public override int VisitIf([NotNull] GrammarParser.IfContext context) { Visit(context.condition()); int ifAddress = instructionCount; AddJMC(0); Visit(context.blok()); ChangeJMC(ifAddress, instructionCount + 1); return(10); }
/// <summary> /// Exit a parse tree produced by <see cref="GrammarParser.if"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitIf([NotNull] GrammarParser.IfContext context) { }
/// <summary> /// Visit a parse tree produced by <see cref="GrammarParser.if"/>. /// <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 VisitIf([NotNull] GrammarParser.IfContext context) { return(VisitChildren(context)); }