Beispiel #1
0
 public void TestGrammar()
 {
     String input = "hello zome\r\nhello tezt";
     AntlrInputStream stream = new AntlrInputStream(input);
     ITokenSource lexer = new TagzLexer(stream);
     ITokenStream tokens = new CommonTokenStream(lexer);
     TagzParser parser = new TagzParser(tokens);
     parser.BuildParseTree = true;
     IParseTree tree = parser.r();
     TagzKeyPrinter printer = new TagzKeyPrinter();
     ParseTreeWalker.Default.Walk(printer, tree);
 }
Beispiel #2
0
        public void TestGrammar()
        {
            String           input  = "hello zome\r\nhello tezt";
            AntlrInputStream stream = new AntlrInputStream(input);
            ITokenSource     lexer  = new TagzLexer(stream);
            ITokenStream     tokens = new CommonTokenStream(lexer);
            TagzParser       parser = new TagzParser(tokens);

            parser.BuildParseTree = true;
            IParseTree     tree    = parser.r();
            TagzKeyPrinter printer = new TagzKeyPrinter();

            ParseTreeWalker.Default.Walk(printer, tree);
        }