[antlr-interest] next problem - kindof

Kay Roepke kroepke at classdump.org
Thu Aug 2 17:22:26 PDT 2007


On Aug 3, 2007, at 2:15 AM, Diehl, Matthew J wrote:

> You're using the WS in your grammar...but the lexer is skipping them.
> The parser only reads tokens on a certain channel (and doesn't read
> skipped ones), so if you skip tokens or put them on a separate  
> channel,
> the parser does not have access to them.

Additionally, if you removed the skip() calls you will get in trouble  
because
WSNoNewline will be matched in favor of WS, thus causing mismatched  
token exceptions
because the parser is looking for WS tokens.

Do you really need to spell out the whitespace? In general that is  
not necessary, you
can either skip() those tokens or put them on the hiddel channel by  
using
$channel=HIDDEN; in place of skip().

cheers,
-k
-- 
Kay Röpke
http://classdump.org/






More information about the antlr-interest mailing list