/// <summary> /// The visit subroutine for integer constants. /// </summary> public override VisitorResult VisitIntVar([NotNull] HaskellmmParser.IntVarContext context) { string s = context.GetText(); int value = int.Parse(s); IntNode node = new IntNode(CreateNodeContext(context), value); AddExprNode(node); // An integer constant has no parents, so find the next node to fill // by traversing the tree upwards currentNode = FindEarliestParentWithUnfilledChildren(currentNode); return(base.VisitIntVar(context)); }
/// <summary> /// Visit a parse tree produced by the <c>intVar</c> /// labeled alternative in <see cref="HaskellmmParser.expr"/>. /// <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 VisitIntVar([NotNull] HaskellmmParser.IntVarContext context) { return(VisitChildren(context)); }
/// <summary> /// Exit a parse tree produced by the <c>intVar</c> /// labeled alternative in <see cref="HaskellmmParser.expr"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitIntVar([NotNull] HaskellmmParser.IntVarContext context) { }