Repository: flex-falcon
Updated Branches:
  refs/heads/develop 75b555aeb -> 96c45c445


handle fx:Declarations


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/fd42cf29
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/fd42cf29
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/fd42cf29

Branch: refs/heads/develop
Commit: fd42cf29eba1d32128de79ec8e91fd1edb2e6cc2
Parents: 3ff5c3c
Author: Alex Harui <aha...@apache.org>
Authored: Tue Nov 18 07:44:31 2014 -0800
Committer: Alex Harui <aha...@apache.org>
Committed: Fri Nov 21 14:58:15 2014 -0800

----------------------------------------------------------------------
 .../flex/compiler/codegen/mxml/IMXMLEmitter.java  |  3 +++
 .../internal/codegen/mxml/MXMLBlockWalker.java    |  2 +-
 .../internal/codegen/mxml/MXMLEmitter.java        | 11 +++++++++++
 .../codegen/mxml/flexjs/MXMLFlexJSEmitter.java    | 18 ++++++++++++++++++
 4 files changed, 33 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fd42cf29/compiler.jx/src/org/apache/flex/compiler/codegen/mxml/IMXMLEmitter.java
----------------------------------------------------------------------
diff --git 
a/compiler.jx/src/org/apache/flex/compiler/codegen/mxml/IMXMLEmitter.java 
b/compiler.jx/src/org/apache/flex/compiler/codegen/mxml/IMXMLEmitter.java
index 3d6b288..53461b4 100644
--- a/compiler.jx/src/org/apache/flex/compiler/codegen/mxml/IMXMLEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/codegen/mxml/IMXMLEmitter.java
@@ -27,6 +27,7 @@ import org.apache.flex.compiler.tree.mxml.IMXMLBooleanNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLClassDefinitionNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLComponentNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLDataBindingNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDeclarationsNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLEmbedNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLEventSpecifierNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLFactoryNode;
@@ -112,6 +113,8 @@ public interface IMXMLEmitter extends IEmitter
 
     void emitComponent(IMXMLComponentNode node);
 
+    void emitDeclarations(IMXMLDeclarationsNode node);
+
     
//--------------------------------------------------------------------------
 
     void emitMetadata(IMXMLMetadataNode node);

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fd42cf29/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/MXMLBlockWalker.java
----------------------------------------------------------------------
diff --git 
a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/MXMLBlockWalker.java
 
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/MXMLBlockWalker.java
index ed518de..bed0187 100644
--- 
a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/MXMLBlockWalker.java
+++ 
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/MXMLBlockWalker.java
@@ -200,7 +200,7 @@ public class MXMLBlockWalker implements IMXMLBlockVisitor, 
IMXMLBlockWalker
     {
         debug("visitDeclarations()");
 
-        //
+        mxmlEmitter.emitDeclarations(node);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fd42cf29/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/MXMLEmitter.java
----------------------------------------------------------------------
diff --git 
a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/MXMLEmitter.java
 
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/MXMLEmitter.java
index fcf2597..56d0fb2 100644
--- 
a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/MXMLEmitter.java
+++ 
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/MXMLEmitter.java
@@ -90,6 +90,17 @@ public class MXMLEmitter extends Emitter implements 
IMXMLEmitter
     
//--------------------------------------------------------------------------
 
     @Override
+    public void emitDeclarations(IMXMLDeclarationsNode node)
+    {
+        // visit tags
+        final int len = node.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            getMXMLWalker().walk(node.getChild(i));
+        }    
+    }
+    
+    @Override
     public void emitDocumentHeader(IMXMLFileNode node)
     {
         IMXMLDocumentNode dnode = node.getDocumentNode();

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fd42cf29/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
----------------------------------------------------------------------
diff --git 
a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
 
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
index 08b113e..5955432 100644
--- 
a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
+++ 
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
@@ -64,6 +64,7 @@ import 
org.apache.flex.compiler.tree.mxml.IMXMLClassDefinitionNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLClassNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLComponentNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLDataBindingNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLDeclarationsNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLDocumentNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLEventSpecifierNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLFactoryNode;
@@ -125,6 +126,23 @@ public class MXMLFlexJSEmitter extends MXMLEmitter 
implements
     
//--------------------------------------------------------------------------
 
     @Override
+    public void emitDeclarations(IMXMLDeclarationsNode node)
+    {
+       inMXMLContent = true;
+        MXMLDescriptorSpecifier currentInstance = getCurrentDescriptor("i");
+
+        MXMLDescriptorSpecifier currentPropertySpecifier = new 
MXMLDescriptorSpecifier();
+        currentPropertySpecifier.isProperty = true;
+        currentPropertySpecifier.name = "mxmlContent";
+        currentPropertySpecifier.parent = currentInstance;
+        descriptorTree.add(currentPropertySpecifier);
+        moveDown(false, currentInstance, currentPropertySpecifier);
+       super.emitDeclarations(node);
+        moveUp(false, false);
+       inMXMLContent = false;
+    }
+    
+    @Override
     public void emitDocument(IMXMLDocumentNode node)
     {
         descriptorTree = new ArrayList<MXMLDescriptorSpecifier>();

Reply via email to