antlr / grammars-v4

Grammars written for ANTLR v4; expectation that the grammars are free of actions.
MIT License
10.18k stars 3.71k forks source link

generated grammer-buggy python files. #3406

Open lenijwp opened 1 year ago

lenijwp commented 1 year ago

I run "java -cp "antlr-4.12.0-complete.jar" org.antlr.v4.Tool -Dlanguage=Python3 ECMAScript.g4 ", but the generated 'ECMAScriptLexer.py' is grammerly wrong. Such as 'ECMAScriptLexer.prototype.strictMode = true; ECMAScriptLexer.prototype.lastToken = null;' in python.

kaby76 commented 1 year ago

Only three targets work for the grammar, see desc.xml. The Python3 target directory isn't correctly named, either, named Python rather than Python3 or Python2, the proper names for the supported targets. And, the grammar shouldn't be forked. Much work to do to fix.