Mercurial > pub > ImplabNet
annotate Implab/Parsing/CatToken.cs @ 158:130781364799 v2
refactoring, code cleanup
author | cin |
---|---|
date | Thu, 18 Feb 2016 14:34:02 +0300 |
parents | 97fbbf816844 |
children |
rev | line source |
---|---|
156
97fbbf816844
Promises: SignalXXX methods merged into SignalHandler method.
cin
parents:
55
diff
changeset
|
1 using System; |
55 | 2 |
3 namespace Implab.Parsing { | |
4 public class CatToken : BinaryToken { | |
5 public CatToken(Token left, Token right) | |
6 : base(left, right) { | |
7 } | |
8 | |
9 public override void Accept(IVisitor visitor) { | |
10 Safe.ArgumentNotNull(visitor, "visitor"); | |
11 visitor.Visit(this); | |
12 } | |
13 | |
14 public override string ToString() { | |
15 return String.Format("{0}{1}", FormatToken(Left), FormatToken(Right)); | |
16 } | |
17 | |
18 string FormatToken(Token token) { | |
19 return String.Format(token is AltToken ? "({0})" : "{0}", token); | |
20 } | |
21 } | |
22 } |