Clover coverage report - DynamicJava Test Coverage (dynamicjava-20120303-r5436)
Coverage timestamp: Sat Mar 3 2012 03:02:19 CST
file stats: LOC: 89   Methods: 26
NCLOC: 28   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
TreeWalker.java - 0% 0% 0%
coverage
 1    package edu.rice.cs.dynamicjava.symbol.type;
 2   
 3   
 4    /**
 5    * <p>A lightweight visitor for traversing (in depth-first order) arbitrary ASTGen-produced
 6    * trees. Unlike the Visitor classes generated for a specific AST, implementations of
 7    * TreeWalker are defined for all ASTs. They are more limited, having far fewer hooks
 8    * available for manipulating the traversal process and handling different types of nodes.
 9    * This minimal interface is enough, however, for simple visitors which aren't concerned
 10    * with the semantic content of a tree and simply need to traverse its structure.</p>
 11    *
 12    * <p>When passed to a node's {@code walk()} method, a TreeWalker can expect to receive
 13    * a specific sequence of method calls: {@link #visitNode}, then {@link #visitField}
 14    * and a recursive invocation for each of the node's fields. "Recursive invocations"
 15    * include additional {@code visitNode()} calls and invocations of the the other "visit"
 16    * methods for handling Strings, lists, primitives, and objects of unrecognized type.
 17    * (Note that the method to call is determined statically based on the field's declared
 18    * type, not at runtime.) Clients can prevent recursion into a non-atomic element's
 19    * children by returning {@code false} in the appropriate visit method.</p>
 20    */
 21    public abstract class TreeWalker {
 22   
 23    /** Visit an AST node. Return {@code true} to recur on each of the node's fields. */
 24  0 public boolean visitNode(java.lang.Object node, java.lang.String type, int fields) { return true; }
 25    /** Visit an AST node's field. Return {@code true} to recur on the field's value. */
 26  0 public boolean visitNodeField(java.lang.String name, java.lang.Object value) { return true; }
 27    /** Signal the end of recursion on an AST node's field. */
 28  0 public void endNodeField(java.lang.String name, java.lang.Object value) {}
 29    /** Signal the end of a sequence of node fields. */
 30  0 public void endNode(java.lang.Object node, java.lang.String type, int fields) {}
 31   
 32    /** Visit an Iterable or array. Return {@code true} to recur on each element. */
 33  0 public boolean visitIterated(java.lang.Object iterable) { return true; }
 34    /** Visit an iterated element. Return {@code true} to recur on the element value. */
 35  0 public boolean visitIteratedElement(int index, java.lang.Object element) { return true; }
 36    /** Signal the end of recursion on an iterated element. */
 37  0 public void endIteratedElement(int index, java.lang.Object element) {}
 38    /** Signal the end of a sequence of iterated elements. */
 39  0 public void endIterated(java.lang.Object iterable, int size) {}
 40   
 41    /** Visit a non-empty option-typed value. Return {@code true} to recur on the nested value. */
 42  0 public boolean visitNonEmptyOption(java.lang.Object option) { return true; }
 43    /** Signal the end of recursion on a non-empty option. */
 44  0 public void endNonEmptyOption(java.lang.Object option) {}
 45    /** Visit an empty option-typed value. */
 46  0 public void visitEmptyOption(java.lang.Object option) {}
 47   
 48    /** Visit a tuple-typed value. Return {@code true} to recur on the nested elements. */
 49  0 public boolean visitTuple(java.lang.Object tuple, int arity) { return true; }
 50    /** Visit a tuple element. Return {@code true} to recur on the element value. */
 51  0 public boolean visitTupleElement(int index, java.lang.Object element) { return true; }
 52    /** Signal the end of a tuple element. */
 53  0 public void endTupleElement(int index, java.lang.Object element) {}
 54    /** Signal the end of a sequence of tuple elements. */
 55  0 public void endTuple(java.lang.Object tuple, int arity) {}
 56   
 57    /** Visit a string value. */
 58  0 public void visitString(java.lang.String s) {}
 59   
 60    /**
 61    * Visit an object that is not known statically to have an AST Node or
 62    * other supported type.
 63    */
 64  0 public void visitUnknownObject(java.lang.Object o) {}
 65   
 66    /**
 67    * Visit a null reference. This is called rather than {@code visitNode}, {@code visitList},
 68    * {@code visitUnknownObject}, etc., where a field or element's value is {@code null}.
 69    */
 70  0 public void visitNull() {}
 71   
 72    /** Visit a boolean primitive. */
 73  0 public void visitBoolean(boolean b) {}
 74    /** Visit a char primitive. */
 75  0 public void visitChar(char c) {}
 76    /** Visit a byte primitive. */
 77  0 public void visitByte(byte b) {}
 78    /** Visit a short primitive. */
 79  0 public void visitShort(short s) {}
 80    /** Visit a int primitive. */
 81  0 public void visitInt(int i) {}
 82    /** Visit a long primitive. */
 83  0 public void visitLong(long l) {}
 84    /** Visit a float primitive. */
 85  0 public void visitFloat(float f) {}
 86    /** Visit a double primitive. */
 87  0 public void visitDouble(double d) {}
 88   
 89    }