Exemplo n.º 1
0
Arquivo: Tiny.cs Projeto: RoyGI/code
        /// <summary>
        ///     Trees the specified code.
        /// </summary>
        /// <param name="code">The code.</param>
        /// <returns>the parser.</returns>
        public TinyParser.UnitContext Tree(string code)
        {
            var stream = new AntlrInputStream(code);
            var lexer  = new TinyLexer(stream);

            lexer.AddErrorListener(this.errors);
            var token  = new CommonTokenStream(lexer);
            var parser = new TinyParser(token);

            parser.AddErrorListener(this.errors);
            return(parser.unit());
        }