On Monday 04 May 2009 21:08:50 Brian Nelson wrote:
> The input would be "aa, bb, cc" and I simply want a list of
> ['aa','bb','cc']. I am not trying to process it, just get the list out
> of it, ignoring the commas, in a variable I can use.
>
> prog : rone (COMMA rone)*
> ;
>
> rone : IDENT;
>
> IDENT: 'a'..'z' ('a'..'z')*;
> COMMA: ',';
>
for this I would do (in java):
String idents[] = text.split(",");
then, if needed:
for (String s: idents) {
if (!s.matches("[a..z]([a..z])*")) throw new Argh();
}
cheers
Michael
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
-~----------~----~----~----~------~----~------~--~---