You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ms...@apache.org on 2012/12/21 18:48:56 UTC

svn commit: r1425049 - in /incubator/flex/whiteboard/mschmalle/falconjx: compiler.jx.tests/src/org/apache/flex/js/internal/driver/ compiler.jx/src/org/apache/flex/as/ compiler.jx/src/org/apache/flex/compiler/as/ compiler.jx/src/org/apache/flex/compiler...

Author: mschmalle
Date: Fri Dec 21 17:48:55 2012
New Revision: 1425049

URL: http://svn.apache.org/viewvc?rev=1425049&view=rev
Log:
Flex:FalconJx
- added actionscript layer to app, target, emitters and writers to allow for as code testing
- added TestPackage for preliminary package/class production
- all tests pass 

Added:
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestClass.java   (with props)
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestPackage.java   (with props)
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IASEmitter.java   (with props)
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IASWriter.java   (with props)
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IApplication.java   (with props)
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASFilterWriter.java   (with props)
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASWriter.java   (with props)
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/ASBackend.java   (with props)
Removed:
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/as/
Modified:
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestWalkerBase.java
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/clients/IBackend.java
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/JSBackend.java
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/strategy/AfterNodeStrategy.java
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/strategy/BeforeNodeStrategy.java
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/js/codgen/ASBlockWalker.java
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/js/codgen/JSFilterWriter.java
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/js/codgen/JSWriter.java
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/js/IJSApplication.java
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/js/IJSEmitter.java
    incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/js/IJSWriter.java

Added: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestClass.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestClass.java?rev=1425049&view=auto
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestClass.java (added)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestClass.java Fri Dec 21 17:48:55 2012
@@ -0,0 +1,41 @@
+/*
+ *
+ *  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.js.internal.driver;
+
+import org.junit.Test;
+
+/**
+ * This class tests the production of valid ActionScript3 code for Class
+ * production.
+ * 
+ * @author Michael Schmalle
+ */
+public class TestClass extends TestWalkerBase
+{
+    //--------------------------------------------------------------------------
+    // Accessor
+    //--------------------------------------------------------------------------
+
+    @Test
+    public void testGetAccessor()
+    {
+
+    }
+}

Propchange: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestClass.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestPackage.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestPackage.java?rev=1425049&view=auto
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestPackage.java (added)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestPackage.java Fri Dec 21 17:48:55 2012
@@ -0,0 +1,85 @@
+/*
+ *
+ *  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.js.internal.driver;
+
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.junit.Test;
+
+/**
+ * This class tests the production of valid ActionScript3 code for Package
+ * production.
+ * 
+ * @author Michael Schmalle
+ */
+public class TestPackage extends TestWalkerBase
+{
+    //--------------------------------------------------------------------------
+    // Package
+    //--------------------------------------------------------------------------
+
+    @Test
+    public void testPackage_Simple()
+    {
+        IFileNode node = getFileNode("package{}");
+        visitor.visitFile(node);
+        assertOut("package {\n}");
+    }
+
+    @Test
+    public void testPackage_Name()
+    {
+        IFileNode node = getFileNode("package foo.bar.baz {}");
+        visitor.visitFile(node);
+        assertOut("package foo.bar.baz {\n}");
+    }
+
+    @Test
+    public void testPackageSimple_Class()
+    {
+        IFileNode node = getFileNode("package {public class A{}}");
+        visitor.visitFile(node);
+        assertOut("package {\n\tpublic class A {\n\t}\n}");
+    }
+
+    @Test
+    public void testPackageQualified_Class()
+    {
+        IFileNode node = getFileNode("package foo.bar.baz {public class A{}}");
+        visitor.visitFile(node);
+        assertOut("package foo.bar.baz {\n\tpublic class A {\n\t}\n}");
+    }
+
+    @Test
+    public void testPackageQualified_ClassBody()
+    {
+        IFileNode node = getFileNode("package foo.bar.baz {public class A{public function A(){}}}");
+        visitor.visitFile(node);
+        assertOut("package foo.bar.baz {\n\tpublic class A {\n\t\tpublic function A() {\n\t\t}\n\t}\n}");
+    }
+
+    @Test
+    public void testPackageQualified_ClassBodyMethodContents()
+    {
+        IFileNode node = getFileNode("package foo.bar.baz {public class A{public function A(){if (a){for each(var i:Object in obj){doit();}}}}}");
+        visitor.visitFile(node);
+        assertOut("package foo.bar.baz {\n\tpublic class A {\n\t\tpublic function A() {\n\t\t\t" +
+        		"if (a) {\n\t\t\t\tfor each (var i:Object in obj) {\n\t\t\t\t\tdoit();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}");
+    }
+}

Propchange: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestPackage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestWalkerBase.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestWalkerBase.java?rev=1425049&r1=1425048&r2=1425049&view=diff
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestWalkerBase.java (original)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/js/internal/driver/TestWalkerBase.java Fri Dec 21 17:48:55 2012
@@ -7,8 +7,8 @@ import java.io.StringWriter;
 import java.io.Writer;
 
 import org.apache.flex.compiler.clients.IBackend;
