[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Doubt about ebnf parser using lpeg.
- From: Tony Finch <dot@...>
- Date: Wed, 1 Jun 2011 19:05:26 +0100
Cleverton Hentz <cleverton_hentz@yahoo.com.br> wrote:
>
> I'm trying describe EBNF parser with lpeg library but my implementation of
> parser don't recognize some sentences.
The first alternative for Primary is TerminalString. This means that if
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.
Tony.
--
f.anthony.n.finch <dot@dotat.at> 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,
occasionally poor.