Exemplo n.º 1
0
        public Ast Parse(DetailLogger log, TokenList tokens, string fileName)
        {
            var state = new ParserState(log, tokens, fileName);

            var ast = new Ast();
            // TODO(kai): actually run a parser loop.
            while (true)
            {
                //Console.WriteLine("Attempting to parse");
                var node = state.ParseTopLevel();
                if (node == null)
                    break;
                ast.children.Add(node);
            }

            return ast;
        }
Exemplo n.º 2
0
 public ParserState(DetailLogger log, TokenList tokens, string fileName)
 {
     this.log = log;
     this.tokens = tokens;
     this.fileName = fileName;
 }