You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by er...@apache.org on 2013/02/28 14:53:20 UTC

svn commit: r1451197 [4/4] - in /flex/falcon/trunk: compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/ compiler.jx.tests/src/org/apache/flex/compiler/internal/js/codegen/amd/ compiler.jx.tests/src/org/apache/flex/compiler/internal/js/c...

Added: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/common/codegen/Emitter.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/common/codegen/Emitter.java?rev=1451197&view=auto
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/common/codegen/Emitter.java (added)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/common/codegen/Emitter.java Thu Feb 28 13:53:18 2013
@@ -0,0 +1,234 @@
+/*
+ *
+ *  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.common.codegen;
+
+import java.io.FilterWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.flex.compiler.common.codegen.IEmitter;
+import org.apache.flex.compiler.common.codegen.IEmitterTokens;
+import org.apache.flex.compiler.internal.as.codegen.ASEmitterTokens;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.tree.as.IASNode;
+import org.apache.flex.compiler.visitor.IASBlockWalker;
+
+/**
+ * The base implementation for an ActionScript emitter.
+ * 
+ * @author Michael Schmalle
+ */
+public class Emitter implements IEmitter
+{
+    private final FilterWriter out;
+
+    private boolean bufferWrite;
+
+    protected boolean isBufferWrite()
+    {
+        return bufferWrite;
+    }
+
+    protected void setBufferWrite(boolean value)
+    {
+        bufferWrite = value;
+    }
+
+    private StringBuilder builder;
+
+    protected StringBuilder getBuilder()
+    {
+        return builder;
+    }
+
+    protected void flushBuilder()
+    {
+        setBufferWrite(false);
+        write(builder.toString());
+        builder.setLength(0);
+    }
+
+    protected List<ICompilerProblem> problems;
+
+    // (mschmalle) think about how this should be implemented, we can add our
+    // own problems to this, they don't just have to be parse problems
+    public List<ICompilerProblem> getProblems()
+    {
+        return problems;
+    }
+
+//    private IDocEmitter docEmitter;
+//
+//    @Override
+//    public IDocEmitter getDocEmitter()
+//    {
+//        return docEmitter;
+//    }
+//
+//    @Override
+//    public void setDocEmitter(IDocEmitter value)
+//    {
+//        docEmitter = value;
+//    }
+
+    private int currentIndent = 0;
+
+    protected int getCurrentIndent()
+    {
+        return currentIndent;
+    }
+
+    private IASBlockWalker walker;
+
+    public IASBlockWalker getWalker()
+    {
+        return walker;
+    }
+
+    public void setWalker(IASBlockWalker value)
+    {
+        walker = value;
+    }
+
+    public Emitter(FilterWriter out)
+    {
+        this.out = out;
+        builder = new StringBuilder();
+        problems = new ArrayList<ICompilerProblem>();
+    }
+
+    @Override
+    public void write(IEmitterTokens value)
+    {
+        write(value.getToken());
+    }
+
+    @Override
+    public void write(String value)
+    {
+        try
+        {
+            if (!bufferWrite)
+                out.write(value);
+            else
+                builder.append(value);
+        }
+        catch (IOException e)
+        {
+            throw new RuntimeException(e);
+        }
+    }
+
+    protected String getIndent(int numIndent)
+    {
+        final StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < numIndent; i++)
+            sb.append(ASEmitterTokens.INDENT.getToken());
+        return sb.toString();
+    }
+
+    @Override
+    public void indentPush()
+    {
+        currentIndent++;
+    }
+
+    @Override
+    public void indentPop()
+    {
+        currentIndent--;
+    }
+
+    @Override
+    public void writeNewline()
+    {
+        write(ASEmitterTokens.NEW_LINE);
+        write(getIndent(currentIndent));
+    }
+
+    @Override
+    public void writeNewline(IEmitterTokens value)
+    {
+        writeNewline(value.getToken());
+    }
+
+    @Override
+    public void writeNewline(String value)
+    {
+        write(value);
+        writeNewline();
+    }
+
+    @Override
+    public void writeNewline(IEmitterTokens value, boolean pushIndent)
+    {
+        writeNewline(value.getToken(), pushIndent);
+    }
+
+    @Override
+    public void writeNewline(String value, boolean pushIndent)
+    {
+        if (pushIndent)
+            indentPush();
+        else
+            indentPop();
+        write(value);
+        writeNewline();
+    }
+
+    public void writeSymbol(String value)
+    {
+        write(value);
+    }
+
+    @Override
+    public void writeToken(IEmitterTokens value)
+    {
+        writeToken(value.getToken());
+    }
+
+    @Override
+    public void writeToken(String value)
+    {
+        write(value);
+        write(ASEmitterTokens.SPACE);
+    }
+
+    /**
+     * Takes the node argument and created a String representation if it using
+     * the buffer temporarily.
+     * <p>
+     * Note; This method is still beta, it need more logic if an emitter is
+     * actually using the buffer!
+     * 
+     * @param node The node walk and create a String for.
+     * @return The node's output.
+     */
+    protected String stringifyNode(IASNode node)
+    {
+        setBufferWrite(true);
+        getWalker().walk(node);
+        String result = getBuilder().toString();
+        getBuilder().setLength(0);
+        setBufferWrite(false);
+        return result;
+    }
+}

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

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/JSDocEmitter.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/JSDocEmitter.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/JSDocEmitter.java (original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/JSDocEmitter.java Thu Feb 28 13:53:18 2013
@@ -19,15 +19,29 @@
 
 package org.apache.flex.compiler.internal.js.codegen;
 
-import org.apache.flex.compiler.as.codegen.IEmitter;
-import org.apache.flex.compiler.as.codegen.IEmitterTokens;
+import org.apache.flex.compiler.common.codegen.IDocEmitter;
+import org.apache.flex.compiler.common.codegen.IEmitter;
+import org.apache.flex.compiler.common.codegen.IEmitterTokens;
 import org.apache.flex.compiler.internal.as.codegen.ASEmitterTokens;
-import org.apache.flex.compiler.js.codegen.IJSDocEmitter;
 import org.apache.flex.compiler.js.codegen.IJSEmitter;
 
-public class JSDocEmitter implements IJSDocEmitter, IEmitter
+public class JSDocEmitter implements IDocEmitter, IEmitter
 {
 
+    private int currentIndent = 0;
+
+    @Override
+    public void indentPush()
+    {
+        currentIndent++;
+    }
+
+    @Override
+    public void indentPop()
+    {
+        currentIndent--;
+    }
+
     @Override
     public void write(IEmitterTokens value)
     {

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/JSDocEmitterTokens.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/JSDocEmitterTokens.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/JSDocEmitterTokens.java (original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/JSDocEmitterTokens.java Thu Feb 28 13:53:18 2013
@@ -1,6 +1,6 @@
 package org.apache.flex.compiler.internal.js.codegen;
 
-import org.apache.flex.compiler.as.codegen.IEmitterTokens;
+import org.apache.flex.compiler.common.codegen.IEmitterTokens;
 
 public enum JSDocEmitterTokens implements IEmitterTokens
 {

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/JSEmitterTokens.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/JSEmitterTokens.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/JSEmitterTokens.java (original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/JSEmitterTokens.java Thu Feb 28 13:53:18 2013
@@ -1,6 +1,6 @@
 package org.apache.flex.compiler.internal.js.codegen;
 
-import org.apache.flex.compiler.as.codegen.IEmitterTokens;
+import org.apache.flex.compiler.common.codegen.IEmitterTokens;
 
 public enum JSEmitterTokens implements IEmitterTokens
 {

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/JSSharedData.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/JSSharedData.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/JSSharedData.java (original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/JSSharedData.java Thu Feb 28 13:53:18 2013
@@ -25,7 +25,7 @@ import java.util.Calendar;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
-import org.apache.flex.compiler.clients.IBackend;
+import org.apache.flex.compiler.common.driver.IBackend;
 import org.apache.flex.compiler.internal.workspaces.Workspace;
 
 // TODO (mschmalle) This class sucks, figure out some other way instead of using

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/amd/JSAMDEmitterTokens.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/amd/JSAMDEmitterTokens.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/amd/JSAMDEmitterTokens.java (original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/amd/JSAMDEmitterTokens.java Thu Feb 28 13:53:18 2013
@@ -1,6 +1,6 @@
 package org.apache.flex.compiler.internal.js.codegen.amd;
 
-import org.apache.flex.compiler.as.codegen.IEmitterTokens;
+import org.apache.flex.compiler.common.codegen.IEmitterTokens;
 
 public enum JSAMDEmitterTokens implements IEmitterTokens
 {

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/goog/JSGoogDocEmitter.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/goog/JSGoogDocEmitter.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/goog/JSGoogDocEmitter.java (original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/goog/JSGoogDocEmitter.java Thu Feb 28 13:53:18 2013
@@ -19,9 +19,9 @@
 
 package org.apache.flex.compiler.internal.js.codegen.goog;
 
-import org.apache.flex.compiler.as.codegen.IEmitterTokens;
 import org.apache.flex.compiler.common.ASModifier;
 import org.apache.flex.compiler.common.DependencyType;
+import org.apache.flex.compiler.common.codegen.IEmitterTokens;
 import org.apache.flex.compiler.constants.IASGlobalFunctionConstants;
 import org.apache.flex.compiler.constants.IASKeywordConstants;
 import org.apache.flex.compiler.constants.IASLanguageConstants;

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/goog/JSGoogDocEmitterTokens.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/goog/JSGoogDocEmitterTokens.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/goog/JSGoogDocEmitterTokens.java (original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/goog/JSGoogDocEmitterTokens.java Thu Feb 28 13:53:18 2013
@@ -1,6 +1,6 @@
 package org.apache.flex.compiler.internal.js.codegen.goog;
 
-import org.apache.flex.compiler.as.codegen.IEmitterTokens;
+import org.apache.flex.compiler.common.codegen.IEmitterTokens;
 
 public enum JSGoogDocEmitterTokens implements IEmitterTokens
 {

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/goog/JSGoogEmitter.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/goog/JSGoogEmitter.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/goog/JSGoogEmitter.java (original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/goog/JSGoogEmitter.java Thu Feb 28 13:53:18 2013
@@ -27,6 +27,7 @@ import java.util.Map;
 
 import org.apache.flex.compiler.common.ASModifier;
 import org.apache.flex.compiler.common.ModifiersSet;
+import org.apache.flex.compiler.common.codegen.IDocEmitter;
 import org.apache.flex.compiler.constants.IASGlobalFunctionConstants.BuiltinType;
 import org.apache.flex.compiler.constants.IASLanguageConstants;
 import org.apache.flex.compiler.definitions.IClassDefinition;
@@ -89,6 +90,12 @@ public class JSGoogEmitter extends JSEmi
         return (IJSGoogDocEmitter) getDocEmitter();
     }
 
+    @Override
+    public IDocEmitter getDocEmitter()
+    {
+        return new JSGoogDocEmitter(this);
+    }
+
     //--------------------------------------------------------------------------
     // 
     //--------------------------------------------------------------------------

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/goog/JSGoogEmitterTokens.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/goog/JSGoogEmitterTokens.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/goog/JSGoogEmitterTokens.java (original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/codegen/goog/JSGoogEmitterTokens.java Thu Feb 28 13:53:18 2013
@@ -1,6 +1,6 @@
 package org.apache.flex.compiler.internal.js.codegen.goog;
 
-import org.apache.flex.compiler.as.codegen.IEmitterTokens;
+import org.apache.flex.compiler.common.codegen.IEmitterTokens;
 
 public enum JSGoogEmitterTokens implements IEmitterTokens
 {

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/JSBackend.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/JSBackend.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/JSBackend.java (original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/JSBackend.java Thu Feb 28 13:53:18 2013
@@ -24,9 +24,9 @@ import java.io.StringWriter;
 import java.util.List;
 
 import org.apache.flex.compiler.as.codegen.IASEmitter;
-import org.apache.flex.compiler.as.codegen.IDocEmitter;
-import org.apache.flex.compiler.clients.IBackend;
 import org.apache.flex.compiler.clients.JSConfiguration;
+import org.apache.flex.compiler.common.codegen.IDocEmitter;
+import org.apache.flex.compiler.common.driver.IBackend;
 import org.apache.flex.compiler.config.Configurator;
 import org.apache.flex.compiler.internal.as.codegen.ASAfterNodeStrategy;
 import org.apache.flex.compiler.internal.as.codegen.ASBeforeNodeStrategy;
@@ -37,12 +37,11 @@ import org.apache.flex.compiler.internal
 import org.apache.flex.compiler.internal.js.codegen.JSEmitter;
 import org.apache.flex.compiler.internal.js.codegen.JSFilterWriter;
 import org.apache.flex.compiler.internal.js.codegen.JSWriter;
-import org.apache.flex.compiler.internal.mxml.codegen.MXMLBlockWalker;
-import org.apache.flex.compiler.internal.mxml.codegen.MXMLNodeSwitch;
 import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
 import org.apache.flex.compiler.internal.targets.JSTarget;
 import org.apache.flex.compiler.js.codegen.IJSEmitter;
 import org.apache.flex.compiler.js.codegen.IJSWriter;
+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.targets.ITargetProgressMonitor;
@@ -102,6 +101,13 @@ public class JSBackend implements IBacke
     }
 
     @Override
+    public IMXMLBlockWalker createMXMLWalker(IASProject project,
+            List<ICompilerProblem> errors, IMXMLEmitter emitter)
+    {
+        return null;
+    }
+
+    @Override
     public JSFilterWriter createWriterBuffer(IASProject project)
     {
         StringWriter out = new StringWriter();
@@ -124,19 +130,15 @@ public class JSBackend implements IBacke
     }
 
     @Override
-    public IJSEmitter createEmitter(FilterWriter out)
+    public IASEmitter createEmitter(FilterWriter out)
     {
         return new JSEmitter(out);
     }
 
     @Override
-    public IMXMLBlockWalker createMXMLWalker(IASEmitter emitter,
-            IASProject project, List<ICompilerProblem> errors)
+    public IMXMLEmitter createMXMLEmitter(FilterWriter out)
     {
-        MXMLBlockWalker walker = new MXMLBlockWalker(emitter, project, errors);
-        MXMLNodeSwitch strategy = new MXMLNodeSwitch(walker);
-        walker.setStrategy(strategy);
-        return walker;
+        return null;
     }
 
 }

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/amd/AMDBackend.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/amd/AMDBackend.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/amd/AMDBackend.java (original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/amd/AMDBackend.java Thu Feb 28 13:53:18 2013
@@ -22,8 +22,8 @@ package org.apache.flex.compiler.interna
 import java.io.FilterWriter;
 
 import org.apache.flex.compiler.as.codegen.IASEmitter;
-import org.apache.flex.compiler.as.codegen.IDocEmitter;
-import org.apache.flex.compiler.clients.IBackend;
+import org.apache.flex.compiler.common.codegen.IDocEmitter;
+import org.apache.flex.compiler.common.driver.IBackend;
 import org.apache.flex.compiler.internal.js.codegen.amd.JSAMDDocEmitter;
 import org.apache.flex.compiler.internal.js.codegen.amd.JSAMDEmitter;
 import org.apache.flex.compiler.internal.js.driver.JSBackend;

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/goog/GoogBackend.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/goog/GoogBackend.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/goog/GoogBackend.java (original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/goog/GoogBackend.java Thu Feb 28 13:53:18 2013
@@ -22,8 +22,8 @@ package org.apache.flex.compiler.interna
 import java.io.FilterWriter;
 
 import org.apache.flex.compiler.as.codegen.IASEmitter;
-import org.apache.flex.compiler.as.codegen.IDocEmitter;
-import org.apache.flex.compiler.clients.IBackend;
+import org.apache.flex.compiler.common.codegen.IDocEmitter;
+import org.apache.flex.compiler.common.driver.IBackend;
 import org.apache.flex.compiler.config.Configurator;
 import org.apache.flex.compiler.internal.js.codegen.goog.JSGoogDocEmitter;
 import org.apache.flex.compiler.internal.js.codegen.goog.JSGoogEmitter;

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=1451197&r1=1451196&r2=1451197&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 Thu Feb 28 13:53:18 2013
@@ -21,9 +21,9 @@ package org.apache.flex.compiler.interna
 
 import java.util.List;
 
-import org.apache.flex.compiler.as.codegen.IASEmitter;
 import org.apache.flex.compiler.definitions.IClassDefinition;
 import org.apache.flex.compiler.definitions.IPackageDefinition;
+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.as.IASNode;
@@ -35,7 +35,6 @@ import org.apache.flex.compiler.tree.mxm
 import org.apache.flex.compiler.tree.mxml.IMXMLPropertySpecifierNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLScriptNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLStyleSpecifierNode;
-import org.apache.flex.compiler.visitor.IASBlockWalker;
 import org.apache.flex.compiler.visitor.IASNodeStrategy;
 import org.apache.flex.compiler.visitor.IMXMLBlockVisitor;
 import org.apache.flex.compiler.visitor.IMXMLBlockWalker;
@@ -47,9 +46,9 @@ public class MXMLBlockWalker implements 
 {
     private List<ICompilerProblem> errors;
 
-    private IASBlockWalker visitor;
+    private IMXMLBlockWalker visitor;
 
-    private IASEmitter emitter;
+    private IMXMLEmitter emitter;
 
     //----------------------------------
     // project
@@ -89,14 +88,14 @@ public class MXMLBlockWalker implements 
         strategy.handle(node);
     }
 
-    public MXMLBlockWalker(IASEmitter emitter, IASProject project,
-            List<ICompilerProblem> errors)
+    public MXMLBlockWalker(List<ICompilerProblem> errors, IASProject project,
+            IMXMLEmitter emitter)
     {
         this.emitter = emitter;
         this.project = project;
         this.errors = errors;
 
-        this.visitor = emitter.getWalker();
+        this.visitor = emitter.getMXMLWalker();
     }
 
     public void visitFile(IMXMLFileNode node)
@@ -124,7 +123,7 @@ public class MXMLBlockWalker implements 
                 .getContainingScope().getDefinition();
 
         emitter.emitPackageHeader(definition2);
-        emitter.emitPackageHeaderContents(definition2);
+        //emitter.emitPackageHeaderContents(definition2);
 
         // main contents of MXML are produced
         IMXMLScriptNode[] snodes = node.getScriptNodes();

Added: 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=1451197&view=auto
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLEmitter.java (added)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLEmitter.java Thu Feb 28 13:53:18 2013
@@ -0,0 +1,71 @@
+/*
+ *
+ *  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;
+
+import java.io.FilterWriter;
+
+import org.apache.flex.compiler.definitions.IPackageDefinition;
+import org.apache.flex.compiler.internal.common.codegen.Emitter;
+import org.apache.flex.compiler.mxml.codegen.IMXMLEmitter;
+
+/**
+ * The base implementation for an MXML emitter.
+ * 
+ * @author Erik de Bruin
+ */
+public class MXMLEmitter extends Emitter implements IMXMLEmitter
+{
+
+    private MXMLBlockWalker walker;
+
+    public MXMLBlockWalker getMXMLWalker()
+    {
+        return walker;
+    }
+
+    public void setMXMLWalker(MXMLBlockWalker value)
+    {
+        walker = value;
+    }
+
+    public MXMLEmitter(FilterWriter out)
+    {
+        super(out);
+    }
+
+    //--------------------------------------------------------------------------
+
+    public void emitPackageHeader(IPackageDefinition definition)
+    {
+        write("Hello World ;-)");
+
+//        IPackageNode node = definition.getNode();
+//        String name = node.getQualifiedName();
+//        if (name != null && !name.equals(""))
+//        {
+//            write(MXMLEmitterTokens.SPACE);
+//            getWalker().walk(node.getNameExpressionNode());
+//        }
+//
+//        write(MXMLEmitterTokens.SPACE);
+//        write(MXMLEmitterTokens.BLOCK_OPEN);
+    }
+    
+}

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

Added: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLEmitterTokens.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLEmitterTokens.java?rev=1451197&view=auto
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLEmitterTokens.java (added)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLEmitterTokens.java Thu Feb 28 13:53:18 2013
@@ -0,0 +1,202 @@
+/*
+ *
+ *  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;
+
+import org.apache.flex.compiler.common.codegen.IEmitterTokens;
+
+/**
+ * @author Michael Schmalle
+ * @author Erik de Bruin
+ */
+public enum MXMLEmitterTokens implements IEmitterTokens
+{
+    INDENT("\t"), NEW_LINE("\n"), SINGLE_QUOTE("'"), SPACE(" "),
+
+    INTERNAL("internal"), PRIVATE("private"), PROTECTED("protected"),
+
+    ANY_TYPE("*"), UNDEFINED("undefined"),
+
+    //    int EOF = 1;
+    //    int NULL_TREE_LOOKAHEAD = 3;
+    //    int HIDDEN_TOKEN_COMMENT = 4;
+    //    int HIDDEN_TOKEN_SINGLE_LINE_COMMENT = 5;
+    //    int HIDDEN_TOKEN_STAR_ASSIGNMENT = 6;
+    //    int HIDDEN_TOKEN_BUILTIN_NS = 7;
+    //    int HIDDEN_TOKEN_MULTI_LINE_COMMENT = 8;
+    //    int TOKEN_ASDOC_TAG = 9;
+    //    int TOKEN_ASDOC_TEXT = 10;
+    EACH("each"),
+    //    int TOKEN_RESERVED_WORD_CONFIG = 12;
+    //    int TOKEN_KEYWORD_INCLUDE = 13;
+    //    int TOKEN_RESERVED_WORD_GOTO = 14;
+    //    int TOKEN_IDENTIFIER = 15;
+    FINALLY("finally"),
+    CATCH("catch"),
+    //    int TOKEN_LITERAL_STRING = 18;
+    BLOCK_OPEN("{"),
+    BLOCK_CLOSE("}"),
+    //    int TOKEN_NAMESPACE_NAME = 21;
+    //    int TOKEN_OPERATOR_NS_QUALIFIER = 22;
+    //    int TOKEN_NAMESPACE_ANNOTATION = 23;
+    COLON(":"),
+    IMPORT("import"),
+    //    int TOKEN_KEYWORD_USE = 26;
+    NAMESPACE("namespace"),
+    //    int TOKEN_ASDOC_COMMENT = 28;
+    FINAL("final"),
+    DYNAMIC("dynamic"),
+    OVERRIDE("override"),
+    //    int TOKEN_MODIFIER_STATIC = 32;
+    //    int TOKEN_MODIFIER_NATIVE = 33;
+    //    int TOKEN_MODIFIER_VIRTUAL = 34;
+    MEMBER_ACCESS("."),
+    //    int TOKEN_ATTRIBUTE = 36;
+    SQUARE_OPEN("["),
+    PACKAGE("package"),
+    INTERFACE("interface"),
+    EXTENDS("extends"),
+    COMMA(","),
+    CLASS("class"),
+    IMPLEMENTS("implements"),
+    FUNCTION("function"),
+    PAREN_CLOSE(")"),
+    PAREN_OPEN("("),
+    GET("get"),
+    SET("set"),
+    ELLIPSIS("..."),
+    VAR("var"),
+    CONST("const"),
+    //    int TOKEN_OPERATOR_ASSIGNMENT = 52;
+    //    int TOKEN_DIRECTIVE_DEFAULT_XML = 53;
+    SEMICOLON(";"),
+    RETURN("return"),
+    THROW("throw"),
+    FOR("for"),
+    //    int TOKEN_KEYWORD_IN = 58;
+    DO("do"),
+    WHILE("while"),
+    //    int TOKEN_KEYWORD_CONTINUE = 61;
+    //    int TOKEN_KEYWORD_BREAK = 62;
+    WITH("with"),
+    TRY("try"),
+    IF("if"),
+    ELSE("else"),
+    SWITCH("switch"),
+    CASE("case"),
+    DEFAULT("default"),
+    SUPER("super"),
+    //    int TOKEN_TYPED_COLLECTION_OPEN = 71;
+    //    int TOKEN_TYPED_COLLECTION_CLOSE = 72;
+    GREATER_THAN(">"),
+    //    int TOKEN_OPERATOR_LOGICAL_AND_ASSIGNMENT = 74;
+    //    int TOKEN_OPERATOR_LOGICAL_OR_ASSIGNMENT = 75;
+    //    int TOKEN_OPERATOR_PLUS_ASSIGNMENT = 76;
+    //    int TOKEN_OPERATOR_MINUS_ASSIGNMENT = 77;
+    //    int TOKEN_OPERATOR_MULTIPLICATION_ASSIGNMENT = 78;
+    //    int TOKEN_OPERATOR_DIVISION_ASSIGNMENT = 79;
+    //    int TOKEN_OPERATOR_MODULO_ASSIGNMENT = 80;
+    //    int TOKEN_OPERATOR_BITWISE_AND_ASSIGNMENT = 81;
+    //    int TOKEN_OPERATOR_BITWISE_OR_ASSIGNMENT = 82;
+    //    int TOKEN_OPERATOR_BITWISE_XOR_ASSIGNMENT = 83;
+    //    int TOKEN_OPERATOR_BITWISE_LEFT_SHIFT_ASSIGNMENT = 84;
+    //    int TOKEN_OPERATOR_BITWISE_RIGHT_SHIFT_ASSIGNMENT = 85;
+    //    int TOKEN_OPERATOR_BITWISE_UNSIGNED_RIGHT_SHIFT_ASSIGNMENT = 86;
+    TERNARY("?"),
+    LOGICAL_OR("||"),
+    LOGICAL_AND("&&"),
+    //    int TOKEN_OPERATOR_BITWISE_OR = 90;
+    //    int TOKEN_OPERATOR_BITWISE_XOR = 91;
+    //    int TOKEN_OPERATOR_BITWISE_AND = 92;
+    EQUAL("="),
+    //    int TOKEN_OPERATOR_NOT_EQUAL = 94;
+    //    int TOKEN_OPERATOR_STRICT_EQUAL = 95;
+    STRICT_NOT_EQUAL("!=="),
+    //    int TOKEN_OPERATOR_GREATER_THAN_EQUALS = 97;
+    LESS_THAN("<"),
+    //    int TOKEN_OPERATOR_LESS_THAN_EQUALS = 99;
+    //    int TOKEN_KEYWORD_INSTANCEOF = 100;
+    IS("is"),
+    AS("as"),
+    //    int TOKEN_OPERATOR_BITWISE_LEFT_SHIFT = 103;
+    //    int TOKEN_OPERATOR_BITWISE_RIGHT_SHIFT = 104;
+    //    int TOKEN_OPERATOR_BITWISE_UNSIGNED_RIGHT_SHIFT = 105;
+    MINUS("-"),
+    //    int TOKEN_OPERATOR_PLUS = 107;
+    //    int TOKEN_OPERATOR_DIVISION = 108;
+    //    int TOKEN_OPERATOR_MODULO = 109;
+    //    int TOKEN_OPERATOR_STAR = 110;
+    //    int TOKEN_KEYWORD_DELETE = 111;
+    //    int TOKEN_OPERATOR_INCREMENT = 112;
+    //    int TOKEN_OPERATOR_DECREMENT = 113;
+    VOID("void"),
+    TYPEOF("typeof"),
+    //    int TOKEN_OPERATOR_BITWISE_NOT = 116;
+    //    int TOKEN_OPERATOR_LOGICAL_NOT = 117;
+    NULL("null"),
+    TRUE("true"),
+    //    int TOKEN_KEYWORD_FALSE = 120;
+    THIS("this"),
+    //    int TOKEN_VOID_0 = 122;
+    //    int TOKEN_LITERAL_REGEXP = 123;
+    //    int TOKEN_LITERAL_NUMBER = 124;
+    //    int TOKEN_LITERAL_HEX_NUMBER = 125;
+    SQUARE_CLOSE("]"),
+    //    int TOKEN_TYPED_LITERAL_OPEN = 127;
+    //    int TOKEN_TYPED_LITERAL_CLOSE = 128;
+    //    int TOKEN_E4X_WHITESPACE = 129;
+    //    int TOKEN_E4X_COMMENT = 130;
+    //    int TOKEN_E4X_CDATA = 131;
+    //    int TOKEN_E4X_PROCESSING_INSTRUCTION = 132;
+    //    int TOKEN_E4X_ENTITY = 133;
+    //    int TOKEN_E4X_DECIMAL_ENTITY = 134;
+    //    int TOKEN_E4X_HEX_ENTITY = 135;
+    //    int TOKEN_E4X_TEXT = 136;
+    //    int TOKEN_E4X_STRING = 137;
+    //    int TOKEN_E4X_OPEN_TAG_START = 138;
+    //    int TOKEN_E4X_CLOSE_TAG_START = 139;
+    //    int HIDDEN_TOKEN_E4X = 140;
+    //    int TOKEN_E4X_NAME = 141;
+    //    int TOKEN_E4X_TAG_END = 142;
+    //    int TOKEN_E4X_EMPTY_TAG_END = 143;
+    //    int TOKEN_E4X_XMLNS = 144;
+    //    int TOKEN_E4X_NAME_DOT = 145;
+    //    int TOKEN_E4X_DOTTED_NAME_PART = 146;
+    //    int TOKEN_E4X_EQUALS = 147;
+    //    int TOKEN_LITERAL_XMLLIST = 148;
+    //    int TOKEN_E4X_XMLLIST_CLOSE = 149;
+    //    int TOKEN_E4X_BINDING_OPEN = 150;
+    //    int TOKEN_E4X_BINDING_CLOSE = 151;
+    NEW("new"),
+    ATSIGN("@"),
+    //    int TOKEN_OPERATOR_DESCENDANT_ACCESS = 154;
+    ;
+
+    private String token;
+
+    private MXMLEmitterTokens(String value)
+    {
+        token = value;
+    }
+
+    public String getToken()
+    {
+        return token;
+    }
+}

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

Added: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/driver/MXMLBackend.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/driver/MXMLBackend.java?rev=1451197&view=auto
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/driver/MXMLBackend.java (added)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/driver/MXMLBackend.java Thu Feb 28 13:53:18 2013
@@ -0,0 +1,71 @@
+/*
+ *
+ *  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.driver;
+
+import java.io.FilterWriter;
+import java.util.List;
+
+import org.apache.flex.compiler.common.driver.IBackend;
+import org.apache.flex.compiler.internal.js.driver.JSBackend;
+import org.apache.flex.compiler.internal.mxml.codegen.MXMLBlockWalker;
+import org.apache.flex.compiler.internal.mxml.codegen.MXMLEmitter;
+import org.apache.flex.compiler.internal.mxml.visitor.MXMLNodeSwitch;
+import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
+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
+ * {@link MXMLBlockWalker} is used to traverse the {@link IMXMLFileNode} AST.
+ * 
+ * @author Erik de Bruin
+ */
+public class MXMLBackend extends JSBackend
+{
+
+    @Override
+    public ISourceFileHandler getSourceFileHandlerInstance()
+    {
+        return MXMLSourceFileHandler.INSTANCE;
+    }
+
+    @Override
+    public IMXMLEmitter createMXMLEmitter(FilterWriter out)
+    {
+        return new MXMLEmitter(out);
+    }
+
+    @Override
+    public IMXMLBlockWalker createMXMLWalker(IASProject project,
+            List<ICompilerProblem> errors, IMXMLEmitter emitter)
+    {
+        MXMLBlockWalker walker = new MXMLBlockWalker(errors, project, emitter);
+
+        MXMLNodeSwitch strategy = new MXMLNodeSwitch(walker);
+
+        walker.setStrategy(strategy);
+
+        return walker;
+    }
+
+}

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

Added: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/driver/MXMLSourceFileHandler.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/driver/MXMLSourceFileHandler.java?rev=1451197&view=auto
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/driver/MXMLSourceFileHandler.java (added)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/driver/MXMLSourceFileHandler.java Thu Feb 28 13:53:18 2013
@@ -0,0 +1,84 @@
+/*
+ *
+ *  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.driver;
+
+import org.apache.flex.compiler.internal.js.driver.JSCompilationUnit;
+import org.apache.flex.compiler.internal.projects.CompilerProject;
+import org.apache.flex.compiler.internal.projects.DefinitionPriority;
+import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
+import org.apache.flex.compiler.internal.units.ASCompilationUnit;
+import org.apache.flex.compiler.units.ICompilationUnit;
+
+/**
+ * Implementation of ISourceFileHandler that constructs
+ * {@link ASCompilationUnit}'s. MXMLSourceFileHandler is the SourceFileHandler
+ * that provides JSCompilationUnit for *.mxml files. JSDriver registers
+ * MXMLSourceFileHandler at FlexApplicationProject. This implementation is part of
+ * FalconJS. For more details on FalconJS see org.apache.flex.compiler.JSDriver
+ */
+public final class MXMLSourceFileHandler implements ISourceFileHandler
+{
+
+    public static final String EXTENSION = "mxml"; //$NON-NLS-1$
+    public static final MXMLSourceFileHandler INSTANCE = new MXMLSourceFileHandler();
+
+    private MXMLSourceFileHandler()
+    {
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String[] getExtensions()
+    {
+        return new String[] { EXTENSION };
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public ICompilationUnit createCompilationUnit(CompilerProject proj,
+            String path, DefinitionPriority.BasePriority basePriority,
+            int order, String qname, String locale)
+    {
+        return new JSCompilationUnit(proj, path, basePriority, qname);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean needCompilationUnit(CompilerProject project, String path,
+            String qname, String locale)
+    {
+        return true;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean canCreateInvisibleCompilationUnit()
+    {
+        return false;
+    }
+}

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

Copied: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/visitor/MXMLNodeSwitch.java (from r1451144, flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLNodeSwitch.java)
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/visitor/MXMLNodeSwitch.java?p2=flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/visitor/MXMLNodeSwitch.java&p1=flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLNodeSwitch.java&r1=1451144&r2=1451197&rev=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/codegen/MXMLNodeSwitch.java (original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/mxml/visitor/MXMLNodeSwitch.java Thu Feb 28 13:53:18 2013
@@ -17,7 +17,7 @@
  *
  */
 
-package org.apache.flex.compiler.internal.mxml.codegen;
+package org.apache.flex.compiler.internal.mxml.visitor;
 
 import org.apache.flex.compiler.tree.as.IASNode;
 import org.apache.flex.compiler.tree.mxml.IMXMLDocumentNode;
@@ -40,6 +40,8 @@ public class MXMLNodeSwitch implements I
     @Override
     public void handle(IASNode node)
     {
+        System.out.println(node.getNodeID().getParaphrase());
+        
         switch (node.getNodeID())
         {
         case MXMLDocumentID:

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/js/codegen/IJSDocEmitter.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/js/codegen/IJSDocEmitter.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/js/codegen/IJSDocEmitter.java (original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/js/codegen/IJSDocEmitter.java Thu Feb 28 13:53:18 2013
@@ -19,7 +19,7 @@
 
 package org.apache.flex.compiler.js.codegen;
 
-import org.apache.flex.compiler.as.codegen.IDocEmitter;
+import org.apache.flex.compiler.common.codegen.IDocEmitter;
 
 /**
  * The {@link IJSDocEmitter} interface allows the abstraction of JavaScript

Added: 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=1451197&view=auto
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/mxml/codegen/IMXMLEmitter.java (added)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/mxml/codegen/IMXMLEmitter.java Thu Feb 28 13:53:18 2013
@@ -0,0 +1,45 @@
+/*
+ *
+ *  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.mxml.codegen;
+
+import java.io.Writer;
+
+import org.apache.flex.compiler.common.codegen.IEmitter;
+import org.apache.flex.compiler.definitions.IPackageDefinition;
+import org.apache.flex.compiler.internal.mxml.codegen.MXMLBlockWalker;
+import org.apache.flex.compiler.visitor.IASNodeStrategy;
+import org.apache.flex.compiler.visitor.IMXMLBlockWalker;
+
+/**
+ * The {@link IMXMLEmitter} interface allows abstraction between the
+ * {@link IASNodeStrategy} and the current output buffer {@link Writer}.
+ * 
+ * @author Michael Schmalle
+ */
+public interface IMXMLEmitter extends IEmitter
+{
+
+    IMXMLBlockWalker getMXMLWalker();
+
+    void setMXMLWalker(MXMLBlockWalker mxmlBlockWalker);
+
+    void emitPackageHeader(IPackageDefinition definition);
+
+}

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

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/targets/IJSTarget.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/targets/IJSTarget.java?rev=1451197&r1=1451196&r2=1451197&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/targets/IJSTarget.java (original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/targets/IJSTarget.java Thu Feb 28 13:53:18 2013
@@ -21,8 +21,8 @@ package org.apache.flex.compiler.targets
 
 import java.util.Collection;
 
-import org.apache.flex.compiler.clients.IBackend;
 import org.apache.flex.compiler.clients.JSConfiguration;
+import org.apache.flex.compiler.common.driver.IBackend;
 import org.apache.flex.compiler.js.IJSApplication;
 import org.apache.flex.compiler.problems.ICompilerProblem;
 import org.apache.flex.compiler.projects.IASProject;