Пример #1
0
        public override bool VisitSimple_name([NotNull] calculatorParser.Simple_nameContext context)
        {
            if (context.children != null)
            {
                foreach (IParseTree c in context.children)
                {
                    if (!Visit(c))
                    {
                        Results[context] = false;
                        return(false);
                    }
                }
            }
            bool res = true;

            Results[context] = res;
            return(res);
        }
Пример #2
0
 public override Expression VisitSimple_name([NotNull] calculatorParser.Simple_nameContext context)
 {
     if (context.children != null)
     {
         foreach (IParseTree c in context.children)
         {
             Visit(c);
         }
     }
     if (_completeness.Results[context])
     {
         if (context.ChildCount == 1)
         {
             Expression lhs = Results[context.GetChild(0)];
             Results[context] = lhs;
             return(lhs);
         }
     }
     Results[context] = null;
     return(null);
 }