⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 python.py

📁 antlr最新版本V3源代码
💻 PY
字号:
import sysimport antlr3from PythonLexer import PythonLexerfrom PythonParser import PythonParserfrom PythonTokenSource import PythonTokenSource# override nextToken to set startPos (this seems too hard)class MyLexer(PythonLexer):    def nextToken(self):        self.startPos = self.getCharPositionInLine()        return PythonLexer.nextToken(self)cStream = antlr3.FileStream(sys.argv[1])lexer = MyLexer(cStream)tokens = antlr3.CommonTokenStream(lexer)tokens.discardOffChannelTokens = TrueindentedSource = PythonTokenSource(tokens)tokens = antlr3.CommonTokenStream(indentedSource)parser = PythonParser(tokens)parser.file_input()

⌨️ 快捷键说明

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