Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

antlr4: ATN version 2 expected 3

Tags:

java

antlr

antlr4

When trying to use a generated grammar and lexer I get:

org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 2 (expected 3).

What's wrong?

like image 954
Darren Pulsipher Avatar asked Aug 12 '13 05:08

Darren Pulsipher


1 Answers

Your parser was generated with ANTLR 4.0, but you are trying to execute it with ANTLR 4.1. The most likely cause of this is using ANTLRWorks 2.0 to generate the parser, which internally uses ANTLR 4.0. I'm in the process of releasing ANTLRWorks 2.1 which will correct this mismatch.

like image 165
Sam Harwell Avatar answered Nov 12 '22 07:11

Sam Harwell