lua-users home
lua-l archive

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


> ltokenp uses a separate Lua interpretor. How different is it from the usual Lua 5.3.x code and can it be merged?

ltokenp is a preprocessor. You need to save its output and run it separately.

If your DSL contains Lua as a subset, then you can embed a token
processor by using the modified llex.c (one line) and a suitable
proxy.c. I have posted several examples here in lua-l. Search the
archives for proxy.c. However, writing a custom proxy.c is not fun for
anything complicated and requires some understanding of the internals
of Lua (mainly the lexer). This was the motivation for ltokenp, where
you can write token filters in Lua.