162
|
1 using Implab;
|
|
2 using System;
|
177
|
3
|
162
|
4
|
|
5 namespace Implab.Automaton.RegularExpressions {
|
|
6 /// <summary>
|
|
7 /// Замыкание выражения с 0 и более повторов.
|
|
8 /// </summary>
|
177
|
9 public class StarToken: Token {
|
162
|
10
|
177
|
11 Token m_token;
|
162
|
12
|
177
|
13 public Token Token {
|
162
|
14 get { return m_token; }
|
|
15 }
|
|
16
|
177
|
17 public StarToken(Token token) {
|
162
|
18 Safe.ArgumentNotNull(token, "token");
|
|
19 m_token = token;
|
|
20 }
|
|
21
|
177
|
22 public override void Accept(IVisitor visitor) {
|
162
|
23 Safe.ArgumentNotNull(visitor, "visitor");
|
|
24 visitor.Visit(this);
|
|
25 }
|
|
26
|
|
27 public override string ToString() {
|
|
28 return String.Format("({0})*", Token);
|
|
29 }
|
|
30 }
|
|
31 }
|