So i haven’t been working on Haxer too much lately, mostly because i’ve hit a wall as far how to best convert some AS3 code to Haxe without having to implement a full parser/lexer. The main area i am struggling with is converting “o is Object” and “o as Object” which sounds trivial at first, but when you look at the myriad of possible ways those statements can appear in code, it becomes a much more complex task.
In HaXe, the “is” operator/keyword/whatever it is, is written as “Std.is(obj, type)” and the “as” operator is written as “cast(obj, type)”. This presents quite a challenge when you have lines like this in AS3:
There are other, more complicated examples that make using regular expressions nearly impossible. I am open to a discussion as to how i might be able to implement such a conversion.
With the rewrite of my as3 to haxe translator in Java, i have also renamed the program ‘Haxer’. It just sounds a whole lot cooler. The current version of the code is up on git hub. Right now it only knows how to skip comments, detect and convert types correctly. I *think* i’ve managed to nail down the best way to do the type refactoring without having to loop over everything a bunch of times. So far the results look promising.

Categories
Tag Cloud
Blog RSS
Comments RSS

Void « Default
Life
Earth
Wind
Water
Fire
Light 