Example #1
0
 public static Expression Create(Token token)
 {
     switch (token.Type)
     {
         case Tokens.SYMBOL: return new SymbolExpression(token);
         case Tokens.INT: return new IntExpression(token);
         case Tokens.STRING: return new StringExpression(token);
         default: return new Expression(token);
     }
 }
Example #2
0
 public Expression(Token token)
 {
     Token = token;
     Elements = new List<Expression>();
 }
Example #3
0
 public StringExpression(Token t)
     : base(t)
 {
     Value = Token.Text.Substring(1, Token.Text.Length - 2);
 }
Example #4
0
 public SymbolExpression(Token token)
     : base(token)
 {
     Value = token.Text;
 }
Example #5
0
 public IntExpression(Token t)
     : base(t)
 {
     Value = Int32.Parse(Token.Text);
 }