1import antlr3 2import testbase 3import unittest 4 5 6class t024finally(testbase.ANTLRTest): 7 def setUp(self): 8 self.compileGrammar() 9 10 11 def testValid1(self): 12 cStream = antlr3.StringStream('foobar') 13 lexer = self.getLexer(cStream) 14 tStream = antlr3.CommonTokenStream(lexer) 15 parser = self.getParser(tStream) 16 events = parser.prog() 17 18 self.assertEqual(events, ['catch', 'finally']) 19 20 21if __name__ == '__main__': 22 unittest.main() 23 24