comparison Implab/Parsing/CatToken.cs @ 55:c0bf853aa04f

Added initial JSON support +JSONParser +JSONWriter
author cin
date Sun, 15 Jun 2014 19:39:11 +0400
parents
children 97fbbf816844
comparison
equal deleted inserted replaced
51:2c332a9c64c0 55:c0bf853aa04f
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 }