4

When i run the interpreter as follows,

Running method

to create parse tree in ANTLR 3.4(in eclipse 3.7) it shows,

Error message

An internal error occurred during: "ANTLR Event Listener". For input string: "false"

When I run the second option Debug(Java) it doesn't give any error nor parse tree.

How can I resolve this?

Thanks

Vinayak Garg
  • 6,518
  • 10
  • 53
  • 80
DarRay
  • 2,550
  • 6
  • 27
  • 39
  • I am facing exactly same problem. i.e On running, the "error" comes up. Strangely, clicking on save, makes the parse tree correctly. If you have sorted out the problem, please share it here. – Vinayak Garg Apr 02 '12 at 13:02

3 Answers3

3

By not using the interpreter.

No, it's not joke :). AFAIK, antlrv3ide uses the interpreter- and debug-components from ANTLRWorks. And ANTLRWorks' interpreter is rather buggy. However, its debugger works like a charm: so use that.

Bart Kiers
  • 166,582
  • 36
  • 299
  • 288
  • I tried the debug also. But it wont display any errors nor the parse tree. But the tester wrote for the grammar showing a error. – DarRay Mar 03 '12 at 04:30
  • @DarRay, sorry, I don't know what 'a error' is. There's too little information to (try to) help you. Consider posting the grammar, the test input, and explaining how you'r invoking the interpreter. – Bart Kiers Mar 03 '12 at 06:37
  • This interpreter error gives me even in a new project. Seems like it wont depend on the grammar. Without the parse tree are there any way to debug the code find the errors? – DarRay Mar 03 '12 at 07:37
  • Please can u tell me how to use the debugger. I have updated the question also. Thanks. – DarRay Mar 03 '12 at 07:39
  • @DarRay, from your screenshot, the `Run` probably launches the interpreter, and `Debug` probably the debugger. I've never used *antlrv3ide* myself though. So again: do *not* use the interpreter! – Bart Kiers Mar 03 '12 at 07:55
  • Those both options are in interpreter section in anltride, are you using antlrworks. Im looking forward to move to it. Thanks – DarRay Mar 03 '12 at 08:11
  • 1
    Yes, ANTLRWorks' debugger is great: I use it a lot (press CTRL+D in ANTLRWorks). – Bart Kiers Mar 03 '12 at 08:23
  • In the ANTLRWorks when i run the debug, it says `Connection Error` `Cannot launch the debugger tab. Time-out waiting to connect to the remote parser.` BTW thanks a lot for your help – DarRay Mar 03 '12 at 09:56
2

I had this problem when I was using antlr-3.4-complete.jar , but I changed it to antlr-3.2.jar and even if it gives me FailedPredicateExeption I still able to run it with java in the interpreter and create the grammar tree in the interpreter . download antlr jar :antlr-3.2.jar

bla
  • 21
  • 3
-1

refer bla said, my here, change from antlr-3.5-complete.jar to antlr-3.3-complete.jar, then fix this problem.

for detail, can refer An internal error occurred during: "ANTLR Event Listener". For input string: "false"

crifan
  • 12,947
  • 1
  • 71
  • 56