1324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruverimport antlr3
2324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruverimport testbase
3324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruverimport unittest
4324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
5324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruverclass t013parser(testbase.ANTLRTest):
6324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver    def setUp(self):
7324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver        self.compileGrammar()
8324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
9324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
10324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver    def testValid(self):
11324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver        cStream = antlr3.StringStream('foobar')
12324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver        lexer = self.getLexer(cStream)
13324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver        tStream = antlr3.CommonTokenStream(lexer)
14324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver        parser = self.getParser(tStream)
15324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver        parser.document()
16324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
17324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver        assert parser.events == ['before', 'after']
18324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
19324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver
20324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruverif __name__ == '__main__':
21324c4644fee44b9898524c09511bd33c3f12e2dfBen Gruver    unittest.main()
22