Antlr4: No results for Hello.g4 on Windows

Created on 5 Mar 2013  Â·  7Comments  Â·  Source: antlr/antlr4

Just running through the basics here.

java org.antlr.v4.runtime.misc.TestRig Hello r -tree

The system just hangs. It's not eating CPU, it's memory usage is stable. It never crashes, it simply just does not return any output or close. Tried against java 1.6 and java 1.7.

java org.antlr.v4.runtime.misc.TestRig Hello r -gui

produces the same results

Most helpful comment

Happy to have found this exchange since I just had the exact same problem. Tutorial should clarify what is user input and what is not.
Not even sorry for the necro to be honest.

All 7 comments

It probably expects you to input something to parse. After you executed java org.antlr.v4.runtime.misc.TestRig Hello r -tree, just enter some text on your console and press return. After that, press CTRL+Z (CTRL+D on *nix) to terminate the input and let the parser generated by Hello.g4 parse your input text.

google keyword "standard input"

On Mon, Mar 4, 2013 at 10:38 PM, Steve [email protected] wrote:

Just running through the basics here.

java org.antlr.v4.runtime.misc.TestRig Hello r -tree

The system just hangs. It's not eating CPU, it's memory usage is stable.
It never crashes, it simply just does not return any output or close. Tried
against java 1.6 and java 1.7.

java org.antlr.v4.runtime.misc.TestRig Hello r -gui

produces the same results

—
Reply to this email directly or view it on GitHubhttps://github.com/antlr/antlr4/issues/179
.

Dictation in use. Please excuse homophones, malapropism, and nonsense.

D'oh! I misunderstood the instructions. I took a look again and there really should be a note there showing where user input ends and output begins.

Something like:

$grun Hello r -tree

Then enter:

hello parrt
^D (or ^Z on windows)

You should see

(r hello parrt)

Also - run.bat earlier in the page should be relabeled grun.bat so that it matches the instructions.

I can understand why there's no prompt for user input now that I've had a day to gain an understanding of antlr, but since that is the case the getting started sample should be as clear as possible.

Happy to have found this exchange since I just had the exact same problem. Tutorial should clarify what is user input and what is not.
Not even sorry for the necro to be honest.

yeah - I couldn't understand why nothing was happening. Obviously there had to be some text for it to parse. But I was just trying to make sure everything was installed and didn't really think it through. Instructions could have been clearer about what to expect...

This is a generational issue. Old people like me are used to stdin and command line. Please help out by updating doc for common programmers and submit a PR :)

Thanks - I should do that... Antlr is a great tool. I have been using 2.74 for a very long time and finally decided to move to the latest version for a new project that is about to start. Should probably have gone straight to using it within Eclipse... I'm better at configuring stuff there :)

Was this page helpful?
0 / 5 - 0 ratings