lua-users home
lua-l archive

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


Where i can find some exmples for creating such parser?

2012/12/6 steve donovan <steve.j.donovan@gmail.com>:
> An entertaining project (or maybe it already exists?) would be a
> lpeg-based DSL generation tool
>
> You would give it something like:
>
> MUST directory STRING {
>   owner IDEN
>   group IDEN
>   mode STRING
>   action IDEN
> }
>
> which would match this syntax (there MUST be a directory clause)
>
> directory "/etc/" {
>   owner root
>   group wheel
>   mode "0755"
>   action create
> }
>
> and create a parser that brings this in as a table structure. ( It
> would issue sensible errors at the right place, which is a tricky
> thing with lpeg)



--
Vasiliy Tolstov,
Clodo.ru
e-mail: v.tolstov@selfip.ru
jabber: vase@selfip.ru