[antlr-interest] Debugging doesn't work with grammar

Johannes Luber jaluber at gmx.de
Fri Jul 6 06:34:28 PDT 2007


Thomas Brandon wrote:
> On 7/6/07, Johannes Luber <jaluber at gmx.de> wrote:
>> Hi!
>>
> Without the input you used I can't be sure, but it looks like a
> problem with non-matched "s in actions. To avoid non-LL* issues the
> grammar uses a fixed lookahead in the NESTED_ACTION rule, so upon
> seeing a " it decides it must be an ACTION_STRING_LITERAL, if there is
> no closing " it will swallow input until the end of the file. Looks
> like it's not finding that matching " for some reason.

I don't want post the grammar with the ACTION_STRING_LITERAL problem
here. If you need it I can send it off-list. I've attached my other test
grammar, though.

>> Testing a Java version of the file with the same input as for the
>> exception results, that the remote debugger doesn't connect with parser
>> (mind you, I've used the normal debug menu here).
> I was able to debug the attached grammar so not sure what's going on
> there. Did you get any errors in the console? Is the code generated
> correctly? Did you try remote debugging? Are you able to debug other
> grammars?

I didn't get any errors in the console. While looking again to be sure
that I haven't overlooked them, I somehow managed to start debugging of
the Java version. Not sure why it didn't work yesterday. But the
attached grammar isn't still recognized correctly. I end with "root ->
action -> MismatchedTokenException" and an entirely red input pane. What
goes wrong here?

Regarding remote debugging: I tried it with the C# version wihtout much
success, but not with the Java version, as I don't have parser for that.
I've tested Java.g with the same result as with the attached grammar.
But using the debug option caused it to be truncated. My non-attached
grammar was also truncated, but resulted in a different parse:

" 		-> MismatchedTokenException
 root -> action -> actionScopeName -> parser
		-> MismatchedTokenException"

Looking at this I'm not sure if the culprit is the syntactic predicate
code, as you suggested.

Best regards,
Johannes Luber

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: BackslashBugTest.g
Url: http://www.antlr.org/pipermail/antlr-interest/attachments/20070706/bede7b3d/attachment.pl 


More information about the antlr-interest mailing list