[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [Q] simple translator from Lua to Java Script and PHP
- From: KHMan <keinhong@...>
- Date: Fri, 31 Oct 2008 04:52:47 +0800
V S P wrote:
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,
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