Exemple #1
0
        public override Value VisitParExpr(calculatorParser.ParExprContext context)
        {
            Value left  = Visit(context.expr(0));
            Value right = Visit(context.expr(1));

            return(new Value(left.asDouble() + right.asDouble()));
        }
 /// <summary>
 /// Visit a parse tree produced by <see cref="calculatorParser.parExpr"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitParExpr([NotNull] calculatorParser.ParExprContext context)
 {
     return(VisitChildren(context));
 }
Exemple #3
0
 /// <summary>
 /// Exit a parse tree produced by <see cref="calculatorParser.parExpr"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitParExpr([NotNull] calculatorParser.ParExprContext context)
 {
 }
Exemple #4
0
 public override Value VisitParExpr(calculatorParser.ParExprContext context)
 {
     return(Visit(context.expr()));
 }