lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 18/11/2010 20:50, Lorenzo Donati wrote:
Since I heard so many people praising Lpeg, I hoped it would be good for me too, but I
begin to feel I need some experience in grammar design.
I really had hoped to get along without delving into a CS textbook.

In my experience, PEG parsing is easier to understand than Yacc/Lex or Antlr one.

(I also read the page on Wikipedia about PEGs, but didn't help much, since it always
focused on CS issues: parsers, grammars, etc.).

When Lpeg was out, I was excited, because it was simple at the time. It evolved to be useful (with many capture cases) but it might be slightly harder to understand. I fear I haven't followed closely the latest developments, I should catch up. Anyway, I am in your case: I have some programming experience, but only a faint CS background. I dived into the Wikipedia article, looked at the original article on PEG, read various other sources, and I finally found out it wasn't so complex...

Maybe I'm missing something and effectively LPeg can be used effectively only by people
with strong CS background ?

Not at all.

If this is the case, I think that will rule out Lpeg for me ( :-( )

As said, it is worth studying it a bit more. Somehow, it is simpler than regular expressions, after all, and much more powerful.
It is worth analyzing Roberto's examples, and making your own exercises on simple grammars.

Philippe Lhoste
--  (near) Paris -- France
--  --  --  --  --  --  --  --  --  --  --  --  --  --