dGayand
dGayand

Reputation: 721

ANTLR cannot generate java code as of version 4.7.2

I have installed the ANTLR IntelijIdea plugin latest version 4.7.2 and tried to generate the java code for the grammar. (Right-click on the Grammer file and execute "Generate ANTRL Recognizer)

However, I get below error.

2019-05-13 10:51:08: antlr4 -o E:\Work\FE\CGUI\mitscript4j\src\main\java\gen.antlr -Dlanguage=java -listener -visitor -lib E:/Work/FE/CGUI/mitscript4j/src/main/antlr4 E:/Work/FE/CGUI/mitscript4j/src/main/antlr4\MITS.g4
error(31):  ANTLR cannot generate java code as of version 4.7.2

Below is my grammar

grammar MITS;
main: 'Hello ' name '!';
name: ANY+;
ANY: .;

Can anyone tell where is the problem?

Upvotes: 3

Views: 1476

Answers (1)

dGayand
dGayand

Reputation: 721

I found the answer

In the "Configure ANTLR" window I have mistakenly specified the language as "java". The problem resolved after renaming to "Java"

Upvotes: 3

Related Questions