示例#1
0
        protected AstNode GetAstNodesFromInput(string input)
        {
            var charStream = new AntlrInputStream(input);
            var lexer      = new QlsGrammarLexer(charStream);
            var parser     = new QlsGrammarParser(new CommonTokenStream(lexer));
            var visitor    = new AstCreator();

            return(visitor.Visit(parser.stylesheet()));
        }
示例#2
0
        public StyleSheet BuildAst()
        {
            var dataStream = new AntlrInputStream(this.InputData);
            var lexer      = new QlsGrammarLexer(dataStream);
            var parser     = new QlsGrammarParser(new CommonTokenStream(lexer));
            var visitor    = new AstCreator();
            var astTree    = visitor.Visit(parser.stylesheet());

            Console.WriteLine("Ql AST building done!");

            return(astTree.As <StyleSheet>());
        }