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); }