Clover coverage report - PMD - 3.3
Coverage timestamp: Thu Sep 15 2005 17:59:57 EDT
file stats: LOC: 72   Methods: 6
NCLOC: 32   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
Scope.java 0% 0% 0% 0%
coverage
 1    package net.sourceforge.pmd.cpd.cppast;
 2   
 3    import java.util.Hashtable;
 4   
 5    public class Scope {
 6    /**
 7    * Name of the scope (set only for class/function scopes).
 8    */
 9    String scopeName;
 10   
 11    /**
 12    * Indicates whether this is a class scope or not.
 13    */
 14    boolean type; // Indicates if this is a type.
 15   
 16    /**
 17    * (partial) table of type symbols introduced in this scope.
 18    */
 19    Hashtable typeTable = new Hashtable();
 20   
 21    /**
 22    * Parent scope. (null if it is the global scope).
 23    */
 24    Scope parent;
 25   
 26    /**
 27    * Creates a scope object with a given name.
 28    */
 29  0 public Scope(String name, boolean isType, Scope p) {
 30  0 scopeName = name;
 31  0 type = isType;
 32  0 parent = p;
 33    }
 34   
 35    /**
 36    * Creates an unnamed scope (like for compound statements).
 37    */
 38  0 public Scope(Scope p) {
 39  0 type = false;
 40  0 parent = p;
 41    }
 42   
 43    /**
 44    * Inserts a name into the table to say that it is the name of a type.
 45    */
 46  0 public void PutTypeName(String name) {
 47  0 typeTable.put(name, name);
 48    }
 49   
 50    /**
 51    * A type with a scope (class/struct/union).
 52    */
 53  0 public void PutTypeName(String name, Scope sc) {
 54  0 typeTable.put(name, sc);
 55    }
 56   
 57    /**
 58    * Checks if a given name is the name of a type in this scope.
 59    */
 60  0 public boolean IsTypeName(String name) {
 61  0 return typeTable.get(name) != null;
 62    }
 63   
 64  0 public Scope GetScope(String name) {
 65  0 Object sc = typeTable.get(name);
 66   
 67  0 if (sc instanceof Scope || sc instanceof ClassScope)
 68  0 return (Scope) sc;
 69   
 70  0 return null;
 71    }
 72    }