[antlr-interest] Additional tokens not being passed to Create(IToken token) ?
Terence Parr
parrt at cs.usfca.edu
Tue Oct 21 14:01:17 PDT 2008
On Oct 21, 2008, at 1:47 PM, Dejas Ninethousand wrote:
> I see the problem now. I put a breakpoint in the parser and that
> production was never hit. The reason is that in my root production
> namespace_decl is preceded by non-terminal filler:
>
> cs_file : filler namespace_decl LBRACE ((comment)*
> class_def)* RBRACE;
>
>
> filler : ( options {greedy=false;} : . )*;
>
> removing filler causes my case statement breakpoint to be hit. I
> must have misunderstood the nature of "greedy=false". I interpreted
> that to mean "consume all characters that could not constitute other
> non terminals". I saw this construct in an example grammar file for
> block comments:
>
> COMMENT_BLOCK
> : '/*' ( options {greedy=false;} : . )* '*/'
>
> If indeed my interpretation is wrong, then how does the (.)* regex
> avoid eating the closing */ in a block comment?
it says "consume until you see what follows".
Ter
More information about the antlr-interest
mailing list