mwalk Platform 0.3.0

mwalk.visitor
Class TraceVisitor

java.lang.Object
  |
  +--mwalk.visitor.AbstractVisitor
        |
        +--mwalk.visitor.TraceVisitor

public class TraceVisitor
extends AbstractVisitor
implements UpVisitor

A visitor used by the builder to add mtrace paths into the tree.

Version:
1.0
Author:
Robert Chalmers

Field Summary
protected  int hop
          Current hop count
(package private)  TreeNode parent
          Reference to parent node
protected  MTrace trace
          Associated mtrace object
 
Fields inherited from class mwalk.visitor.AbstractVisitor
CFG_BASE, eval, seen, verbose
 
Constructor Summary
TraceVisitor(MTrace trace)
           
 
Method Summary
 TreeNode[] getParents(Tree tree, TreeNode node)
          Get a list of parents for the current node applying correct activity semantics.
 boolean prefix()
          Whether to visit prior to visiting parent/children.
 void reset(Tree tree)
          Reset the visitor for a new pass over the tree.
 java.lang.Object visitUp(Tree tree, TreeNode node)
          Visit the current node prior to visiting parent.
 
Methods inherited from class mwalk.visitor.AbstractVisitor
again, cfgBoolean, cfgInt, cfgString, cfgVisitor, evaluator, evaluator, getChildren, getReceivers, haveSeen, haveVisited, init, markSeen, markVisited, nextReceiver, postfix, verbose, visitDown, visitDown, visitUp, walkDown, walkUp
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

trace

protected MTrace trace
Associated mtrace object

hop

protected int hop
Current hop count

parent

TreeNode parent
Reference to parent node
Constructor Detail

TraceVisitor

public TraceVisitor(MTrace trace)
             throws BuildException
Method Detail

prefix

public boolean prefix()
Whether to visit prior to visiting parent/children.
Overrides:
prefix in class AbstractVisitor
Returns:
boolean whether to visit prior

reset

public void reset(Tree tree)
Reset the visitor for a new pass over the tree.
Overrides:
reset in class AbstractVisitor
Parameters:
Tree - vistited tree

visitUp

public java.lang.Object visitUp(Tree tree,
                                TreeNode node)
                         throws VisitException
Visit the current node prior to visiting parent.
Specified by:
visitUp in interface UpVisitor
Overrides:
visitUp in class AbstractVisitor
Parameters:
Tree - current tree instance
TreeNode - current node
Returns:
Object optional return value to pass back along the path
Throws:
VisitException - if a problem ocurred during visit

getParents

public TreeNode[] getParents(Tree tree,
                             TreeNode node)
Get a list of parents for the current node applying correct activity semantics.
Specified by:
getParents in interface UpVisitor
Overrides:
getParents in class AbstractVisitor
Parameters:
Tree - current tree instance
TreeNode - current node
Returns:
TreeNode[] array of parent nodes of currently visited node

mwalk Platform 0.3.0

Submit a bug or feature mwalk Platform API Specification 0.3.0
Sensitivity: {Public:Research}
Copyright(c) 2000, Robert Chalmers