public override InterpBase VisitAssignStatement([NotNull] TesterParser.AssignStatementContext context) { string id = context.Identifier().GetText(); InterpBase value = context.expr().Accept(this); return(new InterpAssignment(id, value)); }
public override string VisitAssignStatement([NotNull] TesterParser.AssignStatementContext context) { IndentLevel += 2; var expr = context.expr().Accept(this); IndentLevel -= 2; IndentLevel++; var id = Indent() + "Identifier: " + context.Identifier().GetText(); var exprText = Indent() + "Expression: "; IndentLevel--; return(string.Join(Environment.NewLine, Indent() + "AssignStatement: ", id, exprText, expr)); }