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