如何用antlr.jar输出python3目标代码?

How do I output python3 target code with antlr.jar?

我下载了:

antlr-4.7-complete.jar

C:\ANTLR\ 并重命名为 C:\ANTLR\antlr.jar.

我也做了: pip3 install antlr4-python3-runtime.

自下载文档 here 以来,我假设它是用于编码的,比如:

All users should download the ANTLR tool itself and then choose a runtime target below, unless you are using Java which is built into the tool jar.

看起来我拥有所有需要的工具。但是正在做:

cd C:\ANTLR
java -jar antlr.jar arithmetic.g4

输出Java代码!

如何使其输出或将输出转换为 Python3 代码?

谢谢。

请不要告诉我这不是编程问题。没有其他地方可以回答这个问题。

K,回答了我自己的问题:

来自here

antlr4 -Dlanguage=Python3 MyGrammar.g4

所以我想我会做类似的事情:

java -jar antlr.jar -Dlanguage=Python3 arithmetic.g4