2008/9/13 Johannes Luber <[EMAIL PROTECTED]>:
> Dave Pawson schrieb:
>> The input is
>>
>> blah
>> blah
>>
>> *list item 1
>> * list content 2
>
> There is one. I'd define a grammar like:
>
> grammar Test;
>
> tokens {
> LIST='LIST';
> STAR=''*';
> }
>
> CONTENT: ('a'..'z' | 'A'..'Z')+;
> NEWLINE: '\r' | '\n';
> WHITESPACE: ('\t' | ' ')+ {$channel = HIDDEN;};
>
> start: line*;
>
> line: content+ NEWLINE+
> | STAR LIST content+ NEWLINE+
> ;
That requires the string 'LIST' on each list element?
My input is line based plain text.
A list starts from the first occurrence of
* Any string content to end of line
and ends on the last
* Any string content up to end of line.
I guess I can leave this one till I've read more about navigating trees.
regards
--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk
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
-~----------~----~----~----~------~----~------~--~---