//###################### // FUNCTIONS //###################### public override object VisitFunction(FaParser.FunctionContext context) { string id = context.ID(0).GetText(); int nArgs = context.ID().Length - 1; LinkedList <string> namesParams = new LinkedList <string>(); for (int i = 1; i <= nArgs; i++) { namesParams.AddLast(context.ID(i).GetText()); } MyFunction var = new MyFunction(id, nArgs, namesParams, context.body_return()); queue.Last().Add(id, var); return(null); }
/// <summary> /// Visit a parse tree produced by <see cref="FaParser.function"/>. /// <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 VisitFunction([NotNull] FaParser.FunctionContext context) { return(VisitChildren(context)); }