0
votes

I want to run an ANTLR jar from the command line to run a parser, as described at the bottom of http://www.antlr.org/wiki/pages/viewpage.action?pageId=729, where it says,

What if I want to test my parser without generating code? Easy. Just run ANTLR in interpreter mode. It can't execute your actions, but it can create a parse tree from your input to show you how it would be matched. Use the org.antlr.tool.Interp main class. In the following, I interpret simplec.g on t.c, which contains "int x;"

and follows that with

$ java org.antlr.tool.Interp simplec.g WS program t.c

Which jar do I download, and where can i get it? I tried antlr-3.4-complete.jar, but the output suggests that that may be only the parser generator.

Thanks.

2

2 Answers

0
votes

Which jar do I download

The sentence following the command says this:

"In above command, we are considering ANTLR3 jar lies in your classpath."

where ANTLR3 jar presumably means the antlr-3.1.2.jar file mentioned earlier in the page.

... and where can i get it?

The ANTLR FAQ answers this one:

0
votes

I just started using ANTLR and found developing in it and java was quick and straightforward in Eclipse with the ANTLR IDE plug-in. This will give you an idea of what that process is like: Testing ANTLR Grammar.