public override void ExitGreater(lisp_gammarParser.GreaterContext 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.ExitGreater(context); }
/// <summary> /// Exit a parse tree produced by <see cref="lisp_gammarParser.greater"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitGreater([NotNull] lisp_gammarParser.GreaterContext context) { }
/// <summary> /// Visit a parse tree produced by <see cref="lisp_gammarParser.greater"/>. /// <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 VisitGreater([NotNull] lisp_gammarParser.GreaterContext context) { return(VisitChildren(context)); }