Actually, I don't want the semicolon between the blocks. I wanted to detect
it as an error. In any case, putting the EOF in the rule as you indicate
below fixed the issue!

Thanks for your help!

- Dan -

On Tue, Apr 7, 2009 at 10:01 AM, Jim Idle <[email protected]> wrote:

>  Dan Baumberger wrote:
>
>  Handling only a single block was a mistake on my part in the email. The
> rule should have been:
>
> prog : (b=ID '{' (ID ';')+ '}')+ { System.out.println("Found block: " +
> $b.text);} ;
>
> There may be other things in your grammar (you have removed all the
> warnings and errors?), but this fragment does not do what you want. Use:
>
> prog : (b=ID '{' (ID ';')+ '}' *';'*)+ { System.out.println("Found block:
> " + $b.text);}  *EOF;*
>
> See the ';' and the EOF?
>
> Jim
>
>
> 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
-~----------~----~----~----~------~----~------~--~---

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

Reply via email to