M. Usaid
M. Usaid

Reputation: 70

How to generate ANTLR recognizer again in Intellij after editing grammar

I have written a grammar to rotate a robot.

grammar RobotController;

//Parser
program: statement+;
statement: rotateStatements;
rotateStatements: ROTATE EOS;

//lexer
ROTATE: 'rotate';
EOS: ';';

Then i created ANTLR recognizer and it worked, It created some Java files with some code. Later on I modified my grammar to

grammar RobotController;

//Parser
program: statement+;
statement: rotateStatements;
rotateStatements: ROTATE (LPAREN direction RPAREN)? EOS;
direction: STRING;

//lexer
ROTATE: 'rotate';
LPAREN: '(';
RPAREN: ')';
EOS: ';';
STRING:  '"' (~[\r\n])* '"';

Now I am creating ANTLR recognizer again but the previously generated Java files remain the same in the system. No new code is added to them.

Does anyone know how to generate ANTLR recognizer after modifying the grammar?

Upvotes: 0

Views: 305

Answers (1)

M. Usaid
M. Usaid

Reputation: 70

INFO: Restarting Intellij and invalidating cache solved the problem

Upvotes: 1

Related Questions