/// <summary>
 /// Visit a parse tree produced by the <c>Calculate</c>
 /// labeled alternative in <see cref="CalculatorParser.input"/>.
 /// <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 VisitCalculate([NotNull] CalculatorParser.CalculateContext context)
 {
     return(VisitChildren(context));
 }
 public override Double VisitCalculate(CalculatorParser.CalculateContext ctx)
 {
     return(Visit(ctx.plusOrMinus()));
 }
Beispiel #3
0
 /// <summary>
 /// Vista el nodo correspondiente a una ecuación
 /// </summary>
 /// <param name="context">Variable de contexto</param>
 /// <returns>Devuelve el resultado de la ecuación tras la visita al nodo hijo</returns>
 public override double VisitCalculate(CalculatorParser.CalculateContext context)
 {
     return(Visit(context.plusOrMinus()));
 }