annotate Implab/Automaton/RegularExpressions/StarToken.cs @ 173:ecfece82ca11 ref20160224

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