soot.JastAddJ.AbstractWildcardType 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 AbstractWildcardType : {@link TypeDecl};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.ast:25
*/
public abstract class AbstractWildcardType extends TypeDecl implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
getSootClassDecl_computed = false;
getSootClassDecl_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public AbstractWildcardType clone() throws CloneNotSupportedException {
AbstractWildcardType node = (AbstractWildcardType)super.clone();
node.getSootClassDecl_computed = false;
node.getSootClassDecl_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* Qualified access for wildcard types.
* Since they have no ordinary package and type name
* we just return the bound access.
* @ast method
* @aspect Generics
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:17
*/
public Access createQualifiedAccess() {
// this was suggested by Hyunik Na as a fix for bug
// http://svn.cs.lth.se/trac/jastadd-trac/ticket/60
return createBoundAccess();
}
/**
* @ast method
*
*/
public AbstractWildcardType() {
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[2];
setChild(new List(), 1);
}
/**
* @ast method
*
*/
public AbstractWildcardType(Modifiers p0, String p1, List p2) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
}
/**
* @ast method
*
*/
public AbstractWildcardType(Modifiers p0, beaver.Symbol p1, List p2) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 2;
}
/**
* @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 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, 1);
}
/**
* 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.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List getBodyDeclList() {
List list = (List)getChild(1);
list.getNumChild();
return list;
}
/**
* Retrieves the BodyDecl list.
* This method does not invoke AST transformations.
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List getBodyDeclListNoTransform() {
return (List)getChildNoTransform(1);
}
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:102
*/
public boolean isWildcard() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean getSootClassDecl_computed = false;
/**
* @apilevel internal
*/
protected SootClass getSootClassDecl_value;
/**
* @attribute syn
* @aspect GenericsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/GenericsCodegen.jrag:424
*/
@SuppressWarnings({"unchecked", "cast"})
public SootClass getSootClassDecl() {
if(getSootClassDecl_computed) {
return getSootClassDecl_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
getSootClassDecl_value = getSootClassDecl_compute();
if(isFinal && num == state().boundariesCrossed) getSootClassDecl_computed = true;
return getSootClassDecl_value;
}
/**
* @apilevel internal
*/
private SootClass getSootClassDecl_compute() { return typeObject().getSootClassDecl(); }
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}