Oh you made me break my promise of radio silence! I guess that will start tomorrow, my kids are throwing tomatoes at me then they get up (I'm on EST). :)

Yes, The way I am testing this is have your debug workspace setup with the variables view.

- Put your break point on visitor.visitFile(node); line which is #58 in that code.
- put your cursor on the testSimple() line #47 text
- hit F11 to debug
- step passed the visitFile() method 1 time
- look in the variables view, open "this" variable
- click on the "writer" variable and you will see the nicly output code.

You can do this for any of the myriad almost 200 tests we have now, same process, that is how I debug this stuff.

Mike

Quoting Erik de Bruin <e...@ixsoftware.nl>:

FYI, I was able to use the unit test to look at the JS output, by
uncommenting the assert and looking at it fail ;-)

Is there a more convenient way to do this? Mind you, I'm not
complaining! Just askin' ;-)

EdB



On Sat, Dec 22, 2012 at 9:37 AM, Erik de Bruin <e...@ixsoftware.nl> wrote:
Awesome, Mike!

Now you've gone and created a reason for me to waste a considerable
amount of the holidays on getting to know this code and "finish" the
conversion table ;-)

Have a very merry Xmas,

EdB



On Sat, Dec 22, 2012 at 1:00 AM, Michael Schmalle
<apa...@teotigraphix.com> wrote:

Hi,

Well I busted my A$$ before I hit vacation, Erik you can look at
TestGoogEmiter and the JSGoogEmitter to see the black majik I whipped up
today.

Basically with the NEW FalconJx (BTW I'm starting to like this name now, the "x" with Fle"X"), cross compiler is doing this all. I know there are missing
"this, super" etc etc etc, but this things is working!

And all that little stuff is easy to add now. Like I said in my commits, I
have package down to expressions working and it creates valid AS3 source
code from the AST.

Now it's just work filling in all the holes you have listed in the as->js
conversion table.

Frank, I'm sure you could look at my code and take the JSGoogEmitter as an
example and create a prototype JSRequireEmitter with the pattern I have
setup.

I'm still refactoring but it's looking good.

Peace and happy new year,
Mike


----------------------------------------------------------------------------
AS Code

package com.example.components
{

import org.apache.flex.html.staticControls.TextButton;

public class MyTextButton extends TextButton
{
    public function MyTextButton()
    {
        if (foo() != 42) {
            bar();
        }
     }

    private var _privateVar:String = "do ";

    public var publicProperty:Number = 100;

    public function myFunction(value: String): String
    {
        return "Don't " + _privateVar + value;
    }
}
}



----------------------------------------------------------------------------
JS Code



goog.provide('com.example.components.MyTextButton');

goog.require('org.apache.flex.html.staticControls.TextButton');

/**
 * @constructor
 */
com.example.components.MyTextButton = function() {
        if (foo() != 42) {
                bar();
        }
}

/**
 * @type {String}
 */
com.example.components.MyTextButton.prototype._privateVar = "do ";

/**
 * @type {Number}
 */
com.example.components.MyTextButton.prototype.publicProperty = 100;

/**
 * @this {com.example.components.MyTextButton}
 * @param {String} value
 * @return {String}
 */
com.example.components.MyTextButton = function(value:String) {
        return "Don't " + _privateVar + value;
}



--
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com




--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl



--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl


--
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com

Reply via email to