Beispiel #1
0
 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()));
 }
Beispiel #2
0
 /// <summary>
 /// Exit a parse tree produced by <see cref="HelloParser.propertyCall"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitPropertyCall([NotNull] HelloParser.PropertyCallContext context)
 {
 }
Beispiel #3
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="HelloParser.propertyCall"/>.
 /// <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 VisitPropertyCall([NotNull] HelloParser.PropertyCallContext context)
 {
     return(VisitChildren(context));
 }