public abstract class SimultaneousJavaASTWalker extends Object
walk(ProgramElement)
.JavaASTWalker
Modifier and Type | Field and Description |
---|---|
private int |
depth
The currently visited level.
|
private ProgramElement |
e1
The roots where the walker starts.
|
private ProgramElement |
e2
The roots where the walker starts.
|
private boolean |
incompatible
True iff the given program elements have a different structure.
|
Constructor and Description |
---|
SimultaneousJavaASTWalker(ProgramElement e1,
ProgramElement e2)
Create the SimultaneousJavaASTWalker.
|
Modifier and Type | Method and Description |
---|---|
int |
depth() |
protected abstract void |
doAction(ProgramElement node1,
ProgramElement node2)
The action that is performed just before leaving the node the last time.
|
ProgramElement |
getFirstRoot()
Returns the first start point of the walker.
|
ProgramElement |
getSecondRoot()
Returns the second start point of the walker.
|
boolean |
isIncompatible() |
void |
setIncompatible() |
void |
start()
Starts the walker.
|
protected void |
walk(ProgramElement node1,
ProgramElement node2)
Walks through the ASTs simultaneously, while keeping track of the current
nodes.
|
private ProgramElement e1
private ProgramElement e2
private int depth
private boolean incompatible
public SimultaneousJavaASTWalker(ProgramElement e1, ProgramElement e2)
e1
- The first ProgramElement to start with.e2
- The second ProgramElement to start with.public ProgramElement getFirstRoot()
public ProgramElement getSecondRoot()
public boolean isIncompatible()
public void setIncompatible()
incompatible
- Call iff the given program elements are incompatible
(that is, differ in more than just the naming of the program
variables).public void start()
public int depth()
protected void walk(ProgramElement node1, ProgramElement node2)
node1
- The first JavaProgramElement the walker is at.node2
- The second JavaProgramElement the walker is at.protected abstract void doAction(ProgramElement node1, ProgramElement node2)