soot.JastAddJ.ArrayTypeWithSizeAccess 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 ArrayTypeWithSizeAccess : {@link ArrayTypeAccess} ::= {@link Expr};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:26
*/
public class ArrayTypeWithSizeAccess extends ArrayTypeAccess implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ArrayTypeWithSizeAccess clone() throws CloneNotSupportedException {
ArrayTypeWithSizeAccess node = (ArrayTypeWithSizeAccess)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ArrayTypeWithSizeAccess copy() {
try {
ArrayTypeWithSizeAccess node = (ArrayTypeWithSizeAccess) 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 ArrayTypeWithSizeAccess fullCopy() {
ArrayTypeWithSizeAccess tree = (ArrayTypeWithSizeAccess) copy();
if (children != null) {
for (int i = 0; i < children.length; ++i) {
ASTNode child = (ASTNode) children[i];
if(child != null) {
child = child.fullCopy();
tree.setChild(child, i);
}
}
}
return tree;
}
/**
* @ast method
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:495
*/
public void toString(StringBuffer s) {
getAccess().toString(s);
s.append("[");
getExpr().toString(s);
s.append("]");
}
/**
* @ast method
* @aspect TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:555
*/
public void typeCheck() {
super.typeCheck();
if(!getExpr().type().unaryNumericPromotion().isInt())
error(getExpr().type().typeName() + " is not int after unary numeric promotion");
}
/**
* @ast method
* @aspect Expressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:663
*/
public void addArraySize(Body b, ArrayList list) {
getAccess().addArraySize(b, list);
list.add(asImmediate(b, getExpr().eval(b)));
}
/**
* @ast method
*
*/
public ArrayTypeWithSizeAccess() {
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];
}
/**
* @ast method
*
*/
public ArrayTypeWithSizeAccess(Access p0, Expr p1) {
setChild(p0, 0);
setChild(p1, 1);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 2;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the Access child.
* @param node The new node to replace the Access child.
* @apilevel high-level
* @ast method
*
*/
public void setAccess(Access node) {
setChild(node, 0);
}
/**
* Retrieves the Access child.
* @return The current node used as the Access child.
* @apilevel high-level
* @ast method
*
*/
public Access getAccess() {
return (Access)getChild(0);
}
/**
* Retrieves the Access child.
* This method does not invoke AST transformations.
* @return The current node used as the Access child.
* @apilevel low-level
* @ast method
*
*/
public Access getAccessNoTransform() {
return (Access)getChildNoTransform(0);
}
/**
* Replaces the Expr child.
* @param node The new node to replace the Expr child.
* @apilevel high-level
* @ast method
*
*/
public void setExpr(Expr node) {
setChild(node, 1);
}
/**
* Retrieves the Expr child.
* @return The current node used as the Expr child.
* @apilevel high-level
* @ast method
*
*/
public Expr getExpr() {
return (Expr)getChild(1);
}
/**
* Retrieves the Expr child.
* This method does not invoke AST transformations.
* @return The current node used as the Expr child.
* @apilevel low-level
* @ast method
*
*/
public Expr getExprNoTransform() {
return (Expr)getChildNoTransform(1);
}
/**
* Replaces the lexeme Package.
* @param value The new value for the lexeme Package.
* @apilevel high-level
* @ast method
*
*/
public void setPackage(String value) {
tokenString_Package = value;
}
/**
* 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;
}
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:235
*/
public boolean isDAafter(Variable v) {
ASTNode$State state = state();
try { return getExpr().isDAafter(v); }
finally {
}
}
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:694
*/
public boolean isDUafter(Variable v) {
ASTNode$State state = state();
try { return getExpr().isDUafter(v); }
finally {
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:36
* @apilevel internal
*/
public boolean Define_boolean_isDest(ASTNode caller, ASTNode child) {
if(caller == getExprNoTransform()) {
return false;
}
else { return getParent().Define_boolean_isDest(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:37
* @apilevel internal
*/
public boolean Define_boolean_isSource(ASTNode caller, ASTNode child) {
if(caller == getExprNoTransform()) {
return true;
}
else { return getParent().Define_boolean_isSource(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:359
* @apilevel internal
*/
public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) {
if(caller == getExprNoTransform()) {
return getAccess().isDAafter(v);
}
else { return getParent().Define_boolean_isDAbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:839
* @apilevel internal
*/
public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) {
if(caller == getExprNoTransform()) {
return getAccess().isDUafter(v);
}
else { return getParent().Define_boolean_isDUbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupMethod.jrag:31
* @apilevel internal
*/
public Collection Define_Collection_lookupMethod(ASTNode caller, ASTNode child, String name) {
if(caller == getExprNoTransform()) {
return unqualifiedScope().lookupMethod(name);
}
else { return getParent().Define_Collection_lookupMethod(this, caller, name);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:91
* @apilevel internal
*/
public boolean Define_boolean_hasPackage(ASTNode caller, ASTNode child, String packageName) {
if(caller == getExprNoTransform()) {
return unqualifiedScope().hasPackage(packageName);
}
else { return getParent().Define_boolean_hasPackage(this, caller, packageName);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:256
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_lookupType(ASTNode caller, ASTNode child, String name) {
if(caller == getExprNoTransform()) {
return unqualifiedScope().lookupType(name);
}
else { return getParent().Define_SimpleSet_lookupType(this, caller, name);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:136
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) {
if(caller == getExprNoTransform()) {
return unqualifiedScope().lookupVariable(name);
}
else { return getParent().Define_SimpleSet_lookupVariable(this, caller, name);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:123
* @apilevel internal
*/
public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {
if(caller == getExprNoTransform()) {
return NameType.EXPRESSION_NAME;
}
else { return getParent().Define_NameType_nameType(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}