Пример #1
0
 public void Visit(ASTree t, IEnvironment env)
 {
     if (debug)
     {
         System.Console.WriteLine("ASTree: " + t.GetType().ToString());
     }
     result = new ErrorValue("cannot eval: [ASTree]");
     return;
 }
Пример #2
0
 public void Parse(Lexer lexer, List <ASTree> res)
 {
     while (parser.Match(lexer))
     {
         ASTree tree = parser.Parse(lexer);
         if (tree.GetType() != typeof(ASTList) || tree.NumChildren() > 0)
         {
             res.Add(tree);
         }
         if (onlyOnce)
         {
             break;
         }
     }
 }
Пример #3
0
 public override void Parse(ILexer lexer, List <ASTree> res)
 {
     while (parser.Match(lexer))
     {
         ASTree t = parser.parse(lexer);
         if (t.GetType() != typeof(ASTList) || t.NumChildern > 0)
         {
             res.Add(t);
         }
         if (onlyOnce)
         {
             break;
         }
     }
 }