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

William Clodius wclodius at los-alamos.net
Sat Jul 3 14:05:40 PDT 2010


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?


More information about the antlr-interest mailing list