[antlr-interest] Bug in AntlrWorks debugger

Dukie Banderjee dukie_banderjee at hotmail.com
Mon Jun 8 13:48:42 PDT 2009


> That could be. it's possible that the tab character means moveto the
> next field
> Ter

No, it was definitely a Tab char in the input box. However, I discovered what the real underlying problem was.

It wasn't actually the Tab char that was the problem, but that my grammar didn't recognize Tab, and so it was causing an infinite loop (I mistakenly used a * quantifier in one of my lexer rules instead of a +). This in turn caused AntlrWorks to think it was failing to connect, when actually the real problem was that the lexer process was stuck in a loop.

Does the debugger perform a complete parse *before* attempting to connect to the process? That would probably explain it. I was expecting the debugger to first connect, and *then* attempt to parse. In that way, I could have debugged the infinite looping. However, all I saw was a mysterious "Failed to connect" message which sent me on a wild goose chase.

FYI here's a sample grammar and input that would cause this usability bug to occur:

grammar Bug;

file       : line+ EOF ;
line       : field+ terminator ;
field      : SEP TEXT? ;
terminator : (NEWLINE | EOF) ;

NEWLINE    : '\r'? '\n' ;
TEXT       : ('a'..'z'|'A'..'Z'|' ')* ; // NOTE: Does not match Tab, and also has a * quantifier
SEP        : '*' ;

Input:
*a*a[Tab]a**

Note: Replace '[Tab]' with an actual Tab char. (In fact, even the '[' char will cause the bug to occur.)

Rob

----------------------------------------
> CC: antlr-interest at antlr.org
> From: parrt at cs.usfca.edu
> To: dukie_banderjee at hotmail.com
> Subject: Re: [antlr-interest] Bug in AntlrWorks debugger
> Date: Mon, 8 Jun 2009 13:22:13 -0700
>
>
> On Jun 8, 2009, at 12:14 PM, Dukie Banderjee wrote:
>
>>
>> Hi,
>>
>> Is this the right place to post AntlrWorks bugs? I looked around but
>> didn't find any other place.
>>
>> It seems that AntlrWorks does not accept Tab characters (or
>> backslashes, for that matter) in the Text field of the Input Text
>> dialog box when you press the Debug button.
>
> That could be. it's possible that the tab character means moveto the
> next field
> Ter

_________________________________________________________________
We are your photos. Share us now with Windows Live Photos.
http://go.microsoft.com/?linkid=9666047


More information about the antlr-interest mailing list