views:

646

answers:

3

One of my ANTLR grammars running in AntlrWorks throws: “Cannot launch the debugger. Time-out waiting to connect to the remote parser.”

In the past this message usxually goes away but this one is persistent. On searching the ANTLR lists (e.g. http://www.antlr.org/pipermail/antlr-interest/2009-June/034659.html) there are hints that the error message is nothing to do with what it seems but could be a grammar error.

Has anyone got tips as to how to "reboot" or find the bugs in this situation?

+1  A: 

It may or may not relate - but we got rid of the problem as follows:

On a UNIX box it didn't occur. On Windows it did. There were two parser rules that differed by case (e.g. myfoo and myFOO). When they were resolved the error went away.

I updated the ANTLRworks but the error persisted until we "solved" it as above.

peter.murray.rust
+1  A: 

I've found that the Windows firewall rules can really interfere with the debugger, so make sure you haven't set it to block the Java VM.

Also, try waiting a bit and then choosing the "Debug Remote" option, often the debugger just takes a little while and the main process times out, but the debugger does still come up.

hollaburoo
+1 that looks a useful tip - I'll try it.
peter.murray.rust
A: 

I am getting this same thing as a result of an OutOfMemoryError that occurs upon initialization of my Parser. I don't know why this is happening, but I assume I've done something grievously wrong in my grammar!

Mike