annotate Implab/Automaton/RegularExpressions/StarToken.cs @ 244:eee3e49dd1ff v3

working on promises
author cin
date Thu, 25 Jan 2018 19:09:16 +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 Implab;
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
2 using System;
177
a0ff6a0e9c44 refactoring
cin
parents: 162
diff changeset
3
162
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
4
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
5 namespace Implab.Automaton.RegularExpressions {
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
6 /// <summary>
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
7 /// Замыкание выражения с 0 и более повторов.
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
8 /// </summary>
177
a0ff6a0e9c44 refactoring
cin
parents: 162
diff changeset
9 public class StarToken: Token {
162
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
10
177
a0ff6a0e9c44 refactoring
cin
parents: 162
diff changeset
11 Token m_token;
162
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
12
177
a0ff6a0e9c44 refactoring
cin
parents: 162
diff changeset
13 public Token Token {
162
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
14 get { return m_token; }
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
15 }
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
16
177
a0ff6a0e9c44 refactoring
cin
parents: 162
diff changeset
17 public StarToken(Token token) {
162
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
18 Safe.ArgumentNotNull(token, "token");
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
19 m_token = token;
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
20 }
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
21
177
a0ff6a0e9c44 refactoring
cin
parents: 162
diff changeset
22 public override void Accept(IVisitor visitor) {
162
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
23 Safe.ArgumentNotNull(visitor, "visitor");
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
24 visitor.Visit(this);
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
25 }
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
26
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
27 public override string ToString() {
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
28 return String.Format("({0})*", Token);
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
29 }
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
30 }
0526412bbb26 DFA refactoring
cin
parents:
diff changeset
31 }