-import org.apache.flex.compiler.internal.driver.JSBackend;
-import org.apache.flex.compiler.internal.js.codgen.JSFilterWriter;
+import org.apache.flex.compiler.internal.as.codegen.ASFilterWriter;
+import org.apache.flex.compiler.internal.driver.ASBackend;
 import org.apache.flex.compiler.visitor.IASBlockVisitor;
 import org.junit.After;
 
@@ -20,7 +20,7 @@ public class TestWalkerBase extends Test
 
     private IBackend backend;
 
-    private JSFilterWriter writer;
+    private ASFilterWriter writer;
 
     protected String mCode;
 
@@ -29,9 +29,9 @@ public class TestWalkerBase extends Test
     {
         super.setUp();
 
-        backend = new JSBackend();
+        backend = new ASBackend();
         out = new StringWriter();
-        writer = new JSFilterWriter(out);
+        writer = new ASFilterWriter(out);
         visitor = backend.createWalker(project, errors, writer);
     }
 

Added: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IASEmitter.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IASEmitter.java?rev=1425049&view=auto
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IASEmitter.java (added)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IASEmitter.java Fri Dec 21 17:48:55 2012
@@ -0,0 +1,141 @@
+/*
+ *
+ *  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.as;
+
+import java.io.Writer;
+
+import org.apache.flex.compiler.internal.tree.as.FunctionObjectNode;
+import org.apache.flex.compiler.tree.as.IExpressionNode;
+import org.apache.flex.compiler.tree.as.IFunctionNode;
+import org.apache.flex.compiler.tree.as.IGetterNode;
+import org.apache.flex.compiler.tree.as.ISetterNode;
+import org.apache.flex.compiler.tree.as.IVariableNode;
+import org.apache.flex.compiler.visitor.IASBlockWalker;
+import org.apache.flex.compiler.visitor.IASNodeStrategy;
+
+/**
+ * The {@link IASEmitter} interface allows abstraction between the
+ * {@link IASNodeStrategy} and the current output buffer {@link Writer}.
+ * 
+ * @author Michael Schmalle
+ */
+public interface IASEmitter
+{
+    IASBlockWalker getWalker();
+
+    void setWalker(IASBlockWalker asBlockWalker);
+
+    /**
+     * Writes a string to the writer.
+     * 
+     * @param value The string to write to the output buffer.
+     */
+    void write(String value);
+
+    /**
+     * Pushes an indent into the emitter so after newlines are emitted, the
+     * output is correctly formatted.
+     */
+    void indentPush();
+
+    /**
+     * Pops an indent from the emitter so after newlines are emitted, the output
+     * is correctly formatted.
+     */
+    void indentPop();
+
+    /**
+     * Emit a documentation comment for a Class field or constant
+     * {@link IVariableNode}.
+     * 
+     * @param node The {@link IVariableNode} class field member.
+     */
+    void emitFieldDocumentation(IVariableNode node);
+
+    /**
+     * Emit a full Class field member.
+     * 
+     * @param node The {@link IVariableNode} class field member.
+     */
+    void emitField(IVariableNode node);
+
+    /**
+     * Emit a documentation comment for a Class method {@link IFunctionNode}.
+     * 
+     * @param node The {@link IFunctionNode} class method member.
+     */
+    void emitMethodDocumentation(IFunctionNode node);
+
+    /**
+     * Emit a full Class or Interface method member.
+     * 
+     * @param node The {@link IFunctionNode} class method member.
+     */
+    void emitMethod(IFunctionNode node);
+
+    /**
+     * Emit a documentation comment for a Class method {@link IGetterNode}.
+     * 
+     * @param node The {@link IGetterNode} class accessor member.
+     */
+    void emitGetAccessorDocumentation(IGetterNode node);
+
+    /**
+     * Emit a full Class getter member.
+     * 
+     * @param node The {@link IVariableNode} class getter member.
+     */
+    void emitGetAccessor(IGetterNode node);
+
+    /**
+     * Emit a documentation comment for a Class accessor {@link IGetterNode}.
+     * 
+     * @param node The {@link ISetterNode} class accessor member.
+     */
+    void emitSetAccessorDocumentation(ISetterNode node);
+
+    /**
+     * Emit a full Class setter member.
+     * 
+     * @param node The {@link ISetterNode} class setter member.
+     */
+    void emitSetAccessor(ISetterNode node);
+
+    //--------------------------------------------------------------------------
+    // Expressions
+    //--------------------------------------------------------------------------
+
+    /**
+     * Emit a variable declaration found in expression statements within scoped
+     * blocks.
+     * 
+     * @param node The {@link IVariableNode} or chain of variable nodes.
+     */
+    void emitVarDeclaration(IVariableNode node);
+
+    // TODO (mschmalle) we need IFunctionObjectNode API for FunctionObjectNode
+    /**
+     * Emit an anonymous {@link FunctionObjectNode}.
+     * 
+     * @param node The anonymous {@link FunctionObjectNode}.
+     */
+    void emitFunctionObject(IExpressionNode node);
+
+}

