annotate Implab/Automaton/RegularExpressions/AltToken.cs @ 209:a867536c68fc v2

Bound promise to CancellationToken Added new states to ExecutionSate enum. Added Safe.Guard() method to handle cleanup of the result of the promise
author cin
date Wed, 16 Nov 2016 03:06:08 +0300
parents a0ff6a0e9c44
children
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 {
177
a0ff6a0e9c44 refactoring
cin
parents: 162
diff changeset
4 public class AltToken: BinaryToken {
a0ff6a0e9c44 refactoring
cin
parents: 162
diff changeset
5 public AltToken(Token left, Token right)
162
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
177
a0ff6a0e9c44 refactoring
cin
parents: 162
diff changeset
9 public override void Accept(IVisitor visitor) {
162
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() {
177
a0ff6a0e9c44 refactoring
cin
parents: 162
diff changeset
14 return String.Format(Right is BinaryToken ? "{0}|({1})" : "{0}|{1}", Left, Right);
162
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
15 }
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
16 }
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
17 }