flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject svn commit: r1452099 - in /flex/falcon/trunk: compiler.jx.tests/src/org/apache/flex/compiler/internal/mxml/codegen/flexjs/ compiler.jx.tests/src/org/apache/flex/compiler/internal/test/ compiler.jx.tests/test-files/flexjs/projects/FlexJSTest/ compiler.j...
Date Sun, 03 Mar 2013 18:56:59 GMT
Author: erikdebruin
Date: Sun Mar  3 18:56:59 2013
New Revision: 1452099

URL: http://svn.apache.org/r1452099
Log:
- Removed FlexJS example project copy from 'test-files', the FlexJS MXML tests 
  now uses the 'asjsRoot' field, which - for now, I hope - is a relative path from
  FalconJx to the ASJS project root (SVN). The field is also used to complete the 
  library and source paths for FlexJS.
- FlexJS MXML is now correctly parsed back to an XML-like output that mirrors the
  input. Next step: create 'goog' JS output instead of the XML.

Added:
    flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/flexjs/MXMLFlexJSBlockWalker.java
  (with props)
Removed:
    flex/falcon/trunk/compiler.jx.tests/test-files/flexjs/projects/FlexJSTest/
Modified:
    flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/mxml/codegen/flexjs/TestFlexJSMXMLApplication.java
    flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/FlexJSTestBase.java
    flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLBlockWalker.java
    flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLEmitter.java
    flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/flexjs/MXMLFlexJSEmitter.java
    flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/driver/flexjs/MXMLFlexJSBackend.java
    flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/mxml/codegen/IMXMLEmitter.java

Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/mxml/codegen/flexjs/TestFlexJSMXMLApplication.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/mxml/codegen/flexjs/TestFlexJSMXMLApplication.java?rev=1452099&r1=1452098&r2=1452099&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/mxml/codegen/flexjs/TestFlexJSMXMLApplication.java
(original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/mxml/codegen/flexjs/TestFlexJSMXMLApplication.java
Sun Mar  3 18:56:59 2013
@@ -1,7 +1,5 @@
 package org.apache.flex.compiler.internal.mxml.codegen.flexjs;
 
-import java.io.File;
-
 import org.apache.flex.compiler.internal.test.FlexJSTestBase;
 import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
 import org.junit.Ignore;
@@ -24,9 +22,9 @@ public class TestFlexJSMXMLApplication e
         </basic:HTTPService>
     </basic:beads>
     //*/
-    
+
     // TODO (erikdebruin) this needs to become JS Goog output ;-)
-    
+
     @Test
     public void testBasicFlexJSApp()
     {
@@ -38,7 +36,7 @@ public class TestFlexJSMXMLApplication e
 
         mxmlBlockWalker.visitFile(node);
 
-        assertOut("<Application>\n\t\n</Application>");
+        assertOut("<Application>\n</Application>");
     }
 
     @Test
@@ -46,49 +44,57 @@ public class TestFlexJSMXMLApplication e
     {
         String code = ""
                 + "<basic:Application xmlns:basic=\"library://ns.apache.org/flexjs/basic\">"
-                + "    <basic:beads />"
+                + "    <basic:beads />" 
                 + "</basic:Application>";
-        
+
         IMXMLFileNode node = compileMXML(code);
 
         mxmlBlockWalker.visitFile(node);
 
         assertOut("<Application>\n\t<beads></beads>\n</Application>");
     }
-    
-    @Ignore
+
     @Test
     public void testFlexJSAppWithNodeAndChild()
     {
         String code = ""
-                + "<basic:Application xmlns:basic=\"library://ns.apache.org/flexjs/basic\">"
+                + "<basic:Application xmlns:fx=\"http://ns.adobe.com/mxml/2009\""
+                + "                   xmlns:local=\"*\""
+                + "                   xmlns:basic=\"library://ns.apache.org/flexjs/basic\">"
                 + "    <basic:beads>"
                 + "        <basic:HTTPService id=\"service\">"
-                + "            <basic:LazyCollection id=\"collection\" />"
-                + "        </basic:HTTPService>"
+                + "            <basic:LazyCollection id=\"collection\">"
+                + "                <basic:inputParser>"
+                + "                    <basic:JSONInputParser />"
+                + "                </basic:inputParser>"
+                + "                <basic:itemConverter>"
+                + "                    <local:StockDataJSONItemConverter />"
+                + "                </basic:itemConverter>"
+                + "            </basic:LazyCollection id=\"collection\">"
+                + "        </basic:HTTPService>" 
                 + "    </basic:beads>"
                 + "</basic:Application>";
-        
+
         IMXMLFileNode node = compileMXML(code);
-        
+
         mxmlBlockWalker.visitFile(node);
+
+        //System.out.println(writer.toString());
         
-        System.out.println(writer.toString());
-        
-        assertOut("<Application>\n\t<beads><org.apache.flex.net.HTTPService
id=\"service\"></org.apache.flex.net.HTTPService></beads>\n</Application>");
+        assertOut("<Application>\n\t<beads>\n\t\t<HTTPService id=\"service\">\n\t\t\t<beads>\n\t\t\t\t<LazyCollection
id=\"collection\">\n\t\t\t\t\t<inputParser>\n\t\t\t\t\t\t<JSONInputParser>\n\t\t\t\t\t\t</JSONInputParser>\n\t\t\t\t\t</inputParser>\n\t\t\t\t\t<itemConverter>\n\t\t\t\t\t\t<StockDataJSONItemConverter>\n\t\t\t\t\t\t</StockDataJSONItemConverter>\n\t\t\t\t\t</itemConverter>\n\t\t\t\t</LazyCollection>\n\t\t\t</beads>\n\t\t</HTTPService>\n\t</beads>\n</Application>");
     }
 
     @Ignore
     @Test
     public void MXMLClassNode_flashDisplaySprite()
     {
-        String path = "flexjs"
-                + File.separator + "projects" + File.separator + "FlexJSTest"
-                + File.separator + "src";
-
-        IMXMLFileNode node = compileMXML("FlexJSTest", true, path);
+        IMXMLFileNode node = compileMXML("FlexJSTest", true, asjsRoot
+                + "examples/FlexJSTest_again", false);
 
         mxmlBlockWalker.visitFile(node);
-    }
 
+        //System.out.println(writer.toString());
+        
+        assertOut("");
+    }
 }