Propchange: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IASEmitter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IASWriter.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IASWriter.java?rev=1425049&view=auto
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IASWriter.java (added)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IASWriter.java Fri Dec 21 17:48:55 2012
@@ -0,0 +1,51 @@
+/*
+ *
+ *  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.as;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * An ActionScript writer that outputs cross compiled string data to the
+ * output stream.
+ * 
+ * @author Michael Schmalle
+ */
+public interface IASWriter extends Closeable
+{
+    /**
+     * Start writing to output stream.
+     * 
+     * @param out output stream
+     */
+    void writeTo(OutputStream out);
+
+    /**
+     * Start writing to a file.
+     * 
+     * @param out The output {@link File}.
+     * @return The number of bytes written.
+     */
+    int writeTo(File out) throws FileNotFoundException, IOException;
+
+}

Propchange: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IASWriter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IApplication.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IApplication.java?rev=1425049&view=auto
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IApplication.java (added)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IApplication.java Fri Dec 21 17:48:55 2012
@@ -0,0 +1,32 @@
+/*
+ *
+ *  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.as;
+
+
+/**
+ * The ActionScript model interface used when implementing build targets that
+ * create javascript applications cross compiled from actionscript.
+ * 
+ * @author Michael Schmalle
+ */
+public interface IApplication
+{
+
+}

Propchange: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/as/IApplication.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/clients/IBackend.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/clients/IBackend.java?rev=1425049&r1=1425048&r2=1425049&view=diff
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/clients/IBackend.java (original)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/clients/IBackend.java Fri Dec 21 17:48:55 2012
@@ -22,18 +22,19 @@ package org.apache.flex.compiler.clients
 import java.io.File;
 import java.util.List;
 
+import org.apache.flex.compiler.as.IASWriter;
 import org.apache.flex.compiler.config.Configurator;
-import org.apache.flex.compiler.internal.js.codgen.ASBlockWalker;
-import org.apache.flex.compiler.internal.js.codgen.JSFilterWriter;
-import org.apache.flex.compiler.internal.js.codgen.JSWriter;
+import org.apache.flex.compiler.internal.as.codegen.ASFilterWriter;
 import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
 import org.apache.flex.compiler.internal.targets.JSTarget;
 import org.apache.flex.compiler.problems.ICompilerProblem;
 import org.apache.flex.compiler.projects.IASProject;
 import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.targets.ITarget;
 import org.apache.flex.compiler.targets.ITargetProgressMonitor;
 import org.apache.flex.compiler.targets.ITargetSettings;
 import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.IASBlockWalker;
 
 /**
  * The backend strategy for the {@link MXMLJSC} javascript compiler.
@@ -70,15 +71,15 @@ public interface IBackend
      * of {@link ICompilationUnit}s.
      * @return A new {@link JSTarget} used during compilation.
      */
