public class NonRecursive
extends java.lang.Object
class MyWalker extends TermWalker { MyWalker(Term term) { super(term) } walk(NonRecursiveWalker walker, final ApplicationTerm appTerm) { walker.addWorkItem(new NonRecursive.Walker() { public void walk(NonRecursiveWalker walker) { // ... code that should run after parameters are processed } } for (Term param : appTerm.getParameters()) { walker.enqueueWalker(new MyWalker(param)); } } walk(... // handle other term classes...For stateful walker you need to extend the class NonRecursive. In addition you still need a Walker class that does the job. It can access the state by casting NonRecursive. Results can be added in a stateful walker to an additional result stack. See FormulaUnLet as an example.
ComputeFreeVariables
,
FormulaUnLet
Modifier and Type | Class and Description |
---|---|
static class |
NonRecursive.TermWalker
Walker that walks non-recursively over terms.
|
protected static interface |
NonRecursive.Walker
Walker that does some piece of work.
|
Constructor and Description |
---|
NonRecursive() |
Modifier and Type | Method and Description |
---|---|
void |
enqueueWalker(NonRecursive.Walker item)
Enqueues a walker on the todo stack.
|
protected void |
reset()
Manually reset this walker.
|
void |
run()
The main work horse.
|
void |
run(NonRecursive.Walker item)
The main work horse.
|
java.lang.String |
toString() |
protected void reset()
public void enqueueWalker(NonRecursive.Walker item)
item
- the walker to enqueue.public void run(NonRecursive.Walker item)
item
- the walker to execute initially.public void run()
public java.lang.String toString()
toString
in class java.lang.Object