public void Visit(BoolValueExpr node)
 {
     TypeStack.Push ("Bool");
     VisitChildren (node);
 }
 public void Visit(BoolValueExpr node)
 {
     ValueStack.Push (new StackValue("Bool", node.Name));
     VisitChildren (node);
 }
Пример #3
0
 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);
             }
     }
 }