1import antlr3 2import testbase 3import unittest 4 5 6class t033backtracking(testbase.ANTLRTest): 7 def setUp(self): 8 self.compileGrammar() 9 10 11 def parserClass(self, base): 12 class TParser(base): 13 def recover(self, input, re): 14 # no error recovery yet, just crash! 15 raise 16 17 return TParser 18 19 20 @testbase.broken("Some bug in the tool", SyntaxError) 21 def testValid1(self): 22 cStream = antlr3.StringStream('int a;') 23 24 lexer = self.getLexer(cStream) 25 tStream = antlr3.CommonTokenStream(lexer) 26 parser = self.getParser(tStream) 27 events = parser.translation_unit() 28 29 30if __name__ == '__main__': 31 unittest.main() 32