lua-users home
lua-l archive

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


On Thu, Dec 6, 2012 at 9:52 AM, Vasiliy Tolstov <v.tolstov@selfip.ru> wrote:
> Hello.
> What is the best way to create custom DSL in Lua? Google says, that it
> can be possible via base lua or using lpeg.
>
> I need something like this
> direcotry "/etc/" {
>   owner "root"
>   group "wheel"
>   mode "0755"
>   action "create"
> }
>
> Can somebody provie minimal lua code for this sample? How can i do
> this using lua lpeg?

Shameless promotion: couple of links:

http://habrahabr.ru/post/77413/ (basic; in Russian, but looks like you
shouldn't have a problem with that :) )

http://www.slideshare.net/agladysh/declarative-internal-dsls-in-lua-a-game-changing-experience
(more advanced; tell me if you're interested in code behind this)

HTH,
Alexander.