예제 #1
0
        public override InterpBase VisitAssignStatement([NotNull] TesterParser.AssignStatementContext context)
        {
            string     id    = context.Identifier().GetText();
            InterpBase value = context.expr().Accept(this);

            return(new InterpAssignment(id, value));
        }
예제 #2
0
        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));
        }