I am trying to display a GUI of a tree I have parsed in from a pascal program using ANTLR v4. I have used this import to get access to the TV package: import org.antlr.v4.runtime.tree.gui.TreeViewer;
However whenever I try to compile my java program using ANTLR is says that the package org.antlr.v4.runtime.tree.gui. doesn't exist and that it cannot find the symbol for TreeViewer.
Any ideas on why it might be doing this and am I missing something from my imports? I am defining this TreeViewer in java with:
TreeViewer viewr = new TreeViewer(Arrays.asList(
parser.getRuleNames()), tree);
Running a grammar requires antlr4-runtime package
using maven :
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.7</version>
</dependency>
Gui tools like TreeViewer requires antlr4 package
using maven :
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4</artifactId>
<version>4.7</version>
</dependency>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With