-    JSTarget createJSTarget(IASProject project, ITargetSettings settings,
+    ITarget createTarget(IASProject project, ITargetSettings settings,
             ITargetProgressMonitor monitor);
 
-    JSFilterWriter createFilterWriter(IASProject project);
+    ASFilterWriter createFilterWriter(IASProject project);
 
-    JSWriter createWriter(IASProject project, List<ICompilerProblem> errors,
+    IASWriter createWriter(IASProject project, List<ICompilerProblem> errors,
             ICompilationUnit compilationUnit, boolean enableDebug);
 
-    ASBlockWalker createWalker(IASProject project,
-            List<ICompilerProblem> errors, JSFilterWriter writer);
+    IASBlockWalker createWalker(IASProject project,
+            List<ICompilerProblem> errors, ASFilterWriter writer);
 
 }

Modified: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java?rev=1425049&r1=1425048&r2=1425049&view=diff
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java (original)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/clients/MXMLJSC.java Fri Dec 21 17:48:55 2012
@@ -32,6 +32,7 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.commons.io.FilenameUtils;
+import org.apache.flex.compiler.as.IASWriter;
 import org.apache.flex.compiler.clients.problems.ProblemPrinter;
 import org.apache.flex.compiler.clients.problems.ProblemQuery;
 import org.apache.flex.compiler.clients.problems.WorkspaceProblemFormatter;
@@ -46,7 +47,6 @@ import org.apache.flex.compiler.exceptio
 import org.apache.flex.compiler.exceptions.ConfigurationException.OnlyOneSource;
 import org.apache.flex.compiler.internal.driver.JSBackend;
 import org.apache.flex.compiler.internal.js.codgen.JSSharedData;
-import org.apache.flex.compiler.internal.js.codgen.JSWriter;
 import org.apache.flex.compiler.internal.projects.CompilerProject;
 import org.apache.flex.compiler.internal.projects.FlexProject;
 import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
@@ -61,6 +61,7 @@ import org.apache.flex.compiler.problems
 import org.apache.flex.compiler.problems.UnableToBuildSWFProblem;
 import org.apache.flex.compiler.problems.UnexpectedExceptionProblem;
 import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.targets.ITarget;
 import org.apache.flex.compiler.targets.ITargetSettings;
 import org.apache.flex.compiler.units.ICompilationUnit;
 import org.apache.flex.utils.FileUtils;
@@ -123,7 +124,7 @@ public class MXMLJSC
     private Configurator projectConfigurator;
     private ConfigurationBuffer configBuffer;
     private ICompilationUnit mainCU;
-    private JSTarget target;
+    private ITarget target;
     private ITargetSettings targetSettings;
     private IJSApplication jsTarget;
 
@@ -281,7 +282,7 @@ public class MXMLJSC
 
                         for (ICompilationUnit unit : reachableCompilationUnits)
                         {
-                            JSWriter jswriter = JSSharedData.backend
+                            IASWriter jswriter = JSSharedData.backend
                                     .createWriter(project,
                                             (List<ICompilerProblem>) errors,
                                             unit, false);
@@ -369,7 +370,7 @@ public class MXMLJSC
             return null;
         }
 
-        return target.build(mainCU, problems);
+        return ((JSTarget) target).build(mainCU, problems);
     }
 
     /**
@@ -459,7 +460,7 @@ public class MXMLJSC
         // if (getTargetSettings() == null)
         //     return false;
 
-        target = (JSTarget) JSSharedData.backend.createJSTarget(project,
+        target = (JSTarget) JSSharedData.backend.createTarget(project,
                 getTargetSettings(), null);
 
         return true;
@@ -493,21 +494,21 @@ public class MXMLJSC
     public static void registerSWCs(CompilerProject project)
             throws InterruptedException
     {
-//        final JSSharedData sharedData = JSSharedData.instance;
-//
-//        // collect all SWCCompilationUnit in swcUnits
-//        final List<ICompilationUnit> swcUnits = new ArrayList<ICompilationUnit>();
-//        for (ICompilationUnit cu : project.getCompilationUnits())
-//        {
-//            //            if (cu instanceof SWCCompilationUnit)
-//            //                swcUnits.add(cu);
-//            //
-//            //            final List<IDefinition> defs = getDefinitions(cu, false);
-//            //            for (IDefinition def : defs)
-//            //            {
-//            //                sharedData.registerDefinition(def);
-//            //            }
-//        }
+        //        final JSSharedData sharedData = JSSharedData.instance;
+        //
+        //        // collect all SWCCompilationUnit in swcUnits
+        //        final List<ICompilationUnit> swcUnits = new ArrayList<ICompilationUnit>();
+        //        for (ICompilationUnit cu : project.getCompilationUnits())
+        //        {
+        //            //            if (cu instanceof SWCCompilationUnit)
+        //            //                swcUnits.add(cu);
+        //            //
+        //            //            final List<IDefinition> defs = getDefinitions(cu, false);
+        //            //            for (IDefinition def : defs)
+        //            //            {
+        //            //                sharedData.registerDefinition(def);
+        //            //            }
+        //        }
 
     }
 

Modified: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java?rev=1425049&r1=1425048&r2=1425049&view=diff
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java (original)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java Fri Dec 21 17:48:55 2012
@@ -21,8 +21,9 @@ package org.apache.flex.compiler.interna
 
 import java.io.FilterWriter;
 import java.io.IOException;
+import java.util.ArrayList;
 
-import org.apache.flex.as.IASEmitter;
+import org.apache.flex.compiler.as.IASEmitter;
 import org.apache.flex.compiler.common.ASModifier;
 import org.apache.flex.compiler.common.ModifiersSet;
 import org.apache.flex.compiler.definitions.IDefinition;
@@ -32,6 +33,7 @@ import org.apache.flex.compiler.definiti
 import org.apache.flex.compiler.internal.tree.as.ChainedVariableNode;
 import org.apache.flex.compiler.internal.tree.as.FunctionNode;
 import org.apache.flex.compiler.internal.tree.as.FunctionObjectNode;
+import org.apache.flex.compiler.problems.ICompilerProblem;
 import org.apache.flex.compiler.tree.as.IASNode;
 import org.apache.flex.compiler.tree.as.IAccessorNode;
 import org.apache.flex.compiler.tree.as.IDefinitionNode;
@@ -190,7 +192,7 @@ public class ASEmitter implements IASEmi
 
         if (!(node instanceof ChainedVariableNode))
         {
-            emitNamespace(definition);
+            emitNamespace2(node);
             emitModifiers(definition);
             emitMemberKeyword(node);
         }
@@ -246,15 +248,15 @@ public class ASEmitter implements IASEmi
             emitMethodDocumentation(node);
         }
 
-//        FunctionNode fn = (FunctionNode) node;
+        FunctionNode fn = (FunctionNode) node;
         // XXX (mschmalle) parseFunctionBody() TEMP until I figure out the correct way to do this
         // will need to pass these problems back to the visitor
         // Figure out where this is getting parsed!
-//        fn.parseFunctionBody(new ArrayList<ICompilerProblem>());
+        fn.parseFunctionBody(new ArrayList<ICompilerProblem>());
 
         IFunctionDefinition definition = node.getDefinition();
 
-        emitNamespace(definition);
+        emitNamespace2(node);
         emitModifiers(definition);
         emitMemberKeyword(node);
 
@@ -313,7 +315,17 @@ public class ASEmitter implements IASEmi
     //--------------------------------------------------------------------------
     // 
     //--------------------------------------------------------------------------
-
+    
+    protected void emitNamespace2(IDefinitionNode node)
+    {
+        String namespace = node.getNamespace();
+        if (namespace != null && !namespace.equals("internal"))
+        {
+            write(namespace);
+            write(" ");
+        }
+    }
+    
     protected void emitNamespace(IDefinition definition)
     {
         // namespace (public, protected, private, foo_bar)

Added: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASFilterWriter.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASFilterWriter.java?rev=1425049&view=auto
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASFilterWriter.java (added)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASFilterWriter.java Fri Dec 21 17:48:55 2012
@@ -0,0 +1,42 @@
+/*
+ *
+ *  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.as.codegen;
+
+import java.io.FilterWriter;
+import java.io.Writer;
+
+/**
+ * @author Michael Schmalle
+ */
+public class ASFilterWriter extends FilterWriter
+{
+
+    public ASFilterWriter(Writer out)
+    {
+        super(out);
+    }
+
+    @Override
+    public String toString()
+    {
+        return out.toString();
+    }
+
+}

