Esempio n. 1
0
        public static AstNode Parse(List <Token> lexerTokens)
        {
            // remove all comments and whitespace
            var tokens = lexerTokens.Where(lt => !(lt is CommentToken) &&
                                           !(lt is WhitespaceToken)).ToList();

            var stream  = new ParserStream(tokens);
            var program = MofSpecificationAst.Parse(stream);

            return(program);
        }
Esempio n. 2
0
        public static MofSpecificationAst Parse(List <Token> lexerTokens, ParserQuirks quirks = ParserQuirks.None)
        {
            // remove all comments and whitespace
            var tokens = lexerTokens.Where(lt => !(lt is CommentToken) &&
                                           !(lt is WhitespaceToken)).ToList();

            var stream  = new ParserStream(tokens);
            var program = ParserEngine.ParseMofSpecificationAst(stream, quirks);

            return(program);
        }