soot.JastAddJ.RawInterfaceDecl Maven / Gradle / Ivy
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */
package soot.JastAddJ;
import java.util.HashSet;
import java.io.File;
import java.util.*;
import beaver.*;
import java.util.ArrayList;
import java.util.zip.*;
import java.io.*;
import java.io.FileNotFoundException;
import java.util.Collection;
import soot.*;
import soot.util.*;
import soot.jimple.*;
import soot.coffi.ClassFile;
import soot.coffi.method_info;
import soot.coffi.CONSTANT_Utf8_info;
import soot.tagkit.SourceFileTag;
import soot.coffi.CoffiMethodSource;
/**
* @production RawInterfaceDecl : {@link ParInterfaceDecl} ::= Argument:{@link Access}*;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.ast:10
*/
public class RawInterfaceDecl extends ParInterfaceDecl implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
getArgumentList_computed = false;
getArgumentList_value = null;
subtype_TypeDecl_values = null;
instanceOf_TypeDecl_values = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public RawInterfaceDecl clone() throws CloneNotSupportedException {
RawInterfaceDecl node = (RawInterfaceDecl)super.clone();
node.getArgumentList_computed = false;
node.getArgumentList_value = null;
node.subtype_TypeDecl_values = null;
node.instanceOf_TypeDecl_values = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public RawInterfaceDecl copy() {
try {
RawInterfaceDecl node = (RawInterfaceDecl) clone();
node.parent = null;
if(children != null)
node.children = (ASTNode[]) children.clone();
return node;
} catch (CloneNotSupportedException e) {
throw new Error("Error: clone not supported for " +
getClass().getName());
}
}
/**
* Create a deep copy of the AST subtree at this node.
* The copy is dangling, i.e. has no parent.
* @return dangling copy of the subtree at this node
* @apilevel low-level
*/
@SuppressWarnings({"unchecked", "cast"})
public RawInterfaceDecl fullCopy() {
RawInterfaceDecl tree = (RawInterfaceDecl) copy();
if (children != null) {
for (int i = 0; i < children.length; ++i) {
switch (i) {
case 2:
case 3:
case 4:
tree.children[i] = new List();
continue;
}
ASTNode child = (ASTNode) children[i];
if(child != null) {
child = child.fullCopy();
tree.setChild(child, i);
}
}
}
return tree;
}
/**
* @ast method
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:900
*/
public Access substitute(Parameterization parTypeDecl) { return createBoundAccess(); }
/**
* @ast method
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:955
*/
public Access substituteReturnType(Parameterization parTypeDecl) { return createBoundAccess(); }
/**
* @ast method
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:975
*/
public Access substituteParameterType(Parameterization parTypeDecl) { return createBoundAccess(); }
/**
* @ast method
*
*/
public RawInterfaceDecl() {
super();
}
/**
* Initializes the child array to the correct size.
* Initializes List and Opt nta children.
* @apilevel internal
* @ast method
* @ast method
*
*/
public void init$Children() {
children = new ASTNode[4];
setChild(new List(), 1);
setChild(new List(), 2);
setChild(new List(), 3);
}
/**
* @ast method
*
*/
public RawInterfaceDecl(Modifiers p0, String p1) {
setChild(p0, 0);
setID(p1);
}
/**
* @ast method
*
*/
public RawInterfaceDecl(Modifiers p0, beaver.Symbol p1) {
setChild(p0, 0);
setID(p1);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 1;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the Modifiers child.
* @param node The new node to replace the Modifiers child.
* @apilevel high-level
* @ast method
*
*/
public void setModifiers(Modifiers node) {
setChild(node, 0);
}
/**
* Retrieves the Modifiers child.
* @return The current node used as the Modifiers child.
* @apilevel high-level
* @ast method
*
*/
public Modifiers getModifiers() {
return (Modifiers)getChild(0);
}
/**
* Retrieves the Modifiers child.
* This method does not invoke AST transformations.
* @return The current node used as the Modifiers child.
* @apilevel low-level
* @ast method
*
*/
public Modifiers getModifiersNoTransform() {
return (Modifiers)getChildNoTransform(0);
}
/**
* Replaces the lexeme ID.
* @param value The new value for the lexeme ID.
* @apilevel high-level
* @ast method
*
*/
public void setID(String value) {
tokenString_ID = value;
}
/**
* JastAdd-internal setter for lexeme ID using the Beaver parser.
* @apilevel internal
* @ast method
*
*/
public void setID(beaver.Symbol symbol) {
if(symbol.value != null && !(symbol.value instanceof String))
throw new UnsupportedOperationException("setID is only valid for String lexemes");
tokenString_ID = (String)symbol.value;
IDstart = symbol.getStart();
IDend = symbol.getEnd();
}
/**
* Retrieves the value for the lexeme ID.
* @return The value for the lexeme ID.
* @apilevel high-level
* @ast method
*
*/
public String getID() {
return tokenString_ID != null ? tokenString_ID : "";
}
/**
* Replaces the SuperInterfaceId list.
* @param list The new list node to be used as the SuperInterfaceId list.
* @apilevel high-level
* @ast method
*
*/
public void setSuperInterfaceIdList(List list) {
setChild(list, 1);
}
/**
* Retrieves the number of children in the SuperInterfaceId list.
* @return Number of children in the SuperInterfaceId list.
* @apilevel high-level
* @ast method
*
*/
public int getNumSuperInterfaceId() {
return getSuperInterfaceIdList().getNumChild();
}
/**
* Retrieves the number of children in the SuperInterfaceId list.
* Calling this method will not trigger rewrites..
* @return Number of children in the SuperInterfaceId list.
* @apilevel low-level
* @ast method
*
*/
public int getNumSuperInterfaceIdNoTransform() {
return getSuperInterfaceIdListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the SuperInterfaceId list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the SuperInterfaceId list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getSuperInterfaceId(int i) {
return (Access)getSuperInterfaceIdList().getChild(i);
}
/**
* Append an element to the SuperInterfaceId list.
* @param node The element to append to the SuperInterfaceId list.
* @apilevel high-level
* @ast method
*
*/
public void addSuperInterfaceId(Access node) {
List list = (parent == null || state == null) ? getSuperInterfaceIdListNoTransform() : getSuperInterfaceIdList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addSuperInterfaceIdNoTransform(Access node) {
List list = getSuperInterfaceIdListNoTransform();
list.addChild(node);
}
/**
* Replaces the SuperInterfaceId list element at index {@code i} with the new node {@code node}.
* @param node The new node to replace the old list element.
* @param i The list index of the node to be replaced.
* @apilevel high-level
* @ast method
*
*/
public void setSuperInterfaceId(Access node, int i) {
List list = getSuperInterfaceIdList();
list.setChild(node, i);
}
/**
* Retrieves the SuperInterfaceId list.
* @return The node representing the SuperInterfaceId list.
* @apilevel high-level
* @ast method
*
*/
public List getSuperInterfaceIds() {
return getSuperInterfaceIdList();
}
/**
* Retrieves the SuperInterfaceId list.
* This method does not invoke AST transformations.
* @return The node representing the SuperInterfaceId list.
* @apilevel low-level
* @ast method
*
*/
public List getSuperInterfaceIdsNoTransform() {
return getSuperInterfaceIdListNoTransform();
}
/**
* Retrieves the SuperInterfaceId list.
* This method does not invoke AST transformations.
* @return The node representing the SuperInterfaceId list.
* @apilevel low-level
* @ast method
*
*/
public List getSuperInterfaceIdListNoTransform() {
return (List)getChildNoTransform(1);
}
/**
* Retrieves the child position of the SuperInterfaceId list.
* @return The the child position of the SuperInterfaceId list.
* @apilevel low-level
* @ast method
*
*/
protected int getSuperInterfaceIdListChildPosition() {
return 1;
}
/**
* Replaces the BodyDecl list.
* @param list The new list node to be used as the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public void setBodyDeclList(List list) {
setChild(list, 2);
}
/**
* Retrieves the number of children in the BodyDecl list.
* @return Number of children in the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public int getNumBodyDecl() {
return getBodyDeclList().getNumChild();
}
/**
* Retrieves the number of children in the BodyDecl list.
* Calling this method will not trigger rewrites..
* @return Number of children in the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public int getNumBodyDeclNoTransform() {
return getBodyDeclListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the BodyDecl list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public BodyDecl getBodyDecl(int i) {
return (BodyDecl)getBodyDeclList().getChild(i);
}
/**
* Append an element to the BodyDecl list.
* @param node The element to append to the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public void addBodyDecl(BodyDecl node) {
List list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addBodyDeclNoTransform(BodyDecl node) {
List list = getBodyDeclListNoTransform();
list.addChild(node);
}
/**
* Replaces the BodyDecl list element at index {@code i} with the new node {@code node}.
* @param node The new node to replace the old list element.
* @param i The list index of the node to be replaced.
* @apilevel high-level
* @ast method
*
*/
public void setBodyDecl(BodyDecl node, int i) {
List list = getBodyDeclList();
list.setChild(node, i);
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public List getBodyDecls() {
return getBodyDeclList();
}
/**
* Retrieves the BodyDecl list.
* This method does not invoke AST transformations.
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List getBodyDeclsNoTransform() {
return getBodyDeclListNoTransform();
}
/**
* Retrieves the BodyDecl list.
* This method does not invoke AST transformations.
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List getBodyDeclListNoTransform() {
return (List)getChildNoTransform(2);
}
/**
* Retrieves the child position of the BodyDecl list.
* @return The the child position of the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
protected int getBodyDeclListChildPosition() {
return 2;
}
/**
* Replaces the Argument list.
* @param list The new list node to be used as the Argument list.
* @apilevel high-level
* @ast method
*
*/
public void setArgumentList(List list) {
setChild(list, 3);
}
/**
* Retrieves the number of children in the Argument list.
* @return Number of children in the Argument list.
* @apilevel high-level
* @ast method
*
*/
public int getNumArgument() {
return getArgumentList().getNumChild();
}
/**
* Retrieves the number of children in the Argument list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Argument list.
* @apilevel low-level
* @ast method
*
*/
public int getNumArgumentNoTransform() {
return getArgumentListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Argument list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Argument list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getArgument(int i) {
return (Access)getArgumentList().getChild(i);
}
/**
* Append an element to the Argument list.
* @param node The element to append to the Argument list.
* @apilevel high-level
* @ast method
*
*/
public void addArgument(Access node) {
List list = (parent == null || state == null) ? getArgumentListNoTransform() : getArgumentList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addArgumentNoTransform(Access node) {
List list = getArgumentListNoTransform();
list.addChild(node);
}
/**
* Replaces the Argument list element at index {@code i} with the new node {@code node}.
* @param node The new node to replace the old list element.
* @param i The list index of the node to be replaced.
* @apilevel high-level
* @ast method
*
*/
public void setArgument(Access node, int i) {
List list = getArgumentList();
list.setChild(node, i);
}
/**
* Retrieves the Argument list.
* @return The node representing the Argument list.
* @apilevel high-level
* @ast method
*
*/
public List getArguments() {
return getArgumentList();
}
/**
* Retrieves the Argument list.
* This method does not invoke AST transformations.
* @return The node representing the Argument list.
* @apilevel low-level
* @ast method
*
*/
public List getArgumentsNoTransform() {
return getArgumentListNoTransform();
}
/**
* Retrieves the Argument list.
* This method does not invoke AST transformations.
* @return The node representing the Argument list.
* @apilevel low-level
* @ast method
*
*/
public List getArgumentListNoTransform() {
return (List)getChildNoTransform(3);
}
/**
* Retrieves the child position of the Argument list.
* @return The the child position of the Argument list.
* @apilevel low-level
* @ast method
*
*/
protected int getArgumentListChildPosition() {
return 3;
}
/**
* @attribute syn
* @aspect NestedTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:569
*/
public TypeDecl hostType() {
ASTNode$State state = state();
try { return original(); }
finally {
}
}
/**
* @attribute syn
* @aspect Generics
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:245
*/
public boolean isRawType() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:577
*/
public boolean sameSignature(Access a) {
ASTNode$State state = state();
try { return a instanceof TypeAccess && a.type() == this; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean getArgumentList_computed = false;
/**
* @apilevel internal
*/
protected List getArgumentList_value;
/**
* @attribute syn nta
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:756
*/
@SuppressWarnings({"unchecked", "cast"})
public List getArgumentList() {
if(getArgumentList_computed) {
return (List) getChild(getArgumentListChildPosition());
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
getArgumentList_value = getArgumentList_compute();
setArgumentList(getArgumentList_value);
if(true) getArgumentList_computed = true;
return (List) getChild(getArgumentListChildPosition());
}
/**
* @apilevel internal
*/
private List getArgumentList_compute() { return ((GenericInterfaceDecl)genericDecl()).createArgumentList(new ArrayList()); }
/**
* @attribute syn
* @aspect GenericsParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsParTypeDecl.jrag:30
*/
public String nameWithArgs() {
ASTNode$State state = state();
try { return name(); }
finally {
}
}
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:20
*/
public boolean supertypeGenericInterfaceDecl(GenericInterfaceDecl type) {
ASTNode$State state = state();
try { return type.subtype(genericDecl().original()); }
finally {
}
}
protected java.util.Map subtype_TypeDecl_values;
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:29
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean subtype(TypeDecl type) {
Object _parameters = type;
if(subtype_TypeDecl_values == null) subtype_TypeDecl_values = new java.util.HashMap(4);
ASTNode$State.CircularValue _value;
if(subtype_TypeDecl_values.containsKey(_parameters)) {
Object _o = subtype_TypeDecl_values.get(_parameters);
if(!(_o instanceof ASTNode$State.CircularValue)) {
return ((Boolean)_o).booleanValue();
}
else
_value = (ASTNode$State.CircularValue)_o;
}
else {
_value = new ASTNode$State.CircularValue();
subtype_TypeDecl_values.put(_parameters, _value);
_value.value = Boolean.valueOf(true);
}
ASTNode$State state = state();
if (!state.IN_CIRCLE) {
state.IN_CIRCLE = true;
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean new_subtype_TypeDecl_value;
do {
_value.visited = new Integer(state.CIRCLE_INDEX);
state.CHANGE = false;
new_subtype_TypeDecl_value = subtype_compute(type);
if (new_subtype_TypeDecl_value!=((Boolean)_value.value).booleanValue()) {
state.CHANGE = true;
_value.value = Boolean.valueOf(new_subtype_TypeDecl_value);
}
state.CIRCLE_INDEX++;
} while (state.CHANGE);
if(isFinal && num == state().boundariesCrossed) {
subtype_TypeDecl_values.put(_parameters, new_subtype_TypeDecl_value);
}
else {
subtype_TypeDecl_values.remove(_parameters);
state.RESET_CYCLE = true;
subtype_compute(type);
state.RESET_CYCLE = false;
}
state.IN_CIRCLE = false;
return new_subtype_TypeDecl_value;
}
if(!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) {
_value.visited = new Integer(state.CIRCLE_INDEX);
boolean new_subtype_TypeDecl_value = subtype_compute(type);
if (state.RESET_CYCLE) {
subtype_TypeDecl_values.remove(_parameters);
}
else if (new_subtype_TypeDecl_value!=((Boolean)_value.value).booleanValue()) {
state.CHANGE = true;
_value.value = new_subtype_TypeDecl_value;
}
return new_subtype_TypeDecl_value;
}
return ((Boolean)_value.value).booleanValue();
}
/**
* @apilevel internal
*/
private boolean subtype_compute(TypeDecl type) { return type.supertypeRawInterfaceDecl(this); }
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:421
*/
public boolean supertypeClassDecl(ClassDecl type) {
ASTNode$State state = state();
try { return type.subtype(genericDecl().original()); }
finally {
}
}
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:437
*/
public boolean supertypeInterfaceDecl(InterfaceDecl type) {
ASTNode$State state = state();
try { return type.subtype(genericDecl().original()); }
finally {
}
}
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:129
*/
public boolean supertypeParInterfaceDecl(ParInterfaceDecl type) {
ASTNode$State state = state();
try { return type.genericDecl().original().subtype(genericDecl().original()); }
finally {
}
}
protected java.util.Map instanceOf_TypeDecl_values;
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:399
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean instanceOf(TypeDecl type) {
Object _parameters = type;
if(instanceOf_TypeDecl_values == null) instanceOf_TypeDecl_values = new java.util.HashMap(4);
if(instanceOf_TypeDecl_values.containsKey(_parameters)) {
return ((Boolean)instanceOf_TypeDecl_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean instanceOf_TypeDecl_value = instanceOf_compute(type);
if(isFinal && num == state().boundariesCrossed) instanceOf_TypeDecl_values.put(_parameters, Boolean.valueOf(instanceOf_TypeDecl_value));
return instanceOf_TypeDecl_value;
}
/**
* @apilevel internal
*/
private boolean instanceOf_compute(TypeDecl type) { return subtype(type); }
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}