Modified: flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/FlexJSTestBase.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/FlexJSTestBase.java?rev=1452099&r1=1452098&r2=1452099&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/FlexJSTestBase.java
(original)
+++ flex/falcon/trunk/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/FlexJSTestBase.java
Sun Mar  3 18:56:59 2013
@@ -12,6 +12,10 @@ import org.junit.Ignore;
 public class FlexJSTestBase extends TestBase
 {
 
+    // TODO (erikdebruin) handle this path more like env.SDK or something
+    //                    similarly non-hard coded
+    protected final String asjsRoot = "../../asjs/";
+
     @Override
     public void setUp()
     {
@@ -31,8 +35,7 @@ public class FlexJSTestBase extends Test
                 + "/frameworks/libs/framework.swc")));
         libraries.add(new File(FilenameNormalization.normalize(env.SDK
                 + "\\frameworks\\libs\\rpc.swc")));
-        libraries.add(new File(
-                "./test-files/flexjs/projects/FlexJSTest/libs/FlexJSUI.swc"));
+        libraries.add(new File(asjsRoot + "frameworks/as/libs/FlexJSUI.swc"));
 
         super.addLibraries();
     }
@@ -43,14 +46,21 @@ public class FlexJSTestBase extends Test
         namespaceMappings
                 .add(new MXMLNamespaceMapping(
                         "library://ns.apache.org/flexjs/basic",
-                        new File(
-                                "./test-files/flexjs/projects/FlexJSTest/libs/basic-manifest.xml")
+                        new File(asjsRoot + "frameworks/as/basic-manifest.xml")
                                 .getAbsolutePath()));
 
         super.addNamespaceMappings();
     }
 
     @Override
