• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 import antlr3
2 import testbase
3 import unittest
4 
5 
6 class 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         self.assertEqual(tok.type, self.lexerModule.SPACE, tok)
18 
19         tok = lexer.nextToken()
20         self.assertEqual(tok.type, self.lexerModule.END, tok)
21 
22 
23 if __name__ == '__main__':
24     unittest.main()
25 
26