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

List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to