lua-users home
lua-l archive

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


Humberto Aranha wrote:

See: http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html#intro
It contains references and examples.

-Humberto Aranha



Japa wrote:
I recommend you to look http://lua-users.org/wiki/LpegRecipes
In this page you will see more examples with LPeg.

good luck

[snip]

--
Marcelo Oikawa



Thanks you both for the pointers, but as I said in my previous message, I _did_ search the Wiki, but I found the examples in the LPeg recipes page a bit obscure. And I, of course, did read the documentation coming with LPeg. As I said, I'm no CS wizard and although I did some examples a try, I didn't get the big picture and still feel uneasy. I fear that all those examples are targeted at people knowing much more than I do about grammars and the like (or maybe it's just me that didn't try harder :-) ).

As I hinted before, I always viewed grammars as a way to understand the meaning of a language construct. I never designed a grammar. So, as far as I understood it, LPeg is about casting a text matching problem into a syntactical structure parsing problem (sorry if terminology is lacking rigour), that is, to design a grammar as the text to match were part of a language.

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.


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

Maybe I'm missing something and effectively LPeg can be used effectively only by people with strong CS background ?
If this is the case, I think that will rule out Lpeg for me ( :-( )
Sorry for the noise anyway.

Best Regards,

-- Lorenzo