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 2013/01/10 23:53:24 UTC
svn commit: r1431716 - in
/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler:
internal/as/codegen/ASBlockWalker.java visitor/IASBlockWalker.java
Author: mschmalle
Date: Thu Jan 10 22:53:24 2013
New Revision: 1431716
URL: http://svn.apache.org/viewvc?rev=1431716&view=rev
Log:
Flex:FalconJx:
- Removed more state from the ASBlockWalker, state is a bad thing here
Modified:
flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASBlockWalker.java
flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/visitor/IASBlockWalker.java
Modified: flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASBlockWalker.java
URL: http://svn.apache.org/viewvc/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASBlockWalker.java?rev=1431716&r1=1431715&r2=1431716&view=diff
==============================================================================
--- flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASBlockWalker.java (original)
+++ flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASBlockWalker.java Thu Jan 10 22:53:24 2013
@@ -23,9 +23,6 @@ import java.util.ArrayList;
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.IInterfaceDefinition;
-import org.apache.flex.compiler.definitions.ITypeDefinition;
import org.apache.flex.compiler.internal.semantics.SemanticUtils;
import org.apache.flex.compiler.internal.tree.as.BaseLiteralContainerNode;
import org.apache.flex.compiler.internal.tree.as.ContainerNode;
@@ -137,41 +134,6 @@ public class ASBlockWalker implements IA
return project;
}
- //----------------------------------
- // currentType
- //----------------------------------
-
- private ITypeDefinition typeDefinition;
-
- @Override
- public ITypeDefinition getCurrentType()
- {
- return typeDefinition;
- }
-
- @Override
- public IClassDefinition getCurrentClass()
- {
- return (IClassDefinition) typeDefinition;
- }
-
- @Override
- public IInterfaceDefinition getCurrentInterface()
- {
- return (IInterfaceDefinition) typeDefinition;
- }
-
- //----------------------------------
- // currentConstructor
- //----------------------------------
-
- private IFunctionNode currentConstructor;
-
- public IFunctionNode getCurrentConstructor()
- {
- return currentConstructor;
- }
-
public ASBlockWalker(List<ICompilerProblem> errors, IASProject project,
IASEmitter emitter)
{
Modified: flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/visitor/IASBlockWalker.java
URL: http://svn.apache.org/viewvc/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/visitor/IASBlockWalker.java?rev=1431716&r1=1431715&r2=1431716&view=diff
==============================================================================
--- flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/visitor/IASBlockWalker.java (original)
+++ flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/visitor/IASBlockWalker.java Thu Jan 10 22:53:24 2013
@@ -19,9 +19,6 @@
package org.apache.flex.compiler.visitor;
-import org.apache.flex.compiler.definitions.IClassDefinition;
-import org.apache.flex.compiler.definitions.IInterfaceDefinition;
-import org.apache.flex.compiler.definitions.ITypeDefinition;
import org.apache.flex.compiler.projects.ICompilerProject;
import org.apache.flex.compiler.tree.as.IASNode;
@@ -30,14 +27,19 @@ import org.apache.flex.compiler.tree.as.
*/
public interface IASBlockWalker extends IASBlockVisitor
{
+ /**
+ * Returns the current {@link ICompilerProject} for the traverse state.
+ */
ICompilerProject getProject();
- ITypeDefinition getCurrentType();
-
- IClassDefinition getCurrentClass();
-
- IInterfaceDefinition getCurrentInterface();
-
+ /**
+ * Traverses an {@link IASNode} based on the semantics of the known node.
+ * <p>
+ * Typically uses the {@link IASNodeStrategy#handle(IASNode)} to delegate
+ * how the node will be traversed.
+ *
+ * @param node The {@link IASNode} to traverse using the current strategy
+ */
void walk(IASNode node);
}