This was a small example of a much larger problem. This isn't this
simple case only, I am processing CSS files and trying to object-ize the
entire file (rules, declarations, media blocks, etc)
On 5/4/09 12:21 PM, Micha wrote:
> 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
>
>
--
Brian Nelson
Software Engineer, Neue Software
e. [email protected]
c. +1 408 373 8310
--~--~---------~--~----~------------~-------~--~----~
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