incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Schmalle <apa...@teotigraphix.com>
Subject [FalconJx] Package down to Expression production; JSGoogEmiter prototype
Date Sat, 22 Dec 2012 00:00:35 GMT

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


Mime
View raw message