This seems to be another way of writing the "repeat-until" operation.
Apparently, version 4.0 of APG (ABNF Parser Generator) by Lowell D. Thomas
had this operation in the form *A!B, meaning "repeat matching A until B
is found."
It was removed in version 5.0 as being equivalent to *(!B A)B, which is
the same
as indicated by Francisco (for some reason APG writes star before
expressions).
See http://www.coasttocoastresearch.com/apg/docs/doc50, section 3.2.3.5.
My argument for introducing "repeat-until" would be a very concise
implementation
(at least in the style I use in my "Mouse"), much shorter than that of
*(!B A)B.
Have been considering syntax such as A**B, but cannot make up my mind.
Happy New Year!
Roman
On 2011-01-02 00:12, Francisco Mota wrote:
It might be convenient sometimes, but I don't think it increases the
power of PEGs.
You can always rewrite an expression like "(E1 break | E2)*" as "(!E1
E2)* E1?"
I wonder if there are any grammars that can't be expressed without break?
2011/1/1 Ondřej Bílka <nel...@seznam.cz <mailto:nel...@seznam.cz>>
Hello
as I started to LR/RR eliminator I noticed that break is handy
It gave idea to introduce break statement to break iteration.
For example C strings could be parsed as
'"' ('"' break | '\"' | . )*
whad do you think about it
--
SCSI's too wide.
_______________________________________________
PEG mailing list
PEG@lists.csail.mit.edu <mailto:PEG@lists.csail.mit.edu>
https://lists.csail.mit.edu/mailman/listinfo/peg
_______________________________________________
PEG mailing list
PEG@lists.csail.mit.edu
https://lists.csail.mit.edu/mailman/listinfo/peg
_______________________________________________
PEG mailing list
PEG@lists.csail.mit.edu
https://lists.csail.mit.edu/mailman/listinfo/peg