[antlr-interest] Re: trying to understand greedy option
xdecoret
xdecoret at free.fr
Tue Aug 3 16:08:01 PDT 2004
>
> But then, I can parse the following file:
>
> value = toto,
> value = "toto",
> value = "toto" + tata + "titi" + tutu,
> value = lastone
>
> But I cannot parse the same input if I remove the last line ?!?!
>
I can get my parser to parse the desired format if I change it
slightly into:
parseFile
: fields
;
fields
: field (COMA)?
| field COMA fields
;
field
: id EQUAL fieldValue
;
fieldValue
: (fieldValuePart PLUS)* fieldValuePart
;
fieldValuePart
: STRING
| NAME
;
id
: NAME
;
But then I cannot place a greedy option to sop the warning.
> Any explanations to help me understand?
and I don't understand what has changed ;-) The rewriting seems
equivalent to me!
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list