t019lexer.py

来自「antlr最新版本V3源代码」· Python 代码 · 共 23 行

PY
23
字号
import osimport antlr3import testbaseimport unittestclass t019lexer(testbase.ANTLRTest):    def setUp(self):        self.compileGrammar()            def testValid(self):        inputPath = os.path.splitext(__file__)[0] + '.input'        stream = antlr3.StringStream(open(inputPath).read())        lexer = self.getLexer(stream)        while True:            token = lexer.nextToken()            if token.type == antlr3.EOF:                breakif __name__ == '__main__':    unittest.main()

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?