ANTLR 4 RuntimeMetaData and Vocabulary
Asked Answered
F

1

6

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.

Frankforter answered 29/1, 2016 at 11:0 Comment(0)
M
2

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.

Mead answered 18/2, 2016 at 9:56 Comment(1)
Thanks! I figured it out in the end and forgot to post back. If you're using Antlr on IntelliJ everyone needs to remember to install the latest jar from Antlr, install the latest plugin directly through IntelliJ (it didn't work installing it myself) and to mark the gen directory as source generated! Hope that helps someone!Frankforter

© 2022 - 2024 — McMap. All rights reserved.