1import antlr3 2import testbase 3import unittest 4 5 6class t027eof(testbase.ANTLRTest): 7 def setUp(self): 8 self.compileGrammar() 9 10 11 @testbase.broken("That's not how EOF is supposed to be used", Exception) 12 def testValid1(self): 13 cStream = antlr3.StringStream(' ') 14 lexer = self.getLexer(cStream) 15 16 tok = lexer.nextToken() 17 assert tok.type == self.lexerModule.SPACE, tok 18 19 tok = lexer.nextToken() 20 assert tok.type == self.lexerModule.END, tok 21 22 23if __name__ == '__main__': 24 unittest.main() 25 26