atif rahman
atif rahman

Reputation: 15

How to generate the python files using antlr v4 plugin in IntelliJ?

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.

Upvotes: 0

Views: 218

Answers (1)

Bart Kiers
Bart Kiers

Reputation: 170158

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.

Upvotes: 2

Related Questions