use of soot in project soot by Sable.
the class ElementAnnotationValue method appendAsAttributeTo.
/**
* @ast method
* @aspect AnnotationsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:354
*/
public void appendAsAttributeTo(Collection list, String name) {
ArrayList elemVals = new ArrayList();
getAnnotation().appendAsAttributeTo(elemVals);
list.add(new soot.tagkit.AnnotationAnnotationElem((soot.tagkit.AnnotationTag) elemVals.get(0), '@', name));
}
use of soot in project soot by Sable.
the class AnnotatedCompilationUnit method jimplify1phase2.
/**
* @ast method
* @aspect AnnotationsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:11
*/
public void jimplify1phase2() {
super.jimplify1phase2();
ArrayList c = new ArrayList();
getModifiers().addAllAnnotations(c);
for (Iterator iter = c.iterator(); iter.hasNext(); ) {
soot.tagkit.Tag tag = (soot.tagkit.Tag) iter.next();
// host.addTag(tag);
}
}
use of soot in project soot by Sable.
the class Annotation method appendAsAttributeTo.
/**
* @ast method
* @aspect AnnotationsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:305
*/
public void appendAsAttributeTo(Collection list) {
soot.tagkit.AnnotationTag tag = new soot.tagkit.AnnotationTag(decl().typeDescriptor(), getNumElementValuePair());
ArrayList elements = new ArrayList(getNumElementValuePair());
for (int i = 0; i < getNumElementValuePair(); i++) {
String name = getElementValuePair(i).getName();
ElementValue value = getElementValuePair(i).getElementValue();
value.appendAsAttributeTo(elements, name);
}
tag.setElems(elements);
list.add(tag);
}
use of soot in project soot by Sable.
the class AnnotationMethodDecl method addAttributes.
/**
* @ast method
* @aspect AnnotationsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:293
*/
public void addAttributes() {
super.addAttributes();
// 4.8.19
if (hasDefaultValue()) {
ArrayList elements = new ArrayList(1);
getDefaultValue().appendAsAttributeTo(elements, "default");
soot.tagkit.AnnotationDefaultTag tag = new soot.tagkit.AnnotationDefaultTag((soot.tagkit.AnnotationElem) elements.get(0));
sootMethod.addTag(tag);
}
}
use of soot in project soot by Sable.
the class ArrayCreationExpr method eval.
/**
* @ast method
* @aspect Expressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:633
*/
public soot.Value eval(Body b) {
if (hasArrayInit()) {
return getArrayInit().eval(b);
} else {
ArrayList list = new ArrayList();
getTypeAccess().addArraySize(b, list);
if (numArrays() == 1) {
soot.Value size = (soot.Value) list.get(0);
return b.newNewArrayExpr(type().componentType().getSootType(), asImmediate(b, size), this);
} else {
return b.newNewMultiArrayExpr((soot.ArrayType) type().getSootType(), list, this);
}
}
}
Aggregations