+    public void addSourcePaths()
+    {
+        sourcePaths.add(new File(asjsRoot + "examples/FlexJSTest_again"));
+
+        super.addSourcePaths();
+    }
+
+    @Override
     protected IBackend createBackend()
     {
         return new MXMLFlexJSBackend();

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLBlockWalker.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLBlockWalker.java?rev=1452099&r1=1452098&r2=1452099&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLBlockWalker.java
(original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLBlockWalker.java
Sun Mar  3 18:56:59 2013
@@ -54,7 +54,7 @@ public class MXMLBlockWalker implements 
 {
     private List<ICompilerProblem> errors;
 
-    private IMXMLEmitter emitter;
+    protected IMXMLEmitter emitter;
 
     //----------------------------------
     // project
@@ -148,7 +148,7 @@ public class MXMLBlockWalker implements 
     }
 
     //--------------------------------------------------------------------------
-    
+
     @Override
     public void visitEventSpecifier(IMXMLEventSpecifierNode node)
     {
@@ -201,10 +201,10 @@ public class MXMLBlockWalker implements 
     public void visitBoolean(IMXMLBooleanNode node)
     {
         debug("visitBoolean()");
-        
+
         emitter.emitBoolean(node);
     }
-    
+
     @Override
     public void visitInt(IMXMLIntNode node)
     {
@@ -217,10 +217,10 @@ public class MXMLBlockWalker implements 
     public void visitNumber(IMXMLNumberNode node)
     {
         debug("visitNumber()");
-        
+
         emitter.emitNumber(node);
     }
-    
+
     @Override
     public void visitString(IMXMLStringNode node)
     {
@@ -233,10 +233,10 @@ public class MXMLBlockWalker implements 
     public void visitUint(IMXMLUintNode node)
     {
         debug("visitUint()");
-        
+
         emitter.emitUint(node);
     }
-    
+
     //--------------------------------------------------------------------------
 
     @Override

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLEmitter.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLEmitter.java?rev=1452099&r1=1452098&r2=1452099&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLEmitter.java
(original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLEmitter.java
Sun Mar  3 18:56:59 2013
@@ -214,31 +214,31 @@ public class MXMLEmitter extends Emitter
     @Override
     public void emitBoolean(IMXMLBooleanNode node)
     {
-        emitAttributeValue(node.getChild(0));
+        emitAttributeValue(node);
     }
 
     @Override
     public void emitInt(IMXMLIntNode node)
     {
-        emitAttributeValue(node.getChild(0));
+        emitAttributeValue(node);
     }
 
     @Override
     public void emitNumber(IMXMLNumberNode node)
     {
-        emitAttributeValue(node.getChild(0));
+        emitAttributeValue(node);
     }
     
     @Override
     public void emitString(IMXMLStringNode node)
     {
-        emitAttributeValue(node.getChild(0));
+        emitAttributeValue(node);
     }
     
     @Override
     public void emitUint(IMXMLUintNode node)
     {
-        emitAttributeValue(node.getChild(0));
+        emitAttributeValue(node);
     }
 
     //--------------------------------------------------------------------------
@@ -253,7 +253,7 @@ public class MXMLEmitter extends Emitter
     //  utils
     //--------------------------------------------------------------------------
 
-    protected void emitPropertySpecifiers(IMXMLPropertySpecifierNode[] nodes,
+    public void emitPropertySpecifiers(IMXMLPropertySpecifierNode[] nodes,
             boolean emitAttributes)
     {
         if (nodes != null)
@@ -275,11 +275,16 @@ public class MXMLEmitter extends Emitter
 
     protected void emitAttributeValue(IASNode node)
     {
-        write("\"");
-
-        getMXMLWalker().walk(node);
-
-        write("\"");
+        IMXMLLiteralNode cnode = (IMXMLLiteralNode) node.getChild(0);
+        
+        if (cnode.getValue() != null)
+        {
+            write("\"");
+    
+            getMXMLWalker().walk((IASNode) cnode); // Literal
+    
+            write("\"");
+        }
     }
 
     protected boolean isMXMLContentNode(IMXMLNode node)

Added: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/flexjs/MXMLFlexJSBlockWalker.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/flexjs/MXMLFlexJSBlockWalker.java?rev=1452099&view=auto
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/flexjs/MXMLFlexJSBlockWalker.java
(added)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/flexjs/MXMLFlexJSBlockWalker.java
Sun Mar  3 18:56:59 2013
@@ -0,0 +1,57 @@
+/*
+ *
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.internal.mxml.codegen.flexjs;
+
+import java.util.List;
+
+import org.apache.flex.compiler.internal.mxml.codegen.MXMLBlockWalker;
+import org.apache.flex.compiler.mxml.codegen.IMXMLEmitter;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.tree.mxml.IMXMLDocumentNode;
+
+/**
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public class MXMLFlexJSBlockWalker extends MXMLBlockWalker
+{
+
+    public MXMLFlexJSBlockWalker(List<ICompilerProblem> errors, IASProject project,
+            IMXMLEmitter emitter)
+    {
+        super(errors, project, emitter);
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void visitDocument(IMXMLDocumentNode node)
+    {
+        debug("visitDocument()");
+
+        emitter.emitDocumentHeader(node);
+        
+        emitter.emitPropertySpecifiers(node.getPropertySpecifierNodes(), true);
+
+        emitter.emitDocumentFooter(node);
+    }
+
+}

Propchange: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/flexjs/MXMLFlexJSBlockWalker.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/flexjs/MXMLFlexJSEmitter.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/flexjs/MXMLFlexJSEmitter.java?rev=1452099&r1=1452098&r2=1452099&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/flexjs/MXMLFlexJSEmitter.java
(original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/flexjs/MXMLFlexJSEmitter.java
Sun Mar  3 18:56:59 2013
@@ -27,7 +27,7 @@ import org.apache.flex.compiler.internal
 import org.apache.flex.compiler.mxml.codegen.flexjs.IMXMLFlexJSEmitter;
 import org.apache.flex.compiler.projects.ICompilerProject;
 import org.apache.flex.compiler.tree.as.IASNode;
-import org.apache.flex.compiler.tree.mxml.IMXMLClassDefinitionNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLArrayNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLDocumentNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLInstanceNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLPropertySpecifierNode;
@@ -37,7 +37,8 @@ import org.apache.flex.compiler.tree.mxm
  * 
  * @author Erik de Bruin
  */
-public class MXMLFlexJSEmitter extends MXMLEmitter implements IMXMLFlexJSEmitter
+public class MXMLFlexJSEmitter extends MXMLEmitter implements
+        IMXMLFlexJSEmitter
 {
 
     public MXMLFlexJSEmitter(FilterWriter out)
@@ -53,23 +54,7 @@ public class MXMLFlexJSEmitter extends M
         IClassDefinition cdef = node
                 .getClassReference((ICompilerProject) walker.getProject());
 
-        writeNewline("<" + cdef.getBaseName() + ">", true);
-    }
-
-    //--------------------------------------------------------------------------
-
-    @Override
-    public void emitClass(IMXMLClassDefinitionNode node)
-    {
-        // "regular" tags
-        IMXMLPropertySpecifierNode[] pnodes = node.getPropertySpecifierNodes();
-        if (pnodes != null)
-        {
-            for (IMXMLPropertySpecifierNode pnode : pnodes)
-            {
-                getMXMLWalker().walk(pnode);
-            }
-        }
+        write("<" + cdef.getBaseName() + ">");
     }
 
     //--------------------------------------------------------------------------
@@ -77,8 +62,13 @@ public class MXMLFlexJSEmitter extends M
     @Override
     public void emitInstance(IMXMLInstanceNode node)
     {
-        String cname = node.getName();
+        IClassDefinition cdef = node
+                .getClassReference((ICompilerProject) getMXMLWalker()
+                        .getProject());
+
+        String cname = cdef.getBaseName();
 
+        writeNewline("", true);
         write("<");
         write(cname);
         if (node.getID() != null && node.getID() != "")
@@ -90,72 +80,72 @@ public class MXMLFlexJSEmitter extends M
             write(node.getID());
             write("\"");
         }
-//
-//        IMXMLPropertySpecifierNode[] pnodes = node.getPropertySpecifierNodes();
-//
-//        // attributes
-//        emitPropertySpecifiers(pnodes, true);
+
+        IMXMLPropertySpecifierNode[] pnodes = node.getPropertySpecifierNodes();
 
         write(">");
 
+        // attributes
+        emitPropertySpecifiers(pnodes, true);
+
         // child nodes
-        int len = node.getChildCount();
-        if (len > 0)
-        {
-            for (int i = 0; i < len; i++)
-            {
-                IASNode cnode = node.getChild(i);
-                
-                getMXMLWalker().walk(cnode);
-            }
-        }
+        //emitPropertySpecifiers(pnodes, false);
 
+        writeNewline("");
         write("<");
         write("/");
         write(cname);
-        write(">");
+        writeNewline(">", false);
     }
 
     @Override
-    public void emitPropertySpecifier(IMXMLPropertySpecifierNode  node)
+    public void emitPropertySpecifier(IMXMLPropertySpecifierNode node)
     {
-        String cname = node.getName();
+        writeNewline("", true);
+        write("<" + node.getName() + ">");
 
-        write("<");
-        write(cname);
-//        if (node.getID() != null && node.getID() != "")
-//        {
-//            write(ASEmitterTokens.SPACE);
-//            write("id");
-//            write(ASEmitterTokens.EQUAL);
-//            write("\"");
-//            write(node.getID());
-//            write("\"");
-//        }
-//
-//        IMXMLPropertySpecifierNode[] pnodes = node.getPropertySpecifierNodes();
-//
-//        // attributes
-//        emitPropertySpecifiers(pnodes, true);
+        getMXMLWalker().walk(node.getChild(0)); // Array
 
-        write(">");
+        write("</" + node.getName() + ">");
+        indentPop();
+    }
 
-        // child nodes
-        int len = node.getChildCount();
-        if (len > 0)
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitArray(IMXMLArrayNode node)
+    {
+        final int len = node.getChildCount();
+        for (int i = 0; i < len; i++)
+        {
+            IASNode child = node.getChild(i);
+
+            //writeNewline("a", true);
+            getMXMLWalker().walk(child);
+            //writeNewline("~a", false);
+        }
+    }
+
+    //--------------------------------------------------------------------------
+
+    @Override
+    public void emitPropertySpecifiers(IMXMLPropertySpecifierNode[] nodes,
+            boolean emitAttributes)
+    {
+        if (nodes != null)
         {
-            for (int i = 0; i < len; i++)
+            for (IMXMLPropertySpecifierNode cnode : nodes)
             {
-                IASNode cnode = node.getChild(i);
-                
-                getMXMLWalker().walk(cnode);
+                if (!isMXMLContentNode(cnode) && emitAttributes)
+                {
+                    getMXMLWalker().walk(cnode);
+                }
+                else if (isMXMLContentNode(cnode) && !emitAttributes)
+                {
+                    getMXMLWalker().walk(cnode);
+                }
             }
         }
-
-        write("<");
-        write("/");
-        write(cname);
-        write(">");
     }
 
 }

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/driver/flexjs/MXMLFlexJSBackend.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/driver/flexjs/MXMLFlexJSBackend.java?rev=1452099&r1=1452098&r2=1452099&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/driver/flexjs/MXMLFlexJSBackend.java
(original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/driver/flexjs/MXMLFlexJSBackend.java
Sun Mar  3 18:56:59 2013
@@ -20,13 +20,19 @@
 package org.apache.flex.compiler.internal.mxml.driver.flexjs;
 
 import java.io.FilterWriter;
+import java.util.List;
 
 import org.apache.flex.compiler.common.driver.IBackend;
 import org.apache.flex.compiler.internal.mxml.codegen.MXMLBlockWalker;
+import org.apache.flex.compiler.internal.mxml.codegen.flexjs.MXMLFlexJSBlockWalker;
 import org.apache.flex.compiler.internal.mxml.codegen.flexjs.MXMLFlexJSEmitter;
 import org.apache.flex.compiler.internal.mxml.driver.MXMLBackend;
+import org.apache.flex.compiler.internal.mxml.visitor.MXMLNodeSwitch;
 import org.apache.flex.compiler.mxml.codegen.IMXMLEmitter;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
 import org.apache.flex.compiler.tree.mxml.IMXMLFileNode;
+import org.apache.flex.compiler.visitor.IMXMLBlockWalker;
 
 /**
  * A concrete implementation of the {@link IBackend} API where the
@@ -43,4 +49,17 @@ public class MXMLFlexJSBackend extends M
         return new MXMLFlexJSEmitter(out);
     }
 
+    @Override
+    public IMXMLBlockWalker createMXMLWalker(IASProject project,
+            List<ICompilerProblem> errors, IMXMLEmitter emitter)
+    {
+        MXMLFlexJSBlockWalker walker = new MXMLFlexJSBlockWalker(errors, project, emitter);
+
+        MXMLNodeSwitch strategy = new MXMLNodeSwitch(walker);
+
+        walker.setStrategy(strategy);
+
+        return walker;
+    }
+
 }

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/mxml/codegen/IMXMLEmitter.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/mxml/codegen/IMXMLEmitter.java?rev=1452099&r1=1452098&r2=1452099&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/mxml/codegen/IMXMLEmitter.java
(original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/mxml/codegen/IMXMLEmitter.java
Sun Mar  3 18:56:59 2013
@@ -78,17 +78,22 @@ public interface IMXMLEmitter extends IE
     void emitArray(IMXMLArrayNode node);
 
     void emitBoolean(IMXMLBooleanNode node);
-    
+
     void emitInt(IMXMLIntNode node);
 
     void emitNumber(IMXMLNumberNode node);
 
     void emitString(IMXMLStringNode node);
-    
+
     void emitUint(IMXMLUintNode node);
-    
+
     //--------------------------------------------------------------------------
 
     void emitLiteral(IMXMLLiteralNode node);
 
+    //--------------------------------------------------------------------------
+
+    void emitPropertySpecifiers(IMXMLPropertySpecifierNode[] nodes,
+            boolean emitAttributes);
+
 }



Mime
View raw message