Beispiel #1
0
        public override Value VisitIs_error(calculatorParser.Is_errorContext context)
        {
            Value ret = Visit(context.expr());

            if (ret.isDouble())
            {
                return(new Value(false)); //value is double and so not an error
            }
            else
            {
                return(new Value(true)); //value is
            }
        }
Beispiel #2
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="calculatorParser.is_error"/>.
 /// <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 VisitIs_error([NotNull] calculatorParser.Is_errorContext context)
 {
     return(VisitChildren(context));
 }
Beispiel #3
0
 /// <summary>
 /// Exit a parse tree produced by <see cref="calculatorParser.is_error"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitIs_error([NotNull] calculatorParser.Is_errorContext context)
 {
 }