Propchange: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASFilterWriter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASWriter.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASWriter.java?rev=1425049&view=auto
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASWriter.java (added)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASWriter.java Fri Dec 21 17:48:55 2012
@@ -0,0 +1,97 @@
+/*
+ *
+ *  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.as.codegen;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.List;
+
+import org.apache.flex.compiler.internal.js.codgen.JSSharedData;
+import org.apache.flex.compiler.js.IJSWriter;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.IASBlockWalker;
+
+public class ASWriter implements IJSWriter
+{
+    private IASProject project;
+
+    private List<ICompilerProblem> problems;
+
+    private ICompilationUnit compilationUnit;
+
+    @SuppressWarnings("unused")
+    private boolean enableDebug;
+
+    /**
+     * Create a JSApplication writer.
+     * 
+     * @param application the JSApplication model to be encoded
+     * @param useCompression use ZLIB compression if true
+     */
+    public ASWriter(IASProject project, List<ICompilerProblem> problems,
+            ICompilationUnit compilationUnit, boolean enableDebug)
+    {
+        this.project = project;
+        this.problems = problems;
+        this.compilationUnit = compilationUnit;
+        this.enableDebug = enableDebug;
+    }
+
+    @Override
+    public void close() throws IOException
+    {
+        //outputBuffer.close();
+    }
+
+    @Override
+    public void writeTo(OutputStream out)
+    {
+        ASFilterWriter writer = JSSharedData.backend
+                .createFilterWriter(project);
+
+        IASBlockWalker walker = JSSharedData.backend.createWalker(project,
+                (List<ICompilerProblem>) problems, writer);
+
+        walker.visitCompilationUnit(compilationUnit);
+
+        System.out.println(writer.toString());
+
+        try
+        {
+            out.write(writer.toString().getBytes());
+        }
+        catch (IOException e)
+        {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public int writeTo(File out) throws FileNotFoundException, IOException
+    {
+        return 0;
+    }
+
+}

Propchange: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASWriter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/ASBackend.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/ASBackend.java?rev=1425049&view=auto
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/ASBackend.java (added)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/ASBackend.java Fri Dec 21 17:48:55 2012
@@ -0,0 +1,109 @@
+/*
+ *
+ *  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.driver;
+
+import java.io.StringWriter;
+import java.util.List;
+
+import org.apache.flex.compiler.as.IASWriter;
+import org.apache.flex.compiler.clients.IBackend;
+import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.internal.as.codegen.ASEmitter;
+import org.apache.flex.compiler.internal.as.codegen.ASFilterWriter;
+import org.apache.flex.compiler.internal.as.codegen.ASWriter;
+import org.apache.flex.compiler.internal.driver.strategy.AfterNodeStrategy;
+import org.apache.flex.compiler.internal.driver.strategy.BeforeAfterStrategy;
+import org.apache.flex.compiler.internal.driver.strategy.BeforeNodeStrategy;
+import org.apache.flex.compiler.internal.js.codgen.ASBlockWalker;
+import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
+import org.apache.flex.compiler.internal.visitor.ASNodeSwitch;
+import org.apache.flex.compiler.problems.ICompilerProblem;
+import org.apache.flex.compiler.projects.IASProject;
+import org.apache.flex.compiler.targets.ITarget;
+import org.apache.flex.compiler.targets.ITargetProgressMonitor;
+import org.apache.flex.compiler.targets.ITargetSettings;
+import org.apache.flex.compiler.tree.as.IFileNode;
+import org.apache.flex.compiler.units.ICompilationUnit;
+
+/**
+ * A concrete implementation of the {@link IBackend} API where the
+ * {@link ASBlockWalker} is used to traverse the {@link IFileNode} AST.
+ * 
+ * @author Michael Schmalle
+ */
+public class ASBackend implements IBackend
+{
+    @Override
+    public String getOutputExtension()
+    {
+        return "as";
+    }
+
+    @Override
+    public ISourceFileHandler getSourceFileHandlerInstance()
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Configurator createConfigurator()
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public ITarget createTarget(IASProject project,
+            ITargetSettings settings, ITargetProgressMonitor monitor)
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public ASBlockWalker createWalker(IASProject project,
+            List<ICompilerProblem> errors, ASFilterWriter out)
+    {
+        ASEmitter emitter = new ASEmitter(out);
+        ASBlockWalker walker = new ASBlockWalker(errors, project, emitter);
+
+        BeforeAfterStrategy strategy = new BeforeAfterStrategy(
+                new ASNodeSwitch(walker), new BeforeNodeStrategy(emitter),
+                new AfterNodeStrategy(emitter));
+
+        walker.setStrategy(strategy);
+
+        return walker;
+    }
+
+    @Override
+    public ASFilterWriter createFilterWriter(IASProject project)
+    {
+        StringWriter out = new StringWriter();
+        ASFilterWriter writer = new ASFilterWriter(out);
+        return writer;
+    }
+
+    @Override
+    public IASWriter createWriter(IASProject project,
+            List<ICompilerProblem> problems, ICompilationUnit compilationUnit,
+            boolean enableDebug)
+    {
+        return new ASWriter(project, problems, compilationUnit, enableDebug);
+    }
+}

Propchange: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/ASBackend.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/JSBackend.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/JSBackend.java?rev=1425049&r1=1425048&r2=1425049&view=diff
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/JSBackend.java (original)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/JSBackend.java Fri Dec 21 17:48:55 2012
@@ -25,6 +25,7 @@ import java.util.List;
 import org.apache.flex.compiler.clients.IBackend;
 import org.apache.flex.compiler.clients.JSConfiguration;
 import org.apache.flex.compiler.config.Configurator;
+import org.apache.flex.compiler.internal.as.codegen.ASFilterWriter;
 import org.apache.flex.compiler.internal.driver.strategy.AfterNodeStrategy;
 import org.apache.flex.compiler.internal.driver.strategy.BeforeAfterStrategy;
 import org.apache.flex.compiler.internal.driver.strategy.BeforeNodeStrategy;
@@ -35,12 +36,14 @@ import org.apache.flex.compiler.internal
 import org.apache.flex.compiler.internal.projects.ISourceFileHandler;
 import org.apache.flex.compiler.internal.targets.JSTarget;
 import org.apache.flex.compiler.internal.visitor.ASNodeSwitch;
+import org.apache.flex.compiler.js.IJSWriter;
 import org.apache.flex.compiler.problems.ICompilerProblem;
 import org.apache.flex.compiler.projects.IASProject;
 import org.apache.flex.compiler.targets.ITargetProgressMonitor;
 import org.apache.flex.compiler.targets.ITargetSettings;
 import org.apache.flex.compiler.tree.as.IFileNode;
 import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.IASBlockWalker;
 
 /**
  * A concrete implementation of the {@link IBackend} API where the
@@ -70,15 +73,15 @@ public class JSBackend implements IBacke
     }
 
     @Override
-    public JSTarget createJSTarget(IASProject project,
+    public JSTarget createTarget(IASProject project,
             ITargetSettings settings, ITargetProgressMonitor monitor)
     {
         return new JSTarget(project, settings, monitor);
     }
 
     @Override
-    public ASBlockWalker createWalker(IASProject project,
-            List<ICompilerProblem> errors, JSFilterWriter out)
+    public IASBlockWalker createWalker(IASProject project,
+            List<ICompilerProblem> errors, ASFilterWriter out)
     {
         JSEmitter emitter = new JSEmitter(out);
         ASBlockWalker walker = new ASBlockWalker(errors, project, emitter);
@@ -101,7 +104,7 @@ public class JSBackend implements IBacke
     }
 
     @Override
-    public JSWriter createWriter(IASProject project,
+    public IJSWriter createWriter(IASProject project,
             List<ICompilerProblem> problems, ICompilationUnit compilationUnit,
             boolean enableDebug)
     {

Modified: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/strategy/AfterNodeStrategy.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/strategy/AfterNodeStrategy.java?rev=1425049&r1=1425048&r2=1425049&view=diff
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/strategy/AfterNodeStrategy.java (original)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/strategy/AfterNodeStrategy.java Fri Dec 21 17:48:55 2012
@@ -19,6 +19,7 @@
 
 package org.apache.flex.compiler.internal.driver.strategy;
 
+import org.apache.flex.compiler.as.IASEmitter;
 import org.apache.flex.compiler.js.IJSEmitter;
 import org.apache.flex.compiler.tree.ASTNodeID;
 import org.apache.flex.compiler.tree.as.IASNode;
@@ -37,9 +38,9 @@ import org.apache.flex.compiler.visitor.
  */
 public class AfterNodeStrategy implements IASNodeStrategy
 {
-    private final IJSEmitter emitter;
+    private final IASEmitter emitter;
 
-    public AfterNodeStrategy(IJSEmitter emitter)
+    public AfterNodeStrategy(IASEmitter emitter)
     {
         this.emitter = emitter;
     }

Modified: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/strategy/BeforeNodeStrategy.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/strategy/BeforeNodeStrategy.java?rev=1425049&r1=1425048&r2=1425049&view=diff
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/strategy/BeforeNodeStrategy.java (original)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/driver/strategy/BeforeNodeStrategy.java Fri Dec 21 17:48:55 2012
@@ -19,7 +19,7 @@
 
 package org.apache.flex.compiler.internal.driver.strategy;
 
-import org.apache.flex.compiler.js.IJSEmitter;
+import org.apache.flex.compiler.as.IASEmitter;
 import org.apache.flex.compiler.tree.ASTNodeID;
 import org.apache.flex.compiler.tree.as.IASNode;
 import org.apache.flex.compiler.tree.as.IContainerNode;
@@ -34,9 +34,9 @@ import org.apache.flex.compiler.visitor.
  */
 public class BeforeNodeStrategy implements IASNodeStrategy
 {
-    private final IJSEmitter emitter;
+    private final IASEmitter emitter;
 
-    public BeforeNodeStrategy(IJSEmitter emitter)
+    public BeforeNodeStrategy(IASEmitter emitter)
     {
         this.emitter = emitter;
     }

Modified: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/js/codgen/ASBlockWalker.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/js/codgen/ASBlockWalker.java?rev=1425049&r1=1425048&r2=1425049&view=diff
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/js/codgen/ASBlockWalker.java (original)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/js/codgen/ASBlockWalker.java Fri Dec 21 17:48:55 2012
@@ -23,7 +23,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Stack;
 
-import org.apache.flex.as.IASEmitter;
+import org.apache.flex.compiler.as.IASEmitter;
 import org.apache.flex.compiler.definitions.IClassDefinition;
 import org.apache.flex.compiler.definitions.IInterfaceDefinition;
 import org.apache.flex.compiler.definitions.ITypeDefinition;
@@ -258,10 +258,25 @@ public class ASBlockWalker implements IA
     public void visitPackage(IPackageNode node)
     {
         debug("visitPackage()");
-        pushContext(TraverseContext.PACKAGE);
-        //        emitter.emitJSDocPackgeHeader(node);
-        walk(findTypeNode(node)); // IClassNode | IInterfaceNode
-        popContext(TraverseContext.PACKAGE);
+        emitter.write("package");
+        String name = node.getQualifiedName();
+        if (name != null && !name.equals(""))
+        {
+            emitter.write(" ");
+            emitter.write(name);
+        }
+        emitter.write(" ");
+        emitter.write("{");
+        ITypeNode tnode = findTypeNode(node);
+        if (tnode != null)
+        {
+            emitter.indentPush();
+            emitter.write("\n");
+            walk(tnode); // IClassNode | IInterfaceNode
+        }
+        emitter.indentPop();
+        emitter.write("\n");
+        emitter.write("}");
     }
 
     @Override
@@ -270,25 +285,43 @@ public class ASBlockWalker implements IA
         typeDefinition = node.getDefinition();
 
         debug("visitClass()");
-        pushContext(TraverseContext.TYPE);
+
+        emitter.write("public");
+        emitter.write(" ");
+        emitter.write("class");
+        emitter.write(" ");
+        emitter.write(typeDefinition.getBaseName());
+        emitter.write(" ");
+        emitter.write("{");
+
         //        emitter.emitProvide(typeDefinition);
         //        emitter.emitRequire(typeDefinition);
 
         // fields, methods, namespaces
         final IDefinitionNode[] members = node.getAllMemberNodes();
-        currentConstructor = getConstructor(members);
-        if (currentConstructor == null)
+        if (members.length > 0)
         {
-            // TODO (mschmalle) handle null constructor
-        }
+            emitter.indentPush();
+            emitter.write("\n");
+
+            currentConstructor = getConstructor(members);
+            if (currentConstructor == null)
+            {
+                // TODO (mschmalle) handle null constructor
+            }
+
+            //        emitter.emitConstructor(currentConstructor);
+            //        emitter.emitInherits(typeDefinition, project);
+
+            emitFields(members);
+            emitMethods(members);
 
-        //        emitter.emitConstructor(currentConstructor);
-        //        emitter.emitInherits(typeDefinition, project);
+            emitter.indentPop();
+        }
 
-        emitFields(members);
-        emitMethods(members);
+        emitter.write("\n");
+        emitter.write("}");
 
-        popContext(TraverseContext.TYPE);
         typeDefinition = null;
         currentConstructor = null;
     }
@@ -305,16 +338,14 @@ public class ASBlockWalker implements IA
         if (node == null)
             return;
         debug("visitConstructor()");
-        pushContext(TraverseContext.CONSTRUCTOR);
         walk(node);
-        popContext(TraverseContext.CONSTRUCTOR);
     }
 
     @Override
     public void visitVariable(IVariableNode node)
     {
         debug("visitVariable()");
-        
+
         if (SemanticUtils.isMemberDefinition(node.getDefinition()))
         {
             emitter.emitField(node);
@@ -1067,8 +1098,11 @@ public class ASBlockWalker implements IA
         {
             if (node instanceof IFunctionNode)
             {
-                if (node != getCurrentClass().getConstructor())
+                IFunctionNode fnode = (IFunctionNode) node;
+                if (!fnode.isConstructor())
                     walk(node);
+                else
+                    visitConstructor(fnode);
             }
         }
     }

Modified: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/js/codgen/JSFilterWriter.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/js/codgen/JSFilterWriter.java?rev=1425049&r1=1425048&r2=1425049&view=diff
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/js/codgen/JSFilterWriter.java (original)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/js/codgen/JSFilterWriter.java Fri Dec 21 17:48:55 2012
@@ -19,13 +19,14 @@
 
 package org.apache.flex.compiler.internal.js.codgen;
 
-import java.io.FilterWriter;
 import java.io.Writer;
 
+import org.apache.flex.compiler.internal.as.codegen.ASFilterWriter;
+
 /**
  * @author Michael Schmalle
  */
-public class JSFilterWriter extends FilterWriter
+public class JSFilterWriter extends ASFilterWriter
 {
 
     public JSFilterWriter(Writer out)

Modified: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/js/codgen/JSWriter.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/js/codgen/JSWriter.java?rev=1425049&r1=1425048&r2=1425049&view=diff
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/js/codgen/JSWriter.java (original)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/js/codgen/JSWriter.java Fri Dec 21 17:48:55 2012
@@ -29,6 +29,7 @@ import org.apache.flex.compiler.js.IJSWr
 import org.apache.flex.compiler.problems.ICompilerProblem;
 import org.apache.flex.compiler.projects.IASProject;
 import org.apache.flex.compiler.units.ICompilationUnit;
+import org.apache.flex.compiler.visitor.IASBlockWalker;
 
 public class JSWriter implements IJSWriter
 {
@@ -65,10 +66,10 @@ public class JSWriter implements IJSWrit
     @Override
     public void writeTo(OutputStream out)
     {
-        JSFilterWriter writer = JSSharedData.backend
+        JSFilterWriter writer = (JSFilterWriter) JSSharedData.backend
                 .createFilterWriter(project);
 
-        ASBlockWalker walker = JSSharedData.backend.createWalker(project,
+        IASBlockWalker walker = JSSharedData.backend.createWalker(project,
                 (List<ICompilerProblem>) problems, writer);
 
         walker.visitCompilationUnit(compilationUnit);

Modified: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/js/IJSApplication.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/js/IJSApplication.java?rev=1425049&r1=1425048&r2=1425049&view=diff
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/js/IJSApplication.java (original)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/js/IJSApplication.java Fri Dec 21 17:48:55 2012
@@ -19,6 +19,7 @@
 
 package org.apache.flex.compiler.js;
 
+import org.apache.flex.compiler.as.IApplication;
 
 /**
  * The JavaScript model interface used when implementing build targets that
@@ -26,7 +27,7 @@ package org.apache.flex.compiler.js;
  * 
  * @author Michael Schmalle
  */
-public interface IJSApplication
+public interface IJSApplication extends IApplication
 {
 
 }

Modified: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/js/IJSEmitter.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/js/IJSEmitter.java?rev=1425049&r1=1425048&r2=1425049&view=diff
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/js/IJSEmitter.java (original)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/js/IJSEmitter.java Fri Dec 21 17:48:55 2012
@@ -21,7 +21,7 @@ package org.apache.flex.compiler.js;
 
 import java.io.Writer;
 
-import org.apache.flex.as.IASEmitter;
+import org.apache.flex.compiler.as.IASEmitter;
 import org.apache.flex.compiler.visitor.IASNodeStrategy;
 
 /**

Modified: incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/js/IJSWriter.java
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/js/IJSWriter.java?rev=1425049&r1=1425048&r2=1425049&view=diff
==============================================================================
--- incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/js/IJSWriter.java (original)
+++ incubator/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/js/IJSWriter.java Fri Dec 21 17:48:55 2012
@@ -19,11 +19,7 @@
 
 package org.apache.flex.compiler.js;
 
-import java.io.Closeable;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.OutputStream;
+import org.apache.flex.compiler.as.IASWriter;
 
 /**
  * A JavaScript writer that outputs cross compiled string data to the
@@ -31,21 +27,7 @@ import java.io.OutputStream;
  * 
  * @author Michael Schmalle
  */
-public interface IJSWriter extends Closeable
+public interface IJSWriter extends IASWriter
 {
-    /**
-     * Start writing to output stream.
-     * 
-     * @param out output stream
-     */
-    void writeTo(OutputStream out);
-
-    /**
-     * Start writing to a file.
-     * 
-     * @param out The output {@link File}.
-     * @return The number of bytes written.
-     */
-    int writeTo(File out) throws FileNotFoundException, IOException;
 
 }