// Identifier of our property
public static final int NUMDECL_KEY = RESERVED_PROPERTIES +
1;
// Method to perform the annotation
void annoteNumDecls(CompileUnitNode ast) {
int numDecls =
ast.getDefTypes().size();
ast.setProperty(NUMDECL_KEY,new Integer(numDecls));
}
// Method to read the annotation
int getNumDecls(CompileUnitNode ast) {
Integer num =
(Integer) getProperty(NUMDECL_KEY,val);
return
num.intValue();
}