flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mschma...@apache.org
Subject svn commit: r1444817 - in /flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler: as/codegen/IASEmitter.java internal/as/codegen/ASBlockWalker.java internal/as/codegen/ASEmitter.java internal/as/visitor/ASNodeSwitch.java visitor/IASBlockVisitor.java
Date Mon, 11 Feb 2013 15:09:49 GMT
Author: mschmalle
Date: Mon Feb 11 15:09:35 2013
New Revision: 1444817

URL: http://svn.apache.org/r1444817
Log:
Flex:FalconJx
- added 'as' and 'is' binary visitor methods and emitter methods

Modified:
    flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/as/codegen/IASEmitter.java
    flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASBlockWalker.java
    flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java
    flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/visitor/ASNodeSwitch.java
    flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/visitor/IASBlockVisitor.java

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/as/codegen/IASEmitter.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/as/codegen/IASEmitter.java?rev=1444817&r1=1444816&r2=1444817&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/as/codegen/IASEmitter.java
(original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/as/codegen/IASEmitter.java
Mon Feb 11 15:09:35 2013
@@ -343,7 +343,11 @@ public interface IASEmitter
     //--------------------------------------------------------------------------
 
     void emitUnaryOperator(IUnaryOperatorNode node);
-
+    
+    void emitAsOperator(IBinaryOperatorNode node);
+    
+    void emitIsOperator(IBinaryOperatorNode node);
+    
     /**
      * Emit an operator statement.
      * 

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASBlockWalker.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASBlockWalker.java?rev=1444817&r1=1444816&r2=1444817&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASBlockWalker.java
(original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASBlockWalker.java
Mon Feb 11 15:09:35 2013
@@ -466,6 +466,20 @@ public class ASBlockWalker implements IA
     }
 
     @Override
+    public void visitAsOperator(IBinaryOperatorNode node)
+    {
+        debug("visitAsOperator()");
+        emitter.emitAsOperator(node);
+    }
+
+    @Override
+    public void visitIsOperator(IBinaryOperatorNode node)
+    {
+        debug("visitIsOperator()");
+        emitter.emitIsOperator(node);
+    }
+
+    @Override
     public void visitBinaryOperator(IBinaryOperatorNode node)
     {
         debug("visitBinaryOperator("
@@ -578,7 +592,7 @@ public class ASBlockWalker implements IA
     {
         // (erikdebruin) let's only do this when debugging... or it'll show up
         //               in the stdout on the command line
-        System.out.println(message);
+        //System.out.println(message);
     }
 
     //--------------------------------------------------------------------------

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java?rev=1444817&r1=1444816&r2=1444817&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java
(original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java
Mon Feb 11 15:09:35 2013
@@ -1088,6 +1088,26 @@ public class ASEmitter implements IASEmi
     //--------------------------------------------------------------------------
 
     @Override
+    public void emitAsOperator(IBinaryOperatorNode node)
+    {
+        getWalker().walk(node.getLeftOperandNode());
+        write(SPACE);
+        write(node.getOperator().getOperatorText());
+        write(SPACE);
+        getWalker().walk(node.getRightOperandNode());
+    }
+
+    @Override
+    public void emitIsOperator(IBinaryOperatorNode node)
+    {
+        getWalker().walk(node.getLeftOperandNode());
+        write(SPACE);
+        write(node.getOperator().getOperatorText());
+        write(SPACE);
+        getWalker().walk(node.getRightOperandNode());
+    }
+
+    @Override
     public void emitBinaryOperator(IBinaryOperatorNode node)
     {
         getWalker().walk(node.getLeftOperandNode());
@@ -1449,11 +1469,11 @@ public class ASEmitter implements IASEmi
             write(IASKeywordConstants.VOID);
         }
     }
-    
+
     //--------------------------------------------------------------------------
     // TODO (mschmalle) These are here to remind me I did the newline push backwards, needs
to be fixed
     //--------------------------------------------------------------------------
-    
+
     protected void loopIndent(int i, int len, boolean hasIndent)
     {
         if (i < len - 1)
@@ -1478,4 +1498,5 @@ public class ASEmitter implements IASEmi
         }
         return false;
     }
+
 }

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/visitor/ASNodeSwitch.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/visitor/ASNodeSwitch.java?rev=1444817&r1=1444816&r2=1444817&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/visitor/ASNodeSwitch.java
(original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/as/visitor/ASNodeSwitch.java
Mon Feb 11 15:09:35 2013
@@ -19,6 +19,8 @@
 
 package org.apache.flex.compiler.internal.as.visitor;
 
+import org.apache.flex.compiler.internal.tree.as.BinaryOperatorAsNode;
+import org.apache.flex.compiler.internal.tree.as.BinaryOperatorIsNode;
 import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode;
 import org.apache.flex.compiler.internal.tree.as.NamespaceAccessExpressionNode;
 import org.apache.flex.compiler.tree.ASTNodeID;
@@ -303,7 +305,12 @@ public class ASNodeSwitch implements IAS
         }
         else if (node instanceof IBinaryOperatorNode)
         {
-            visitor.visitBinaryOperator((IBinaryOperatorNode) node);
+            if (node instanceof BinaryOperatorAsNode)
+                visitor.visitAsOperator((IBinaryOperatorNode) node);
+            else if (node instanceof BinaryOperatorIsNode)
+                visitor.visitIsOperator((IBinaryOperatorNode) node);
+            else
+                visitor.visitBinaryOperator((IBinaryOperatorNode) node);
         }
         // IUnaryOperatorNode > IOperator
         else if (node instanceof IUnaryOperatorNode)

Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/visitor/IASBlockVisitor.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/visitor/IASBlockVisitor.java?rev=1444817&r1=1444816&r2=1444817&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/visitor/IASBlockVisitor.java
(original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/visitor/IASBlockVisitor.java
Mon Feb 11 15:09:35 2013
@@ -174,6 +174,10 @@ public interface IASBlockVisitor
 
     void visitFunctionCall(IFunctionCallNode node);
 
+    void visitAsOperator(IBinaryOperatorNode node);
+
+    void visitIsOperator(IBinaryOperatorNode node);
+
     void visitBinaryOperator(IBinaryOperatorNode node);
 
     void visitUnaryOperator(IUnaryOperatorNode node);



Mime
View raw message