lua-users home
lua-l archive

Re: Bi-directional transformations

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


Hi,
spir wrote:
On 2010年2月12日 14:11:06 -0800
Nathan Angelacos <nangel@nothome.org> wrote:
The target is to have some regex parser turn a config file into a tree (in my case, json would be preferred), and back again.
May I ask why you don't use Lua itself as config language?
Good question.
I want to parse config files from /etc, for example,
	/etc/network/interfaces
	/etc/dnsmasq.conf
	/etc/resolv.conf
	/etc/modules
	/etc/ssh/sshd_config
I have no control over the format, and there are plenty of different formats. I then want to process the parsed tree with Lua.
The easiest way out of that problem is appears to be:
A) Use someone else's filter (and bind it to Lua)
B) Rewrite someone else's filter in Lua
C) Roll your own filter in Lua
Of the three options, A seems the least amount of work (and thus the original question)
Hope that helps.

AltStyle によって変換されたページ (->オリジナル) /