public override double VisitPropertyCall([NotNull] HelloParser.PropertyCallContext context) { if (context.propertyCallParameters() != null) { Dictionary <string, string> stack = new Dictionary <string, string>(); List <string> names = funcs[context.pathName().GetText()].param; HelloParser.ExpressionContext contextFunc = funcs[context.pathName().GetText()].context; for (int i = 0; i < names.Count; i++) { stack[names[i]] = VisitExpression(context.propertyCallParameters().actualParameterList().expression()[i]).ToString(); } vars.Add(stack); double res = VisitExpression(contextFunc); vars.RemoveAt(vars.Count - 1); return(res); } return(VisitPathName(context.pathName())); }
/// <summary> /// Exit a parse tree produced by <see cref="HelloParser.expression"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitExpression([NotNull] HelloParser.ExpressionContext context) { }
/// <summary> /// Visit a parse tree produced by <see cref="HelloParser.expression"/>. /// <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 VisitExpression([NotNull] HelloParser.ExpressionContext context) { return(VisitChildren(context)); }