Exemplo n.º 1
0
 public override Expression VisitConstant_expression([NotNull] calculatorParser.Constant_expressionContext context)
 {
     if (context.children != null)
     {
         foreach (IParseTree c in context.children)
         {
             Visit(c);
         }
     }
     if (_completeness.Results[context])
     {
         Expression lhs = Results[context.GetChild(0)];
         Results[context] = lhs;
         return(lhs);
     }
     Results[context] = null;
     return(null);
 }
Exemplo n.º 2
0
 public override bool VisitConstant_expression([NotNull] calculatorParser.Constant_expressionContext context)
 {
     if (context.children != null)
     {
         foreach (var c in context.children)
         {
             if (!Visit(c))
             {
                 Results[context] = false;
                 return(false);
             }
         }
     }
     if (context.ChildCount == 1)
     {
         bool lhs = Results[context.GetChild(0)];
         Results[context] = lhs;
         return(lhs);
     }
     {
         Results[context] = false;
         return(false);
     }
 }