1import antlr3 2import testbase 3import unittest 4 5class t013parser(testbase.ANTLRTest): 6 def setUp(self): 7 self.compileGrammar() 8 9 10 def testValid(self): 11 cStream = antlr3.StringStream('foobar') 12 lexer = self.getLexer(cStream) 13 tStream = antlr3.CommonTokenStream(lexer) 14 parser = self.getParser(tStream) 15 parser.document() 16 17 assert parser.events == ['before', 'after'] 18 19 20if __name__ == '__main__': 21 unittest.main() 22