[antlr-interest] unable to run or debug grammar in antlrworks 1.4 on Windows XP

Matt Palmer mattpalms at gmail.com
Sat Jul 3 14:14:40 PDT 2010


I should add, in case the way I phrased the problem is causing any
confusion: The grammar itself is fine (well - it works - it may not be very
elegant!).  Code can be generated.  I have no warnings or errors.  The
problem is whether the debugger in antlrworks will choose to start up, or
time out.

Matt.

On 3 July 2010 22:11, Matt Palmer <mattpalms at gmail.com> wrote:

> Hi William,
>
> well, in terms of grammar design, you're probably right that bitmask should
> probably be a rule rather than a lexer token.  HEX_BYTE is a fragment, used
> by other lexer tokens too.
>
> However, the real issue for me is that the debugger sometimes works, and
> sometimes doesn't,for the same grammar.  My only fix at this point is
> commenting things out and back in until it starts mysteriously working!
>
> cheers,
>
> Matt
>
>
> On 3 July 2010 22:05, William Clodius <wclodius at los-alamos.net> wrote:
>
>>
>> On Jul 3, 2010, at 2:58 PM, Matt Palmer wrote:
>>
>> > Well, this gets wierder, and to my mind seems to point to a bug in
>> > Antlrworks itself.
>> >
>> > I verified that I could consistently run the debugger using one simple
>> > grammar, but not another.  On the non-working grammar, I commented out
>> rules
>> > and tokens (starting from the most complex), until, lo-and-behold, after
>> one
>> > rule went the debugger started working.  I then re-enabled all the other
>> > rules one by one, and the grammar kept working.  The lexer rule that
>> wasn't
>> > working was  a literal followed by a fragment, looking like this:
>> >
>> > BITMASK :   '&' HEX_BYTE ;
>> >
>> > I then re-enabled this rule... and the debugger kept working.  The only
>> > difference at this point between where I started with a non-working
>> debugger
>> > and where I finished with a working debugger is I moved a couple of
>> rules to
>> > the end (comments and whitespace both going to hidden channels) to
>> simplify
>> > commenting them out.
>> >
>> > I've faced this problem before, I still have no idea what causes it and
>> how
>> > to fix it.  Maybe this will make sense to someone.
>> >
>> > Matt.
>> <snip>
>>
>> Normally I would expect bitmask to be a syntactic element not a lexical
>> element. If so then change all occurrences of BITMASK to bitmask. Otherwise
>> have youm marked HEX_BYTE as a fragment?
>>
>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>> Unsubscribe:
>> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>>
>
>


More information about the antlr-interest mailing list