Clover coverage report - DynamicJava Test Coverage (dynamicjava-20130518-r5436)
Coverage timestamp: Sat May 18 2013 03:01:28 CDT
file stats: LOC: 65   Methods: 8
NCLOC: 36   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
TypeUtil.java - 37.5% 37.5% 37.5%
coverage coverage
 1    package koala.dynamicjava.interpreter;
 2   
 3    import koala.dynamicjava.tree.Node;
 4    import koala.dynamicjava.tree.Expression;
 5    import koala.dynamicjava.tree.SourceInfo;
 6    import koala.dynamicjava.tree.TypeName;
 7    import koala.dynamicjava.tree.visitor.Visitor;
 8   
 9    public class TypeUtil {
 10   
 11   
 12    /**
 13    * @return An expression for representing arbitrary "imaginary" syntax at
 14    * the given location. Useful for invoking {@code TypeSystem} methods
 15    * that require an expression. The result cannot be visited,
 16    * but it can have properties set and be used to build other {@code Node}s.
 17    */
 18  417 public static Expression makeEmptyExpression() {
 19  417 return new Expression(SourceInfo.NONE) {
 20  0 public <T> T acceptVisitor(Visitor<T> v) {
 21  0 throw new IllegalArgumentException("Cannot visit an empty expression");
 22    }
 23    };
 24    }
 25   
 26    /**
 27    * @return An expression for representing arbitrary "imaginary" syntax at
 28    * the given location. Useful for invoking {@code TypeSystem} methods
 29    * that require an expression. The result cannot be visited,
 30    * but it can have properties set and be used to build other {@code Node}s.
 31    */
 32  79 public static Expression makeEmptyExpression(Node location) {
 33  79 return new Expression(location.getSourceInfo()) {
 34  0 public <T> T acceptVisitor(Visitor<T> v) {
 35  0 throw new IllegalArgumentException("Cannot visit an empty expression");
 36    }
 37    };
 38    }
 39    /**
 40    * @return A type name for representing arbitrary "imaginary" syntax at
 41    * the given location. The result cannot be visited,
 42    * but it can have properties set and be used to build other {@code Node}s.
 43    */
 44  20 public static TypeName makeEmptyTypeName() {
 45  20 return new TypeName(SourceInfo.NONE) {
 46  0 public <T> T acceptVisitor(Visitor<T> v) {
 47  0 throw new IllegalArgumentException("Cannot visit an empty type name");
 48    }
 49    };
 50    }
 51   
 52    /**
 53    * @return A type name for representing arbitrary "imaginary" syntax at
 54    * the given location. The result cannot be visited,
 55    * but it can have properties set and be used to build other {@code Node}s.
 56    */
 57  0 public static TypeName makeEmptyTypeName(Node location) {
 58  0 return new TypeName(location.getSourceInfo()) {
 59  0 public <T> T acceptVisitor(Visitor<T> v) {
 60  0 throw new IllegalArgumentException("Cannot visit an empty type name");
 61    }
 62    };
 63    }
 64   
 65    }