ASTNode PRINT() { var node = new PrintNode(); node.lexeme = Consume("print", TokenType.KEYWORD); node.printedValue = EXPR(); return(node); }
public void VisitPrint(PrintNode prn) { int temp = this.depth; string spaces = IncreaseDepth(); this.io.WriteLine($"{spaces}Print: ("); prn.Expression.Visit(this); this.io.WriteLine($"{spaces})"); this.depth = temp; }
public void VisitPrint(PrintNode prn) { UnaryOperandNode expr = prn.Expression.Visit(this); this.io.WriteLine(expr.Value); }