lua-users home
lua-l archive

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

here it is (there are two files and a test file)

----  lua file like this

if arr1.field1<arr2.field1  or arr1.field2>arr2[33][15] then
elseif a<b then


will get translated into 

if( js_iop_or( js_iop_lt( arr1['field1'], arr2['field1'])
, js_iop_lt( arr2[33][15], arr1['field2'])
 call_func2('xyz') ;
else if
( js_iop_lt(a,b)
 call_func3('abc') ; call_func4('abc') ;

 call_func5(123) ;
}/*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
declarations either....

I can add some things easily , but others are obviously way beyound
my skills.

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&#227;o Felipe Santos"
<> said:
> On Thu, Nov 13, 2008 at 5:20 AM, V S P <> wrote:
> > Just wanted to report back
> > that for my simple lua to javascript translator
> > 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&#227;o
  V S P

-- - Email service worth paying for. Try it for free