public void Visit(StringValueExpr node) { TypeStack.Push ("String"); VisitChildren (node); }
public void Visit(StringValueExpr node) { ValueStack.Push (new StackValue("String", node.Name)); VisitChildren (node); }
private Expression Value() { switch ((Token.Types)currentToken.Type) { case Token.Types.IntLiteral: { IntValueExpr expr = new IntValueExpr (currentToken.Lexeme, currentToken.Row, currentToken.Column); Match (Token.Types.IntLiteral); return expr; } case Token.Types.StringLiteral: { StringValueExpr expr = new StringValueExpr (currentToken.Lexeme, currentToken.Row, currentToken.Column); Match (Token.Types.StringLiteral); return expr; } case Token.Types.BoolLiteral: { BoolValueExpr expr = new BoolValueExpr (currentToken.Lexeme, currentToken.Row, currentToken.Column); Match (Token.Types.BoolLiteral); return expr; } case Token.Types.Identifier: { IdentifierValueExpr expr = new IdentifierValueExpr (currentToken.Lexeme, currentToken.Row, currentToken.Column); Match (Token.Types.Identifier); return expr; } default: { throw new SyntaxError ("invalid type " + currentToken.Type, currentToken.Row, currentToken.Column); } } }