Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ANTLR 4 RuntimeMetaData and Vocabulary

I am using the ANTLR4 IntelliJ plug-in, and I am using a the Antlr-4.5.1 Jar.

When I Generate Antlr Recognizer in Lexer and Parser can't resolve symbols RuntimeMetaData and Vocabulary.

If I use the command line to compile and run my .g4 file it works fine but gives errors in IntelliJ.

I can swap in the command line compiled Lexer and Parser Java files for the error ones and it runs fine.

I'm on Mac OS X 10.11 using IntelliJ 15.

like image 768
DonnellyOverflow Avatar asked Jan 29 '16 11:01

DonnellyOverflow


People also ask

What is ANTLR v4?

ANTLR v4 is a powerful tool used for building new programming languages and processing/translating structured text or binary files. ANTLR uses a grammar you create to generate a parser which can build and traverse a parse tree (or abstract syntax tree, AST).

What is an ANTLR grammar?

ANTLR (ANother Tool for Language Recognition) is a tool for processing structured text. It does this by giving us access to language processing primitives like lexers, grammars, and parsers as well as the runtime to process text against them. It's often used to build tools and frameworks.

What kind of parser is ANTLR?

What is ANTLR? ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files. Terence Parr is a tech lead at Google and until 2022 was a professor of data science / computer science at Univ.

What is the latest version of ANTLR?

The latest version of ANTLR is 4.10. 1, released April 15, 2022.


1 Answers

You might have an older antlr4-runtime-x.y.z.jar on your compile classpath. I had the same issue when upgrading the antlr4-maven-plugin to 4.5.1, but forgetting to do the same for the antlr4-runtime dependency.

like image 94
Bart Robeyns Avatar answered Oct 25 '22 17:10

Bart Robeyns