Ejemplo n.º 1
0
        public override void ExitSmaller(lisp_gammarParser.SmallerContext context)
        {
            if (!_FuncExp)
            {
                if (!_IfExp)
                {
                    int a = 0, b = 0;
                    if (int.TryParse(context.GetChild(2).GetText(), out a))
                    {
                        a = Convert.ToInt32(context.GetChild(2).GetText());
                    }
                    else
                    {
                        ParsingMessage.ErrorCode(4, context);
                    }
                    if (int.TryParse(context.GetChild(3).GetText(), out b))
                    {
                        b = Convert.ToInt32(context.GetChild(3).GetText());
                    }
                    else
                    {
                        ParsingMessage.ErrorCode(4, context);
                    }

                    ClearCtx(context);
                    AddCtx(context, (a < b) ? "#t" : "#f");
                }
            }
            base.ExitSmaller(context);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Exit a parse tree produced by <see cref="lisp_gammarParser.smaller"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitSmaller([NotNull] lisp_gammarParser.SmallerContext context)
 {
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="lisp_gammarParser.smaller"/>.
 /// <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 VisitSmaller([NotNull] lisp_gammarParser.SmallerContext context)
 {
     return(VisitChildren(context));
 }