lua-users home
lua-l archive

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

V S P wrote:
[snip snip]
I understand that the most straighforward approach
(but not necessarely the simplest and easy to implement)
is to write my own parser (i am using Lpeg for my other things)

However, I would like to know if there is a way for me to
use Lua's load string,
then get access to byte-compiled code  and then translate the
code into whatever I need

Wouldn't this be simpler for me to do (as then Lua takes care of lexing,
parsing, etc)

Are there any examples of this (or even the first approach)?
May be there are other suggestions?

Yueliang has some 5.0.x/5.1.x lexer/parser skeletons. Complexity is around 220 SLOC for the lexer, 600 SLOC for a parser skeleton. The parser skeleton has been successfully used in LuaSrcDiet to optimize/rename local variable names in reducing the size of Lua source code files.

Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia