[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Doubt about ebnf parser using lpeg.
- From: Cleverton Hentz <cleverton_hentz@...>
- Date: Thu, 2 Jun 2011 13:14:41 -0300
Thanks Tony. You are right.
This is my first PEG grammar and I don't see this detail. Change the order in Primary nonterminal solve my problem.
On Wed, Jun 1, 2011 at 3:05 PM, Tony Finch <email@example.com>
The first alternative for Primary is TerminalString. This means that if
Cleverton Hentz <firstname.lastname@example.org
> I'm trying describe EBNF parser with lpeg library but my implementation of
> parser don't recognize some sentences.
any other alternative starts with a TerminalString it cannot match, since
the Primary has already succeeded. For instance, a later alternative is
RepeatedSequence and many of its alternatives start with strings. Your
example should match a RepeatedSequence but cannot.
f.anthony.n.finch <email@example.com> http://dotat.at/
Rockall, Malin, Hebrides: South 5 to 7, occasionally gale 8 at first in
Rockall and Malin, veering west or northwest 4 or 5, then backing southwest 5
or 6 later. Rough or very rough. Occasional rain. Moderate or good,