Home > Software design >  How to generate the python files using antlr v4 plugin in IntelliJ?
How to generate the python files using antlr v4 plugin in IntelliJ?

Time:01-22

when clicking on "generate ANTLR recognizer" its only generating the java files and I'm not able to find how to generate python files instead of java files.

CodePudding user response:

Add a language=...; to the options { ... } of your grammar:

grammar Test;

options {
  language=Python3;
}

parse
 : ANY*? EOF
 ;

ANY
 : .
 ;

Or right click the grammar and choose the option Configure ANTLR..., and then set the language property in there.

  •  Tags:  
  • Related