Open Roise-yue opened 11 months ago
Copy the files from python/python3/Python3/ to python/python3/, run python transformGrammar.py
to modify the .g4's, run `antlr4 -Dlanguage=Python3 .g4to generate the Python3 source code for the parser, then you can run the parser (though I don't know what driver you have in place). The
atStartOfInput()` function is defined in the file python/python3/Python3/Python3LexerBase.py.
I'm reading a python file processed by python3 grammar in "grammars-v4",and as my code is written in python ,there is an error in this line:“with AlternationContext(self, [1, 0],, [this.atStartOfInput(), 1]) as weights0” The context of this code is as follows: def NEWLINE(self, parent=None): with RuleContext(self, UnlexerRule(name='NEWLINE', parent=parent)) as current: with AlternationContext(self, [1, 0],, [this.atStartOfInput(), 1]) as weights0: choice0 = self._model.choice(current, 0, weights0) if choice0 == 0: self.SPACES(parent=current) elif choice0 == 1: So I want to ask how to use "atStartOfInput" or how to modify thiscode.Thank you .