annotate Implab/Automaton/RegularExpressions/AltToken.cs @ 164:ec35731ae299 ref20160224

Almost complete DFA refactoring
author cin
date Thu, 25 Feb 2016 02:11:13 +0300
parents 0526412bbb26
children a0ff6a0e9c44
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
162
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
1 using System;
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
2
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
3 namespace Implab.Automaton.RegularExpressions {
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
4 public class AltToken<TTag>: BinaryToken<TTag> {
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
5 public AltToken(Token<TTag> left, Token<TTag> right)
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
6 : base(left, right) {
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
7 }
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
8
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
9 public override void Accept(IVisitor<TTag> visitor) {
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
10 Safe.ArgumentNotNull(visitor, "visitor");
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
11 visitor.Visit(this);
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
12 }
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
13 public override string ToString() {
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
14 return String.Format(Right is BinaryToken<TTag> ? "{0}|({1})" : "{0}|{1}", Left, Right);
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
15 }
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
16 }
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
17 }