public abstract class JavaASTWalker
extends java.lang.Object
walk(ProgramElement)
.Modifier and Type | Field and Description |
---|---|
private int |
depth
the current visited level
|
private ProgramElement |
root
the root the walker starts
|
Constructor and Description |
---|
JavaASTWalker(ProgramElement root)
create the JavaASTWalker
|
Modifier and Type | Method and Description |
---|---|
int |
depth()
returns the current vistted level
|
protected abstract void |
doAction(ProgramElement node)
the action that is performed just before leaving the node the
last time
|
ProgramElement |
root()
returns start point of the walker
|
void |
start()
starts the walker
|
protected void |
walk(ProgramElement node)
walks through the AST.
|
private ProgramElement root
private int depth
public JavaASTWalker(ProgramElement root)
root
- the ProgramElement where to beginpublic ProgramElement root()
public void start()
public int depth()
protected void walk(ProgramElement node)
node
- the JavaProgramElement the walker is atprotected abstract void doAction(ProgramElement node)