55
|
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.Parsing {
|
|
9 public class CatToken : BinaryToken {
|
|
10 public CatToken(Token left, Token right)
|
|
11 : base(left, right) {
|
|
12 }
|
|
13
|
|
14 public override void Accept(IVisitor visitor) {
|
|
15 Safe.ArgumentNotNull(visitor, "visitor");
|
|
16 visitor.Visit(this);
|
|
17 }
|
|
18
|
|
19 public override string ToString() {
|
|
20 return String.Format("{0}{1}", FormatToken(Left), FormatToken(Right));
|
|
21 }
|
|
22
|
|
23 string FormatToken(Token token) {
|
|
24 return String.Format(token is AltToken ? "({0})" : "{0}", token);
|
|
25 }
|
|
26 }
|
|
27 }
|