[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [Q] simple translator from Lua to Java Script and PHP
- From: "V S P" <toreason@...>
- Date: Thu, 13 Nov 2008 06:50:15 -0500
here it is (there are two files and a test file)
---- lua file like this
if arr1.field1<arr2.field1 or arr1.field2>arr2 then
elseif a<b then
will get translated into
if( js_iop_or( js_iop_lt( arr1['field1'], arr2['field1'])
, js_iop_lt( arr2, arr1['field2'])
call_func3('abc') ; call_func4('abc') ;
}/*end of if*/
I also have many call backs
context sensitive callbacks and 'output language builder' callbacks
(to translate to other languages if I need to)
I just have it serving my needs because it does not do
even assignment operations (because I use function calls for assignments
and does not support parenthesis, of course nothing like function
I can add some things easily , but others are obviously way beyound
Also, I have been programming Lua just for two months, so my code
may be 'cheesy' to many hardcore people
Well -- done with disclaimers :-)
On Thu, 13 Nov 2008 09:10:32 -0200, "João Felipe Santos"
> On Thu, Nov 13, 2008 at 5:20 AM, V S P <email@example.com> wrote:
> > Just wanted to report back
> > I ended up using metalua.
> > Now I have it working and I am moving on to use it my system.
> > Once I got to know metalua little bit, it became
> > 'natural' at AST manipulation tasks
> > (and it already has a complete built in lua parser and lexer,
> > with error handling, so I did not even have to worry about that part).
> > Fabien provided a lot of help on the metalua users list.
> > thanks,
> > Vlad
> Great news! Any chance that we'll see the code published soon? I'm
> very interested!
> Best regards
> -- João
V S P
http://www.fastmail.fm - Email service worth paying for. Try it for free