Jim Idle ([email protected]) wrote:

> You need:
> 
> fragment DIGITS : ('0'..'9')+ ;
> DATE
> : DIGITS
>   (
>       (SLASH DIGITS SLASH DIGITS)=> SLASH DIGITS SLASH DIGITS
>     | {$type = DIGITS; }
> ;
> 
> SLASH : '/' ;

Thanks.  But it seems like it'll get nasty pretty quick when I put this back
into the "real" grammar I'm working on.  If I have to left-factor everything
I'll be rather confused.

Is there not a way besides factoring?  In TheBook on page 299 it talks about
"rather than left-factor the grammar, making it less readable...", and I
tend to agree in this case.

-- 
Ken Williams
Sr. Research Scientist
Thomson Reuters
Phone: 651-848-7712
[email protected]



List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/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