repo
stringlengths 1
191
⌀ | file
stringlengths 23
351
| code
stringlengths 0
5.32M
| file_length
int64 0
5.32M
| avg_line_length
float64 0
2.9k
| max_line_length
int64 0
288k
| extension_type
stringclasses 1
value |
|---|---|---|---|---|---|---|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/BoundFieldAccess.java
|
/* 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 BoundFieldAccess : {@link VarAccess} ::= <span class="component"><FieldDeclaration:FieldDeclaration></span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BoundNames.ast:6
*/
public class BoundFieldAccess extends VarAccess implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
decl_computed = false;
decl_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public BoundFieldAccess clone() throws CloneNotSupportedException {
BoundFieldAccess node = (BoundFieldAccess)super.clone();
node.decl_computed = false;
node.decl_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public BoundFieldAccess copy() {
try {
BoundFieldAccess node = (BoundFieldAccess) 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 BoundFieldAccess fullCopy() {
BoundFieldAccess tree = (BoundFieldAccess) 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 BoundNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BoundNames.jrag:68
*/
public BoundFieldAccess(FieldDeclaration f) {
this(f.name(), f);
}
/**
* @ast method
* @aspect BoundNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BoundNames.jrag:73
*/
public boolean isExactVarAccess() {
return false;
}
/**
* @ast method
*
*/
public BoundFieldAccess() {
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() {
}
/**
* @ast method
*
*/
public BoundFieldAccess(String p0, FieldDeclaration p1) {
setID(p0);
setFieldDeclaration(p1);
}
/**
* @ast method
*
*/
public BoundFieldAccess(beaver.Symbol p0, FieldDeclaration p1) {
setID(p0);
setFieldDeclaration(p1);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* 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 lexeme FieldDeclaration.
* @param value The new value for the lexeme FieldDeclaration.
* @apilevel high-level
* @ast method
*
*/
public void setFieldDeclaration(FieldDeclaration value) {
tokenFieldDeclaration_FieldDeclaration = value;
}
/**
* @apilevel internal
* @ast method
*
*/
/**
* @apilevel internal
*/
protected FieldDeclaration tokenFieldDeclaration_FieldDeclaration;
/**
* Retrieves the value for the lexeme FieldDeclaration.
* @return The value for the lexeme FieldDeclaration.
* @apilevel high-level
* @ast method
*
*/
public FieldDeclaration getFieldDeclaration() {
return tokenFieldDeclaration_FieldDeclaration;
}
/**
* @apilevel internal
*/
protected boolean decl_computed = false;
/**
* @apilevel internal
*/
protected Variable decl_value;
/**
* @attribute syn
* @aspect BoundNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BoundNames.jrag:72
*/
@SuppressWarnings({"unchecked", "cast"})
public Variable decl() {
if(decl_computed) {
return decl_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
decl_value = decl_compute();
if(isFinal && num == state().boundariesCrossed) decl_computed = true;
return decl_value;
}
/**
* @apilevel internal
*/
private Variable decl_compute() { return getFieldDeclaration(); }
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 6,318
| 23.683594
| 129
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/BoundMethodAccess.java
|
/* 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 BoundMethodAccess : {@link MethodAccess};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BoundNames.ast:3
*/
public class BoundMethodAccess extends MethodAccess implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
decl_computed = false;
decl_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public BoundMethodAccess clone() throws CloneNotSupportedException {
BoundMethodAccess node = (BoundMethodAccess)super.clone();
node.decl_computed = false;
node.decl_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public BoundMethodAccess copy() {
try {
BoundMethodAccess node = (BoundMethodAccess) 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 BoundMethodAccess fullCopy() {
BoundMethodAccess tree = (BoundMethodAccess) 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 BoundNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BoundNames.jrag:61
*/
public BoundMethodAccess(String name, List args, MethodDecl methodDecl) {
this(name, args);
this.methodDecl = methodDecl;
}
/**
* @ast method
* @aspect BoundNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BoundNames.jrag:65
*/
private MethodDecl methodDecl;
/**
* @ast method
*
*/
public BoundMethodAccess() {
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[1];
setChild(new List(), 0);
}
/**
* @ast method
*
*/
public BoundMethodAccess(String p0, List<Expr> p1) {
setID(p0);
setChild(p1, 0);
}
/**
* @ast method
*
*/
public BoundMethodAccess(beaver.Symbol p0, List<Expr> p1) {
setID(p0);
setChild(p1, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 1;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* 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 Arg list.
* @param list The new list node to be used as the Arg list.
* @apilevel high-level
* @ast method
*
*/
public void setArgList(List<Expr> list) {
setChild(list, 0);
}
/**
* Retrieves the number of children in the Arg list.
* @return Number of children in the Arg list.
* @apilevel high-level
* @ast method
*
*/
public int getNumArg() {
return getArgList().getNumChild();
}
/**
* Retrieves the number of children in the Arg list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Arg list.
* @apilevel low-level
* @ast method
*
*/
public int getNumArgNoTransform() {
return getArgListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Arg list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Arg list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Expr getArg(int i) {
return (Expr)getArgList().getChild(i);
}
/**
* Append an element to the Arg list.
* @param node The element to append to the Arg list.
* @apilevel high-level
* @ast method
*
*/
public void addArg(Expr node) {
List<Expr> list = (parent == null || state == null) ? getArgListNoTransform() : getArgList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addArgNoTransform(Expr node) {
List<Expr> list = getArgListNoTransform();
list.addChild(node);
}
/**
* Replaces the Arg 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 setArg(Expr node, int i) {
List<Expr> list = getArgList();
list.setChild(node, i);
}
/**
* Retrieves the Arg list.
* @return The node representing the Arg list.
* @apilevel high-level
* @ast method
*
*/
public List<Expr> getArgs() {
return getArgList();
}
/**
* Retrieves the Arg list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Arg list.
* @apilevel low-level
* @ast method
*
*/
public List<Expr> getArgsNoTransform() {
return getArgListNoTransform();
}
/**
* Retrieves the Arg list.
* @return The node representing the Arg list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Expr> getArgList() {
List<Expr> list = (List<Expr>)getChild(0);
list.getNumChild();
return list;
}
/**
* Retrieves the Arg list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Arg list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Expr> getArgListNoTransform() {
return (List<Expr>)getChildNoTransform(0);
}
/**
* @apilevel internal
*/
protected boolean decl_computed = false;
/**
* @apilevel internal
*/
protected MethodDecl decl_value;
/**
* @attribute syn
* @aspect BoundNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BoundNames.jrag:66
*/
@SuppressWarnings({"unchecked", "cast"})
public MethodDecl decl() {
if(decl_computed) {
return decl_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
decl_value = decl_compute();
if(isFinal && num == state().boundariesCrossed) decl_computed = true;
return decl_value;
}
/**
* @apilevel internal
*/
private MethodDecl decl_compute() { return methodDecl; }
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 8,757
| 24.094556
| 104
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/BoundTypeAccess.java
|
/* 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 BoundTypeAccess : {@link TypeAccess} ::= <span class="component"><TypeDecl:TypeDecl></span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BoundNames.ast:8
*/
public class BoundTypeAccess extends TypeAccess implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
decls_computed = false;
decls_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public BoundTypeAccess clone() throws CloneNotSupportedException {
BoundTypeAccess node = (BoundTypeAccess)super.clone();
node.decls_computed = false;
node.decls_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public BoundTypeAccess copy() {
try {
BoundTypeAccess node = (BoundTypeAccess) 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 BoundTypeAccess fullCopy() {
BoundTypeAccess tree = (BoundTypeAccess) 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 GenericsTypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:333
*/
public boolean isRaw() {
return getTypeDecl().isRawType();
}
/**
* @ast method
*
*/
public BoundTypeAccess() {
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() {
}
/**
* @ast method
*
*/
public BoundTypeAccess(String p0, String p1, TypeDecl p2) {
setPackage(p0);
setID(p1);
setTypeDecl(p2);
}
/**
* @ast method
*
*/
public BoundTypeAccess(beaver.Symbol p0, beaver.Symbol p1, TypeDecl p2) {
setPackage(p0);
setID(p1);
setTypeDecl(p2);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* 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;
}
/**
* JastAdd-internal setter for lexeme Package using the Beaver parser.
* @apilevel internal
* @ast method
*
*/
public void setPackage(beaver.Symbol symbol) {
if(symbol.value != null && !(symbol.value instanceof String))
throw new UnsupportedOperationException("setPackage is only valid for String lexemes");
tokenString_Package = (String)symbol.value;
Packagestart = symbol.getStart();
Packageend = symbol.getEnd();
}
/**
* Retrieves the value for the lexeme Package.
* @return The value for the lexeme Package.
* @apilevel high-level
* @ast method
*
*/
public String getPackage() {
return tokenString_Package != null ? tokenString_Package : "";
}
/**
* 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 lexeme TypeDecl.
* @param value The new value for the lexeme TypeDecl.
* @apilevel high-level
* @ast method
*
*/
public void setTypeDecl(TypeDecl value) {
tokenTypeDecl_TypeDecl = value;
}
/**
* @apilevel internal
* @ast method
*
*/
/**
* @apilevel internal
*/
protected TypeDecl tokenTypeDecl_TypeDecl;
/**
* Retrieves the value for the lexeme TypeDecl.
* @return The value for the lexeme TypeDecl.
* @apilevel high-level
* @ast method
*
*/
public TypeDecl getTypeDecl() {
return tokenTypeDecl_TypeDecl;
}
/**
* @apilevel internal
*/
protected boolean decls_computed = false;
/**
* @apilevel internal
*/
protected SimpleSet decls_value;
/**
* @attribute syn
* @aspect BoundNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BoundNames.jrag:93
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet decls() {
if(decls_computed) {
return decls_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
decls_value = decls_compute();
if(isFinal && num == state().boundariesCrossed) decls_computed = true;
return decls_value;
}
/**
* @apilevel internal
*/
private SimpleSet decls_compute() { return SimpleSet.emptySet.add(getTypeDecl()); }
/**
* @attribute syn
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:800
*/
public String dumpString() {
ASTNode$State state = state();
try { return getClass().getName() + " [" + getTypeDecl().fullName() + "]"; }
finally {
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 7,316
| 23.972696
| 113
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/BranchPropagation.java
|
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;
/**
* @ast interface
*
*/
public interface BranchPropagation {
public void collectBranches(Collection c);
public Stmt branchTarget(Stmt branchStmt);
public void collectFinally(Stmt branchStmt, ArrayList list);
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:32
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection targetContinues();
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:33
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection targetBreaks();
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:34
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection targetBranches();
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:35
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection escapedBranches();
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:36
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection branches();
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:39
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean targetOf(ContinueStmt stmt);
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:40
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean targetOf(BreakStmt stmt);
}
| 2,421
| 28.536585
| 106
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/BranchTargetStmt.java
|
/* 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 BranchTargetStmt : {@link Stmt};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:196
*/
public abstract class BranchTargetStmt extends Stmt implements Cloneable, BranchPropagation {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
reachableBreak_computed = false;
reachableContinue_computed = false;
targetBranches_computed = false;
targetBranches_value = null;
escapedBranches_computed = false;
escapedBranches_value = null;
branches_computed = false;
branches_value = null;
targetContinues_computed = false;
targetContinues_value = null;
targetBreaks_computed = false;
targetBreaks_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public BranchTargetStmt clone() throws CloneNotSupportedException {
BranchTargetStmt node = (BranchTargetStmt)super.clone();
node.reachableBreak_computed = false;
node.reachableContinue_computed = false;
node.targetBranches_computed = false;
node.targetBranches_value = null;
node.escapedBranches_computed = false;
node.escapedBranches_value = null;
node.branches_computed = false;
node.branches_value = null;
node.targetContinues_computed = false;
node.targetContinues_value = null;
node.targetBreaks_computed = false;
node.targetBreaks_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @ast method
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:57
*/
public void collectBranches(Collection c) {
c.addAll(escapedBranches());
}
/**
* @ast method
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:156
*/
public Stmt branchTarget(Stmt branchStmt) {
if(targetBranches().contains(branchStmt))
return this;
return super.branchTarget(branchStmt);
}
/**
* @ast method
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:194
*/
public void collectFinally(Stmt branchStmt, ArrayList list) {
if(targetBranches().contains(branchStmt))
return;
super.collectFinally(branchStmt, list);
}
/**
* @ast method
*
*/
public BranchTargetStmt() {
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() {
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:39
*/
@SuppressWarnings({"unchecked", "cast"})
public abstract boolean targetOf(ContinueStmt stmt);
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:40
*/
@SuppressWarnings({"unchecked", "cast"})
public abstract boolean targetOf(BreakStmt stmt);
/**
* @apilevel internal
*/
protected boolean reachableBreak_computed = false;
/**
* @apilevel internal
*/
protected boolean reachableBreak_value;
/**
* @attribute syn
* @aspect UnreachableStatements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:49
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean reachableBreak() {
if(reachableBreak_computed) {
return reachableBreak_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
reachableBreak_value = reachableBreak_compute();
if(isFinal && num == state().boundariesCrossed) reachableBreak_computed = true;
return reachableBreak_value;
}
/**
* @apilevel internal
*/
private boolean reachableBreak_compute() {
for(Iterator iter = targetBreaks().iterator(); iter.hasNext(); ) {
BreakStmt stmt = (BreakStmt)iter.next();
if(stmt.reachable())
return true;
}
return false;
}
/**
* @apilevel internal
*/
protected boolean reachableContinue_computed = false;
/**
* @apilevel internal
*/
protected boolean reachableContinue_value;
/**
* @attribute syn
* @aspect UnreachableStatements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:91
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean reachableContinue() {
if(reachableContinue_computed) {
return reachableContinue_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
reachableContinue_value = reachableContinue_compute();
if(isFinal && num == state().boundariesCrossed) reachableContinue_computed = true;
return reachableContinue_value;
}
/**
* @apilevel internal
*/
private boolean reachableContinue_compute() {
for(Iterator iter = targetContinues().iterator(); iter.hasNext(); ) {
Stmt stmt = (Stmt)iter.next();
if(stmt.reachable())
return true;
}
return false;
}
/**
* @apilevel internal
*/
protected boolean targetBranches_computed = false;
/**
* @apilevel internal
*/
protected Collection targetBranches_value;
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:82
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection targetBranches() {
if(targetBranches_computed) {
return targetBranches_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
targetBranches_value = targetBranches_compute();
if(isFinal && num == state().boundariesCrossed) targetBranches_computed = true;
return targetBranches_value;
}
/**
* @apilevel internal
*/
private Collection targetBranches_compute() {
HashSet set = new HashSet();
for(Iterator iter = branches().iterator(); iter.hasNext(); ) {
Object o = iter.next();
if(o instanceof ContinueStmt && targetOf((ContinueStmt)o))
set.add(o);
if(o instanceof BreakStmt && targetOf((BreakStmt)o))
set.add(o);
}
return set;
}
/**
* @apilevel internal
*/
protected boolean escapedBranches_computed = false;
/**
* @apilevel internal
*/
protected Collection escapedBranches_value;
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:94
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection escapedBranches() {
if(escapedBranches_computed) {
return escapedBranches_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
escapedBranches_value = escapedBranches_compute();
if(isFinal && num == state().boundariesCrossed) escapedBranches_computed = true;
return escapedBranches_value;
}
/**
* @apilevel internal
*/
private Collection escapedBranches_compute() {
HashSet set = new HashSet();
for(Iterator iter = branches().iterator(); iter.hasNext(); ) {
Object o = iter.next();
if(o instanceof ContinueStmt && !targetOf((ContinueStmt)o))
set.add(o);
if(o instanceof BreakStmt && !targetOf((BreakStmt)o))
set.add(o);
if(o instanceof ReturnStmt)
set.add(o);
}
return set;
}
/**
* @apilevel internal
*/
protected boolean branches_computed = false;
/**
* @apilevel internal
*/
protected Collection branches_value;
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:108
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection branches() {
if(branches_computed) {
return branches_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
branches_value = branches_compute();
if(isFinal && num == state().boundariesCrossed) branches_computed = true;
return branches_value;
}
/**
* @apilevel internal
*/
private Collection branches_compute() {
HashSet set = new HashSet();
super.collectBranches(set);
return set;
}
/**
* @apilevel internal
*/
protected boolean targetContinues_computed = false;
/**
* @apilevel internal
*/
protected Collection targetContinues_value;
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:215
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection targetContinues() {
if(targetContinues_computed) {
return targetContinues_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
targetContinues_value = targetContinues_compute();
if(isFinal && num == state().boundariesCrossed) targetContinues_computed = true;
return targetContinues_value;
}
/**
* @apilevel internal
*/
private Collection targetContinues_compute() {
HashSet set = new HashSet();
for(Iterator iter = targetBranches().iterator(); iter.hasNext(); ) {
Object o = iter.next();
if(o instanceof ContinueStmt)
set.add(o);
}
if(getParent() instanceof LabeledStmt) {
for(Iterator iter = ((LabeledStmt)getParent()).targetBranches().iterator(); iter.hasNext(); ) {
Object o = iter.next();
if(o instanceof ContinueStmt)
set.add(o);
}
}
return set;
}
/**
* @apilevel internal
*/
protected boolean targetBreaks_computed = false;
/**
* @apilevel internal
*/
protected Collection targetBreaks_value;
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:232
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection targetBreaks() {
if(targetBreaks_computed) {
return targetBreaks_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
targetBreaks_value = targetBreaks_compute();
if(isFinal && num == state().boundariesCrossed) targetBreaks_computed = true;
return targetBreaks_value;
}
/**
* @apilevel internal
*/
private Collection targetBreaks_compute() {
HashSet set = new HashSet();
for(Iterator iter = targetBranches().iterator(); iter.hasNext(); ) {
Object o = iter.next();
if(o instanceof BreakStmt)
set.add(o);
}
return set;
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 12,124
| 27.664303
| 115
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/BreakStmt.java
|
/* 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 BreakStmt : {@link Stmt} ::= <span class="component"><Label:String></span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:212
*/
public class BreakStmt extends Stmt implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
targetStmt_computed = false;
targetStmt_value = null;
finallyList_computed = false;
finallyList_value = null;
isDAafter_Variable_values = null;
isDUafterReachedFinallyBlocks_Variable_values = null;
isDAafterReachedFinallyBlocks_Variable_values = null;
isDUafter_Variable_values = null;
canCompleteNormally_computed = false;
inSynchronizedBlock_computed = false;
lookupLabel_String_values = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public BreakStmt clone() throws CloneNotSupportedException {
BreakStmt node = (BreakStmt)super.clone();
node.targetStmt_computed = false;
node.targetStmt_value = null;
node.finallyList_computed = false;
node.finallyList_value = null;
node.isDAafter_Variable_values = null;
node.isDUafterReachedFinallyBlocks_Variable_values = null;
node.isDAafterReachedFinallyBlocks_Variable_values = null;
node.isDUafter_Variable_values = null;
node.canCompleteNormally_computed = false;
node.inSynchronizedBlock_computed = false;
node.lookupLabel_String_values = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public BreakStmt copy() {
try {
BreakStmt node = (BreakStmt) 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 BreakStmt fullCopy() {
BreakStmt tree = (BreakStmt) 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 BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:51
*/
public void collectBranches(Collection c) {
c.add(this);
}
/**
* @ast method
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:379
*/
public void nameCheck() {
if(!hasLabel() && !insideLoop() && !insideSwitch())
error("break outside switch or loop");
else if(hasLabel()) {
LabeledStmt label = lookupLabel(getLabel());
if(label == null)
error("labeled break must have visible matching label");
}
}
/**
* @ast method
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:667
*/
public void toString(StringBuffer s) {
s.append(indent());
s.append("break ");
if(hasLabel())
s.append(getLabel());
s.append(";");
}
/**
* @ast method
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:210
*/
public void jimplify2(Body b) {
ArrayList list = exceptionRanges();
if(!inSynchronizedBlock())
endExceptionRange(b, list);
for(Iterator iter = finallyList().iterator(); iter.hasNext(); ) {
FinallyHost stmt = (FinallyHost)iter.next();
stmt.emitFinallyCode(b);
}
if(inSynchronizedBlock())
endExceptionRange(b, list);
b.setLine(this);
b.add(b.newGotoStmt(targetStmt().break_label(), this));
beginExceptionRange(b, list);
}
/**
* @ast method
*
*/
public BreakStmt() {
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() {
}
/**
* @ast method
*
*/
public BreakStmt(String p0) {
setLabel(p0);
}
/**
* @ast method
*
*/
public BreakStmt(beaver.Symbol p0) {
setLabel(p0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the lexeme Label.
* @param value The new value for the lexeme Label.
* @apilevel high-level
* @ast method
*
*/
public void setLabel(String value) {
tokenString_Label = value;
}
/**
* @apilevel internal
* @ast method
*
*/
/**
* @apilevel internal
*/
protected String tokenString_Label;
/**
* @ast method
*
*/
public int Labelstart;
/**
* @ast method
*
*/
public int Labelend;
/**
* JastAdd-internal setter for lexeme Label using the Beaver parser.
* @apilevel internal
* @ast method
*
*/
public void setLabel(beaver.Symbol symbol) {
if(symbol.value != null && !(symbol.value instanceof String))
throw new UnsupportedOperationException("setLabel is only valid for String lexemes");
tokenString_Label = (String)symbol.value;
Labelstart = symbol.getStart();
Labelend = symbol.getEnd();
}
/**
* Retrieves the value for the lexeme Label.
* @return The value for the lexeme Label.
* @apilevel high-level
* @ast method
*
*/
public String getLabel() {
return tokenString_Label != null ? tokenString_Label : "";
}
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:65
*/
public boolean hasLabel() {
ASTNode$State state = state();
try { return !getLabel().equals(""); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean targetStmt_computed = false;
/**
* @apilevel internal
*/
protected Stmt targetStmt_value;
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:148
*/
@SuppressWarnings({"unchecked", "cast"})
public Stmt targetStmt() {
if(targetStmt_computed) {
return targetStmt_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
targetStmt_value = targetStmt_compute();
if(isFinal && num == state().boundariesCrossed) targetStmt_computed = true;
return targetStmt_value;
}
/**
* @apilevel internal
*/
private Stmt targetStmt_compute() { return branchTarget(this); }
/**
* @apilevel internal
*/
protected boolean finallyList_computed = false;
/**
* @apilevel internal
*/
protected ArrayList finallyList_value;
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:175
*/
@SuppressWarnings({"unchecked", "cast"})
public ArrayList finallyList() {
if(finallyList_computed) {
return finallyList_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
finallyList_value = finallyList_compute();
if(isFinal && num == state().boundariesCrossed) finallyList_computed = true;
return finallyList_value;
}
/**
* @apilevel internal
*/
private ArrayList finallyList_compute() {
ArrayList list = new ArrayList();
collectFinally(this, list);
return list;
}
protected java.util.Map isDAafter_Variable_values;
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:647
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDAafter(Variable v) {
Object _parameters = v;
if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4);
if(isDAafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDAafter_Variable_value = isDAafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value));
return isDAafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDAafter_compute(Variable v) { return true; }
protected java.util.Map isDUafterReachedFinallyBlocks_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:921
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDUafterReachedFinallyBlocks(Variable v) {
Object _parameters = v;
if(isDUafterReachedFinallyBlocks_Variable_values == null) isDUafterReachedFinallyBlocks_Variable_values = new java.util.HashMap(4);
if(isDUafterReachedFinallyBlocks_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDUafterReachedFinallyBlocks_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDUafterReachedFinallyBlocks_Variable_value = isDUafterReachedFinallyBlocks_compute(v);
if(isFinal && num == state().boundariesCrossed) isDUafterReachedFinallyBlocks_Variable_values.put(_parameters, Boolean.valueOf(isDUafterReachedFinallyBlocks_Variable_value));
return isDUafterReachedFinallyBlocks_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDUafterReachedFinallyBlocks_compute(Variable v) {
if(!isDUbefore(v) && finallyList().isEmpty())
return false;
for(Iterator iter = finallyList().iterator(); iter.hasNext(); ) {
FinallyHost f = (FinallyHost)iter.next();
if(!f.isDUafterFinally(v))
return false;
}
return true;
}
protected java.util.Map isDAafterReachedFinallyBlocks_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:953
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDAafterReachedFinallyBlocks(Variable v) {
Object _parameters = v;
if(isDAafterReachedFinallyBlocks_Variable_values == null) isDAafterReachedFinallyBlocks_Variable_values = new java.util.HashMap(4);
if(isDAafterReachedFinallyBlocks_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDAafterReachedFinallyBlocks_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDAafterReachedFinallyBlocks_Variable_value = isDAafterReachedFinallyBlocks_compute(v);
if(isFinal && num == state().boundariesCrossed) isDAafterReachedFinallyBlocks_Variable_values.put(_parameters, Boolean.valueOf(isDAafterReachedFinallyBlocks_Variable_value));
return isDAafterReachedFinallyBlocks_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDAafterReachedFinallyBlocks_compute(Variable v) {
if(isDAbefore(v))
return true;
if(finallyList().isEmpty())
return false;
for(Iterator iter = finallyList().iterator(); iter.hasNext(); ) {
FinallyHost f = (FinallyHost)iter.next();
if(!f.isDAafterFinally(v))
return false;
}
return true;
}
protected java.util.Map isDUafter_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:1170
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDUafter(Variable v) {
Object _parameters = v;
if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4);
if(isDUafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDUafter_Variable_value = isDUafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value));
return isDUafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDUafter_compute(Variable v) { return true; }
/**
* @apilevel internal
*/
protected boolean canCompleteNormally_computed = false;
/**
* @apilevel internal
*/
protected boolean canCompleteNormally_value;
/**
* @attribute syn
* @aspect UnreachableStatements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:105
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean canCompleteNormally() {
if(canCompleteNormally_computed) {
return canCompleteNormally_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
canCompleteNormally_value = canCompleteNormally_compute();
if(isFinal && num == state().boundariesCrossed) canCompleteNormally_computed = true;
return canCompleteNormally_value;
}
/**
* @apilevel internal
*/
private boolean canCompleteNormally_compute() { return false; }
/**
* @apilevel internal
*/
protected boolean inSynchronizedBlock_computed = false;
/**
* @apilevel internal
*/
protected boolean inSynchronizedBlock_value;
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:251
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean inSynchronizedBlock() {
if(inSynchronizedBlock_computed) {
return inSynchronizedBlock_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
inSynchronizedBlock_value = inSynchronizedBlock_compute();
if(isFinal && num == state().boundariesCrossed) inSynchronizedBlock_computed = true;
return inSynchronizedBlock_value;
}
/**
* @apilevel internal
*/
private boolean inSynchronizedBlock_compute() { return !finallyList().isEmpty() && finallyList().iterator().next() instanceof SynchronizedStmt; }
/**
* @attribute syn
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:55
*/
public boolean modifiedInScope(Variable var) {
ASTNode$State state = state();
try { return false; }
finally {
}
}
protected java.util.Map lookupLabel_String_values;
/**
* @attribute inh
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:168
*/
@SuppressWarnings({"unchecked", "cast"})
public LabeledStmt lookupLabel(String name) {
Object _parameters = name;
if(lookupLabel_String_values == null) lookupLabel_String_values = new java.util.HashMap(4);
if(lookupLabel_String_values.containsKey(_parameters)) {
return (LabeledStmt)lookupLabel_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
LabeledStmt lookupLabel_String_value = getParent().Define_LabeledStmt_lookupLabel(this, null, name);
if(isFinal && num == state().boundariesCrossed) lookupLabel_String_values.put(_parameters, lookupLabel_String_value);
return lookupLabel_String_value;
}
/**
* @attribute inh
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:365
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean insideLoop() {
ASTNode$State state = state();
boolean insideLoop_value = getParent().Define_boolean_insideLoop(this, null);
return insideLoop_value;
}
/**
* @attribute inh
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:374
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean insideSwitch() {
ASTNode$State state = state();
boolean insideSwitch_value = getParent().Define_boolean_insideSwitch(this, null);
return insideSwitch_value;
}
/**
* @attribute inh
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:460
*/
@SuppressWarnings({"unchecked", "cast"})
public ArrayList exceptionRanges() {
ASTNode$State state = state();
ArrayList exceptionRanges_value = getParent().Define_ArrayList_exceptionRanges(this, null);
return exceptionRanges_value;
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 18,486
| 30.764605
| 180
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/BridgeMethodDecl.java
|
/* 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 BridgeMethodDecl : {@link MethodDecl};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.ast:51
*/
public class BridgeMethodDecl extends MethodDecl implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public BridgeMethodDecl clone() throws CloneNotSupportedException {
BridgeMethodDecl node = (BridgeMethodDecl)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public BridgeMethodDecl copy() {
try {
BridgeMethodDecl node = (BridgeMethodDecl) 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 BridgeMethodDecl fullCopy() {
BridgeMethodDecl tree = (BridgeMethodDecl) 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 GenericsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/GenericsCodegen.jrag:320
*/
public void transformation() { }
/**
* @ast method
*
*/
public BridgeMethodDecl() {
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[5];
setChild(new List(), 2);
setChild(new List(), 3);
setChild(new Opt(), 4);
}
/**
* @ast method
*
*/
public BridgeMethodDecl(Modifiers p0, Access p1, String p2, List<ParameterDeclaration> p3, List<Access> p4, Opt<Block> p5) {
setChild(p0, 0);
setChild(p1, 1);
setID(p2);
setChild(p3, 2);
setChild(p4, 3);
setChild(p5, 4);
}
/**
* @ast method
*
*/
public BridgeMethodDecl(Modifiers p0, Access p1, beaver.Symbol p2, List<ParameterDeclaration> p3, List<Access> p4, Opt<Block> p5) {
setChild(p0, 0);
setChild(p1, 1);
setID(p2);
setChild(p3, 2);
setChild(p4, 3);
setChild(p5, 4);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 5;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Modifiers child.
* @apilevel low-level
* @ast method
*
*/
public Modifiers getModifiersNoTransform() {
return (Modifiers)getChildNoTransform(0);
}
/**
* Replaces the TypeAccess child.
* @param node The new node to replace the TypeAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setTypeAccess(Access node) {
setChild(node, 1);
}
/**
* Retrieves the TypeAccess child.
* @return The current node used as the TypeAccess child.
* @apilevel high-level
* @ast method
*
*/
public Access getTypeAccess() {
return (Access)getChild(1);
}
/**
* Retrieves the TypeAccess child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the TypeAccess child.
* @apilevel low-level
* @ast method
*
*/
public Access getTypeAccessNoTransform() {
return (Access)getChildNoTransform(1);
}
/**
* 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 Parameter list.
* @param list The new list node to be used as the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public void setParameterList(List<ParameterDeclaration> list) {
setChild(list, 2);
}
/**
* Retrieves the number of children in the Parameter list.
* @return Number of children in the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public int getNumParameter() {
return getParameterList().getNumChild();
}
/**
* Retrieves the number of children in the Parameter list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Parameter list.
* @apilevel low-level
* @ast method
*
*/
public int getNumParameterNoTransform() {
return getParameterListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Parameter list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Parameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public ParameterDeclaration getParameter(int i) {
return (ParameterDeclaration)getParameterList().getChild(i);
}
/**
* Append an element to the Parameter list.
* @param node The element to append to the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public void addParameter(ParameterDeclaration node) {
List<ParameterDeclaration> list = (parent == null || state == null) ? getParameterListNoTransform() : getParameterList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addParameterNoTransform(ParameterDeclaration node) {
List<ParameterDeclaration> list = getParameterListNoTransform();
list.addChild(node);
}
/**
* Replaces the Parameter 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 setParameter(ParameterDeclaration node, int i) {
List<ParameterDeclaration> list = getParameterList();
list.setChild(node, i);
}
/**
* Retrieves the Parameter list.
* @return The node representing the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public List<ParameterDeclaration> getParameters() {
return getParameterList();
}
/**
* Retrieves the Parameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Parameter list.
* @apilevel low-level
* @ast method
*
*/
public List<ParameterDeclaration> getParametersNoTransform() {
return getParameterListNoTransform();
}
/**
* Retrieves the Parameter list.
* @return The node representing the Parameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<ParameterDeclaration> getParameterList() {
List<ParameterDeclaration> list = (List<ParameterDeclaration>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the Parameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Parameter list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<ParameterDeclaration> getParameterListNoTransform() {
return (List<ParameterDeclaration>)getChildNoTransform(2);
}
/**
* Replaces the Exception list.
* @param list The new list node to be used as the Exception list.
* @apilevel high-level
* @ast method
*
*/
public void setExceptionList(List<Access> list) {
setChild(list, 3);
}
/**
* Retrieves the number of children in the Exception list.
* @return Number of children in the Exception list.
* @apilevel high-level
* @ast method
*
*/
public int getNumException() {
return getExceptionList().getNumChild();
}
/**
* Retrieves the number of children in the Exception list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Exception list.
* @apilevel low-level
* @ast method
*
*/
public int getNumExceptionNoTransform() {
return getExceptionListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Exception list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Exception list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getException(int i) {
return (Access)getExceptionList().getChild(i);
}
/**
* Append an element to the Exception list.
* @param node The element to append to the Exception list.
* @apilevel high-level
* @ast method
*
*/
public void addException(Access node) {
List<Access> list = (parent == null || state == null) ? getExceptionListNoTransform() : getExceptionList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addExceptionNoTransform(Access node) {
List<Access> list = getExceptionListNoTransform();
list.addChild(node);
}
/**
* Replaces the Exception 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 setException(Access node, int i) {
List<Access> list = getExceptionList();
list.setChild(node, i);
}
/**
* Retrieves the Exception list.
* @return The node representing the Exception list.
* @apilevel high-level
* @ast method
*
*/
public List<Access> getExceptions() {
return getExceptionList();
}
/**
* Retrieves the Exception list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Exception list.
* @apilevel low-level
* @ast method
*
*/
public List<Access> getExceptionsNoTransform() {
return getExceptionListNoTransform();
}
/**
* Retrieves the Exception list.
* @return The node representing the Exception list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getExceptionList() {
List<Access> list = (List<Access>)getChild(3);
list.getNumChild();
return list;
}
/**
* Retrieves the Exception list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Exception list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getExceptionListNoTransform() {
return (List<Access>)getChildNoTransform(3);
}
/**
* Replaces the optional node for the Block child. This is the {@code Opt} node containing the child Block, not the actual child!
* @param opt The new node to be used as the optional node for the Block child.
* @apilevel low-level
* @ast method
*
*/
public void setBlockOpt(Opt<Block> opt) {
setChild(opt, 4);
}
/**
* Check whether the optional Block child exists.
* @return {@code true} if the optional Block child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasBlock() {
return getBlockOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) Block child.
* @return The Block child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Block getBlock() {
return (Block)getBlockOpt().getChild(0);
}
/**
* Replaces the (optional) Block child.
* @param node The new node to be used as the Block child.
* @apilevel high-level
* @ast method
*
*/
public void setBlock(Block node) {
getBlockOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Block> getBlockOpt() {
return (Opt<Block>)getChild(4);
}
/**
* Retrieves the optional node for child Block. This is the {@code Opt} node containing the child Block, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child Block.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Block> getBlockOptNoTransform() {
return (Opt<Block>)getChildNoTransform(4);
}
/**
* @attribute syn
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:107
*/
public int sootTypeModifiers() {
ASTNode$State state = state();
try {
int res = super.sootTypeModifiers();
res |= Modifiers.ACC_BRIDGE;
res |= Flags.ACC_SYNTHETIC;
return res;
}
finally {
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 15,633
| 26.142361
| 133
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ByteType.java
|
/* 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 ByteType : {@link IntegralType};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:56
*/
public class ByteType extends IntegralType implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
narrowingConversionTo_TypeDecl_values = null;
unaryNumericPromotion_computed = false;
unaryNumericPromotion_value = null;
boxed_computed = false;
boxed_value = null;
jvmName_computed = false;
jvmName_value = null;
getSootType_computed = false;
getSootType_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ByteType clone() throws CloneNotSupportedException {
ByteType node = (ByteType)super.clone();
node.narrowingConversionTo_TypeDecl_values = null;
node.unaryNumericPromotion_computed = false;
node.unaryNumericPromotion_value = null;
node.boxed_computed = false;
node.boxed_value = null;
node.jvmName_computed = false;
node.jvmName_value = null;
node.getSootType_computed = false;
node.getSootType_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ByteType copy() {
try {
ByteType node = (ByteType) 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 ByteType fullCopy() {
ByteType tree = (ByteType) 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:835
*/
public void toString(StringBuffer s) {
s.append("byte");
}
/**
* @ast method
*
*/
public ByteType() {
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[3];
setChild(new Opt(), 1);
setChild(new List(), 2);
}
/**
* @ast method
*
*/
public ByteType(Modifiers p0, String p1, Opt<Access> p2, List<BodyDecl> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @ast method
*
*/
public ByteType(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<BodyDecl> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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 optional node for the SuperClassAccess child. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* @param opt The new node to be used as the optional node for the SuperClassAccess child.
* @apilevel low-level
* @ast method
*
*/
public void setSuperClassAccessOpt(Opt<Access> opt) {
setChild(opt, 1);
}
/**
* Check whether the optional SuperClassAccess child exists.
* @return {@code true} if the optional SuperClassAccess child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasSuperClassAccess() {
return getSuperClassAccessOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) SuperClassAccess child.
* @return The SuperClassAccess child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getSuperClassAccess() {
return (Access)getSuperClassAccessOpt().getChild(0);
}
/**
* Replaces the (optional) SuperClassAccess child.
* @param node The new node to be used as the SuperClassAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setSuperClassAccess(Access node) {
getSuperClassAccessOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOpt() {
return (Opt<Access>)getChild(1);
}
/**
* Retrieves the optional node for child SuperClassAccess. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child SuperClassAccess.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOptNoTransform() {
return (Opt<Access>)getChildNoTransform(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<BodyDecl> 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<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addBodyDeclNoTransform(BodyDecl node) {
List<BodyDecl> 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<BodyDecl> list = getBodyDeclList();
list.setChild(node, i);
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<BodyDecl> getBodyDecls() {
return getBodyDeclList();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclsNoTransform() {
return getBodyDeclListNoTransform();
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclList() {
List<BodyDecl> list = (List<BodyDecl>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclListNoTransform() {
return (List<BodyDecl>)getChildNoTransform(2);
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:160
*/
public Constant cast(Constant c) {
ASTNode$State state = state();
try { return Constant.create((byte)c.intValue()); }
finally {
}
}
protected java.util.Map narrowingConversionTo_TypeDecl_values;
/**
* @attribute syn
* @aspect TypeConversion
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:30
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean narrowingConversionTo(TypeDecl type) {
Object _parameters = type;
if(narrowingConversionTo_TypeDecl_values == null) narrowingConversionTo_TypeDecl_values = new java.util.HashMap(4);
if(narrowingConversionTo_TypeDecl_values.containsKey(_parameters)) {
return ((Boolean)narrowingConversionTo_TypeDecl_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean narrowingConversionTo_TypeDecl_value = narrowingConversionTo_compute(type);
if(isFinal && num == state().boundariesCrossed) narrowingConversionTo_TypeDecl_values.put(_parameters, Boolean.valueOf(narrowingConversionTo_TypeDecl_value));
return narrowingConversionTo_TypeDecl_value;
}
/**
* @apilevel internal
*/
private boolean narrowingConversionTo_compute(TypeDecl type) { return type.isChar(); }
/**
* @apilevel internal
*/
protected boolean unaryNumericPromotion_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl unaryNumericPromotion_value;
/**
* @attribute syn
* @aspect NumericPromotion
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:149
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl unaryNumericPromotion() {
if(unaryNumericPromotion_computed) {
return unaryNumericPromotion_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
unaryNumericPromotion_value = unaryNumericPromotion_compute();
if(isFinal && num == state().boundariesCrossed) unaryNumericPromotion_computed = true;
return unaryNumericPromotion_value;
}
/**
* @apilevel internal
*/
private TypeDecl unaryNumericPromotion_compute() { return typeInt(); }
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:185
*/
public boolean isByte() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean boxed_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl boxed_value;
/**
* @attribute syn
* @aspect AutoBoxing
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:37
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl boxed() {
if(boxed_computed) {
return boxed_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boxed_value = boxed_compute();
if(isFinal && num == state().boundariesCrossed) boxed_computed = true;
return boxed_value;
}
/**
* @apilevel internal
*/
private TypeDecl boxed_compute() { return lookupType("java.lang", "Byte"); }
/**
* @attribute syn
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:82
*/
public TypeDecl stringPromotion() {
ASTNode$State state = state();
try { return typeInt(); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean jvmName_computed = false;
/**
* @apilevel internal
*/
protected String jvmName_value;
/**
* @attribute syn
* @aspect Java2Rewrites
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Java2Rewrites.jrag:35
*/
@SuppressWarnings({"unchecked", "cast"})
public String jvmName() {
if(jvmName_computed) {
return jvmName_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
jvmName_value = jvmName_compute();
if(isFinal && num == state().boundariesCrossed) jvmName_computed = true;
return jvmName_value;
}
/**
* @apilevel internal
*/
private String jvmName_compute() { return "B"; }
/**
* @attribute syn
* @aspect Java2Rewrites
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Java2Rewrites.jrag:44
*/
public String primitiveClassName() {
ASTNode$State state = state();
try { return "Byte"; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean getSootType_computed = false;
/**
* @apilevel internal
*/
protected Type getSootType_value;
/**
* @attribute syn
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:48
*/
@SuppressWarnings({"unchecked", "cast"})
public Type getSootType() {
if(getSootType_computed) {
return getSootType_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
getSootType_value = getSootType_compute();
if(isFinal && num == state().boundariesCrossed) getSootType_computed = true;
return getSootType_value;
}
/**
* @apilevel internal
*/
private Type getSootType_compute() { return soot.ByteType.v(); }
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 17,187
| 27.31631
| 164
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/BytecodeParser.java
|
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;
/**
* @ast class
*
*/
public class BytecodeParser extends java.lang.Object implements Flags, BytecodeReader {
public CompilationUnit read(InputStream is, String fullName, Program p) throws FileNotFoundException, IOException {
return new BytecodeParser(is, fullName).parse(null, null, p);
}
public static final boolean VERBOSE = false;
private DataInputStream is;
public CONSTANT_Class_Info classInfo;
public String outerClassName;
public String name;
public BytecodeParser(byte[] buffer, int size, String name) {
//this.is = new DataInputStream(new DummyInputStream(buffer, size));
this.is = new DataInputStream(new ByteArrayInputStream(buffer, 0, size));
this.name = name;
}
public BytecodeParser(InputStream in, String name) {
//this.is = new DataInputStream(new DummyInputStream(buffer, size));
this.is = new DataInputStream(new DummyInputStream(in));
this.name = name;
}
public BytecodeParser() {
this("");
}
public BytecodeParser(String name) {
if (!name.endsWith(".class")) {
//name = name.replaceAll("\\.", "/") + ".class";
name = name.replace('.', '/') + ".class";
}
this.name = name;
}
private static class DummyInputStream extends InputStream {
byte[] bytes;
int pos;
int size;
public DummyInputStream(byte[] buffer, int size) {
bytes = buffer;
this.size = size;
}
public DummyInputStream(InputStream is) {
bytes = new byte[1024];
int index = 0;
size = 1024;
try {
int status;
do {
status = is.read(bytes, index, size - index);
if(status != -1) {
index += status;
if(index == size) {
byte[] newBytes = new byte[size*2];
System.arraycopy(bytes, 0, newBytes, 0, size);
bytes = newBytes;
size *= 2;
}
}
} while (status != -1);
} catch (IOException e) {
System.err.println("Something went wrong trying to read " + is);
//System.exit(1);
}
size = index;
pos = 0;
}
public int available() {
return size - pos;
}
public void close() {
}
public void mark(int readlimit) {
}
public boolean markSupported() {
return false;
}
public int read(byte[] b) {
int actualLength = Math.min(b.length, size-pos);
System.arraycopy(bytes, pos, b, 0, actualLength);
pos += actualLength;
return actualLength;
}
public int read(byte[] b, int offset, int length) {
int actualLength = Math.min(length, size-pos);
System.arraycopy(bytes, pos, b, offset, actualLength);
pos += actualLength;
return actualLength;
}
public void reset() {
}
public long skip(long n) {
if(size == pos)
return -1;
long skipSize = Math.min(n, size-pos);
pos += skipSize;
return skipSize;
}
public int read() throws IOException {
if(pos < size) {
int i = bytes[pos++];
if(i < 0)
i = 256 + i;
return i;
}
return -1;
}
}
public int next() {
try {
return is.read();
} catch (IOException e) {
System.exit(1);
}
return -1;
}
public int u1() {
try {
return is.readUnsignedByte();
} catch (IOException e) {
System.exit(1);
}
return -1;
}
public int u2() {
try {
return is.readUnsignedShort();
} catch (IOException e) {
System.exit(1);
}
return -1;
}
public int u4() {
try {
return is.readInt();
} catch (IOException e) {
System.exit(1);
}
return -1;
}
public int readInt() {
try {
return is.readInt();
} catch (IOException e) {
System.exit(1);
}
return -1;
}
public float readFloat() {
try {
return is.readFloat();
} catch (IOException e) {
System.exit(1);
}
return -1;
}
public long readLong() {
try {
return is.readLong();
} catch (IOException e) {
System.exit(1);
}
return -1;
}
public double readDouble() {
try {
return is.readDouble();
} catch (IOException e) {
System.exit(1);
}
return -1;
}
public String readUTF() {
try {
return is.readUTF();
} catch (IOException e) {
System.exit(1);
}
return "";
}
public void skip(int length) {
try {
is.skip(length);
} catch (IOException e) {
System.exit(1);
}
}
public void error(String s) {
throw new RuntimeException(s);
}
public void print(String s) {
//System.out.print(s);
}
public void println(String s) {
print(s + "\n");
}
public void println() {
print("\n");
}
public CompilationUnit parse(TypeDecl outerTypeDecl, String outerClassName, Program classPath, boolean isInner)
throws FileNotFoundException, IOException {
isInnerClass = isInner;
return parse(outerTypeDecl, outerClassName, classPath);
}
public CompilationUnit parse(TypeDecl outerTypeDecl, String outerClassName, Program program)
throws FileNotFoundException, IOException {
//InputStream file = ClassLoader.getSystemResourceAsStream(name);
if(is == null) {
FileInputStream file = new FileInputStream(name);
//System.err.println("/home/torbjorn/sandbox/jdk/" + name);
if(file == null) {
throw new FileNotFoundException(name);
}
// // Does not work without DummyInputStream. Why?
//is = new DataInputStream(new DummyInputStream(new BufferedInputStream(file)));
is = new DataInputStream(new BufferedInputStream(file));
}
if(BytecodeParser.VERBOSE)
println("Parsing byte codes in " + name);
this.outerClassName = outerClassName;
parseMagic();
parseMinor();
parseMajor();
parseConstantPool();
CompilationUnit cu = new CompilationUnit();
TypeDecl typeDecl = parseTypeDecl();
cu.setPackageDecl(classInfo.packageDecl());
cu.addTypeDecl(typeDecl);
parseFields(typeDecl);
parseMethods(typeDecl);
//parse attributes, and if we have an inner class, then execute the branch...
if(new Attributes.TypeAttributes(this, typeDecl, outerTypeDecl, program).isInnerClass()) {
//this is a workaround for the fact that JastAdd stores inner classes as members of
//their outer classes, even for inner classes that come from bytecode;
//to avoid having inner classes show up as top-level classes, we remove them here
//from the compilation unit again...
//first add the cu to the program, so that getTypeDecls() won't fail
program.addCompilationUnit(cu);
//then clear the cu
for(int i=0;i<cu.getTypeDecls().getNumChild();i++) {
cu.getTypeDecls().removeChild(i);
}
//and remove the cu from the program again
program.getCompilationUnits().removeChild(program.getCompilationUnits().getIndexOfChild(cu));
}
is.close();
is = null;
return cu;
}
public void parseMagic() {
if (next() != 0xca || next() != 0xfe || next() != 0xba || next() != 0xbe)
error("magic error");
}
public void parseMinor() {
int low = u1();
int high = u1();
if(BytecodeParser.VERBOSE)
println("Minor: " + high + "." + low);
}
public void parseMajor() {
int low = u1();
int high = u1();
if(BytecodeParser.VERBOSE)
println("Major: " + high + "." + low);
}
public boolean isInnerClass = false;
public TypeDecl parseTypeDecl() {
int flags = u2();
Modifiers modifiers = modifiers(flags & 0xfddf);
if((flags & (ACC_INTERFACE | ACC_ENUM)) == ACC_ENUM) {
// Modifiers <ID:String> /[SuperClassAccess:Access]/ Implements:Access* BodyDecl*;
EnumDecl decl = new EnumDecl();
decl.setModifiers(modifiers);
decl.setID(parseThisClass());
Access superClass = parseSuperClass();
decl.setImplementsList(parseInterfaces(new List()));
return decl;
}
else if ((flags & ACC_INTERFACE) == 0) {
ClassDecl decl = new ClassDecl();
decl.setModifiers(modifiers);
decl.setID(parseThisClass());
Access superClass = parseSuperClass();
decl.setSuperClassAccessOpt(superClass == null ? new Opt()
: new Opt(superClass));
decl.setImplementsList(parseInterfaces(new List()));
return decl;
} else if((flags & ACC_ANNOTATION) == 0) {
InterfaceDecl decl = new InterfaceDecl();
decl.setModifiers(modifiers);
decl.setID(parseThisClass());
Access superClass = parseSuperClass();
decl.setSuperInterfaceIdList(
parseInterfaces(
superClass == null ? new List()
: new List().add(superClass)));
return decl;
} else {
AnnotationDecl decl = new AnnotationDecl();
decl.setModifiers(modifiers);
decl.setID(parseThisClass());
Access superClass = parseSuperClass();
parseInterfaces(
superClass == null ? new List()
: new List().add(superClass));
return decl;
}
}
public String parseThisClass() {
int index = u2();
CONSTANT_Class_Info info = (CONSTANT_Class_Info) constantPool[index];
classInfo = info;
return info.simpleName();
}
public Access parseSuperClass() {
int index = u2();
if (index == 0)
return null;
CONSTANT_Class_Info info = (CONSTANT_Class_Info) constantPool[index];
return info.access();
}
public List parseInterfaces(List list) {
int count = u2();
for (int i = 0; i < count; i++) {
CONSTANT_Class_Info info = (CONSTANT_Class_Info) constantPool[u2()];
list.add(info.access());
}
return list;
}
public Access fromClassName(String s) {
// Sample ClassName: a/b/c$d$e
// the package name ends at the last '/'
// after that follows a list of type names separated by '$'
// all except the first are nested types
String packageName = "";
int index = s.lastIndexOf('/');
if(index != -1)
packageName = s.substring(0, index).replace('/', '.');
String typeName = s.substring(index + 1, s.length());
if(typeName.indexOf('$') != -1)
return new BytecodeTypeAccess(packageName, typeName);
else
return new TypeAccess(packageName, typeName);
}
public static Modifiers modifiers(int flags) {
Modifiers m = new Modifiers();
if ((flags & 0x0001) != 0)
m.addModifier(new Modifier("public"));
if ((flags & 0x0002) != 0)
m.addModifier(new Modifier("private"));
if ((flags & 0x0004) != 0)
m.addModifier(new Modifier("protected"));
if ((flags & 0x0008) != 0)
m.addModifier(new Modifier("static"));
if ((flags & 0x0010) != 0)
m.addModifier(new Modifier("final"));
if ((flags & 0x0020) != 0)
m.addModifier(new Modifier("synchronized"));
if ((flags & 0x0040) != 0)
m.addModifier(new Modifier("volatile"));
if ((flags & 0x0080) != 0)
m.addModifier(new Modifier("transient"));
if ((flags & 0x0100) != 0)
m.addModifier(new Modifier("native"));
if ((flags & 0x0400) != 0)
m.addModifier(new Modifier("abstract"));
if ((flags & 0x0800) != 0)
m.addModifier(new Modifier("strictfp"));
return m;
}
public void parseFields(TypeDecl typeDecl) {
int count = u2();
if(BytecodeParser.VERBOSE)
println("Fields (" + count + "):");
for (int i = 0; i < count; i++) {
if(BytecodeParser.VERBOSE)
print(" Field nbr " + i + " ");
FieldInfo fieldInfo = new FieldInfo(this);
if(!fieldInfo.isSynthetic())
typeDecl.addBodyDecl(fieldInfo.bodyDecl());
}
}
public void parseMethods(TypeDecl typeDecl) {
int count = u2();
if(BytecodeParser.VERBOSE)
println("Methods (" + count + "):");
for (int i = 0; i < count; i++) {
if(BytecodeParser.VERBOSE)
print(" Method nbr " + i + " ");
MethodInfo info = new MethodInfo(this);
if(!info.isSynthetic() && !info.name.equals("<clinit>")) {
typeDecl.addBodyDecl(info.bodyDecl());
}
}
}
public CONSTANT_Info[] constantPool = null;
private void checkLengthAndNull(int index) {
if(index >= constantPool.length) {
throw new Error("Trying to access element " + index + " in constant pool of length " + constantPool.length);
}
if(constantPool[index] == null)
throw new Error("Unexpected null element in constant pool at index " + index);
}
public boolean validConstantPoolIndex(int index) {
return index < constantPool.length && constantPool[index] != null;
}
public CONSTANT_Info getCONSTANT_Info(int index) {
checkLengthAndNull(index);
return constantPool[index];
}
public CONSTANT_Utf8_Info getCONSTANT_Utf8_Info(int index) {
checkLengthAndNull(index);
CONSTANT_Info info = constantPool[index];
if(!(info instanceof CONSTANT_Utf8_Info))
throw new Error("Expected CONSTANT_Utf8_info at " + index + " in constant pool but found " + info.getClass().getName());
return (CONSTANT_Utf8_Info)info;
}
public CONSTANT_Class_Info getCONSTANT_Class_Info(int index) {
checkLengthAndNull(index);
CONSTANT_Info info = constantPool[index];
if(!(info instanceof CONSTANT_Class_Info))
throw new Error("Expected CONSTANT_Class_info at " + index + " in constant pool but found " + info.getClass().getName());
return (CONSTANT_Class_Info)info;
}
public void parseConstantPool() {
int count = u2();
if(BytecodeParser.VERBOSE)
println("constant_pool_count: " + count);
constantPool = new CONSTANT_Info[count + 1];
for (int i = 1; i < count; i++) {
parseEntry(i);
if (constantPool[i] instanceof CONSTANT_Long_Info
|| constantPool[i] instanceof CONSTANT_Double_Info)
i++;
}
//println("ConstantPool: ");
//for(int i = 1; i < count; i++) {
// println(i + ", " + constantPool[i]);
//}
}
private static final int CONSTANT_Class = 7;
private static final int CONSTANT_FieldRef = 9;
private static final int CONSTANT_MethodRef = 10;
private static final int CONSTANT_InterfaceMethodRef = 11;
private static final int CONSTANT_String = 8;
private static final int CONSTANT_Integer = 3;
private static final int CONSTANT_Float = 4;
private static final int CONSTANT_Long = 5;
private static final int CONSTANT_Double = 6;
private static final int CONSTANT_NameAndType = 12;
private static final int CONSTANT_Utf8 = 1;
private static final int CONSTANT_MethodHandle= 15;
private static final int CONSTANT_MethodType = 16;
private static final int CONSTANT_InvokeDynamic = 18;
public void parseEntry(int i) {
int tag = u1();
switch (tag) {
case CONSTANT_Class:
constantPool[i] = new CONSTANT_Class_Info(this);
break;
case CONSTANT_FieldRef:
constantPool[i] = new CONSTANT_Fieldref_Info(this);
break;
case CONSTANT_MethodRef:
constantPool[i] = new CONSTANT_Methodref_Info(this);
break;
case CONSTANT_InterfaceMethodRef:
constantPool[i] = new CONSTANT_InterfaceMethodref_Info(this);
break;
case CONSTANT_String:
constantPool[i] = new CONSTANT_String_Info(this);
break;
case CONSTANT_Integer:
constantPool[i] = new CONSTANT_Integer_Info(this);
break;
case CONSTANT_Float:
constantPool[i] = new CONSTANT_Float_Info(this);
break;
case CONSTANT_Long:
constantPool[i] = new CONSTANT_Long_Info(this);
break;
case CONSTANT_Double:
constantPool[i] = new CONSTANT_Double_Info(this);
break;
case CONSTANT_NameAndType:
constantPool[i] = new CONSTANT_NameAndType_Info(this);
break;
case CONSTANT_Utf8:
constantPool[i] = new CONSTANT_Utf8_Info(this);
break;
case CONSTANT_MethodHandle:
constantPool[i] = new CONSTANT_MethodHandle_Info(this);
break;
case CONSTANT_MethodType:
constantPool[i] = new CONSTANT_MethodType_Info(this);
break;
case CONSTANT_InvokeDynamic:
constantPool[i] = new CONSTANT_InvokeDynamic_Info(this);
break;
default:
println("Unknown entry: " + tag);
}
}
}
| 18,057
| 24.577904
| 129
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/BytecodeReader.java
|
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;
/**
* @ast interface
*
*/
public interface BytecodeReader {
CompilationUnit read(InputStream is, String fullName, Program p) throws FileNotFoundException, IOException;
}
| 657
| 21.689655
| 111
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/BytecodeTypeAccess.java
|
/* 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 BytecodeTypeAccess : {@link TypeAccess};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BoundNames.ast:10
*/
public class BytecodeTypeAccess extends TypeAccess implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public BytecodeTypeAccess clone() throws CloneNotSupportedException {
BytecodeTypeAccess node = (BytecodeTypeAccess)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public BytecodeTypeAccess copy() {
try {
BytecodeTypeAccess node = (BytecodeTypeAccess) 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 BytecodeTypeAccess fullCopy() {
BytecodeTypeAccess tree = (BytecodeTypeAccess) 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
*
*/
public BytecodeTypeAccess() {
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() {
}
/**
* @ast method
*
*/
public BytecodeTypeAccess(String p0, String p1) {
setPackage(p0);
setID(p1);
}
/**
* @ast method
*
*/
public BytecodeTypeAccess(beaver.Symbol p0, beaver.Symbol p1) {
setPackage(p0);
setID(p1);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return true;
}
/**
* 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;
}
/**
* JastAdd-internal setter for lexeme Package using the Beaver parser.
* @apilevel internal
* @ast method
*
*/
public void setPackage(beaver.Symbol symbol) {
if(symbol.value != null && !(symbol.value instanceof String))
throw new UnsupportedOperationException("setPackage is only valid for String lexemes");
tokenString_Package = (String)symbol.value;
Packagestart = symbol.getStart();
Packageend = symbol.getEnd();
}
/**
* Retrieves the value for the lexeme Package.
* @return The value for the lexeme Package.
* @apilevel high-level
* @ast method
*
*/
public String getPackage() {
return tokenString_Package != null ? tokenString_Package : "";
}
/**
* 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 : "";
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
// Declared in /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BoundNames.jrag at line 95
state().duringBoundNames++;
ASTNode result = rewriteRule0();
state().duringBoundNames--;
return result;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BoundNames.jrag:95
* @apilevel internal
*/ private Access rewriteRule0() {
{
if(name().indexOf("$") == -1)
return new TypeAccess(packageName(), name());
else {
String[] names = name().split("\\$");
Access a = null; // the resulting access
String newName = null; // the subname to try
TypeDecl type = null; // qualifying type if one
for(int i = 0; i < names.length; i++) {
newName = newName == null ? names[i] : (newName + "$" + names[i]);
SimpleSet set;
if(type != null)
set = type.memberTypes(newName);
else if(packageName().equals(""))
set = lookupType(newName);
else {
TypeDecl typeDecl = lookupType(packageName(), newName);
set = SimpleSet.emptySet;
if(typeDecl != null)
set = set.add(typeDecl);
}
if(!set.isEmpty()) {
a = a == null ? (Access)new TypeAccess(packageName(), newName) : (Access)a.qualifiesAccess(new TypeAccess(newName));
type = (TypeDecl)set.iterator().next();
newName = null; // reset subname
}
}
if(a == null) {
a = new TypeAccess(packageName(), name());
}
return a;
}
} }
}
| 6,713
| 25.856
| 128
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CONSTANT_Class_Info.java
|
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;
/**
* @ast class
*
*/
public class CONSTANT_Class_Info extends CONSTANT_Info {
public int name_index;
public CONSTANT_Class_Info(BytecodeParser parser) {
super(parser);
name_index = p.u2();
}
public String toString() {
return "ClassInfo: " + name();
}
public String name() {
String name = ((CONSTANT_Utf8_Info) this.p.constantPool[name_index]).string();
//name = name.replaceAll("\\/", ".");
name = name.replace('/', '.');
return name;
}
public String simpleName() {
String name = name();
//name = name.replace('$', '.');
int pos = name.lastIndexOf('.');
return name.substring(pos + 1, name.length());
}
public String packageDecl() {
String name = name();
//name = name.replace('$', '.');
int pos = name.lastIndexOf('.');
if(pos == -1)
return "";
return name.substring(0, pos);
}
public Access access() {
String name = name();
int pos = name.lastIndexOf('.');
String typeName = name.substring(pos + 1, name.length());
String packageName = pos == -1 ? "" : name.substring(0, pos);
if(typeName.indexOf('$') != -1)
return new BytecodeTypeAccess(packageName, typeName);
else
return new TypeAccess(packageName, typeName);
}
}
| 1,826
| 20.494118
| 84
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CONSTANT_Double_Info.java
|
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;
/**
* @ast class
*
*/
public class CONSTANT_Double_Info extends CONSTANT_Info {
public double value;
public CONSTANT_Double_Info(BytecodeParser parser) {
super(parser);
value = this.p.readDouble();
}
public String toString() {
return "DoubleInfo: " + Double.toString(value);
}
public Expr expr() {
return Literal.buildDoubleLiteral(value);
}
}
| 884
| 17.061224
| 57
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CONSTANT_Fieldref_Info.java
|
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;
/**
* @ast class
*
*/
public class CONSTANT_Fieldref_Info extends CONSTANT_Info {
public int class_index;
public int name_and_type_index;
public CONSTANT_Fieldref_Info(BytecodeParser parser) {
super(parser);
class_index = p.u2();
name_and_type_index = p.u2();
}
public String toString() {
return "FieldRefInfo: " + p.constantPool[class_index] + " "
+ p.constantPool[name_and_type_index];
}
}
| 935
| 18.5
| 65
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CONSTANT_Float_Info.java
|
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;
/**
* @ast class
*
*/
public class CONSTANT_Float_Info extends CONSTANT_Info {
public float value;
public CONSTANT_Float_Info(BytecodeParser parser) {
super(parser);
value = p.readFloat();
}
public String toString() {
return "FloatInfo: " + Float.toString(value);
}
public Expr expr() {
return Literal.buildFloatLiteral(value);
}
}
| 872
| 16.816327
| 56
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CONSTANT_Info.java
|
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;
/**
* @ast class
*
*/
public class CONSTANT_Info extends java.lang.Object {
protected BytecodeParser p;
public CONSTANT_Info(BytecodeParser parser) {
p = parser;
}
public Expr expr() {
throw new Error("CONSTANT_info.expr() should not be computed for " + getClass().getName());
}
public Expr exprAsBoolean() {
return expr();
}
}
| 860
| 17.717391
| 97
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CONSTANT_Integer_Info.java
|
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;
/**
* @ast class
*
*/
public class CONSTANT_Integer_Info extends CONSTANT_Info {
public int value;
public CONSTANT_Integer_Info(BytecodeParser parser) {
super(parser);
value = p.readInt();
}
public String toString() {
return "IntegerInfo: " + Integer.toString(value);
}
public Expr expr() {
return Literal.buildIntegerLiteral(value);
}
public Expr exprAsBoolean() {
return Literal.buildBooleanLiteral(value == 0);
}
}
| 974
| 17.055556
| 58
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CONSTANT_InterfaceMethodref_Info.java
|
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;
/**
* @ast class
*
*/
public class CONSTANT_InterfaceMethodref_Info extends CONSTANT_Info {
public int class_index;
public int name_and_type_index;
public CONSTANT_InterfaceMethodref_Info(BytecodeParser parser) {
super(parser);
class_index = p.u2();
name_and_type_index = p.u2();
}
public String toString() {
return "InterfaceMethodRefInfo: " + p.constantPool[class_index] + " "
+ p.constantPool[name_and_type_index];
}
}
| 965
| 19.125
| 75
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CONSTANT_InvokeDynamic_Info.java
|
package soot.JastAddJ;
/**
* @ast class
*/
public class CONSTANT_InvokeDynamic_Info extends CONSTANT_Info {
public int method_attr_index;
public int name_and_type_index;
public CONSTANT_InvokeDynamic_Info(BytecodeParser parser) {
super(parser);
method_attr_index = p.u2();
name_and_type_index = p.u2();
}
public String toString() {
return "InvokeDynamicInfo: " + method_attr_index + " " + name_and_type_index;
}
}
| 476
| 16.666667
| 85
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CONSTANT_Long_Info.java
|
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;
/**
* @ast class
*
*/
public class CONSTANT_Long_Info extends CONSTANT_Info {
public long value;
public CONSTANT_Long_Info(BytecodeParser parser) {
super(parser);
value = p.readLong();
}
public String toString() {
return "LongInfo: " + Long.toString(value);
}
public Expr expr() {
return Literal.buildLongLiteral(value);
}
}
| 865
| 16.673469
| 55
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CONSTANT_MethodHandle_Info.java
|
package soot.JastAddJ;
/**
* @ast class
*/
public class CONSTANT_MethodHandle_Info extends CONSTANT_Info {
public int reference_kind;
public int reference_index;
public CONSTANT_MethodHandle_Info(BytecodeParser parser) {
super(parser);
reference_kind = p.u1();
reference_index = p.u2();
}
public String toString() {
return "MethodHandleInfo: " + reference_kind + " " + reference_index;
}
}
| 452
| 15.777778
| 77
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CONSTANT_MethodType_Info.java
|
package soot.JastAddJ;
/**
* @ast class
*/
public class CONSTANT_MethodType_Info extends CONSTANT_Info {
public int descriptor_index;
public CONSTANT_MethodType_Info(BytecodeParser parser) {
super(parser);
descriptor_index = p.u2();
}
public String toString() {
return "MethodTypeInfo: " + descriptor_index ;
}
}
| 363
| 14.826087
| 61
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CONSTANT_Methodref_Info.java
|
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;
/**
* @ast class
*
*/
public class CONSTANT_Methodref_Info extends CONSTANT_Info {
public int class_index;
public int name_and_type_index;
public CONSTANT_Methodref_Info(BytecodeParser parser) {
super(parser);
class_index = p.u2();
name_and_type_index = p.u2();
}
public String toString() {
return "MethodRefInfo: " + class_index + " " + name_and_type_index;
}
}
| 898
| 18.12766
| 73
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CONSTANT_NameAndType_Info.java
|
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;
/**
* @ast class
*
*/
public class CONSTANT_NameAndType_Info extends CONSTANT_Info {
public int name_index;
public int descriptor_index;
public CONSTANT_NameAndType_Info(BytecodeParser parser) {
super(parser);
name_index = p.u2();
descriptor_index = p.u2();
}
public String toString() {
return "NameAndTypeInfo: " + name_index + " " + descriptor_index;
}
}
| 892
| 18
| 71
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CONSTANT_String_Info.java
|
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;
/**
* @ast class
*
*/
public class CONSTANT_String_Info extends CONSTANT_Info {
public int string_index;
public CONSTANT_String_Info(BytecodeParser parser) {
super(parser);
string_index = p.u2();
}
public Expr expr() {
CONSTANT_Utf8_Info i = (CONSTANT_Utf8_Info)p.constantPool[string_index];
return Literal.buildStringLiteral(i.string);
}
public String toString() {
return "StringInfo: " + p.constantPool[string_index];
}
}
| 970
| 18.42
| 78
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CONSTANT_Utf8_Info.java
|
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;
/**
* @ast class
*
*/
public class CONSTANT_Utf8_Info extends CONSTANT_Info {
public String string;
public CONSTANT_Utf8_Info(BytecodeParser parser) {
super(parser);
string = p.readUTF();
}
public String toString() {
return "Utf8Info: " + string;
}
public Expr expr() {
return Literal.buildStringLiteral(string);
}
public String string() {
return string;
}
}
| 916
| 15.672727
| 55
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/Case.java
|
/* 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 Case : {@link Stmt};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:203
*/
public abstract class Case extends Stmt implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
isDAbefore_Variable_values = null;
isDAafter_Variable_values = null;
isDUafter_Variable_values = null;
label_computed = false;
label_value = null;
bind_Case_values = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public Case clone() throws CloneNotSupportedException {
Case node = (Case)super.clone();
node.isDAbefore_Variable_values = null;
node.isDAafter_Variable_values = null;
node.isDUafter_Variable_values = null;
node.label_computed = false;
node.label_value = null;
node.bind_Case_values = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @ast method
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:109
*/
public void jimplify2(Body b) {
b.addLabel(label());
}
/**
* @ast method
*
*/
public Case() {
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() {
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* @attribute syn
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:431
*/
@SuppressWarnings({"unchecked", "cast"})
public abstract boolean constValue(Case c);
protected java.util.Map isDAbefore_Variable_values;
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:570
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDAbefore(Variable v) {
Object _parameters = v;
if(isDAbefore_Variable_values == null) isDAbefore_Variable_values = new java.util.HashMap(4);
if(isDAbefore_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDAbefore_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDAbefore_Variable_value = isDAbefore_compute(v);
if(isFinal && num == state().boundariesCrossed) isDAbefore_Variable_values.put(_parameters, Boolean.valueOf(isDAbefore_Variable_value));
return isDAbefore_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDAbefore_compute(Variable v) { return getParent().getParent() instanceof Block && ((Block)getParent().getParent()).isDAbefore(v)
&& super.isDAbefore(v); }
protected java.util.Map isDAafter_Variable_values;
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:574
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDAafter(Variable v) {
Object _parameters = v;
if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4);
if(isDAafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDAafter_Variable_value = isDAafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value));
return isDAafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDAafter_compute(Variable v) { return isDAbefore(v); }
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:1025
*/
public boolean isDUbefore(Variable v) {
ASTNode$State state = state();
try { return getParent().getParent() instanceof Block && ((Block)getParent().getParent()).isDUbefore(v)
&& super.isDUbefore(v); }
finally {
}
}
protected java.util.Map isDUafter_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:1029
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDUafter(Variable v) {
Object _parameters = v;
if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4);
if(isDUafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDUafter_Variable_value = isDUafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value));
return isDUafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDUafter_compute(Variable v) { return isDUbefore(v); }
/**
* @attribute syn
* @aspect UnreachableStatements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:83
*/
public boolean reachable() {
ASTNode$State state = state();
try { return getParent().getParent() instanceof Block && ((Block)getParent().getParent()).reachable(); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean label_computed = false;
/**
* @apilevel internal
*/
protected soot.jimple.Stmt label_value;
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:107
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt label() {
if(label_computed) {
return label_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
label_value = label_compute();
if(isFinal && num == state().boundariesCrossed) label_computed = true;
return label_value;
}
/**
* @apilevel internal
*/
private soot.jimple.Stmt label_compute() { return newLabel(); }
/**
* @attribute syn
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:55
*/
public boolean modifiedInScope(Variable var) {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/* Type checking for case labels need not be changed as it
* already tests if the case labels have expressions which are
* assignable to the switch expression
* @attribute syn
* @aspect StringsInSwitch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/StringsInSwitch.jrag:38
*/
public boolean isDefaultCase() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
protected java.util.Map bind_Case_values;
/**
* @attribute inh
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:417
*/
@SuppressWarnings({"unchecked", "cast"})
public Case bind(Case c) {
Object _parameters = c;
if(bind_Case_values == null) bind_Case_values = new java.util.HashMap(4);
if(bind_Case_values.containsKey(_parameters)) {
return (Case)bind_Case_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
Case bind_Case_value = getParent().Define_Case_bind(this, null, c);
if(isFinal && num == state().boundariesCrossed) bind_Case_values.put(_parameters, bind_Case_value);
return bind_Case_value;
}
/**
* @attribute inh
* @aspect TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:358
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl switchType() {
ASTNode$State state = state();
TypeDecl switchType_value = getParent().Define_TypeDecl_switchType(this, null);
return switchType_value;
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 9,536
| 31.003356
| 149
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CastExpr.java
|
/* 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 CastExpr : {@link Expr} ::= <span class="component">TypeAccess:{@link Access}</span> <span class="component">{@link Expr}</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:144
*/
public class CastExpr extends Expr implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
type_computed = false;
type_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public CastExpr clone() throws CloneNotSupportedException {
CastExpr node = (CastExpr)super.clone();
node.type_computed = false;
node.type_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public CastExpr copy() {
try {
CastExpr node = (CastExpr) 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 CastExpr fullCopy() {
CastExpr tree = (CastExpr) 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:385
*/
public void toString(StringBuffer s) {
s.append("(");
getTypeAccess().toString(s);
s.append(")");
getExpr().toString(s);
}
/**
* @ast method
* @aspect TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:252
*/
public void typeCheck() {
TypeDecl expr = getExpr().type();
TypeDecl type = getTypeAccess().type();
if(!expr.isUnknown()) {
if(!expr.castingConversionTo(type))
error(expr.typeName() + " can not be cast into " + type.typeName());
if(!getTypeAccess().isTypeAccess())
error("" + getTypeAccess() + " is not a type access in cast expression");
}
}
/**
* @ast method
* @aspect Expressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:709
*/
public soot.Value eval(Body b) {
if(isConstant())
return emitConstant(constant());
soot.Value operand = getExpr().eval(b);
if (operand == NullConstant.v())
return getExpr().type().emitCastTo(b, operand, type(), this);
return getExpr().type().emitCastTo(b, asLocal(b, operand), type(), this);
}
/**
* @ast method
* @aspect UncheckedConversion
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/UncheckedConversion.jrag:35
*/
public void checkWarnings() {
if (!withinSuppressWarnings("unchecked"))
checkUncheckedConversion(getExpr().type(), getTypeAccess().type());
}
/**
* @ast method
*
*/
public CastExpr() {
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 CastExpr(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 TypeAccess child.
* @param node The new node to replace the TypeAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setTypeAccess(Access node) {
setChild(node, 0);
}
/**
* Retrieves the TypeAccess child.
* @return The current node used as the TypeAccess child.
* @apilevel high-level
* @ast method
*
*/
public Access getTypeAccess() {
return (Access)getChild(0);
}
/**
* Retrieves the TypeAccess child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the TypeAccess child.
* @apilevel low-level
* @ast method
*
*/
public Access getTypeAccessNoTransform() {
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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Expr child.
* @apilevel low-level
* @ast method
*
*/
public Expr getExprNoTransform() {
return (Expr)getChildNoTransform(1);
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:91
*/
public Constant constant() {
ASTNode$State state = state();
try { return type().cast(getExpr().constant()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:336
*/
public boolean isConstant() {
ASTNode$State state = state();
try { return getExpr().isConstant() &&
(getTypeAccess().type().isPrimitive() || getTypeAccess().type().isString()); }
finally {
}
}
/**
* @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 {
}
}
/**
* @attribute syn
* @aspect AccessTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:25
*/
public boolean isSuperAccess() {
ASTNode$State state = state();
try { return getExpr().isSuperAccess(); }
finally {
}
}
/**
* @attribute syn
* @aspect AccessTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:31
*/
public boolean isThisAccess() {
ASTNode$State state = state();
try { return getExpr().isThisAccess(); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean type_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl type_value;
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:320
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl type() {
if(type_computed) {
return type_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
type_value = type_compute();
if(isFinal && num == state().boundariesCrossed) type_computed = true;
return type_value;
}
/**
* @apilevel internal
*/
private TypeDecl type_compute() { return getTypeAccess().type(); }
/**
* @attribute syn
* @aspect TypeHierarchyCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:150
*/
public boolean staticContextQualifier() {
ASTNode$State state = state();
try { return getExpr().staticContextQualifier(); }
finally {
}
}
/**
* @attribute inh
* @aspect SuppressWarnings
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/SuppressWarnings.jrag:16
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean withinSuppressWarnings(String s) {
ASTNode$State state = state();
boolean withinSuppressWarnings_String_value = getParent().Define_boolean_withinSuppressWarnings(this, null, s);
return withinSuppressWarnings_String_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:88
* @apilevel internal
*/
public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {
if(caller == getTypeAccessNoTransform()) {
return NameType.TYPE_NAME;
}
else { return getParent().Define_NameType_nameType(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 10,374
| 26.37467
| 144
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CatchClause.java
|
/* 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;
/**
* Abstract superclass for catch clauses.
* @production CatchClause : {@link ASTNode} ::= <span class="component">{@link Block}</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.ast:4
*/
public abstract class CatchClause extends ASTNode<ASTNode> implements Cloneable, VariableScope {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
parameterDeclaration_String_values = null;
typeThrowable_computed = false;
typeThrowable_value = null;
lookupVariable_String_values = null;
reachableCatchClause_TypeDecl_values = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public CatchClause clone() throws CloneNotSupportedException {
CatchClause node = (CatchClause)super.clone();
node.parameterDeclaration_String_values = null;
node.typeThrowable_computed = false;
node.typeThrowable_value = null;
node.lookupVariable_String_values = null;
node.reachableCatchClause_TypeDecl_values = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @ast method
*
*/
public CatchClause() {
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[1];
}
/**
* @ast method
*
*/
public CatchClause(Block p0) {
setChild(p0, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 1;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the Block child.
* @param node The new node to replace the Block child.
* @apilevel high-level
* @ast method
*
*/
public void setBlock(Block node) {
setChild(node, 0);
}
/**
* Retrieves the Block child.
* @return The current node used as the Block child.
* @apilevel high-level
* @ast method
*
*/
public Block getBlock() {
return (Block)getChild(0);
}
/**
* Retrieves the Block child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Block child.
* @apilevel low-level
* @ast method
*
*/
public Block getBlockNoTransform() {
return (Block)getChildNoTransform(0);
}
/**
* @attribute syn
* @aspect ExceptionHandling
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:212
*/
public boolean handles(TypeDecl exceptionType) {
ASTNode$State state = state();
try { return false; }
finally {
}
}
protected java.util.Map parameterDeclaration_String_values;
/**
* @attribute syn
* @aspect VariableScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:111
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet parameterDeclaration(String name) {
Object _parameters = name;
if(parameterDeclaration_String_values == null) parameterDeclaration_String_values = new java.util.HashMap(4);
if(parameterDeclaration_String_values.containsKey(_parameters)) {
return (SimpleSet)parameterDeclaration_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet parameterDeclaration_String_value = parameterDeclaration_compute(name);
if(isFinal && num == state().boundariesCrossed) parameterDeclaration_String_values.put(_parameters, parameterDeclaration_String_value);
return parameterDeclaration_String_value;
}
/**
* @apilevel internal
*/
private SimpleSet parameterDeclaration_compute(String name) { return SimpleSet.emptySet; }
/**
* @attribute syn
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:109
*/
public boolean modifiedInScope(Variable var) {
ASTNode$State state = state();
try { return getBlock().modifiedInScope(var); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean typeThrowable_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl typeThrowable_value;
/**
* @attribute inh
* @aspect SpecialClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:68
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl typeThrowable() {
if(typeThrowable_computed) {
return typeThrowable_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
typeThrowable_value = getParent().Define_TypeDecl_typeThrowable(this, null);
if(isFinal && num == state().boundariesCrossed) typeThrowable_computed = true;
return typeThrowable_value;
}
protected java.util.Map lookupVariable_String_values;
/**
* @attribute inh
* @aspect VariableScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:20
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet lookupVariable(String name) {
Object _parameters = name;
if(lookupVariable_String_values == null) lookupVariable_String_values = new java.util.HashMap(4);
if(lookupVariable_String_values.containsKey(_parameters)) {
return (SimpleSet)lookupVariable_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet lookupVariable_String_value = getParent().Define_SimpleSet_lookupVariable(this, null, name);
if(isFinal && num == state().boundariesCrossed) lookupVariable_String_values.put(_parameters, lookupVariable_String_value);
return lookupVariable_String_value;
}
protected java.util.Map reachableCatchClause_TypeDecl_values;
/**
* @return true if an exception of type exceptionType is catchable by the catch clause
* @attribute inh
* @aspect UnreachableStatements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:127
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean reachableCatchClause(TypeDecl exceptionType) {
Object _parameters = exceptionType;
if(reachableCatchClause_TypeDecl_values == null) reachableCatchClause_TypeDecl_values = new java.util.HashMap(4);
if(reachableCatchClause_TypeDecl_values.containsKey(_parameters)) {
return ((Boolean)reachableCatchClause_TypeDecl_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean reachableCatchClause_TypeDecl_value = getParent().Define_boolean_reachableCatchClause(this, null, exceptionType);
if(isFinal && num == state().boundariesCrossed) reachableCatchClause_TypeDecl_values.put(_parameters, Boolean.valueOf(reachableCatchClause_TypeDecl_value));
return reachableCatchClause_TypeDecl_value;
}
/**
* @attribute inh
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:885
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl hostType() {
ASTNode$State state = state();
TypeDecl hostType_value = getParent().Define_TypeDecl_hostType(this, null);
return hostType_value;
}
/**
* @attribute inh
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:136
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection<TypeDecl> caughtExceptions() {
ASTNode$State state = state();
Collection<TypeDecl> caughtExceptions_value = getParent().Define_Collection_TypeDecl__caughtExceptions(this, null);
return caughtExceptions_value;
}
/**
* @attribute inh
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:195
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean reportUnreachable() {
ASTNode$State state = state();
boolean reportUnreachable_value = getParent().Define_boolean_reportUnreachable(this, null);
return reportUnreachable_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:78
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) {
if(caller == getBlockNoTransform()){
SimpleSet set = parameterDeclaration(name);
if(!set.isEmpty()) return set;
return lookupVariable(name);
}
else { return getParent().Define_SimpleSet_lookupVariable(this, caller, name);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:134
* @apilevel internal
*/
public CatchClause Define_CatchClause_catchClause(ASTNode caller, ASTNode child) {
{
int i = this.getIndexOfChild(caller);
return this;
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:196
* @apilevel internal
*/
public boolean Define_boolean_reportUnreachable(ASTNode caller, ASTNode child) {
if(caller == getBlockNoTransform()) {
return false;
}
else { return getParent().Define_boolean_reportUnreachable(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 10,556
| 31.990625
| 162
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CatchParameterDeclaration.java
|
/* 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;
/**
* A catch parameter with disjunct exception type.
* @production CatchParameterDeclaration : {@link ASTNode} ::= <span class="component">{@link Modifiers}</span> <span class="component">TypeAccess:{@link Access}*</span> <span class="component"><ID:String></span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.ast:19
*/
public class CatchParameterDeclaration extends ASTNode<ASTNode> implements Cloneable, Variable, SimpleSet, Iterator {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
sourceVariableDecl_computed = false;
sourceVariableDecl_value = null;
throwTypes_computed = false;
throwTypes_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public CatchParameterDeclaration clone() throws CloneNotSupportedException {
CatchParameterDeclaration node = (CatchParameterDeclaration)super.clone();
node.sourceVariableDecl_computed = false;
node.sourceVariableDecl_value = null;
node.throwTypes_computed = false;
node.throwTypes_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public CatchParameterDeclaration copy() {
try {
CatchParameterDeclaration node = (CatchParameterDeclaration) 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 CatchParameterDeclaration fullCopy() {
CatchParameterDeclaration tree = (CatchParameterDeclaration) 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 MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:63
*/
public SimpleSet add(Object o) {
return new SimpleSetImpl().add(this).add(o);
}
/**
* @ast method
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:67
*/
public boolean isSingleton() { return true; }
/**
* @ast method
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:68
*/
public boolean isSingleton(Object o) { return contains(o); }
/**
* @ast method
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:71
*/
private CatchParameterDeclaration iterElem;
/**
* @ast method
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:72
*/
public Iterator iterator() { iterElem = this; return this; }
/**
* @ast method
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:73
*/
public boolean hasNext() { return iterElem != null; }
/**
* @ast method
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:74
*/
public Object next() { Object o = iterElem; iterElem = null; return o; }
/**
* @ast method
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:75
*/
public void remove() { throw new UnsupportedOperationException(); }
/**
* Type checking.
* The types given in a disjunction type may not be
* subtypes of each other.
* @ast method
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:109
*/
public void typeCheck() {
boolean pass = true;
for (int i = 0; i < getNumTypeAccess(); ++i) {
for (int j = 0; j < getNumTypeAccess(); ++j) {
if (i == j) continue;
TypeDecl t1 = getTypeAccess(i).type();
TypeDecl t2 = getTypeAccess(j).type();
if (t2.instanceOf(t1)) {
error(t2.fullName() + " is a subclass of " +
t1.fullName());
pass = false;
}
}
}
}
/**
* Pretty printing of catch parameter declaration.
* @ast method
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:156
*/
public void toString(StringBuffer sb) {
getModifiers().toString(sb);
for (int i = 0; i < getNumTypeAccess(); ++i) {
if (i > 0) sb.append(" | ");
getTypeAccess(i).toString(sb);
}
sb.append(" "+getID());
}
/**
* Duplicate declaration checking for catch parameters.
* @ast method
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:186
*/
public void nameCheck() {
SimpleSet decls = outerScope().lookupVariable(name());
for(Iterator iter = decls.iterator(); iter.hasNext(); ) {
Variable var = (Variable)iter.next();
if (var instanceof VariableDeclaration) {
VariableDeclaration decl = (VariableDeclaration)var;
if (decl.enclosingBodyDecl() == enclosingBodyDecl())
error("duplicate declaration of "+
"catch parameter "+name());
} else if (var instanceof ParameterDeclaration) {
ParameterDeclaration decl = (ParameterDeclaration)var;
if (decl.enclosingBodyDecl() == enclosingBodyDecl())
error("duplicate declaration of "+
"catch parameter "+name());
} else if (var instanceof CatchParameterDeclaration) {
CatchParameterDeclaration decl = (CatchParameterDeclaration)var;
if (decl.enclosingBodyDecl() == enclosingBodyDecl())
error("duplicate declaration of "+
"catch parameter "+name());
}
}
// 8.4.1
if (!lookupVariable(name()).contains(this))
error("duplicate declaration of catch parameter " +
name());
}
/**
* @ast method
*
*/
public CatchParameterDeclaration() {
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 CatchParameterDeclaration(Modifiers p0, List<Access> p1, String p2) {
setChild(p0, 0);
setChild(p1, 1);
setID(p2);
}
/**
* @ast method
*
*/
public CatchParameterDeclaration(Modifiers p0, List<Access> p1, beaver.Symbol p2) {
setChild(p0, 0);
setChild(p1, 1);
setID(p2);
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Modifiers child.
* @apilevel low-level
* @ast method
*
*/
public Modifiers getModifiersNoTransform() {
return (Modifiers)getChildNoTransform(0);
}
/**
* Replaces the TypeAccess list.
* @param list The new list node to be used as the TypeAccess list.
* @apilevel high-level
* @ast method
*
*/
public void setTypeAccessList(List<Access> list) {
setChild(list, 1);
}
/**
* Retrieves the number of children in the TypeAccess list.
* @return Number of children in the TypeAccess list.
* @apilevel high-level
* @ast method
*
*/
public int getNumTypeAccess() {
return getTypeAccessList().getNumChild();
}
/**
* Retrieves the number of children in the TypeAccess list.
* Calling this method will not trigger rewrites..
* @return Number of children in the TypeAccess list.
* @apilevel low-level
* @ast method
*
*/
public int getNumTypeAccessNoTransform() {
return getTypeAccessListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the TypeAccess list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the TypeAccess list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getTypeAccess(int i) {
return (Access)getTypeAccessList().getChild(i);
}
/**
* Append an element to the TypeAccess list.
* @param node The element to append to the TypeAccess list.
* @apilevel high-level
* @ast method
*
*/
public void addTypeAccess(Access node) {
List<Access> list = (parent == null || state == null) ? getTypeAccessListNoTransform() : getTypeAccessList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addTypeAccessNoTransform(Access node) {
List<Access> list = getTypeAccessListNoTransform();
list.addChild(node);
}
/**
* Replaces the TypeAccess 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 setTypeAccess(Access node, int i) {
List<Access> list = getTypeAccessList();
list.setChild(node, i);
}
/**
* Retrieves the TypeAccess list.
* @return The node representing the TypeAccess list.
* @apilevel high-level
* @ast method
*
*/
public List<Access> getTypeAccesss() {
return getTypeAccessList();
}
/**
* Retrieves the TypeAccess list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeAccess list.
* @apilevel low-level
* @ast method
*
*/
public List<Access> getTypeAccesssNoTransform() {
return getTypeAccessListNoTransform();
}
/**
* Retrieves the TypeAccess list.
* @return The node representing the TypeAccess list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getTypeAccessList() {
List<Access> list = (List<Access>)getChild(1);
list.getNumChild();
return list;
}
/**
* Retrieves the TypeAccess list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeAccess list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getTypeAccessListNoTransform() {
return (List<Access>)getChildNoTransform(1);
}
/**
* 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;
}
/**
* @apilevel internal
* @ast method
*
*/
/**
* @apilevel internal
*/
protected String tokenString_ID;
/**
* @ast method
*
*/
public int IDstart;
/**
* @ast method
*
*/
public int IDend;
/**
* 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 : "";
}
/**
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:17
*/
public boolean isParameter() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:20
*/
public boolean isClassVariable() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:21
*/
public boolean isInstanceVariable() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:25
*/
public boolean isLocalVariable() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* The catch parameter of a multi-catch clause is implicitly final.
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:34
*/
public boolean isFinal() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:35
*/
public boolean isVolatile() {
ASTNode$State state = state();
try { return getModifiers().isVolatile(); }
finally {
}
}
/**
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:36
*/
public boolean isBlank() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:37
*/
public boolean isStatic() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:39
*/
public String name() {
ASTNode$State state = state();
try { return getID(); }
finally {
}
}
/**
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:41
*/
public boolean hasInit() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:42
*/
public Expr getInit() {
ASTNode$State state = state();
try {
throw new UnsupportedOperationException();
}
finally {
}
}
/**
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:45
*/
public Constant constant() {
ASTNode$State state = state();
try {
throw new UnsupportedOperationException();
}
finally {
}
}
/**
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:50
*/
public boolean isSynthetic() {
ASTNode$State state = state();
try { return getModifiers().isSynthetic(); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean sourceVariableDecl_computed = false;
/**
* @apilevel internal
*/
protected Variable sourceVariableDecl_value;
/**
* @see "Generics.jrag"
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:55
*/
@SuppressWarnings({"unchecked", "cast"})
public Variable sourceVariableDecl() {
if(sourceVariableDecl_computed) {
return sourceVariableDecl_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
sourceVariableDecl_value = sourceVariableDecl_compute();
if(isFinal && num == state().boundariesCrossed) sourceVariableDecl_computed = true;
return sourceVariableDecl_value;
}
/**
* @apilevel internal
*/
private Variable sourceVariableDecl_compute() { return this; }
/**
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:61
*/
public int size() {
ASTNode$State state = state();
try { return 1; }
finally {
}
}
/**
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:62
*/
public boolean isEmpty() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:66
*/
public boolean contains(Object o) {
ASTNode$State state = state();
try { return this == o; }
finally {
}
}
/**
* A catch parameter declared with a disjunction type has the
* effective type lub(t1, t2, ...)
*
* @see "JLSv3 §15.12.2.7"
* @attribute syn
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:173
*/
public TypeDecl type() {
ASTNode$State state = state();
try {
ArrayList<TypeDecl> list = new ArrayList<TypeDecl>();
for (int i = 0; i < getNumTypeAccess(); i++)
list.add(getTypeAccess(i).type());
return lookupLUBType(list).lub();
}
finally {
}
}
/**
* @apilevel internal
*/
protected boolean throwTypes_computed = false;
/**
* @apilevel internal
*/
protected Collection<TypeDecl> throwTypes_value;
/**
* @attribute syn
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:38
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection<TypeDecl> throwTypes() {
if(throwTypes_computed) {
return throwTypes_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
throwTypes_value = throwTypes_compute();
if(isFinal && num == state().boundariesCrossed) throwTypes_computed = true;
return throwTypes_value;
}
/**
* @apilevel internal
*/
private Collection<TypeDecl> throwTypes_compute() { return catchClause().caughtExceptions(); }
/**
* Inherit the lookupVariable attribute.
* @attribute inh
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:14
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet lookupVariable(String name) {
ASTNode$State state = state();
SimpleSet lookupVariable_String_value = getParent().Define_SimpleSet_lookupVariable(this, null, name);
return lookupVariable_String_value;
}
/**
* @attribute inh
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:22
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isMethodParameter() {
ASTNode$State state = state();
boolean isMethodParameter_value = getParent().Define_boolean_isMethodParameter(this, null);
return isMethodParameter_value;
}
/**
* @attribute inh
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:23
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isConstructorParameter() {
ASTNode$State state = state();
boolean isConstructorParameter_value = getParent().Define_boolean_isConstructorParameter(this, null);
return isConstructorParameter_value;
}
/**
* @attribute inh
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:24
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isExceptionHandlerParameter() {
ASTNode$State state = state();
boolean isExceptionHandlerParameter_value = getParent().Define_boolean_isExceptionHandlerParameter(this, null);
return isExceptionHandlerParameter_value;
}
/**
* @attribute inh
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:49
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl hostType() {
ASTNode$State state = state();
TypeDecl hostType_value = getParent().Define_TypeDecl_hostType(this, null);
return hostType_value;
}
/**
* @attribute inh
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:165
*/
@SuppressWarnings({"unchecked", "cast"})
public LUBType lookupLUBType(Collection bounds) {
ASTNode$State state = state();
LUBType lookupLUBType_Collection_value = getParent().Define_LUBType_lookupLUBType(this, null, bounds);
return lookupLUBType_Collection_value;
}
/**
* @attribute inh
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:180
*/
@SuppressWarnings({"unchecked", "cast"})
public VariableScope outerScope() {
ASTNode$State state = state();
VariableScope outerScope_value = getParent().Define_VariableScope_outerScope(this, null);
return outerScope_value;
}
/**
* @attribute inh
* @aspect MultiCatch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:181
*/
@SuppressWarnings({"unchecked", "cast"})
public BodyDecl enclosingBodyDecl() {
ASTNode$State state = state();
BodyDecl enclosingBodyDecl_value = getParent().Define_BodyDecl_enclosingBodyDecl(this, null);
return enclosingBodyDecl_value;
}
/**
* @attribute inh
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:128
*/
@SuppressWarnings({"unchecked", "cast"})
public CatchClause catchClause() {
ASTNode$State state = state();
CatchClause catchClause_value = getParent().Define_CatchClause_catchClause(this, null);
return catchClause_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/MultiCatch.jrag:92
* @apilevel internal
*/
public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {
if(caller == getTypeAccessListNoTransform()) {
int i = caller.getIndexOfChild(child);
return NameType.TYPE_NAME;
}
else { return getParent().Define_NameType_nameType(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 24,837
| 28.016355
| 219
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CharType.java
|
/* 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 CharType : {@link IntegralType};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:60
*/
public class CharType extends IntegralType implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
narrowingConversionTo_TypeDecl_values = null;
unaryNumericPromotion_computed = false;
unaryNumericPromotion_value = null;
boxed_computed = false;
boxed_value = null;
jvmName_computed = false;
jvmName_value = null;
getSootType_computed = false;
getSootType_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public CharType clone() throws CloneNotSupportedException {
CharType node = (CharType)super.clone();
node.narrowingConversionTo_TypeDecl_values = null;
node.unaryNumericPromotion_computed = false;
node.unaryNumericPromotion_value = null;
node.boxed_computed = false;
node.boxed_value = null;
node.jvmName_computed = false;
node.jvmName_value = null;
node.getSootType_computed = false;
node.getSootType_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public CharType copy() {
try {
CharType node = (CharType) 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 CharType fullCopy() {
CharType tree = (CharType) 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:847
*/
public void toString(StringBuffer s) {
s.append("char");
}
/**
* @ast method
*
*/
public CharType() {
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[3];
setChild(new Opt(), 1);
setChild(new List(), 2);
}
/**
* @ast method
*
*/
public CharType(Modifiers p0, String p1, Opt<Access> p2, List<BodyDecl> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @ast method
*
*/
public CharType(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<BodyDecl> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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 optional node for the SuperClassAccess child. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* @param opt The new node to be used as the optional node for the SuperClassAccess child.
* @apilevel low-level
* @ast method
*
*/
public void setSuperClassAccessOpt(Opt<Access> opt) {
setChild(opt, 1);
}
/**
* Check whether the optional SuperClassAccess child exists.
* @return {@code true} if the optional SuperClassAccess child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasSuperClassAccess() {
return getSuperClassAccessOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) SuperClassAccess child.
* @return The SuperClassAccess child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getSuperClassAccess() {
return (Access)getSuperClassAccessOpt().getChild(0);
}
/**
* Replaces the (optional) SuperClassAccess child.
* @param node The new node to be used as the SuperClassAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setSuperClassAccess(Access node) {
getSuperClassAccessOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOpt() {
return (Opt<Access>)getChild(1);
}
/**
* Retrieves the optional node for child SuperClassAccess. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child SuperClassAccess.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOptNoTransform() {
return (Opt<Access>)getChildNoTransform(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<BodyDecl> 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<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addBodyDeclNoTransform(BodyDecl node) {
List<BodyDecl> 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<BodyDecl> list = getBodyDeclList();
list.setChild(node, i);
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<BodyDecl> getBodyDecls() {
return getBodyDeclList();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclsNoTransform() {
return getBodyDeclListNoTransform();
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclList() {
List<BodyDecl> list = (List<BodyDecl>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclListNoTransform() {
return (List<BodyDecl>)getChildNoTransform(2);
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:160
*/
public Constant cast(Constant c) {
ASTNode$State state = state();
try { return Constant.create((char)c.intValue()); }
finally {
}
}
protected java.util.Map narrowingConversionTo_TypeDecl_values;
/**
* @attribute syn
* @aspect TypeConversion
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:29
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean narrowingConversionTo(TypeDecl type) {
Object _parameters = type;
if(narrowingConversionTo_TypeDecl_values == null) narrowingConversionTo_TypeDecl_values = new java.util.HashMap(4);
if(narrowingConversionTo_TypeDecl_values.containsKey(_parameters)) {
return ((Boolean)narrowingConversionTo_TypeDecl_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean narrowingConversionTo_TypeDecl_value = narrowingConversionTo_compute(type);
if(isFinal && num == state().boundariesCrossed) narrowingConversionTo_TypeDecl_values.put(_parameters, Boolean.valueOf(narrowingConversionTo_TypeDecl_value));
return narrowingConversionTo_TypeDecl_value;
}
/**
* @apilevel internal
*/
private boolean narrowingConversionTo_compute(TypeDecl type) { return type.isByte() || type.isShort(); }
/**
* @apilevel internal
*/
protected boolean unaryNumericPromotion_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl unaryNumericPromotion_value;
/**
* @attribute syn
* @aspect NumericPromotion
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:151
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl unaryNumericPromotion() {
if(unaryNumericPromotion_computed) {
return unaryNumericPromotion_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
unaryNumericPromotion_value = unaryNumericPromotion_compute();
if(isFinal && num == state().boundariesCrossed) unaryNumericPromotion_computed = true;
return unaryNumericPromotion_value;
}
/**
* @apilevel internal
*/
private TypeDecl unaryNumericPromotion_compute() { return typeInt(); }
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:187
*/
public boolean isChar() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean boxed_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl boxed_value;
/**
* @attribute syn
* @aspect AutoBoxing
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:38
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl boxed() {
if(boxed_computed) {
return boxed_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boxed_value = boxed_compute();
if(isFinal && num == state().boundariesCrossed) boxed_computed = true;
return boxed_value;
}
/**
* @apilevel internal
*/
private TypeDecl boxed_compute() { return lookupType("java.lang", "Character"); }
/**
* @apilevel internal
*/
protected boolean jvmName_computed = false;
/**
* @apilevel internal
*/
protected String jvmName_value;
/**
* @attribute syn
* @aspect Java2Rewrites
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Java2Rewrites.jrag:36
*/
@SuppressWarnings({"unchecked", "cast"})
public String jvmName() {
if(jvmName_computed) {
return jvmName_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
jvmName_value = jvmName_compute();
if(isFinal && num == state().boundariesCrossed) jvmName_computed = true;
return jvmName_value;
}
/**
* @apilevel internal
*/
private String jvmName_compute() { return "C"; }
/**
* @attribute syn
* @aspect Java2Rewrites
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Java2Rewrites.jrag:44
*/
public String primitiveClassName() {
ASTNode$State state = state();
try { return "Character"; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean getSootType_computed = false;
/**
* @apilevel internal
*/
protected Type getSootType_value;
/**
* @attribute syn
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:52
*/
@SuppressWarnings({"unchecked", "cast"})
public Type getSootType() {
if(getSootType_computed) {
return getSootType_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
getSootType_value = getSootType_compute();
if(isFinal && num == state().boundariesCrossed) getSootType_computed = true;
return getSootType_value;
}
/**
* @apilevel internal
*/
private Type getSootType_compute() { return soot.CharType.v(); }
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 16,922
| 27.394295
| 164
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CharacterLiteral.java
|
/* 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;
/**
* Represents a single character.
* May not contain a Unicode escape sequence (Unicode escapes
* are transcoded by the scanner).
* @production CharacterLiteral : {@link Literal};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Literals.ast:30
*/
public class CharacterLiteral extends Literal implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
constant_computed = false;
constant_value = null;
type_computed = false;
type_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public CharacterLiteral clone() throws CloneNotSupportedException {
CharacterLiteral node = (CharacterLiteral)super.clone();
node.constant_computed = false;
node.constant_value = null;
node.type_computed = false;
node.type_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public CharacterLiteral copy() {
try {
CharacterLiteral node = (CharacterLiteral) 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 CharacterLiteral fullCopy() {
CharacterLiteral tree = (CharacterLiteral) 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:271
*/
public void toString(StringBuffer s) {
s.append("'" + escape(getLITERAL()) + "'");
}
/**
* @ast method
* @aspect Expressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:20
*/
public soot.Value eval(Body b) {
return IntType.emitConstant(constant().intValue());
}
/**
* @ast method
*
*/
public CharacterLiteral() {
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() {
}
/**
* @ast method
*
*/
public CharacterLiteral(String p0) {
setLITERAL(p0);
}
/**
* @ast method
*
*/
public CharacterLiteral(beaver.Symbol p0) {
setLITERAL(p0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the lexeme LITERAL.
* @param value The new value for the lexeme LITERAL.
* @apilevel high-level
* @ast method
*
*/
public void setLITERAL(String value) {
tokenString_LITERAL = value;
}
/**
* JastAdd-internal setter for lexeme LITERAL using the Beaver parser.
* @apilevel internal
* @ast method
*
*/
public void setLITERAL(beaver.Symbol symbol) {
if(symbol.value != null && !(symbol.value instanceof String))
throw new UnsupportedOperationException("setLITERAL is only valid for String lexemes");
tokenString_LITERAL = (String)symbol.value;
LITERALstart = symbol.getStart();
LITERALend = symbol.getEnd();
}
/**
* Retrieves the value for the lexeme LITERAL.
* @return The value for the lexeme LITERAL.
* @apilevel high-level
* @ast method
*
*/
public String getLITERAL() {
return tokenString_LITERAL != null ? tokenString_LITERAL : "";
}
/**
* @apilevel internal
*/
protected boolean constant_computed = false;
/**
* @apilevel internal
*/
protected Constant constant_value;
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:157
*/
@SuppressWarnings({"unchecked", "cast"})
public Constant constant() {
if(constant_computed) {
return constant_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
constant_value = constant_compute();
if(isFinal && num == state().boundariesCrossed) constant_computed = true;
return constant_value;
}
/**
* @apilevel internal
*/
private Constant constant_compute() { return Constant.create(getLITERAL().charAt(0)); }
/**
* @apilevel internal
*/
protected boolean type_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl type_value;
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:305
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl type() {
if(type_computed) {
return type_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
type_value = type_compute();
if(isFinal && num == state().boundariesCrossed) type_computed = true;
return type_value;
}
/**
* @apilevel internal
*/
private TypeDecl type_compute() { return typeChar(); }
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 6,657
| 24.706564
| 112
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ClassAccess.java
|
/* 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 ClassAccess : {@link Access};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:39
*/
public class ClassAccess extends Access implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
type_computed = false;
type_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ClassAccess clone() throws CloneNotSupportedException {
ClassAccess node = (ClassAccess)super.clone();
node.type_computed = false;
node.type_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ClassAccess copy() {
try {
ClassAccess node = (ClassAccess) 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 ClassAccess fullCopy() {
ClassAccess tree = (ClassAccess) 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 NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:177
*/
public void nameCheck() {
if(isQualified() && !qualifier().isTypeAccess())
error("class literal may only contain type names");
}
/**
* @ast method
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:520
*/
public void toString(StringBuffer s) {
s.append("class");
}
/**
* @ast method
* @aspect Transformations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Transformations.jrag:160
*/
public void transformation() {
super.transformation();
// touch static class method before any accessors to make it first in method
if(isQualified() && qualifier().type().isReferenceType()) {
hostType().topLevelType().createStaticClassMethod();
FieldDeclaration f = hostType().topLevelType().createStaticClassField(prevExpr().type().referenceClassFieldName());
}
}
/**
* @ast method
* @aspect Expressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:911
*/
public soot.Value eval(Body b) {
if(prevExpr().type().isPrimitiveType() || prevExpr().type().isVoid()) {
TypeDecl typeDecl = lookupType("java.lang", prevExpr().type().primitiveClassName());
SimpleSet c = typeDecl.memberFields("TYPE");
FieldDeclaration f = (FieldDeclaration)c.iterator().next();
return b.newStaticFieldRef(f.sootRef(), this);
}
else {
FieldDeclaration f = hostType().topLevelType().createStaticClassField(prevExpr().type().referenceClassFieldName());
// add method to perform lookup as a side-effect
MethodDecl m = hostType().topLevelType().createStaticClassMethod();
soot.jimple.Stmt next_label = b.newLabel();
soot.jimple.Stmt end_label = b.newLabel();
Local result = b.newTemp(type().getSootType());
Local ref = asLocal(b, b.newStaticFieldRef(f.sootRef(), this));
b.setLine(this);
b.add(
b.newIfStmt(
b.newNeExpr(ref, soot.jimple.NullConstant.v(), this),
next_label,
this
)
);
// emit string literal
ArrayList list = new ArrayList();
list.add(new StringLiteral(prevExpr().type().jvmName()).eval(b));
Local l = asLocal(b, b.newStaticInvokeExpr(m.sootRef(), list, this));
b.setLine(this);
b.add(b.newAssignStmt(
b.newStaticFieldRef(f.sootRef(), this),
l,
this
));
b.setLine(this);
b.add(b.newAssignStmt(result, l, this));
b.add(b.newGotoStmt(end_label, this));
b.addLabel(next_label);
b.add(b.newAssignStmt(
result,
b.newStaticFieldRef(f.sootRef(), this),
this
));
b.addLabel(end_label);
return result;
}
}
/**
* @ast method
*
*/
public ClassAccess() {
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() {
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* @ast method
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:401
*/
private TypeDecl refined_TypeAnalysis_ClassAccess_type()
{ return lookupType("java.lang", "Class"); }
/**
* @attribute syn
* @aspect AccessTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:45
*/
public boolean isClassAccess() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @attribute syn
* @aspect SyntacticClassification
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:56
*/
public NameType predNameType() {
ASTNode$State state = state();
try { return NameType.TYPE_NAME; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean type_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl type_value;
/**
* @attribute syn
* @aspect Generics
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:119
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl type() {
if(type_computed) {
return type_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
type_value = type_compute();
if(isFinal && num == state().boundariesCrossed) type_computed = true;
return type_value;
}
/**
* @apilevel internal
*/
private TypeDecl type_compute() {
GenericClassDecl d = (GenericClassDecl)refined_TypeAnalysis_ClassAccess_type();
TypeDecl type = qualifier().type();
if(type.isPrimitiveType())
type = type.boxed();
ArrayList list = new ArrayList();
list.add(type);
return d.lookupParTypeDecl(list);
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 7,927
| 27.213523
| 121
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ClassDecl.java
|
/* 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 ClassDecl : {@link ReferenceType} ::= <span class="component">{@link Modifiers}</span> <span class="component"><ID:String></span> <span class="component">[SuperClassAccess:{@link Access}]</span> <span class="component">Implements:{@link Access}*</span> <span class="component">{@link BodyDecl}*</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:66
*/
public class ClassDecl extends ReferenceType implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
interfacesMethodsSignatureMap_computed = false;
interfacesMethodsSignatureMap_value = null;
methodsSignatureMap_computed = false;
methodsSignatureMap_value = null;
ancestorMethods_String_values = null;
memberTypes_String_values = null;
memberFieldsMap_computed = false;
memberFieldsMap_value = null;
memberFields_String_values = null;
unimplementedMethods_computed = false;
unimplementedMethods_value = null;
hasAbstract_computed = false;
castingConversionTo_TypeDecl_values = null;
isString_computed = false;
isObject_computed = false;
instanceOf_TypeDecl_values = null;
isCircular_visited = -1;
isCircular_computed = false;
isCircular_initialized = false;
implementedInterfaces_computed = false;
implementedInterfaces_value = null;
subtype_TypeDecl_values = null;
sootClass_computed = false;
sootClass_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ClassDecl clone() throws CloneNotSupportedException {
ClassDecl node = (ClassDecl)super.clone();
node.interfacesMethodsSignatureMap_computed = false;
node.interfacesMethodsSignatureMap_value = null;
node.methodsSignatureMap_computed = false;
node.methodsSignatureMap_value = null;
node.ancestorMethods_String_values = null;
node.memberTypes_String_values = null;
node.memberFieldsMap_computed = false;
node.memberFieldsMap_value = null;
node.memberFields_String_values = null;
node.unimplementedMethods_computed = false;
node.unimplementedMethods_value = null;
node.hasAbstract_computed = false;
node.castingConversionTo_TypeDecl_values = null;
node.isString_computed = false;
node.isObject_computed = false;
node.instanceOf_TypeDecl_values = null;
node.isCircular_visited = -1;
node.isCircular_computed = false;
node.isCircular_initialized = false;
node.implementedInterfaces_computed = false;
node.implementedInterfaces_value = null;
node.subtype_TypeDecl_values = null;
node.sootClass_computed = false;
node.sootClass_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ClassDecl copy() {
try {
ClassDecl node = (ClassDecl) 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 ClassDecl fullCopy() {
ClassDecl tree = (ClassDecl) 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 AccessControl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AccessControl.jrag:147
*/
public void accessControl() {
super.accessControl();
// 8.1.1.2 final Classes
TypeDecl typeDecl = hasSuperclass() ? superclass() : null;
if(typeDecl != null && !typeDecl.accessibleFromExtend(this))
//if(typeDecl != null && !isCircular() && !typeDecl.accessibleFrom(this))
error("class " + fullName() + " may not extend non accessible type " + typeDecl.fullName());
if(hasSuperclass() && !superclass().accessibleFrom(this))
error("a superclass must be accessible which " + superclass().name() + " is not");
// 8.1.4
for(int i = 0; i < getNumImplements(); i++) {
TypeDecl decl = getImplements(i).type();
if(!decl.isCircular() && !decl.accessibleFrom(this))
error("class " + fullName() + " can not implement non accessible type " + decl.fullName());
}
}
/**
* @ast method
* @aspect ExceptionHandling
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:106
*/
public void exceptionHandling() {
constructors();
super.exceptionHandling();
}
/**
* @ast method
* @aspect MemberMethods
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupMethod.jrag:265
*/
public Iterator interfacesMethodsIterator() {
return new Iterator() {
private Iterator outer = interfacesMethodsSignatureMap().values().iterator();
private Iterator inner = null;
public boolean hasNext() {
if((inner == null || !inner.hasNext()) && outer.hasNext())
inner = ((SimpleSet)outer.next()).iterator();
return inner == null ? false : inner.hasNext();
}
public Object next() {
return inner.next();
}
public void remove() { throw new UnsupportedOperationException(); }
};
}
/**
* @ast method
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:96
*/
public void checkModifiers() {
super.checkModifiers();
// 8.1.1.2 final Classes
TypeDecl typeDecl = hasSuperclass() ? superclass() : null;
if(typeDecl != null && typeDecl.isFinal()) {
error("class " + fullName() + " may not extend final class " + typeDecl.fullName());
}
}
/**
* @ast method
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:70
*/
public void toString(StringBuffer s) {
s.append(indent());
getModifiers().toString(s);
s.append("class " + name());
if(hasSuperClassAccess()) {
s.append(" extends ");
getSuperClassAccess().toString(s);
}
if(getNumImplements() > 0) {
s.append(" implements ");
getImplements(0).toString(s);
for(int i = 1; i < getNumImplements(); i++) {
s.append(", ");
getImplements(i).toString(s);
}
}
ppBodyDecls(s);
}
/**
* @ast method
* @aspect SuperClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:596
*/
public boolean hasSuperclass() {
return !isObject();
}
/**
* @ast method
* @aspect SuperClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:600
*/
public ClassDecl superclass() {
if(isObject())
return null;
if(hasSuperClassAccess() && !isCircular() && getSuperClassAccess().type().isClassDecl())
return (ClassDecl)getSuperClassAccess().type();
return (ClassDecl)typeObject();
}
/**
* @ast method
* @aspect SuperClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:615
*/
public Iterator interfacesIterator() {
return new Iterator() {
public boolean hasNext() {
computeNextCurrent();
return current != null;
}
public Object next() {
return current;
}
public void remove() {
throw new UnsupportedOperationException();
}
private int index = 0;
private TypeDecl current = null;
private void computeNextCurrent() {
current = null;
if(isObject() || isCircular())
return;
while(index < getNumImplements()) {
TypeDecl typeDecl = getImplements(index++).type();
if(!typeDecl.isCircular() && typeDecl.isInterfaceDecl()) {
current = typeDecl;
return;
}
}
}
};
}
/**
* @ast method
* @aspect TypeHierarchyCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:239
*/
public void nameCheck() {
super.nameCheck();
if(hasSuperClassAccess() && !getSuperClassAccess().type().isClassDecl())
error("class may only inherit a class and not " + getSuperClassAccess().type().typeName());
if(isObject() && hasSuperClassAccess())
error("class Object may not have superclass");
if(isObject() && getNumImplements() != 0)
error("class Object may not implement interfaces");
// 8.1.3
if(isCircular())
error("circular inheritance dependency in " + typeName());
// 8.1.4
HashSet set = new HashSet();
for(int i = 0; i < getNumImplements(); i++) {
TypeDecl decl = getImplements(i).type();
if(!decl.isInterfaceDecl() && !decl.isUnknown())
error("type " + fullName() + " tries to implement non interface type " + decl.fullName());
if(set.contains(decl))
error("type " + decl.fullName() + " mentionened multiple times in implements clause");
set.add(decl);
}
for(Iterator iter = interfacesMethodsIterator(); iter.hasNext(); ) {
MethodDecl m = (MethodDecl)iter.next();
if(localMethodsSignature(m.signature()).isEmpty()) {
SimpleSet s = superclass().methodsSignature(m.signature());
for(Iterator i2 = s.iterator(); i2.hasNext(); ) {
MethodDecl n = (MethodDecl)i2.next();
if(n.accessibleFrom(this)) {
interfaceMethodCompatibleWithInherited(m, n);
}
}
if(s.isEmpty()) {
for(Iterator i2 = interfacesMethodsSignature(m.signature()).iterator(); i2.hasNext(); ) {
MethodDecl n = (MethodDecl)i2.next();
if(!n.mayOverrideReturn(m) && !m.mayOverrideReturn(n))
error("Xthe return type of method " + m.signature() + " in " + m.hostType().typeName() +
" does not match the return type of method " + n.signature() + " in " +
n.hostType().typeName() + " and may thus not be overriden");
}
}
}
}
}
/**
* @ast method
* @aspect TypeHierarchyCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:286
*/
private void interfaceMethodCompatibleWithInherited(MethodDecl m, MethodDecl n) {
if(n.isStatic())
error("Xa static method may not hide an instance method");
if(!n.isAbstract() && !n.isPublic())
error("Xoverriding access modifier error for " + m.signature() + " in " + m.hostType().typeName() + " and " + n.hostType().typeName());
if(!n.mayOverrideReturn(m) && !m.mayOverrideReturn(m))
error("Xthe return type of method " + m.signature() + " in " + m.hostType().typeName() +
" does not match the return type of method " + n.signature() + " in " +
n.hostType().typeName() + " and may thus not be overriden");
if(!n.isAbstract()) {
// n implements and overrides method m in the interface
// may not throw more checked exceptions
for(int i = 0; i < n.getNumException(); i++) {
Access e = n.getException(i);
boolean found = false;
for(int j = 0; !found && j < m.getNumException(); j++) {
if(e.type().instanceOf(m.getException(j).type()))
found = true;
}
if(!found && e.type().isUncheckedException())
error("X" + n.signature() + " in " + n.hostType().typeName() + " may not throw more checked exceptions than overridden method " +
m.signature() + " in " + m.hostType().typeName());
}
}
}
/**
* @ast method
* @aspect Generics
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:187
*/
public TypeDecl makeGeneric(Signatures.ClassSignature s) {
if(s.hasFormalTypeParameters()) {
ASTNode node = getParent();
int index = node.getIndexOfChild(this);
node.setChild(
new GenericClassDecl(
getModifiersNoTransform(),
getID(),
s.hasSuperclassSignature() ? new Opt(s.superclassSignature()) : getSuperClassAccessOptNoTransform(),
s.hasSuperinterfaceSignature() ? s.superinterfaceSignature() : getImplementsListNoTransform(),
getBodyDeclListNoTransform(),
s.typeParameters()
),
index
);
return (TypeDecl)node.getChildNoTransform(index);
}
else {
if(s.hasSuperclassSignature())
setSuperClassAccessOpt(new Opt(s.superclassSignature()));
if(s.hasSuperinterfaceSignature())
setImplementsList(s.superinterfaceSignature());
return this;
}
}
/**
* @ast method
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1313
*/
public ClassDecl substitutedClassDecl(Parameterization parTypeDecl) {
ClassDecl c = new ClassDeclSubstituted(
(Modifiers)getModifiers().fullCopy(),
getID(),
hasSuperClassAccess() ? new Opt(getSuperClassAccess().type().substitute(parTypeDecl)) : new Opt(),
getImplementsList().substitute(parTypeDecl),
// ES: new List(),
this
);
return c;
}
/**
* @ast method
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:163
*/
public void jimplify1phase2() {
SootClass sc = getSootClassDecl();
sc.setResolvingLevel(SootClass.DANGLING);
sc.setModifiers(sootTypeModifiers());
sc.setApplicationClass();
SourceFileTag st = new soot.tagkit.SourceFileTag(sourceNameWithoutPath());
st.setAbsolutePath(compilationUnit().pathName());
sc.addTag(st);
if(hasSuperclass()) {
sc.setSuperclass(superclass().getSootClassDecl());
}
for(Iterator iter = interfacesIterator(); iter.hasNext(); ) {
TypeDecl typeDecl = (TypeDecl)iter.next();
if(!sc.implementsInterface(typeDecl.getSootClassDecl().getName()))
sc.addInterface(typeDecl.getSootClassDecl());
}
if(isNestedType())
sc.setOuterClass(enclosingType().getSootClassDecl());
sc.setResolvingLevel(SootClass.HIERARCHY);
super.jimplify1phase2();
sc.setResolvingLevel(SootClass.SIGNATURES);
}
/**
* @ast method
*
*/
public ClassDecl() {
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 Opt(), 1);
setChild(new List(), 2);
setChild(new List(), 3);
}
/**
* @ast method
*
*/
public ClassDecl(Modifiers p0, String p1, Opt<Access> p2, List<Access> p3, List<BodyDecl> p4) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setChild(p4, 3);
}
/**
* @ast method
*
*/
public ClassDecl(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<Access> p3, List<BodyDecl> p4) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setChild(p4, 3);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 4;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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 optional node for the SuperClassAccess child. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* @param opt The new node to be used as the optional node for the SuperClassAccess child.
* @apilevel low-level
* @ast method
*
*/
public void setSuperClassAccessOpt(Opt<Access> opt) {
setChild(opt, 1);
}
/**
* Check whether the optional SuperClassAccess child exists.
* @return {@code true} if the optional SuperClassAccess child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasSuperClassAccess() {
return getSuperClassAccessOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) SuperClassAccess child.
* @return The SuperClassAccess child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getSuperClassAccess() {
return (Access)getSuperClassAccessOpt().getChild(0);
}
/**
* Replaces the (optional) SuperClassAccess child.
* @param node The new node to be used as the SuperClassAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setSuperClassAccess(Access node) {
getSuperClassAccessOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOpt() {
return (Opt<Access>)getChild(1);
}
/**
* Retrieves the optional node for child SuperClassAccess. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child SuperClassAccess.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOptNoTransform() {
return (Opt<Access>)getChildNoTransform(1);
}
/**
* Replaces the Implements list.
* @param list The new list node to be used as the Implements list.
* @apilevel high-level
* @ast method
*
*/
public void setImplementsList(List<Access> list) {
setChild(list, 2);
}
/**
* Retrieves the number of children in the Implements list.
* @return Number of children in the Implements list.
* @apilevel high-level
* @ast method
*
*/
public int getNumImplements() {
return getImplementsList().getNumChild();
}
/**
* Retrieves the number of children in the Implements list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Implements list.
* @apilevel low-level
* @ast method
*
*/
public int getNumImplementsNoTransform() {
return getImplementsListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Implements list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Implements list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getImplements(int i) {
return (Access)getImplementsList().getChild(i);
}
/**
* Append an element to the Implements list.
* @param node The element to append to the Implements list.
* @apilevel high-level
* @ast method
*
*/
public void addImplements(Access node) {
List<Access> list = (parent == null || state == null) ? getImplementsListNoTransform() : getImplementsList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addImplementsNoTransform(Access node) {
List<Access> list = getImplementsListNoTransform();
list.addChild(node);
}
/**
* Replaces the Implements 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 setImplements(Access node, int i) {
List<Access> list = getImplementsList();
list.setChild(node, i);
}
/**
* Retrieves the Implements list.
* @return The node representing the Implements list.
* @apilevel high-level
* @ast method
*
*/
public List<Access> getImplementss() {
return getImplementsList();
}
/**
* Retrieves the Implements list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Implements list.
* @apilevel low-level
* @ast method
*
*/
public List<Access> getImplementssNoTransform() {
return getImplementsListNoTransform();
}
/**
* Retrieves the Implements list.
* @return The node representing the Implements list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getImplementsList() {
List<Access> list = (List<Access>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the Implements list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Implements list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getImplementsListNoTransform() {
return (List<Access>)getChildNoTransform(2);
}
/**
* 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<BodyDecl> list) {
setChild(list, 3);
}
/**
* 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<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addBodyDeclNoTransform(BodyDecl node) {
List<BodyDecl> 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<BodyDecl> list = getBodyDeclList();
list.setChild(node, i);
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<BodyDecl> getBodyDecls() {
return getBodyDeclList();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclsNoTransform() {
return getBodyDeclListNoTransform();
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclList() {
List<BodyDecl> list = (List<BodyDecl>)getChild(3);
list.getNumChild();
return list;
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclListNoTransform() {
return (List<BodyDecl>)getChildNoTransform(3);
}
/**
* @ast method
* @aspect TypeConversion
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:84
*/
private boolean refined_TypeConversion_ClassDecl_castingConversionTo_TypeDecl(TypeDecl type)
{
if(type.isArrayDecl()) {
return isObject();
}
else if(type.isClassDecl()) {
return this == type || instanceOf(type) || type.instanceOf(this);
}
else if(type.isInterfaceDecl()) {
return !isFinal() || instanceOf(type);
}
else return super.castingConversionTo(type);
}
/**
* @ast method
* @aspect Generics
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:57
*/
private boolean refined_Generics_ClassDecl_castingConversionTo_TypeDecl(TypeDecl type)
{
TypeDecl S = this;
TypeDecl T = type;
if(T instanceof TypeVariable) {
TypeVariable t = (TypeVariable)T;
if(t.getNumTypeBound() == 0) return true;
for(int i = 0; i < t.getNumTypeBound(); i++)
if(castingConversionTo(t.getTypeBound(i).type()))
return true;
return false;
}
if(T.isClassDecl() && (S.erasure() != S || T.erasure() != T))
return S.erasure().castingConversionTo(T.erasure());
return refined_TypeConversion_ClassDecl_castingConversionTo_TypeDecl(type);
}
/**
* @ast method
* @aspect EmitJimpleRefinements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/SootJastAddJ/EmitJimpleRefinements.jrag:24
*/
private SootClass refined_EmitJimpleRefinements_ClassDecl_sootClass()
{
boolean needAddclass = false;
SootClass sc = null;
if(Scene.v().containsClass(jvmName())) {
SootClass cl = Scene.v().getSootClass(jvmName());
//fix for test case 653: if there's a class java.lang.Object etc. on the command line
//prefer that class over the Coffi class that may already have been loaded from bytecode
try {
MethodSource source = cl.getMethodByName("<clinit>").getSource();
if(source instanceof CoffiMethodSource) {
Scene.v().removeClass(cl);
needAddclass = true;
}
} catch(RuntimeException e) {
//method not found
}
sc = cl;
}
else {
needAddclass = true;
}
if(needAddclass) {
if(options().verbose())
System.out.println("Creating from source " + jvmName());
sc = new SootClass(jvmName());
sc.setResolvingLevel(SootClass.DANGLING);
Scene.v().addClass(sc);
}
return sc;
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:160
*/
public Constant cast(Constant c) {
ASTNode$State state = state();
try { return Constant.create(c.stringValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:226
*/
public Constant add(Constant c1, Constant c2) {
ASTNode$State state = state();
try { return Constant.create(c1.stringValue() + c2.stringValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:290
*/
public Constant questionColon(Constant cond, Constant c1, Constant c2) {
ASTNode$State state = state();
try { return Constant.create(cond.booleanValue() ? c1.stringValue() : c2.stringValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:394
*/
public boolean eqIsTrue(Expr left, Expr right) {
ASTNode$State state = state();
try { return isString() && left.constant().stringValue().equals(right.constant().stringValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ErrorCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:22
*/
public int lineNumber() {
ASTNode$State state = state();
try { return getLine(IDstart); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstructScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:21
*/
public Collection lookupSuperConstructor() {
ASTNode$State state = state();
try { return hasSuperclass() ? superclass().constructors() : Collections.EMPTY_LIST; }
finally {
}
}
/**
* @attribute syn
* @aspect ImplicitConstructor
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:207
*/
public boolean noConstructor() {
ASTNode$State state = state();
try {
if(!compilationUnit().fromSource())
return false;
for(int i = 0; i < getNumBodyDecl(); i++)
if(getBodyDecl(i) instanceof ConstructorDecl)
return false;
return true;
}
finally {
}
}
/**
* @attribute syn
* @aspect MemberMethods
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupMethod.jrag:280
*/
public SimpleSet interfacesMethodsSignature(String signature) {
ASTNode$State state = state();
try {
SimpleSet set = (SimpleSet)interfacesMethodsSignatureMap().get(signature);
if(set != null) return set;
return SimpleSet.emptySet;
}
finally {
}
}
/**
* @apilevel internal
*/
protected boolean interfacesMethodsSignatureMap_computed = false;
/**
* @apilevel internal
*/
protected HashMap interfacesMethodsSignatureMap_value;
/**
* @attribute syn
* @aspect MemberMethods
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupMethod.jrag:286
*/
@SuppressWarnings({"unchecked", "cast"})
public HashMap interfacesMethodsSignatureMap() {
if(interfacesMethodsSignatureMap_computed) {
return interfacesMethodsSignatureMap_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
interfacesMethodsSignatureMap_value = interfacesMethodsSignatureMap_compute();
if(isFinal && num == state().boundariesCrossed) interfacesMethodsSignatureMap_computed = true;
return interfacesMethodsSignatureMap_value;
}
/**
* @apilevel internal
*/
private HashMap interfacesMethodsSignatureMap_compute() {
HashMap map = new HashMap();
for(Iterator iter = interfacesIterator(); iter.hasNext(); ) {
TypeDecl typeDecl = (InterfaceDecl)iter.next();
for(Iterator i2 = typeDecl.methodsIterator(); i2.hasNext(); ) {
MethodDecl m = (MethodDecl)i2.next();
putSimpleSetElement(map, m.signature(), m);
}
}
return map;
}
/**
* @apilevel internal
*/
protected boolean methodsSignatureMap_computed = false;
/**
* @apilevel internal
*/
protected HashMap methodsSignatureMap_value;
/**
* @attribute syn
* @aspect MethodSignature15
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/MethodSignature.jrag:359
*/
@SuppressWarnings({"unchecked", "cast"})
public HashMap methodsSignatureMap() {
if(methodsSignatureMap_computed) {
return methodsSignatureMap_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
methodsSignatureMap_value = methodsSignatureMap_compute();
if(isFinal && num == state().boundariesCrossed) methodsSignatureMap_computed = true;
return methodsSignatureMap_value;
}
/**
* @apilevel internal
*/
private HashMap methodsSignatureMap_compute() {
HashMap map = new HashMap(localMethodsSignatureMap());
if(hasSuperclass()) {
for(Iterator iter = superclass().methodsIterator(); iter.hasNext(); ) {
MethodDecl m = (MethodDecl)iter.next();
if(!m.isPrivate() && m.accessibleFrom(this) && !localMethodsSignatureMap().containsKey(m.signature())) {
if(!(m instanceof MethodDeclSubstituted) || !localMethodsSignatureMap().containsKey(m.sourceMethodDecl().signature()))
putSimpleSetElement(map, m.signature(), m);
}
}
}
for(Iterator outerIter = interfacesIterator(); outerIter.hasNext(); ) {
TypeDecl typeDecl = (TypeDecl)outerIter.next();
for(Iterator iter = typeDecl.methodsIterator(); iter.hasNext(); ) {
MethodDecl m = (MethodDecl)iter.next();
if(!m.isPrivate() && m.accessibleFrom(this) && !localMethodsSignatureMap().containsKey(m.signature())) {
if(!(m instanceof MethodDeclSubstituted) || !localMethodsSignatureMap().containsKey(m.sourceMethodDecl().signature())) {
if(allMethodsAbstract((SimpleSet)map.get(m.signature())) &&
(!(m instanceof MethodDeclSubstituted) ||
allMethodsAbstract((SimpleSet)map.get(m.sourceMethodDecl().signature())) )
)
putSimpleSetElement(map, m.signature(), m);
}
}
}
}
return map;
}
protected java.util.Map ancestorMethods_String_values;
/**
* @attribute syn
* @aspect AncestorMethods
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupMethod.jrag:380
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet ancestorMethods(String signature) {
Object _parameters = signature;
if(ancestorMethods_String_values == null) ancestorMethods_String_values = new java.util.HashMap(4);
if(ancestorMethods_String_values.containsKey(_parameters)) {
return (SimpleSet)ancestorMethods_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet ancestorMethods_String_value = ancestorMethods_compute(signature);
if(isFinal && num == state().boundariesCrossed) ancestorMethods_String_values.put(_parameters, ancestorMethods_String_value);
return ancestorMethods_String_value;
}
/**
* @apilevel internal
*/
private SimpleSet ancestorMethods_compute(String signature) {
SimpleSet set = SimpleSet.emptySet;
if(hasSuperclass()) {
for(Iterator iter = superclass().localMethodsSignature(signature).iterator(); iter.hasNext(); ) {
MethodDecl m = (MethodDecl)iter.next();
if(!m.isPrivate())
set = set.add(m);
}
}
if(set.size() != 1 || ((MethodDecl)set.iterator().next()).isAbstract()) {
for(Iterator iter = interfacesMethodsSignature(signature).iterator(); iter.hasNext(); ) {
MethodDecl m = (MethodDecl)iter.next();
set = set.add(m);
}
}
if(!hasSuperclass()) return set;
if(set.size() == 1) {
MethodDecl m = (MethodDecl)set.iterator().next();
if(!m.isAbstract()) {
boolean done = true;
for(Iterator iter = superclass().ancestorMethods(signature).iterator(); iter.hasNext(); ) {
MethodDecl n = (MethodDecl)iter.next();
if(n.isPrivate() || !n.accessibleFrom(m.hostType()))
done = false;
}
if(done) return set;
}
}
for(Iterator iter = superclass().ancestorMethods(signature).iterator(); iter.hasNext(); ) {
MethodDecl m = (MethodDecl)iter.next();
set = set.add(m);
}
return set;
}
protected java.util.Map memberTypes_String_values;
/**
* @attribute syn
* @aspect TypeScopePropagation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:498
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet memberTypes(String name) {
Object _parameters = name;
if(memberTypes_String_values == null) memberTypes_String_values = new java.util.HashMap(4);
if(memberTypes_String_values.containsKey(_parameters)) {
return (SimpleSet)memberTypes_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet memberTypes_String_value = memberTypes_compute(name);
if(isFinal && num == state().boundariesCrossed) memberTypes_String_values.put(_parameters, memberTypes_String_value);
return memberTypes_String_value;
}
/**
* @apilevel internal
*/
private SimpleSet memberTypes_compute(String name) {
SimpleSet set = localTypeDecls(name);
if(!set.isEmpty()) return set;
for(Iterator outerIter = interfacesIterator(); outerIter.hasNext(); ) {
TypeDecl type = (TypeDecl)outerIter.next();
for(Iterator iter = type.memberTypes(name).iterator(); iter.hasNext(); ) {
TypeDecl decl = (TypeDecl)iter.next();
if(!decl.isPrivate() && decl.accessibleFrom(this))
set = set.add(decl);
}
}
if(hasSuperclass()) {
for(Iterator iter = superclass().memberTypes(name).iterator(); iter.hasNext(); ) {
TypeDecl decl = (TypeDecl)iter.next();
if(!decl.isPrivate() && decl.accessibleFrom(this)) {
set = set.add(decl);
}
}
}
return set;
}
/**
* @apilevel internal
*/
protected boolean memberFieldsMap_computed = false;
/**
* @apilevel internal
*/
protected HashMap memberFieldsMap_value;
/**
* @attribute syn
* @aspect Fields
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:283
*/
@SuppressWarnings({"unchecked", "cast"})
public HashMap memberFieldsMap() {
if(memberFieldsMap_computed) {
return memberFieldsMap_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
memberFieldsMap_value = memberFieldsMap_compute();
if(isFinal && num == state().boundariesCrossed) memberFieldsMap_computed = true;
return memberFieldsMap_value;
}
/**
* @apilevel internal
*/
private HashMap memberFieldsMap_compute() {
HashMap map = new HashMap(localFieldsMap());
if(hasSuperclass()) {
for(Iterator iter = superclass().fieldsIterator(); iter.hasNext(); ) {
FieldDeclaration decl = (FieldDeclaration)iter.next();
if(!decl.isPrivate() && decl.accessibleFrom(this) && !localFieldsMap().containsKey(decl.name()))
putSimpleSetElement(map, decl.name(), decl);
}
}
for(Iterator outerIter = interfacesIterator(); outerIter.hasNext(); ) {
TypeDecl type = (TypeDecl)outerIter.next();
for(Iterator iter = type.fieldsIterator(); iter.hasNext(); ) {
FieldDeclaration decl = (FieldDeclaration)iter.next();
if(!decl.isPrivate() && decl.accessibleFrom(this) && !localFieldsMap().containsKey(decl.name()))
putSimpleSetElement(map, decl.name(), decl);
}
}
return map;
}
protected java.util.Map memberFields_String_values;
/**
* @attribute syn
* @aspect Fields
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:334
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet memberFields(String name) {
Object _parameters = name;
if(memberFields_String_values == null) memberFields_String_values = new java.util.HashMap(4);
if(memberFields_String_values.containsKey(_parameters)) {
return (SimpleSet)memberFields_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet memberFields_String_value = memberFields_compute(name);
if(isFinal && num == state().boundariesCrossed) memberFields_String_values.put(_parameters, memberFields_String_value);
return memberFields_String_value;
}
/**
* @apilevel internal
*/
private SimpleSet memberFields_compute(String name) {
SimpleSet fields = localFields(name);
if(!fields.isEmpty())
return fields; // this causes hiding of fields in superclass and interfaces
if(hasSuperclass()) {
for(Iterator iter = superclass().memberFields(name).iterator(); iter.hasNext(); ) {
FieldDeclaration decl = (FieldDeclaration)iter.next();
if(!decl.isPrivate() && decl.accessibleFrom(this))
fields = fields.add(decl);
}
}
for(Iterator outerIter = interfacesIterator(); outerIter.hasNext(); ) {
TypeDecl type = (TypeDecl)outerIter.next();
for(Iterator iter = type.memberFields(name).iterator(); iter.hasNext(); ) {
FieldDeclaration decl = (FieldDeclaration)iter.next();
if(!decl.isPrivate() && decl.accessibleFrom(this))
fields = fields.add(decl);
}
}
return fields;
}
/**
* @apilevel internal
*/
protected boolean unimplementedMethods_computed = false;
/**
* @apilevel internal
*/
protected Collection unimplementedMethods_value;
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:17
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection unimplementedMethods() {
if(unimplementedMethods_computed) {
return unimplementedMethods_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
unimplementedMethods_value = unimplementedMethods_compute();
if(isFinal && num == state().boundariesCrossed) unimplementedMethods_computed = true;
return unimplementedMethods_value;
}
/**
* @apilevel internal
*/
private Collection unimplementedMethods_compute() {
Collection c = new ArrayList();
for(Iterator iter = interfacesMethodsIterator(); iter.hasNext(); ) {
MethodDecl m = (MethodDecl)iter.next();
boolean implemented = false;
SimpleSet set = (SimpleSet)localMethodsSignature(m.signature());
if(set.size() == 1) {
MethodDecl n = (MethodDecl)set.iterator().next();
if(!n.isAbstract())
implemented = true;
}
if(!implemented) {
set = (SimpleSet)ancestorMethods(m.signature());
for(Iterator i2 = set.iterator(); i2.hasNext(); ) {
MethodDecl n = (MethodDecl)i2.next();
if(!n.isAbstract()) {
implemented = true;
break;
}
}
}
if(!implemented) {
c.add(m);
}
}
if(hasSuperclass()) {
for(Iterator iter = superclass().unimplementedMethods().iterator(); iter.hasNext(); ) {
MethodDecl m = (MethodDecl)iter.next();
SimpleSet set = (SimpleSet)localMethodsSignature(m.signature());
if(set.size() == 1) {
MethodDecl n = (MethodDecl)set.iterator().next();
if(n.isAbstract() || !n.overrides(m))
c.add(m);
}
else
c.add(m);
}
}
for(Iterator iter = localMethodsIterator(); iter.hasNext(); ) {
MethodDecl m = (MethodDecl)iter.next();
if(m.isAbstract()) {
c.add(m);
}
}
return c;
}
/**
* @apilevel internal
*/
protected boolean hasAbstract_computed = false;
/**
* @apilevel internal
*/
protected boolean hasAbstract_value;
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:66
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean hasAbstract() {
if(hasAbstract_computed) {
return hasAbstract_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
hasAbstract_value = hasAbstract_compute();
if(isFinal && num == state().boundariesCrossed) hasAbstract_computed = true;
return hasAbstract_value;
}
/**
* @apilevel internal
*/
private boolean hasAbstract_compute() { return !unimplementedMethods().isEmpty(); }
protected java.util.Map castingConversionTo_TypeDecl_values;
/**
* @attribute syn
* @aspect AutoBoxing
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:134
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean castingConversionTo(TypeDecl type) {
Object _parameters = type;
if(castingConversionTo_TypeDecl_values == null) castingConversionTo_TypeDecl_values = new java.util.HashMap(4);
if(castingConversionTo_TypeDecl_values.containsKey(_parameters)) {
return ((Boolean)castingConversionTo_TypeDecl_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean castingConversionTo_TypeDecl_value = castingConversionTo_compute(type);
if(isFinal && num == state().boundariesCrossed) castingConversionTo_TypeDecl_values.put(_parameters, Boolean.valueOf(castingConversionTo_TypeDecl_value));
return castingConversionTo_TypeDecl_value;
}
/**
* @apilevel internal
*/
private boolean castingConversionTo_compute(TypeDecl type) {
if(refined_Generics_ClassDecl_castingConversionTo_TypeDecl(type))
return true;
boolean canUnboxThis = !unboxed().isUnknown();
boolean canUnboxType = !type.unboxed().isUnknown();
if(canUnboxThis && !canUnboxType)
return unboxed().wideningConversionTo(type);
return false;
/*
else if(unboxingConversionTo(type))
return true;
return false;
*/
}
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:209
*/
public boolean isClassDecl() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean isString_computed = false;
/**
* @apilevel internal
*/
protected boolean isString_value;
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:225
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isString() {
if(isString_computed) {
return isString_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
isString_value = isString_compute();
if(isFinal && num == state().boundariesCrossed) isString_computed = true;
return isString_value;
}
/**
* @apilevel internal
*/
private boolean isString_compute() { return fullName().equals("java.lang.String"); }
/**
* @apilevel internal
*/
protected boolean isObject_computed = false;
/**
* @apilevel internal
*/
protected boolean isObject_value;
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:228
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isObject() {
if(isObject_computed) {
return isObject_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
isObject_value = isObject_compute();
if(isFinal && num == state().boundariesCrossed) isObject_computed = true;
return isObject_value;
}
/**
* @apilevel internal
*/
private boolean isObject_compute() { return name().equals("Object") && packageName().equals("java.lang"); }
protected java.util.Map instanceOf_TypeDecl_values;
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:387
*/
@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); }
/**
* @attribute syn
* @aspect TypeWideningAndIdentity
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:423
*/
public boolean isSupertypeOfClassDecl(ClassDecl type) {
ASTNode$State state = state();
try {
if(super.isSupertypeOfClassDecl(type))
return true;
return type.hasSuperclass() && type.superclass() != null && type.superclass().instanceOf(this);
}
finally {
}
}
/**
* @attribute syn
* @aspect TypeWideningAndIdentity
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:440
*/
public boolean isSupertypeOfInterfaceDecl(InterfaceDecl type) {
ASTNode$State state = state();
try { return isObject(); }
finally {
}
}
/**
* @attribute syn
* @aspect TypeWideningAndIdentity
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:453
*/
public boolean isSupertypeOfArrayDecl(ArrayDecl type) {
ASTNode$State state = state();
try {
if(super.isSupertypeOfArrayDecl(type))
return true;
return type.hasSuperclass() && type.superclass() != null && type.superclass().instanceOf(this);
}
finally {
}
}
/**
* @attribute syn
* @aspect NestedTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:534
*/
public boolean isInnerClass() {
ASTNode$State state = state();
try { return isNestedType() && !isStatic() && enclosingType().isClassDecl(); }
finally {
}
}
/**
* @apilevel internal
*/
protected int isCircular_visited = -1;
/**
* @apilevel internal
*/
protected boolean isCircular_computed = false;
/**
* @apilevel internal
*/
protected boolean isCircular_initialized = false;
/**
* @apilevel internal
*/
protected boolean isCircular_value;
/**
* @attribute syn
* @aspect Circularity
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:677
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isCircular() {
if(isCircular_computed) {
return isCircular_value;
}
ASTNode$State state = state();
if (!isCircular_initialized) {
isCircular_initialized = true;
isCircular_value = true;
}
if (!state.IN_CIRCLE) {
state.IN_CIRCLE = true;
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
do {
isCircular_visited = state.CIRCLE_INDEX;
state.CHANGE = false;
boolean new_isCircular_value = isCircular_compute();
if (new_isCircular_value!=isCircular_value)
state.CHANGE = true;
isCircular_value = new_isCircular_value;
state.CIRCLE_INDEX++;
} while (state.CHANGE);
if(isFinal && num == state().boundariesCrossed) {
isCircular_computed = true;
}
else {
state.RESET_CYCLE = true;
isCircular_compute();
state.RESET_CYCLE = false;
isCircular_computed = false;
isCircular_initialized = false;
}
state.IN_CIRCLE = false;
return isCircular_value;
}
if(isCircular_visited != state.CIRCLE_INDEX) {
isCircular_visited = state.CIRCLE_INDEX;
if (state.RESET_CYCLE) {
isCircular_computed = false;
isCircular_initialized = false;
isCircular_visited = -1;
return isCircular_value;
}
boolean new_isCircular_value = isCircular_compute();
if (new_isCircular_value!=isCircular_value)
state.CHANGE = true;
isCircular_value = new_isCircular_value;
return isCircular_value;
}
return isCircular_value;
}
/**
* @apilevel internal
*/
private boolean isCircular_compute() {
if(hasSuperClassAccess()) {
Access a = getSuperClassAccess().lastAccess();
while(a != null) {
if(a.type().isCircular())
return true;
a = (a.isQualified() && a.qualifier().isTypeAccess()) ? (Access)a.qualifier() : null;
}
}
for(int i = 0; i < getNumImplements(); i++) {
Access a = getImplements(i).lastAccess();
while(a != null) {
if(a.type().isCircular())
return true;
a = (a.isQualified() && a.qualifier().isTypeAccess()) ? (Access)a.qualifier() : null;
}
}
return false;
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:225
*/
public Annotation annotation(TypeDecl typeDecl) {
ASTNode$State state = state();
try {
Annotation a = super.annotation(typeDecl);
if(a != null) return a;
if(hasSuperclass()) {
// If the queried annotation is itself annotation with @Inherited then
// delegate the query to the superclass
if(typeDecl.annotation(lookupType("java.lang.annotation", "Inherited")) != null)
return superclass().annotation(typeDecl);
}
return null;
}
finally {
}
}
/**
* @apilevel internal
*/
protected boolean implementedInterfaces_computed = false;
/**
* @apilevel internal
*/
protected HashSet implementedInterfaces_value;
/**
* @attribute syn
* @aspect GenericsTypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:400
*/
@SuppressWarnings({"unchecked", "cast"})
public HashSet implementedInterfaces() {
if(implementedInterfaces_computed) {
return implementedInterfaces_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
implementedInterfaces_value = implementedInterfaces_compute();
if(isFinal && num == state().boundariesCrossed) implementedInterfaces_computed = true;
return implementedInterfaces_value;
}
/**
* @apilevel internal
*/
private HashSet implementedInterfaces_compute() {
HashSet set = new HashSet();
if(hasSuperclass())
set.addAll(superclass().implementedInterfaces());
for(Iterator iter = interfacesIterator(); iter.hasNext(); ) {
InterfaceDecl decl = (InterfaceDecl)iter.next();
set.add(decl);
set.addAll(decl.implementedInterfaces());
}
return set;
}
protected java.util.Map subtype_TypeDecl_values;
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:407
*/
@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.supertypeClassDecl(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 super.supertypeClassDecl(type) ||
type.hasSuperclass() && type.superclass() != null && type.superclass().subtype(this); }
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 isObject(); }
finally {
}
}
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:450
*/
public boolean supertypeArrayDecl(ArrayDecl type) {
ASTNode$State state = state();
try {
if(super.supertypeArrayDecl(type))
return true;
return type.hasSuperclass() && type.superclass() != null && type.superclass().subtype(this);
}
finally {
}
}
/**
* @attribute syn
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:430
*/
public TypeDecl superEnclosing() {
ASTNode$State state = state();
try {
return superclass().erasure().enclosing();
}
finally {
}
}
/**
* @apilevel internal
*/
protected boolean sootClass_computed = false;
/**
* @apilevel internal
*/
protected SootClass sootClass_value;
/**
* @attribute syn
* @aspect IncrementalJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/SootJastAddJ/IncrementalJimple.jrag:35
*/
@SuppressWarnings({"unchecked", "cast"})
public SootClass sootClass() {
if(sootClass_computed) {
return sootClass_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
sootClass_value = sootClass_compute();
if(isFinal && num == state().boundariesCrossed) sootClass_computed = true;
return sootClass_value;
}
/**
* @apilevel internal
*/
private SootClass sootClass_compute() {
if(!Scene.v().isIncrementalBuild()) {
return refined_EmitJimpleRefinements_ClassDecl_sootClass();
}
if(Scene.v().containsClass(jvmName())) {
Scene.v().removeClass(Scene.v().getSootClass(jvmName()));
}
SootClass sc = null;
if(options().verbose())
System.out.println("Creating from source " + jvmName());
sc = new SootClass(jvmName());
sc.setResolvingLevel(SootClass.DANGLING);
Scene.v().addClass(sc);
return sc;
}
/**
* @attribute syn
* @aspect AnnotationsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:322
*/
public String typeDescriptor() {
ASTNode$State state = state();
try { return "L" + jvmName().replace('.', '/') + ";"; }
finally {
}
}
/**
* @attribute syn
* @aspect GenericsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/GenericsCodegen.jrag:333
*/
public SimpleSet bridgeCandidates(String signature) {
ASTNode$State state = state();
try {
SimpleSet set = ancestorMethods(signature);
for(Iterator iter = interfacesMethodsSignature(signature).iterator(); iter.hasNext(); )
set = set.add(iter.next());
return set;
}
finally {
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:259
* @apilevel internal
*/
public boolean Define_boolean_mayBeFinal(ASTNode caller, ASTNode child) {
if(caller == getModifiersNoTransform()) {
return true;
}
else { return super.Define_boolean_mayBeFinal(caller, child);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:74
* @apilevel internal
*/
public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {
if(caller == getImplementsListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return NameType.TYPE_NAME;
}
else if(caller == getSuperClassAccessOptNoTransform()) {
return NameType.TYPE_NAME;
}
else { return super.Define_NameType_nameType(caller, child);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:579
* @apilevel internal
*/
public TypeDecl Define_TypeDecl_hostType(ASTNode caller, ASTNode child) {
if(caller == getImplementsListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return hostType();
}
else if(caller == getSuperClassAccessOptNoTransform()) {
return hostType();
}
else { return super.Define_TypeDecl_hostType(caller, child);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:276
* @apilevel internal
*/
public boolean Define_boolean_withinSuppressWarnings(ASTNode caller, ASTNode child, String s) {
if(caller == getImplementsListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return hasAnnotationSuppressWarnings(s) || withinSuppressWarnings(s);
}
else if(caller == getSuperClassAccessOptNoTransform()) {
return hasAnnotationSuppressWarnings(s) || withinSuppressWarnings(s);
}
else { return super.Define_boolean_withinSuppressWarnings(caller, child, s);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:377
* @apilevel internal
*/
public boolean Define_boolean_withinDeprecatedAnnotation(ASTNode caller, ASTNode child) {
if(caller == getImplementsListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return isDeprecated() || withinDeprecatedAnnotation();
}
else if(caller == getSuperClassAccessOptNoTransform()) {
return isDeprecated() || withinDeprecatedAnnotation();
}
else { return super.Define_boolean_withinDeprecatedAnnotation(caller, child);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:269
* @apilevel internal
*/
public boolean Define_boolean_inExtendsOrImplements(ASTNode caller, ASTNode child) {
if(caller == getImplementsListNoTransform()) {
int i = caller.getIndexOfChild(child);
return true;
}
else if(caller == getSuperClassAccessOptNoTransform()) {
return true;
}
else { return getParent().Define_boolean_inExtendsOrImplements(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 68,097
| 32.234749
| 323
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ClassDeclSubstituted.java
|
/* 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 ClassDeclSubstituted : {@link ClassDecl} ::= <span class="component"><Original:TypeDecl></span> <span class="component">{@link BodyDecl}*</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.ast:41
*/
public class ClassDeclSubstituted extends ClassDecl implements Cloneable, MemberSubstitutor {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
getBodyDeclList_computed = false;
getBodyDeclList_value = null;
sourceTypeDecl_computed = false;
sourceTypeDecl_value = null;
instanceOf_TypeDecl_values = null;
subtype_TypeDecl_values = null;
localMethodsSignatureMap_computed = false;
localMethodsSignatureMap_value = null;
localFields_String_values = null;
localTypeDecls_String_values = null;
constructors_computed = false;
constructors_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ClassDeclSubstituted clone() throws CloneNotSupportedException {
ClassDeclSubstituted node = (ClassDeclSubstituted)super.clone();
node.getBodyDeclList_computed = false;
node.getBodyDeclList_value = null;
node.sourceTypeDecl_computed = false;
node.sourceTypeDecl_value = null;
node.instanceOf_TypeDecl_values = null;
node.subtype_TypeDecl_values = null;
node.localMethodsSignatureMap_computed = false;
node.localMethodsSignatureMap_value = null;
node.localFields_String_values = null;
node.localTypeDecls_String_values = null;
node.constructors_computed = false;
node.constructors_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ClassDeclSubstituted copy() {
try {
ClassDeclSubstituted node = (ClassDeclSubstituted) 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 ClassDeclSubstituted fullCopy() {
ClassDeclSubstituted tree = (ClassDeclSubstituted) copy();
if (children != null) {
for (int i = 0; i < children.length; ++i) {
switch (i) {
case 5:
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
*
*/
public ClassDeclSubstituted() {
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 Opt(), 1);
setChild(new List(), 2);
setChild(new List(), 3);
}
/**
* @ast method
*
*/
public ClassDeclSubstituted(Modifiers p0, String p1, Opt<Access> p2, List<Access> p3, TypeDecl p4) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setOriginal(p4);
}
/**
* @ast method
*
*/
public ClassDeclSubstituted(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<Access> p3, TypeDecl p4) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setOriginal(p4);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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 optional node for the SuperClassAccess child. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* @param opt The new node to be used as the optional node for the SuperClassAccess child.
* @apilevel low-level
* @ast method
*
*/
public void setSuperClassAccessOpt(Opt<Access> opt) {
setChild(opt, 1);
}
/**
* Check whether the optional SuperClassAccess child exists.
* @return {@code true} if the optional SuperClassAccess child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasSuperClassAccess() {
return getSuperClassAccessOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) SuperClassAccess child.
* @return The SuperClassAccess child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getSuperClassAccess() {
return (Access)getSuperClassAccessOpt().getChild(0);
}
/**
* Replaces the (optional) SuperClassAccess child.
* @param node The new node to be used as the SuperClassAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setSuperClassAccess(Access node) {
getSuperClassAccessOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOpt() {
return (Opt<Access>)getChild(1);
}
/**
* Retrieves the optional node for child SuperClassAccess. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child SuperClassAccess.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOptNoTransform() {
return (Opt<Access>)getChildNoTransform(1);
}
/**
* Replaces the Implements list.
* @param list The new list node to be used as the Implements list.
* @apilevel high-level
* @ast method
*
*/
public void setImplementsList(List<Access> list) {
setChild(list, 2);
}
/**
* Retrieves the number of children in the Implements list.
* @return Number of children in the Implements list.
* @apilevel high-level
* @ast method
*
*/
public int getNumImplements() {
return getImplementsList().getNumChild();
}
/**
* Retrieves the number of children in the Implements list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Implements list.
* @apilevel low-level
* @ast method
*
*/
public int getNumImplementsNoTransform() {
return getImplementsListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Implements list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Implements list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getImplements(int i) {
return (Access)getImplementsList().getChild(i);
}
/**
* Append an element to the Implements list.
* @param node The element to append to the Implements list.
* @apilevel high-level
* @ast method
*
*/
public void addImplements(Access node) {
List<Access> list = (parent == null || state == null) ? getImplementsListNoTransform() : getImplementsList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addImplementsNoTransform(Access node) {
List<Access> list = getImplementsListNoTransform();
list.addChild(node);
}
/**
* Replaces the Implements 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 setImplements(Access node, int i) {
List<Access> list = getImplementsList();
list.setChild(node, i);
}
/**
* Retrieves the Implements list.
* @return The node representing the Implements list.
* @apilevel high-level
* @ast method
*
*/
public List<Access> getImplementss() {
return getImplementsList();
}
/**
* Retrieves the Implements list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Implements list.
* @apilevel low-level
* @ast method
*
*/
public List<Access> getImplementssNoTransform() {
return getImplementsListNoTransform();
}
/**
* Retrieves the Implements list.
* @return The node representing the Implements list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getImplementsList() {
List<Access> list = (List<Access>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the Implements list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Implements list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getImplementsListNoTransform() {
return (List<Access>)getChildNoTransform(2);
}
/**
* Replaces the lexeme Original.
* @param value The new value for the lexeme Original.
* @apilevel high-level
* @ast method
*
*/
public void setOriginal(TypeDecl value) {
tokenTypeDecl_Original = value;
}
/**
* @apilevel internal
* @ast method
*
*/
/**
* @apilevel internal
*/
protected TypeDecl tokenTypeDecl_Original;
/**
* Retrieves the value for the lexeme Original.
* @return The value for the lexeme Original.
* @apilevel high-level
* @ast method
*
*/
public TypeDecl getOriginal() {
return tokenTypeDecl_Original;
}
/**
* 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<BodyDecl> list) {
setChild(list, 3);
}
/**
* 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<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addBodyDeclNoTransform(BodyDecl node) {
List<BodyDecl> 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<BodyDecl> list = getBodyDeclList();
list.setChild(node, i);
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<BodyDecl> getBodyDecls() {
return getBodyDeclList();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclsNoTransform() {
return getBodyDeclListNoTransform();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclListNoTransform() {
return (List<BodyDecl>)getChildNoTransform(3);
}
/**
* 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 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 getOriginal(); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean getBodyDeclList_computed = false;
/**
* @apilevel internal
*/
protected List getBodyDeclList_value;
/**
* @attribute syn nta
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1050
*/
@SuppressWarnings({"unchecked", "cast"})
public List getBodyDeclList() {
if(getBodyDeclList_computed) {
return (List) getChild(getBodyDeclListChildPosition());
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
getBodyDeclList_value = getBodyDeclList_compute();
setBodyDeclList(getBodyDeclList_value);
if(isFinal && num == state().boundariesCrossed) getBodyDeclList_computed = true;
return (List) getChild(getBodyDeclListChildPosition());
}
/**
* @apilevel internal
*/
private List getBodyDeclList_compute() { return new BodyDeclList(); }
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1306
*/
public TypeDecl original() {
ASTNode$State state = state();
try { return getOriginal().original(); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean sourceTypeDecl_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl sourceTypeDecl_value;
/**
* @attribute syn
* @aspect SourceDeclarations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1506
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl sourceTypeDecl() {
if(sourceTypeDecl_computed) {
return sourceTypeDecl_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
sourceTypeDecl_value = sourceTypeDecl_compute();
if(isFinal && num == state().boundariesCrossed) sourceTypeDecl_computed = true;
return sourceTypeDecl_value;
}
/**
* @apilevel internal
*/
private TypeDecl sourceTypeDecl_compute() { return original().sourceTypeDecl(); }
protected java.util.Map instanceOf_TypeDecl_values;
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:486
*/
@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); }
protected java.util.Map subtype_TypeDecl_values;
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:491
*/
@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.supertypeClassDeclSubstituted(this); }
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:493
*/
public boolean supertypeClassDeclSubstituted(ClassDeclSubstituted type) {
ASTNode$State state = state();
try { return original() == type.original() && type.enclosingType().subtype(enclosingType()) || super.supertypeClassDeclSubstituted(type); }
finally {
}
}
/**
* @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 super.supertypeClassDecl(type) || original().supertypeClassDecl(type); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean localMethodsSignatureMap_computed = false;
/**
* @apilevel internal
*/
protected HashMap localMethodsSignatureMap_value;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1084
*/
@SuppressWarnings({"unchecked", "cast"})
public HashMap localMethodsSignatureMap() {
if(localMethodsSignatureMap_computed) {
return localMethodsSignatureMap_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
localMethodsSignatureMap_value = localMethodsSignatureMap_compute();
if(true) localMethodsSignatureMap_computed = true;
return localMethodsSignatureMap_value;
}
/**
* @apilevel internal
*/
private HashMap localMethodsSignatureMap_compute() {
HashMap map = new HashMap();
for(Iterator iter = original().localMethodsIterator(); iter.hasNext(); ) {
MethodDecl decl = (MethodDecl)iter.next();
/* ES removing this:
if(!decl.isStatic() && (decl.usesTypeVariable() || isRawType())) {
BodyDecl b = decl.substitutedBodyDecl(this);
addBodyDecl(b);
// Here we should access b through an ordinary
// child accessor instead of setting is$Final directly,
// however doing so appears to cause unexpected behaviour!
b.is$Final = true;
decl = (MethodDecl) b;
}
map.put(decl.signature(), decl);
* and replacing with:
*/
if(!decl.isStatic() && (decl.usesTypeVariable() || isRawType())) {
BodyDecl copyDecl = ((BodyDeclList)getBodyDeclList()).localMethodSignatureCopy(decl, this);
decl = (MethodDecl) copyDecl;
}
map.put(decl.signature(), decl);
}
return map;
}
protected java.util.Map localFields_String_values;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1119
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet localFields(String name) {
Object _parameters = name;
if(localFields_String_values == null) localFields_String_values = new java.util.HashMap(4);
if(localFields_String_values.containsKey(_parameters)) {
return (SimpleSet)localFields_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet localFields_String_value = localFields_compute(name);
if(true) localFields_String_values.put(_parameters, localFields_String_value);
return localFields_String_value;
}
/**
* @apilevel internal
*/
private SimpleSet localFields_compute(String name) {
SimpleSet set = SimpleSet.emptySet;
for(Iterator iter = original().localFields(name).iterator(); iter.hasNext(); ) {
FieldDeclaration f = (FieldDeclaration)iter.next();
/* ES removing this:
if(!f.isStatic() && (f.usesTypeVariable() || isRawType())) {
BodyDecl b = f.substitutedBodyDecl(this);
addBodyDecl(b);
// Here we should access b through an ordinary
// child accessor instead of setting is$Final directly,
// however doing so appears to cause unexpected behaviour!
b.is$Final = true;
f = (FieldDeclaration) b;
}
set = set.add(f);
* and replacing with:
*/
if(!f.isStatic() && (f.usesTypeVariable() || isRawType())) {
BodyDecl fCopy = ((BodyDeclList)getBodyDeclList()).localFieldCopy(f, this);
f = (FieldDeclaration) fCopy;
}
set = set.add(f);
}
return set;
}
protected java.util.Map localTypeDecls_String_values;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1154
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet localTypeDecls(String name) {
Object _parameters = name;
if(localTypeDecls_String_values == null) localTypeDecls_String_values = new java.util.HashMap(4);
ASTNode$State.CircularValue _value;
if(localTypeDecls_String_values.containsKey(_parameters)) {
Object _o = localTypeDecls_String_values.get(_parameters);
if(!(_o instanceof ASTNode$State.CircularValue)) {
return (SimpleSet)_o;
}
else
_value = (ASTNode$State.CircularValue)_o;
}
else {
_value = new ASTNode$State.CircularValue();
localTypeDecls_String_values.put(_parameters, _value);
_value.value = SimpleSet.emptySet;
}
ASTNode$State state = state();
if (!state.IN_CIRCLE) {
state.IN_CIRCLE = true;
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet new_localTypeDecls_String_value;
do {
_value.visited = new Integer(state.CIRCLE_INDEX);
state.CHANGE = false;
new_localTypeDecls_String_value = localTypeDecls_compute(name);
if ((new_localTypeDecls_String_value==null && (SimpleSet)_value.value!=null) || (new_localTypeDecls_String_value!=null && !new_localTypeDecls_String_value.equals((SimpleSet)_value.value))) {
state.CHANGE = true;
_value.value = new_localTypeDecls_String_value;
}
state.CIRCLE_INDEX++;
} while (state.CHANGE);
if(true) {
localTypeDecls_String_values.put(_parameters, new_localTypeDecls_String_value);
}
else {
localTypeDecls_String_values.remove(_parameters);
state.RESET_CYCLE = true;
localTypeDecls_compute(name);
state.RESET_CYCLE = false;
}
state.IN_CIRCLE = false;
return new_localTypeDecls_String_value;
}
if(!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) {
_value.visited = new Integer(state.CIRCLE_INDEX);
SimpleSet new_localTypeDecls_String_value = localTypeDecls_compute(name);
if (state.RESET_CYCLE) {
localTypeDecls_String_values.remove(_parameters);
}
else if ((new_localTypeDecls_String_value==null && (SimpleSet)_value.value!=null) || (new_localTypeDecls_String_value!=null && !new_localTypeDecls_String_value.equals((SimpleSet)_value.value))) {
state.CHANGE = true;
_value.value = new_localTypeDecls_String_value;
}
return new_localTypeDecls_String_value;
}
return (SimpleSet)_value.value;
}
/**
* @apilevel internal
*/
private SimpleSet localTypeDecls_compute(String name) {
SimpleSet set = SimpleSet.emptySet;
for(Iterator iter = original().localTypeDecls(name).iterator(); iter.hasNext(); ) {
TypeDecl t = (TypeDecl)iter.next();
/* ES: removing this:
if(t.isStatic())
set = set.add(t);
else {
BodyDecl b;
TypeDecl typeDecl;
if(t instanceof ClassDecl) {
ClassDecl classDecl = (ClassDecl)t;
typeDecl = classDecl.substitutedClassDecl(this);
b = new MemberClassDecl((ClassDecl)typeDecl);
addBodyDecl(b);
// Here we should access b through an ordinary
// child accessor instead of setting is$Final directly,
// however doing so appears to cause unexpected behaviour!
b.is$Final = true;
set = set.add(typeDecl);
}
else if(t instanceof InterfaceDecl) {
InterfaceDecl interfaceDecl = (InterfaceDecl)t;
typeDecl = interfaceDecl.substitutedInterfaceDecl(this);
b = new MemberInterfaceDecl((InterfaceDecl)typeDecl);
addBodyDecl(b);
// Here we should access b through an ordinary
// child accessor instead of setting is$Final directly,
// however doing so appears to cause unexpected behaviour!
b.is$Final = true;
set = set.add(typeDecl);
}
}
* and replacing with:
*/
if(t.isStatic()) {
set = set.add(t);
} else if (t instanceof ClassDecl) {
MemberClassDecl copy = ((BodyDeclList)getBodyDeclList()).localClassDeclCopy((ClassDecl)t, this);
set = set.add(copy.getClassDecl());
} else if (t instanceof InterfaceDecl) {
MemberInterfaceDecl copy = ((BodyDeclList)getBodyDeclList()).localInterfaceDeclCopy((InterfaceDecl)t, this);
set = set.add(copy.getInterfaceDecl());
}
}
return set;
}
/**
* @apilevel internal
*/
protected boolean constructors_computed = false;
/**
* @apilevel internal
*/
protected Collection constructors_value;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1213
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection constructors() {
if(constructors_computed) {
return constructors_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
constructors_value = constructors_compute();
if(isFinal && num == state().boundariesCrossed) constructors_computed = true;
return constructors_value;
}
/**
* @apilevel internal
*/
private Collection constructors_compute() {
Collection set = new ArrayList();
for(Iterator iter = original().constructors().iterator(); iter.hasNext(); ) {
ConstructorDecl c = (ConstructorDecl)iter.next();
/* ES: removing this:
BodyDecl b = c.substitutedBodyDecl(this);
addBodyDecl(b);
// Here we should access b through an ordinary
// child accessor instead of setting is$Final directly,
// however doing so appears to cause unexpected behaviour!
b.is$Final = true;
* and replacing with:
*/
BodyDecl b = ((BodyDeclList)getBodyDeclList()).constructorCopy(c, this);
set.add(b);
}
return set;
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 32,906
| 30.550336
| 201
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ClassInstanceExpr.java
|
/* 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 ClassInstanceExpr : {@link Access} ::= <span class="component">{@link Access}</span> <span class="component">Arg:{@link Expr}*</span> <span class="component">[{@link TypeDecl}]</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:37
*/
public class ClassInstanceExpr extends Access implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
isDAafterInstance_Variable_values = null;
computeDAbefore_int_Variable_values = null;
computeDUbefore_int_Variable_values = null;
decls_computed = false;
decls_value = null;
decl_computed = false;
decl_value = null;
localLookupType_String_values = null;
type_computed = false;
type_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ClassInstanceExpr clone() throws CloneNotSupportedException {
ClassInstanceExpr node = (ClassInstanceExpr)super.clone();
node.isDAafterInstance_Variable_values = null;
node.computeDAbefore_int_Variable_values = null;
node.computeDUbefore_int_Variable_values = null;
node.decls_computed = false;
node.decls_value = null;
node.decl_computed = false;
node.decl_value = null;
node.localLookupType_String_values = null;
node.type_computed = false;
node.type_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ClassInstanceExpr copy() {
try {
ClassInstanceExpr node = (ClassInstanceExpr) 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 ClassInstanceExpr fullCopy() {
ClassInstanceExpr tree = (ClassInstanceExpr) 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 AccessControl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AccessControl.jrag:139
*/
public void accessControl() {
super.accessControl();
if(type().isAbstract())
error("Can not instantiate abstract class " + type().fullName());
if(!decl().accessibleFrom(hostType()))
error("constructor " + decl().signature() + " is not accessible");
}
/**
* @ast method
* @aspect ExceptionHandling
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:119
*/
public void exceptionHandling() {
for (Access exception : decl().getExceptionList()) {
TypeDecl exceptionType = exception.type();
if (!handlesException(exceptionType))
error("" + this + " may throw uncaught exception " +
exceptionType.fullName() + "; it must be caught or declared as being thrown");
}
}
/**
* @ast method
* @aspect ExceptionHandling
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:281
*/
protected boolean reachedException(TypeDecl catchType) {
ConstructorDecl decl = decl();
for(int i = 0; i < decl.getNumException(); i++) {
TypeDecl exceptionType = decl.getException(i).type();
if(catchType.mayCatch(exceptionType))
return true;
}
for(int i = 0; i < getNumArg(); i++) {
if(getArg(i).reachedException(catchType))
return true;
}
return false;
}
/**
* @ast method
* @aspect TypeScopePropagation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:414
*/
public SimpleSet keepInnerClasses(SimpleSet c) {
SimpleSet newSet = SimpleSet.emptySet;
for(Iterator iter = c.iterator(); iter.hasNext(); ) {
TypeDecl t = (TypeDecl)iter.next();
if(t.isInnerType() && t.isClassDecl()) {
newSet = newSet.add(c);
}
}
return newSet;
}
/**
* @ast method
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:142
*/
public void refined_NameCheck_ClassInstanceExpr_nameCheck() {
super.nameCheck();
if(decls().isEmpty())
error("can not instantiate " + type().typeName() + " no matching constructor found in " + type().typeName());
else if(decls().size() > 1 && validArgs()) {
error("several most specific constructors found");
for(Iterator iter = decls().iterator(); iter.hasNext(); ) {
error(" " + ((ConstructorDecl)iter.next()).signature());
}
}
}
/**
* @ast method
* @aspect NodeConstructors
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NodeConstructors.jrag:82
*/
public ClassInstanceExpr(Access type, List args) {
this(type, args, new Opt());
}
/**
* @ast method
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:327
*/
public void toString(StringBuffer s) {
s.append("new ");
getAccess().toString(s);
s.append("(");
if(getNumArg() > 0) {
getArg(0).toString(s);
for(int i = 1; i < getNumArg(); i++) {
s.append(", ");
getArg(i).toString(s);
}
}
s.append(")");
if(hasTypeDecl()) {
TypeDecl decl = getTypeDecl();
s.append(" {");
for(int i = 0; i < decl.getNumBodyDecl(); i++) {
if(!(decl.getBodyDecl(i) instanceof ConstructorDecl))
decl.getBodyDecl(i).toString(s);
}
s.append(typeDeclIndent());
s.append("}");
}
}
/**
* @ast method
* @aspect TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:434
*/
public void typeCheck() {
if(isQualified() && qualifier().isTypeAccess() && !qualifier().type().isUnknown())
error("*** The expression in a qualified class instance expr must not be a type name");
// 15.9
if(isQualified() && !type().isInnerClass() && !((ClassDecl)type()).superclass().isInnerClass() && !type().isUnknown()) {
error("*** Qualified class instance creation can only instantiate inner classes and their anonymous subclasses");
}
if(!type().isClassDecl()) {
error("*** Can only instantiate classes, which " + type().typeName() + " is not");
}
typeCheckEnclosingInstance();
typeCheckAnonymousSuperclassEnclosingInstance();
}
/**
* @ast method
* @aspect TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:448
*/
public void typeCheckEnclosingInstance() {
TypeDecl C = type();
if(!C.isInnerClass())
return;
TypeDecl enclosing = null;
if(C.isAnonymous()) {
if(noEnclosingInstance()) {
enclosing = null;
}
else {
enclosing = hostType();
}
}
else if(C.isLocalClass()) {
if(C.inStaticContext()) {
enclosing = null;
}
else if(noEnclosingInstance()) {
enclosing = unknownType();
}
else {
TypeDecl nest = hostType();
while(nest != null && !nest.instanceOf(C.enclosingType()))
nest = nest.enclosingType();
enclosing = nest;
}
}
else if(C.isMemberType()) {
if(!isQualified()) {
if(noEnclosingInstance()) {
error("No enclosing instance to initialize " + C.typeName() + " with");
//System.err.println("ClassInstanceExpr: Non qualified MemberType " + C.typeName() + " is in a static context when instantiated in " + this);
enclosing = unknownType();
}
else {
TypeDecl nest = hostType();
while(nest != null && !nest.instanceOf(C.enclosingType()))
nest = nest.enclosingType();
enclosing = nest == null ? unknownType() : nest;
}
}
else {
enclosing = enclosingInstance();
}
}
if(enclosing != null && !enclosing.instanceOf(type().enclosingType())) {
String msg = enclosing == null ? "None" : enclosing.typeName();
error("*** Can not instantiate " + type().typeName() + " with the enclosing instance " + msg + " due to incorrect enclosing instance");
}
else if(!isQualified() && C.isMemberType() && inExplicitConstructorInvocation() && enclosing == hostType()) {
error("*** The innermost enclosing instance of type " + enclosing.typeName() + " is this which is not yet initialized here.");
}
}
/**
* @ast method
* @aspect TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:521
*/
public void typeCheckAnonymousSuperclassEnclosingInstance() {
if(type().isAnonymous() && ((ClassDecl)type()).superclass().isInnerType()) {
TypeDecl S = ((ClassDecl)type()).superclass();
if(S.isLocalClass()) {
if(S.inStaticContext()) {
}
else if(noEnclosingInstance()) {
error("*** No enclosing instance to class " + type().typeName() + " due to static context");
}
else if(inExplicitConstructorInvocation())
error("*** No enclosing instance to superclass " + S.typeName() + " of " + type().typeName() + " since this is not initialized yet");
}
else if(S.isMemberType()) {
if(!isQualified()) {
// 15.9.2 2nd paragraph
if(noEnclosingInstance()) {
error("*** No enclosing instance to class " + type().typeName() + " due to static context");
}
else {
TypeDecl nest = hostType();
while(nest != null && !nest.instanceOf(S.enclosingType()))
nest = nest.enclosingType();
if(nest == null) {
error("*** No enclosing instance to superclass " + S.typeName() + " of " + type().typeName());
}
else if(inExplicitConstructorInvocation()) {
error("*** No enclosing instance to superclass " + S.typeName() + " of " + type().typeName() + " since this is not initialized yet");
}
}
}
}
}
}
/**
* @ast method
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:363
*/
public void checkModifiers() {
if(decl().isDeprecated() &&
!withinDeprecatedAnnotation() &&
hostType().topLevelType() != decl().hostType().topLevelType() &&
!withinSuppressWarnings("deprecation"))
warning(decl().signature() + " in " + decl().hostType().typeName() + " has been deprecated");
}
/**
* @ast method
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:481
*/
// add val$name as arguments to the constructor
protected boolean addEnclosingVariables = true;
/**
* @ast method
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:482
*/
public void addEnclosingVariables() {
if(!addEnclosingVariables) return;
addEnclosingVariables = false;
decl().addEnclosingVariables();
for(Iterator iter = decl().hostType().enclosingVariables().iterator(); iter.hasNext(); ) {
Variable v = (Variable)iter.next();
getArgList().add(new VarAccess(v.name()));
}
}
/**
* @ast method
* @aspect Transformations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Transformations.jrag:127
*/
public void refined_Transformations_ClassInstanceExpr_transformation() {
// this$val
addEnclosingVariables();
// touch accessorIndex go force creation of private constructorAccessor
if(decl().isPrivate() && type() != hostType()) {
decl().createAccessor();
}
super.transformation();
}
/**
* @ast method
* @aspect Expressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:550
*/
private soot.Value emitLocalEnclosing(Body b, TypeDecl localClass) {
if(!localClass.inStaticContext()) {
return emitThis(b, localClass.enclosingType());
}
throw new Error("Not implemented");
}
/**
* @ast method
* @aspect Expressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:557
*/
private soot.Value emitInnerMemberEnclosing(Body b, TypeDecl innerClass) {
if(hasPrevExpr()) {
Local base = asLocal(b, prevExpr().eval(b));
b.setLine(this);
b.add(b.newInvokeStmt(
b.newVirtualInvokeExpr(
base,
Scene.v().getMethod("<java.lang.Object: java.lang.Class getClass()>").makeRef(),
this
),
this
));
return base;
}
else {
TypeDecl enclosing = hostType();
while(!enclosing.hasType(innerClass.name()))
enclosing = enclosing.enclosingType();
return emitThis(b, enclosing);
}
}
/**
* @ast method
* @aspect Expressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:579
*/
public soot.Value eval(Body b) {
Local local = asLocal(b, b.newNewExpr(type().sootRef(), this));
ArrayList list = new ArrayList();
// 15.9.2 first part
if(type().isAnonymous()) {
if(type().isAnonymousInNonStaticContext()) {
list.add(asImmediate(b, b.emitThis(hostType())));
}
// 15.9.2 second part
ClassDecl C = (ClassDecl)type();
TypeDecl S = C.superclass();
if(S.isLocalClass()) {
if(!type().inStaticContext())
list.add(asImmediate(b, emitLocalEnclosing(b, S)));
}
else if(S.isInnerType()) {
list.add(asImmediate(b, emitInnerMemberEnclosing(b, S)));
}
}
else if(type().isLocalClass()) {
if(!type().inStaticContext())
list.add(asImmediate(b, emitLocalEnclosing(b, type())));
}
else if(type().isInnerType()) {
list.add(asImmediate(b, emitInnerMemberEnclosing(b, type())));
}
for(int i = 0; i < getNumArg(); i++)
list.add(asImmediate(b, getArg(i).type().emitCastTo(b, getArg(i), decl().getParameter(i).type()))); // MethodInvocationConversion
if(decl().isPrivate() && type() != hostType()) {
list.add(asImmediate(b, soot.jimple.NullConstant.v()));
b.setLine(this);
b.add(
b.newInvokeStmt(
b.newSpecialInvokeExpr(local, decl().createAccessor().sootRef(), list, this),
this
)
);
return local;
}
else {
b.setLine(this);
b.add(
b.newInvokeStmt(
b.newSpecialInvokeExpr(local, decl().sootRef(), list, this),
this
)
);
return local;
}
}
/**
* @ast method
* @aspect EmitJimpleRefinements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/SootJastAddJ/EmitJimpleRefinements.jrag:231
*/
public void collectTypesToSignatures(Collection<Type> set) {
super.collectTypesToSignatures(set);
addDependencyIfNeeded(set, decl().erasedConstructor().hostType());
}
/**
* @ast method
*
*/
public ClassInstanceExpr() {
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[3];
setChild(new List(), 1);
setChild(new Opt(), 2);
}
/**
* @ast method
*
*/
public ClassInstanceExpr(Access p0, List<Expr> p1, Opt<TypeDecl> p2) {
setChild(p0, 0);
setChild(p1, 1);
setChild(p2, 2);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Access child.
* @apilevel low-level
* @ast method
*
*/
public Access getAccessNoTransform() {
return (Access)getChildNoTransform(0);
}
/**
* Replaces the Arg list.
* @param list The new list node to be used as the Arg list.
* @apilevel high-level
* @ast method
*
*/
public void setArgList(List<Expr> list) {
setChild(list, 1);
}
/**
* Retrieves the number of children in the Arg list.
* @return Number of children in the Arg list.
* @apilevel high-level
* @ast method
*
*/
public int getNumArg() {
return getArgList().getNumChild();
}
/**
* Retrieves the number of children in the Arg list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Arg list.
* @apilevel low-level
* @ast method
*
*/
public int getNumArgNoTransform() {
return getArgListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Arg list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Arg list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Expr getArg(int i) {
return (Expr)getArgList().getChild(i);
}
/**
* Append an element to the Arg list.
* @param node The element to append to the Arg list.
* @apilevel high-level
* @ast method
*
*/
public void addArg(Expr node) {
List<Expr> list = (parent == null || state == null) ? getArgListNoTransform() : getArgList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addArgNoTransform(Expr node) {
List<Expr> list = getArgListNoTransform();
list.addChild(node);
}
/**
* Replaces the Arg 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 setArg(Expr node, int i) {
List<Expr> list = getArgList();
list.setChild(node, i);
}
/**
* Retrieves the Arg list.
* @return The node representing the Arg list.
* @apilevel high-level
* @ast method
*
*/
public List<Expr> getArgs() {
return getArgList();
}
/**
* Retrieves the Arg list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Arg list.
* @apilevel low-level
* @ast method
*
*/
public List<Expr> getArgsNoTransform() {
return getArgListNoTransform();
}
/**
* Retrieves the Arg list.
* @return The node representing the Arg list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Expr> getArgList() {
List<Expr> list = (List<Expr>)getChild(1);
list.getNumChild();
return list;
}
/**
* Retrieves the Arg list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Arg list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Expr> getArgListNoTransform() {
return (List<Expr>)getChildNoTransform(1);
}
/**
* Replaces the optional node for the TypeDecl child. This is the {@code Opt} node containing the child TypeDecl, not the actual child!
* @param opt The new node to be used as the optional node for the TypeDecl child.
* @apilevel low-level
* @ast method
*
*/
public void setTypeDeclOpt(Opt<TypeDecl> opt) {
setChild(opt, 2);
}
/**
* Check whether the optional TypeDecl child exists.
* @return {@code true} if the optional TypeDecl child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasTypeDecl() {
return getTypeDeclOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) TypeDecl child.
* @return The TypeDecl child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl getTypeDecl() {
return (TypeDecl)getTypeDeclOpt().getChild(0);
}
/**
* Replaces the (optional) TypeDecl child.
* @param node The new node to be used as the TypeDecl child.
* @apilevel high-level
* @ast method
*
*/
public void setTypeDecl(TypeDecl node) {
getTypeDeclOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<TypeDecl> getTypeDeclOpt() {
return (Opt<TypeDecl>)getChild(2);
}
/**
* Retrieves the optional node for child TypeDecl. This is the {@code Opt} node containing the child TypeDecl, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child TypeDecl.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<TypeDecl> getTypeDeclOptNoTransform() {
return (Opt<TypeDecl>)getChildNoTransform(2);
}
/**
* @ast method
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:19
*/
public void nameCheck() {
if(getAccess().type().isEnumDecl() && !enclosingBodyDecl().isEnumConstant())
error("enum types may not be instantiated explicitly");
else
refined_NameCheck_ClassInstanceExpr_nameCheck();
}
/**
* @ast method
* @aspect VariableArityParametersCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/VariableArityParametersCodegen.jrag:36
*/
public void transformation() {
if(decl().isVariableArity() && !invokesVariableArityAsArray()) {
// arguments to normal parameters
List list = new List();
for(int i = 0; i < decl().getNumParameter() - 1; i++)
list.add(getArg(i).fullCopy());
// arguments to variable arity parameters
List last = new List();
for(int i = decl().getNumParameter() - 1; i < getNumArg(); i++)
last.add(getArg(i).fullCopy());
// build an array holding arguments
Access typeAccess = decl().lastParameter().type().elementType().createQualifiedAccess();
for(int i = 0; i < decl().lastParameter().type().dimension(); i++)
typeAccess = new ArrayTypeAccess(typeAccess);
list.add(new ArrayCreationExpr(typeAccess, new Opt(new ArrayInit(last))));
// replace argument list with augemented argument list
setArgList(list);
}
refined_Transformations_ClassInstanceExpr_transformation();
}
protected java.util.Map isDAafterInstance_Variable_values;
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:421
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDAafterInstance(Variable v) {
Object _parameters = v;
if(isDAafterInstance_Variable_values == null) isDAafterInstance_Variable_values = new java.util.HashMap(4);
if(isDAafterInstance_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDAafterInstance_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDAafterInstance_Variable_value = isDAafterInstance_compute(v);
if(isFinal && num == state().boundariesCrossed) isDAafterInstance_Variable_values.put(_parameters, Boolean.valueOf(isDAafterInstance_Variable_value));
return isDAafterInstance_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDAafterInstance_compute(Variable v) {
if(getNumArg() == 0)
return isDAbefore(v);
return getArg(getNumArg()-1).isDAafter(v);
}
/**
* @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 isDAafterInstance(v); }
finally {
}
}
protected java.util.Map computeDAbefore_int_Variable_values;
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:428
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean computeDAbefore(int i, Variable v) {
java.util.List _parameters = new java.util.ArrayList(2);
_parameters.add(Integer.valueOf(i));
_parameters.add(v);
if(computeDAbefore_int_Variable_values == null) computeDAbefore_int_Variable_values = new java.util.HashMap(4);
if(computeDAbefore_int_Variable_values.containsKey(_parameters)) {
return ((Boolean)computeDAbefore_int_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean computeDAbefore_int_Variable_value = computeDAbefore_compute(i, v);
if(isFinal && num == state().boundariesCrossed) computeDAbefore_int_Variable_values.put(_parameters, Boolean.valueOf(computeDAbefore_int_Variable_value));
return computeDAbefore_int_Variable_value;
}
/**
* @apilevel internal
*/
private boolean computeDAbefore_compute(int i, Variable v) { return i == 0 ? isDAbefore(v) : getArg(i-1).isDAafter(v); }
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:850
*/
public boolean isDUafterInstance(Variable v) {
ASTNode$State state = state();
try {
if(getNumArg() == 0)
return isDUbefore(v);
return getArg(getNumArg()-1).isDUafter(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 isDUafterInstance(v); }
finally {
}
}
protected java.util.Map computeDUbefore_int_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:857
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean computeDUbefore(int i, Variable v) {
java.util.List _parameters = new java.util.ArrayList(2);
_parameters.add(Integer.valueOf(i));
_parameters.add(v);
if(computeDUbefore_int_Variable_values == null) computeDUbefore_int_Variable_values = new java.util.HashMap(4);
if(computeDUbefore_int_Variable_values.containsKey(_parameters)) {
return ((Boolean)computeDUbefore_int_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean computeDUbefore_int_Variable_value = computeDUbefore_compute(i, v);
if(isFinal && num == state().boundariesCrossed) computeDUbefore_int_Variable_values.put(_parameters, Boolean.valueOf(computeDUbefore_int_Variable_value));
return computeDUbefore_int_Variable_value;
}
/**
* @apilevel internal
*/
private boolean computeDUbefore_compute(int i, Variable v) { return i == 0 ? isDUbefore(v) : getArg(i-1).isDUafter(v); }
/**
* @attribute syn
* @aspect ConstructScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:50
*/
public boolean applicableAndAccessible(ConstructorDecl decl) {
ASTNode$State state = state();
try { return decl.applicable(getArgList()) && decl.accessibleFrom(hostType()) &&
(!decl.isProtected() || hasTypeDecl() || decl.hostPackage().equals(hostPackage())); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean decls_computed = false;
/**
* @apilevel internal
*/
protected SimpleSet decls_value;
/**
* @attribute syn
* @aspect MethodSignature15
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/MethodSignature.jrag:70
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet decls() {
if(decls_computed) {
return decls_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
decls_value = decls_compute();
if(isFinal && num == state().boundariesCrossed) decls_computed = true;
return decls_value;
}
/**
* @apilevel internal
*/
private SimpleSet decls_compute() {
TypeDecl typeDecl = hasTypeDecl() ? getTypeDecl() : getAccess().type();
return chooseConstructor(typeDecl.constructors(), getArgList());
}
/**
* @apilevel internal
*/
protected boolean decl_computed = false;
/**
* @apilevel internal
*/
protected ConstructorDecl decl_value;
/**
* @attribute syn
* @aspect ConstructScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:78
*/
@SuppressWarnings({"unchecked", "cast"})
public ConstructorDecl decl() {
if(decl_computed) {
return decl_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
decl_value = decl_compute();
if(isFinal && num == state().boundariesCrossed) decl_computed = true;
return decl_value;
}
/**
* @apilevel internal
*/
private ConstructorDecl decl_compute() {
SimpleSet decls = decls();
if(decls.size() == 1)
return (ConstructorDecl)decls.iterator().next();
return unknownConstructor();
}
/**
* @attribute syn
* @aspect TypeScopePropagation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:430
*/
public SimpleSet qualifiedLookupType(String name) {
ASTNode$State state = state();
try {
SimpleSet c = keepAccessibleTypes(type().memberTypes(name));
if(!c.isEmpty())
return c;
if(type().name().equals(name))
return SimpleSet.emptySet.add(type());
return SimpleSet.emptySet;
}
finally {
}
}
protected java.util.Map localLookupType_String_values;
/**
* @attribute syn
* @aspect TypeScopePropagation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:472
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet localLookupType(String name) {
Object _parameters = name;
if(localLookupType_String_values == null) localLookupType_String_values = new java.util.HashMap(4);
if(localLookupType_String_values.containsKey(_parameters)) {
return (SimpleSet)localLookupType_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet localLookupType_String_value = localLookupType_compute(name);
if(isFinal && num == state().boundariesCrossed) localLookupType_String_values.put(_parameters, localLookupType_String_value);
return localLookupType_String_value;
}
/**
* @apilevel internal
*/
private SimpleSet localLookupType_compute(String name) {
if(hasTypeDecl() && getTypeDecl().name().equals(name))
return SimpleSet.emptySet.add(getTypeDecl());
return SimpleSet.emptySet;
}
/**
* @attribute syn
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:135
*/
public boolean validArgs() {
ASTNode$State state = state();
try {
for(int i = 0; i < getNumArg(); i++)
if(getArg(i).type().isUnknown())
return false;
return true;
}
finally {
}
}
/**
* @attribute syn
* @aspect SyntacticClassification
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:56
*/
public NameType predNameType() {
ASTNode$State state = state();
try { return NameType.EXPRESSION_NAME; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean type_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl type_value;
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:311
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl type() {
if(type_computed) {
return type_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
type_value = type_compute();
if(isFinal && num == state().boundariesCrossed) type_computed = true;
return type_value;
}
/**
* @apilevel internal
*/
private TypeDecl type_compute() { return hasTypeDecl() ? getTypeDecl() : getAccess().type(); }
/**
* @attribute syn
* @aspect TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:519
*/
public boolean noEnclosingInstance() {
ASTNode$State state = state();
try { return isQualified() ? qualifier().staticContextQualifier() : inStaticContext(); }
finally {
}
}
/**
* @attribute syn
* @aspect MethodSignature15
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/MethodSignature.jrag:327
*/
public int arity() {
ASTNode$State state = state();
try { return getNumArg(); }
finally {
}
}
/**
* @attribute syn
* @aspect VariableArityParameters
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/VariableArityParameters.jrag:54
*/
public boolean invokesVariableArityAsArray() {
ASTNode$State state = state();
try {
if(!decl().isVariableArity())
return false;
if(arity() != decl().arity())
return false;
return getArg(getNumArg()-1).type().methodInvocationConversionTo(decl().lastParameter().type());
}
finally {
}
}
/**
* @attribute inh
* @aspect ExceptionHandling
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:52
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean handlesException(TypeDecl exceptionType) {
ASTNode$State state = state();
boolean handlesException_TypeDecl_value = getParent().Define_boolean_handlesException(this, null, exceptionType);
return handlesException_TypeDecl_value;
}
/**
* @attribute inh
* @aspect ConstructScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:27
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl typeObject() {
ASTNode$State state = state();
TypeDecl typeObject_value = getParent().Define_TypeDecl_typeObject(this, null);
return typeObject_value;
}
/**
* @attribute inh
* @aspect ConstructScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:84
*/
@SuppressWarnings({"unchecked", "cast"})
public ConstructorDecl unknownConstructor() {
ASTNode$State state = state();
ConstructorDecl unknownConstructor_value = getParent().Define_ConstructorDecl_unknownConstructor(this, null);
return unknownConstructor_value;
}
/**
* @attribute inh
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:351
*/
@SuppressWarnings({"unchecked", "cast"})
public String typeDeclIndent() {
ASTNode$State state = state();
String typeDeclIndent_value = getParent().Define_String_typeDeclIndent(this, null);
return typeDeclIndent_value;
}
/**
* @attribute inh
* @aspect TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:504
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl enclosingInstance() {
ASTNode$State state = state();
TypeDecl enclosingInstance_value = getParent().Define_TypeDecl_enclosingInstance(this, null);
return enclosingInstance_value;
}
/**
* @attribute inh
* @aspect TypeHierarchyCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:126
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean inExplicitConstructorInvocation() {
ASTNode$State state = state();
boolean inExplicitConstructorInvocation_value = getParent().Define_boolean_inExplicitConstructorInvocation(this, null);
return inExplicitConstructorInvocation_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AnonymousClasses.jrag:15
* @apilevel internal
*/
public TypeDecl Define_TypeDecl_superType(ASTNode caller, ASTNode child) {
if(caller == getTypeDeclOptNoTransform()) {
return getAccess().type();
}
else { return getParent().Define_TypeDecl_superType(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/MethodSignature.jrag:83
* @apilevel internal
*/
public ConstructorDecl Define_ConstructorDecl_constructorDecl(ASTNode caller, ASTNode child) {
if(caller == getTypeDeclOptNoTransform()){
Collection c = getAccess().type().constructors();
SimpleSet maxSpecific = chooseConstructor(c, getArgList());
if(maxSpecific.size() == 1)
return (ConstructorDecl)maxSpecific.iterator().next();
return unknownConstructor();
}
else { return getParent().Define_ConstructorDecl_constructorDecl(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:430
* @apilevel internal
*/
public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) {
if(caller == getTypeDeclOptNoTransform()) {
return isDAafterInstance(v);
}
else if(caller == getArgListNoTransform()) {
int i = caller.getIndexOfChild(child);
return computeDAbefore(i, v);
}
else { return getParent().Define_boolean_isDAbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:856
* @apilevel internal
*/
public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) {
if(caller == getArgListNoTransform()) {
int i = caller.getIndexOfChild(child);
return computeDUbefore(i, v);
}
else { return getParent().Define_boolean_isDUbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:92
* @apilevel internal
*/
public boolean Define_boolean_hasPackage(ASTNode caller, ASTNode child, String packageName) {
if(caller == getArgListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
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:404
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_lookupType(ASTNode caller, ASTNode child, String name) {
if(caller == getTypeDeclOptNoTransform()){
SimpleSet c = localLookupType(name);
if(!c.isEmpty())
return c;
c = lookupType(name);
if(!c.isEmpty())
return c;
return unqualifiedScope().lookupType(name);
}
else if(caller == getAccessNoTransform()){
SimpleSet c = lookupType(name);
if(c.size() == 1) {
if(isQualified())
c = keepInnerClasses(c);
}
return c;
}
else if(caller == getArgListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
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:137
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) {
if(caller == getArgListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
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:127
* @apilevel internal
*/
public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {
if(caller == getArgListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return NameType.EXPRESSION_NAME;
}
else if(caller == getTypeDeclOptNoTransform()) {
return NameType.TYPE_NAME;
}
else if(caller == getAccessNoTransform()) {
return NameType.TYPE_NAME;
}
else { return getParent().Define_NameType_nameType(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:217
* @apilevel internal
*/
public boolean Define_boolean_isAnonymous(ASTNode caller, ASTNode child) {
if(caller == getTypeDeclOptNoTransform()) {
return true;
}
else { return getParent().Define_boolean_isAnonymous(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:530
* @apilevel internal
*/
public boolean Define_boolean_isMemberType(ASTNode caller, ASTNode child) {
if(caller == getTypeDeclOptNoTransform()) {
return false;
}
else { return getParent().Define_boolean_isMemberType(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:576
* @apilevel internal
*/
public TypeDecl Define_TypeDecl_hostType(ASTNode caller, ASTNode child) {
if(caller == getTypeDeclOptNoTransform()) {
return hostType();
}
else { return getParent().Define_TypeDecl_hostType(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:147
* @apilevel internal
*/
public boolean Define_boolean_inStaticContext(ASTNode caller, ASTNode child) {
if(caller == getTypeDeclOptNoTransform()) {
return isQualified() ?
qualifier().staticContextQualifier() : inStaticContext();
}
else { return getParent().Define_boolean_inStaticContext(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:69
* @apilevel internal
*/
public ClassInstanceExpr Define_ClassInstanceExpr_getClassInstanceExpr(ASTNode caller, ASTNode child) {
if(caller == getAccessNoTransform()) {
return this;
}
else { return getParent().Define_ClassInstanceExpr_getClassInstanceExpr(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:457
* @apilevel internal
*/
public boolean Define_boolean_isAnonymousDecl(ASTNode caller, ASTNode child) {
if(caller == getAccessNoTransform()) {
return hasTypeDecl();
}
else { return getParent().Define_boolean_isAnonymousDecl(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 45,999
| 32.309196
| 199
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/CompilationUnit.java
|
/* 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 CompilationUnit : {@link ASTNode} ::= <span class="component"><PackageDecl:java.lang.String></span> <span class="component">{@link ImportDecl}*</span> <span class="component">{@link TypeDecl}*</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:4
*/
public class CompilationUnit extends ASTNode<ASTNode> implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
packageName_computed = false;
packageName_value = null;
lookupType_String_values = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public CompilationUnit clone() throws CloneNotSupportedException {
CompilationUnit node = (CompilationUnit)super.clone();
node.packageName_computed = false;
node.packageName_value = null;
node.lookupType_String_values = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public CompilationUnit copy() {
try {
CompilationUnit node = (CompilationUnit) 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 CompilationUnit fullCopy() {
CompilationUnit tree = (CompilationUnit) 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 ClassPath
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ClassPath.jrag:159
*/
private String relativeName;
/**
* @ast method
* @aspect ClassPath
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ClassPath.jrag:160
*/
private String pathName;
/**
* @ast method
* @aspect ClassPath
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ClassPath.jrag:161
*/
private boolean fromSource;
/**
* @ast method
* @aspect ClassPath
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ClassPath.jrag:163
*/
public void setRelativeName(String name) {
relativeName = name;
}
/**
* @ast method
* @aspect ClassPath
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ClassPath.jrag:166
*/
public void setPathName(String name) {
pathName = name;
}
/**
* @ast method
* @aspect ClassPath
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ClassPath.jrag:169
*/
public void setFromSource(boolean value) {
fromSource = value;
}
/**
* @ast method
* @aspect ErrorCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:65
*/
protected java.util.ArrayList errors = new java.util.ArrayList();
/**
* @ast method
* @aspect ErrorCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:66
*/
protected java.util.ArrayList warnings = new java.util.ArrayList();
/**
* @ast method
* @aspect ErrorCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:68
*/
public Collection parseErrors() { return parseErrors; }
/**
* @ast method
* @aspect ErrorCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:69
*/
public void addParseError(Problem msg) { parseErrors.add(msg); }
/**
* @ast method
* @aspect ErrorCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:70
*/
protected Collection parseErrors = new ArrayList();
/**
* @ast method
* @aspect ErrorCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:228
*/
public void errorCheck(Collection collection) {
collectErrors();
collection.addAll(errors);
}
/**
* @ast method
* @aspect ErrorCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:232
*/
public void errorCheck(Collection err, Collection warn) {
collectErrors();
err.addAll(errors);
warn.addAll(warnings);
}
/**
* @ast method
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:35
*/
public void refined_NameCheck_CompilationUnit_nameCheck() {
for(int i = 0; i < getNumImportDecl(); i++) {
ImportDecl decl = getImportDecl(i);
if(decl instanceof SingleTypeImportDecl) {
TypeDecl importedType = decl.getAccess().type();
Iterator iter = localLookupType(importedType.name()).iterator();
while (iter.hasNext()) {
TypeDecl local = (TypeDecl) iter.next();
if (local != importedType)
error("imported type " + decl + " is conflicting with visible type");
}
}
}
}
/**
* @ast method
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:32
*/
public void toString(StringBuffer s) {
try {
if(!getPackageDecl().equals("")) {
s.append("package " + getPackageDecl() + ";\n");
}
for(int i = 0; i < getNumImportDecl(); i++) {
getImportDecl(i).toString(s);
}
for(int i = 0; i < getNumTypeDecl(); i++) {
getTypeDecl(i).toString(s);
s.append("\n");
}
} catch (NullPointerException e) {
System.out.print("Error in compilation unit hosting " + getTypeDecl(0).typeName());
throw e;
}
}
/**
* @ast method
* @aspect Transformations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Transformations.jrag:18
*/
public void transformation() {
if(fromSource()) {
for(int i = 0; i < getNumTypeDecl(); i++) {
getTypeDecl(i).transformation();
}
}
}
/**
* @ast method
* @aspect ClassLoading
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/SootJastAddJ/ClassLoading.jrag:12
*/
public boolean isResolved = false;
/**
* @ast method
*
*/
public CompilationUnit() {
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(), 0);
setChild(new List(), 1);
}
/**
* @ast method
*
*/
public CompilationUnit(java.lang.String p0, List<ImportDecl> p1, List<TypeDecl> p2) {
setPackageDecl(p0);
setChild(p1, 0);
setChild(p2, 1);
}
/**
* @ast method
*
*/
public CompilationUnit(beaver.Symbol p0, List<ImportDecl> p1, List<TypeDecl> p2) {
setPackageDecl(p0);
setChild(p1, 0);
setChild(p2, 1);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 2;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the lexeme PackageDecl.
* @param value The new value for the lexeme PackageDecl.
* @apilevel high-level
* @ast method
*
*/
public void setPackageDecl(java.lang.String value) {
tokenjava_lang_String_PackageDecl = value;
}
/**
* @apilevel internal
* @ast method
*
*/
/**
* @apilevel internal
*/
protected java.lang.String tokenjava_lang_String_PackageDecl;
/**
* @ast method
*
*/
public int PackageDeclstart;
/**
* @ast method
*
*/
public int PackageDeclend;
/**
* JastAdd-internal setter for lexeme PackageDecl using the Beaver parser.
* @apilevel internal
* @ast method
*
*/
public void setPackageDecl(beaver.Symbol symbol) {
if(symbol.value != null && !(symbol.value instanceof String))
throw new UnsupportedOperationException("setPackageDecl is only valid for String lexemes");
tokenjava_lang_String_PackageDecl = (String)symbol.value;
PackageDeclstart = symbol.getStart();
PackageDeclend = symbol.getEnd();
}
/**
* Retrieves the value for the lexeme PackageDecl.
* @return The value for the lexeme PackageDecl.
* @apilevel high-level
* @ast method
*
*/
public java.lang.String getPackageDecl() {
return tokenjava_lang_String_PackageDecl != null ? tokenjava_lang_String_PackageDecl : "";
}
/**
* Replaces the ImportDecl list.
* @param list The new list node to be used as the ImportDecl list.
* @apilevel high-level
* @ast method
*
*/
public void setImportDeclList(List<ImportDecl> list) {
setChild(list, 0);
}
/**
* Retrieves the number of children in the ImportDecl list.
* @return Number of children in the ImportDecl list.
* @apilevel high-level
* @ast method
*
*/
public int getNumImportDecl() {
return getImportDeclList().getNumChild();
}
/**
* Retrieves the number of children in the ImportDecl list.
* Calling this method will not trigger rewrites..
* @return Number of children in the ImportDecl list.
* @apilevel low-level
* @ast method
*
*/
public int getNumImportDeclNoTransform() {
return getImportDeclListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the ImportDecl list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the ImportDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public ImportDecl getImportDecl(int i) {
return (ImportDecl)getImportDeclList().getChild(i);
}
/**
* Append an element to the ImportDecl list.
* @param node The element to append to the ImportDecl list.
* @apilevel high-level
* @ast method
*
*/
public void addImportDecl(ImportDecl node) {
List<ImportDecl> list = (parent == null || state == null) ? getImportDeclListNoTransform() : getImportDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addImportDeclNoTransform(ImportDecl node) {
List<ImportDecl> list = getImportDeclListNoTransform();
list.addChild(node);
}
/**
* Replaces the ImportDecl 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 setImportDecl(ImportDecl node, int i) {
List<ImportDecl> list = getImportDeclList();
list.setChild(node, i);
}
/**
* Retrieves the ImportDecl list.
* @return The node representing the ImportDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<ImportDecl> getImportDecls() {
return getImportDeclList();
}
/**
* Retrieves the ImportDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the ImportDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<ImportDecl> getImportDeclsNoTransform() {
return getImportDeclListNoTransform();
}
/**
* Retrieves the ImportDecl list.
* @return The node representing the ImportDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<ImportDecl> getImportDeclList() {
List<ImportDecl> list = (List<ImportDecl>)getChild(0);
list.getNumChild();
return list;
}
/**
* Retrieves the ImportDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the ImportDecl list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<ImportDecl> getImportDeclListNoTransform() {
return (List<ImportDecl>)getChildNoTransform(0);
}
/**
* Replaces the TypeDecl list.
* @param list The new list node to be used as the TypeDecl list.
* @apilevel high-level
* @ast method
*
*/
public void setTypeDeclList(List<TypeDecl> list) {
setChild(list, 1);
}
/**
* Retrieves the number of children in the TypeDecl list.
* @return Number of children in the TypeDecl list.
* @apilevel high-level
* @ast method
*
*/
public int getNumTypeDecl() {
return getTypeDeclList().getNumChild();
}
/**
* Retrieves the number of children in the TypeDecl list.
* Calling this method will not trigger rewrites..
* @return Number of children in the TypeDecl list.
* @apilevel low-level
* @ast method
*
*/
public int getNumTypeDeclNoTransform() {
return getTypeDeclListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the TypeDecl list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the TypeDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl getTypeDecl(int i) {
return (TypeDecl)getTypeDeclList().getChild(i);
}
/**
* Append an element to the TypeDecl list.
* @param node The element to append to the TypeDecl list.
* @apilevel high-level
* @ast method
*
*/
public void addTypeDecl(TypeDecl node) {
List<TypeDecl> list = (parent == null || state == null) ? getTypeDeclListNoTransform() : getTypeDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addTypeDeclNoTransform(TypeDecl node) {
List<TypeDecl> list = getTypeDeclListNoTransform();
list.addChild(node);
}
/**
* Replaces the TypeDecl 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 setTypeDecl(TypeDecl node, int i) {
List<TypeDecl> list = getTypeDeclList();
list.setChild(node, i);
}
/**
* Retrieves the TypeDecl list.
* @return The node representing the TypeDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<TypeDecl> getTypeDecls() {
return getTypeDeclList();
}
/**
* Retrieves the TypeDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<TypeDecl> getTypeDeclsNoTransform() {
return getTypeDeclListNoTransform();
}
/**
* Retrieves the TypeDecl list.
* @return The node representing the TypeDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<TypeDecl> getTypeDeclList() {
List<TypeDecl> list = (List<TypeDecl>)getChild(1);
list.getNumChild();
return list;
}
/**
* Retrieves the TypeDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeDecl list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<TypeDecl> getTypeDeclListNoTransform() {
return (List<TypeDecl>)getChildNoTransform(1);
}
/**
* @ast method
* @aspect StaticImports
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/StaticImports.jrag:181
*/
public void nameCheck() {
refined_NameCheck_CompilationUnit_nameCheck();
for(int i = 0; i < getNumImportDecl(); i++) {
if(getImportDecl(i) instanceof SingleStaticImportDecl) {
SingleStaticImportDecl decl = (SingleStaticImportDecl)getImportDecl(i);
String name = decl.name();
if(!decl.importedTypes(name).isEmpty()) {
TypeDecl type = (TypeDecl)decl.importedTypes(name).iterator().next();
if(localLookupType(name).contains(type))
decl.error(packageName() + "." + name + " is already defined in this compilation unit");
}
}
}
}
/**
* @ast method
* @aspect TypeScopePropagation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:270
*/
private SimpleSet refined_TypeScopePropagation_CompilationUnit_Child_lookupType_String(String name)
{
// locally declared types in compilation unit
SimpleSet set = localLookupType(name);
if(!set.isEmpty()) return set;
// imported types
set = importedTypes(name);
if(!set.isEmpty()) return set;
// types in the same package
TypeDecl result = lookupType(packageName(), name);
if(result != null && result.accessibleFromPackage(packageName()))
return SimpleSet.emptySet.add(result);
// types imported on demand
set = importedTypesOnDemand(name);
if(!set.isEmpty()) return set;
// include primitive types
result = lookupType(PRIMITIVE_PACKAGE_NAME, name);
if(result != null) return SimpleSet.emptySet.add(result);
// 7.5.5 Automatic Imports
result = lookupType("java.lang", name);
if(result != null && result.accessibleFromPackage(packageName()))
return SimpleSet.emptySet.add(result);
return lookupType(name);
}
/**
* @attribute syn
* @aspect ClassPath
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ClassPath.jrag:27
*/
public String relativeName() {
ASTNode$State state = state();
try { return relativeName; }
finally {
}
}
/**
* @attribute syn
* @aspect ClassPath
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ClassPath.jrag:28
*/
public String pathName() {
ASTNode$State state = state();
try { return pathName; }
finally {
}
}
/**
* @attribute syn
* @aspect ClassPath
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ClassPath.jrag:29
*/
public boolean fromSource() {
ASTNode$State state = state();
try { return fromSource; }
finally {
}
}
/**
* @attribute syn
* @aspect TypeScopePropagation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:299
*/
public SimpleSet localLookupType(String name) {
ASTNode$State state = state();
try {
for(int i = 0; i < getNumTypeDecl(); i++)
if(getTypeDecl(i).name().equals(name))
return SimpleSet.emptySet.add(getTypeDecl(i));
return SimpleSet.emptySet;
}
finally {
}
}
/**
* @attribute syn
* @aspect TypeScopePropagation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:306
*/
public SimpleSet importedTypes(String name) {
ASTNode$State state = state();
try {
SimpleSet set = SimpleSet.emptySet;
for(int i = 0; i < getNumImportDecl(); i++)
if(!getImportDecl(i).isOnDemand())
for(Iterator iter = getImportDecl(i).importedTypes(name).iterator(); iter.hasNext(); )
set = set.add(iter.next());
return set;
}
finally {
}
}
/**
* @attribute syn
* @aspect TypeScopePropagation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:314
*/
public SimpleSet importedTypesOnDemand(String name) {
ASTNode$State state = state();
try {
SimpleSet set = SimpleSet.emptySet;
for(int i = 0; i < getNumImportDecl(); i++)
if(getImportDecl(i).isOnDemand())
for(Iterator iter = getImportDecl(i).importedTypes(name).iterator(); iter.hasNext(); )
set = set.add(iter.next());
return set;
}
finally {
}
}
/**
* @attribute syn
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:800
*/
public String dumpString() {
ASTNode$State state = state();
try { return getClass().getName() + " [" + getPackageDecl() + "]"; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean packageName_computed = false;
/**
* @apilevel internal
*/
protected String packageName_value;
/**
* @attribute syn
* @aspect TypeName
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/QualifiedNames.jrag:92
*/
@SuppressWarnings({"unchecked", "cast"})
public String packageName() {
if(packageName_computed) {
return packageName_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
packageName_value = packageName_compute();
if(isFinal && num == state().boundariesCrossed) packageName_computed = true;
return packageName_value;
}
/**
* @apilevel internal
*/
private String packageName_compute() {return getPackageDecl();}
/**
* @attribute syn
* @aspect StaticImports
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/StaticImports.jrag:112
*/
public SimpleSet importedFields(String name) {
ASTNode$State state = state();
try {
SimpleSet set = SimpleSet.emptySet;
for(int i = 0; i < getNumImportDecl(); i++)
if(!getImportDecl(i).isOnDemand())
for(Iterator iter = getImportDecl(i).importedFields(name).iterator(); iter.hasNext(); )
set = set.add(iter.next());
return set;
}
finally {
}
}
/**
* @attribute syn
* @aspect StaticImports
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/StaticImports.jrag:120
*/
public SimpleSet importedFieldsOnDemand(String name) {
ASTNode$State state = state();
try {
SimpleSet set = SimpleSet.emptySet;
for(int i = 0; i < getNumImportDecl(); i++)
if(getImportDecl(i).isOnDemand())
for(Iterator iter = getImportDecl(i).importedFields(name).iterator(); iter.hasNext(); )
set = set.add(iter.next());
return set;
}
finally {
}
}
/**
* @attribute syn
* @aspect StaticImports
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/StaticImports.jrag:141
*/
public Collection importedMethods(String name) {
ASTNode$State state = state();
try {
Collection list = new ArrayList();
for(int i = 0; i < getNumImportDecl(); i++)
if(!getImportDecl(i).isOnDemand())
list.addAll(getImportDecl(i).importedMethods(name));
return list;
}
finally {
}
}
/**
* @attribute syn
* @aspect StaticImports
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/StaticImports.jrag:148
*/
public Collection importedMethodsOnDemand(String name) {
ASTNode$State state = state();
try {
Collection list = new ArrayList();
for(int i = 0; i < getNumImportDecl(); i++)
if(getImportDecl(i).isOnDemand())
list.addAll(getImportDecl(i).importedMethods(name));
return list;
}
finally {
}
}
/**
* @attribute inh
* @aspect LookupFullyQualifiedTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:99
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl lookupType(String packageName, String typeName) {
ASTNode$State state = state();
TypeDecl lookupType_String_String_value = getParent().Define_TypeDecl_lookupType(this, null, packageName, typeName);
return lookupType_String_String_value;
}
protected java.util.Map lookupType_String_values;
/**
* @attribute inh
* @aspect TypeScopePropagation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:259
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet lookupType(String name) {
Object _parameters = name;
if(lookupType_String_values == null) lookupType_String_values = new java.util.HashMap(4);
if(lookupType_String_values.containsKey(_parameters)) {
return (SimpleSet)lookupType_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet lookupType_String_value = getParent().Define_SimpleSet_lookupType(this, null, name);
if(isFinal && num == state().boundariesCrossed) lookupType_String_values.put(_parameters, lookupType_String_value);
return lookupType_String_value;
}
/**
* @attribute inh
* @aspect StaticImports
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/StaticImports.jrag:111
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet lookupVariable(String name) {
ASTNode$State state = state();
SimpleSet lookupVariable_String_value = getParent().Define_SimpleSet_lookupVariable(this, null, name);
return lookupVariable_String_value;
}
/**
* @attribute inh
* @aspect StaticImports
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/StaticImports.jrag:140
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection lookupMethod(String name) {
ASTNode$State state = state();
Collection lookupMethod_String_value = getParent().Define_Collection_lookupMethod(this, null, name);
return lookupMethod_String_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ClassPath.jrag:32
* @apilevel internal
*/
public CompilationUnit Define_CompilationUnit_compilationUnit(ASTNode caller, ASTNode child) {
{
int childIndex = this.getIndexOfChild(caller);
return this;
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:51
* @apilevel internal
*/
public boolean Define_boolean_isIncOrDec(ASTNode caller, ASTNode child) {
if(caller == getTypeDeclListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return false;
}
else { return getParent().Define_boolean_isIncOrDec(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/StaticImports.jrag:198
* @apilevel internal
*/
public boolean Define_boolean_handlesException(ASTNode caller, ASTNode child, TypeDecl exceptionType) {
if(caller == getImportDeclListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
{
return !exceptionType.isUncheckedException();
}
}
else if(caller == getTypeDeclListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return !exceptionType.isUncheckedException();
}
else { return getParent().Define_boolean_handlesException(this, caller, exceptionType);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:355
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_lookupType(ASTNode caller, ASTNode child, String name) {
if(caller == getImportDeclListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return lookupType(name);
}
else {
int childIndex = this.getIndexOfChild(caller);
{
SimpleSet result = SimpleSet.emptySet;
for(Iterator iter = refined_TypeScopePropagation_CompilationUnit_Child_lookupType_String(name).iterator(); iter.hasNext(); ) {
TypeDecl typeDecl = (TypeDecl)iter.next();
if(typeDecl instanceof ParTypeDecl)
result = result.add(((ParTypeDecl)typeDecl).genericDecl());
else
result = result.add(typeDecl);
}
return result;
}
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:27
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_allImportedTypes(ASTNode caller, ASTNode child, String name) {
if(caller == getImportDeclListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return importedTypes(name);
}
else { return getParent().Define_SimpleSet_allImportedTypes(this, caller, name);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/QualifiedNames.jrag:90
* @apilevel internal
*/
public String Define_String_packageName(ASTNode caller, ASTNode child) {
{
int childIndex = this.getIndexOfChild(caller);
return packageName();
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:69
* @apilevel internal
*/
public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {
if(caller == getImportDeclListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return NameType.PACKAGE_NAME;
}
else { return getParent().Define_NameType_nameType(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:493
* @apilevel internal
*/
public TypeDecl Define_TypeDecl_enclosingType(ASTNode caller, ASTNode child) {
{
int childIndex = this.getIndexOfChild(caller);
return null;
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:519
* @apilevel internal
*/
public boolean Define_boolean_isNestedType(ASTNode caller, ASTNode child) {
{
int childIndex = this.getIndexOfChild(caller);
return false;
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:529
* @apilevel internal
*/
public boolean Define_boolean_isMemberType(ASTNode caller, ASTNode child) {
if(caller == getTypeDeclListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return false;
}
else { return getParent().Define_boolean_isMemberType(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:541
* @apilevel internal
*/
public boolean Define_boolean_isLocalClass(ASTNode caller, ASTNode child) {
{
int childIndex = this.getIndexOfChild(caller);
return false;
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:563
* @apilevel internal
*/
public String Define_String_hostPackage(ASTNode caller, ASTNode child) {
{
int childIndex = this.getIndexOfChild(caller);
return packageName();
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:583
* @apilevel internal
*/
public TypeDecl Define_TypeDecl_hostType(ASTNode caller, ASTNode child) {
if(caller == getImportDeclListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return null;
}
else { return getParent().Define_TypeDecl_hostType(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/StaticImports.jrag:104
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) {
if(caller == getTypeDeclListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
{
SimpleSet set = importedFields(name);
if(!set.isEmpty()) return set;
set = importedFieldsOnDemand(name);
if(!set.isEmpty()) return set;
return lookupVariable(name);
}
}
else { return getParent().Define_SimpleSet_lookupVariable(this, caller, name);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/StaticImports.jrag:133
* @apilevel internal
*/
public Collection Define_Collection_lookupMethod(ASTNode caller, ASTNode child, String name) {
if(caller == getTypeDeclListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
{
Collection list = importedMethods(name);
if(!list.isEmpty()) return list;
list = importedMethodsOnDemand(name);
if(!list.isEmpty()) return list;
return lookupMethod(name);
}
}
else { return getParent().Define_Collection_lookupMethod(this, caller, name);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 34,114
| 29.706571
| 221
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ConditionalExpr.java
|
/* 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 ConditionalExpr : {@link Expr} ::= <span class="component">Condition:{@link Expr}</span> <span class="component">TrueExpr:{@link Expr}</span> <span class="component">FalseExpr:{@link Expr}</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:188
*/
public class ConditionalExpr extends Expr implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
constant_computed = false;
constant_value = null;
isConstant_computed = false;
booleanOperator_computed = false;
type_computed = false;
type_value = null;
else_branch_label_computed = false;
else_branch_label_value = null;
then_branch_label_computed = false;
then_branch_label_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ConditionalExpr clone() throws CloneNotSupportedException {
ConditionalExpr node = (ConditionalExpr)super.clone();
node.constant_computed = false;
node.constant_value = null;
node.isConstant_computed = false;
node.booleanOperator_computed = false;
node.type_computed = false;
node.type_value = null;
node.else_branch_label_computed = false;
node.else_branch_label_value = null;
node.then_branch_label_computed = false;
node.then_branch_label_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ConditionalExpr copy() {
try {
ConditionalExpr node = (ConditionalExpr) 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 ConditionalExpr fullCopy() {
ConditionalExpr tree = (ConditionalExpr) 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:427
*/
public void toString(StringBuffer s) {
getCondition().toString(s);
s.append(" ? ");
getTrueExpr().toString(s);
s.append(" : ");
getFalseExpr().toString(s);
}
/**
* @ast method
* @aspect TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:562
*/
public void typeCheck() {
if(!getCondition().type().isBoolean())
error("The first operand of a conditional expression must be a boolean");
if(type().isUnknown() && !getTrueExpr().type().isUnknown() && !getFalseExpr().type().isUnknown()) {
error("The types of the second and third operand in this conditional expression do not match");
}
}
/**
* @ast method
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:119
*/
public soot.Value eval(Body b) {
b.setLine(this);
if(type().isBoolean())
return emitBooleanCondition(b);
else {
Local result = b.newTemp(type().getSootType());
soot.jimple.Stmt endBranch = newLabel();
getCondition().emitEvalBranch(b);
if(getCondition().canBeTrue()) {
b.addLabel(then_branch_label());
b.add(b.newAssignStmt(result,
getTrueExpr().type().emitCastTo(b,
getTrueExpr(),
type()
),
this
));
if(getCondition().canBeFalse()) {
b.add(b.newGotoStmt(endBranch, this));
}
}
if(getCondition().canBeFalse()) {
b.addLabel(else_branch_label());
b.add(b.newAssignStmt(result,
getFalseExpr().type().emitCastTo(b,
getFalseExpr(),
type()
),
this
));
}
b.addLabel(endBranch);
return result;
}
}
/**
* @ast method
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:209
*/
public void emitEvalBranch(Body b) {
b.setLine(this);
soot.jimple.Stmt endBranch = newLabel();
getCondition().emitEvalBranch(b);
b.addLabel(then_branch_label());
if(getCondition().canBeTrue()) {
getTrueExpr().emitEvalBranch(b);
b.add(b.newGotoStmt(true_label(), this));
}
b.addLabel(else_branch_label());
if(getCondition().canBeFalse()) {
getFalseExpr().emitEvalBranch(b);
b.add(b.newGotoStmt(true_label(), this));
}
}
/**
* @ast method
*
*/
public ConditionalExpr() {
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[3];
}
/**
* @ast method
*
*/
public ConditionalExpr(Expr p0, Expr p1, Expr p2) {
setChild(p0, 0);
setChild(p1, 1);
setChild(p2, 2);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the Condition child.
* @param node The new node to replace the Condition child.
* @apilevel high-level
* @ast method
*
*/
public void setCondition(Expr node) {
setChild(node, 0);
}
/**
* Retrieves the Condition child.
* @return The current node used as the Condition child.
* @apilevel high-level
* @ast method
*
*/
public Expr getCondition() {
return (Expr)getChild(0);
}
/**
* Retrieves the Condition child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Condition child.
* @apilevel low-level
* @ast method
*
*/
public Expr getConditionNoTransform() {
return (Expr)getChildNoTransform(0);
}
/**
* Replaces the TrueExpr child.
* @param node The new node to replace the TrueExpr child.
* @apilevel high-level
* @ast method
*
*/
public void setTrueExpr(Expr node) {
setChild(node, 1);
}
/**
* Retrieves the TrueExpr child.
* @return The current node used as the TrueExpr child.
* @apilevel high-level
* @ast method
*
*/
public Expr getTrueExpr() {
return (Expr)getChild(1);
}
/**
* Retrieves the TrueExpr child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the TrueExpr child.
* @apilevel low-level
* @ast method
*
*/
public Expr getTrueExprNoTransform() {
return (Expr)getChildNoTransform(1);
}
/**
* Replaces the FalseExpr child.
* @param node The new node to replace the FalseExpr child.
* @apilevel high-level
* @ast method
*
*/
public void setFalseExpr(Expr node) {
setChild(node, 2);
}
/**
* Retrieves the FalseExpr child.
* @return The current node used as the FalseExpr child.
* @apilevel high-level
* @ast method
*
*/
public Expr getFalseExpr() {
return (Expr)getChild(2);
}
/**
* Retrieves the FalseExpr child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the FalseExpr child.
* @apilevel low-level
* @ast method
*
*/
public Expr getFalseExprNoTransform() {
return (Expr)getChildNoTransform(2);
}
/**
* @ast method
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:364
*/
private TypeDecl refined_TypeAnalysis_ConditionalExpr_type()
{
TypeDecl trueType = getTrueExpr().type();
TypeDecl falseType = getFalseExpr().type();
if(trueType == falseType) return trueType;
if(trueType.isNumericType() && falseType.isNumericType()) {
if(trueType.isByte() && falseType.isShort()) return falseType;
if(trueType.isShort() && falseType.isByte()) return trueType;
if((trueType.isByte() || trueType.isShort() || trueType.isChar()) &&
falseType.isInt() && getFalseExpr().isConstant() && getFalseExpr().representableIn(trueType))
return trueType;
if((falseType.isByte() || falseType.isShort() || falseType.isChar()) &&
trueType.isInt() && getTrueExpr().isConstant() && getTrueExpr().representableIn(falseType))
return falseType;
return trueType.binaryNumericPromotion(falseType);
}
else if(trueType.isBoolean() && falseType.isBoolean()) {
return trueType;
}
else if(trueType.isReferenceType() && falseType.isNull()) {
return trueType;
}
else if(trueType.isNull() && falseType.isReferenceType()) {
return falseType;
}
else if(trueType.isReferenceType() && falseType.isReferenceType()) {
if(trueType.assignConversionTo(falseType, null))
return falseType;
if(falseType.assignConversionTo(trueType, null))
return trueType;
return unknownType();
}
else
return unknownType();
}
/**
* @ast method
* @aspect AutoBoxing
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:181
*/
private TypeDecl refined_AutoBoxing_ConditionalExpr_type()
{
TypeDecl trueType = getTrueExpr().type();
TypeDecl falseType = getFalseExpr().type();
if(trueType.isBoolean() && falseType.isBoolean()) {
if(trueType == falseType)
return trueType;
if(trueType.isReferenceType())
return trueType.unboxed();
return trueType;
}
return refined_TypeAnalysis_ConditionalExpr_type();
}
/**
* @apilevel internal
*/
protected boolean constant_computed = false;
/**
* @apilevel internal
*/
protected Constant constant_value;
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:125
*/
@SuppressWarnings({"unchecked", "cast"})
public Constant constant() {
if(constant_computed) {
return constant_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
constant_value = constant_compute();
if(isFinal && num == state().boundariesCrossed) constant_computed = true;
return constant_value;
}
/**
* @apilevel internal
*/
private Constant constant_compute() { return type().questionColon(getCondition().constant(), getTrueExpr().constant(),getFalseExpr().constant()); }
/**
* @apilevel internal
*/
protected boolean isConstant_computed = false;
/**
* @apilevel internal
*/
protected boolean isConstant_value;
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:347
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isConstant() {
if(isConstant_computed) {
return isConstant_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
isConstant_value = isConstant_compute();
if(isFinal && num == state().boundariesCrossed) isConstant_computed = true;
return isConstant_value;
}
/**
* @apilevel internal
*/
private boolean isConstant_compute() { return getCondition().isConstant() && getTrueExpr().isConstant() && getFalseExpr().isConstant(); }
/**
* @apilevel internal
*/
protected boolean booleanOperator_computed = false;
/**
* @apilevel internal
*/
protected boolean booleanOperator_value;
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:230
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean booleanOperator() {
if(booleanOperator_computed) {
return booleanOperator_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
booleanOperator_value = booleanOperator_compute();
if(isFinal && num == state().boundariesCrossed) booleanOperator_computed = true;
return booleanOperator_value;
}
/**
* @apilevel internal
*/
private boolean booleanOperator_compute() { return getTrueExpr().type().isBoolean() && getFalseExpr().type().isBoolean(); }
/*eq Stmt.isDAafter(Variable v) {
//System.out.println("### isDAafter reached in " + getClass().getName());
//throw new NullPointerException();
throw new Error("Can not compute isDAafter for " + getClass().getName() + " at " + errorPrefix());
}* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:332
*/
public boolean isDAafterTrue(Variable v) {
ASTNode$State state = state();
try { return (getTrueExpr().isDAafterTrue(v) && getFalseExpr().isDAafterTrue(v)) || isFalse(); }
finally {
}
}
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:333
*/
public boolean isDAafterFalse(Variable v) {
ASTNode$State state = state();
try { return (getTrueExpr().isDAafterFalse(v) && getFalseExpr().isDAafterFalse(v)) || isTrue(); }
finally {
}
}
/**
* @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 booleanOperator() ? isDAafterTrue(v) && isDAafterFalse(v) : getTrueExpr().isDAafter(v) && getFalseExpr().isDAafter(v); }
finally {
}
}
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:702
*/
public boolean isDUafterTrue(Variable v) {
ASTNode$State state = state();
try { return getTrueExpr().isDUafterTrue(v) && getFalseExpr().isDUafterTrue(v); }
finally {
}
}
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:703
*/
public boolean isDUafterFalse(Variable v) {
ASTNode$State state = state();
try { return getTrueExpr().isDUafterFalse(v) && getFalseExpr().isDUafterFalse(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 booleanOperator() ? isDUafterTrue(v) && isDUafterFalse(v) : getTrueExpr().isDUafter(v) && getFalseExpr().isDUafter(v); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean type_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl type_value;
/**
* @attribute syn
* @aspect Generics
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:129
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl type() {
if(type_computed) {
return type_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
type_value = type_compute();
if(isFinal && num == state().boundariesCrossed) type_computed = true;
return type_value;
}
/**
* @apilevel internal
*/
private TypeDecl type_compute() {
TypeDecl type = refined_AutoBoxing_ConditionalExpr_type();
TypeDecl trueType = getTrueExpr().type();
TypeDecl falseType = getFalseExpr().type();
if(type.isUnknown()) {
if(!trueType.isReferenceType() && !trueType.boxed().isUnknown())
trueType = trueType.boxed();
if(!falseType.isReferenceType() && !falseType.boxed().isUnknown())
falseType = falseType.boxed();
ArrayList list = new ArrayList();
list.add(trueType);
list.add(falseType);
return type.lookupLUBType(list);
}
return type;
}
/**
* @attribute syn
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:21
*/
public boolean definesLabel() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @attribute syn
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:82
*/
public boolean canBeTrue() {
ASTNode$State state = state();
try { return type().isBoolean() && (getTrueExpr().canBeTrue() && getFalseExpr().canBeTrue()
|| getCondition().isTrue() && getTrueExpr().canBeTrue()
|| getCondition().isFalse() && getFalseExpr().canBeTrue()); }
finally {
}
}
/**
* @attribute syn
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:92
*/
public boolean canBeFalse() {
ASTNode$State state = state();
try { return type().isBoolean() && (getTrueExpr().canBeFalse() && getFalseExpr().canBeFalse()
|| getCondition().isTrue() && getTrueExpr().canBeFalse()
|| getCondition().isFalse() && getFalseExpr().canBeFalse()); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean else_branch_label_computed = false;
/**
* @apilevel internal
*/
protected soot.jimple.Stmt else_branch_label_value;
/**
* @attribute syn
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:155
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt else_branch_label() {
if(else_branch_label_computed) {
return else_branch_label_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
else_branch_label_value = else_branch_label_compute();
if(isFinal && num == state().boundariesCrossed) else_branch_label_computed = true;
return else_branch_label_value;
}
/**
* @apilevel internal
*/
private soot.jimple.Stmt else_branch_label_compute() { return newLabel(); }
/**
* @apilevel internal
*/
protected boolean then_branch_label_computed = false;
/**
* @apilevel internal
*/
protected soot.jimple.Stmt then_branch_label_value;
/**
* @attribute syn
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:156
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt then_branch_label() {
if(then_branch_label_computed) {
return then_branch_label_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
then_branch_label_value = then_branch_label_compute();
if(isFinal && num == state().boundariesCrossed) then_branch_label_computed = true;
return then_branch_label_value;
}
/**
* @apilevel internal
*/
private soot.jimple.Stmt then_branch_label_compute() { return newLabel(); }
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:387
* @apilevel internal
*/
public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) {
if(caller == getFalseExprNoTransform()) {
return getCondition().isDAafterFalse(v);
}
else if(caller == getTrueExprNoTransform()) {
return getCondition().isDAafterTrue(v);
}
else if(caller == getConditionNoTransform()) {
return isDAbefore(v);
}
else { return getParent().Define_boolean_isDAbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:823
* @apilevel internal
*/
public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) {
if(caller == getFalseExprNoTransform()) {
return getCondition().isDUafterFalse(v);
}
else if(caller == getTrueExprNoTransform()) {
return getCondition().isDUafterTrue(v);
}
else if(caller == getConditionNoTransform()) {
return isDUbefore(v);
}
else { return getParent().Define_boolean_isDUbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:64
* @apilevel internal
*/
public soot.jimple.Stmt Define_soot_jimple_Stmt_condition_false_label(ASTNode caller, ASTNode child) {
if(caller == getFalseExprNoTransform()) {
return false_label();
}
else if(caller == getTrueExprNoTransform()) {
return false_label();
}
else if(caller == getConditionNoTransform()) {
return else_branch_label();
}
else { return getParent().Define_soot_jimple_Stmt_condition_false_label(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:65
* @apilevel internal
*/
public soot.jimple.Stmt Define_soot_jimple_Stmt_condition_true_label(ASTNode caller, ASTNode child) {
if(caller == getFalseExprNoTransform()) {
return true_label();
}
else if(caller == getTrueExprNoTransform()) {
return true_label();
}
else if(caller == getConditionNoTransform()) {
return then_branch_label();
}
else { return getParent().Define_soot_jimple_Stmt_condition_true_label(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 23,476
| 29.931489
| 211
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ConstCase.java
|
/* 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 ConstCase : {@link Case} ::= <span class="component">Value:{@link Expr}</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:204
*/
public class ConstCase extends Case implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ConstCase clone() throws CloneNotSupportedException {
ConstCase node = (ConstCase)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ConstCase copy() {
try {
ConstCase node = (ConstCase) 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 ConstCase fullCopy() {
ConstCase tree = (ConstCase) 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 NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:406
*/
public void nameCheck() {
if(getValue().isConstant() && bind(this) != this) {
error("constant expression " + getValue() + " is multiply declared in two case statements");
}
}
/**
* @ast method
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:562
*/
public void toString(StringBuffer s) {
s.append(indent());
s.append("case ");
getValue().toString(s);
s.append(":");
}
/**
* @ast method
* @aspect EnumsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/EnumsCodegen.jrag:32
*/
public void transformation() {
if(getValue() instanceof VarAccess && getValue().varDecl() instanceof EnumConstant) {
int i = hostType().createEnumIndex((EnumConstant)getValue().varDecl());
setValue(new IntegerLiteral(new Integer(i).toString()));
}
super.transformation();
}
/**
* @ast method
*
*/
public ConstCase() {
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[1];
}
/**
* @ast method
*
*/
public ConstCase(Expr p0) {
setChild(p0, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 1;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the Value child.
* @param node The new node to replace the Value child.
* @apilevel high-level
* @ast method
*
*/
public void setValue(Expr node) {
setChild(node, 0);
}
/**
* Retrieves the Value child.
* @return The current node used as the Value child.
* @apilevel high-level
* @ast method
*
*/
public Expr getValue() {
return (Expr)getChild(0);
}
/**
* Retrieves the Value child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Value child.
* @apilevel low-level
* @ast method
*
*/
public Expr getValueNoTransform() {
return (Expr)getChildNoTransform(0);
}
/**
* @ast method
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:503
*/
public void refined_Enums_ConstCase_typeCheck() {
boolean isEnumConstant = getValue().isEnumConstant();
if(switchType().isEnumDecl() && !isEnumConstant) {
error("Unqualified enumeration constant required");
} else {
TypeDecl switchType = switchType();
TypeDecl type = getValue().type();
if(!type.assignConversionTo(switchType, getValue()))
error("Constant expression must be assignable to Expression");
if(!getValue().isConstant() && !getValue().type().isUnknown() &&
!isEnumConstant)
error("Switch expression must be constant");
}
}
/**
* <p>Improve the type checking error messages given for case labels.
* @ast method
* @aspect StringsInSwitch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/StringsInSwitch.jrag:68
*/
public void typeCheck() {
boolean isEnumConstant = getValue().isEnumConstant();
TypeDecl switchType = switchType();
TypeDecl type = getValue().type();
if (switchType.isEnumDecl() && !isEnumConstant)
error("Unqualified enumeration constant required");
if (!type.assignConversionTo(switchType, getValue()))
error("Case label has incompatible type "+switchType.name()+
", expected type compatible with "+type.name());
if (!getValue().isConstant() && !getValue().type().isUnknown() &&
!isEnumConstant)
error("Case label must have constant expression");
}
/**
* @ast method
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:432
*/
private boolean refined_NameCheck_ConstCase_constValue_Case(Case c)
{
if(!(c instanceof ConstCase) || !getValue().isConstant())
return false;
if(!getValue().type().assignableToInt() || !((ConstCase)c).getValue().type().assignableToInt())
return false;
return getValue().constant().intValue() == ((ConstCase)c).getValue().constant().intValue();
}
/**
* @ast method
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:517
*/
private boolean refined_Enums_ConstCase_constValue_Case(Case c)
{
if(switchType().isEnumDecl()) {
if(!(c instanceof ConstCase) || !getValue().isConstant())
return false;
return getValue().varDecl() == ((ConstCase)c).getValue().varDecl();
}
else
return refined_NameCheck_ConstCase_constValue_Case(c);
}
/**
* @attribute syn
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:431
*/
public boolean constValue(Case c) {
ASTNode$State state = state();
try {
if (isDefaultCase() || c.isDefaultCase())
return isDefaultCase() && c.isDefaultCase();
Expr myValue = getValue();
Expr otherValue = ((ConstCase) c).getValue();
TypeDecl myType = myValue.type();
TypeDecl otherType = otherValue.type();
if (myType.isString() || otherType.isString()) {
if (!myType.isString() || !otherType.isString())
return false;
if (!myValue.isConstant() || !otherValue.isConstant())
return false;
return myValue.constant().stringValue().equals(
otherValue.constant().stringValue());
}
return refined_Enums_ConstCase_constValue_Case(c);
}
finally {
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:497
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) {
if(caller == getValueNoTransform()) {
return switchType().isEnumDecl() ? switchType().memberFields(name) : lookupVariable(name);
}
else { return getParent().Define_SimpleSet_lookupVariable(this, caller, name);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 8,868
| 28.078689
| 116
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/Constant.java
|
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;
/**
* @ast class
*
*/
public class Constant extends java.lang.Object {
static class ConstantInt extends Constant {
private int value;
public ConstantInt(int i) { this.value = i; }
int intValue() { return value; }
long longValue() { return value; }
float floatValue() { return value; }
double doubleValue() { return value; }
String stringValue() { return new Integer(value).toString(); }
}
static class ConstantLong extends Constant {
private long value;
public ConstantLong(long l) { this.value = l; }
int intValue() { return (int)value; }
long longValue() { return value; }
float floatValue() { return value; }
double doubleValue() { return value; }
String stringValue() { return new Long(value).toString(); }
}
static class ConstantFloat extends Constant {
private float value;
public ConstantFloat(float f) { this.value = f; }
int intValue() { return (int)value; }
long longValue() { return (long)value; }
float floatValue() { return value; }
double doubleValue() { return value; }
String stringValue() { return new Float(value).toString(); }
}
static class ConstantDouble extends Constant {
private double value;
public ConstantDouble(double d) { this.value = d; }
int intValue() { return (int)value; }
long longValue() { return (long)value; }
float floatValue() { return (float)value; }
double doubleValue() { return value; }
String stringValue() { return new Double(value).toString(); }
}
static class ConstantChar extends Constant {
private char value;
public ConstantChar(char c) { this.value = c; }
int intValue() { return value; }
long longValue() { return value; }
float floatValue() { return value; }
double doubleValue() { return value; }
String stringValue() { return new Character(value).toString(); }
}
static class ConstantBoolean extends Constant {
private boolean value;
public ConstantBoolean(boolean b) { this.value = b; }
boolean booleanValue() { return value; }
String stringValue() { return new Boolean(value).toString(); }
}
static class ConstantString extends Constant {
private String value;
public ConstantString(String s) { this.value = s; }
String stringValue() { return value; }
}
int intValue() { throw new UnsupportedOperationException(); }
long longValue() { throw new UnsupportedOperationException(); }
float floatValue() { throw new UnsupportedOperationException(); }
double doubleValue() { throw new UnsupportedOperationException(); }
boolean booleanValue() { throw new UnsupportedOperationException(getClass().getName()); }
String stringValue() { throw new UnsupportedOperationException(); }
protected Constant() {
}
public boolean error = false;
static Constant create(int i) { return new ConstantInt(i); }
static Constant create(long l) { return new ConstantLong(l); }
static Constant create(float f) { return new ConstantFloat(f); }
static Constant create(double d) { return new ConstantDouble(d); }
static Constant create(boolean b) { return new ConstantBoolean(b); }
static Constant create(char c) { return new ConstantChar(c); }
static Constant create(String s) { return new ConstantString(s); }
}
| 3,949
| 25.870748
| 93
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/Constraints.java
|
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;
/**
* @ast class
*
*/
public class Constraints extends java.lang.Object {
static class ConstraintSet {
public Collection supertypeConstraints = new HashSet(4);
public Collection subtypeConstraints = new HashSet(4);
public Collection equaltypeConstraints = new HashSet(4);
public TypeDecl typeArgument;
}
private Collection typeVariables;
private Map constraintsMap;
public boolean rawAccess = false;
public Constraints() {
typeVariables = new ArrayList(4);
constraintsMap = new HashMap();
}
public void addTypeVariable(TypeVariable T) {
if(!typeVariables.contains(T)) {
typeVariables.add(T);
constraintsMap.put(T, new ConstraintSet());
}
}
public boolean unresolvedTypeArguments() {
for(Iterator iter = typeVariables.iterator(); iter.hasNext(); ) {
TypeVariable T = (TypeVariable)iter.next();
ConstraintSet set = (ConstraintSet)constraintsMap.get(T);
if(set.typeArgument == null)
return true;
}
return false;
}
public void printConstraints() {
System.err.println("Current constraints:");
for(Iterator iter = typeVariables.iterator(); iter.hasNext(); ) {
TypeVariable T = (TypeVariable)iter.next();
ConstraintSet set = (ConstraintSet)constraintsMap.get(T);
for(Iterator i2 = set.supertypeConstraints.iterator(); i2.hasNext(); ) {
TypeDecl U = (TypeDecl)i2.next();
System.err.println(" " + T.fullName() + " :> " + U.fullName());
}
for(Iterator i2 = set.subtypeConstraints.iterator(); i2.hasNext(); ) {
TypeDecl U = (TypeDecl)i2.next();
System.err.println(" " + T.fullName() + " <: " + U.fullName());
}
for(Iterator i2 = set.equaltypeConstraints.iterator(); i2.hasNext(); ) {
TypeDecl U = (TypeDecl)i2.next();
System.err.println(" " + T.fullName() + " = " + U.fullName());
}
}
}
public void resolveBounds() {
for(Iterator iter = typeVariables.iterator(); iter.hasNext(); ) {
TypeVariable T = (TypeVariable)iter.next();
ConstraintSet set = (ConstraintSet)constraintsMap.get(T);
if(set.typeArgument == null) {
//if(T.getNumTypeBound() == 1)
set.typeArgument = T.getTypeBound(0).type();
//else
// throw new Error("Not supported for multiple bounds yet");
}
}
}
public void resolveEqualityConstraints() {
for(Iterator iter = typeVariables.iterator(); iter.hasNext(); ) {
TypeVariable T = (TypeVariable)iter.next();
ConstraintSet set = (ConstraintSet)constraintsMap.get(T);
boolean done = false;
for(Iterator i2 = set.equaltypeConstraints.iterator(); !done && i2.hasNext(); ) {
TypeDecl U = (TypeDecl)i2.next();
if(!typeVariables.contains(U)) {
replaceEqualityConstraints(T, U); // replace equality constraints for other type variables
set.equaltypeConstraints.clear();
set.equaltypeConstraints.add(U); // make U is the only equality constraint for T
set.typeArgument = U;
done = true; // continue on next type variable
}
else if(T == U) {
//i2.remove(); // discard constraint
}
else {
replaceAllConstraints(T, U); // rewrite all constraints involving T to use U instead
done = true; // continue on next type variable
}
}
if(set.typeArgument == null && set.equaltypeConstraints.size() == 1 && set.equaltypeConstraints.contains(T))
set.typeArgument = T;
}
}
public void replaceEqualityConstraints(TypeDecl before, TypeDecl after) {
for(Iterator iter = typeVariables.iterator(); iter.hasNext(); ) {
TypeVariable T = (TypeVariable)iter.next();
ConstraintSet set = (ConstraintSet)constraintsMap.get(T);
replaceConstraints(set.equaltypeConstraints, before, after);
}
}
public void replaceAllConstraints(TypeDecl before, TypeDecl after) {
for(Iterator iter = typeVariables.iterator(); iter.hasNext(); ) {
TypeVariable T = (TypeVariable)iter.next();
ConstraintSet set = (ConstraintSet)constraintsMap.get(T);
replaceConstraints(set.supertypeConstraints, before, after);
replaceConstraints(set.subtypeConstraints, before, after);
replaceConstraints(set.equaltypeConstraints, before, after);
}
}
private void replaceConstraints(Collection constraints, TypeDecl before, TypeDecl after) {
Collection newConstraints = new ArrayList();
for(Iterator i2 = constraints.iterator(); i2.hasNext(); ) {
TypeDecl U = (TypeDecl)i2.next();
if(U == before) { // TODO: fix parameterized type
i2.remove();
newConstraints.add(after);
}
}
constraints.addAll(newConstraints);
}
public void resolveSubtypeConstraints() {
for(Iterator iter = typeVariables.iterator(); iter.hasNext(); ) {
TypeVariable T = (TypeVariable)iter.next();
ConstraintSet set = (ConstraintSet)constraintsMap.get(T);
if((!set.subtypeConstraints.isEmpty() || T.getNumTypeBound() > 0) && set.typeArgument == null) {
ArrayList bounds = new ArrayList();
for(Iterator i2 = set.subtypeConstraints.iterator(); i2.hasNext(); ) {
bounds.add(i2.next());
}
for(int i = 0; i < T.getNumTypeBound(); i++) {
bounds.add(T.getTypeBound(i).type());
}
set.typeArgument = GLBTypeFactory.glb(bounds);
}
}
}
public void resolveSupertypeConstraints() {
for(Iterator iter = typeVariables.iterator(); iter.hasNext(); ) {
TypeVariable T = (TypeVariable)iter.next();
ConstraintSet set = (ConstraintSet)constraintsMap.get(T);
if(!set.supertypeConstraints.isEmpty() && set.typeArgument == null) {
//TypeDecl typeDecl = lub(set.supertypeConstraints);
TypeDecl typeDecl = T.lookupLUBType(set.supertypeConstraints).lub();
set.typeArgument = typeDecl;
/*
TypeDecl EC = (TypeDecl)set.supertypeConstraints.get(0);
for(Iterator i2 = set.supertypeConstraints.iterator(); i2.hasNext(); ) {
TypeDecl U = (TypeDecl)i2.next();
TypeDecl ST = U;
TypeDecl EST = ST.erasure();
EC = intersect(EC, EST);
}
TypeDecl MEC = EC;
//System.err.println(" MEC(" + T.fullName() + ") = " + MEC.fullName());
set.typeArgument = MEC;
*/
}
}
}
/*
// operates only on erased types. does it matter? (no type variables, no partypedecl)
private TypeDecl intersect(TypeDecl t1, TypeDecl t2) {
if(t1.instanceOf(t2))
return t1;
else if(t2.instanceOf(t1))
return t2;
else {
HashSet set = new HashSet();
for(Iterator iter = directSupertypes(t1).iterator(); iter.hasNext(); ) {
TypeDecl t1Super = (TypeDecl)iter.next();
set.add(intersect(t1Super, t2));
}
if(set.isEmpty())
throw new Error("Empty intersection of " + t1.fullName() + " and " + t2.fullName());
TypeDecl lowestType = (TypeDecl)set.iterator().next();
for(Iterator iter = set.iterator(); iter.hasNext(); ) {
TypeDecl type = (TypeDecl)iter.next();
if(type.instanceOf(lowestType))
lowestType = type;
else if(!lowestType.instanceOf(type))
throw new Error("Several leaf types in intersection, " + lowestType.fullName() + " and " + type.fullName());
}
return lowestType;
}
}
*/
public static HashSet directSupertypes(TypeDecl t) {
if(t instanceof ClassDecl) {
ClassDecl type = (ClassDecl)t;
HashSet set = new HashSet();
if(type.hasSuperclass())
set.add(type.superclass());
for(int i = 0; i < type.getNumImplements(); i++)
set.add(type.getImplements(i).type());
return set;
}
else if(t instanceof InterfaceDecl) {
InterfaceDecl type = (InterfaceDecl)t;
HashSet set = new HashSet();
for(int i = 0; i < type.getNumSuperInterfaceId(); i++)
set.add(type.getSuperInterfaceId(i).type());
return set;
}
else if(t instanceof TypeVariable) {
TypeVariable type = (TypeVariable)t;
HashSet set = new HashSet();
for(int i = 0; i < type.getNumTypeBound(); i++)
set.add(type.getTypeBound(i).type());
return set;
}
else
throw new Error("Operation not supported for " + t.fullName() + ", " + t.getClass().getName());
}
public static HashSet parameterizedSupertypes(TypeDecl t) {
HashSet result = new HashSet();
addParameterizedSupertypes(t, new HashSet(), result);
return result;
}
public static void addParameterizedSupertypes(TypeDecl t, HashSet processed, HashSet result) {
if(!processed.contains(t)) {
processed.add(t);
if(t.isParameterizedType() /*&& !t.isRawType()*/)
result.add(t);
for(Iterator iter = directSupertypes(t).iterator(); iter.hasNext(); ) {
TypeDecl typeDecl = (TypeDecl)iter.next();
addParameterizedSupertypes(typeDecl, processed, result);
}
}
}
public Collection typeArguments() {
ArrayList list = new ArrayList(typeVariables.size());
for(Iterator iter = typeVariables.iterator(); iter.hasNext(); ) {
TypeVariable T = (TypeVariable)iter.next();
ConstraintSet set = (ConstraintSet)constraintsMap.get(T);
list.add(set.typeArgument);
}
return list;
}
public void addSupertypeConstraint(TypeDecl T, TypeDecl A) {
ConstraintSet set = (ConstraintSet)constraintsMap.get(T);
set.supertypeConstraints.add(A);
//System.out.println(T.name() + " :> " + A.fullName());
}
public void addSubtypeConstraint(TypeDecl T, TypeDecl A) {
ConstraintSet set = (ConstraintSet)constraintsMap.get(T);
set.subtypeConstraints.add(A);
//System.out.println(T.name() + " <: " + A.fullName());
}
public void addEqualConstraint(TypeDecl T, TypeDecl A) {
ConstraintSet set = (ConstraintSet)constraintsMap.get(T);
set.equaltypeConstraints.add(A);
//System.out.println(T.name() + " = " + A.fullName());
}
public void convertibleTo(TypeDecl A, TypeDecl F) {
//System.out.println("Convertible to called with " + A.fullName() + "(" + A.getClass().getName() + ")" + " and " + F.fullName() + "(" + F.getClass().getName() + ")");
// If F does not involve a type parameter Tj then con constraint is implied on Tj
if(!F.involvesTypeParameters())
return;
// If A is the type of null, no constraint is implied on Tj.
if(A.isNull())
return;
// If A is a primitive type, then A is converted to a reference type U via boxing conversion
// and this algorithm is applied recursively to the constraint U << F.
if(A.isUnboxedPrimitive()) {
TypeDecl U = A.boxed();
convertibleTo(U, F);
}
// If F = Tj, then the constrint Tj :> A is implied
else if(F instanceof TypeVariable) {
if(typeVariables.contains(F))
addSupertypeConstraint(F, A);
}
// If F = U[], where the type U involves Tj, then if A is an array type V[]
// or a type variable with an upper bound that is an array type V[],
// where V is a reference type, this algorithm is applied recursively
// to the constraint V << U
else if(F.isArrayDecl()) {
//System.out.println("convertibleTo array decl");
TypeDecl U = ((ArrayDecl)F).componentType();
if(!U.involvesTypeParameters())
return;
if(A.isArrayDecl()) {
TypeDecl V = ((ArrayDecl)A).componentType();
if(V.isReferenceType())
convertibleTo(V, U);
}
else if(A.isTypeVariable()) {
TypeVariable t = (TypeVariable)A;
for(int i = 0; i < t.getNumTypeBound(); i++) {
TypeDecl typeBound = t.getTypeBound(i).type();
if(typeBound.isArrayDecl() && ((ArrayDecl)typeBound).componentType().isReferenceType()) {
TypeDecl V = ((ArrayDecl)typeBound).componentType();
convertibleTo(V, U);
}
}
}
}
else if(F instanceof ParTypeDecl && !F.isRawType()) {
for(Iterator iter = parameterizedSupertypes(A).iterator(); iter.hasNext(); ) {
ParTypeDecl PF = (ParTypeDecl)F;
ParTypeDecl PA = (ParTypeDecl)iter.next();
if(PF.genericDecl() == PA.genericDecl()) {
if(A.isRawType())
rawAccess = true;
else
for(int i = 0; i < PF.getNumArgument(); i++) {
TypeDecl T = PF.getArgument(i).type();
if(T.involvesTypeParameters()) {
if(!T.isWildcard()) {
TypeDecl U = T;
TypeDecl V = PA.getArgument(i).type();
constraintEqual(V, U);
}
else if(T instanceof WildcardExtendsType) {
TypeDecl U = ((WildcardExtendsType)T).getAccess().type();
TypeDecl S = PA.getArgument(i).type();
if(!S.isWildcard()) {
TypeDecl V = S;
convertibleTo(V, U);
}
else if(S instanceof WildcardExtendsType) {
TypeDecl V = ((WildcardExtendsType)S).getAccess().type();
convertibleTo(V, U);
}
}
else if(T instanceof WildcardSuperType) {
TypeDecl U = ((WildcardSuperType)T).getAccess().type();
TypeDecl S = PA.getArgument(i).type();
if(!S.isWildcard()) {
TypeDecl V = S;
convertibleFrom(V, U);
}
else if(S instanceof WildcardSuperType) {
TypeDecl V = ((WildcardSuperType)S).getAccess().type();
convertibleFrom(V, U);
}
}
}
}
}
}
}
}
public void convertibleFrom(TypeDecl A, TypeDecl F) {
//System.out.println("ConvertibleFrom called with " + A.fullName() + "(" + A.getClass().getName() + ")" + " and " + F.fullName() + "(" + F.getClass().getName() + ")");
// If F does not involve a type parameter Tj then con constraint is implied on Tj
if(!F.involvesTypeParameters())
return;
// If A is the type of null, no constraint is implied on Tj.
else if(A.isNull())
return;
else if(F instanceof TypeVariable) {
if(typeVariables.contains(F))
addSubtypeConstraint(F, A);
}
else if(F.isArrayDecl()) {
TypeDecl U = ((ArrayDecl)F).componentType();
if(A.isArrayDecl()) {
TypeDecl V = ((ArrayDecl)A).componentType();
convertibleFrom(V, U);
}
else if(A.isTypeVariable()) {
TypeVariable t = (TypeVariable)A;
for(int i = 0; i < t.getNumTypeBound(); i++) {
TypeDecl typeBound = t.getTypeBound(i).type();
if(typeBound.isArrayDecl() && ((ArrayDecl)typeBound).componentType().isReferenceType()) {
TypeDecl V = ((ArrayDecl)typeBound).componentType();
convertibleFrom(V, U);
}
}
}
}
else if(F instanceof ParTypeDecl && !F.isRawType() && A instanceof ParTypeDecl && !A.isRawType()) {
ParTypeDecl PF = (ParTypeDecl)F;
ParTypeDecl PA = (ParTypeDecl)A;
TypeDecl G = PF.genericDecl();
TypeDecl H = PA.genericDecl();
for(int i = 0; i < PF.getNumArgument(); i++) {
TypeDecl T = PF.getArgument(i).type();
if(T.involvesTypeParameters()) {
// If F has the form G<...,U,...> where U is a type expression that involves Tj
if(!T.isWildcard()) {
TypeDecl U = T;
if(G.instanceOf(H)) {
if(H != G) {
for(Iterator iter = parameterizedSupertypes(F).iterator(); iter.hasNext(); ) {
TypeDecl V = (TypeDecl)iter.next();
if(!V.isRawType() && ((ParTypeDecl)V).genericDecl() == H) {
if(F.instanceOf(V))
convertibleFrom(A, V);
}
}
}
else if(PF.getNumArgument() == PA.getNumArgument()) {
TypeDecl X = PA.getArgument(i).type();
if(!X.isWildcard()) {
TypeDecl W = X;
constraintEqual(W, U);
}
else if(X instanceof WildcardExtendsType) {
TypeDecl W = ((WildcardExtendsType)X).getAccess().type();
convertibleFrom(W, U);
}
else if(X instanceof WildcardSuperType) {
TypeDecl W = ((WildcardSuperType)X).getAccess().type();
convertibleTo(W, U);
}
}
}
}
else if(T instanceof WildcardExtendsType) {
TypeDecl U = ((WildcardExtendsType)T).getAccess().type();
if(G.instanceOf(H)) {
if(H != G) {
for(Iterator iter = parameterizedSupertypes(F).iterator(); iter.hasNext(); ) {
TypeDecl V = (TypeDecl)iter.next();
if(!V.isRawType() && ((ParTypeDecl)V).genericDecl() == H) {
// replace type argument Un with ? extends Un in V
ArrayList list = new ArrayList();
for(int j = 0; j < ((ParTypeDecl)V).getNumArgument(); j++)
list.add(((ParTypeDecl)V).getArgument(j).type().asWildcardExtends());
V = ((GenericTypeDecl)H).lookupParTypeDecl(list);
convertibleFrom(A, V);
}
}
}
else if(PF.getNumArgument() == PA.getNumArgument()) {
TypeDecl X = PA.getArgument(i).type();
if(X instanceof WildcardExtendsType) {
TypeDecl W = ((WildcardExtendsType)X).getAccess().type();
convertibleFrom(W, U);
}
}
}
}
else if(T instanceof WildcardSuperType) {
TypeDecl U = ((WildcardSuperType)T).getAccess().type();
if(G.instanceOf(H)) {
if(H != G) {
for(Iterator iter = parameterizedSupertypes(F).iterator(); iter.hasNext(); ) {
TypeDecl V = (TypeDecl)iter.next();
if(!V.isRawType() && ((ParTypeDecl)V).genericDecl() == H) {
// replace type argument Un with ? super Un in V
ArrayList list = new ArrayList();
for(int j = 0; j < ((ParTypeDecl)V).getNumArgument(); j++)
list.add(((ParTypeDecl)V).getArgument(j).type().asWildcardExtends());
V = ((GenericTypeDecl)H).lookupParTypeDecl(list);
convertibleFrom(A, V);
}
}
}
else if(PF.getNumArgument() == PA.getNumArgument()) {
TypeDecl X = PA.getArgument(i).type();
if(X instanceof WildcardSuperType) {
TypeDecl W = ((WildcardSuperType)X).getAccess().type();
convertibleTo(W, U);
}
}
}
}
}
}
}
else if(F.isRawType())
rawAccess = true;
}
public void constraintEqual(TypeDecl A, TypeDecl F) {
//System.out.println("ConstraintEqual called with " + A.fullName() + "(" + A.getClass().getName() + ")" + " and " + F.fullName() + "(" + F.getClass().getName() + ")");
// If F does not involve a type parameter Tj then con constraint is implied on Tj
if(!F.involvesTypeParameters())
return;
// If A is the type of null, no constraint is implied on Tj.
else if(A.isNull())
return;
else if(F instanceof TypeVariable) {
if(typeVariables.contains(F))
addEqualConstraint(F, A);
}
else if(F.isArrayDecl()) {
TypeDecl U = ((ArrayDecl)F).componentType();
if(A.isArrayDecl()) {
TypeDecl V = ((ArrayDecl)A).componentType();
constraintEqual(V, U);
}
else if(A.isTypeVariable()) {
TypeVariable t = (TypeVariable)A;
for(int i = 0; i < t.getNumTypeBound(); i++) {
TypeDecl typeBound = t.getTypeBound(i).type();
if(typeBound.isArrayDecl() && ((ArrayDecl)typeBound).componentType().isReferenceType()) {
TypeDecl V = ((ArrayDecl)typeBound).componentType();
constraintEqual(V, U);
}
}
}
}
else if(F instanceof ParTypeDecl && !F.isRawType()) {
if(A instanceof ParTypeDecl) {
ParTypeDecl PF = (ParTypeDecl)F;
ParTypeDecl PA = (ParTypeDecl)A;
if(PF.genericDecl() == PA.genericDecl()) {
if(A.isRawType())
rawAccess = true;
else
for(int i = 0; i < PF.getNumArgument(); i++) {
TypeDecl T = PF.getArgument(i).type();
if(T.involvesTypeParameters()) {
if(!T.isWildcard()) {
TypeDecl U = T;
TypeDecl V = PA.getArgument(i).type();
constraintEqual(V, U);
}
else if(T instanceof WildcardExtendsType) {
TypeDecl U = ((WildcardExtendsType)T).getAccess().type();
TypeDecl S = PA.getArgument(i).type();
if(S instanceof WildcardExtendsType) {
TypeDecl V = ((WildcardExtendsType)S).getAccess().type();
constraintEqual(V, U);
}
}
else if(T instanceof WildcardSuperType) {
TypeDecl U = ((WildcardSuperType)T).getAccess().type();
TypeDecl S = PA.getArgument(i).type();
if(S instanceof WildcardSuperType) {
TypeDecl V = ((WildcardSuperType)S).getAccess().type();
constraintEqual(V, U);
}
}
}
}
}
}
}
}
}
| 23,529
| 36.76886
| 173
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ConstructorAccess.java
|
/* 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 ConstructorAccess : {@link Access} ::= <span class="component"><ID:String></span> <span class="component">Arg:{@link Expr}*</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:21
*/
public class ConstructorAccess extends Access implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
decls_computed = false;
decls_value = null;
decl_computed = false;
decl_value = null;
type_computed = false;
type_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ConstructorAccess clone() throws CloneNotSupportedException {
ConstructorAccess node = (ConstructorAccess)super.clone();
node.decls_computed = false;
node.decls_value = null;
node.decl_computed = false;
node.decl_value = null;
node.type_computed = false;
node.type_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ConstructorAccess copy() {
try {
ConstructorAccess node = (ConstructorAccess) 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 ConstructorAccess fullCopy() {
ConstructorAccess tree = (ConstructorAccess) 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 ExceptionHandling
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:111
*/
public void exceptionHandling() {
for(int i = 0; i < decl().getNumException(); i++) {
TypeDecl exceptionType = decl().getException(i).type();
if(!handlesException(exceptionType))
error("" + this + " may throw uncaught exception " + exceptionType.fullName());
}
}
/**
* @ast method
* @aspect ExceptionHandling
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:272
*/
protected boolean reachedException(TypeDecl catchType) {
for(int i = 0; i < decl().getNumException(); i++) {
TypeDecl exceptionType = decl().getException(i).type();
if(catchType.mayCatch(exceptionType))
return true;
}
return super.reachedException(catchType);
}
/**
* @ast method
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:117
*/
public void nameCheck() {
super.nameCheck();
if(decls().isEmpty())
error("no constructor named " + this);
if(decls().size() > 1 && validArgs()) {
error("several most specific constructors for " + this);
for(Iterator iter = decls().iterator(); iter.hasNext(); ) {
error(" " + ((ConstructorDecl)iter.next()).signature());
}
}
}
/**
* @ast method
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:470
*/
public void toString(StringBuffer s) {
s.append(name());
s.append("(");
if(getNumArg() > 0) {
getArg(0).toString(s);
for(int i = 1; i < getNumArg(); i++) {
s.append(", ");
getArg(i).toString(s);
}
}
s.append(")");
}
/**
* @ast method
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:355
*/
public void checkModifiers() {
if(decl().isDeprecated() &&
!withinDeprecatedAnnotation() &&
hostType().topLevelType() != decl().hostType().topLevelType() &&
!withinSuppressWarnings("deprecation"))
warning(decl().signature() + " in " + decl().hostType().typeName() + " has been deprecated");
}
/**
* @ast method
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:171
*/
protected void transformEnumConstructors() {
super.transformEnumConstructors();
getArgList().insertChild(new VarAccess("@p0"),0);
getArgList().insertChild(new VarAccess("@p1"),1);
}
/**
* @ast method
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:469
*/
// add val$name as arguments to the constructor
protected boolean addEnclosingVariables = true;
/**
* @ast method
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:470
*/
public void addEnclosingVariables() {
if(!addEnclosingVariables) return;
addEnclosingVariables = false;
decl().addEnclosingVariables();
for(Iterator iter = decl().hostType().enclosingVariables().iterator(); iter.hasNext(); ) {
Variable v = (Variable)iter.next();
getArgList().add(new VarAccess("val$" + v.name()));
}
}
/**
* @ast method
* @aspect Transformations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Transformations.jrag:138
*/
public void refined_Transformations_ConstructorAccess_transformation() {
// this$val
addEnclosingVariables();
// touch accessorIndex go force creation of private constructorAccessor
if(decl().isPrivate() && decl().hostType() != hostType()) {
decl().createAccessor();
}
super.transformation();
}
/**
* @ast method
* @aspect EmitJimpleRefinements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/SootJastAddJ/EmitJimpleRefinements.jrag:235
*/
public void collectTypesToSignatures(Collection<Type> set) {
super.collectTypesToSignatures(set);
addDependencyIfNeeded(set, decl().erasedConstructor().hostType());
}
/**
* @ast method
*
*/
public ConstructorAccess() {
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[1];
setChild(new List(), 0);
}
/**
* @ast method
*
*/
public ConstructorAccess(String p0, List<Expr> p1) {
setID(p0);
setChild(p1, 0);
}
/**
* @ast method
*
*/
public ConstructorAccess(beaver.Symbol p0, List<Expr> p1) {
setID(p0);
setChild(p1, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 1;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* 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;
}
/**
* @apilevel internal
* @ast method
*
*/
/**
* @apilevel internal
*/
protected String tokenString_ID;
/**
* @ast method
*
*/
public int IDstart;
/**
* @ast method
*
*/
public int IDend;
/**
* 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 Arg list.
* @param list The new list node to be used as the Arg list.
* @apilevel high-level
* @ast method
*
*/
public void setArgList(List<Expr> list) {
setChild(list, 0);
}
/**
* Retrieves the number of children in the Arg list.
* @return Number of children in the Arg list.
* @apilevel high-level
* @ast method
*
*/
public int getNumArg() {
return getArgList().getNumChild();
}
/**
* Retrieves the number of children in the Arg list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Arg list.
* @apilevel low-level
* @ast method
*
*/
public int getNumArgNoTransform() {
return getArgListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Arg list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Arg list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Expr getArg(int i) {
return (Expr)getArgList().getChild(i);
}
/**
* Append an element to the Arg list.
* @param node The element to append to the Arg list.
* @apilevel high-level
* @ast method
*
*/
public void addArg(Expr node) {
List<Expr> list = (parent == null || state == null) ? getArgListNoTransform() : getArgList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addArgNoTransform(Expr node) {
List<Expr> list = getArgListNoTransform();
list.addChild(node);
}
/**
* Replaces the Arg 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 setArg(Expr node, int i) {
List<Expr> list = getArgList();
list.setChild(node, i);
}
/**
* Retrieves the Arg list.
* @return The node representing the Arg list.
* @apilevel high-level
* @ast method
*
*/
public List<Expr> getArgs() {
return getArgList();
}
/**
* Retrieves the Arg list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Arg list.
* @apilevel low-level
* @ast method
*
*/
public List<Expr> getArgsNoTransform() {
return getArgListNoTransform();
}
/**
* Retrieves the Arg list.
* @return The node representing the Arg list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Expr> getArgList() {
List<Expr> list = (List<Expr>)getChild(0);
list.getNumChild();
return list;
}
/**
* Retrieves the Arg list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Arg list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Expr> getArgListNoTransform() {
return (List<Expr>)getChildNoTransform(0);
}
/**
* @ast method
* @aspect VariableArityParametersCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/VariableArityParametersCodegen.jrag:57
*/
public void transformation() {
if(decl().isVariableArity() && !invokesVariableArityAsArray()) {
// arguments to normal parameters
List list = new List();
for(int i = 0; i < decl().getNumParameter() - 1; i++)
list.add(getArg(i).fullCopy());
// arguments to variable arity parameters
List last = new List();
for(int i = decl().getNumParameter() - 1; i < getNumArg(); i++)
last.add(getArg(i).fullCopy());
// build an array holding arguments
Access typeAccess = decl().lastParameter().type().elementType().createQualifiedAccess();
for(int i = 0; i < decl().lastParameter().type().dimension(); i++)
typeAccess = new ArrayTypeAccess(typeAccess);
list.add(new ArrayCreationExpr(typeAccess, new Opt(new ArrayInit(last))));
// replace argument list with augemented argument list
setArgList(list);
}
refined_Transformations_ConstructorAccess_transformation();
}
/**
* @ast method
* @aspect GenericsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/GenericsCodegen.jrag:216
*/
public soot.Value eval(Body b) {
b.setLine(this);
ConstructorDecl c = decl().erasedConstructor();
// this
Local base = b.emitThis(hostType());
int index = 0;
ArrayList list = new ArrayList();
// this$0
if(c.needsEnclosing())
list.add(asImmediate(b,
b.newParameterRef(hostType().enclosingType().getSootType(), index++, this)
));
if(c.needsSuperEnclosing()) {
TypeDecl superClass = ((ClassDecl)hostType()).superclass();
list.add(asImmediate(b,
b.newParameterRef(superClass.enclosingType().getSootType(), index++, this)
));
}
// args
for(int i = 0; i < getNumArg(); i++)
list.add(asImmediate(b,
getArg(i).type().emitCastTo(b, getArg(i), c.getParameter(i).type()))); // MethodInvocationConversion
if(decl().isPrivate() && decl().hostType() != hostType()) {
list.add(asImmediate(b, soot.jimple.NullConstant.v()));
b.add(
b.newInvokeStmt(
b.newSpecialInvokeExpr(base, decl().erasedConstructor().createAccessor().sootRef(), list, this),
this
)
);
return base;
}
else {
return b.newSpecialInvokeExpr(base, c.sootRef(), list, this);
}
}
/**
* @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 decl().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 decl().isDUafter(v); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstructScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:50
*/
public boolean applicableAndAccessible(ConstructorDecl decl) {
ASTNode$State state = state();
try { return decl.applicable(getArgList()) && decl.accessibleFrom(hostType()); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean decls_computed = false;
/**
* @apilevel internal
*/
protected SimpleSet decls_value;
/**
* @attribute syn
* @aspect MethodSignature15
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/MethodSignature.jrag:74
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet decls() {
if(decls_computed) {
return decls_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
decls_value = decls_compute();
if(isFinal && num == state().boundariesCrossed) decls_computed = true;
return decls_value;
}
/**
* @apilevel internal
*/
private SimpleSet decls_compute() {
return chooseConstructor(lookupConstructor(), getArgList());
}
/**
* @apilevel internal
*/
protected boolean decl_computed = false;
/**
* @apilevel internal
*/
protected ConstructorDecl decl_value;
/**
* @attribute syn
* @aspect ConstructScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:65
*/
@SuppressWarnings({"unchecked", "cast"})
public ConstructorDecl decl() {
if(decl_computed) {
return decl_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
decl_value = decl_compute();
if(isFinal && num == state().boundariesCrossed) decl_computed = true;
return decl_value;
}
/**
* @apilevel internal
*/
private ConstructorDecl decl_compute() {
SimpleSet decls = decls();
if(decls.size() == 1)
return (ConstructorDecl)decls.iterator().next();
return unknownConstructor();
}
/**
* @attribute syn
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:129
*/
public boolean validArgs() {
ASTNode$State state = state();
try {
for(int i = 0; i < getNumArg(); i++)
if(getArg(i).type().isUnknown())
return false;
return true;
}
finally {
}
}
/**
* @attribute syn
* @aspect Names
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/QualifiedNames.jrag:19
*/
public String name() {
ASTNode$State state = state();
try { return "this"; }
finally {
}
}
/**
* @attribute syn
* @aspect SyntacticClassification
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:56
*/
public NameType predNameType() {
ASTNode$State state = state();
try { return NameType.AMBIGUOUS_NAME; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean type_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl type_value;
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:285
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl type() {
if(type_computed) {
return type_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
type_value = type_compute();
if(isFinal && num == state().boundariesCrossed) type_computed = true;
return type_value;
}
/**
* @apilevel internal
*/
private TypeDecl type_compute() { return decl().type(); }
/**
* @attribute syn
* @aspect MethodSignature15
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/MethodSignature.jrag:326
*/
public int arity() {
ASTNode$State state = state();
try { return getNumArg(); }
finally {
}
}
/**
* @attribute syn
* @aspect VariableArityParameters
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/VariableArityParameters.jrag:47
*/
public boolean invokesVariableArityAsArray() {
ASTNode$State state = state();
try {
if(!decl().isVariableArity())
return false;
if(arity() != decl().arity())
return false;
return getArg(getNumArg()-1).type().methodInvocationConversionTo(decl().lastParameter().type());
}
finally {
}
}
/**
* @attribute inh
* @aspect ExceptionHandling
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:44
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean handlesException(TypeDecl exceptionType) {
ASTNode$State state = state();
boolean handlesException_TypeDecl_value = getParent().Define_boolean_handlesException(this, null, exceptionType);
return handlesException_TypeDecl_value;
}
/**
* @attribute inh
* @aspect ConstructScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:14
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection lookupConstructor() {
ASTNode$State state = state();
Collection lookupConstructor_value = getParent().Define_Collection_lookupConstructor(this, null);
return lookupConstructor_value;
}
/**
* @attribute inh
* @aspect ConstructScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:71
*/
@SuppressWarnings({"unchecked", "cast"})
public ConstructorDecl unknownConstructor() {
ASTNode$State state = state();
ConstructorDecl unknownConstructor_value = getParent().Define_ConstructorDecl_unknownConstructor(this, null);
return unknownConstructor_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupMethod.jrag:29
* @apilevel internal
*/
public Collection Define_Collection_lookupMethod(ASTNode caller, ASTNode child, String name) {
if(caller == getArgListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
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:88
* @apilevel internal
*/
public boolean Define_boolean_hasPackage(ASTNode caller, ASTNode child, String packageName) {
if(caller == getArgListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
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:254
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_lookupType(ASTNode caller, ASTNode child, String name) {
if(caller == getArgListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
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:133
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) {
if(caller == getArgListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
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:121
* @apilevel internal
*/
public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {
if(caller == getArgListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return NameType.EXPRESSION_NAME;
}
else { return getParent().Define_NameType_nameType(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:18
* @apilevel internal
*/
public String Define_String_methodHost(ASTNode caller, ASTNode child) {
{
int childIndex = this.getIndexOfChild(caller);
return unqualifiedScope().methodHost();
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:130
* @apilevel internal
*/
public boolean Define_boolean_inExplicitConstructorInvocation(ASTNode caller, ASTNode child) {
if(caller == getArgListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return true;
}
else { return getParent().Define_boolean_inExplicitConstructorInvocation(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 24,963
| 28.897006
| 152
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ConstructorDecl.java
|
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */
package soot.JastAddJ;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import soot.Local;
import soot.Scene;
import soot.SootMethod;
import soot.SootMethodRef;
import soot.jimple.Jimple;
import soot.jimple.JimpleBody;
/**
* @production ConstructorDecl : {@link BodyDecl} ::=
* <span class="component">{@link Modifiers}</span>
* <span class="component"><ID:String></span> <span class=
* "component">Parameter:{@link ParameterDeclaration}*</span>
* <span class="component">Exception:{@link Access}*</span>
* <span class=
* "component">[ConstructorInvocation:{@link Stmt}]</span>
* <span class="component">{@link Block}</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:75
*/
public class ConstructorDecl extends BodyDecl implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
accessibleFrom_TypeDecl_values = null;
isDAafter_Variable_values = null;
isDUafter_Variable_values = null;
throwsException_TypeDecl_values = null;
name_computed = false;
name_value = null;
signature_computed = false;
signature_value = null;
sameSignature_ConstructorDecl_values = null;
moreSpecificThan_ConstructorDecl_values = null;
parameterDeclaration_String_values = null;
circularThisInvocation_ConstructorDecl_values = null;
sourceConstructorDecl_computed = false;
sourceConstructorDecl_value = null;
sootMethod_computed = false;
sootMethod_value = null;
sootRef_computed = false;
sootRef_value = null;
localNumOfFirstParameter_computed = false;
offsetFirstEnclosingVariable_computed = false;
handlesException_TypeDecl_values = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({ "unchecked", "cast" })
public ConstructorDecl clone() throws CloneNotSupportedException {
ConstructorDecl node = (ConstructorDecl) super.clone();
node.accessibleFrom_TypeDecl_values = null;
node.isDAafter_Variable_values = null;
node.isDUafter_Variable_values = null;
node.throwsException_TypeDecl_values = null;
node.name_computed = false;
node.name_value = null;
node.signature_computed = false;
node.signature_value = null;
node.sameSignature_ConstructorDecl_values = null;
node.moreSpecificThan_ConstructorDecl_values = null;
node.parameterDeclaration_String_values = null;
node.circularThisInvocation_ConstructorDecl_values = null;
node.sourceConstructorDecl_computed = false;
node.sourceConstructorDecl_value = null;
node.sootMethod_computed = false;
node.sootMethod_value = null;
node.sootRef_computed = false;
node.sootRef_value = null;
node.localNumOfFirstParameter_computed = false;
node.offsetFirstEnclosingVariable_computed = false;
node.handlesException_TypeDecl_values = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({ "unchecked", "cast" })
public ConstructorDecl copy() {
try {
ConstructorDecl node = (ConstructorDecl) 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 ConstructorDecl fullCopy() {
ConstructorDecl tree = (ConstructorDecl) 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 ConstructorDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:144
*/
public boolean applicable(List argList) {
if (getNumParameter() != argList.getNumChild())
return false;
for (int i = 0; i < getNumParameter(); i++) {
TypeDecl arg = ((Expr) argList.getChild(i)).type();
TypeDecl parameter = getParameter(i).type();
if (!arg.instanceOf(parameter)) {
return false;
}
}
return true;
}
/**
* Flag to indicate if this constructor is an auto-generated default
* constructor. Default constructors are not pretty printed.
*
* @ast method
* @aspect ImplicitConstructor
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:171
*/
/**
* Flag to indicate if this constructor is an auto-generated default
* constructor. Default constructors are not pretty printed.
*/
private boolean isDefaultConstructor = false;
/**
* Set the default constructor flag. Causes this constructor to not be
* pretty printed.
*
* @ast method
* @aspect ImplicitConstructor
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:176
*/
public void setDefaultConstructor() {
isDefaultConstructor = true;
}
/**
* @ast method
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:110
*/
public void checkModifiers() {
super.checkModifiers();
}
/**
* @ast method
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:73
*/
public void nameCheck() {
super.nameCheck();
// 8.8
if (!hostType().name().equals(name()))
error("constructor " + name() + " does not have the same name as the simple name of the host class "
+ hostType().name());
// 8.8.2
if (hostType().lookupConstructor(this) != this)
error("constructor with signature " + signature() + " is multiply declared in type "
+ hostType().typeName());
if (circularThisInvocation(this))
error("The constructor " + signature() + " may not directly or indirectly invoke itself");
}
/**
* @ast method
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:119
*/
public void toString(StringBuffer s) {
if (isDefaultConstructor())
return;
s.append(indent());
getModifiers().toString(s);
s.append(name() + "(");
if (getNumParameter() > 0) {
getParameter(0).toString(s);
for (int i = 1; i < getNumParameter(); i++) {
s.append(", ");
getParameter(i).toString(s);
}
}
s.append(")");
if (getNumException() > 0) {
s.append(" throws ");
getException(0).toString(s);
for (int i = 1; i < getNumException(); i++) {
s.append(", ");
getException(i).toString(s);
}
}
s.append(" {");
if (hasConstructorInvocation()) {
getConstructorInvocation().toString(s);
}
for (int i = 0; i < getBlock().getNumStmt(); i++) {
getBlock().getStmt(i).toString(s);
}
s.append(indent());
s.append("}");
}
/**
* @ast method
* @aspect TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:424
*/
public void typeCheck() {
// 8.8.4 (8.4.4)
TypeDecl exceptionType = typeThrowable();
for (int i = 0; i < getNumException(); i++) {
TypeDecl typeDecl = getException(i).type();
if (!typeDecl.instanceOf(exceptionType))
error(signature() + " throws non throwable type " + typeDecl.fullName());
}
}
/**
* @ast method
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:138
*/
protected void transformEnumConstructors() {
// make sure constructor is private
Modifiers newModifiers = new Modifiers(new List());
for (int i = 0; i < getModifiers().getNumModifier(); ++i) {
String modifier = getModifiers().getModifier(i).getID();
if (modifier.equals("public") || modifier.equals("private") || modifier.equals("protected"))
continue;
newModifiers.addModifier(new Modifier(modifier));
}
newModifiers.addModifier(new Modifier("private"));
setModifiers(newModifiers);
// add implicit super constructor access since we are traversing
// without doing rewrites
if (!hasConstructorInvocation()) {
setConstructorInvocation(new ExprStmt(new SuperConstructorAccess("super", new List())));
}
super.transformEnumConstructors();
getParameterList().insertChild(new ParameterDeclaration(new TypeAccess("java.lang", "String"), "@p0"), 0);
getParameterList().insertChild(new ParameterDeclaration(new TypeAccess("int"), "@p1"), 1);
}
/**
* @ast method
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1283
*/
public BodyDecl substitutedBodyDecl(Parameterization parTypeDecl) {
ConstructorDecl c = new ConstructorDeclSubstituted((Modifiers) getModifiers().fullCopy(), getID(),
getParameterList().substitute(parTypeDecl), getExceptionList().substitute(parTypeDecl), new Opt(),
new Block(), this);
return c;
}
/**
* @ast method
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:457
*/
// add val$name as parameters to the constructor
protected boolean addEnclosingVariables = true;
/**
* @ast method
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:458
*/
public void addEnclosingVariables() {
if (!addEnclosingVariables)
return;
addEnclosingVariables = false;
hostType().addEnclosingVariables();
for (Iterator iter = hostType().enclosingVariables().iterator(); iter.hasNext();) {
Variable v = (Variable) iter.next();
getParameterList().add(new ParameterDeclaration(v.type(), "val$" + v.name()));
}
}
/**
* @ast method
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:492
*/
public ConstructorDecl createAccessor() {
ConstructorDecl c = (ConstructorDecl) hostType().getAccessor(this, "constructor");
if (c != null)
return c;
// make sure enclosing varibles are added as parameters prior to
// building accessor
addEnclosingVariables();
Modifiers modifiers = new Modifiers(new List());
modifiers.addModifier(new Modifier("synthetic"));
modifiers.addModifier(new Modifier("public"));
List parameters = createAccessorParameters();
List exceptionList = new List();
for (int i = 0; i < getNumException(); i++)
exceptionList.add(getException(i).type().createQualifiedAccess());
// add all parameters as arguments except for the dummy parameter
List args = new List();
for (int i = 0; i < parameters.getNumChildNoTransform() - 1; i++)
args.add(new VarAccess(((ParameterDeclaration) parameters.getChildNoTransform(i)).name()));
ConstructorAccess access = new ConstructorAccess("this", args);
access.addEnclosingVariables = false;
c = new ConstructorDecl(modifiers, name(), parameters, exceptionList, new Opt(new ExprStmt(access)),
new Block(new List().add(new ReturnStmt(new Opt()))));
c = hostType().addConstructor(c);
c.addEnclosingVariables = false;
hostType().addAccessor(this, "constructor", c);
return c;
}
/**
* @ast method
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:536
*/
protected List createAccessorParameters() {
List parameters = new List();
for (int i = 0; i < getNumParameter(); i++)
parameters.add(new ParameterDeclaration(getParameter(i).type(), getParameter(i).name()));
parameters.add(
new ParameterDeclaration(createAnonymousJavaTypeDecl().createBoundAccess(), ("p" + getNumParameter())));
return parameters;
}
/**
* @ast method
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:544
*/
protected TypeDecl createAnonymousJavaTypeDecl() {
ClassDecl classDecl = new ClassDecl(new Modifiers(new List().add(new Modifier("synthetic"))),
"" + hostType().nextAnonymousIndex(), new Opt(), new List(), new List());
classDecl = hostType().addMemberClass(classDecl);
hostType().addNestedType(classDecl);
return classDecl;
}
/**
* @ast method
* @aspect Transformations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Transformations.jrag:119
*/
public void transformation() {
// this$val as fields and constructor parameters
addEnclosingVariables();
super.transformation();
}
/**
* @ast method
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:234
*/
public void jimplify1phase2() {
String name = "<init>";
ArrayList parameters = new ArrayList();
ArrayList paramnames = new ArrayList();
// this$0
TypeDecl typeDecl = hostType();
if (typeDecl.needsEnclosing())
parameters.add(typeDecl.enclosingType().getSootType());
if (typeDecl.needsSuperEnclosing()) {
TypeDecl superClass = ((ClassDecl) typeDecl).superclass();
parameters.add(superClass.enclosingType().getSootType());
}
// args
for (int i = 0; i < getNumParameter(); i++) {
parameters.add(getParameter(i).type().getSootType());
paramnames.add(getParameter(i).name());
}
soot.Type returnType = soot.VoidType.v();
int modifiers = sootTypeModifiers();
ArrayList throwtypes = new ArrayList();
for (int i = 0; i < getNumException(); i++)
throwtypes.add(getException(i).type().getSootClassDecl());
String signature = SootMethod.getSubSignature(name, parameters, returnType);
if (!hostType().getSootClassDecl().declaresMethod(signature)) {
SootMethod m = Scene.v().makeSootMethod(name, parameters, returnType, modifiers, throwtypes);
hostType().getSootClassDecl().addMethod(m);
m.addTag(new soot.tagkit.ParamNamesTag(paramnames));
sootMethod = m;
} else {
sootMethod = hostType().getSootClassDecl().getMethod(signature);
}
addAttributes();
}
/**
* @ast method
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:294
*/
public SootMethod sootMethod;
/**
* @ast method
* @aspect AnnotationsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:57
*/
public void addAttributes() {
super.addAttributes();
ArrayList c = new ArrayList();
getModifiers().addRuntimeVisibleAnnotationsAttribute(c);
getModifiers().addRuntimeInvisibleAnnotationsAttribute(c);
addRuntimeVisibleParameterAnnotationsAttribute(c);
addRuntimeInvisibleParameterAnnotationsAttribute(c);
addSourceLevelParameterAnnotationsAttribute(c);
getModifiers().addSourceOnlyAnnotations(c);
for (Iterator iter = c.iterator(); iter.hasNext();) {
soot.tagkit.Tag tag = (soot.tagkit.Tag) iter.next();
sootMethod.addTag(tag);
}
}
/**
* @ast method
* @aspect AnnotationsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:186
*/
public void addRuntimeVisibleParameterAnnotationsAttribute(Collection c) {
boolean foundVisibleAnnotations = false;
Collection annotations = new ArrayList(getNumParameter());
for (int i = 0; i < getNumParameter(); i++) {
Collection a = getParameter(i).getModifiers().runtimeVisibleAnnotations();
if (!a.isEmpty())
foundVisibleAnnotations = true;
soot.tagkit.VisibilityAnnotationTag tag = new soot.tagkit.VisibilityAnnotationTag(
soot.tagkit.AnnotationConstants.RUNTIME_VISIBLE);
for (Iterator iter = a.iterator(); iter.hasNext();) {
Annotation annotation = (Annotation) iter.next();
ArrayList elements = new ArrayList(1);
annotation.appendAsAttributeTo(elements);
tag.addAnnotation((soot.tagkit.AnnotationTag) elements.get(0));
}
annotations.add(tag);
}
if (foundVisibleAnnotations) {
soot.tagkit.VisibilityParameterAnnotationTag tag = new soot.tagkit.VisibilityParameterAnnotationTag(
annotations.size(), soot.tagkit.AnnotationConstants.RUNTIME_VISIBLE);
for (Iterator iter = annotations.iterator(); iter.hasNext();) {
tag.addVisibilityAnnotation((soot.tagkit.VisibilityAnnotationTag) iter.next());
}
c.add(tag);
}
}
/**
* @ast method
* @aspect AnnotationsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:242
*/
public void addRuntimeInvisibleParameterAnnotationsAttribute(Collection c) {
boolean foundVisibleAnnotations = false;
Collection annotations = new ArrayList(getNumParameter());
for (int i = 0; i < getNumParameter(); i++) {
Collection a = getParameter(i).getModifiers().runtimeInvisibleAnnotations();
if (!a.isEmpty())
foundVisibleAnnotations = true;
soot.tagkit.VisibilityAnnotationTag tag = new soot.tagkit.VisibilityAnnotationTag(
soot.tagkit.AnnotationConstants.RUNTIME_INVISIBLE);
for (Iterator iter = a.iterator(); iter.hasNext();) {
Annotation annotation = (Annotation) iter.next();
ArrayList elements = new ArrayList(1);
annotation.appendAsAttributeTo(elements);
tag.addAnnotation((soot.tagkit.AnnotationTag) elements.get(0));
}
annotations.add(tag);
}
if (foundVisibleAnnotations) {
soot.tagkit.VisibilityParameterAnnotationTag tag = new soot.tagkit.VisibilityParameterAnnotationTag(
annotations.size(), soot.tagkit.AnnotationConstants.RUNTIME_INVISIBLE);
for (Iterator iter = annotations.iterator(); iter.hasNext();) {
tag.addVisibilityAnnotation((soot.tagkit.VisibilityAnnotationTag) iter.next());
}
c.add(tag);
}
}
/**
* @ast method
* @aspect AnnotationsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:281
*/
public void addSourceLevelParameterAnnotationsAttribute(Collection c) {
boolean foundVisibleAnnotations = false;
Collection annotations = new ArrayList(getNumParameter());
for (int i = 0; i < getNumParameter(); i++) {
getParameter(i).getModifiers().addSourceOnlyAnnotations(c);
}
}
/**
* @ast method
*
*/
public ConstructorDecl() {
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[5];
setChild(new List(), 1);
setChild(new List(), 2);
setChild(new Opt(), 3);
}
/**
* @ast method
*
*/
public ConstructorDecl(Modifiers p0, String p1, List<ParameterDeclaration> p2, List<Access> p3, Opt<Stmt> p4,
Block p5) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setChild(p4, 3);
setChild(p5, 4);
}
/**
* @ast method
*
*/
public ConstructorDecl(Modifiers p0, beaver.Symbol p1, List<ParameterDeclaration> p2, List<Access> p3, Opt<Stmt> p4,
Block p5) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setChild(p4, 3);
setChild(p5, 4);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 5;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return true;
}
/**
* 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.
* <p>
* <em>This method does not invoke AST transformations.</em>
* </p>
*
* @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;
}
/**
* @apilevel internal
* @ast method
*
*/
/**
* @apilevel internal
*/
protected String tokenString_ID;
/**
* @ast method
*
*/
public int IDstart;
/**
* @ast method
*
*/
public int IDend;
/**
* 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 Parameter list.
*
* @param list
* The new list node to be used as the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public void setParameterList(List<ParameterDeclaration> list) {
setChild(list, 1);
}
/**
* Retrieves the number of children in the Parameter list.
*
* @return Number of children in the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public int getNumParameter() {
return getParameterList().getNumChild();
}
/**
* Retrieves the number of children in the Parameter list. Calling this
* method will not trigger rewrites..
*
* @return Number of children in the Parameter list.
* @apilevel low-level
* @ast method
*
*/
public int getNumParameterNoTransform() {
return getParameterListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Parameter list..
*
* @param i
* Index of the element to return.
* @return The element at position {@code i} in the Parameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({ "unchecked", "cast" })
public ParameterDeclaration getParameter(int i) {
return (ParameterDeclaration) getParameterList().getChild(i);
}
/**
* Append an element to the Parameter list.
*
* @param node
* The element to append to the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public void addParameter(ParameterDeclaration node) {
List<ParameterDeclaration> list = (parent == null || state == null) ? getParameterListNoTransform()
: getParameterList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addParameterNoTransform(ParameterDeclaration node) {
List<ParameterDeclaration> list = getParameterListNoTransform();
list.addChild(node);
}
/**
* Replaces the Parameter 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 setParameter(ParameterDeclaration node, int i) {
List<ParameterDeclaration> list = getParameterList();
list.setChild(node, i);
}
/**
* Retrieves the Parameter list.
*
* @return The node representing the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public List<ParameterDeclaration> getParameters() {
return getParameterList();
}
/**
* Retrieves the Parameter list.
* <p>
* <em>This method does not invoke AST transformations.</em>
* </p>
*
* @return The node representing the Parameter list.
* @apilevel low-level
* @ast method
*
*/
public List<ParameterDeclaration> getParametersNoTransform() {
return getParameterListNoTransform();
}
/**
* Retrieves the Parameter list.
*
* @return The node representing the Parameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({ "unchecked", "cast" })
public List<ParameterDeclaration> getParameterList() {
List<ParameterDeclaration> list = (List<ParameterDeclaration>) getChild(1);
list.getNumChild();
return list;
}
/**
* Retrieves the Parameter list.
* <p>
* <em>This method does not invoke AST transformations.</em>
* </p>
*
* @return The node representing the Parameter list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({ "unchecked", "cast" })
public List<ParameterDeclaration> getParameterListNoTransform() {
return (List<ParameterDeclaration>) getChildNoTransform(1);
}
/**
* Replaces the Exception list.
*
* @param list
* The new list node to be used as the Exception list.
* @apilevel high-level
* @ast method
*
*/
public void setExceptionList(List<Access> list) {
setChild(list, 2);
}
/**
* Retrieves the number of children in the Exception list.
*
* @return Number of children in the Exception list.
* @apilevel high-level
* @ast method
*
*/
public int getNumException() {
return getExceptionList().getNumChild();
}
/**
* Retrieves the number of children in the Exception list. Calling this
* method will not trigger rewrites..
*
* @return Number of children in the Exception list.
* @apilevel low-level
* @ast method
*
*/
public int getNumExceptionNoTransform() {
return getExceptionListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Exception list..
*
* @param i
* Index of the element to return.
* @return The element at position {@code i} in the Exception list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({ "unchecked", "cast" })
public Access getException(int i) {
return (Access) getExceptionList().getChild(i);
}
/**
* Append an element to the Exception list.
*
* @param node
* The element to append to the Exception list.
* @apilevel high-level
* @ast method
*
*/
public void addException(Access node) {
List<Access> list = (parent == null || state == null) ? getExceptionListNoTransform() : getExceptionList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addExceptionNoTransform(Access node) {
List<Access> list = getExceptionListNoTransform();
list.addChild(node);
}
/**
* Replaces the Exception 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 setException(Access node, int i) {
List<Access> list = getExceptionList();
list.setChild(node, i);
}
/**
* Retrieves the Exception list.
*
* @return The node representing the Exception list.
* @apilevel high-level
* @ast method
*
*/
public List<Access> getExceptions() {
return getExceptionList();
}
/**
* Retrieves the Exception list.
* <p>
* <em>This method does not invoke AST transformations.</em>
* </p>
*
* @return The node representing the Exception list.
* @apilevel low-level
* @ast method
*
*/
public List<Access> getExceptionsNoTransform() {
return getExceptionListNoTransform();
}
/**
* Retrieves the Exception list.
*
* @return The node representing the Exception list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({ "unchecked", "cast" })
public List<Access> getExceptionList() {
List<Access> list = (List<Access>) getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the Exception list.
* <p>
* <em>This method does not invoke AST transformations.</em>
* </p>
*
* @return The node representing the Exception list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({ "unchecked", "cast" })
public List<Access> getExceptionListNoTransform() {
return (List<Access>) getChildNoTransform(2);
}
/**
* Replaces the optional node for the ConstructorInvocation child. This is
* the {@code Opt} node containing the child ConstructorInvocation, not the
* actual child!
*
* @param opt
* The new node to be used as the optional node for the
* ConstructorInvocation child.
* @apilevel low-level
* @ast method
*
*/
public void setConstructorInvocationOpt(Opt<Stmt> opt) {
setChild(opt, 3);
}
/**
* Check whether the optional ConstructorInvocation child exists.
*
* @return {@code true} if the optional ConstructorInvocation child exists,
* {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasConstructorInvocation() {
return getConstructorInvocationOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) ConstructorInvocation child.
*
* @return The ConstructorInvocation child, if it exists. Returns
* {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({ "unchecked", "cast" })
public Stmt getConstructorInvocation() {
return (Stmt) getConstructorInvocationOpt().getChild(0);
}
/**
* Replaces the (optional) ConstructorInvocation child.
*
* @param node
* The new node to be used as the ConstructorInvocation child.
* @apilevel high-level
* @ast method
*
*/
public void setConstructorInvocation(Stmt node) {
getConstructorInvocationOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({ "unchecked", "cast" })
public Opt<Stmt> getConstructorInvocationOpt() {
return (Opt<Stmt>) getChild(3);
}
/**
* Retrieves the optional node for child ConstructorInvocation. This is the
* {@code Opt} node containing the child ConstructorInvocation, not the
* actual child!
* <p>
* <em>This method does not invoke AST transformations.</em>
* </p>
*
* @return The optional node for child ConstructorInvocation.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({ "unchecked", "cast" })
public Opt<Stmt> getConstructorInvocationOptNoTransform() {
return (Opt<Stmt>) getChildNoTransform(3);
}
/**
* Replaces the Block child.
*
* @param node
* The new node to replace the Block child.
* @apilevel high-level
* @ast method
*
*/
public void setBlock(Block node) {
setChild(node, 4);
}
/**
* Retrieves the Block child.
*
* @return The current node used as the Block child.
* @apilevel high-level
* @ast method
*
*/
public Block getBlock() {
return (Block) getChild(4);
}
/**
* Retrieves the Block child.
* <p>
* <em>This method does not invoke AST transformations.</em>
* </p>
*
* @return The current node used as the Block child.
* @apilevel low-level
* @ast method
*
*/
public Block getBlockNoTransform() {
return (Block) getChildNoTransform(4);
}
/**
* @ast method
* @aspect EmitJimpleRefinements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/SootJastAddJ/EmitJimpleRefinements.jrag:121
*/
public void jimplify2() {
if (!generate() || sootMethod().hasActiveBody() || (sootMethod().getSource() != null
&& (sootMethod().getSource() instanceof soot.coffi.CoffiMethodSource)))
return;
JimpleBody body = Jimple.v().newBody(sootMethod());
sootMethod().setActiveBody(body);
Body b = new Body(hostType(), body, this);
b.setLine(this);
for (int i = 0; i < getNumParameter(); i++)
getParameter(i).jimplify2(b);
boolean needsInit = true;
if (hasConstructorInvocation()) {
getConstructorInvocation().jimplify2(b);
Stmt stmt = getConstructorInvocation();
if (stmt instanceof ExprStmt) {
ExprStmt exprStmt = (ExprStmt) stmt;
Expr expr = exprStmt.getExpr();
if (!expr.isSuperConstructorAccess())
needsInit = false;
}
}
if (hostType().needsEnclosing()) {
TypeDecl type = hostType().enclosingType();
b.add(Jimple.v().newAssignStmt(
Jimple.v().newInstanceFieldRef(b.emitThis(hostType()),
hostType().getSootField("this$0", type).makeRef()),
asLocal(b, Jimple.v().newParameterRef(type.getSootType(), 0))));
}
for (Iterator iter = hostType().enclosingVariables().iterator(); iter.hasNext();) {
Variable v = (Variable) iter.next();
ParameterDeclaration p = (ParameterDeclaration) parameterDeclaration("val$" + v.name()).iterator().next();
b.add(Jimple.v().newAssignStmt(Jimple.v().newInstanceFieldRef(b.emitThis(hostType()), Scene.v()
.makeFieldRef(hostType().getSootClassDecl(), "val$" + v.name(), v.type().getSootType(), false)
// hostType().getSootClassDecl().getField("val$" + v.name(),
// v.type().getSootType()).makeRef()
), p.local));
}
if (needsInit) {
TypeDecl typeDecl = hostType();
for (int i = 0; i < typeDecl.getNumBodyDecl(); i++) {
BodyDecl bodyDecl = typeDecl.getBodyDecl(i);
if (bodyDecl instanceof FieldDeclaration && bodyDecl.generate()) {
FieldDeclaration f = (FieldDeclaration) bodyDecl;
if (!f.isStatic() && f.hasInit()) {
soot.Local base = b.emitThis(hostType());
Local l = asLocal(b, f.getInit().type().emitCastTo(b, f.getInit(), f.type()), // AssignConversion
f.type().getSootType());
b.setLine(f);
b.add(Jimple.v().newAssignStmt(Jimple.v().newInstanceFieldRef(base, f.sootRef()), l));
}
} else if (bodyDecl instanceof InstanceInitializer && bodyDecl.generate()) {
bodyDecl.jimplify2(b);
}
}
}
getBlock().jimplify2(b);
b.add(Jimple.v().newReturnVoidStmt());
}
/**
* @ast method
* @aspect ConstructorDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:136
*/
private boolean refined_ConstructorDecl_ConstructorDecl_moreSpecificThan_ConstructorDecl(ConstructorDecl m) {
for (int i = 0; i < getNumParameter(); i++) {
if (!getParameter(i).type().instanceOf(m.getParameter(i).type()))
return false;
}
return true;
}
protected java.util.Map accessibleFrom_TypeDecl_values;
/**
* @attribute syn
* @aspect AccessControl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AccessControl.jrag:94
*/
@SuppressWarnings({ "unchecked", "cast" })
public boolean accessibleFrom(TypeDecl type) {
Object _parameters = type;
if (accessibleFrom_TypeDecl_values == null)
accessibleFrom_TypeDecl_values = new java.util.HashMap(4);
if (accessibleFrom_TypeDecl_values.containsKey(_parameters)) {
return ((Boolean) accessibleFrom_TypeDecl_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean accessibleFrom_TypeDecl_value = accessibleFrom_compute(type);
if (isFinal && num == state().boundariesCrossed)
accessibleFrom_TypeDecl_values.put(_parameters, Boolean.valueOf(accessibleFrom_TypeDecl_value));
return accessibleFrom_TypeDecl_value;
}
/**
* @apilevel internal
*/
private boolean accessibleFrom_compute(TypeDecl type) {
if (!hostType().accessibleFrom(type))
return false;
else if (isPublic())
return true;
else if (isProtected()) {
return true;
} else if (isPrivate()) {
return hostType().topLevelType() == type.topLevelType();
} else
return hostPackage().equals(type.hostPackage());
}
protected java.util.Map isDAafter_Variable_values;
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:295
*/
@SuppressWarnings({ "unchecked", "cast" })
public boolean isDAafter(Variable v) {
Object _parameters = v;
if (isDAafter_Variable_values == null)
isDAafter_Variable_values = new java.util.HashMap(4);
if (isDAafter_Variable_values.containsKey(_parameters)) {
return ((Boolean) isDAafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDAafter_Variable_value = isDAafter_compute(v);
if (isFinal && num == state().boundariesCrossed)
isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value));
return isDAafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDAafter_compute(Variable v) {
return getBlock().isDAafter(v) && getBlock().checkReturnDA(v);
}
protected java.util.Map isDUafter_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:752
*/
@SuppressWarnings({ "unchecked", "cast" })
public boolean isDUafter(Variable v) {
Object _parameters = v;
if (isDUafter_Variable_values == null)
isDUafter_Variable_values = new java.util.HashMap(4);
if (isDUafter_Variable_values.containsKey(_parameters)) {
return ((Boolean) isDUafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDUafter_Variable_value = isDUafter_compute(v);
if (isFinal && num == state().boundariesCrossed)
isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value));
return isDUafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDUafter_compute(Variable v) {
return getBlock().isDUafter(v) && getBlock().checkReturnDU(v);
}
protected java.util.Map throwsException_TypeDecl_values;
/**
* @attribute syn
* @aspect ExceptionHandling
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:159
*/
@SuppressWarnings({ "unchecked", "cast" })
public boolean throwsException(TypeDecl exceptionType) {
Object _parameters = exceptionType;
if (throwsException_TypeDecl_values == null)
throwsException_TypeDecl_values = new java.util.HashMap(4);
if (throwsException_TypeDecl_values.containsKey(_parameters)) {
return ((Boolean) throwsException_TypeDecl_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean throwsException_TypeDecl_value = throwsException_compute(exceptionType);
if (isFinal && num == state().boundariesCrossed)
throwsException_TypeDecl_values.put(_parameters, Boolean.valueOf(throwsException_TypeDecl_value));
return throwsException_TypeDecl_value;
}
/**
* @apilevel internal
*/
private boolean throwsException_compute(TypeDecl exceptionType) {
for (int i = 0; i < getNumException(); i++)
if (exceptionType.instanceOf(getException(i).type()))
return true;
return false;
}
/**
* @apilevel internal
*/
protected boolean name_computed = false;
/**
* @apilevel internal
*/
protected String name_value;
/**
* @attribute syn
* @aspect ConstructorDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:110
*/
@SuppressWarnings({ "unchecked", "cast" })
public String name() {
if (name_computed) {
return name_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
name_value = name_compute();
if (isFinal && num == state().boundariesCrossed)
name_computed = true;
return name_value;
}
/**
* @apilevel internal
*/
private String name_compute() {
return getID();
}
/**
* @apilevel internal
*/
protected boolean signature_computed = false;
/**
* @apilevel internal
*/
protected String signature_value;
/**
* @attribute syn
* @aspect ConstructorDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:112
*/
@SuppressWarnings({ "unchecked", "cast" })
public String signature() {
if (signature_computed) {
return signature_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
signature_value = signature_compute();
if (isFinal && num == state().boundariesCrossed)
signature_computed = true;
return signature_value;
}
/**
* @apilevel internal
*/
private String signature_compute() {
StringBuffer s = new StringBuffer();
s.append(name() + "(");
for (int i = 0; i < getNumParameter(); i++) {
s.append(getParameter(i));
if (i != getNumParameter() - 1)
s.append(", ");
}
s.append(")");
return s.toString();
}
protected java.util.Map sameSignature_ConstructorDecl_values;
/**
* @attribute syn
* @aspect ConstructorDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:125
*/
@SuppressWarnings({ "unchecked", "cast" })
public boolean sameSignature(ConstructorDecl c) {
Object _parameters = c;
if (sameSignature_ConstructorDecl_values == null)
sameSignature_ConstructorDecl_values = new java.util.HashMap(4);
if (sameSignature_ConstructorDecl_values.containsKey(_parameters)) {
return ((Boolean) sameSignature_ConstructorDecl_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean sameSignature_ConstructorDecl_value = sameSignature_compute(c);
if (isFinal && num == state().boundariesCrossed)
sameSignature_ConstructorDecl_values.put(_parameters, Boolean.valueOf(sameSignature_ConstructorDecl_value));
return sameSignature_ConstructorDecl_value;
}
/**
* @apilevel internal
*/
private boolean sameSignature_compute(ConstructorDecl c) {
if (!name().equals(c.name()))
return false;
if (c.getNumParameter() != getNumParameter())
return false;
for (int i = 0; i < getNumParameter(); i++)
if (!c.getParameter(i).type().equals(getParameter(i).type()))
return false;
return true;
}
protected java.util.Map moreSpecificThan_ConstructorDecl_values;
/**
* @attribute syn
* @aspect MethodSignature15
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/MethodSignature.jrag:168
*/
@SuppressWarnings({ "unchecked", "cast" })
public boolean moreSpecificThan(ConstructorDecl m) {
Object _parameters = m;
if (moreSpecificThan_ConstructorDecl_values == null)
moreSpecificThan_ConstructorDecl_values = new java.util.HashMap(4);
if (moreSpecificThan_ConstructorDecl_values.containsKey(_parameters)) {
return ((Boolean) moreSpecificThan_ConstructorDecl_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean moreSpecificThan_ConstructorDecl_value = moreSpecificThan_compute(m);
if (isFinal && num == state().boundariesCrossed)
moreSpecificThan_ConstructorDecl_values.put(_parameters,
Boolean.valueOf(moreSpecificThan_ConstructorDecl_value));
return moreSpecificThan_ConstructorDecl_value;
}
/**
* @apilevel internal
*/
private boolean moreSpecificThan_compute(ConstructorDecl m) {
if (!isVariableArity() && !m.isVariableArity())
return refined_ConstructorDecl_ConstructorDecl_moreSpecificThan_ConstructorDecl(m);
int num = Math.max(getNumParameter(), m.getNumParameter());
for (int i = 0; i < num; i++) {
TypeDecl t1 = i < getNumParameter() - 1 ? getParameter(i).type()
: getParameter(getNumParameter() - 1).type().componentType();
TypeDecl t2 = i < m.getNumParameter() - 1 ? m.getParameter(i).type()
: m.getParameter(m.getNumParameter() - 1).type().componentType();
if (!t1.instanceOf(t2))
return false;
}
return true;
}
/**
* @return true if this is an auto-generated default constructor
* @attribute syn
* @aspect ImplicitConstructor
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:182
*/
public boolean isDefaultConstructor() {
ASTNode$State state = state();
try {
return isDefaultConstructor;
} finally {
}
}
protected java.util.Map parameterDeclaration_String_values;
/**
* @attribute syn
* @aspect VariableScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:105
*/
@SuppressWarnings({ "unchecked", "cast" })
public SimpleSet parameterDeclaration(String name) {
Object _parameters = name;
if (parameterDeclaration_String_values == null)
parameterDeclaration_String_values = new java.util.HashMap(4);
if (parameterDeclaration_String_values.containsKey(_parameters)) {
return (SimpleSet) parameterDeclaration_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet parameterDeclaration_String_value = parameterDeclaration_compute(name);
if (isFinal && num == state().boundariesCrossed)
parameterDeclaration_String_values.put(_parameters, parameterDeclaration_String_value);
return parameterDeclaration_String_value;
}
/**
* @apilevel internal
*/
private SimpleSet parameterDeclaration_compute(String name) {
for (int i = 0; i < getNumParameter(); i++)
if (getParameter(i).name().equals(name))
return (ParameterDeclaration) getParameter(i);
return SimpleSet.emptySet;
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:217
*/
public boolean isSynthetic() {
ASTNode$State state = state();
try {
return getModifiers().isSynthetic();
} finally {
}
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:235
*/
public boolean isPublic() {
ASTNode$State state = state();
try {
return getModifiers().isPublic();
} finally {
}
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:236
*/
public boolean isPrivate() {
ASTNode$State state = state();
try {
return getModifiers().isPrivate();
} finally {
}
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:237
*/
public boolean isProtected() {
ASTNode$State state = state();
try {
return getModifiers().isProtected();
} finally {
}
}
protected java.util.Map circularThisInvocation_ConstructorDecl_values;
/**
* @attribute syn
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:88
*/
@SuppressWarnings({ "unchecked", "cast" })
public boolean circularThisInvocation(ConstructorDecl decl) {
Object _parameters = decl;
if (circularThisInvocation_ConstructorDecl_values == null)
circularThisInvocation_ConstructorDecl_values = new java.util.HashMap(4);
ASTNode$State.CircularValue _value;
if (circularThisInvocation_ConstructorDecl_values.containsKey(_parameters)) {
Object _o = circularThisInvocation_ConstructorDecl_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();
circularThisInvocation_ConstructorDecl_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_circularThisInvocation_ConstructorDecl_value;
do {
_value.visited = new Integer(state.CIRCLE_INDEX);
state.CHANGE = false;
new_circularThisInvocation_ConstructorDecl_value = circularThisInvocation_compute(decl);
if (new_circularThisInvocation_ConstructorDecl_value != ((Boolean) _value.value).booleanValue()) {
state.CHANGE = true;
_value.value = Boolean.valueOf(new_circularThisInvocation_ConstructorDecl_value);
}
state.CIRCLE_INDEX++;
} while (state.CHANGE);
if (isFinal && num == state().boundariesCrossed) {
circularThisInvocation_ConstructorDecl_values.put(_parameters,
new_circularThisInvocation_ConstructorDecl_value);
} else {
circularThisInvocation_ConstructorDecl_values.remove(_parameters);
state.RESET_CYCLE = true;
circularThisInvocation_compute(decl);
state.RESET_CYCLE = false;
}
state.IN_CIRCLE = false;
return new_circularThisInvocation_ConstructorDecl_value;
}
if (!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) {
_value.visited = new Integer(state.CIRCLE_INDEX);
boolean new_circularThisInvocation_ConstructorDecl_value = circularThisInvocation_compute(decl);
if (state.RESET_CYCLE) {
circularThisInvocation_ConstructorDecl_values.remove(_parameters);
} else if (new_circularThisInvocation_ConstructorDecl_value != ((Boolean) _value.value).booleanValue()) {
state.CHANGE = true;
_value.value = new_circularThisInvocation_ConstructorDecl_value;
}
return new_circularThisInvocation_ConstructorDecl_value;
}
return ((Boolean) _value.value).booleanValue();
}
/**
* @apilevel internal
*/
private boolean circularThisInvocation_compute(ConstructorDecl decl) {
if (hasConstructorInvocation()) {
Expr e = ((ExprStmt) getConstructorInvocation()).getExpr();
if (e instanceof ConstructorAccess) {
ConstructorDecl constructorDecl = ((ConstructorAccess) e).decl();
if (constructorDecl == decl)
return true;
return constructorDecl.circularThisInvocation(decl);
}
}
return false;
}
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:268
*/
public TypeDecl type() {
ASTNode$State state = state();
try {
return unknownType();
} finally {
}
}
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:271
*/
public boolean isVoid() {
ASTNode$State state = state();
try {
return true;
} finally {
}
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:283
*/
public boolean hasAnnotationSuppressWarnings(String s) {
ASTNode$State state = state();
try {
return getModifiers().hasAnnotationSuppressWarnings(s);
} finally {
}
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:324
*/
public boolean isDeprecated() {
ASTNode$State state = state();
try {
return getModifiers().hasDeprecatedAnnotation();
} finally {
}
}
/**
* @apilevel internal
*/
protected boolean sourceConstructorDecl_computed = false;
/**
* @apilevel internal
*/
protected ConstructorDecl sourceConstructorDecl_value;
/**
* @attribute syn
* @aspect SourceDeclarations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1515
*/
@SuppressWarnings({ "unchecked", "cast" })
public ConstructorDecl sourceConstructorDecl() {
if (sourceConstructorDecl_computed) {
return sourceConstructorDecl_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
sourceConstructorDecl_value = sourceConstructorDecl_compute();
if (isFinal && num == state().boundariesCrossed)
sourceConstructorDecl_computed = true;
return sourceConstructorDecl_value;
}
/**
* @apilevel internal
*/
private ConstructorDecl sourceConstructorDecl_compute() {
return this;
}
/**
* @attribute syn
* @aspect MethodSignature15
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/MethodSignature.jrag:190
*/
public boolean applicableBySubtyping(List argList) {
ASTNode$State state = state();
try {
if (getNumParameter() != argList.getNumChild())
return false;
for (int i = 0; i < getNumParameter(); i++) {
TypeDecl arg = ((Expr) argList.getChild(i)).type();
if (!arg.instanceOf(getParameter(i).type()))
return false;
}
return true;
} finally {
}
}
/**
* @attribute syn
* @aspect MethodSignature15
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/MethodSignature.jrag:210
*/
public boolean applicableByMethodInvocationConversion(List argList) {
ASTNode$State state = state();
try {
if (getNumParameter() != argList.getNumChild())
return false;
for (int i = 0; i < getNumParameter(); i++) {
TypeDecl arg = ((Expr) argList.getChild(i)).type();
if (!arg.methodInvocationConversionTo(getParameter(i).type()))
return false;
}
return true;
} finally {
}
}
/**
* @attribute syn
* @aspect MethodSignature15
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/MethodSignature.jrag:231
*/
public boolean applicableVariableArity(List argList) {
ASTNode$State state = state();
try {
for (int i = 0; i < getNumParameter() - 1; i++) {
TypeDecl arg = ((Expr) argList.getChild(i)).type();
if (!arg.methodInvocationConversionTo(getParameter(i).type()))
return false;
}
for (int i = getNumParameter() - 1; i < argList.getNumChild(); i++) {
TypeDecl arg = ((Expr) argList.getChild(i)).type();
if (!arg.methodInvocationConversionTo(lastParameter().type().componentType()))
return false;
}
return true;
} finally {
}
}
/**
* @attribute syn
* @aspect MethodSignature15
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/MethodSignature.jrag:318
*/
public boolean potentiallyApplicable(List argList) {
ASTNode$State state = state();
try {
if (isVariableArity() && !(argList.getNumChild() >= arity() - 1))
return false;
if (!isVariableArity() && !(arity() == argList.getNumChild()))
return false;
return true;
} finally {
}
}
/**
* @attribute syn
* @aspect MethodSignature15
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/MethodSignature.jrag:325
*/
public int arity() {
ASTNode$State state = state();
try {
return getNumParameter();
} finally {
}
}
/**
* @attribute syn
* @aspect VariableArityParameters
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/VariableArityParameters.jrag:34
*/
public boolean isVariableArity() {
ASTNode$State state = state();
try {
return getNumParameter() == 0 ? false : getParameter(getNumParameter() - 1).isVariableArity();
} finally {
}
}
/**
* @attribute syn
* @aspect VariableArityParameters
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/VariableArityParameters.jrag:63
*/
public ParameterDeclaration lastParameter() {
ASTNode$State state = state();
try {
return getParameter(getNumParameter() - 1);
} finally {
}
}
/**
* @attribute syn
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:433
*/
public boolean needsEnclosing() {
ASTNode$State state = state();
try {
return hostType().needsEnclosing();
} finally {
}
}
/**
* @attribute syn
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:434
*/
public boolean needsSuperEnclosing() {
ASTNode$State state = state();
try {
return hostType().needsSuperEnclosing();
} finally {
}
}
/**
* @attribute syn
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:436
*/
public TypeDecl enclosing() {
ASTNode$State state = state();
try {
return hostType().enclosing();
} finally {
}
}
/**
* @attribute syn
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:437
*/
public TypeDecl superEnclosing() {
ASTNode$State state = state();
try {
return hostType().superEnclosing();
} finally {
}
}
/**
* @attribute syn
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:120
*/
public int sootTypeModifiers() {
ASTNode$State state = state();
try {
int result = 0;
if (isPublic())
result |= soot.Modifier.PUBLIC;
if (isProtected())
result |= soot.Modifier.PROTECTED;
if (isPrivate())
result |= soot.Modifier.PRIVATE;
return result;
} finally {
}
}
/**
* @apilevel internal
*/
protected boolean sootMethod_computed = false;
/**
* @apilevel internal
*/
protected SootMethod sootMethod_value;
/**
* @attribute syn
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:295
*/
@SuppressWarnings({ "unchecked", "cast" })
public SootMethod sootMethod() {
if (sootMethod_computed) {
return sootMethod_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
sootMethod_value = sootMethod_compute();
if (isFinal && num == state().boundariesCrossed)
sootMethod_computed = true;
return sootMethod_value;
}
/**
* @apilevel internal
*/
private SootMethod sootMethod_compute() {
ArrayList list = new ArrayList();
// this$0
TypeDecl typeDecl = hostType();
if (typeDecl.needsEnclosing())
list.add(typeDecl.enclosingType().getSootType());
if (typeDecl.needsSuperEnclosing()) {
TypeDecl superClass = ((ClassDecl) typeDecl).superclass();
list.add(superClass.enclosingType().getSootType());
}
// args
for (int i = 0; i < getNumParameter(); i++)
list.add(getParameter(i).type().getSootType());
return hostType().getSootClassDecl().getMethod("<init>", list, soot.VoidType.v());
}
/**
* @apilevel internal
*/
protected boolean sootRef_computed = false;
/**
* @apilevel internal
*/
protected SootMethodRef sootRef_value;
/**
* @attribute syn
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:310
*/
@SuppressWarnings({ "unchecked", "cast" })
public SootMethodRef sootRef() {
if (sootRef_computed) {
return sootRef_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
sootRef_value = sootRef_compute();
if (isFinal && num == state().boundariesCrossed)
sootRef_computed = true;
return sootRef_value;
}
/**
* @apilevel internal
*/
private SootMethodRef sootRef_compute() {
ArrayList parameters = new ArrayList();
TypeDecl typeDecl = hostType();
if (typeDecl.needsEnclosing())
parameters.add(typeDecl.enclosingType().getSootType());
if (typeDecl.needsSuperEnclosing()) {
TypeDecl superClass = ((ClassDecl) typeDecl).superclass();
parameters.add(superClass.enclosingType().getSootType());
}
for (int i = 0; i < getNumParameter(); i++)
parameters.add(getParameter(i).type().getSootType());
SootMethodRef ref = Scene.v().makeConstructorRef(hostType().getSootClassDecl(), parameters);
return ref;
}
/**
* @apilevel internal
*/
protected boolean localNumOfFirstParameter_computed = false;
/**
* @apilevel internal
*/
protected int localNumOfFirstParameter_value;
/**
* @attribute syn
* @aspect LocalNum
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/LocalNum.jrag:32
*/
@SuppressWarnings({ "unchecked", "cast" })
public int localNumOfFirstParameter() {
if (localNumOfFirstParameter_computed) {
return localNumOfFirstParameter_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
localNumOfFirstParameter_value = localNumOfFirstParameter_compute();
if (isFinal && num == state().boundariesCrossed)
localNumOfFirstParameter_computed = true;
return localNumOfFirstParameter_value;
}
/**
* @apilevel internal
*/
private int localNumOfFirstParameter_compute() {
int i = 0;
if (hostType().needsEnclosing())
i++;
if (hostType().needsSuperEnclosing())
i++;
return i;
}
/**
* @apilevel internal
*/
protected boolean offsetFirstEnclosingVariable_computed = false;
/**
* @apilevel internal
*/
protected int offsetFirstEnclosingVariable_value;
/**
* @attribute syn
* @aspect LocalNum
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/LocalNum.jrag:41
*/
@SuppressWarnings({ "unchecked", "cast" })
public int offsetFirstEnclosingVariable() {
if (offsetFirstEnclosingVariable_computed) {
return offsetFirstEnclosingVariable_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
offsetFirstEnclosingVariable_value = offsetFirstEnclosingVariable_compute();
if (isFinal && num == state().boundariesCrossed)
offsetFirstEnclosingVariable_computed = true;
return offsetFirstEnclosingVariable_value;
}
/**
* @apilevel internal
*/
private int offsetFirstEnclosingVariable_compute() {
return getNumParameter() == 0 ? localNumOfFirstParameter()
: getParameter(getNumParameter() - 1).localNum()
+ getParameter(getNumParameter() - 1).type().variableSize();
}
/**
* @attribute syn
* @aspect GenericsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/GenericsCodegen.jrag:317
*/
public ConstructorDecl erasedConstructor() {
ASTNode$State state = state();
try {
return this;
} finally {
}
}
/**
* @return true if the modifier list includes the SafeVarargs annotation
* @attribute syn
* @aspect SafeVarargs
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/SafeVarargs.jrag:20
*/
public boolean hasAnnotationSafeVarargs() {
ASTNode$State state = state();
try {
return getModifiers().hasAnnotationSafeVarargs();
} finally {
}
}
/**
* It is an error if the SafeVarargs annotation is used on something that is
* not a variable arity method or constructor.
*
* @attribute syn
* @aspect SafeVarargs
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/SafeVarargs.jrag:56
*/
public boolean hasIllegalAnnotationSafeVarargs() {
ASTNode$State state = state();
try {
return hasAnnotationSafeVarargs() && !isVariableArity();
} finally {
}
}
protected java.util.Map handlesException_TypeDecl_values;
/**
* @attribute inh
* @aspect ExceptionHandling
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:50
*/
@SuppressWarnings({ "unchecked", "cast" })
public boolean handlesException(TypeDecl exceptionType) {
Object _parameters = exceptionType;
if (handlesException_TypeDecl_values == null)
handlesException_TypeDecl_values = new java.util.HashMap(4);
if (handlesException_TypeDecl_values.containsKey(_parameters)) {
return ((Boolean) handlesException_TypeDecl_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean handlesException_TypeDecl_value = getParent().Define_boolean_handlesException(this, null,
exceptionType);
if (isFinal && num == state().boundariesCrossed)
handlesException_TypeDecl_values.put(_parameters, Boolean.valueOf(handlesException_TypeDecl_value));
return handlesException_TypeDecl_value;
}
/**
* @attribute inh
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:267
*/
@SuppressWarnings({ "unchecked", "cast" })
public TypeDecl unknownType() {
ASTNode$State state = state();
TypeDecl unknownType_value = getParent().Define_TypeDecl_unknownType(this, null);
return unknownType_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:298
* @apilevel internal
*/
public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) {
if (caller == getBlockNoTransform()) {
return hasConstructorInvocation() ? getConstructorInvocation().isDAafter(v) : isDAbefore(v);
} else {
return getParent().Define_boolean_isDAbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:755
* @apilevel internal
*/
public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) {
if (caller == getBlockNoTransform()) {
return hasConstructorInvocation() ? getConstructorInvocation().isDUafter(v) : isDUbefore(v);
} else {
return getParent().Define_boolean_isDUbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:156
* @apilevel internal
*/
public boolean Define_boolean_handlesException(ASTNode caller, ASTNode child, TypeDecl exceptionType) {
if (caller == getConstructorInvocationOptNoTransform()) {
return throwsException(exceptionType) || handlesException(exceptionType);
} else if (caller == getBlockNoTransform()) {
return throwsException(exceptionType) || handlesException(exceptionType);
} else {
return getParent().Define_boolean_handlesException(this, caller, exceptionType);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupMethod.jrag:45
* @apilevel internal
*/
public Collection Define_Collection_lookupMethod(ASTNode caller, ASTNode child, String name) {
if (caller == getConstructorInvocationOptNoTransform()) {
Collection c = new ArrayList();
for (Iterator iter = lookupMethod(name).iterator(); iter.hasNext();) {
MethodDecl m = (MethodDecl) iter.next();
if (!hostType().memberMethods(name).contains(m) || m.isStatic())
c.add(m);
}
return c;
} else {
return getParent().Define_Collection_lookupMethod(this, caller, name);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:64
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) {
if (caller == getParameterListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return parameterDeclaration(name);
} else if (caller == getConstructorInvocationOptNoTransform()) {
SimpleSet set = parameterDeclaration(name);
if (!set.isEmpty())
return set;
for (Iterator iter = lookupVariable(name).iterator(); iter.hasNext();) {
Variable v = (Variable) iter.next();
if (!hostType().memberFields(name).contains(v) || v.isStatic())
set = set.add(v);
}
return set;
} else if (caller == getBlockNoTransform()) {
SimpleSet set = parameterDeclaration(name);
if (!set.isEmpty())
return set;
return lookupVariable(name);
} else {
return getParent().Define_SimpleSet_lookupVariable(this, caller, name);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:282
* @apilevel internal
*/
public boolean Define_boolean_mayBePublic(ASTNode caller, ASTNode child) {
if (caller == getModifiersNoTransform()) {
return true;
} else {
return getParent().Define_boolean_mayBePublic(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:283
* @apilevel internal
*/
public boolean Define_boolean_mayBeProtected(ASTNode caller, ASTNode child) {
if (caller == getModifiersNoTransform()) {
return true;
} else {
return getParent().Define_boolean_mayBeProtected(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:284
* @apilevel internal
*/
public boolean Define_boolean_mayBePrivate(ASTNode caller, ASTNode child) {
if (caller == getModifiersNoTransform()) {
return true;
} else {
return getParent().Define_boolean_mayBePrivate(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:247
* @apilevel internal
*/
public ASTNode Define_ASTNode_enclosingBlock(ASTNode caller, ASTNode child) {
if (caller == getBlockNoTransform()) {
return this;
} else {
return getParent().Define_ASTNode_enclosingBlock(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:117
* @apilevel internal
*/
public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {
if (caller == getConstructorInvocationOptNoTransform()) {
return NameType.EXPRESSION_NAME;
} else if (caller == getExceptionListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return NameType.TYPE_NAME;
} else if (caller == getParameterListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return NameType.TYPE_NAME;
} else {
return getParent().Define_NameType_nameType(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:517
* @apilevel internal
*/
public TypeDecl Define_TypeDecl_enclosingInstance(ASTNode caller, ASTNode child) {
if (caller == getConstructorInvocationOptNoTransform()) {
return unknownType();
} else {
return getParent().Define_TypeDecl_enclosingInstance(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:132
* @apilevel internal
*/
public boolean Define_boolean_inExplicitConstructorInvocation(ASTNode caller, ASTNode child) {
if (caller == getConstructorInvocationOptNoTransform()) {
return true;
} else {
return getParent().Define_boolean_inExplicitConstructorInvocation(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:144
* @apilevel internal
*/
public boolean Define_boolean_inStaticContext(ASTNode caller, ASTNode child) {
if (caller == getConstructorInvocationOptNoTransform()) {
return false;
} else if (caller == getBlockNoTransform()) {
return false;
} else {
return getParent().Define_boolean_inStaticContext(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:32
* @apilevel internal
*/
public boolean Define_boolean_reachable(ASTNode caller, ASTNode child) {
if (caller == getBlockNoTransform()) {
return !hasConstructorInvocation() ? true : getConstructorInvocation().canCompleteNormally();
} else if (caller == getConstructorInvocationOptNoTransform()) {
return true;
} else {
return getParent().Define_boolean_reachable(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:58
* @apilevel internal
*/
public boolean Define_boolean_isMethodParameter(ASTNode caller, ASTNode child) {
if (caller == getParameterListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return false;
} else {
return getParent().Define_boolean_isMethodParameter(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:59
* @apilevel internal
*/
public boolean Define_boolean_isConstructorParameter(ASTNode caller, ASTNode child) {
if (caller == getParameterListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return true;
} else {
return getParent().Define_boolean_isConstructorParameter(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:60
* @apilevel internal
*/
public boolean Define_boolean_isExceptionHandlerParameter(ASTNode caller, ASTNode child) {
if (caller == getParameterListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return false;
} else {
return getParent().Define_boolean_isExceptionHandlerParameter(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:89
* @apilevel internal
*/
public boolean Define_boolean_mayUseAnnotationTarget(ASTNode caller, ASTNode child, String name) {
if (caller == getModifiersNoTransform()) {
return name.equals("CONSTRUCTOR");
} else {
return getParent().Define_boolean_mayUseAnnotationTarget(this, caller, name);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/VariableArityParameters.jrag:21
* @apilevel internal
*/
public boolean Define_boolean_variableArityValid(ASTNode caller, ASTNode child) {
if (caller == getParameterListNoTransform()) {
int i = caller.getIndexOfChild(child);
return i == getNumParameter() - 1;
} else {
return getParent().Define_boolean_variableArityValid(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/LocalNum.jrag:45
* @apilevel internal
*/
public int Define_int_localNum(ASTNode caller, ASTNode child) {
if (caller == getParameterListNoTransform()) {
int index = caller.getIndexOfChild(child);
{
if (index == 0) {
return localNumOfFirstParameter();
}
return getParameter(index - 1).localNum() + getParameter(index - 1).type().variableSize();
}
} else {
return getParent().Define_int_localNum(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:352
* @apilevel internal
*/
public boolean Define_boolean_enclosedByExceptionHandler(ASTNode caller, ASTNode child) {
if (caller == getBlockNoTransform()) {
return getNumException() != 0;
} else {
return getParent().Define_boolean_enclosedByExceptionHandler(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:48
* @apilevel internal
*/
public boolean Define_boolean_inhModifiedInScope(ASTNode caller, ASTNode child, Variable var) {
if (caller == getParameterListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return getBlock().modifiedInScope(var);
} else {
return getParent().Define_boolean_inhModifiedInScope(this, caller, var);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:123
* @apilevel internal
*/
public boolean Define_boolean_isCatchParam(ASTNode caller, ASTNode child) {
if (caller == getParameterListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return false;
} else {
return getParent().Define_boolean_isCatchParam(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
// Declared in
// /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag
// at line 218
if (!hasConstructorInvocation() && !hostType().isObject()) {
state().duringImplicitConstructor++;
ASTNode result = rewriteRule0();
state().duringImplicitConstructor--;
return result;
}
return super.rewriteTo();
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:218
* @apilevel internal
*/
private ConstructorDecl rewriteRule0() {
{
setConstructorInvocation(new ExprStmt(new SuperConstructorAccess("super", new List())));
return this;
}
}
}
| 76,993
| 28.750386
| 122
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ConstructorDeclSubstituted.java
|
/* 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 ConstructorDeclSubstituted : {@link ConstructorDecl} ::= <span class="component"><Original:ConstructorDecl></span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.ast:31
*/
public class ConstructorDeclSubstituted extends ConstructorDecl implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
sourceConstructorDecl_computed = false;
sourceConstructorDecl_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ConstructorDeclSubstituted clone() throws CloneNotSupportedException {
ConstructorDeclSubstituted node = (ConstructorDeclSubstituted)super.clone();
node.sourceConstructorDecl_computed = false;
node.sourceConstructorDecl_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ConstructorDeclSubstituted copy() {
try {
ConstructorDeclSubstituted node = (ConstructorDeclSubstituted) 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 ConstructorDeclSubstituted fullCopy() {
ConstructorDeclSubstituted tree = (ConstructorDeclSubstituted) 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 GenericsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/GenericsCodegen.jrag:23
*/
public ConstructorDecl createAccessor() {
return erasedConstructor().createAccessor();
}
/**
* @ast method
* @aspect GenericsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/GenericsCodegen.jrag:27
*/
protected TypeDecl createAnonymousJavaTypeDecl() {
return erasedConstructor().createAnonymousJavaTypeDecl();
}
/**
* @ast method
*
*/
public ConstructorDeclSubstituted() {
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[5];
setChild(new List(), 1);
setChild(new List(), 2);
setChild(new Opt(), 3);
}
/**
* @ast method
*
*/
public ConstructorDeclSubstituted(Modifiers p0, String p1, List<ParameterDeclaration> p2, List<Access> p3, Opt<Stmt> p4, Block p5, ConstructorDecl p6) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setChild(p4, 3);
setChild(p5, 4);
setOriginal(p6);
}
/**
* @ast method
*
*/
public ConstructorDeclSubstituted(Modifiers p0, beaver.Symbol p1, List<ParameterDeclaration> p2, List<Access> p3, Opt<Stmt> p4, Block p5, ConstructorDecl p6) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setChild(p4, 3);
setChild(p5, 4);
setOriginal(p6);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 5;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return true;
}
/**
* 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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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 Parameter list.
* @param list The new list node to be used as the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public void setParameterList(List<ParameterDeclaration> list) {
setChild(list, 1);
}
/**
* Retrieves the number of children in the Parameter list.
* @return Number of children in the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public int getNumParameter() {
return getParameterList().getNumChild();
}
/**
* Retrieves the number of children in the Parameter list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Parameter list.
* @apilevel low-level
* @ast method
*
*/
public int getNumParameterNoTransform() {
return getParameterListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Parameter list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Parameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public ParameterDeclaration getParameter(int i) {
return (ParameterDeclaration)getParameterList().getChild(i);
}
/**
* Append an element to the Parameter list.
* @param node The element to append to the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public void addParameter(ParameterDeclaration node) {
List<ParameterDeclaration> list = (parent == null || state == null) ? getParameterListNoTransform() : getParameterList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addParameterNoTransform(ParameterDeclaration node) {
List<ParameterDeclaration> list = getParameterListNoTransform();
list.addChild(node);
}
/**
* Replaces the Parameter 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 setParameter(ParameterDeclaration node, int i) {
List<ParameterDeclaration> list = getParameterList();
list.setChild(node, i);
}
/**
* Retrieves the Parameter list.
* @return The node representing the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public List<ParameterDeclaration> getParameters() {
return getParameterList();
}
/**
* Retrieves the Parameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Parameter list.
* @apilevel low-level
* @ast method
*
*/
public List<ParameterDeclaration> getParametersNoTransform() {
return getParameterListNoTransform();
}
/**
* Retrieves the Parameter list.
* @return The node representing the Parameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<ParameterDeclaration> getParameterList() {
List<ParameterDeclaration> list = (List<ParameterDeclaration>)getChild(1);
list.getNumChild();
return list;
}
/**
* Retrieves the Parameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Parameter list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<ParameterDeclaration> getParameterListNoTransform() {
return (List<ParameterDeclaration>)getChildNoTransform(1);
}
/**
* Replaces the Exception list.
* @param list The new list node to be used as the Exception list.
* @apilevel high-level
* @ast method
*
*/
public void setExceptionList(List<Access> list) {
setChild(list, 2);
}
/**
* Retrieves the number of children in the Exception list.
* @return Number of children in the Exception list.
* @apilevel high-level
* @ast method
*
*/
public int getNumException() {
return getExceptionList().getNumChild();
}
/**
* Retrieves the number of children in the Exception list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Exception list.
* @apilevel low-level
* @ast method
*
*/
public int getNumExceptionNoTransform() {
return getExceptionListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Exception list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Exception list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getException(int i) {
return (Access)getExceptionList().getChild(i);
}
/**
* Append an element to the Exception list.
* @param node The element to append to the Exception list.
* @apilevel high-level
* @ast method
*
*/
public void addException(Access node) {
List<Access> list = (parent == null || state == null) ? getExceptionListNoTransform() : getExceptionList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addExceptionNoTransform(Access node) {
List<Access> list = getExceptionListNoTransform();
list.addChild(node);
}
/**
* Replaces the Exception 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 setException(Access node, int i) {
List<Access> list = getExceptionList();
list.setChild(node, i);
}
/**
* Retrieves the Exception list.
* @return The node representing the Exception list.
* @apilevel high-level
* @ast method
*
*/
public List<Access> getExceptions() {
return getExceptionList();
}
/**
* Retrieves the Exception list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Exception list.
* @apilevel low-level
* @ast method
*
*/
public List<Access> getExceptionsNoTransform() {
return getExceptionListNoTransform();
}
/**
* Retrieves the Exception list.
* @return The node representing the Exception list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getExceptionList() {
List<Access> list = (List<Access>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the Exception list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Exception list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getExceptionListNoTransform() {
return (List<Access>)getChildNoTransform(2);
}
/**
* Replaces the optional node for the ConstructorInvocation child. This is the {@code Opt} node containing the child ConstructorInvocation, not the actual child!
* @param opt The new node to be used as the optional node for the ConstructorInvocation child.
* @apilevel low-level
* @ast method
*
*/
public void setConstructorInvocationOpt(Opt<Stmt> opt) {
setChild(opt, 3);
}
/**
* Check whether the optional ConstructorInvocation child exists.
* @return {@code true} if the optional ConstructorInvocation child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasConstructorInvocation() {
return getConstructorInvocationOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) ConstructorInvocation child.
* @return The ConstructorInvocation child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Stmt getConstructorInvocation() {
return (Stmt)getConstructorInvocationOpt().getChild(0);
}
/**
* Replaces the (optional) ConstructorInvocation child.
* @param node The new node to be used as the ConstructorInvocation child.
* @apilevel high-level
* @ast method
*
*/
public void setConstructorInvocation(Stmt node) {
getConstructorInvocationOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Stmt> getConstructorInvocationOpt() {
return (Opt<Stmt>)getChild(3);
}
/**
* Retrieves the optional node for child ConstructorInvocation. This is the {@code Opt} node containing the child ConstructorInvocation, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child ConstructorInvocation.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Stmt> getConstructorInvocationOptNoTransform() {
return (Opt<Stmt>)getChildNoTransform(3);
}
/**
* Replaces the Block child.
* @param node The new node to replace the Block child.
* @apilevel high-level
* @ast method
*
*/
public void setBlock(Block node) {
setChild(node, 4);
}
/**
* Retrieves the Block child.
* @return The current node used as the Block child.
* @apilevel high-level
* @ast method
*
*/
public Block getBlock() {
return (Block)getChild(4);
}
/**
* Retrieves the Block child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Block child.
* @apilevel low-level
* @ast method
*
*/
public Block getBlockNoTransform() {
return (Block)getChildNoTransform(4);
}
/**
* Replaces the lexeme Original.
* @param value The new value for the lexeme Original.
* @apilevel high-level
* @ast method
*
*/
public void setOriginal(ConstructorDecl value) {
tokenConstructorDecl_Original = value;
}
/**
* @apilevel internal
* @ast method
*
*/
/**
* @apilevel internal
*/
protected ConstructorDecl tokenConstructorDecl_Original;
/**
* Retrieves the value for the lexeme Original.
* @return The value for the lexeme Original.
* @apilevel high-level
* @ast method
*
*/
public ConstructorDecl getOriginal() {
return tokenConstructorDecl_Original;
}
/**
* @apilevel internal
*/
protected boolean sourceConstructorDecl_computed = false;
/**
* @apilevel internal
*/
protected ConstructorDecl sourceConstructorDecl_value;
/**
* @attribute syn
* @aspect SourceDeclarations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1517
*/
@SuppressWarnings({"unchecked", "cast"})
public ConstructorDecl sourceConstructorDecl() {
if(sourceConstructorDecl_computed) {
return sourceConstructorDecl_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
sourceConstructorDecl_value = sourceConstructorDecl_compute();
if(isFinal && num == state().boundariesCrossed) sourceConstructorDecl_computed = true;
return sourceConstructorDecl_value;
}
/**
* @apilevel internal
*/
private ConstructorDecl sourceConstructorDecl_compute() { return getOriginal().sourceConstructorDecl(); }
/**
* @attribute syn
* @aspect GenericsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/GenericsCodegen.jrag:317
*/
public ConstructorDecl erasedConstructor() {
ASTNode$State state = state();
try { return getOriginal().erasedConstructor(); }
finally {
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 18,345
| 27.399381
| 163
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ContinueStmt.java
|
/* 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 ContinueStmt : {@link Stmt} ::= <span class="component"><Label:String></span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:213
*/
public class ContinueStmt extends Stmt implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
targetStmt_computed = false;
targetStmt_value = null;
finallyList_computed = false;
finallyList_value = null;
isDAafter_Variable_values = null;
isDUafterReachedFinallyBlocks_Variable_values = null;
isDAafterReachedFinallyBlocks_Variable_values = null;
isDUafter_Variable_values = null;
canCompleteNormally_computed = false;
inSynchronizedBlock_computed = false;
lookupLabel_String_values = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ContinueStmt clone() throws CloneNotSupportedException {
ContinueStmt node = (ContinueStmt)super.clone();
node.targetStmt_computed = false;
node.targetStmt_value = null;
node.finallyList_computed = false;
node.finallyList_value = null;
node.isDAafter_Variable_values = null;
node.isDUafterReachedFinallyBlocks_Variable_values = null;
node.isDAafterReachedFinallyBlocks_Variable_values = null;
node.isDUafter_Variable_values = null;
node.canCompleteNormally_computed = false;
node.inSynchronizedBlock_computed = false;
node.lookupLabel_String_values = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ContinueStmt copy() {
try {
ContinueStmt node = (ContinueStmt) 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 ContinueStmt fullCopy() {
ContinueStmt tree = (ContinueStmt) 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 BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:48
*/
public void collectBranches(Collection c) {
c.add(this);
}
/**
* @ast method
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:389
*/
public void nameCheck() {
if(!insideLoop())
error("continue outside loop");
else if(hasLabel()) {
LabeledStmt label = lookupLabel(getLabel());
if(label == null)
error("labeled continue must have visible matching label");
else if(!label.getStmt().continueLabel())
error(getLabel() + " is not a loop label");
}
}
/**
* @ast method
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:675
*/
public void toString(StringBuffer s) {
s.append(indent());
s.append("continue ");
if(hasLabel())
s.append(getLabel());
s.append(";");
}
/**
* @ast method
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:234
*/
public void jimplify2(Body b) {
ArrayList list = exceptionRanges();
if(!inSynchronizedBlock())
endExceptionRange(b, list);
for(Iterator iter = finallyList().iterator(); iter.hasNext(); ) {
FinallyHost stmt = (FinallyHost)iter.next();
stmt.emitFinallyCode(b);
}
if(inSynchronizedBlock())
endExceptionRange(b, list);
b.setLine(this);
b.add(b.newGotoStmt(targetStmt().continue_label(), this));
beginExceptionRange(b, list);
}
/**
* @ast method
*
*/
public ContinueStmt() {
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() {
}
/**
* @ast method
*
*/
public ContinueStmt(String p0) {
setLabel(p0);
}
/**
* @ast method
*
*/
public ContinueStmt(beaver.Symbol p0) {
setLabel(p0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the lexeme Label.
* @param value The new value for the lexeme Label.
* @apilevel high-level
* @ast method
*
*/
public void setLabel(String value) {
tokenString_Label = value;
}
/**
* @apilevel internal
* @ast method
*
*/
/**
* @apilevel internal
*/
protected String tokenString_Label;
/**
* @ast method
*
*/
public int Labelstart;
/**
* @ast method
*
*/
public int Labelend;
/**
* JastAdd-internal setter for lexeme Label using the Beaver parser.
* @apilevel internal
* @ast method
*
*/
public void setLabel(beaver.Symbol symbol) {
if(symbol.value != null && !(symbol.value instanceof String))
throw new UnsupportedOperationException("setLabel is only valid for String lexemes");
tokenString_Label = (String)symbol.value;
Labelstart = symbol.getStart();
Labelend = symbol.getEnd();
}
/**
* Retrieves the value for the lexeme Label.
* @return The value for the lexeme Label.
* @apilevel high-level
* @ast method
*
*/
public String getLabel() {
return tokenString_Label != null ? tokenString_Label : "";
}
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:64
*/
public boolean hasLabel() {
ASTNode$State state = state();
try { return !getLabel().equals(""); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean targetStmt_computed = false;
/**
* @apilevel internal
*/
protected Stmt targetStmt_value;
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:149
*/
@SuppressWarnings({"unchecked", "cast"})
public Stmt targetStmt() {
if(targetStmt_computed) {
return targetStmt_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
targetStmt_value = targetStmt_compute();
if(isFinal && num == state().boundariesCrossed) targetStmt_computed = true;
return targetStmt_value;
}
/**
* @apilevel internal
*/
private Stmt targetStmt_compute() { return branchTarget(this); }
/**
* @apilevel internal
*/
protected boolean finallyList_computed = false;
/**
* @apilevel internal
*/
protected ArrayList finallyList_value;
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:180
*/
@SuppressWarnings({"unchecked", "cast"})
public ArrayList finallyList() {
if(finallyList_computed) {
return finallyList_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
finallyList_value = finallyList_compute();
if(isFinal && num == state().boundariesCrossed) finallyList_computed = true;
return finallyList_value;
}
/**
* @apilevel internal
*/
private ArrayList finallyList_compute() {
ArrayList list = new ArrayList();
collectFinally(this, list);
return list;
}
protected java.util.Map isDAafter_Variable_values;
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:648
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDAafter(Variable v) {
Object _parameters = v;
if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4);
if(isDAafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDAafter_Variable_value = isDAafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value));
return isDAafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDAafter_compute(Variable v) { return true; }
protected java.util.Map isDUafterReachedFinallyBlocks_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:932
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDUafterReachedFinallyBlocks(Variable v) {
Object _parameters = v;
if(isDUafterReachedFinallyBlocks_Variable_values == null) isDUafterReachedFinallyBlocks_Variable_values = new java.util.HashMap(4);
if(isDUafterReachedFinallyBlocks_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDUafterReachedFinallyBlocks_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDUafterReachedFinallyBlocks_Variable_value = isDUafterReachedFinallyBlocks_compute(v);
if(isFinal && num == state().boundariesCrossed) isDUafterReachedFinallyBlocks_Variable_values.put(_parameters, Boolean.valueOf(isDUafterReachedFinallyBlocks_Variable_value));
return isDUafterReachedFinallyBlocks_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDUafterReachedFinallyBlocks_compute(Variable v) {
if(!isDUbefore(v) && finallyList().isEmpty())
return false;
for(Iterator iter = finallyList().iterator(); iter.hasNext(); ) {
FinallyHost f = (FinallyHost)iter.next();
if(!f.isDUafterFinally(v))
return false;
}
return true;
}
protected java.util.Map isDAafterReachedFinallyBlocks_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:966
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDAafterReachedFinallyBlocks(Variable v) {
Object _parameters = v;
if(isDAafterReachedFinallyBlocks_Variable_values == null) isDAafterReachedFinallyBlocks_Variable_values = new java.util.HashMap(4);
if(isDAafterReachedFinallyBlocks_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDAafterReachedFinallyBlocks_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDAafterReachedFinallyBlocks_Variable_value = isDAafterReachedFinallyBlocks_compute(v);
if(isFinal && num == state().boundariesCrossed) isDAafterReachedFinallyBlocks_Variable_values.put(_parameters, Boolean.valueOf(isDAafterReachedFinallyBlocks_Variable_value));
return isDAafterReachedFinallyBlocks_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDAafterReachedFinallyBlocks_compute(Variable v) {
if(isDAbefore(v))
return true;
if(finallyList().isEmpty())
return false;
for(Iterator iter = finallyList().iterator(); iter.hasNext(); ) {
FinallyHost f = (FinallyHost)iter.next();
if(!f.isDAafterFinally(v))
return false;
}
return true;
}
protected java.util.Map isDUafter_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:1171
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDUafter(Variable v) {
Object _parameters = v;
if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4);
if(isDUafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDUafter_Variable_value = isDUafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value));
return isDUafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDUafter_compute(Variable v) { return true; }
/**
* @apilevel internal
*/
protected boolean canCompleteNormally_computed = false;
/**
* @apilevel internal
*/
protected boolean canCompleteNormally_value;
/**
* @attribute syn
* @aspect UnreachableStatements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:106
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean canCompleteNormally() {
if(canCompleteNormally_computed) {
return canCompleteNormally_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
canCompleteNormally_value = canCompleteNormally_compute();
if(isFinal && num == state().boundariesCrossed) canCompleteNormally_computed = true;
return canCompleteNormally_value;
}
/**
* @apilevel internal
*/
private boolean canCompleteNormally_compute() { return false; }
/**
* @apilevel internal
*/
protected boolean inSynchronizedBlock_computed = false;
/**
* @apilevel internal
*/
protected boolean inSynchronizedBlock_value;
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:253
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean inSynchronizedBlock() {
if(inSynchronizedBlock_computed) {
return inSynchronizedBlock_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
inSynchronizedBlock_value = inSynchronizedBlock_compute();
if(isFinal && num == state().boundariesCrossed) inSynchronizedBlock_computed = true;
return inSynchronizedBlock_value;
}
/**
* @apilevel internal
*/
private boolean inSynchronizedBlock_compute() { return !finallyList().isEmpty() && finallyList().iterator().next() instanceof SynchronizedStmt; }
/**
* @attribute syn
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:55
*/
public boolean modifiedInScope(Variable var) {
ASTNode$State state = state();
try { return false; }
finally {
}
}
protected java.util.Map lookupLabel_String_values;
/**
* @attribute inh
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:169
*/
@SuppressWarnings({"unchecked", "cast"})
public LabeledStmt lookupLabel(String name) {
Object _parameters = name;
if(lookupLabel_String_values == null) lookupLabel_String_values = new java.util.HashMap(4);
if(lookupLabel_String_values.containsKey(_parameters)) {
return (LabeledStmt)lookupLabel_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
LabeledStmt lookupLabel_String_value = getParent().Define_LabeledStmt_lookupLabel(this, null, name);
if(isFinal && num == state().boundariesCrossed) lookupLabel_String_values.put(_parameters, lookupLabel_String_value);
return lookupLabel_String_value;
}
/**
* @attribute inh
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:366
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean insideLoop() {
ASTNode$State state = state();
boolean insideLoop_value = getParent().Define_boolean_insideLoop(this, null);
return insideLoop_value;
}
/**
* @attribute inh
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:459
*/
@SuppressWarnings({"unchecked", "cast"})
public ArrayList exceptionRanges() {
ASTNode$State state = state();
ArrayList exceptionRanges_value = getParent().Define_ArrayList_exceptionRanges(this, null);
return exceptionRanges_value;
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 18,203
| 30.769634
| 180
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/DefaultCase.java
|
/* 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 DefaultCase : {@link Case};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:205
*/
public class DefaultCase extends Case implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public DefaultCase clone() throws CloneNotSupportedException {
DefaultCase node = (DefaultCase)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public DefaultCase copy() {
try {
DefaultCase node = (DefaultCase) 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 DefaultCase fullCopy() {
DefaultCase tree = (DefaultCase) 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 NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:411
*/
public void nameCheck() {
if(bind(this) != this) {
error("only one default case statement allowed");
}
}
/**
* @ast method
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:569
*/
public void toString(StringBuffer s) {
s.append(indent());
s.append("default:");
}
/**
* @ast method
*
*/
public DefaultCase() {
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() {
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* @attribute syn
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:431
*/
public boolean constValue(Case c) {
ASTNode$State state = state();
try { return c instanceof DefaultCase; }
finally {
}
}
/* Type checking for case labels need not be changed as it
* already tests if the case labels have expressions which are
* assignable to the switch expression
* @attribute syn
* @aspect StringsInSwitch
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/StringsInSwitch.jrag:38
*/
public boolean isDefaultCase() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 4,197
| 23.694118
| 107
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/DiamondAccess.java
|
/* 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;
/**
* Type access for a generic class with an empty type parameter list.
* @production DiamondAccess : {@link Access} ::= <span class="component">TypeAccess:{@link Access}</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.ast:4
*/
public class DiamondAccess extends Access implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
type_computed = false;
type_value = null;
typeArguments_MethodDecl_values = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public DiamondAccess clone() throws CloneNotSupportedException {
DiamondAccess node = (DiamondAccess)super.clone();
node.type_computed = false;
node.type_value = null;
node.typeArguments_MethodDecl_values = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public DiamondAccess copy() {
try {
DiamondAccess node = (DiamondAccess) 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 DiamondAccess fullCopy() {
DiamondAccess tree = (DiamondAccess) 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 TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:72
*/
protected static SimpleSet mostSpecific(
SimpleSet maxSpecific, MethodDecl decl) {
if (maxSpecific.isEmpty()) {
maxSpecific = maxSpecific.add(decl);
} else {
if (decl.moreSpecificThan(
(MethodDecl)maxSpecific.iterator().next()))
maxSpecific = SimpleSet.emptySet.add(decl);
else if (!((MethodDecl)maxSpecific.iterator().next()).
moreSpecificThan(decl))
maxSpecific = maxSpecific.add(decl);
}
return maxSpecific;
}
/**
* Choose a constructor for the diamond operator using placeholder
* methods.
* @ast method
* @aspect TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:91
*/
protected SimpleSet chooseConstructor() {
ClassInstanceExpr instanceExpr = getClassInstanceExpr();
TypeDecl type = getTypeAccess().type();
assert instanceExpr != null;
assert type instanceof ParClassDecl;
GenericClassDecl genericType =
(GenericClassDecl) ((ParClassDecl)type).genericDecl();
List<PlaceholderMethodDecl> placeholderMethods =
genericType.getPlaceholderMethodList();
SimpleSet maxSpecific = SimpleSet.emptySet;
Collection<MethodDecl> potentiallyApplicable =
potentiallyApplicable(placeholderMethods);
for (MethodDecl candidate : potentiallyApplicable) {
if (applicableBySubtyping(instanceExpr, candidate) ||
applicableByMethodInvocationConversion(
instanceExpr, candidate) ||
applicableByVariableArity(instanceExpr, candidate))
maxSpecific = mostSpecific(maxSpecific, candidate);
}
return maxSpecific;
}
/**
* Select potentially applicable method declarations
* from a set of candidates.
* Type inference is applied to the (potentially) applicable candidates.
* @ast method
* @aspect TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:224
*/
protected Collection<MethodDecl> potentiallyApplicable(
List<PlaceholderMethodDecl> candidates) {
Collection<MethodDecl> potentiallyApplicable =
new LinkedList<MethodDecl>();
for (GenericMethodDecl candidate : candidates) {
if (potentiallyApplicable(candidate)) {
MethodDecl decl = candidate.lookupParMethodDecl(
typeArguments(candidate));
potentiallyApplicable.add(decl);
}
}
return potentiallyApplicable;
}
/**
* @return false if the candidate method is not applicable.
* @ast method
* @aspect TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:241
*/
protected boolean potentiallyApplicable(
GenericMethodDecl candidate) {
if (candidate.isVariableArity() &&
!(getClassInstanceExpr().arity() >= candidate.arity()-1))
return false;
if (!candidate.isVariableArity() &&
!(getClassInstanceExpr().arity() == candidate.arity()))
return false;
java.util.List<TypeDecl> typeArgs = typeArguments(candidate);
if (typeArgs.size() != 0) {
if (candidate.getNumTypeParameter() != typeArgs.size())
return false;
for (int i = 0; i < candidate.getNumTypeParameter(); i++)
if (!typeArgs.get(i).subtype(
candidate.original().getTypeParameter(i)))
return false;
}
return true;
}
/**
* Diamond type inference.
* @ast method
* @aspect TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:297
*/
public Collection<TypeDecl> computeConstraints(
GenericMethodDecl decl) {
Constraints c = new Constraints();
// store type parameters
for (int i = 0; i < decl.original().getNumTypeParameter(); i++)
c.addTypeVariable(decl.original().getTypeParameter(i));
ClassInstanceExpr instanceExpr = getClassInstanceExpr();
for (int i = 0; i < instanceExpr.getNumArg(); i++) {
TypeDecl A = instanceExpr.getArg(i).type();
int index = i >= decl.getNumParameter() ?
decl.getNumParameter() - 1 : i;
TypeDecl F = decl.getParameter(index).type();
if (decl.getParameter(index) instanceof
VariableArityParameterDeclaration &&
(instanceExpr.getNumArg() != decl.getNumParameter() ||
!A.isArrayDecl())) {
F = F.componentType();
}
c.convertibleTo(A, F);
}
if (c.rawAccess)
return new ArrayList();
c.resolveEqualityConstraints();
c.resolveSupertypeConstraints();
if (c.unresolvedTypeArguments()) {
TypeDecl S = assignConvertedType();
if (S.isUnboxedPrimitive())
S = S.boxed();
TypeDecl R = decl.type();
if (R.isVoid())
R = typeObject();
c.convertibleFrom(S, R);
c.resolveEqualityConstraints();
c.resolveSupertypeConstraints();
c.resolveSubtypeConstraints();
}
return c.typeArguments();
}
/**
* @return true if the method is applicable by subtyping
* @ast method
* @aspect TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:344
*/
protected boolean applicableBySubtyping(
ClassInstanceExpr expr, MethodDecl method) {
if (method.getNumParameter() != expr.getNumArg())
return false;
for (int i = 0; i < method.getNumParameter(); i++)
if(!expr.getArg(i).type().instanceOf(method.getParameter(i).type()))
return false;
return true;
}
/**
* @return true if the method is applicable by method invocation conversion
* @ast method
* @aspect TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:357
*/
protected boolean applicableByMethodInvocationConversion(
ClassInstanceExpr expr, MethodDecl method) {
if (method.getNumParameter() != expr.getNumArg())
return false;
for (int i = 0; i < method.getNumParameter(); i++)
if (!expr.getArg(i).type().methodInvocationConversionTo(
method.getParameter(i).type()))
return false;
return true;
}
/**
* @return true if the method is applicable by variable arity
* @ast method
* @aspect TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:371
*/
protected boolean applicableByVariableArity(
ClassInstanceExpr expr, MethodDecl method) {
for (int i = 0; i < method.getNumParameter() - 1; i++)
if(!expr.getArg(i).type().methodInvocationConversionTo(
method.getParameter(i).type()))
return false;
for (int i = method.getNumParameter() - 1; i < expr.getNumArg(); i++)
if (!expr.getArg(i).type().methodInvocationConversionTo(
method.lastParameter().type().componentType()))
return false;
return true;
}
/**
* Checks if this diamond access is legal.
* The diamond access is not legal if it either is part of an inner class
* declaration, if it is used to access a non-generic type, or if it is
* part of a call to a generic constructor with explicit type arguments.
* @ast method
* @aspect TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:487
*/
public void typeCheck() {
if (isAnonymousDecl())
error("the diamond operator can not be used with "+
"anonymous classes");
if (isExplicitGenericConstructorAccess())
error("the diamond operator may not be used with generic "+
"constructors with explicit type parameters");
if (getClassInstanceExpr() == null)
error("the diamond operator can only be used in "+
"class instance expressions");
if (!(getTypeAccess().type() instanceof ParClassDecl))
error("the diamond operator can only be used to "+
"instantiate generic classes");
}
/**
* Pretty printing of diamond access.
* @ast method
* @aspect TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:505
*/
public void toString(StringBuffer sb) {
getTypeAccess().toString(sb);
sb.append("<>");
}
/**
* @ast method
*
*/
public DiamondAccess() {
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[1];
}
/**
* @ast method
*
*/
public DiamondAccess(Access p0) {
setChild(p0, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 1;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the TypeAccess child.
* @param node The new node to replace the TypeAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setTypeAccess(Access node) {
setChild(node, 0);
}
/**
* Retrieves the TypeAccess child.
* @return The current node used as the TypeAccess child.
* @apilevel high-level
* @ast method
*
*/
public Access getTypeAccess() {
return (Access)getChild(0);
}
/**
* Retrieves the TypeAccess child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the TypeAccess child.
* @apilevel low-level
* @ast method
*
*/
public Access getTypeAccessNoTransform() {
return (Access)getChildNoTransform(0);
}
/**
* @apilevel internal
*/
protected boolean type_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl type_value;
/**
* If this DiamondAccess node constitutes a legal use of
* the diamond operator, the inferred generic type for the
* enclosing class instance expression is returned.
* @attribute syn
* @aspect TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:39
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl type() {
if(type_computed) {
return type_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
type_value = type_compute();
if(isFinal && num == state().boundariesCrossed) type_computed = true;
return type_value;
}
/**
* @apilevel internal
*/
private TypeDecl type_compute() {
TypeDecl accessType = getTypeAccess().type();
if (isAnonymousDecl())
return accessType;
if (getClassInstanceExpr() == null)
// it is an error if the DiamondAccess does not occurr
// within a class instance creation expression, but this
// error is handled in typeCheck
return accessType;
if (!(accessType instanceof ParClassDecl))
// it is an error if the TypeDecl of a DiamondAccess is not
// a generic type, but this error is handled in typeCheck
return accessType;
SimpleSet maxSpecific = chooseConstructor();
if (maxSpecific.isEmpty())
return getTypeAccess().type();
MethodDecl constructor = (MethodDecl) maxSpecific.iterator().next();
return constructor.type();
}
/**
* @attribute syn
* @aspect TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:65
*/
public boolean isDiamond() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
protected java.util.Map typeArguments_MethodDecl_values;
/**
* Type inference for placeholder methods.
* @attribute syn
* @aspect TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:267
*/
@SuppressWarnings({"unchecked", "cast"})
public java.util.List<TypeDecl> typeArguments(MethodDecl decl) {
Object _parameters = decl;
if(typeArguments_MethodDecl_values == null) typeArguments_MethodDecl_values = new java.util.HashMap(4);
if(typeArguments_MethodDecl_values.containsKey(_parameters)) {
return (java.util.List<TypeDecl>)typeArguments_MethodDecl_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
java.util.List<TypeDecl> typeArguments_MethodDecl_value = typeArguments_compute(decl);
if(isFinal && num == state().boundariesCrossed) typeArguments_MethodDecl_values.put(_parameters, typeArguments_MethodDecl_value);
return typeArguments_MethodDecl_value;
}
/**
* @apilevel internal
*/
private java.util.List<TypeDecl> typeArguments_compute(MethodDecl decl) {
java.util.List<TypeDecl> typeArguments = new LinkedList<TypeDecl>();
if (decl instanceof GenericMethodDecl) {
GenericMethodDecl method = (GenericMethodDecl) decl;
Collection<TypeDecl> arguments = computeConstraints(method);
if (arguments.isEmpty())
return typeArguments;
int i = 0;
for (TypeDecl argument : arguments) {
if (argument == null) {
TypeVariable v = method.original().getTypeParameter(i);
if (v.getNumTypeBound() == 0)
argument = typeObject();
else if (v.getNumTypeBound() == 1)
argument = v.getTypeBound(0).type();
else
argument = v.lubType();
}
typeArguments.add(argument);
i += 1;
}
}
return typeArguments;
}
/**
* @attribute inh
* @aspect TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:68
*/
@SuppressWarnings({"unchecked", "cast"})
public ClassInstanceExpr getClassInstanceExpr() {
ASTNode$State state = state();
ClassInstanceExpr getClassInstanceExpr_value = getParent().Define_ClassInstanceExpr_getClassInstanceExpr(this, null);
return getClassInstanceExpr_value;
}
/**
* @attribute inh
* @aspect TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:262
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl typeObject() {
ASTNode$State state = state();
TypeDecl typeObject_value = getParent().Define_TypeDecl_typeObject(this, null);
return typeObject_value;
}
/**
* @return true if this access is part of an anonymous class declaration
* @attribute inh
* @aspect TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:452
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isAnonymousDecl() {
ASTNode$State state = state();
boolean isAnonymousDecl_value = getParent().Define_boolean_isAnonymousDecl(this, null);
return isAnonymousDecl_value;
}
/**
* @return true if the Access is part of a generic constructor invocation
* with explicit type arguments
* @attribute inh
* @aspect TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:468
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isExplicitGenericConstructorAccess() {
ASTNode$State state = state();
boolean isExplicitGenericConstructorAccess_value = getParent().Define_boolean_isExplicitGenericConstructorAccess(this, null);
return isExplicitGenericConstructorAccess_value;
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 17,948
| 30.712014
| 135
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/Dims.java
|
/* 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 Dims : {@link ASTNode} ::= <span class="component">[{@link Expr}]</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:134
*/
public class Dims extends ASTNode<ASTNode> implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public Dims clone() throws CloneNotSupportedException {
Dims node = (Dims)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public Dims copy() {
try {
Dims node = (Dims) 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 Dims fullCopy() {
Dims tree = (Dims) 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
*
*/
public Dims() {
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[1];
setChild(new Opt(), 0);
}
/**
* @ast method
*
*/
public Dims(Opt<Expr> p0) {
setChild(p0, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 1;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the optional node for the Expr child. This is the {@code Opt} node containing the child Expr, not the actual child!
* @param opt The new node to be used as the optional node for the Expr child.
* @apilevel low-level
* @ast method
*
*/
public void setExprOpt(Opt<Expr> opt) {
setChild(opt, 0);
}
/**
* Check whether the optional Expr child exists.
* @return {@code true} if the optional Expr child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasExpr() {
return getExprOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) Expr child.
* @return The Expr child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Expr getExpr() {
return (Expr)getExprOpt().getChild(0);
}
/**
* Replaces the (optional) Expr child.
* @param node The new node to be used as the Expr child.
* @apilevel high-level
* @ast method
*
*/
public void setExpr(Expr node) {
getExprOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Expr> getExprOpt() {
return (Opt<Expr>)getChild(0);
}
/**
* Retrieves the optional node for child Expr. This is the {@code Opt} node containing the child Expr, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child Expr.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Expr> getExprOptNoTransform() {
return (Opt<Expr>)getChildNoTransform(0);
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 4,811
| 23.30303
| 129
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/DivExpr.java
|
/* 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 DivExpr : {@link MultiplicativeExpr};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:155
*/
public class DivExpr extends MultiplicativeExpr implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
isConstant_visited = -1;
isConstant_computed = false;
isConstant_initialized = false;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public DivExpr clone() throws CloneNotSupportedException {
DivExpr node = (DivExpr)super.clone();
node.isConstant_visited = -1;
node.isConstant_computed = false;
node.isConstant_initialized = false;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public DivExpr copy() {
try {
DivExpr node = (DivExpr) 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 DivExpr fullCopy() {
DivExpr tree = (DivExpr) 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 Expressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:814
*/
public soot.Value emitOperation(Body b, soot.Value left, soot.Value right) {
return asLocal(b, b.newDivExpr(asImmediate(b, left), asImmediate(b, right), this));
}
/**
* @ast method
*
*/
public DivExpr() {
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 DivExpr(Expr 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 LeftOperand child.
* @param node The new node to replace the LeftOperand child.
* @apilevel high-level
* @ast method
*
*/
public void setLeftOperand(Expr node) {
setChild(node, 0);
}
/**
* Retrieves the LeftOperand child.
* @return The current node used as the LeftOperand child.
* @apilevel high-level
* @ast method
*
*/
public Expr getLeftOperand() {
return (Expr)getChild(0);
}
/**
* Retrieves the LeftOperand child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the LeftOperand child.
* @apilevel low-level
* @ast method
*
*/
public Expr getLeftOperandNoTransform() {
return (Expr)getChildNoTransform(0);
}
/**
* Replaces the RightOperand child.
* @param node The new node to replace the RightOperand child.
* @apilevel high-level
* @ast method
*
*/
public void setRightOperand(Expr node) {
setChild(node, 1);
}
/**
* Retrieves the RightOperand child.
* @return The current node used as the RightOperand child.
* @apilevel high-level
* @ast method
*
*/
public Expr getRightOperand() {
return (Expr)getChild(1);
}
/**
* Retrieves the RightOperand child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the RightOperand child.
* @apilevel low-level
* @ast method
*
*/
public Expr getRightOperandNoTransform() {
return (Expr)getChildNoTransform(1);
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:91
*/
public Constant constant() {
ASTNode$State state = state();
try { return type().div(getLeftOperand().constant(), getRightOperand().constant()); }
finally {
}
}
/**
* @apilevel internal
*/
protected int isConstant_visited = -1;
/**
* @apilevel internal
*/
protected boolean isConstant_computed = false;
/**
* @apilevel internal
*/
protected boolean isConstant_initialized = false;
/**
* @apilevel internal
*/
protected boolean isConstant_value;
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:351
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isConstant() {
if(isConstant_computed) {
return isConstant_value;
}
ASTNode$State state = state();
if (!isConstant_initialized) {
isConstant_initialized = true;
isConstant_value = false;
}
if (!state.IN_CIRCLE) {
state.IN_CIRCLE = true;
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
do {
isConstant_visited = state.CIRCLE_INDEX;
state.CHANGE = false;
boolean new_isConstant_value = isConstant_compute();
if (new_isConstant_value!=isConstant_value)
state.CHANGE = true;
isConstant_value = new_isConstant_value;
state.CIRCLE_INDEX++;
} while (state.CHANGE);
if(isFinal && num == state().boundariesCrossed) {
isConstant_computed = true;
}
else {
state.RESET_CYCLE = true;
isConstant_compute();
state.RESET_CYCLE = false;
isConstant_computed = false;
isConstant_initialized = false;
}
state.IN_CIRCLE = false;
return isConstant_value;
}
if(isConstant_visited != state.CIRCLE_INDEX) {
isConstant_visited = state.CIRCLE_INDEX;
if (state.RESET_CYCLE) {
isConstant_computed = false;
isConstant_initialized = false;
isConstant_visited = -1;
return isConstant_value;
}
boolean new_isConstant_value = isConstant_compute();
if (new_isConstant_value!=isConstant_value)
state.CHANGE = true;
isConstant_value = new_isConstant_value;
return isConstant_value;
}
return isConstant_value;
}
/**
* @apilevel internal
*/
private boolean isConstant_compute() { return getLeftOperand().isConstant() && getRightOperand().isConstant() && !(getRightOperand().type().isInt() && getRightOperand().constant().intValue() == 0); }
/**
* @attribute syn
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:400
*/
public String printOp() {
ASTNode$State state = state();
try { return " / "; }
finally {
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 8,194
| 25.350482
| 203
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/DoStmt.java
|
/* 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 DoStmt : {@link BranchTargetStmt} ::= <span class="component">{@link Stmt}</span> <span class="component">Condition:{@link Expr}</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:209
*/
public class DoStmt extends BranchTargetStmt implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
targetOf_ContinueStmt_values = null;
targetOf_BreakStmt_values = null;
isDAafter_Variable_values = null;
isDUafter_Variable_values = null;
isDUbeforeCondition_Variable_values = null;
canCompleteNormally_computed = false;
begin_label_computed = false;
begin_label_value = null;
cond_label_computed = false;
cond_label_value = null;
end_label_computed = false;
end_label_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public DoStmt clone() throws CloneNotSupportedException {
DoStmt node = (DoStmt)super.clone();
node.targetOf_ContinueStmt_values = null;
node.targetOf_BreakStmt_values = null;
node.isDAafter_Variable_values = null;
node.isDUafter_Variable_values = null;
node.isDUbeforeCondition_Variable_values = null;
node.canCompleteNormally_computed = false;
node.begin_label_computed = false;
node.begin_label_value = null;
node.cond_label_computed = false;
node.cond_label_value = null;
node.end_label_computed = false;
node.end_label_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public DoStmt copy() {
try {
DoStmt node = (DoStmt) 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 DoStmt fullCopy() {
DoStmt tree = (DoStmt) 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:595
*/
public void toString(StringBuffer s) {
s.append(indent());
s.append("do ");
getStmt().toString(s);
s.append("while(");
getCondition().toString(s);
s.append(");");
}
/**
* @ast method
* @aspect TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:328
*/
public void typeCheck() {
TypeDecl cond = getCondition().type();
if(!cond.isBoolean()) {
error("the type of \"" + getCondition() + "\" is " + cond.name() + " which is not boolean");
}
}
/**
* @ast method
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:165
*/
public void jimplify2(Body b) {
b.setLine(this);
b.addLabel(begin_label());
getStmt().jimplify2(b);
b.addLabel(cond_label());
getCondition().emitEvalBranch(b);
if(canCompleteNormally())
b.addLabel(end_label());
}
/**
* @ast method
*
*/
public DoStmt() {
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 DoStmt(Stmt 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 Stmt child.
* @param node The new node to replace the Stmt child.
* @apilevel high-level
* @ast method
*
*/
public void setStmt(Stmt node) {
setChild(node, 0);
}
/**
* Retrieves the Stmt child.
* @return The current node used as the Stmt child.
* @apilevel high-level
* @ast method
*
*/
public Stmt getStmt() {
return (Stmt)getChild(0);
}
/**
* Retrieves the Stmt child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Stmt child.
* @apilevel low-level
* @ast method
*
*/
public Stmt getStmtNoTransform() {
return (Stmt)getChildNoTransform(0);
}
/**
* Replaces the Condition child.
* @param node The new node to replace the Condition child.
* @apilevel high-level
* @ast method
*
*/
public void setCondition(Expr node) {
setChild(node, 1);
}
/**
* Retrieves the Condition child.
* @return The current node used as the Condition child.
* @apilevel high-level
* @ast method
*
*/
public Expr getCondition() {
return (Expr)getChild(1);
}
/**
* Retrieves the Condition child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Condition child.
* @apilevel low-level
* @ast method
*
*/
public Expr getConditionNoTransform() {
return (Expr)getChildNoTransform(1);
}
protected java.util.Map targetOf_ContinueStmt_values;
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:70
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean targetOf(ContinueStmt stmt) {
Object _parameters = stmt;
if(targetOf_ContinueStmt_values == null) targetOf_ContinueStmt_values = new java.util.HashMap(4);
if(targetOf_ContinueStmt_values.containsKey(_parameters)) {
return ((Boolean)targetOf_ContinueStmt_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean targetOf_ContinueStmt_value = targetOf_compute(stmt);
if(isFinal && num == state().boundariesCrossed) targetOf_ContinueStmt_values.put(_parameters, Boolean.valueOf(targetOf_ContinueStmt_value));
return targetOf_ContinueStmt_value;
}
/**
* @apilevel internal
*/
private boolean targetOf_compute(ContinueStmt stmt) { return !stmt.hasLabel(); }
protected java.util.Map targetOf_BreakStmt_values;
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:78
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean targetOf(BreakStmt stmt) {
Object _parameters = stmt;
if(targetOf_BreakStmt_values == null) targetOf_BreakStmt_values = new java.util.HashMap(4);
if(targetOf_BreakStmt_values.containsKey(_parameters)) {
return ((Boolean)targetOf_BreakStmt_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean targetOf_BreakStmt_value = targetOf_compute(stmt);
if(isFinal && num == state().boundariesCrossed) targetOf_BreakStmt_values.put(_parameters, Boolean.valueOf(targetOf_BreakStmt_value));
return targetOf_BreakStmt_value;
}
/**
* @apilevel internal
*/
private boolean targetOf_compute(BreakStmt stmt) { return !stmt.hasLabel(); }
protected java.util.Map isDAafter_Variable_values;
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:589
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDAafter(Variable v) {
Object _parameters = v;
if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4);
if(isDAafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDAafter_Variable_value = isDAafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value));
return isDAafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDAafter_compute(Variable v) {
if(!getCondition().isDAafterFalse(v))
return false;
for(Iterator iter = targetBreaks().iterator(); iter.hasNext(); ) {
BreakStmt stmt = (BreakStmt)iter.next();
if(!stmt.isDAafterReachedFinallyBlocks(v))
return false;
}
return true;
}
protected java.util.Map isDUafter_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:1068
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDUafter(Variable v) {
Object _parameters = v;
if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4);
if(isDUafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDUafter_Variable_value = isDUafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value));
return isDUafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDUafter_compute(Variable v) {
if(!isDUbeforeCondition(v)) // start a circular evaluation here
return false;
if(!getCondition().isDUafterFalse(v))
return false;
for(Iterator iter = targetBreaks().iterator(); iter.hasNext(); ) {
BreakStmt stmt = (BreakStmt)iter.next();
if(!stmt.isDUafterReachedFinallyBlocks(v))
return false;
}
return true;
}
protected java.util.Map isDUbeforeCondition_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:1082
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDUbeforeCondition(Variable v) {
Object _parameters = v;
if(isDUbeforeCondition_Variable_values == null) isDUbeforeCondition_Variable_values = new java.util.HashMap(4);
ASTNode$State.CircularValue _value;
if(isDUbeforeCondition_Variable_values.containsKey(_parameters)) {
Object _o = isDUbeforeCondition_Variable_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();
isDUbeforeCondition_Variable_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_isDUbeforeCondition_Variable_value;
do {
_value.visited = new Integer(state.CIRCLE_INDEX);
state.CHANGE = false;
new_isDUbeforeCondition_Variable_value = isDUbeforeCondition_compute(v);
if (new_isDUbeforeCondition_Variable_value!=((Boolean)_value.value).booleanValue()) {
state.CHANGE = true;
_value.value = Boolean.valueOf(new_isDUbeforeCondition_Variable_value);
}
state.CIRCLE_INDEX++;
} while (state.CHANGE);
if(isFinal && num == state().boundariesCrossed) {
isDUbeforeCondition_Variable_values.put(_parameters, new_isDUbeforeCondition_Variable_value);
}
else {
isDUbeforeCondition_Variable_values.remove(_parameters);
state.RESET_CYCLE = true;
isDUbeforeCondition_compute(v);
state.RESET_CYCLE = false;
}
state.IN_CIRCLE = false;
return new_isDUbeforeCondition_Variable_value;
}
if(!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) {
_value.visited = new Integer(state.CIRCLE_INDEX);
boolean new_isDUbeforeCondition_Variable_value = isDUbeforeCondition_compute(v);
if (state.RESET_CYCLE) {
isDUbeforeCondition_Variable_values.remove(_parameters);
}
else if (new_isDUbeforeCondition_Variable_value!=((Boolean)_value.value).booleanValue()) {
state.CHANGE = true;
_value.value = new_isDUbeforeCondition_Variable_value;
}
return new_isDUbeforeCondition_Variable_value;
}
return ((Boolean)_value.value).booleanValue();
}
/**
* @apilevel internal
*/
private boolean isDUbeforeCondition_compute(Variable v) {
if(!getStmt().isDUafter(v))
return false;
else {
for(Iterator iter = targetContinues().iterator(); iter.hasNext(); ) {
ContinueStmt stmt = (ContinueStmt)iter.next();
if(!stmt.isDUafterReachedFinallyBlocks(v))
return false;
}
}
return true;
}
/**
* @attribute syn
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:401
*/
public boolean continueLabel() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean canCompleteNormally_computed = false;
/**
* @apilevel internal
*/
protected boolean canCompleteNormally_value;
/**
* @attribute syn
* @aspect UnreachableStatements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:88
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean canCompleteNormally() {
if(canCompleteNormally_computed) {
return canCompleteNormally_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
canCompleteNormally_value = canCompleteNormally_compute();
if(isFinal && num == state().boundariesCrossed) canCompleteNormally_computed = true;
return canCompleteNormally_value;
}
/**
* @apilevel internal
*/
private boolean canCompleteNormally_compute() { return getStmt().canCompleteNormally() && (!getCondition().isConstant() || !getCondition().isTrue())
|| reachableContinue() && (!getCondition().isConstant() || !getCondition().isTrue()) || reachableBreak(); }
/**
* @attribute syn
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:21
*/
public boolean definesLabel() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean begin_label_computed = false;
/**
* @apilevel internal
*/
protected soot.jimple.Stmt begin_label_value;
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:161
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt begin_label() {
if(begin_label_computed) {
return begin_label_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
begin_label_value = begin_label_compute();
if(isFinal && num == state().boundariesCrossed) begin_label_computed = true;
return begin_label_value;
}
/**
* @apilevel internal
*/
private soot.jimple.Stmt begin_label_compute() { return newLabel(); }
/**
* @apilevel internal
*/
protected boolean cond_label_computed = false;
/**
* @apilevel internal
*/
protected soot.jimple.Stmt cond_label_value;
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:162
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt cond_label() {
if(cond_label_computed) {
return cond_label_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
cond_label_value = cond_label_compute();
if(isFinal && num == state().boundariesCrossed) cond_label_computed = true;
return cond_label_value;
}
/**
* @apilevel internal
*/
private soot.jimple.Stmt cond_label_compute() { return newLabel(); }
/**
* @apilevel internal
*/
protected boolean end_label_computed = false;
/**
* @apilevel internal
*/
protected soot.jimple.Stmt end_label_value;
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:163
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt end_label() {
if(end_label_computed) {
return end_label_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
end_label_value = end_label_compute();
if(isFinal && num == state().boundariesCrossed) end_label_computed = true;
return end_label_value;
}
/**
* @apilevel internal
*/
private soot.jimple.Stmt end_label_compute() { return newLabel(); }
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:200
*/
public soot.jimple.Stmt break_label() {
ASTNode$State state = state();
try { return end_label(); }
finally {
}
}
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:225
*/
public soot.jimple.Stmt continue_label() {
ASTNode$State state = state();
try { return cond_label(); }
finally {
}
}
/**
* @attribute syn
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:55
*/
public boolean modifiedInScope(Variable var) {
ASTNode$State state = state();
try { return getStmt().modifiedInScope(var); }
finally {
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:600
* @apilevel internal
*/
public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) {
if(caller == getConditionNoTransform()){
if(!getStmt().isDAafter(v))
return false;
for(Iterator iter = targetContinues().iterator(); iter.hasNext(); ) {
ContinueStmt stmt = (ContinueStmt)iter.next();
if(!stmt.isDAafterReachedFinallyBlocks(v))
return false;
}
return true;
}
else if(caller == getStmtNoTransform()) {
return isDAbefore(v);
}
else { return getParent().Define_boolean_isDAbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:1081
* @apilevel internal
*/
public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) {
if(caller == getConditionNoTransform()) {
return isDUbeforeCondition(v);
}
else if(caller == getStmtNoTransform()) {
return isDUbefore(v) && getCondition().isDUafterTrue(v);
}
else { return getParent().Define_boolean_isDUbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:372
* @apilevel internal
*/
public boolean Define_boolean_insideLoop(ASTNode caller, ASTNode child) {
if(caller == getStmtNoTransform()) {
return true;
}
else { return getParent().Define_boolean_insideLoop(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:100
* @apilevel internal
*/
public boolean Define_boolean_reachable(ASTNode caller, ASTNode child) {
if(caller == getStmtNoTransform()) {
return reachable();
}
else { return getParent().Define_boolean_reachable(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:152
* @apilevel internal
*/
public boolean Define_boolean_reportUnreachable(ASTNode caller, ASTNode child) {
if(caller == getStmtNoTransform()) {
return reachable();
}
else { return getParent().Define_boolean_reportUnreachable(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:42
* @apilevel internal
*/
public soot.jimple.Stmt Define_soot_jimple_Stmt_condition_false_label(ASTNode caller, ASTNode child) {
if(caller == getConditionNoTransform()) {
return end_label();
}
else { return getParent().Define_soot_jimple_Stmt_condition_false_label(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:43
* @apilevel internal
*/
public soot.jimple.Stmt Define_soot_jimple_Stmt_condition_true_label(ASTNode caller, ASTNode child) {
if(caller == getConditionNoTransform()) {
return begin_label();
}
else { return getParent().Define_soot_jimple_Stmt_condition_true_label(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 23,191
| 31.255911
| 151
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/Dot.java
|
/* 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 Dot : {@link AbstractDot};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:17
*/
public class Dot extends AbstractDot implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public Dot clone() throws CloneNotSupportedException {
Dot node = (Dot)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public Dot copy() {
try {
Dot node = (Dot) 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 Dot fullCopy() {
Dot tree = (Dot) 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 QualifiedNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:99
*/
public Dot lastDot() {
Dot node = this;
while(node.getRightNoTransform() instanceof Dot)
node = (Dot)node.getRightNoTransform();
return node;
}
/**
* @ast method
* @aspect QualifiedNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:113
*/
public Dot qualifiesAccess(Access access) {
Dot lastDot = lastDot();
Expr l = lastDot.getRightNoTransform();
Dot dot = new Dot(lastDot.getRightNoTransform(), access);
dot.setStart(l.getStart());
dot.setEnd(access.getEnd());
lastDot.setRight(dot);
return this;
}
/**
* @ast method
* @aspect QualifiedNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:124
*/
private Access qualifyTailWith(Access expr) {
if(getRight/*NoTransform*/() instanceof AbstractDot) {
AbstractDot dot = (AbstractDot)getRight/*NoTransform*/();
return expr.qualifiesAccess(dot.getRight/*NoTransform*/());
}
return expr;
}
/**
* @ast method
* @aspect QualifiedNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:141
*/
public Access extractLast() {
return lastDot().getRightNoTransform();
}
/**
* @ast method
* @aspect QualifiedNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:144
*/
public void replaceLast(Access access) {
lastDot().setRight(access);
}
/**
* @ast method
*
*/
public Dot() {
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 Dot(Expr p0, Access 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 true;
}
/**
* Replaces the Left child.
* @param node The new node to replace the Left child.
* @apilevel high-level
* @ast method
*
*/
public void setLeft(Expr node) {
setChild(node, 0);
}
/**
* Retrieves the Left child.
* @return The current node used as the Left child.
* @apilevel high-level
* @ast method
*
*/
public Expr getLeft() {
return (Expr)getChild(0);
}
/**
* Retrieves the Left child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Left child.
* @apilevel low-level
* @ast method
*
*/
public Expr getLeftNoTransform() {
return (Expr)getChildNoTransform(0);
}
/**
* Replaces the Right child.
* @param node The new node to replace the Right child.
* @apilevel high-level
* @ast method
*
*/
public void setRight(Access node) {
setChild(node, 1);
}
/**
* Retrieves the Right child.
* @return The current node used as the Right child.
* @apilevel high-level
* @ast method
*
*/
public Access getRight() {
return (Access)getChild(1);
}
/**
* Retrieves the Right child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Right child.
* @apilevel low-level
* @ast method
*
*/
public Access getRightNoTransform() {
return (Access)getChildNoTransform(1);
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
// Declared in /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag at line 210
if(!duringSyntacticClassification() && leftSide().isPackageAccess() && rightSide().isPackageAccess()) {
state().duringNameResolution++;
ASTNode result = rewriteRule0();
state().duringNameResolution--;
return result;
}
// Declared in /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag at line 222
if(!duringSyntacticClassification() && leftSide().isPackageAccess() && !((Access)leftSide()).hasPrevExpr() && rightSide() instanceof TypeAccess) {
state().duringNameResolution++;
ASTNode result = rewriteRule1();
state().duringNameResolution--;
return result;
}
return super.rewriteTo();
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:210
* @apilevel internal
*/ private Access rewriteRule0() {
{
PackageAccess left = (PackageAccess)leftSide();
PackageAccess right = (PackageAccess)rightSide();
left.setPackage(left.getPackage() + "." + right.getPackage());
left.setEnd(right.end());
return qualifyTailWith(left);
} }
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:222
* @apilevel internal
*/ private Access rewriteRule1() {
{
PackageAccess left = (PackageAccess)leftSide();
TypeAccess right = (TypeAccess)rightSide();
right.setPackage(left.getPackage());
right.setStart(left.start());
return qualifyTailWith(right);
} }
}
| 7,832
| 26.103806
| 150
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/DoubleLiteral.java
|
/* 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;
/**
* Java double-precision floating point literal.
* Can store any value representable as an
* IEEE 754 64-bit double-precision floating point number.
* @production DoubleLiteral : {@link NumericLiteral};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Literals.ast:67
*/
public class DoubleLiteral extends NumericLiteral implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
type_computed = false;
type_value = null;
isZero_computed = false;
constant_computed = false;
constant_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public DoubleLiteral clone() throws CloneNotSupportedException {
DoubleLiteral node = (DoubleLiteral)super.clone();
node.type_computed = false;
node.type_value = null;
node.isZero_computed = false;
node.constant_computed = false;
node.constant_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public DoubleLiteral copy() {
try {
DoubleLiteral node = (DoubleLiteral) 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 DoubleLiteral fullCopy() {
DoubleLiteral tree = (DoubleLiteral) 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 TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:588
*/
public void typeCheck() {
if(!isZero() && constant().doubleValue() == 0.0f)
error("It is an error for nonzero floating-point " + getLITERAL() + " to round to zero");
if(constant().doubleValue() == Double.NEGATIVE_INFINITY || constant().doubleValue() == Double.POSITIVE_INFINITY)
error("It is an error for floating-point " + getLITERAL() + " to round to an infinity");
}
/**
* @ast method
* @aspect Expressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:29
*/
public soot.Value eval(Body b) {
return soot.jimple.DoubleConstant.v(constant().doubleValue());
}
/**
* @ast method
*
*/
public DoubleLiteral() {
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() {
}
/**
* @ast method
*
*/
public DoubleLiteral(String p0) {
setLITERAL(p0);
}
/**
* @ast method
*
*/
public DoubleLiteral(beaver.Symbol p0) {
setLITERAL(p0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return true;
}
/**
* Replaces the lexeme LITERAL.
* @param value The new value for the lexeme LITERAL.
* @apilevel high-level
* @ast method
*
*/
public void setLITERAL(String value) {
tokenString_LITERAL = value;
}
/**
* JastAdd-internal setter for lexeme LITERAL using the Beaver parser.
* @apilevel internal
* @ast method
*
*/
public void setLITERAL(beaver.Symbol symbol) {
if(symbol.value != null && !(symbol.value instanceof String))
throw new UnsupportedOperationException("setLITERAL is only valid for String lexemes");
tokenString_LITERAL = (String)symbol.value;
LITERALstart = symbol.getStart();
LITERALend = symbol.getEnd();
}
/**
* Retrieves the value for the lexeme LITERAL.
* @return The value for the lexeme LITERAL.
* @apilevel high-level
* @ast method
*
*/
public String getLITERAL() {
return tokenString_LITERAL != null ? tokenString_LITERAL : "";
}
/**
* Defer pretty printing to superclass.
* @ast method
* @aspect Literals
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Literals.jrag:112
*/
public void toString(StringBuffer s) {
super.toString(s);
}
/**
* @apilevel internal
*/
protected boolean type_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl type_value;
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:303
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl type() {
if(type_computed) {
return type_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
type_value = type_compute();
if(isFinal && num == state().boundariesCrossed) type_computed = true;
return type_value;
}
/**
* @apilevel internal
*/
private TypeDecl type_compute() { return typeDouble(); }
/**
* @apilevel internal
*/
protected boolean isZero_computed = false;
/**
* @apilevel internal
*/
protected boolean isZero_value;
/**
* @return true if this floating point literal is equivalent to a zero literal
* @attribute syn
* @aspect Literals
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Literals.jrag:36
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isZero() {
if(isZero_computed) {
return isZero_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
isZero_value = isZero_compute();
if(isFinal && num == state().boundariesCrossed) isZero_computed = true;
return isZero_value;
}
/**
* @apilevel internal
*/
private boolean isZero_compute() {
for(int i = 0; i < digits.length(); i++) {
char c = digits.charAt(i);
if (c == 'e' || c == 'p') break;
if (c != '0' && c != '.') {
return false;
}
}
return true;
}
/**
* @apilevel internal
*/
protected boolean constant_computed = false;
/**
* @apilevel internal
*/
protected Constant constant_value;
/**
* Parse this literal and return a fresh Constant.
* @return a fresh Constant representing this DoubleLiteral
* @attribute syn
* @aspect Literals
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Literals.jrag:190
*/
@SuppressWarnings({"unchecked", "cast"})
public Constant constant() {
if(constant_computed) {
return constant_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
constant_value = constant_compute();
if(isFinal && num == state().boundariesCrossed) constant_computed = true;
return constant_value;
}
/**
* @apilevel internal
*/
private Constant constant_compute() {
try {
return Constant.create(Double.parseDouble(getDigits()));
}
catch (NumberFormatException e) {
Constant c = Constant.create(0.0d);
c.error = true;
return c;
}
}
/**
* Utility attribute for literal rewriting.
* Any of the NumericLiteral subclasses have already
* been rewritten and/or parsed, and should not be
* rewritten again.
*
* @return true if this literal is a "raw", not-yet-parsed NumericLiteral
* @attribute syn
* @aspect Literals
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Literals.jrag:334
*/
public boolean needsRewrite() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 9,058
| 25.644118
| 115
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/DoubleType.java
|
/* 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 DoubleType : {@link FloatingPointType};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:63
*/
public class DoubleType extends FloatingPointType implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
boxed_computed = false;
boxed_value = null;
jvmName_computed = false;
jvmName_value = null;
getSootType_computed = false;
getSootType_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public DoubleType clone() throws CloneNotSupportedException {
DoubleType node = (DoubleType)super.clone();
node.boxed_computed = false;
node.boxed_value = null;
node.jvmName_computed = false;
node.jvmName_value = null;
node.getSootType_computed = false;
node.getSootType_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public DoubleType copy() {
try {
DoubleType node = (DoubleType) 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 DoubleType fullCopy() {
DoubleType tree = (DoubleType) 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:853
*/
public void toString(StringBuffer s) {
s.append("double");
}
/**
* @ast method
*
*/
public DoubleType() {
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[3];
setChild(new Opt(), 1);
setChild(new List(), 2);
}
/**
* @ast method
*
*/
public DoubleType(Modifiers p0, String p1, Opt<Access> p2, List<BodyDecl> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @ast method
*
*/
public DoubleType(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<BodyDecl> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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 optional node for the SuperClassAccess child. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* @param opt The new node to be used as the optional node for the SuperClassAccess child.
* @apilevel low-level
* @ast method
*
*/
public void setSuperClassAccessOpt(Opt<Access> opt) {
setChild(opt, 1);
}
/**
* Check whether the optional SuperClassAccess child exists.
* @return {@code true} if the optional SuperClassAccess child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasSuperClassAccess() {
return getSuperClassAccessOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) SuperClassAccess child.
* @return The SuperClassAccess child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getSuperClassAccess() {
return (Access)getSuperClassAccessOpt().getChild(0);
}
/**
* Replaces the (optional) SuperClassAccess child.
* @param node The new node to be used as the SuperClassAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setSuperClassAccess(Access node) {
getSuperClassAccessOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOpt() {
return (Opt<Access>)getChild(1);
}
/**
* Retrieves the optional node for child SuperClassAccess. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child SuperClassAccess.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOptNoTransform() {
return (Opt<Access>)getChildNoTransform(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<BodyDecl> 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<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addBodyDeclNoTransform(BodyDecl node) {
List<BodyDecl> 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<BodyDecl> list = getBodyDeclList();
list.setChild(node, i);
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<BodyDecl> getBodyDecls() {
return getBodyDeclList();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclsNoTransform() {
return getBodyDeclListNoTransform();
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclList() {
List<BodyDecl> list = (List<BodyDecl>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclListNoTransform() {
return (List<BodyDecl>)getChildNoTransform(2);
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:160
*/
public Constant cast(Constant c) {
ASTNode$State state = state();
try { return Constant.create(c.doubleValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:174
*/
public Constant plus(Constant c) {
ASTNode$State state = state();
try { return c; }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:183
*/
public Constant minus(Constant c) {
ASTNode$State state = state();
try { return Constant.create(-c.doubleValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:199
*/
public Constant mul(Constant c1, Constant c2) {
ASTNode$State state = state();
try { return Constant.create(c1.doubleValue() * c2.doubleValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:208
*/
public Constant div(Constant c1, Constant c2) {
ASTNode$State state = state();
try { return Constant.create(c1.doubleValue() / c2.doubleValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:217
*/
public Constant mod(Constant c1, Constant c2) {
ASTNode$State state = state();
try { return Constant.create(c1.doubleValue() % c2.doubleValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:226
*/
public Constant add(Constant c1, Constant c2) {
ASTNode$State state = state();
try { return Constant.create(c1.doubleValue() + c2.doubleValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:236
*/
public Constant sub(Constant c1, Constant c2) {
ASTNode$State state = state();
try { return Constant.create(c1.doubleValue() - c2.doubleValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:290
*/
public Constant questionColon(Constant cond, Constant c1, Constant c2) {
ASTNode$State state = state();
try { return Constant.create(cond.booleanValue() ? c1.doubleValue() : c2.doubleValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:394
*/
public boolean eqIsTrue(Expr left, Expr right) {
ASTNode$State state = state();
try { return left.constant().doubleValue() == right.constant().doubleValue(); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:405
*/
public boolean ltIsTrue(Expr left, Expr right) {
ASTNode$State state = state();
try { return left.constant().doubleValue() < right.constant().doubleValue(); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:411
*/
public boolean leIsTrue(Expr left, Expr right) {
ASTNode$State state = state();
try { return left.constant().doubleValue() <= right.constant().doubleValue(); }
finally {
}
}
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:199
*/
public boolean isDouble() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean boxed_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl boxed_value;
/**
* @attribute syn
* @aspect AutoBoxing
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:43
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl boxed() {
if(boxed_computed) {
return boxed_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boxed_value = boxed_compute();
if(isFinal && num == state().boundariesCrossed) boxed_computed = true;
return boxed_value;
}
/**
* @apilevel internal
*/
private TypeDecl boxed_compute() { return lookupType("java.lang", "Double"); }
/**
* @apilevel internal
*/
protected boolean jvmName_computed = false;
/**
* @apilevel internal
*/
protected String jvmName_value;
/**
* @attribute syn
* @aspect Java2Rewrites
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Java2Rewrites.jrag:41
*/
@SuppressWarnings({"unchecked", "cast"})
public String jvmName() {
if(jvmName_computed) {
return jvmName_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
jvmName_value = jvmName_compute();
if(isFinal && num == state().boundariesCrossed) jvmName_computed = true;
return jvmName_value;
}
/**
* @apilevel internal
*/
private String jvmName_compute() { return "D"; }
/**
* @attribute syn
* @aspect Java2Rewrites
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Java2Rewrites.jrag:44
*/
public String primitiveClassName() {
ASTNode$State state = state();
try { return "Double"; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean getSootType_computed = false;
/**
* @apilevel internal
*/
protected Type getSootType_value;
/**
* @attribute syn
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:54
*/
@SuppressWarnings({"unchecked", "cast"})
public Type getSootType() {
if(getSootType_computed) {
return getSootType_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
getSootType_value = getSootType_compute();
if(isFinal && num == state().boundariesCrossed) getSootType_computed = true;
return getSootType_value;
}
/**
* @apilevel internal
*/
private Type getSootType_compute() { return soot.DoubleType.v(); }
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 18,453
| 27.045593
| 153
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/EQExpr.java
|
/* 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 EQExpr : {@link EqualityExpr};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:182
*/
public class EQExpr extends EqualityExpr implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public EQExpr clone() throws CloneNotSupportedException {
EQExpr node = (EQExpr)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public EQExpr copy() {
try {
EQExpr node = (EQExpr) 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 EQExpr fullCopy() {
EQExpr tree = (EQExpr) 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 BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:294
*/
public soot.Value comparison(Body b, soot.Value left, soot.Value right) {
return b.newEqExpr(asImmediate(b, left), asImmediate(b, right), this);
}
/**
* @ast method
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:316
*/
public soot.Value comparisonInv(Body b, soot.Value left, soot.Value right) {
return b.newNeExpr(asImmediate(b, left), asImmediate(b, right), this);
}
/**
* @ast method
*
*/
public EQExpr() {
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 EQExpr(Expr 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 LeftOperand child.
* @param node The new node to replace the LeftOperand child.
* @apilevel high-level
* @ast method
*
*/
public void setLeftOperand(Expr node) {
setChild(node, 0);
}
/**
* Retrieves the LeftOperand child.
* @return The current node used as the LeftOperand child.
* @apilevel high-level
* @ast method
*
*/
public Expr getLeftOperand() {
return (Expr)getChild(0);
}
/**
* Retrieves the LeftOperand child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the LeftOperand child.
* @apilevel low-level
* @ast method
*
*/
public Expr getLeftOperandNoTransform() {
return (Expr)getChildNoTransform(0);
}
/**
* Replaces the RightOperand child.
* @param node The new node to replace the RightOperand child.
* @apilevel high-level
* @ast method
*
*/
public void setRightOperand(Expr node) {
setChild(node, 1);
}
/**
* Retrieves the RightOperand child.
* @return The current node used as the RightOperand child.
* @apilevel high-level
* @ast method
*
*/
public Expr getRightOperand() {
return (Expr)getChild(1);
}
/**
* Retrieves the RightOperand child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the RightOperand child.
* @apilevel low-level
* @ast method
*
*/
public Expr getRightOperandNoTransform() {
return (Expr)getChildNoTransform(1);
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:91
*/
public Constant constant() {
ASTNode$State state = state();
try { return Constant.create(binaryNumericPromotedType().eqIsTrue(left(), right())); }
finally {
}
}
/**
* @attribute syn
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:400
*/
public String printOp() {
ASTNode$State state = state();
try { return " == "; }
finally {
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 5,896
| 23.987288
| 120
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ElementAnnotationValue.java
|
/* 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 ElementAnnotationValue : {@link ElementValue} ::= <span class="component">{@link Annotation}</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.ast:12
*/
public class ElementAnnotationValue extends ElementValue implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ElementAnnotationValue clone() throws CloneNotSupportedException {
ElementAnnotationValue node = (ElementAnnotationValue)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ElementAnnotationValue copy() {
try {
ElementAnnotationValue node = (ElementAnnotationValue) 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 ElementAnnotationValue fullCopy() {
ElementAnnotationValue tree = (ElementAnnotationValue) 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 Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:600
*/
public void toString(StringBuffer s) {
getAnnotation().toString(s);
}
/**
* @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));
}
/**
* @ast method
*
*/
public ElementAnnotationValue() {
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[1];
}
/**
* @ast method
*
*/
public ElementAnnotationValue(Annotation p0) {
setChild(p0, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 1;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the Annotation child.
* @param node The new node to replace the Annotation child.
* @apilevel high-level
* @ast method
*
*/
public void setAnnotation(Annotation node) {
setChild(node, 0);
}
/**
* Retrieves the Annotation child.
* @return The current node used as the Annotation child.
* @apilevel high-level
* @ast method
*
*/
public Annotation getAnnotation() {
return (Annotation)getChild(0);
}
/**
* Retrieves the Annotation child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Annotation child.
* @apilevel low-level
* @ast method
*
*/
public Annotation getAnnotationNoTransform() {
return (Annotation)getChildNoTransform(0);
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:475
*/
public boolean commensurateWithTypeDecl(TypeDecl type) {
ASTNode$State state = state();
try {
return type() == type;
}
finally {
}
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:510
*/
public TypeDecl type() {
ASTNode$State state = state();
try { return getAnnotation().type(); }
finally {
}
}
/**
* @attribute inh
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:423
*/
@SuppressWarnings({"unchecked", "cast"})
public Annotation lookupAnnotation(TypeDecl typeDecl) {
ASTNode$State state = state();
Annotation lookupAnnotation_TypeDecl_value = getParent().Define_Annotation_lookupAnnotation(this, null, typeDecl);
return lookupAnnotation_TypeDecl_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:95
* @apilevel internal
*/
public boolean Define_boolean_mayUseAnnotationTarget(ASTNode caller, ASTNode child, String name) {
if(caller == getAnnotationNoTransform()) {
return true;
}
else { return getParent().Define_boolean_mayUseAnnotationTarget(this, caller, name);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:427
* @apilevel internal
*/
public Annotation Define_Annotation_lookupAnnotation(ASTNode caller, ASTNode child, TypeDecl typeDecl) {
if(caller == getAnnotationNoTransform()) {
return getAnnotation().type() == typeDecl ? getAnnotation() : lookupAnnotation(typeDecl);
}
else { return getParent().Define_Annotation_lookupAnnotation(this, caller, typeDecl);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 6,764
| 27.070539
| 123
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ElementArrayValue.java
|
/* 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 ElementArrayValue : {@link ElementValue} ::= <span class="component">{@link ElementValue}*</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.ast:13
*/
public class ElementArrayValue extends ElementValue implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ElementArrayValue clone() throws CloneNotSupportedException {
ElementArrayValue node = (ElementArrayValue)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ElementArrayValue copy() {
try {
ElementArrayValue node = (ElementArrayValue) 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 ElementArrayValue fullCopy() {
ElementArrayValue tree = (ElementArrayValue) 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 Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:603
*/
public void toString(StringBuffer s) {
s.append("{");
for(int i = 0; i < getNumElementValue(); i++) {
getElementValue(i).toString(s);
s.append(", ");
}
s.append("}");
}
/**
* @ast method
* @aspect AnnotationsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:359
*/
public void appendAsAttributeTo(Collection list, String name) {
ArrayList elemVals = new ArrayList();
for(int i = 0; i < getNumElementValue(); i++)
getElementValue(i).appendAsAttributeTo(elemVals, "default");
list.add(new soot.tagkit.AnnotationArrayElem(elemVals, '[', name));
}
/**
* @ast method
*
*/
public ElementArrayValue() {
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[1];
setChild(new List(), 0);
}
/**
* @ast method
*
*/
public ElementArrayValue(List<ElementValue> p0) {
setChild(p0, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 1;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the ElementValue list.
* @param list The new list node to be used as the ElementValue list.
* @apilevel high-level
* @ast method
*
*/
public void setElementValueList(List<ElementValue> list) {
setChild(list, 0);
}
/**
* Retrieves the number of children in the ElementValue list.
* @return Number of children in the ElementValue list.
* @apilevel high-level
* @ast method
*
*/
public int getNumElementValue() {
return getElementValueList().getNumChild();
}
/**
* Retrieves the number of children in the ElementValue list.
* Calling this method will not trigger rewrites..
* @return Number of children in the ElementValue list.
* @apilevel low-level
* @ast method
*
*/
public int getNumElementValueNoTransform() {
return getElementValueListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the ElementValue list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the ElementValue list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public ElementValue getElementValue(int i) {
return (ElementValue)getElementValueList().getChild(i);
}
/**
* Append an element to the ElementValue list.
* @param node The element to append to the ElementValue list.
* @apilevel high-level
* @ast method
*
*/
public void addElementValue(ElementValue node) {
List<ElementValue> list = (parent == null || state == null) ? getElementValueListNoTransform() : getElementValueList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addElementValueNoTransform(ElementValue node) {
List<ElementValue> list = getElementValueListNoTransform();
list.addChild(node);
}
/**
* Replaces the ElementValue 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 setElementValue(ElementValue node, int i) {
List<ElementValue> list = getElementValueList();
list.setChild(node, i);
}
/**
* Retrieves the ElementValue list.
* @return The node representing the ElementValue list.
* @apilevel high-level
* @ast method
*
*/
public List<ElementValue> getElementValues() {
return getElementValueList();
}
/**
* Retrieves the ElementValue list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the ElementValue list.
* @apilevel low-level
* @ast method
*
*/
public List<ElementValue> getElementValuesNoTransform() {
return getElementValueListNoTransform();
}
/**
* Retrieves the ElementValue list.
* @return The node representing the ElementValue list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<ElementValue> getElementValueList() {
List<ElementValue> list = (List<ElementValue>)getChild(0);
list.getNumChild();
return list;
}
/**
* Retrieves the ElementValue list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the ElementValue list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<ElementValue> getElementValueListNoTransform() {
return (List<ElementValue>)getChildNoTransform(0);
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:57
*/
public boolean validTarget(Annotation a) {
ASTNode$State state = state();
try {
for(int i = 0; i < getNumElementValue(); i++)
if(getElementValue(i).validTarget(a))
return true;
return false;
}
finally {
}
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:181
*/
public ElementValue definesElementTypeValue(String name) {
ASTNode$State state = state();
try {
for(int i = 0; i < getNumElementValue(); i++)
if(getElementValue(i).definesElementTypeValue(name) != null)
return getElementValue(i).definesElementTypeValue(name);
return null;
}
finally {
}
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:295
*/
public boolean hasValue(String s) {
ASTNode$State state = state();
try {
for(int i = 0; i < getNumElementValue(); i++)
if(getElementValue(i).hasValue(s))
return true;
return false;
}
finally {
}
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:495
*/
public boolean commensurateWithArrayDecl(ArrayDecl type) {
ASTNode$State state = state();
try {
for(int i = 0; i < getNumElementValue(); i++)
if(!type.componentType().commensurateWith(getElementValue(i)))
return false;
return true;
}
finally {
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:178
* @apilevel internal
*/
public ElementValue Define_ElementValue_lookupElementTypeValue(ASTNode caller, ASTNode child, String name) {
if(caller == getElementValueListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return definesElementTypeValue(name);
}
else { return getParent().Define_ElementValue_lookupElementTypeValue(this, caller, name);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 10,016
| 27.058824
| 123
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ElementConstantValue.java
|
/* 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 ElementConstantValue : {@link ElementValue} ::= <span class="component">{@link Expr}</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.ast:11
*/
public class ElementConstantValue extends ElementValue implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ElementConstantValue clone() throws CloneNotSupportedException {
ElementConstantValue node = (ElementConstantValue)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ElementConstantValue copy() {
try {
ElementConstantValue node = (ElementConstantValue) 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 ElementConstantValue fullCopy() {
ElementConstantValue tree = (ElementConstantValue) 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 Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:169
*/
public void nameCheck() {
if(enclosingAnnotationDecl().fullName().equals("java.lang.annotation.Target")) {
Variable v = getExpr().varDecl();
if(v != null && v.hostType().fullName().equals("java.lang.annotation.ElementType"))
if(lookupElementTypeValue(v.name()) != this)
error("repeated annotation target");
}
}
/**
* @ast method
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:597
*/
public void toString(StringBuffer s) {
getExpr().toString(s);
}
/**
* @ast method
* @aspect AnnotationsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:326
*/
public void appendAsAttributeTo(Collection list, String name) {
if(getExpr().isConstant() && !getExpr().type().isEnumDecl()) {
char kind = getExpr().type().isString() ? 's' : getExpr().type().typeDescriptor().charAt(0);
TypeDecl type = getExpr().type();
if(type.isLong())
list.add(new soot.tagkit.AnnotationLongElem(getExpr().constant().longValue(), kind, name));
else if(type.isDouble())
list.add(new soot.tagkit.AnnotationDoubleElem(getExpr().constant().doubleValue(), kind, name));
else if(type.isFloat())
list.add(new soot.tagkit.AnnotationFloatElem(getExpr().constant().floatValue(), kind, name));
else if(type.isString())
list.add(new soot.tagkit.AnnotationStringElem(getExpr().constant().stringValue(), kind, name));
else if(type.isIntegralType())
list.add(new soot.tagkit.AnnotationIntElem(getExpr().constant().intValue(), kind, name));
else if(type().isBoolean())
list.add(new soot.tagkit.AnnotationBooleanElem(getExpr().constant().booleanValue(), kind, name));
else
throw new UnsupportedOperationException("Unsupported attribute constant type " + type.typeName());
}
else if(getExpr().isClassAccess()) {
list.add(new soot.tagkit.AnnotationClassElem(getExpr().type().typeDescriptor(), 'c', name));
}
else {
Variable v = getExpr().varDecl();
if(v == null) throw new Error("Expected Enumeration constant");
list.add(new soot.tagkit.AnnotationEnumElem(v.type().typeDescriptor(), v.name(), 'e', name));
}
}
/**
* @ast method
*
*/
public ElementConstantValue() {
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[1];
}
/**
* @ast method
*
*/
public ElementConstantValue(Expr p0) {
setChild(p0, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 1;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* 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, 0);
}
/**
* Retrieves the Expr child.
* @return The current node used as the Expr child.
* @apilevel high-level
* @ast method
*
*/
public Expr getExpr() {
return (Expr)getChild(0);
}
/**
* Retrieves the Expr child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Expr child.
* @apilevel low-level
* @ast method
*
*/
public Expr getExprNoTransform() {
return (Expr)getChildNoTransform(0);
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:57
*/
public boolean validTarget(Annotation a) {
ASTNode$State state = state();
try {
Variable v = getExpr().varDecl();
if(v == null) return true;
return v.hostType().fullName().equals("java.lang.annotation.ElementType") && a.mayUseAnnotationTarget(v.name());
}
finally {
}
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:181
*/
public ElementValue definesElementTypeValue(String name) {
ASTNode$State state = state();
try {
Variable v = getExpr().varDecl();
if(v != null && v.hostType().fullName().equals("java.lang.annotation.ElementType") && v.name().equals(name))
return this;
return null;
}
finally {
}
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:295
*/
public boolean hasValue(String s) {
ASTNode$State state = state();
try { return getExpr().type().isString() &&
getExpr().isConstant() &&
getExpr().constant().stringValue().equals(s); }
finally {
}
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:475
*/
public boolean commensurateWithTypeDecl(TypeDecl type) {
ASTNode$State state = state();
try {
Expr v = getExpr();
if(!v.type().assignConversionTo(type, v))
return false;
if((type.isPrimitive() || type.isString()) && !v.isConstant())
return false;
if(v.type().isNull())
return false;
if(type.fullName().equals("java.lang.Class") && !v.isClassAccess())
return false;
if(type.isEnumDecl() && (v.varDecl() == null || !(v.varDecl() instanceof EnumConstant)))
return false;
return true;
}
finally {
}
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:510
*/
public TypeDecl type() {
ASTNode$State state = state();
try { return getExpr().type(); }
finally {
}
}
/**
* @attribute inh
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:177
*/
@SuppressWarnings({"unchecked", "cast"})
public ElementValue lookupElementTypeValue(String name) {
ASTNode$State state = state();
ElementValue lookupElementTypeValue_String_value = getParent().Define_ElementValue_lookupElementTypeValue(this, null, name);
return lookupElementTypeValue_String_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:550
* @apilevel internal
*/
public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {
if(caller == getExprNoTransform()) {
return NameType.AMBIGUOUS_NAME;
}
else { return getParent().Define_NameType_nameType(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:555
* @apilevel internal
*/
public String Define_String_methodHost(ASTNode caller, ASTNode child) {
if(caller == getExprNoTransform()) {
return enclosingAnnotationDecl().typeName();
}
else { return getParent().Define_String_methodHost(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 10,096
| 29.412651
| 128
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ElementValue.java
|
/* 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 ElementValue : {@link ASTNode};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.ast:10
*/
public abstract class ElementValue extends ASTNode<ASTNode> implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ElementValue clone() throws CloneNotSupportedException {
ElementValue node = (ElementValue)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @ast method
* @aspect AnnotationsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:318
*/
public void appendAsAttributeTo(Collection list, String name) {
throw new Error(getClass().getName() + " does not support appendAsAttributeTo(Attribute buf)");
}
/**
* @ast method
*
*/
public ElementValue() {
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() {
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:57
*/
public boolean validTarget(Annotation a) {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:181
*/
public ElementValue definesElementTypeValue(String name) {
ASTNode$State state = state();
try { return null; }
finally {
}
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:295
*/
public boolean hasValue(String s) {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:475
*/
public boolean commensurateWithTypeDecl(TypeDecl type) {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:495
*/
public boolean commensurateWithArrayDecl(ArrayDecl type) {
ASTNode$State state = state();
try { return type.componentType().commensurateWith(this); }
finally {
}
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:510
*/
public TypeDecl type() {
ASTNode$State state = state();
try { return unknownType(); }
finally {
}
}
/**
* @attribute inh
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:461
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl enclosingAnnotationDecl() {
ASTNode$State state = state();
TypeDecl enclosingAnnotationDecl_value = getParent().Define_TypeDecl_enclosingAnnotationDecl(this, null);
return enclosingAnnotationDecl_value;
}
/**
* @attribute inh
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:515
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl unknownType() {
ASTNode$State state = state();
TypeDecl unknownType_value = getParent().Define_TypeDecl_unknownType(this, null);
return unknownType_value;
}
/**
* @attribute inh
* @aspect AnnotationsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:366
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl hostType() {
ASTNode$State state = state();
TypeDecl hostType_value = getParent().Define_TypeDecl_hostType(this, null);
return hostType_value;
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 5,364
| 26.09596
| 123
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ElementValuePair.java
|
/* 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 ElementValuePair : {@link ASTNode} ::= <span class="component"><Name:String></span> <span class="component">{@link ElementValue}</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.ast:8
*/
public class ElementValuePair extends ASTNode<ASTNode> implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
type_computed = false;
type_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ElementValuePair clone() throws CloneNotSupportedException {
ElementValuePair node = (ElementValuePair)super.clone();
node.type_computed = false;
node.type_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ElementValuePair copy() {
try {
ElementValuePair node = (ElementValuePair) 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 ElementValuePair fullCopy() {
ElementValuePair tree = (ElementValuePair) 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 Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:504
*/
public void typeCheck() {
if(!type().commensurateWith(getElementValue()))
error("can not construct annotation with " + getName() +
" = " + getElementValue().toString() + "; " + type().typeName() +
" is not commensurate with " + getElementValue().type().typeName());
}
/**
* @ast method
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:593
*/
public void toString(StringBuffer s) {
s.append(getName() + " = ");
getElementValue().toString(s);
}
/**
* @ast method
*
*/
public ElementValuePair() {
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[1];
}
/**
* @ast method
*
*/
public ElementValuePair(String p0, ElementValue p1) {
setName(p0);
setChild(p1, 0);
}
/**
* @ast method
*
*/
public ElementValuePair(beaver.Symbol p0, ElementValue p1) {
setName(p0);
setChild(p1, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 1;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return true;
}
/**
* Replaces the lexeme Name.
* @param value The new value for the lexeme Name.
* @apilevel high-level
* @ast method
*
*/
public void setName(String value) {
tokenString_Name = value;
}
/**
* @apilevel internal
* @ast method
*
*/
/**
* @apilevel internal
*/
protected String tokenString_Name;
/**
* @ast method
*
*/
public int Namestart;
/**
* @ast method
*
*/
public int Nameend;
/**
* JastAdd-internal setter for lexeme Name using the Beaver parser.
* @apilevel internal
* @ast method
*
*/
public void setName(beaver.Symbol symbol) {
if(symbol.value != null && !(symbol.value instanceof String))
throw new UnsupportedOperationException("setName is only valid for String lexemes");
tokenString_Name = (String)symbol.value;
Namestart = symbol.getStart();
Nameend = symbol.getEnd();
}
/**
* Retrieves the value for the lexeme Name.
* @return The value for the lexeme Name.
* @apilevel high-level
* @ast method
*
*/
public String getName() {
return tokenString_Name != null ? tokenString_Name : "";
}
/**
* Replaces the ElementValue child.
* @param node The new node to replace the ElementValue child.
* @apilevel high-level
* @ast method
*
*/
public void setElementValue(ElementValue node) {
setChild(node, 0);
}
/**
* Retrieves the ElementValue child.
* @return The current node used as the ElementValue child.
* @apilevel high-level
* @ast method
*
*/
public ElementValue getElementValue() {
return (ElementValue)getChild(0);
}
/**
* Retrieves the ElementValue child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the ElementValue child.
* @apilevel low-level
* @ast method
*
*/
public ElementValue getElementValueNoTransform() {
return (ElementValue)getChildNoTransform(0);
}
/**
* @apilevel internal
*/
protected boolean type_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl type_value;
/* The annotation type named by an annotation must be accessible (\ufffd6.6) at the
point where the annotation is used, or a compile-time error occurs.
Comment: This is done by the access control framework* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:450
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl type() {
if(type_computed) {
return type_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
type_value = type_compute();
if(isFinal && num == state().boundariesCrossed) type_computed = true;
return type_value;
}
/**
* @apilevel internal
*/
private TypeDecl type_compute() {
Map methodMap = enclosingAnnotationDecl().localMethodsSignatureMap();
MethodDecl method = (MethodDecl) methodMap.get(getName()+"()");
if (method != null)
return method.type();
else
return unknownType();
}
/**
* @attribute inh
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:458
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl unknownType() {
ASTNode$State state = state();
TypeDecl unknownType_value = getParent().Define_TypeDecl_unknownType(this, null);
return unknownType_value;
}
/**
* @attribute inh
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:460
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl enclosingAnnotationDecl() {
ASTNode$State state = state();
TypeDecl enclosingAnnotationDecl_value = getParent().Define_TypeDecl_enclosingAnnotationDecl(this, null);
return enclosingAnnotationDecl_value;
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
// Declared in /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag at line 527
if(type().isArrayDecl() && getElementValue() instanceof ElementConstantValue) {
state().duringAnnotations++;
ASTNode result = rewriteRule0();
state().duringAnnotations--;
return result;
}
return super.rewriteTo();
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:527
* @apilevel internal
*/ private ElementValuePair rewriteRule0() {
{
setElementValue(new ElementArrayValue(new List().add(getElementValue())));
return this;
} }
}
| 8,913
| 26.094225
| 157
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/EmptyStmt.java
|
/* 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 EmptyStmt : {@link Stmt};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:198
*/
public class EmptyStmt extends Stmt implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
isDAafter_Variable_values = null;
isDUafter_Variable_values = null;
canCompleteNormally_computed = false;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public EmptyStmt clone() throws CloneNotSupportedException {
EmptyStmt node = (EmptyStmt)super.clone();
node.isDAafter_Variable_values = null;
node.isDUafter_Variable_values = null;
node.canCompleteNormally_computed = false;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public EmptyStmt copy() {
try {
EmptyStmt node = (EmptyStmt) 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 EmptyStmt fullCopy() {
EmptyStmt tree = (EmptyStmt) 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:537
*/
public void toString(StringBuffer s) {
s.append(indent());
s.append(";");
}
/**
* @ast method
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:20
*/
public void jimplify2(Body b) {
}
/**
* @ast method
*
*/
public EmptyStmt() {
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() {
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
protected java.util.Map isDAafter_Variable_values;
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:416
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDAafter(Variable v) {
Object _parameters = v;
if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4);
if(isDAafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDAafter_Variable_value = isDAafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value));
return isDAafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDAafter_compute(Variable v) { return isDAbefore(v); }
protected java.util.Map isDUafter_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:865
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDUafter(Variable v) {
Object _parameters = v;
if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4);
if(isDUafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDUafter_Variable_value = isDUafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value));
return isDUafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDUafter_compute(Variable v) { return isDUbefore(v); }
/**
* @apilevel internal
*/
protected boolean canCompleteNormally_computed = false;
/**
* @apilevel internal
*/
protected boolean canCompleteNormally_value;
/**
* @attribute syn
* @aspect UnreachableStatements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:44
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean canCompleteNormally() {
if(canCompleteNormally_computed) {
return canCompleteNormally_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
canCompleteNormally_value = canCompleteNormally_compute();
if(isFinal && num == state().boundariesCrossed) canCompleteNormally_computed = true;
return canCompleteNormally_value;
}
/**
* @apilevel internal
*/
private boolean canCompleteNormally_compute() { return reachable(); }
/**
* @attribute syn
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:55
*/
public boolean modifiedInScope(Variable var) {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 6,909
| 28.156118
| 140
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/EmptyType.java
|
/* 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 EmptyType : {@link PrimitiveType};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:46
*/
public class EmptyType extends PrimitiveType implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public EmptyType clone() throws CloneNotSupportedException {
EmptyType node = (EmptyType)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public EmptyType copy() {
try {
EmptyType node = (EmptyType) 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 EmptyType fullCopy() {
EmptyType tree = (EmptyType) 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:216
*/
public void toString(StringBuffer s) {
s.append(indent());
s.append(";");
}
/**
* @ast method
*
*/
public EmptyType() {
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[3];
setChild(new Opt(), 1);
setChild(new List(), 2);
}
/**
* @ast method
*
*/
public EmptyType(Modifiers p0, String p1, Opt<Access> p2, List<BodyDecl> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @ast method
*
*/
public EmptyType(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<BodyDecl> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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 optional node for the SuperClassAccess child. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* @param opt The new node to be used as the optional node for the SuperClassAccess child.
* @apilevel low-level
* @ast method
*
*/
public void setSuperClassAccessOpt(Opt<Access> opt) {
setChild(opt, 1);
}
/**
* Check whether the optional SuperClassAccess child exists.
* @return {@code true} if the optional SuperClassAccess child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasSuperClassAccess() {
return getSuperClassAccessOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) SuperClassAccess child.
* @return The SuperClassAccess child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getSuperClassAccess() {
return (Access)getSuperClassAccessOpt().getChild(0);
}
/**
* Replaces the (optional) SuperClassAccess child.
* @param node The new node to be used as the SuperClassAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setSuperClassAccess(Access node) {
getSuperClassAccessOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOpt() {
return (Opt<Access>)getChild(1);
}
/**
* Retrieves the optional node for child SuperClassAccess. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child SuperClassAccess.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOptNoTransform() {
return (Opt<Access>)getChildNoTransform(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<BodyDecl> 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<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addBodyDeclNoTransform(BodyDecl node) {
List<BodyDecl> 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<BodyDecl> list = getBodyDeclList();
list.setChild(node, i);
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<BodyDecl> getBodyDecls() {
return getBodyDeclList();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclsNoTransform() {
return getBodyDeclListNoTransform();
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclList() {
List<BodyDecl> list = (List<BodyDecl>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclListNoTransform() {
return (List<BodyDecl>)getChildNoTransform(2);
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 10,777
| 25.546798
| 153
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/EnhancedForStmt.java
|
/* 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 EnhancedForStmt : {@link BranchTargetStmt} ::= <span class="component">{@link VariableDeclaration}</span> <span class="component">{@link Expr}</span> <span class="component">{@link Stmt}</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.ast:1
*/
public class EnhancedForStmt extends BranchTargetStmt implements Cloneable, VariableScope {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
targetOf_ContinueStmt_values = null;
targetOf_BreakStmt_values = null;
canCompleteNormally_computed = false;
isDAafter_Variable_values = null;
isDUafter_Variable_values = null;
cond_label_computed = false;
cond_label_value = null;
update_label_computed = false;
update_label_value = null;
end_label_computed = false;
end_label_value = null;
extraLocalIndex_computed = false;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public EnhancedForStmt clone() throws CloneNotSupportedException {
EnhancedForStmt node = (EnhancedForStmt)super.clone();
node.targetOf_ContinueStmt_values = null;
node.targetOf_BreakStmt_values = null;
node.canCompleteNormally_computed = false;
node.isDAafter_Variable_values = null;
node.isDUafter_Variable_values = null;
node.cond_label_computed = false;
node.cond_label_value = null;
node.update_label_computed = false;
node.update_label_value = null;
node.end_label_computed = false;
node.end_label_value = null;
node.extraLocalIndex_computed = false;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public EnhancedForStmt copy() {
try {
EnhancedForStmt node = (EnhancedForStmt) 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 EnhancedForStmt fullCopy() {
EnhancedForStmt tree = (EnhancedForStmt) 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 EnhancedFor
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:15
*/
public void typeCheck() {
if (!getExpr().type().isArrayDecl() && !getExpr().type().isIterable()) {
error("type " + getExpr().type().name() +
" of expression in foreach is neither array type nor java.lang.Iterable");
}
else if(getExpr().type().isArrayDecl() && !getExpr().type().componentType().assignConversionTo(getVariableDeclaration().type(), null))
error("parameter of type " + getVariableDeclaration().type().typeName() + " can not be assigned an element of type " + getExpr().type().componentType().typeName());
else if(getExpr().type().isIterable() && !getExpr().type().isUnknown()) {
MethodDecl iterator = (MethodDecl)getExpr().type().memberMethods("iterator").iterator().next();
MethodDecl next = (MethodDecl)iterator.type().memberMethods("next").iterator().next();
TypeDecl componentType = next.type();
if(!componentType.assignConversionTo(getVariableDeclaration().type(), null))
error("parameter of type " + getVariableDeclaration().type().typeName() + " can not be assigned an element of type " + componentType.typeName());
}
}
/**
* @ast method
* @aspect EnhancedFor
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:58
*/
public void toString(StringBuffer s) {
s.append(indent());
s.append("for (");
getVariableDeclaration().getModifiers().toString(s);
getVariableDeclaration().getTypeAccess().toString(s);
s.append(" " + getVariableDeclaration().name());
s.append(" : ");
getExpr().toString(s);
s.append(") ");
getStmt().toString(s);
}
/**
* @ast method
* @aspect EnhancedForToBytecode
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/EnhancedForCodegen.jrag:24
*/
public void jimplify2(Body b) {
if(getExpr().type().isArrayDecl()) {
soot.Local array = asLocal(b, getExpr().eval(b));
soot.Local index = asLocal(b, soot.jimple.IntConstant.v(0));
soot.Local parameter = b.newLocal(getVariableDeclaration().name(), getVariableDeclaration().type().getSootType());
getVariableDeclaration().local = parameter;
b.setLine(this);
b.addLabel(cond_label());
b.add(
b.newIfStmt(
b.newGeExpr(
asImmediate(b, index),
asImmediate(b, b.newLengthExpr(asImmediate(b, array), this)),
this
),
end_label(),
this
)
);
b.add(
b.newAssignStmt(
parameter,
asRValue(b,
getExpr().type().elementType().emitCastTo(b,
asLocal(b,
b.newArrayRef(
array,
index,
this
)
),
getVariableDeclaration().type(),
this
)
),
this
)
);
getStmt().jimplify2(b);
b.addLabel(update_label());
b.add(
b.newAssignStmt(
index,
b.newAddExpr(
index,
soot.jimple.IntConstant.v(1),
this
),
this
)
);
b.add(b.newGotoStmt(cond_label(), this));
b.addLabel(end_label());
}
else {
soot.Local iterator = asLocal(b,
b.newInterfaceInvokeExpr(
asLocal(b, getExpr().eval(b)),
iteratorMethod().sootRef(),
new ArrayList(),
this
)
);
soot.Local parameter = b.newLocal(getVariableDeclaration().name(), getVariableDeclaration().type().getSootType());
getVariableDeclaration().local = parameter;
b.addLabel(cond_label());
b.add(
b.newIfStmt(
b.newEqExpr(
asImmediate(b,
b.newInterfaceInvokeExpr(
iterator,
hasNextMethod().sootRef(),
new ArrayList(),
this
)
),
BooleanType.emitConstant(false),
this
),
end_label(),
this
)
);
b.add(
b.newAssignStmt(
parameter,
nextMethod().type().emitCastTo(b,
b.newInterfaceInvokeExpr(
iterator,
nextMethod().sootRef(),
new ArrayList(),
this
),
getVariableDeclaration().type(),
this
),
this
)
);
getStmt().jimplify2(b);
b.addLabel(update_label());
b.add(b.newGotoStmt(cond_label(), this));
b.addLabel(end_label());
/*
getExpr().createBCode(gen);
iteratorMethod().emitInvokeMethod(gen, lookupType("java.lang", "Iterable"));
gen.emitStoreReference(extraLocalIndex());
gen.addLabel(cond_label());
gen.emitLoadReference(extraLocalIndex());
hasNextMethod().emitInvokeMethod(gen, lookupType("java.util", "Iterator"));
gen.emitCompare(Bytecode.IFEQ, end_label());
gen.emitLoadReference(extraLocalIndex());
nextMethod().emitInvokeMethod(gen, lookupType("java.util", "Iterator"));
gen.emitCheckCast(getVariableDeclaration().type());
gen.emitStoreReference(getVariableDeclaration().localNum());
getStmt().createBCode(gen);
gen.addLabel(update_label());
gen.emitGoto(cond_label());
gen.addLabel(end_label());
*/
}
}
/**
* @ast method
* @aspect EnhancedForToBytecode
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/EnhancedForCodegen.jrag:151
*/
private MethodDecl iteratorMethod() {
TypeDecl typeDecl = lookupType("java.lang", "Iterable");
for (Iterator iter = typeDecl.memberMethods("iterator").iterator(); iter.hasNext();) {
MethodDecl m = (MethodDecl)iter.next();
if (m.getNumParameter() == 0) {
return m;
}
}
throw new Error("Could not find java.lang.Iterable.iterator()");
}
/**
* @ast method
* @aspect EnhancedForToBytecode
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/EnhancedForCodegen.jrag:161
*/
private MethodDecl hasNextMethod() {
TypeDecl typeDecl = lookupType("java.util", "Iterator");
for (Iterator iter = typeDecl.memberMethods("hasNext").iterator(); iter.hasNext();) {
MethodDecl m = (MethodDecl)iter.next();
if (m.getNumParameter() == 0) {
return m;
}
}
throw new Error("Could not find java.util.Collection.hasNext()");
}
/**
* @ast method
* @aspect EnhancedForToBytecode
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/EnhancedForCodegen.jrag:171
*/
private MethodDecl nextMethod() {
TypeDecl typeDecl = lookupType("java.util", "Iterator");
for (Iterator iter = typeDecl.memberMethods("next").iterator(); iter.hasNext();) {
MethodDecl m = (MethodDecl)iter.next();
if (m.getNumParameter() == 0) {
return m;
}
}
throw new Error("Could not find java.util.Collection.next()");
}
/**
* @ast method
*
*/
public EnhancedForStmt() {
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[3];
}
/**
* @ast method
*
*/
public EnhancedForStmt(VariableDeclaration p0, Expr p1, Stmt p2) {
setChild(p0, 0);
setChild(p1, 1);
setChild(p2, 2);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the VariableDeclaration child.
* @param node The new node to replace the VariableDeclaration child.
* @apilevel high-level
* @ast method
*
*/
public void setVariableDeclaration(VariableDeclaration node) {
setChild(node, 0);
}
/**
* Retrieves the VariableDeclaration child.
* @return The current node used as the VariableDeclaration child.
* @apilevel high-level
* @ast method
*
*/
public VariableDeclaration getVariableDeclaration() {
return (VariableDeclaration)getChild(0);
}
/**
* Retrieves the VariableDeclaration child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the VariableDeclaration child.
* @apilevel low-level
* @ast method
*
*/
public VariableDeclaration getVariableDeclarationNoTransform() {
return (VariableDeclaration)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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Expr child.
* @apilevel low-level
* @ast method
*
*/
public Expr getExprNoTransform() {
return (Expr)getChildNoTransform(1);
}
/**
* Replaces the Stmt child.
* @param node The new node to replace the Stmt child.
* @apilevel high-level
* @ast method
*
*/
public void setStmt(Stmt node) {
setChild(node, 2);
}
/**
* Retrieves the Stmt child.
* @return The current node used as the Stmt child.
* @apilevel high-level
* @ast method
*
*/
public Stmt getStmt() {
return (Stmt)getChild(2);
}
/**
* Retrieves the Stmt child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Stmt child.
* @apilevel low-level
* @ast method
*
*/
public Stmt getStmtNoTransform() {
return (Stmt)getChildNoTransform(2);
}
/**
* @attribute syn
* @aspect EnhancedFor
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:50
*/
public SimpleSet localLookupVariable(String name) {
ASTNode$State state = state();
try {
if(getVariableDeclaration().name().equals(name)) {
return SimpleSet.emptySet.add(getVariableDeclaration());
}
return lookupVariable(name);
}
finally {
}
}
protected java.util.Map targetOf_ContinueStmt_values;
/**
* @attribute syn
* @aspect EnhancedFor
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:75
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean targetOf(ContinueStmt stmt) {
Object _parameters = stmt;
if(targetOf_ContinueStmt_values == null) targetOf_ContinueStmt_values = new java.util.HashMap(4);
if(targetOf_ContinueStmt_values.containsKey(_parameters)) {
return ((Boolean)targetOf_ContinueStmt_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean targetOf_ContinueStmt_value = targetOf_compute(stmt);
if(isFinal && num == state().boundariesCrossed) targetOf_ContinueStmt_values.put(_parameters, Boolean.valueOf(targetOf_ContinueStmt_value));
return targetOf_ContinueStmt_value;
}
/**
* @apilevel internal
*/
private boolean targetOf_compute(ContinueStmt stmt) { return !stmt.hasLabel(); }
protected java.util.Map targetOf_BreakStmt_values;
/**
* @attribute syn
* @aspect EnhancedFor
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:76
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean targetOf(BreakStmt stmt) {
Object _parameters = stmt;
if(targetOf_BreakStmt_values == null) targetOf_BreakStmt_values = new java.util.HashMap(4);
if(targetOf_BreakStmt_values.containsKey(_parameters)) {
return ((Boolean)targetOf_BreakStmt_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean targetOf_BreakStmt_value = targetOf_compute(stmt);
if(isFinal && num == state().boundariesCrossed) targetOf_BreakStmt_values.put(_parameters, Boolean.valueOf(targetOf_BreakStmt_value));
return targetOf_BreakStmt_value;
}
/**
* @apilevel internal
*/
private boolean targetOf_compute(BreakStmt stmt) { return !stmt.hasLabel(); }
/**
* @apilevel internal
*/
protected boolean canCompleteNormally_computed = false;
/**
* @apilevel internal
*/
protected boolean canCompleteNormally_value;
/**
* @attribute syn
* @aspect EnhancedFor
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:79
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean canCompleteNormally() {
if(canCompleteNormally_computed) {
return canCompleteNormally_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
canCompleteNormally_value = canCompleteNormally_compute();
if(isFinal && num == state().boundariesCrossed) canCompleteNormally_computed = true;
return canCompleteNormally_value;
}
/**
* @apilevel internal
*/
private boolean canCompleteNormally_compute() { return reachable(); }
protected java.util.Map isDAafter_Variable_values;
/**
* @attribute syn
* @aspect EnhancedFor
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:83
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDAafter(Variable v) {
Object _parameters = v;
if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4);
if(isDAafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDAafter_Variable_value = isDAafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value));
return isDAafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDAafter_compute(Variable v) {
if(!getExpr().isDAafter(v))
return false;
/*
for(Iterator iter = targetBreaks().iterator(); iter.hasNext(); ) {
BreakStmt stmt = (BreakStmt)iter.next();
if(!stmt.isDAafterReachedFinallyBlocks(v))
return false;
}
*/
return true;
}
protected java.util.Map isDUafter_Variable_values;
/**
* @attribute syn
* @aspect EnhancedFor
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:99
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDUafter(Variable v) {
Object _parameters = v;
if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4);
if(isDUafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDUafter_Variable_value = isDUafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value));
return isDUafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDUafter_compute(Variable v) {
if(!getExpr().isDUafter(v))
return false;
for(Iterator iter = targetBreaks().iterator(); iter.hasNext(); ) {
BreakStmt stmt = (BreakStmt)iter.next();
if(!stmt.isDUafterReachedFinallyBlocks(v))
return false;
}
return true;
}
/**
* @attribute syn
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:401
*/
public boolean continueLabel() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean cond_label_computed = false;
/**
* @apilevel internal
*/
protected soot.jimple.Stmt cond_label_value;
/**
* @attribute syn
* @aspect EnhancedForToBytecode
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/EnhancedForCodegen.jrag:12
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt cond_label() {
if(cond_label_computed) {
return cond_label_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
cond_label_value = cond_label_compute();
if(isFinal && num == state().boundariesCrossed) cond_label_computed = true;
return cond_label_value;
}
/**
* @apilevel internal
*/
private soot.jimple.Stmt cond_label_compute() { return newLabel(); }
/**
* @apilevel internal
*/
protected boolean update_label_computed = false;
/**
* @apilevel internal
*/
protected soot.jimple.Stmt update_label_value;
/**
* @attribute syn
* @aspect EnhancedForToBytecode
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/EnhancedForCodegen.jrag:13
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt update_label() {
if(update_label_computed) {
return update_label_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
update_label_value = update_label_compute();
if(isFinal && num == state().boundariesCrossed) update_label_computed = true;
return update_label_value;
}
/**
* @apilevel internal
*/
private soot.jimple.Stmt update_label_compute() { return newLabel(); }
/**
* @apilevel internal
*/
protected boolean end_label_computed = false;
/**
* @apilevel internal
*/
protected soot.jimple.Stmt end_label_value;
/**
* @attribute syn
* @aspect EnhancedForToBytecode
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/EnhancedForCodegen.jrag:14
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt end_label() {
if(end_label_computed) {
return end_label_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
end_label_value = end_label_compute();
if(isFinal && num == state().boundariesCrossed) end_label_computed = true;
return end_label_value;
}
/**
* @apilevel internal
*/
private soot.jimple.Stmt end_label_compute() { return newLabel(); }
/**
* @apilevel internal
*/
protected boolean extraLocalIndex_computed = false;
/**
* @apilevel internal
*/
protected int extraLocalIndex_value;
/**
* @attribute syn
* @aspect EnhancedForToBytecode
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/EnhancedForCodegen.jrag:16
*/
@SuppressWarnings({"unchecked", "cast"})
public int extraLocalIndex() {
if(extraLocalIndex_computed) {
return extraLocalIndex_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
extraLocalIndex_value = extraLocalIndex_compute();
if(isFinal && num == state().boundariesCrossed) extraLocalIndex_computed = true;
return extraLocalIndex_value;
}
/**
* @apilevel internal
*/
private int extraLocalIndex_compute() { return localNum(); }
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:200
*/
public soot.jimple.Stmt break_label() {
ASTNode$State state = state();
try { return end_label(); }
finally {
}
}
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:225
*/
public soot.jimple.Stmt continue_label() {
ASTNode$State state = state();
try { return update_label(); }
finally {
}
}
/**
* @attribute syn
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:55
*/
public boolean modifiedInScope(Variable var) {
ASTNode$State state = state();
try { return getStmt().modifiedInScope(var); }
finally {
}
}
/**
* @attribute inh
* @aspect EnhancedFor
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:38
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet lookupVariable(String name) {
ASTNode$State state = state();
SimpleSet lookupVariable_String_value = getParent().Define_SimpleSet_lookupVariable(this, null, name);
return lookupVariable_String_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:41
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) {
if(caller == getStmtNoTransform()) {
return localLookupVariable(name);
}
else if(caller == getExprNoTransform()) {
return localLookupVariable(name);
}
else if(caller == getVariableDeclarationNoTransform()) {
return localLookupVariable(name);
}
else { return getParent().Define_SimpleSet_lookupVariable(this, caller, name);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:43
* @apilevel internal
*/
public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {
if(caller == getVariableDeclarationNoTransform()) {
return NameType.TYPE_NAME;
}
else { return getParent().Define_NameType_nameType(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:48
* @apilevel internal
*/
public VariableScope Define_VariableScope_outerScope(ASTNode caller, ASTNode child) {
if(caller == getStmtNoTransform()) {
return this;
}
else if(caller == getExprNoTransform()) {
return this;
}
else if(caller == getVariableDeclarationNoTransform()) {
return this;
}
else { return getParent().Define_VariableScope_outerScope(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:71
* @apilevel internal
*/
public boolean Define_boolean_isMethodParameter(ASTNode caller, ASTNode child) {
if(caller == getVariableDeclarationNoTransform()) {
return false;
}
else { return getParent().Define_boolean_isMethodParameter(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:72
* @apilevel internal
*/
public boolean Define_boolean_isConstructorParameter(ASTNode caller, ASTNode child) {
if(caller == getVariableDeclarationNoTransform()) {
return false;
}
else { return getParent().Define_boolean_isConstructorParameter(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:73
* @apilevel internal
*/
public boolean Define_boolean_isExceptionHandlerParameter(ASTNode caller, ASTNode child) {
if(caller == getVariableDeclarationNoTransform()) {
return false;
}
else { return getParent().Define_boolean_isExceptionHandlerParameter(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:80
* @apilevel internal
*/
public boolean Define_boolean_reachable(ASTNode caller, ASTNode child) {
if(caller == getStmtNoTransform()) {
return reachable();
}
else { return getParent().Define_boolean_reachable(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:97
* @apilevel internal
*/
public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) {
if(caller == getStmtNoTransform()) {
return getExpr().isDAafter(v);
}
else if(caller == getExprNoTransform()) {
return v == getVariableDeclaration() || isDAbefore(v);
}
else { return getParent().Define_boolean_isDAbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:111
* @apilevel internal
*/
public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) {
if(caller == getStmtNoTransform()) {
return getExpr().isDUafter(v);
}
else if(caller == getExprNoTransform()) {
return v != getVariableDeclaration() && isDUbefore(v);
}
else { return getParent().Define_boolean_isDUbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/EnhancedFor.jrag:113
* @apilevel internal
*/
public boolean Define_boolean_insideLoop(ASTNode caller, ASTNode child) {
if(caller == getStmtNoTransform()) {
return true;
}
else { return getParent().Define_boolean_insideLoop(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/EnhancedForCodegen.jrag:18
* @apilevel internal
*/
public int Define_int_localNum(ASTNode caller, ASTNode child) {
if(caller == getStmtNoTransform()) {
return getVariableDeclaration().localNum() + getVariableDeclaration().type().size();
}
else if(caller == getVariableDeclarationNoTransform()) {
return localNum() + (getExpr().type().isArrayDecl() ? 2 : 1);
}
else { return getParent().Define_int_localNum(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 30,339
| 31.276596
| 209
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/Expr.java
|
/* 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 Expr : {@link ASTNode};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:104
*/
public abstract class Expr extends ASTNode<ASTNode> implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
false_label_computed = false;
false_label_value = null;
true_label_computed = false;
true_label_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public Expr clone() throws CloneNotSupportedException {
Expr node = (Expr)super.clone();
node.false_label_computed = false;
node.false_label_value = null;
node.true_label_computed = false;
node.true_label_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @ast method
* @aspect TypeScopePropagation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:461
*/
public SimpleSet keepAccessibleTypes(SimpleSet oldSet) {
SimpleSet newSet = SimpleSet.emptySet;
TypeDecl hostType = hostType();
for(Iterator iter = oldSet.iterator(); iter.hasNext(); ) {
TypeDecl t = (TypeDecl)iter.next();
if((hostType != null && t.accessibleFrom(hostType)) || (hostType == null && t.accessibleFromPackage(hostPackage())))
newSet = newSet.add(t);
}
return newSet;
}
/**
* Remove fields that are not accessible when using this Expr as qualifier
* @return a set containing the accessible fields
* @ast method
* @aspect VariableScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:169
*/
public SimpleSet keepAccessibleFields(SimpleSet oldSet) {
SimpleSet newSet = SimpleSet.emptySet;
for(Iterator iter = oldSet.iterator(); iter.hasNext(); ) {
Variable v = (Variable)iter.next();
if(v instanceof FieldDeclaration) {
FieldDeclaration f = (FieldDeclaration)v;
if(mayAccess(f))
newSet = newSet.add(f);
}
}
return newSet;
}
/**
* @see "JLS $6.6.2.1"
* @return true if the expression may access the given field
* @ast method
* @aspect VariableScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:196
*/
public boolean mayAccess(FieldDeclaration f) {
if(f.isPublic()) {
return true;
} else if(f.isProtected()) {
if(f.hostPackage().equals(hostPackage()))
return true;
return hostType().mayAccess(this, f);
} else if(f.isPrivate()) {
return f.hostType().topLevelType() == hostType().topLevelType();
} else {
return f.hostPackage().equals(hostType().hostPackage());
}
}
/**
* @ast method
* @aspect QualifiedNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:106
*/
public Dot qualifiesAccess(Access access) {
Dot dot = new Dot(this, access);
dot.setStart(this.getStart());
dot.setEnd(access.getEnd());
return dot;
}
/**
* @ast method
* @aspect MethodSignature15
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/MethodSignature.jrag:91
*/
protected SimpleSet chooseConstructor(Collection constructors, List argList) {
SimpleSet potentiallyApplicable = SimpleSet.emptySet;
// select potentially applicable constructors
for(Iterator iter = constructors.iterator(); iter.hasNext(); ) {
ConstructorDecl decl = (ConstructorDecl)iter.next();
if(decl.potentiallyApplicable(argList) && decl.accessibleFrom(hostType()))
potentiallyApplicable = potentiallyApplicable.add(decl);
}
// first phase
SimpleSet maxSpecific = SimpleSet.emptySet;
for(Iterator iter = potentiallyApplicable.iterator(); iter.hasNext(); ) {
ConstructorDecl decl = (ConstructorDecl)iter.next();
if(decl.applicableBySubtyping(argList))
maxSpecific = mostSpecific(maxSpecific, decl);
}
// second phase
if(maxSpecific.isEmpty()) {
for(Iterator iter = potentiallyApplicable.iterator(); iter.hasNext(); ) {
ConstructorDecl decl = (ConstructorDecl)iter.next();
if(decl.applicableByMethodInvocationConversion(argList))
maxSpecific = mostSpecific(maxSpecific, decl);
}
}
// third phase
if(maxSpecific.isEmpty()) {
for(Iterator iter = potentiallyApplicable.iterator(); iter.hasNext(); ) {
ConstructorDecl decl = (ConstructorDecl)iter.next();
if(decl.isVariableArity() && decl.applicableVariableArity(argList))
maxSpecific = mostSpecific(maxSpecific, decl);
}
}
return maxSpecific;
}
/**
* @ast method
* @aspect MethodSignature15
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/MethodSignature.jrag:128
*/
protected static SimpleSet mostSpecific(SimpleSet maxSpecific, ConstructorDecl decl) {
if(maxSpecific.isEmpty())
maxSpecific = maxSpecific.add(decl);
else {
if(decl.moreSpecificThan((ConstructorDecl)maxSpecific.iterator().next()))
maxSpecific = SimpleSet.emptySet.add(decl);
else if(!((ConstructorDecl)maxSpecific.iterator().next()).moreSpecificThan(decl))
maxSpecific = maxSpecific.add(decl);
}
return maxSpecific;
}
/**
* @ast method
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:105
*/
protected soot.Value emitBooleanCondition(Body b) {
b.setLine(this);
emitEvalBranch(b);
soot.jimple.Stmt end_label = newLabel();
b.addLabel(false_label());
Local result = b.newTemp(soot.BooleanType.v());
b.add(b.newAssignStmt(result, BooleanType.emitConstant(false), this));
b.add(b.newGotoStmt(end_label, this));
b.addLabel(true_label());
b.add(b.newAssignStmt(result, BooleanType.emitConstant(true), this));
b.addLabel(end_label);
return result;
}
/**
* @ast method
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:158
*/
public void refined_BooleanExpressions_Expr_emitEvalBranch(Body b) {
b.setLine(this);
if(isTrue())
b.add(b.newGotoStmt(true_label(), this));
else if(isFalse())
b.add(b.newGotoStmt(false_label(), this));
else {
b.add(
b.newIfStmt(
b.newEqExpr(
asImmediate(b, eval(b)),
BooleanType.emitConstant(false),
this
),
false_label(),
this
)
);
b.add(b.newGotoStmt(true_label(), this));
}
}
/**
* @ast method
* @aspect Expressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:11
*/
public soot.Value eval(Body b) {
throw new Error("Operation eval not supported for " + getClass().getName());
}
/**
* @ast method
* @aspect Expressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:259
*/
public soot.Value emitStore(Body b, soot.Value lvalue, soot.Value rvalue, ASTNode location) {
b.setLine(this);
b.add(
b.newAssignStmt(
lvalue,
asLocal(b, rvalue, lvalue.getType()),
location
)
);
return rvalue;
}
/**
* @ast method
* @aspect EmitJimpleRefinements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/SootJastAddJ/EmitJimpleRefinements.jrag:202
*/
public void collectTypesToHierarchy(Collection<Type> set) {
super.collectTypesToHierarchy(set);
// collect all expr types that are reference types
// select the element type in case it is an array type
addDependencyIfNeeded(set, type());
}
/**
* @ast method
* @aspect EmitJimpleRefinements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/SootJastAddJ/EmitJimpleRefinements.jrag:209
*/
protected void addDependencyIfNeeded(Collection<Type> set, TypeDecl type) {
type = type.elementType().erasure();
if(type.isReferenceType() && !type.isUnknown())
set.add(type.getSootType());
}
/**
* @ast method
*
*/
public Expr() {
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() {
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* @ast method
* @aspect AutoBoxingCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AutoBoxingCodegen.jrag:100
*/
public void emitEvalBranch(Body b) {
if(type().isReferenceType()) {
b.setLine(this);
b.add(
b.newIfStmt(
b.newEqExpr(
asImmediate(b, type().emitUnboxingOperation(b, eval(b), this)),
BooleanType.emitConstant(false),
this
),
false_label(),
this
)
);
b.add(b.newGotoStmt(true_label(), this));
}
else
refined_BooleanExpressions_Expr_emitEvalBranch(b);
}
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:276
*/
@SuppressWarnings({"unchecked", "cast"})
public abstract TypeDecl type();
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:91
*/
public Constant constant() {
ASTNode$State state = state();
try {
throw new UnsupportedOperationException("ConstantExpression operation constant" +
" not supported for type " + getClass().getName());
}
finally {
}
}
/*syn lazy boolean FloatingPointLiteral.isZero() {
String s = getLITERAL();
for(int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if(c == 'E' || c == 'e')
break;
if(Character.isDigit(c) && c != '0') {
return false;
}
}
return true;
}
syn lazy boolean DoubleLiteral.isZero() {
String s = getLITERAL();
for(int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if(c == 'E' || c == 'e')
break;
if(Character.isDigit(c) && c != '0') {
return false;
}
}
return true;
}* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:152
*/
public boolean isPositive() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/*
* representableIn(T) is true if and only if the the expression is a
* compile-time constant of type byte, char, short or int, and the value
* of the expression can be represented (by an expression) in the type T
* where T must be byte, char or short.
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:308
*/
public boolean representableIn(TypeDecl t) {
ASTNode$State state = state();
try {
if (!type().isByte() && !type().isChar() && !type().isShort() && !type().isInt()) {
return false;
}
if (t.isByte())
return constant().intValue() >= Byte.MIN_VALUE && constant().intValue() <= Byte.MAX_VALUE;
if (t.isChar())
return constant().intValue() >= Character.MIN_VALUE && constant().intValue() <= Character.MAX_VALUE;
if (t.isShort())
return constant().intValue() >= Short.MIN_VALUE && constant().intValue() <= Short.MAX_VALUE;
if(t.isInt())
return constant().intValue() >= Integer.MIN_VALUE && constant().intValue() <= Integer.MAX_VALUE;
return false;
}
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:336
*/
public boolean isConstant() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:365
*/
public boolean isTrue() {
ASTNode$State state = state();
try { return isConstant() && type() instanceof BooleanType && constant().booleanValue(); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:366
*/
public boolean isFalse() {
ASTNode$State state = state();
try { return isConstant() && type() instanceof BooleanType && !constant().booleanValue(); }
finally {
}
}
/**
* @attribute syn
* @aspect DefiniteAssignment
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:58
*/
public Variable varDecl() {
ASTNode$State state = state();
try { return null; }
finally {
}
}
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:333
*/
public boolean isDAafterFalse(Variable v) {
ASTNode$State state = state();
try { return isTrue() || isDAbefore(v); }
finally {
}
}
/*eq Stmt.isDAafter(Variable v) {
//System.out.println("### isDAafter reached in " + getClass().getName());
//throw new NullPointerException();
throw new Error("Can not compute isDAafter for " + getClass().getName() + " at " + errorPrefix());
}* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:332
*/
public boolean isDAafterTrue(Variable v) {
ASTNode$State state = state();
try { return isFalse() || isDAbefore(v); }
finally {
}
}
/**
* @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 (isDAafterFalse(v) && isDAafterTrue(v)) || isDAbefore(v); }
finally {
}
}
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:703
*/
public boolean isDUafterFalse(Variable v) {
ASTNode$State state = state();
try {
if(isTrue())
return true;
return isDUbefore(v);
}
finally {
}
}
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:702
*/
public boolean isDUafterTrue(Variable v) {
ASTNode$State state = state();
try {
if(isFalse())
return true;
return isDUbefore(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 (isDUafterFalse(v) && isDUafterTrue(v)) || isDUbefore(v); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstructScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:32
*/
public SimpleSet mostSpecificConstructor(Collection constructors) {
ASTNode$State state = state();
try {
SimpleSet maxSpecific = SimpleSet.emptySet;
for(Iterator iter = constructors.iterator(); iter.hasNext(); ) {
ConstructorDecl decl = (ConstructorDecl)iter.next();
if(applicableAndAccessible(decl)) {
if(maxSpecific.isEmpty())
maxSpecific = maxSpecific.add(decl);
else {
if(decl.moreSpecificThan((ConstructorDecl)maxSpecific.iterator().next()))
maxSpecific = SimpleSet.emptySet.add(decl);
else if(!((ConstructorDecl)maxSpecific.iterator().next()).moreSpecificThan(decl))
maxSpecific = maxSpecific.add(decl);
}
}
}
return maxSpecific;
}
finally {
}
}
/**
* @attribute syn
* @aspect ConstructScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupConstructor.jrag:50
*/
public boolean applicableAndAccessible(ConstructorDecl decl) {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect LookupFullyQualifiedTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:83
*/
public boolean hasQualifiedPackage(String packageName) {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect TypeScopePropagation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:430
*/
public SimpleSet qualifiedLookupType(String name) {
ASTNode$State state = state();
try { return keepAccessibleTypes(type().memberTypes(name)); }
finally {
}
}
/**
* @attribute syn
* @aspect VariableScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:148
*/
public SimpleSet qualifiedLookupVariable(String name) {
ASTNode$State state = state();
try {
if(type().accessibleFrom(hostType()))
return keepAccessibleFields(type().memberFields(name));
return SimpleSet.emptySet;
}
finally {
}
}
/**
* @attribute syn
* @aspect Names
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/QualifiedNames.jrag:25
*/
public String packageName() {
ASTNode$State state = state();
try { return ""; }
finally {
}
}
/**
* @attribute syn
* @aspect Names
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/QualifiedNames.jrag:62
*/
public String typeName() {
ASTNode$State state = state();
try { return ""; }
finally {
}
}
/**
* @attribute syn
* @aspect AccessTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:13
*/
public boolean isTypeAccess() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect AccessTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:17
*/
public boolean isMethodAccess() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect AccessTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:21
*/
public boolean isFieldAccess() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect AccessTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:25
*/
public boolean isSuperAccess() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect AccessTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:31
*/
public boolean isThisAccess() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect AccessTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:37
*/
public boolean isPackageAccess() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect AccessTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:41
*/
public boolean isArrayAccess() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect AccessTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:45
*/
public boolean isClassAccess() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect AccessTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:49
*/
public boolean isSuperConstructorAccess() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect QualifiedNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:55
*/
public boolean isLeftChildOfDot() {
ASTNode$State state = state();
try { return hasParentDot() && parentDot().getLeft() == this; }
finally {
}
}
/**
* @attribute syn
* @aspect QualifiedNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:56
*/
public boolean isRightChildOfDot() {
ASTNode$State state = state();
try { return hasParentDot() && parentDot().getRight() == this; }
finally {
}
}
/**
* @attribute syn
* @aspect QualifiedNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:69
*/
public AbstractDot parentDot() {
ASTNode$State state = state();
try { return getParent() instanceof AbstractDot ? (AbstractDot)getParent() : null; }
finally {
}
}
/**
* @attribute syn
* @aspect QualifiedNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:70
*/
public boolean hasParentDot() {
ASTNode$State state = state();
try { return parentDot() != null; }
finally {
}
}
/**
* @attribute syn
* @aspect QualifiedNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:72
*/
public Access nextAccess() {
ASTNode$State state = state();
try { return parentDot().nextAccess(); }
finally {
}
}
/**
* @attribute syn
* @aspect QualifiedNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ResolveAmbiguousNames.jrag:73
*/
public boolean hasNextAccess() {
ASTNode$State state = state();
try { return isLeftChildOfDot(); }
finally {
}
}
/**
* @attribute syn
* @aspect NestedTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:503
*/
public Stmt enclosingStmt() {
ASTNode$State state = state();
try {
ASTNode node = this;
while(node != null && !(node instanceof Stmt))
node = node.getParent();
return (Stmt)node;
}
finally {
}
}
/**
* @attribute syn
* @aspect TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:15
*/
public boolean isVariable() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect TypeHierarchyCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:20
*/
public boolean isUnknown() {
ASTNode$State state = state();
try { return type().isUnknown(); }
finally {
}
}
/**
* @attribute syn
* @aspect TypeHierarchyCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:150
*/
public boolean staticContextQualifier() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:500
*/
public boolean isEnumConstant() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean false_label_computed = false;
/**
* @apilevel internal
*/
protected soot.jimple.Stmt false_label_value;
/**
* @attribute syn
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:16
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt false_label() {
if(false_label_computed) {
return false_label_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
false_label_value = false_label_compute();
if(isFinal && num == state().boundariesCrossed) false_label_computed = true;
return false_label_value;
}
/**
* @apilevel internal
*/
private soot.jimple.Stmt false_label_compute() { return getParent().definesLabel() ? condition_false_label() : newLabel(); }
/**
* @apilevel internal
*/
protected boolean true_label_computed = false;
/**
* @apilevel internal
*/
protected soot.jimple.Stmt true_label_value;
/**
* @attribute syn
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:18
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt true_label() {
if(true_label_computed) {
return true_label_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
true_label_value = true_label_compute();
if(isFinal && num == state().boundariesCrossed) true_label_computed = true;
return true_label_value;
}
/**
* @apilevel internal
*/
private soot.jimple.Stmt true_label_compute() { return getParent().definesLabel() ? condition_true_label() : newLabel(); }
/**
* @attribute syn
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:82
*/
public boolean canBeTrue() {
ASTNode$State state = state();
try { return !isFalse(); }
finally {
}
}
/**
* @attribute syn
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:92
*/
public boolean canBeFalse() {
ASTNode$State state = state();
try { return !isTrue(); }
finally {
}
}
/**
* @attribute syn
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:11
*/
public Collection<TypeDecl> throwTypes() {
ASTNode$State state = state();
try {
Collection<TypeDecl> tts = new LinkedList<TypeDecl>();
tts.add(type());
return tts;
}
finally {
}
}
/**
* @attribute syn
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:111
*/
public boolean modifiedInScope(Variable var) {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:115
*/
public boolean isVariable(Variable var) {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute inh
* @aspect DefiniteAssignment
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:15
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDest() {
ASTNode$State state = state();
boolean isDest_value = getParent().Define_boolean_isDest(this, null);
return isDest_value;
}
/**
* @attribute inh
* @aspect DefiniteAssignment
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:25
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isSource() {
ASTNode$State state = state();
boolean isSource_value = getParent().Define_boolean_isSource(this, null);
return isSource_value;
}
/**
* @attribute inh
* @aspect DefiniteAssignment
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:49
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isIncOrDec() {
ASTNode$State state = state();
boolean isIncOrDec_value = getParent().Define_boolean_isIncOrDec(this, null);
return isIncOrDec_value;
}
/**
* @attribute inh
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:234
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDAbefore(Variable v) {
ASTNode$State state = state();
boolean isDAbefore_Variable_value = getParent().Define_boolean_isDAbefore(this, null, v);
return isDAbefore_Variable_value;
}
/**
* @attribute inh
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:693
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDUbefore(Variable v) {
ASTNode$State state = state();
boolean isDUbefore_Variable_value = getParent().Define_boolean_isDUbefore(this, null, v);
return isDUbefore_Variable_value;
}
/**
* @attribute inh
* @aspect LookupMethod
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupMethod.jrag:23
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection lookupMethod(String name) {
ASTNode$State state = state();
Collection lookupMethod_String_value = getParent().Define_Collection_lookupMethod(this, null, name);
return lookupMethod_String_value;
}
/**
* @attribute inh
* @aspect SpecialClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:49
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl typeBoolean() {
ASTNode$State state = state();
TypeDecl typeBoolean_value = getParent().Define_TypeDecl_typeBoolean(this, null);
return typeBoolean_value;
}
/**
* @attribute inh
* @aspect SpecialClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:50
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl typeByte() {
ASTNode$State state = state();
TypeDecl typeByte_value = getParent().Define_TypeDecl_typeByte(this, null);
return typeByte_value;
}
/**
* @attribute inh
* @aspect SpecialClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:51
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl typeShort() {
ASTNode$State state = state();
TypeDecl typeShort_value = getParent().Define_TypeDecl_typeShort(this, null);
return typeShort_value;
}
/**
* @attribute inh
* @aspect SpecialClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:52
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl typeChar() {
ASTNode$State state = state();
TypeDecl typeChar_value = getParent().Define_TypeDecl_typeChar(this, null);
return typeChar_value;
}
/**
* @attribute inh
* @aspect SpecialClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:53
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl typeInt() {
ASTNode$State state = state();
TypeDecl typeInt_value = getParent().Define_TypeDecl_typeInt(this, null);
return typeInt_value;
}
/**
* @attribute inh
* @aspect SpecialClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:54
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl typeLong() {
ASTNode$State state = state();
TypeDecl typeLong_value = getParent().Define_TypeDecl_typeLong(this, null);
return typeLong_value;
}
/**
* @attribute inh
* @aspect SpecialClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:55
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl typeFloat() {
ASTNode$State state = state();
TypeDecl typeFloat_value = getParent().Define_TypeDecl_typeFloat(this, null);
return typeFloat_value;
}
/**
* @attribute inh
* @aspect SpecialClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:56
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl typeDouble() {
ASTNode$State state = state();
TypeDecl typeDouble_value = getParent().Define_TypeDecl_typeDouble(this, null);
return typeDouble_value;
}
/**
* @attribute inh
* @aspect SpecialClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:57
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl typeString() {
ASTNode$State state = state();
TypeDecl typeString_value = getParent().Define_TypeDecl_typeString(this, null);
return typeString_value;
}
/**
* @attribute inh
* @aspect SpecialClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:58
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl typeVoid() {
ASTNode$State state = state();
TypeDecl typeVoid_value = getParent().Define_TypeDecl_typeVoid(this, null);
return typeVoid_value;
}
/**
* @attribute inh
* @aspect SpecialClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:59
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl typeNull() {
ASTNode$State state = state();
TypeDecl typeNull_value = getParent().Define_TypeDecl_typeNull(this, null);
return typeNull_value;
}
/**
* @attribute inh
* @aspect SpecialClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:72
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl unknownType() {
ASTNode$State state = state();
TypeDecl unknownType_value = getParent().Define_TypeDecl_unknownType(this, null);
return unknownType_value;
}
/**
* @attribute inh
* @aspect LookupFullyQualifiedTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:86
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean hasPackage(String packageName) {
ASTNode$State state = state();
boolean hasPackage_String_value = getParent().Define_boolean_hasPackage(this, null, packageName);
return hasPackage_String_value;
}
/**
* @attribute inh
* @aspect LookupFullyQualifiedTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:95
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl lookupType(String packageName, String typeName) {
ASTNode$State state = state();
TypeDecl lookupType_String_String_value = getParent().Define_TypeDecl_lookupType(this, null, packageName, typeName);
return lookupType_String_String_value;
}
/**
* @attribute inh
* @aspect TypeScopePropagation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:264
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet lookupType(String name) {
ASTNode$State state = state();
SimpleSet lookupType_String_value = getParent().Define_SimpleSet_lookupType(this, null, name);
return lookupType_String_value;
}
/**
* @attribute inh
* @aspect VariableScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:19
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet lookupVariable(String name) {
ASTNode$State state = state();
SimpleSet lookupVariable_String_value = getParent().Define_SimpleSet_lookupVariable(this, null, name);
return lookupVariable_String_value;
}
/**
* @attribute inh
* @aspect SyntacticClassification
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:20
*/
@SuppressWarnings({"unchecked", "cast"})
public NameType nameType() {
ASTNode$State state = state();
NameType nameType_value = getParent().Define_NameType_nameType(this, null);
return nameType_value;
}
/**
* @attribute inh
* @aspect NestedTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:510
*/
@SuppressWarnings({"unchecked", "cast"})
public BodyDecl enclosingBodyDecl() {
ASTNode$State state = state();
BodyDecl enclosingBodyDecl_value = getParent().Define_BodyDecl_enclosingBodyDecl(this, null);
return enclosingBodyDecl_value;
}
/**
* @attribute inh
* @aspect NestedTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:567
*/
@SuppressWarnings({"unchecked", "cast"})
public String hostPackage() {
ASTNode$State state = state();
String hostPackage_value = getParent().Define_String_hostPackage(this, null);
return hostPackage_value;
}
/**
* @attribute inh
* @aspect NestedTypes
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:586
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl hostType() {
ASTNode$State state = state();
TypeDecl hostType_value = getParent().Define_TypeDecl_hostType(this, null);
return hostType_value;
}
/**
* @attribute inh
* @aspect TypeHierarchyCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:11
*/
@SuppressWarnings({"unchecked", "cast"})
public String methodHost() {
ASTNode$State state = state();
String methodHost_value = getParent().Define_String_methodHost(this, null);
return methodHost_value;
}
/**
* @attribute inh
* @aspect TypeHierarchyCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:134
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean inStaticContext() {
ASTNode$State state = state();
boolean inStaticContext_value = getParent().Define_boolean_inStaticContext(this, null);
return inStaticContext_value;
}
/**
* @attribute inh
* @aspect GenericMethodsInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethodsInference.jrag:33
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl assignConvertedType() {
ASTNode$State state = state();
TypeDecl assignConvertedType_value = getParent().Define_TypeDecl_assignConvertedType(this, null);
return assignConvertedType_value;
}
/**
* @attribute inh
* @aspect GenericsTypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:271
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean inExtendsOrImplements() {
ASTNode$State state = state();
boolean inExtendsOrImplements_value = getParent().Define_boolean_inExtendsOrImplements(this, null);
return inExtendsOrImplements_value;
}
/**
* @attribute inh
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:48
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt condition_false_label() {
ASTNode$State state = state();
soot.jimple.Stmt condition_false_label_value = getParent().Define_soot_jimple_Stmt_condition_false_label(this, null);
return condition_false_label_value;
}
/**
* @attribute inh
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:52
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt condition_true_label() {
ASTNode$State state = state();
soot.jimple.Stmt condition_true_label_value = getParent().Define_soot_jimple_Stmt_condition_true_label(this, null);
return condition_true_label_value;
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 42,492
| 30.997741
| 128
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/EnumConstant.java
|
/* 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 EnumConstant : {@link FieldDeclaration} ::= <span class="component">{@link Modifiers}</span> <span class="component"><ID:String></span> <span class="component">Arg:{@link Expr}*</span> <span class="component">[Init:{@link Expr}]</span> <span class="component">TypeAccess:{@link Access}</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.ast:3
*/
public class EnumConstant extends FieldDeclaration implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
getTypeAccess_computed = false;
getTypeAccess_value = null;
localMethodsSignatureMap_computed = false;
localMethodsSignatureMap_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public EnumConstant clone() throws CloneNotSupportedException {
EnumConstant node = (EnumConstant)super.clone();
node.getTypeAccess_computed = false;
node.getTypeAccess_value = null;
node.localMethodsSignatureMap_computed = false;
node.localMethodsSignatureMap_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public EnumConstant copy() {
try {
EnumConstant node = (EnumConstant) 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 EnumConstant fullCopy() {
EnumConstant tree = (EnumConstant) copy();
if (children != null) {
for (int i = 0; i < children.length; ++i) {
switch (i) {
case 4:
tree.children[i] = null;
continue;
}
ASTNode child = (ASTNode) children[i];
if(child != null) {
child = child.fullCopy();
tree.setChild(child, i);
}
}
}
return tree;
}
/**
* @ast method
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:197
*/
public EnumConstant(Modifiers mods, String name, List<Expr> args, List<BodyDecl> bds) {
this(mods, name, args, new Opt<Expr>(new EnumInstanceExpr(createOptAnonymousDecl(bds))));
}
/**
* @ast method
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:236
*/
private static Opt<TypeDecl> createOptAnonymousDecl(List<BodyDecl> bds) {
if(bds.getNumChildNoTransform() == 0)
return new Opt<TypeDecl>();
return new Opt<TypeDecl>(
new AnonymousDecl(
new Modifiers(),
"Anonymous",
bds
)
);
}
/**
* @ast method
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:249
*/
public int getNumBodyDecl() {
int cnt = 0;
ClassInstanceExpr init = (ClassInstanceExpr)getInit();
if(!init.hasTypeDecl())
return 0;
for(BodyDecl bd : init.getTypeDecl().getBodyDecls())
if(!(bd instanceof ConstructorDecl))
++cnt;
return cnt;
}
/**
* @ast method
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:260
*/
public BodyDecl getBodyDecl(int i) {
ClassInstanceExpr init = (ClassInstanceExpr)getInit();
if(init.hasTypeDecl())
for(BodyDecl bd : init.getTypeDecl().getBodyDecls())
if(!(bd instanceof ConstructorDecl))
if(i-- == 0)
return bd;
throw new ArrayIndexOutOfBoundsException(i);
}
/**
* @ast method
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:592
*/
public void toString(StringBuffer s) {
s.append(indent());
getModifiers().toString(s);
s.append(getID());
s.append("(");
if(getNumArg() > 0) {
getArg(0).toString(s);
for(int i = 1; i < getNumArg(); i++) {
s.append(", ");
getArg(i).toString(s);
}
}
s.append(")");
if(getNumBodyDecl() > 0) {
s.append(" {");
for(int i=0; i < getNumBodyDecl(); i++) {
BodyDecl d = getBodyDecl(i);
d.toString(s);
}
s.append(indent() + "}");
}
s.append(",\n");
}
/**
* @ast method
*
*/
public EnumConstant() {
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 Opt(), 2);
}
/**
* @ast method
*
*/
public EnumConstant(Modifiers p0, String p1, List<Expr> p2, Opt<Expr> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @ast method
*
*/
public EnumConstant(Modifiers p0, beaver.Symbol p1, List<Expr> p2, Opt<Expr> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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 Arg list.
* @param list The new list node to be used as the Arg list.
* @apilevel high-level
* @ast method
*
*/
public void setArgList(List<Expr> list) {
setChild(list, 1);
}
/**
* Retrieves the number of children in the Arg list.
* @return Number of children in the Arg list.
* @apilevel high-level
* @ast method
*
*/
public int getNumArg() {
return getArgList().getNumChild();
}
/**
* Retrieves the number of children in the Arg list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Arg list.
* @apilevel low-level
* @ast method
*
*/
public int getNumArgNoTransform() {
return getArgListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Arg list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Arg list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Expr getArg(int i) {
return (Expr)getArgList().getChild(i);
}
/**
* Append an element to the Arg list.
* @param node The element to append to the Arg list.
* @apilevel high-level
* @ast method
*
*/
public void addArg(Expr node) {
List<Expr> list = (parent == null || state == null) ? getArgListNoTransform() : getArgList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addArgNoTransform(Expr node) {
List<Expr> list = getArgListNoTransform();
list.addChild(node);
}
/**
* Replaces the Arg 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 setArg(Expr node, int i) {
List<Expr> list = getArgList();
list.setChild(node, i);
}
/**
* Retrieves the Arg list.
* @return The node representing the Arg list.
* @apilevel high-level
* @ast method
*
*/
public List<Expr> getArgs() {
return getArgList();
}
/**
* Retrieves the Arg list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Arg list.
* @apilevel low-level
* @ast method
*
*/
public List<Expr> getArgsNoTransform() {
return getArgListNoTransform();
}
/**
* Retrieves the Arg list.
* @return The node representing the Arg list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Expr> getArgList() {
List<Expr> list = (List<Expr>)getChild(1);
list.getNumChild();
return list;
}
/**
* Retrieves the Arg list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Arg list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Expr> getArgListNoTransform() {
return (List<Expr>)getChildNoTransform(1);
}
/**
* Replaces the optional node for the Init child. This is the {@code Opt} node containing the child Init, not the actual child!
* @param opt The new node to be used as the optional node for the Init child.
* @apilevel low-level
* @ast method
*
*/
public void setInitOpt(Opt<Expr> opt) {
setChild(opt, 2);
}
/**
* Check whether the optional Init child exists.
* @return {@code true} if the optional Init child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasInit() {
return getInitOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) Init child.
* @return The Init child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Expr getInit() {
return (Expr)getInitOpt().getChild(0);
}
/**
* Replaces the (optional) Init child.
* @param node The new node to be used as the Init child.
* @apilevel high-level
* @ast method
*
*/
public void setInit(Expr node) {
getInitOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Expr> getInitOpt() {
return (Opt<Expr>)getChild(2);
}
/**
* Retrieves the optional node for child Init. This is the {@code Opt} node containing the child Init, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child Init.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Expr> getInitOptNoTransform() {
return (Opt<Expr>)getChildNoTransform(2);
}
/**
* Replaces the TypeAccess child.
* @param node The new node to replace the TypeAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setTypeAccess(Access node) {
setChild(node, 3);
}
/**
* Retrieves the TypeAccess child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the TypeAccess child.
* @apilevel low-level
* @ast method
*
*/
public Access getTypeAccessNoTransform() {
return (Access)getChildNoTransform(3);
}
/**
* Retrieves the child position of the optional child TypeAccess.
* @return The the child position of the optional child TypeAccess.
* @apilevel low-level
* @ast method
*
*/
protected int getTypeAccessChildPosition() {
return 3;
}
/**
* @attribute syn
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:26
*/
public boolean isEnumConstant() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:239
*/
public boolean isPublic() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:242
*/
public boolean isStatic() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:244
*/
public boolean isFinal() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean getTypeAccess_computed = false;
/**
* @apilevel internal
*/
protected Access getTypeAccess_value;
/**
* @attribute syn nta
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:193
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getTypeAccess() {
if(getTypeAccess_computed) {
return (Access) getChild(getTypeAccessChildPosition());
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
getTypeAccess_value = getTypeAccess_compute();
setTypeAccess(getTypeAccess_value);
if(isFinal && num == state().boundariesCrossed) getTypeAccess_computed = true;
return (Access) getChild(getTypeAccessChildPosition());
}
/**
* @apilevel internal
*/
private Access getTypeAccess_compute() {
return hostType().createQualifiedAccess();
}
/**
* @attribute syn
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:689
*/
public SimpleSet localMethodsSignature(String signature) {
ASTNode$State state = state();
try {
SimpleSet set = (SimpleSet)localMethodsSignatureMap().get(signature);
if(set != null) return set;
return SimpleSet.emptySet;
}
finally {
}
}
/**
* @apilevel internal
*/
protected boolean localMethodsSignatureMap_computed = false;
/**
* @apilevel internal
*/
protected HashMap localMethodsSignatureMap_value;
/**
* @attribute syn
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:696
*/
@SuppressWarnings({"unchecked", "cast"})
public HashMap localMethodsSignatureMap() {
if(localMethodsSignatureMap_computed) {
return localMethodsSignatureMap_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
localMethodsSignatureMap_value = localMethodsSignatureMap_compute();
if(isFinal && num == state().boundariesCrossed) localMethodsSignatureMap_computed = true;
return localMethodsSignatureMap_value;
}
/**
* @apilevel internal
*/
private HashMap localMethodsSignatureMap_compute() {
HashMap map = new HashMap(getNumBodyDecl());
for(int i = 0; i < getNumBodyDecl(); i++) {
if(getBodyDecl(i) instanceof MethodDecl) {
MethodDecl decl = (MethodDecl)getBodyDecl(i);
map.put(decl.signature(), decl);
}
}
return map;
}
/**
* @attribute syn
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:707
*/
public boolean implementsMethod(MethodDecl method) {
ASTNode$State state = state();
try {
SimpleSet set = (SimpleSet)localMethodsSignature(method.signature());
if (set.size() == 1) {
MethodDecl n = (MethodDecl)set.iterator().next();
if (!n.isAbstract())
return true;
}
return false;
}
finally {
}
}
/**
* @attribute syn
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:127
*/
public int sootTypeModifiers() {
ASTNode$State state = state();
try { return super.sootTypeModifiers() | Modifiers.ACC_ENUM; }
finally {
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:489
* @apilevel internal
*/
public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {
if(caller == getTypeAccessNoTransform()) {
return NameType.TYPE_NAME;
}
else { return super.Define_NameType_nameType(caller, child);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 18,884
| 26.290462
| 314
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/EnumDecl.java
|
/* 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 EnumDecl : {@link ClassDecl} ::= <span class="component">{@link Modifiers}</span> <span class="component"><ID:String></span> <span class="component">[SuperClassAccess:{@link Access}]</span> <span class="component">Implements:{@link Access}*</span> <span class="component">{@link BodyDecl}*</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.ast:1
*/
public class EnumDecl extends ClassDecl implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
isStatic_computed = false;
getSuperClassAccessOpt_computed = false;
getSuperClassAccessOpt_value = null;
enumConstants_computed = false;
enumConstants_value = null;
unimplementedMethods_computed = false;
unimplementedMethods_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public EnumDecl clone() throws CloneNotSupportedException {
EnumDecl node = (EnumDecl)super.clone();
node.isStatic_computed = false;
node.getSuperClassAccessOpt_computed = false;
node.getSuperClassAccessOpt_value = null;
node.enumConstants_computed = false;
node.enumConstants_value = null;
node.unimplementedMethods_computed = false;
node.unimplementedMethods_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public EnumDecl copy() {
try {
EnumDecl node = (EnumDecl) 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 EnumDecl fullCopy() {
EnumDecl tree = (EnumDecl) copy();
if (children != null) {
for (int i = 0; i < children.length; ++i) {
switch (i) {
case 4:
tree.children[i] = new Opt();
continue;
}
ASTNode child = (ASTNode) children[i];
if(child != null) {
child = child.fullCopy();
tree.setChild(child, i);
}
}
}
return tree;
}
/**
* @ast method
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:46
*/
public void typeCheck() {
super.typeCheck();
for(Iterator iter = memberMethods("finalize").iterator(); iter.hasNext(); ) {
MethodDecl m = (MethodDecl)iter.next();
if(m.getNumParameter() == 0 && m.hostType() == this)
error("an enum may not declare a finalizer");
}
checkEnum(this);
}
/**
* @ast method
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:81
*/
private boolean done = false;
/**
* @ast method
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:82
*/
private boolean done() {
if(done) return true;
done = true;
return false;
}
/**
* @ast method
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:309
*/
private void addValues() {
int numConstants = enumConstants().size();
List initValues = new List();
for(Iterator iter = enumConstants().iterator(); iter.hasNext(); ) {
EnumConstant c = (EnumConstant)iter.next();
initValues.add(c.createBoundFieldAccess());
}
FieldDeclaration values = new FieldDeclaration(
new Modifiers(new List().add(
new Modifier("private")).add(
new Modifier("static")).add(
new Modifier("final")).add(
new Modifier("synthetic"))
),
arrayType().createQualifiedAccess(),
"$VALUES",
new Opt(
new ArrayCreationExpr(
new ArrayTypeWithSizeAccess(
createQualifiedAccess(),
Literal.buildIntegerLiteral(enumConstants().size())
),
new Opt(
new ArrayInit(
initValues
)
)
)
)
);
addBodyDecl(values);
// public static final Test[] values() { return (Test[])$VALUES.clone(); }
addBodyDecl(
new MethodDecl(
new Modifiers(new List().add(
new Modifier("public")).add(
new Modifier("static")).add(
new Modifier("final")).add(
new Modifier("synthetic"))
),
arrayType().createQualifiedAccess(),
"values",
new List(),
new List(),
new Opt(
new Block(
new List().add(
new ReturnStmt(
new Opt(
new CastExpr(
arrayType().createQualifiedAccess(),
values.createBoundFieldAccess().qualifiesAccess(
new MethodAccess(
"clone",
new List()
)
)
)
)
)
)
)
)
)
);
// public static Test valueOf(String s) { return (Test)java.lang.Enum.valueOf(Test.class, s); }
addBodyDecl(
new MethodDecl(
new Modifiers(new List().add(
new Modifier("public")).add(
new Modifier("static")).add(
new Modifier("synthetic"))
),
createQualifiedAccess(),
"valueOf",
new List().add(
new ParameterDeclaration(
new Modifiers(new List()),
typeString().createQualifiedAccess(),
"s"
)
),
new List(),
new Opt(
new Block(
new List().add(
new ReturnStmt(
new Opt(
new CastExpr(
createQualifiedAccess(),
lookupType("java.lang", "Enum").createQualifiedAccess().qualifiesAccess(
new MethodAccess(
"valueOf",
new List().add(
createQualifiedAccess().qualifiesAccess(new ClassAccess())
).add(
new VarAccess(
"s"
)
)
)
)
)
)
)
)
)
)
)
);
}
/**
* @ast method
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:448
*/
protected void checkEnum(EnumDecl enumDecl) {
for(int i = 0; i < getNumBodyDecl(); i++) {
if(getBodyDecl(i) instanceof ConstructorDecl)
getBodyDecl(i).checkEnum(enumDecl);
else if(getBodyDecl(i) instanceof InstanceInitializer)
getBodyDecl(i).checkEnum(enumDecl);
else if(getBodyDecl(i) instanceof FieldDeclaration) {
FieldDeclaration f = (FieldDeclaration)getBodyDecl(i);
if(!f.isStatic() && f.hasInit())
f.checkEnum(enumDecl);
}
}
}
/**
* @ast method
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:527
*/
public void toString(StringBuffer s) {
getModifiers().toString(s);
s.append("enum " + name());
if(getNumImplements() > 0) {
s.append(" implements ");
getImplements(0).toString(s);
for(int i = 1; i < getNumImplements(); i++) {
s.append(", ");
getImplements(i).toString(s);
}
}
s.append(" {");
for(int i=0; i < getNumBodyDecl(); i++) {
BodyDecl d = getBodyDecl(i);
if(d instanceof EnumConstant) {
d.toString(s);
if(i + 1 < getNumBodyDecl() && !(getBodyDecl(i + 1) instanceof EnumConstant))
s.append(indent() + ";");
}
else if(d instanceof ConstructorDecl) {
ConstructorDecl c = (ConstructorDecl)d;
if(!c.isSynthetic()) {
s.append(indent());
c.getModifiers().toString(s);
s.append(c.name() + "(");
if(c.getNumParameter() > 2) {
c.getParameter(2).toString(s);
for(int j = 3; j < c.getNumParameter(); j++) {
s.append(", ");
c.getParameter(j).toString(s);
}
}
s.append(")");
if(c.getNumException() > 0) {
s.append(" throws ");
c.getException(0).toString(s);
for(int j = 1; j < c.getNumException(); j++) {
s.append(", ");
c.getException(j).toString(s);
}
}
s.append(" {");
for(int j = 0; j < c.getBlock().getNumStmt(); j++) {
c.getBlock().getStmt(j).toString(s);
}
s.append(indent());
s.append("}");
}
}
else if(d instanceof MethodDecl) {
MethodDecl m = (MethodDecl)d;
if(!m.isSynthetic())
m.toString(s);
}
else if(d instanceof FieldDeclaration) {
FieldDeclaration f = (FieldDeclaration)d;
if(!f.isSynthetic())
f.toString(s);
}
else
d.toString(s);
}
s.append(indent() + "}");
}
/**
* Check that the enum does not contain unimplemented abstract methods.
* @ast method
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:675
*/
public void checkModifiers() {
super.checkModifiers();
if (!unimplementedMethods().isEmpty()) {
StringBuffer s = new StringBuffer();
s.append("" + name() + " lacks implementations in one or more " +
"enum constants for the following methods:\n");
for (Iterator iter = unimplementedMethods().iterator(); iter.hasNext(); ) {
MethodDecl m = (MethodDecl)iter.next();
s.append(" " + m.signature() + " in " + m.hostType().typeName() + "\n");
}
error(s.toString());
}
}
/**
* @ast method
*
*/
public EnumDecl() {
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 Opt(), 3);
}
/**
* @ast method
*
*/
public EnumDecl(Modifiers p0, String p1, List<Access> p2, List<BodyDecl> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @ast method
*
*/
public EnumDecl(Modifiers p0, beaver.Symbol p1, List<Access> p2, List<BodyDecl> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return true;
}
/**
* 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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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 Implements list.
* @param list The new list node to be used as the Implements list.
* @apilevel high-level
* @ast method
*
*/
public void setImplementsList(List<Access> list) {
setChild(list, 1);
}
/**
* Retrieves the number of children in the Implements list.
* @return Number of children in the Implements list.
* @apilevel high-level
* @ast method
*
*/
public int getNumImplements() {
return getImplementsList().getNumChild();
}
/**
* Retrieves the number of children in the Implements list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Implements list.
* @apilevel low-level
* @ast method
*
*/
public int getNumImplementsNoTransform() {
return getImplementsListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Implements list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Implements list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getImplements(int i) {
return (Access)getImplementsList().getChild(i);
}
/**
* Append an element to the Implements list.
* @param node The element to append to the Implements list.
* @apilevel high-level
* @ast method
*
*/
public void addImplements(Access node) {
List<Access> list = (parent == null || state == null) ? getImplementsListNoTransform() : getImplementsList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addImplementsNoTransform(Access node) {
List<Access> list = getImplementsListNoTransform();
list.addChild(node);
}
/**
* Replaces the Implements 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 setImplements(Access node, int i) {
List<Access> list = getImplementsList();
list.setChild(node, i);
}
/**
* Retrieves the Implements list.
* @return The node representing the Implements list.
* @apilevel high-level
* @ast method
*
*/
public List<Access> getImplementss() {
return getImplementsList();
}
/**
* Retrieves the Implements list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Implements list.
* @apilevel low-level
* @ast method
*
*/
public List<Access> getImplementssNoTransform() {
return getImplementsListNoTransform();
}
/**
* Retrieves the Implements list.
* @return The node representing the Implements list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getImplementsList() {
List<Access> list = (List<Access>)getChild(1);
list.getNumChild();
return list;
}
/**
* Retrieves the Implements list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Implements list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getImplementsListNoTransform() {
return (List<Access>)getChildNoTransform(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<BodyDecl> 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<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addBodyDeclNoTransform(BodyDecl node) {
List<BodyDecl> 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<BodyDecl> list = getBodyDeclList();
list.setChild(node, i);
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<BodyDecl> getBodyDecls() {
return getBodyDeclList();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclsNoTransform() {
return getBodyDeclListNoTransform();
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclList() {
List<BodyDecl> list = (List<BodyDecl>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclListNoTransform() {
return (List<BodyDecl>)getChildNoTransform(2);
}
/**
* Replaces the optional node for the SuperClassAccess child. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* @param opt The new node to be used as the optional node for the SuperClassAccess child.
* @apilevel low-level
* @ast method
*
*/
public void setSuperClassAccessOpt(Opt<Access> opt) {
setChild(opt, 3);
}
/**
* Check whether the optional SuperClassAccess child exists.
* @return {@code true} if the optional SuperClassAccess child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasSuperClassAccess() {
return getSuperClassAccessOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) SuperClassAccess child.
* @return The SuperClassAccess child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getSuperClassAccess() {
return (Access)getSuperClassAccessOpt().getChild(0);
}
/**
* Replaces the (optional) SuperClassAccess child.
* @param node The new node to be used as the SuperClassAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setSuperClassAccess(Access node) {
getSuperClassAccessOpt().setChild(node, 0);
}
/**
* Retrieves the optional node for child SuperClassAccess. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child SuperClassAccess.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOptNoTransform() {
return (Opt<Access>)getChildNoTransform(3);
}
/**
* Retrieves the child position of the optional child SuperClassAccess.
* @return The the child position of the optional child SuperClassAccess.
* @apilevel low-level
* @ast method
*
*/
protected int getSuperClassAccessOptChildPosition() {
return 3;
}
/* It is a compile-time error if the return type of a method declared in an
annotation type is any type other than one of the following: one of the
primitive types, String, Class and any invocation of Class, an enum type
(\ufffd8.9), an annotation type, or an array (\ufffd10) of one of the preceding types.* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:121
*/
public boolean isValidAnnotationMethodReturnType() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/*
1) It is a compile-time error to attempt to explicitly instantiate an enum type
(\ufffd\ufffd\ufffd15.9.1).
* @attribute syn
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:16
*/
public boolean isEnumDecl() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean isStatic_computed = false;
/**
* @apilevel internal
*/
protected boolean isStatic_value;
/*
9) Nested enum types are implicitly static. It is permissable to explicitly
declare a nested enum type to be static.
* @attribute syn
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:39
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isStatic() {
if(isStatic_computed) {
return isStatic_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
isStatic_value = isStatic_compute();
if(isFinal && num == state().boundariesCrossed) isStatic_computed = true;
return isStatic_value;
}
/**
* @apilevel internal
*/
private boolean isStatic_compute() { return isNestedType(); }
/**
* @apilevel internal
*/
protected boolean getSuperClassAccessOpt_computed = false;
/**
* @apilevel internal
*/
protected Opt getSuperClassAccessOpt_value;
/*
10) The direct superclass of an enum type named E is Enum<E>.
* @attribute syn nta
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:60
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt getSuperClassAccessOpt() {
if(getSuperClassAccessOpt_computed) {
return (Opt) getChild(getSuperClassAccessOptChildPosition());
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
getSuperClassAccessOpt_value = getSuperClassAccessOpt_compute();
setSuperClassAccessOpt(getSuperClassAccessOpt_value);
if(isFinal && num == state().boundariesCrossed) getSuperClassAccessOpt_computed = true;
return (Opt) getChild(getSuperClassAccessOptChildPosition());
}
/**
* @apilevel internal
*/
private Opt getSuperClassAccessOpt_compute() {
return new Opt(
new ParTypeAccess(
new TypeAccess(
"java.lang",
"Enum"
),
new List().add(createQualifiedAccess())
)
);
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:209
*/
public boolean isFinal() {
ASTNode$State state = state();
try {
for(Iterator iter = enumConstants().iterator(); iter.hasNext(); ) {
EnumConstant c = (EnumConstant)iter.next();
ClassInstanceExpr e = (ClassInstanceExpr)c.getInit();
if(e.hasTypeDecl())
return false;
}
return true;
}
finally {
}
}
/**
* @apilevel internal
*/
protected boolean enumConstants_computed = false;
/**
* @apilevel internal
*/
protected ArrayList enumConstants_value;
/**
* @attribute syn
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:294
*/
@SuppressWarnings({"unchecked", "cast"})
public ArrayList enumConstants() {
if(enumConstants_computed) {
return enumConstants_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
enumConstants_value = enumConstants_compute();
if(isFinal && num == state().boundariesCrossed) enumConstants_computed = true;
return enumConstants_value;
}
/**
* @apilevel internal
*/
private ArrayList enumConstants_compute() {
ArrayList list = new ArrayList();
for(int i = 0; i < getNumBodyDecl(); i++)
if(getBodyDecl(i).isEnumConstant())
list.add(getBodyDecl(i));
return list;
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:204
*/
public boolean isAbstract() {
ASTNode$State state = state();
try {
for (int i = 0; i < getNumBodyDecl(); i++) {
if (getBodyDecl(i) instanceof MethodDecl) {
MethodDecl m = (MethodDecl)getBodyDecl(i);
if (m.isAbstract())
return true;
}
}
return false;
}
finally {
}
}
/**
* @apilevel internal
*/
protected boolean unimplementedMethods_computed = false;
/**
* @apilevel internal
*/
protected Collection unimplementedMethods_value;
/**
* From the Java Language Specification, third edition, section 8.9 Enums:
*
* It is a compile-time error for an enum type E to have an abstract method
* m as a member unless E has one or more enum constants, and all of E's enum
* constants have class bodies that provide concrete implementations of m.
* @attribute syn
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:623
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection unimplementedMethods() {
if(unimplementedMethods_computed) {
return unimplementedMethods_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
unimplementedMethods_value = unimplementedMethods_compute();
if(isFinal && num == state().boundariesCrossed) unimplementedMethods_computed = true;
return unimplementedMethods_value;
}
/**
* @apilevel internal
*/
private Collection unimplementedMethods_compute() {
Collection<MethodDecl> methods = new LinkedList<MethodDecl>();
for (Iterator iter = interfacesMethodsIterator(); iter.hasNext(); ) {
MethodDecl method = (MethodDecl)iter.next();
SimpleSet set = (SimpleSet)localMethodsSignature(method.signature());
if (set.size() == 1) {
MethodDecl n = (MethodDecl)set.iterator().next();
if (!n.isAbstract())
continue;
}
boolean implemented = false;
set = (SimpleSet)ancestorMethods(method.signature());
for (Iterator i2 = set.iterator(); i2.hasNext(); ) {
MethodDecl n = (MethodDecl)i2.next();
if (!n.isAbstract()) {
implemented = true;
break;
}
}
if (!implemented)
methods.add(method);
}
for (Iterator iter = localMethodsIterator(); iter.hasNext(); ) {
MethodDecl method = (MethodDecl)iter.next();
if (method.isAbstract())
methods.add(method);
}
Collection unimplemented = new ArrayList();
for (MethodDecl method : methods) {
if (enumConstants().isEmpty()) {
unimplemented.add(method);
continue;
}
boolean missing = false;
for (Iterator iter = enumConstants().iterator(); iter.hasNext(); ) {
if (!((EnumConstant) iter.next()).implementsMethod(method)) {
missing = true;
break;
}
}
if (missing)
unimplemented.add(method);
}
return unimplemented;
}
/**
* @attribute syn
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:90
*/
public int sootTypeModifiers() {
ASTNode$State state = state();
try { return super.sootTypeModifiers() | Modifiers.ACC_ENUM; }
finally {
}
}
/**
* @attribute inh
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:421
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl typeString() {
ASTNode$State state = state();
TypeDecl typeString_value = getParent().Define_TypeDecl_typeString(this, null);
return typeString_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:33
* @apilevel internal
*/
public boolean Define_boolean_mayBeAbstract(ASTNode caller, ASTNode child) {
if(caller == getModifiersNoTransform()) {
return false;
}
else { return super.Define_boolean_mayBeAbstract(caller, child);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:40
* @apilevel internal
*/
public boolean Define_boolean_mayBeStatic(ASTNode caller, ASTNode child) {
if(caller == getModifiersNoTransform()) {
return isNestedType();
}
else { return super.Define_boolean_mayBeStatic(caller, child);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:292
* @apilevel internal
*/
public boolean Define_boolean_mayBeFinal(ASTNode caller, ASTNode child) {
if(caller == getModifiersNoTransform()) {
return false;
}
else { return super.Define_boolean_mayBeFinal(caller, child);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
// Declared in /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag at line 88
if(!done()) {
state().duringEnums++;
ASTNode result = rewriteRule0();
state().duringEnums--;
return result;
}
return super.rewriteTo();
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:88
* @apilevel internal
*/ private EnumDecl rewriteRule0() {
{
if(noConstructor()) {
List parameterList = new List();
parameterList.add(
new ParameterDeclaration(new TypeAccess("java.lang", "String"), "p0")
);
parameterList.add(
new ParameterDeclaration(new TypeAccess("int"), "p1")
);
addBodyDecl(
new ConstructorDecl(
new Modifiers(new List().add(
new Modifier("private")).add(
new Modifier("synthetic"))
),
name(),
parameterList,
new List(),
new Opt(
new ExprStmt(
new SuperConstructorAccess(
"super",
new List().add(
new VarAccess("p0")
).add(
new VarAccess("p1")
)
)
)
),
new Block(new List())
)
);
}
else {
transformEnumConstructors();
}
addValues(); // Add the values() and getValue(String s) methods
return this;
} }
}
| 34,167
| 28.633998
| 318
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/EnumInstanceExpr.java
|
/* 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 EnumInstanceExpr : {@link ClassInstanceExpr} ::= <span class="component">{@link Access}</span> <span class="component">Arg:{@link Expr}*</span> <span class="component">[{@link TypeDecl}]</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.ast:5
*/
public class EnumInstanceExpr extends ClassInstanceExpr implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
getAccess_computed = false;
getAccess_value = null;
getArgList_computed = false;
getArgList_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public EnumInstanceExpr clone() throws CloneNotSupportedException {
EnumInstanceExpr node = (EnumInstanceExpr)super.clone();
node.getAccess_computed = false;
node.getAccess_value = null;
node.getArgList_computed = false;
node.getArgList_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public EnumInstanceExpr copy() {
try {
EnumInstanceExpr node = (EnumInstanceExpr) 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 EnumInstanceExpr fullCopy() {
EnumInstanceExpr tree = (EnumInstanceExpr) copy();
if (children != null) {
for (int i = 0; i < children.length; ++i) {
switch (i) {
case 1:
tree.children[i] = null;
continue;
case 2:
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
*
*/
public EnumInstanceExpr() {
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[3];
setChild(new Opt(), 0);
setChild(new List(), 2);
}
/**
* @ast method
*
*/
public EnumInstanceExpr(Opt<TypeDecl> p0) {
setChild(p0, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 1;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the optional node for the TypeDecl child. This is the {@code Opt} node containing the child TypeDecl, not the actual child!
* @param opt The new node to be used as the optional node for the TypeDecl child.
* @apilevel low-level
* @ast method
*
*/
public void setTypeDeclOpt(Opt<TypeDecl> opt) {
setChild(opt, 0);
}
/**
* Check whether the optional TypeDecl child exists.
* @return {@code true} if the optional TypeDecl child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasTypeDecl() {
return getTypeDeclOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) TypeDecl child.
* @return The TypeDecl child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl getTypeDecl() {
return (TypeDecl)getTypeDeclOpt().getChild(0);
}
/**
* Replaces the (optional) TypeDecl child.
* @param node The new node to be used as the TypeDecl child.
* @apilevel high-level
* @ast method
*
*/
public void setTypeDecl(TypeDecl node) {
getTypeDeclOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<TypeDecl> getTypeDeclOpt() {
return (Opt<TypeDecl>)getChild(0);
}
/**
* Retrieves the optional node for child TypeDecl. This is the {@code Opt} node containing the child TypeDecl, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child TypeDecl.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<TypeDecl> getTypeDeclOptNoTransform() {
return (Opt<TypeDecl>)getChildNoTransform(0);
}
/**
* 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, 1);
}
/**
* Retrieves the Access child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Access child.
* @apilevel low-level
* @ast method
*
*/
public Access getAccessNoTransform() {
return (Access)getChildNoTransform(1);
}
/**
* Retrieves the child position of the optional child Access.
* @return The the child position of the optional child Access.
* @apilevel low-level
* @ast method
*
*/
protected int getAccessChildPosition() {
return 1;
}
/**
* Replaces the Arg list.
* @param list The new list node to be used as the Arg list.
* @apilevel high-level
* @ast method
*
*/
public void setArgList(List<Expr> list) {
setChild(list, 2);
}
/**
* Retrieves the number of children in the Arg list.
* @return Number of children in the Arg list.
* @apilevel high-level
* @ast method
*
*/
public int getNumArg() {
return getArgList().getNumChild();
}
/**
* Retrieves the number of children in the Arg list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Arg list.
* @apilevel low-level
* @ast method
*
*/
public int getNumArgNoTransform() {
return getArgListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Arg list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Arg list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Expr getArg(int i) {
return (Expr)getArgList().getChild(i);
}
/**
* Append an element to the Arg list.
* @param node The element to append to the Arg list.
* @apilevel high-level
* @ast method
*
*/
public void addArg(Expr node) {
List<Expr> list = (parent == null || state == null) ? getArgListNoTransform() : getArgList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addArgNoTransform(Expr node) {
List<Expr> list = getArgListNoTransform();
list.addChild(node);
}
/**
* Replaces the Arg 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 setArg(Expr node, int i) {
List<Expr> list = getArgList();
list.setChild(node, i);
}
/**
* Retrieves the Arg list.
* @return The node representing the Arg list.
* @apilevel high-level
* @ast method
*
*/
public List<Expr> getArgs() {
return getArgList();
}
/**
* Retrieves the Arg list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Arg list.
* @apilevel low-level
* @ast method
*
*/
public List<Expr> getArgsNoTransform() {
return getArgListNoTransform();
}
/**
* Retrieves the Arg list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Arg list.
* @apilevel low-level
* @ast method
*
*/
public List<Expr> getArgListNoTransform() {
return (List<Expr>)getChildNoTransform(2);
}
/**
* Retrieves the child position of the Arg list.
* @return The the child position of the Arg list.
* @apilevel low-level
* @ast method
*
*/
protected int getArgListChildPosition() {
return 2;
}
/**
* @apilevel internal
*/
protected boolean getAccess_computed = false;
/**
* @apilevel internal
*/
protected Access getAccess_value;
/*
3) An enum constant may be followed by arguments, which are passed to the
constructor of the enum type when the constant is created during class
initialization as described later in this section. The constructor to be
invoked is chosen using the normal overloading rules (\ufffd\ufffd\ufffd15.12.2). If the
arguments are omitted, an empty argument list is assumed.
* @attribute syn nta
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:209
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getAccess() {
if(getAccess_computed) {
return (Access) getChild(getAccessChildPosition());
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
getAccess_value = getAccess_compute();
setAccess(getAccess_value);
if(isFinal && num == state().boundariesCrossed) getAccess_computed = true;
return (Access) getChild(getAccessChildPosition());
}
/**
* @apilevel internal
*/
private Access getAccess_compute() {
return hostType().createQualifiedAccess();
}
/**
* @apilevel internal
*/
protected boolean getArgList_computed = false;
/**
* @apilevel internal
*/
protected List<Expr> getArgList_value;
/**
* @attribute syn nta
* @aspect Enums
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Enums.jrag:213
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Expr> getArgList() {
if(getArgList_computed) {
return (List<Expr>) getChild(getArgListChildPosition());
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
getArgList_value = getArgList_compute();
setArgList(getArgList_value);
if(isFinal && num == state().boundariesCrossed) getArgList_computed = true;
return (List<Expr>) getChild(getArgListChildPosition());
}
/**
* @apilevel internal
*/
private List<Expr> getArgList_compute() {
EnumConstant ec = (EnumConstant)getParent().getParent();
List<EnumConstant> ecs = (List<EnumConstant>)ec.getParent();
int idx = ecs.getIndexOfChild(ec);
if(idx == -1)
throw new Error("internal: cannot determine numeric value of enum constant");
List<Expr> argList = new List<Expr>();
argList.add(Literal.buildStringLiteral(ec.name()));
argList.add(Literal.buildIntegerLiteral(idx));
for(Expr arg : ec.getArgs())
argList.add((Expr)arg.fullCopy());
return argList;
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 12,244
| 26.70362
| 209
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/EqualityExpr.java
|
/* 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 EqualityExpr : {@link RelationalExpr};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:181
*/
public abstract class EqualityExpr extends RelationalExpr implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public EqualityExpr clone() throws CloneNotSupportedException {
EqualityExpr node = (EqualityExpr)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @ast method
* @aspect TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:220
*/
public void typeCheck() {
TypeDecl left = getLeftOperand().type();
TypeDecl right = getRightOperand().type();
if(left.isNumericType() && right.isNumericType())
return;
else if(left.isBoolean() && right.isBoolean())
return;
else if((left.isReferenceType() || left.isNull()) && (right.isReferenceType() || right.isNull())) {
if(left.castingConversionTo(right) || right.castingConversionTo(left))
return;
}
error(left.typeName() + " can not be compared to " + right.typeName());
}
/**
* @ast method
*
*/
public EqualityExpr() {
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 EqualityExpr(Expr 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 LeftOperand child.
* @param node The new node to replace the LeftOperand child.
* @apilevel high-level
* @ast method
*
*/
public void setLeftOperand(Expr node) {
setChild(node, 0);
}
/**
* Retrieves the LeftOperand child.
* @return The current node used as the LeftOperand child.
* @apilevel high-level
* @ast method
*
*/
public Expr getLeftOperand() {
return (Expr)getChild(0);
}
/**
* Retrieves the LeftOperand child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the LeftOperand child.
* @apilevel low-level
* @ast method
*
*/
public Expr getLeftOperandNoTransform() {
return (Expr)getChildNoTransform(0);
}
/**
* Replaces the RightOperand child.
* @param node The new node to replace the RightOperand child.
* @apilevel high-level
* @ast method
*
*/
public void setRightOperand(Expr node) {
setChild(node, 1);
}
/**
* Retrieves the RightOperand child.
* @return The current node used as the RightOperand child.
* @apilevel high-level
* @ast method
*
*/
public Expr getRightOperand() {
return (Expr)getChild(1);
}
/**
* Retrieves the RightOperand child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the RightOperand child.
* @apilevel low-level
* @ast method
*
*/
public Expr getRightOperandNoTransform() {
return (Expr)getChildNoTransform(1);
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 4,334
| 23.083333
| 104
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ExprStmt.java
|
/* 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 ExprStmt : {@link Stmt} ::= <span class="component">{@link Expr}</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:200
*/
public class ExprStmt extends Stmt implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
isDAafter_Variable_values = null;
isDUafter_Variable_values = null;
canCompleteNormally_computed = false;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ExprStmt clone() throws CloneNotSupportedException {
ExprStmt node = (ExprStmt)super.clone();
node.isDAafter_Variable_values = null;
node.isDUafter_Variable_values = null;
node.canCompleteNormally_computed = false;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ExprStmt copy() {
try {
ExprStmt node = (ExprStmt) 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 ExprStmt fullCopy() {
ExprStmt tree = (ExprStmt) 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:548
*/
public void toString(StringBuffer s) {
s.append(indent());
getExpr().toString(s);
s.append(";");
}
/**
* @ast method
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:32
*/
public void jimplify2(Body b) {
b.setLine(this);
soot.Value value = getExpr().eval(b);
if(value instanceof soot.jimple.InvokeExpr) {
b.add(b.newInvokeStmt((soot.jimple.InvokeExpr)value, this));
}
}
/**
* @ast method
*
*/
public ExprStmt() {
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[1];
}
/**
* @ast method
*
*/
public ExprStmt(Expr p0) {
setChild(p0, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 1;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* 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, 0);
}
/**
* Retrieves the Expr child.
* @return The current node used as the Expr child.
* @apilevel high-level
* @ast method
*
*/
public Expr getExpr() {
return (Expr)getChild(0);
}
/**
* Retrieves the Expr child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Expr child.
* @apilevel low-level
* @ast method
*
*/
public Expr getExprNoTransform() {
return (Expr)getChildNoTransform(0);
}
protected java.util.Map isDAafter_Variable_values;
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:522
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDAafter(Variable v) {
Object _parameters = v;
if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4);
if(isDAafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDAafter_Variable_value = isDAafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value));
return isDAafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDAafter_compute(Variable v) { return getExpr().isDAafter(v); }
protected java.util.Map isDUafter_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:991
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDUafter(Variable v) {
Object _parameters = v;
if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4);
if(isDUafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDUafter_Variable_value = isDUafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value));
return isDUafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDUafter_compute(Variable v) { return getExpr().isDUafter(v); }
/**
* @apilevel internal
*/
protected boolean canCompleteNormally_computed = false;
/**
* @apilevel internal
*/
protected boolean canCompleteNormally_value;
/**
* @attribute syn
* @aspect UnreachableStatements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:58
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean canCompleteNormally() {
if(canCompleteNormally_computed) {
return canCompleteNormally_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
canCompleteNormally_value = canCompleteNormally_compute();
if(isFinal && num == state().boundariesCrossed) canCompleteNormally_computed = true;
return canCompleteNormally_value;
}
/**
* @apilevel internal
*/
private boolean canCompleteNormally_compute() { return reachable(); }
/**
* @attribute syn
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:55
*/
public boolean modifiedInScope(Variable var) {
ASTNode$State state = state();
try { return getExpr().modifiedInScope(var); }
finally {
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:523
* @apilevel internal
*/
public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) {
if(caller == getExprNoTransform()) {
return isDAbefore(v);
}
else { return getParent().Define_boolean_isDAbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:992
* @apilevel internal
*/
public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) {
if(caller == getExprNoTransform()) {
return isDUbefore(v);
}
else { return getParent().Define_boolean_isDUbefore(this, caller, v);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 8,842
| 28.088816
| 140
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/FieldDecl.java
|
/* 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 FieldDecl : {@link MemberDecl} ::= <span class="component">{@link Modifiers}</span> <span class="component">TypeAccess:{@link Access}</span> <span class="component">{@link VariableDecl}*</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:79
*/
public class FieldDecl extends MemberDecl implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public FieldDecl clone() throws CloneNotSupportedException {
FieldDecl node = (FieldDecl)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public FieldDecl copy() {
try {
FieldDecl node = (FieldDecl) 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 FieldDecl fullCopy() {
FieldDecl tree = (FieldDecl) 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
*
*/
public FieldDecl() {
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[3];
setChild(new List(), 2);
}
/**
* @ast method
*
*/
public FieldDecl(Modifiers p0, Access p1, List<VariableDecl> p2) {
setChild(p0, 0);
setChild(p1, 1);
setChild(p2, 2);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return true;
}
/**
* 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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Modifiers child.
* @apilevel low-level
* @ast method
*
*/
public Modifiers getModifiersNoTransform() {
return (Modifiers)getChildNoTransform(0);
}
/**
* Replaces the TypeAccess child.
* @param node The new node to replace the TypeAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setTypeAccess(Access node) {
setChild(node, 1);
}
/**
* Retrieves the TypeAccess child.
* @return The current node used as the TypeAccess child.
* @apilevel high-level
* @ast method
*
*/
public Access getTypeAccess() {
return (Access)getChild(1);
}
/**
* Retrieves the TypeAccess child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the TypeAccess child.
* @apilevel low-level
* @ast method
*
*/
public Access getTypeAccessNoTransform() {
return (Access)getChildNoTransform(1);
}
/**
* Replaces the VariableDecl list.
* @param list The new list node to be used as the VariableDecl list.
* @apilevel high-level
* @ast method
*
*/
public void setVariableDeclList(List<VariableDecl> list) {
setChild(list, 2);
}
/**
* Retrieves the number of children in the VariableDecl list.
* @return Number of children in the VariableDecl list.
* @apilevel high-level
* @ast method
*
*/
public int getNumVariableDecl() {
return getVariableDeclList().getNumChild();
}
/**
* Retrieves the number of children in the VariableDecl list.
* Calling this method will not trigger rewrites..
* @return Number of children in the VariableDecl list.
* @apilevel low-level
* @ast method
*
*/
public int getNumVariableDeclNoTransform() {
return getVariableDeclListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the VariableDecl list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the VariableDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public VariableDecl getVariableDecl(int i) {
return (VariableDecl)getVariableDeclList().getChild(i);
}
/**
* Append an element to the VariableDecl list.
* @param node The element to append to the VariableDecl list.
* @apilevel high-level
* @ast method
*
*/
public void addVariableDecl(VariableDecl node) {
List<VariableDecl> list = (parent == null || state == null) ? getVariableDeclListNoTransform() : getVariableDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addVariableDeclNoTransform(VariableDecl node) {
List<VariableDecl> list = getVariableDeclListNoTransform();
list.addChild(node);
}
/**
* Replaces the VariableDecl 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 setVariableDecl(VariableDecl node, int i) {
List<VariableDecl> list = getVariableDeclList();
list.setChild(node, i);
}
/**
* Retrieves the VariableDecl list.
* @return The node representing the VariableDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<VariableDecl> getVariableDecls() {
return getVariableDeclList();
}
/**
* Retrieves the VariableDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the VariableDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<VariableDecl> getVariableDeclsNoTransform() {
return getVariableDeclListNoTransform();
}
/**
* Retrieves the VariableDecl list.
* @return The node representing the VariableDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<VariableDecl> getVariableDeclList() {
List<VariableDecl> list = (List<VariableDecl>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the VariableDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the VariableDecl list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<VariableDecl> getVariableDeclListNoTransform() {
return (List<VariableDecl>)getChildNoTransform(2);
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:243
*/
public boolean isStatic() {
ASTNode$State state = state();
try { return getModifiers().isStatic(); }
finally {
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:77
* @apilevel internal
*/
public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {
if(caller == getTypeAccessNoTransform()) {
return NameType.TYPE_NAME;
}
else { return getParent().Define_NameType_nameType(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:257
* @apilevel internal
*/
public TypeDecl Define_TypeDecl_declType(ASTNode caller, ASTNode child) {
if(caller == getVariableDeclListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return null;
}
else { return getParent().Define_TypeDecl_declType(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
// Declared in /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag at line 101
if(getNumVariableDecl() == 1) {
state().duringVariableDeclarationTransformation++;
ASTNode result = rewriteRule0();
state().duringVariableDeclarationTransformation--;
return result;
}
// Declared in /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag at line 112
if(getParent().getParent() instanceof TypeDecl &&
((TypeDecl)getParent().getParent()).getBodyDeclListNoTransform() == getParent() && getNumVariableDecl() > 1) {
state().duringVariableDeclarationTransformation++;
List list = (List)getParent();
int i = list.getIndexOfChild(this);
List newList = rewriteTypeDecl_getBodyDecl();
for(int j = 1; j < newList.getNumChildNoTransform(); j++)
list.insertChild(newList.getChildNoTransform(j), ++i);
state().duringVariableDeclarationTransformation--;
return newList.getChildNoTransform(0);
}
return super.rewriteTo();
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:101
* @apilevel internal
*/ private FieldDeclaration rewriteRule0() {
{
FieldDeclaration decl = getVariableDecl(0).createFieldDeclarationFrom(getModifiers(), getTypeAccess());
decl.setStart(start); // copy location information
decl.setEnd(end); // copy location information
return decl;
} }
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:112
* @apilevel internal
*/ private List rewriteTypeDecl_getBodyDecl() {
{
List varList = new List();
for(int j = 0; j < getNumVariableDecl(); j++) {
FieldDeclaration f =
getVariableDecl(j).createFieldDeclarationFrom(
(Modifiers)getModifiers().fullCopy(),
(Access)getTypeAccess().fullCopy()
);
if(j == 0)
f.setStart(start);
else {
f.getModifiersNoTransform().clearLocations();
f.getTypeAccessNoTransform().clearLocations();
}
f.setFieldDecl(this);
varList.add(f);
}
return varList;
} }
}
| 11,898
| 28.164216
| 209
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/FieldDeclaration.java
|
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */
package soot.JastAddJ;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import soot.Scene;
import soot.SootField;
import soot.SootFieldRef;
/**
* @production FieldDeclaration : {@link MemberDecl} ::=
* <span class="component">{@link Modifiers}</span>
* <span class="component">TypeAccess:{@link Access}</span>
* <span class="component"><ID:String></span>
* <span class="component">[Init:{@link Expr}]</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:80
*/
public class FieldDeclaration extends MemberDecl implements Cloneable, SimpleSet, Iterator, Variable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
accessibleFrom_TypeDecl_values = null;
exceptions_computed = false;
exceptions_value = null;
isDAafter_Variable_values = null;
isDUafter_Variable_values = null;
constant_computed = false;
constant_value = null;
usesTypeVariable_computed = false;
sourceVariableDecl_computed = false;
sourceVariableDecl_value = null;
sootRef_computed = false;
sootRef_value = null;
throwTypes_computed = false;
throwTypes_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({ "unchecked", "cast" })
public FieldDeclaration clone() throws CloneNotSupportedException {
FieldDeclaration node = (FieldDeclaration) super.clone();
node.accessibleFrom_TypeDecl_values = null;
node.exceptions_computed = false;
node.exceptions_value = null;
node.isDAafter_Variable_values = null;
node.isDUafter_Variable_values = null;
node.constant_computed = false;
node.constant_value = null;
node.usesTypeVariable_computed = false;
node.sourceVariableDecl_computed = false;
node.sourceVariableDecl_value = null;
node.sootRef_computed = false;
node.sootRef_value = null;
node.throwTypes_computed = false;
node.throwTypes_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({ "unchecked", "cast" })
public FieldDeclaration copy() {
try {
FieldDeclaration node = (FieldDeclaration) 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 FieldDeclaration fullCopy() {
FieldDeclaration tree = (FieldDeclaration) 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 BoundNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BoundNames.jrag:11
*/
public Access createQualifiedBoundAccess() {
if (isStatic())
return hostType().createQualifiedAccess().qualifiesAccess(new BoundFieldAccess(this));
else
return new ThisAccess("this").qualifiesAccess(new BoundFieldAccess(this));
}
/**
* @ast method
* @aspect BoundNames
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BoundNames.jrag:86
*/
public Access createBoundFieldAccess() {
return createQualifiedBoundAccess();
}
/**
* @ast method
* @aspect DataStructures
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DataStructures.jrag:81
*/
public SimpleSet add(Object o) {
return new SimpleSetImpl().add(this).add(o);
}
/**
* @ast method
* @aspect DataStructures
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DataStructures.jrag:85
*/
public boolean isSingleton() {
return true;
}
/**
* @ast method
* @aspect DataStructures
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DataStructures.jrag:86
*/
public boolean isSingleton(Object o) {
return contains(o);
}
/**
* @ast method
* @aspect DataStructures
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DataStructures.jrag:89
*/
private FieldDeclaration iterElem;
/**
* @ast method
* @aspect DataStructures
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DataStructures.jrag:90
*/
public Iterator iterator() {
iterElem = this;
return this;
}
/**
* @ast method
* @aspect DataStructures
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DataStructures.jrag:91
*/
public boolean hasNext() {
return iterElem != null;
}
/**
* @ast method
* @aspect DataStructures
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DataStructures.jrag:92
*/
public Object next() {
Object o = iterElem;
iterElem = null;
return o;
}
/**
* @ast method
* @aspect DataStructures
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DataStructures.jrag:93
*/
public void remove() {
throw new UnsupportedOperationException();
}
/**
* @ast method
* @aspect DefiniteAssignment
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:177
*/
public void definiteAssignment() {
super.definiteAssignment();
if (isBlank() && isFinal() && isClassVariable()) {
boolean found = false;
TypeDecl typeDecl = hostType();
for (int i = 0; i < typeDecl.getNumBodyDecl(); i++) {
if (typeDecl.getBodyDecl(i) instanceof StaticInitializer) {
StaticInitializer s = (StaticInitializer) typeDecl.getBodyDecl(i);
if (s.isDAafter(this))
found = true;
}
else if (typeDecl.getBodyDecl(i) instanceof FieldDeclaration) {
FieldDeclaration f = (FieldDeclaration) typeDecl.getBodyDecl(i);
if (f.isStatic() && f.isDAafter(this))
found = true;
}
}
if (!found)
error("blank final class variable " + name() + " in " + hostType().typeName()
+ " is not definitely assigned in static initializer");
}
if (isBlank() && isFinal() && isInstanceVariable()) {
TypeDecl typeDecl = hostType();
boolean found = false;
for (int i = 0; !found && i < typeDecl.getNumBodyDecl(); i++) {
if (typeDecl.getBodyDecl(i) instanceof FieldDeclaration) {
FieldDeclaration f = (FieldDeclaration) typeDecl.getBodyDecl(i);
if (!f.isStatic() && f.isDAafter(this))
found = true;
} else if (typeDecl.getBodyDecl(i) instanceof InstanceInitializer) {
InstanceInitializer ii = (InstanceInitializer) typeDecl.getBodyDecl(i);
if (ii.getBlock().isDAafter(this))
found = true;
}
}
for (Iterator iter = typeDecl.constructors().iterator(); !found && iter.hasNext();) {
ConstructorDecl c = (ConstructorDecl) iter.next();
if (!c.isDAafter(this)) {
error("blank final instance variable " + name() + " in " + hostType().typeName()
+ " is not definitely assigned after " + c.signature());
}
}
}
if (isBlank() && hostType().isInterfaceDecl()) {
error("variable " + name() + " in " + hostType().typeName()
+ " which is an interface must have an initializer");
}
}
/**
* @ast method
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:114
*/
public void checkModifiers() {
super.checkModifiers();
if (hostType().isInterfaceDecl()) {
if (isProtected())
error("an interface field may not be protected");
if (isPrivate())
error("an interface field may not be private");
if (isTransient())
error("an interface field may not be transient");
if (isVolatile())
error("an interface field may not be volatile");
}
}
/**
* @ast method
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:282
*/
public void nameCheck() {
super.nameCheck();
// 8.3
for (Iterator iter = hostType().memberFields(name()).iterator(); iter.hasNext();) {
Variable v = (Variable) iter.next();
if (v != this && v.hostType() == hostType())
error("field named " + name() + " is multiply declared in type " + hostType().typeName());
}
}
/**
* @ast method
* @aspect NodeConstructors
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NodeConstructors.jrag:86
*/
public FieldDeclaration(Modifiers m, Access type, String name) {
this(m, type, name, new Opt());
}
/**
* @ast method
* @aspect NodeConstructors
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NodeConstructors.jrag:90
*/
public FieldDeclaration(Modifiers m, Access type, String name, Expr init) {
this(m, type, name, new Opt(init));
}
/**
* @ast method
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:152
*/
public void toString(StringBuffer s) {
s.append(indent());
getModifiers().toString(s);
getTypeAccess().toString(s);
s.append(" " + name());
if (hasInit()) {
s.append(" = ");
getInit().toString(s);
}
s.append(";");
}
/**
* @ast method
* @aspect TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:33
*/
public void typeCheck() {
if (hasInit()) {
TypeDecl source = getInit().type();
TypeDecl dest = type();
if (!source.assignConversionTo(dest, getInit()))
error("can not assign field " + name() + " of type " + dest.typeName() + " a value of type "
+ source.typeName());
}
}
/**
* @ast method
* @aspect VariableDeclarationTransformation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:91
*/
// when splitting a FieldDecl into multiple FieldDeclarations, provide every
// FieldDeclaration with a reference
// to the original FieldDecl; if only a single FieldDeclaration results, no
// reference is stored
private FieldDecl fieldDecl = null;
/**
* @ast method
* @aspect VariableDeclarationTransformation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:92
*/
public FieldDecl getFieldDecl() {
return fieldDecl;
}
/**
* @ast method
* @aspect VariableDeclarationTransformation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:95
*/
public void setFieldDecl(FieldDecl fieldDecl) {
this.fieldDecl = fieldDecl;
}
/**
* @ast method
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1295
*/
public BodyDecl substitutedBodyDecl(Parameterization parTypeDecl) {
FieldDeclaration f = new FieldDeclarationSubstituted((Modifiers) getModifiers().fullCopy(),
getTypeAccess().type().substituteReturnType(parTypeDecl), getID(), new Opt(), this);
return f;
}
/**
* @ast method
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:290
*/
public MethodDecl createAccessor(TypeDecl fieldQualifier) {
MethodDecl m = (MethodDecl) fieldQualifier.getAccessor(this, "field_read");
if (m != null)
return m;
int accessorIndex = fieldQualifier.accessorCounter++;
Modifiers modifiers = new Modifiers(new List());
modifiers.addModifier(new Modifier("static"));
modifiers.addModifier(new Modifier("synthetic"));
modifiers.addModifier(new Modifier("public"));
List parameters = new List();
if (!isStatic())
parameters.add(new ParameterDeclaration(fieldQualifier.createQualifiedAccess(), "that"));
m = new MethodDecl(modifiers, type().createQualifiedAccess(), "get$" + name() + "$access$" + accessorIndex,
parameters, new List(), new Opt(new Block(new List().add(new ReturnStmt(createAccess())))));
m = fieldQualifier.addMemberMethod(m);
fieldQualifier.addAccessor(this, "field_read", m);
return m;
}
/**
* @ast method
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:323
*/
public MethodDecl createAccessorWrite(TypeDecl fieldQualifier) {
MethodDecl m = (MethodDecl) fieldQualifier.getAccessor(this, "field_write");
if (m != null)
return m;
int accessorIndex = fieldQualifier.accessorCounter++;
Modifiers modifiers = new Modifiers(new List());
modifiers.addModifier(new Modifier("static"));
modifiers.addModifier(new Modifier("synthetic"));
modifiers.addModifier(new Modifier("public"));
List parameters = new List();
if (!isStatic())
parameters.add(new ParameterDeclaration(fieldQualifier.createQualifiedAccess(), "that"));
parameters.add(new ParameterDeclaration(type().createQualifiedAccess(), "value"));
m = new MethodDecl(modifiers, type().createQualifiedAccess(), "set$" + name() + "$access$" + accessorIndex,
parameters, new List(),
new Opt(new Block(
new List().add(new ExprStmt(new AssignSimpleExpr(createAccess(), new VarAccess("value"))))
.add(new ReturnStmt(new Opt(new VarAccess("value")))))));
m = fieldQualifier.addMemberMethod(m);
fieldQualifier.addAccessor(this, "field_write", m);
return m;
}
/**
* @ast method
* @aspect InnerClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:368
*/
private Access createAccess() {
Access fieldAccess = new BoundFieldAccess(this);
return isStatic() ? fieldAccess : new VarAccess("that").qualifiesAccess(fieldAccess);
}
/**
* @ast method
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:329
*/
public void jimplify1phase2() {
String name = name();
soot.Type type = type().getSootType();
int modifiers = sootTypeModifiers();
if (!hostType().getSootClassDecl().declaresFieldByName(name)) {
SootField f = Scene.v().makeSootField(name, type, modifiers);
hostType().getSootClassDecl().addField(f);
if (isStatic() && isFinal() && isConstant() && (type().isPrimitive() || type().isString())) {
if (type().isString())
f.addTag(new soot.tagkit.StringConstantValueTag(constant().stringValue()));
else if (type().isLong())
f.addTag(new soot.tagkit.LongConstantValueTag(constant().longValue()));
else if (type().isDouble())
f.addTag(new soot.tagkit.DoubleConstantValueTag(constant().doubleValue()));
else if (type().isFloat())
f.addTag(new soot.tagkit.FloatConstantValueTag(constant().floatValue()));
else if (type().isIntegralType())
f.addTag(new soot.tagkit.IntegerConstantValueTag(constant().intValue()));
}
sootField = f;
} else {
sootField = hostType().getSootClassDecl().getFieldByName(name);
}
addAttributes();
}
/**
* @ast method
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:354
*/
public SootField sootField;
/**
* @ast method
* @aspect AnnotationsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AnnotationsCodegen.jrag:32
*/
public void addAttributes() {
super.addAttributes();
ArrayList c = new ArrayList();
getModifiers().addRuntimeVisibleAnnotationsAttribute(c);
getModifiers().addRuntimeInvisibleAnnotationsAttribute(c);
getModifiers().addSourceOnlyAnnotations(c);
for (Iterator iter = c.iterator(); iter.hasNext();) {
soot.tagkit.Tag tag = (soot.tagkit.Tag) iter.next();
sootField.addTag(tag);
}
}
/**
* @ast method
* @aspect UncheckedConversion
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/UncheckedConversion.jrag:25
*/
public void checkWarnings() {
if (hasInit() && !suppressWarnings("unchecked"))
checkUncheckedConversion(getInit().type(), type());
}
/**
* @ast method
*
*/
public FieldDeclaration() {
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[3];
setChild(new Opt(), 2);
}
/**
* @ast method
*
*/
public FieldDeclaration(Modifiers p0, Access p1, String p2, Opt<Expr> p3) {
setChild(p0, 0);
setChild(p1, 1);
setID(p2);
setChild(p3, 2);
}
/**
* @ast method
*
*/
public FieldDeclaration(Modifiers p0, Access p1, beaver.Symbol p2, Opt<Expr> p3) {
setChild(p0, 0);
setChild(p1, 1);
setID(p2);
setChild(p3, 2);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @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.
* <p>
* <em>This method does not invoke AST transformations.</em>
* </p>
*
* @return The current node used as the Modifiers child.
* @apilevel low-level
* @ast method
*
*/
public Modifiers getModifiersNoTransform() {
return (Modifiers) getChildNoTransform(0);
}
/**
* Replaces the TypeAccess child.
*
* @param node
* The new node to replace the TypeAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setTypeAccess(Access node) {
setChild(node, 1);
}
/**
* Retrieves the TypeAccess child.
*
* @return The current node used as the TypeAccess child.
* @apilevel high-level
* @ast method
*
*/
public Access getTypeAccess() {
return (Access) getChild(1);
}
/**
* Retrieves the TypeAccess child.
* <p>
* <em>This method does not invoke AST transformations.</em>
* </p>
*
* @return The current node used as the TypeAccess child.
* @apilevel low-level
* @ast method
*
*/
public Access getTypeAccessNoTransform() {
return (Access) getChildNoTransform(1);
}
/**
* 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;
}
/**
* @apilevel internal
* @ast method
*
*/
/**
* @apilevel internal
*/
protected String tokenString_ID;
/**
* @ast method
*
*/
public int IDstart;
/**
* @ast method
*
*/
public int IDend;
/**
* 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 optional node for the Init child. This is the {@code Opt}
* node containing the child Init, not the actual child!
*
* @param opt
* The new node to be used as the optional node for the Init
* child.
* @apilevel low-level
* @ast method
*
*/
public void setInitOpt(Opt<Expr> opt) {
setChild(opt, 2);
}
/**
* Check whether the optional Init child exists.
*
* @return {@code true} if the optional Init child exists, {@code false} if
* it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasInit() {
return getInitOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) Init child.
*
* @return The Init child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({ "unchecked", "cast" })
public Expr getInit() {
return (Expr) getInitOpt().getChild(0);
}
/**
* Replaces the (optional) Init child.
*
* @param node
* The new node to be used as the Init child.
* @apilevel high-level
* @ast method
*
*/
public void setInit(Expr node) {
getInitOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({ "unchecked", "cast" })
public Opt<Expr> getInitOpt() {
return (Opt<Expr>) getChild(2);
}
/**
* Retrieves the optional node for child Init. This is the {@code Opt} node
* containing the child Init, not the actual child!
* <p>
* <em>This method does not invoke AST transformations.</em>
* </p>
*
* @return The optional node for child Init.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({ "unchecked", "cast" })
public Opt<Expr> getInitOptNoTransform() {
return (Opt<Expr>) getChildNoTransform(2);
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:332
*/
public boolean isConstant() {
ASTNode$State state = state();
try {
return isFinal() && hasInit() && getInit().isConstant()
&& (type() instanceof PrimitiveType || type().isString());
} finally {
}
}
protected java.util.Map accessibleFrom_TypeDecl_values;
/**
* @attribute syn
* @aspect AccessControl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AccessControl.jrag:109
*/
@SuppressWarnings({ "unchecked", "cast" })
public boolean accessibleFrom(TypeDecl type) {
Object _parameters = type;
if (accessibleFrom_TypeDecl_values == null)
accessibleFrom_TypeDecl_values = new java.util.HashMap(4);
if (accessibleFrom_TypeDecl_values.containsKey(_parameters)) {
return ((Boolean) accessibleFrom_TypeDecl_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean accessibleFrom_TypeDecl_value = accessibleFrom_compute(type);
if (isFinal && num == state().boundariesCrossed)
accessibleFrom_TypeDecl_values.put(_parameters, Boolean.valueOf(accessibleFrom_TypeDecl_value));
return accessibleFrom_TypeDecl_value;
}
/**
* @apilevel internal
*/
private boolean accessibleFrom_compute(TypeDecl type) {
if (isPublic())
return true;
else if (isProtected()) {
if (hostPackage().equals(type.hostPackage()))
return true;
if (type.withinBodyThatSubclasses(hostType()) != null)
return true;
return false;
} else if (isPrivate())
return hostType().topLevelType() == type.topLevelType();
else
return hostPackage().equals(type.hostPackage());
}
/**
* @apilevel internal
*/
protected boolean exceptions_computed = false;
/**
* @apilevel internal
*/
protected Collection exceptions_value;
/**
* @attribute syn
* @aspect AnonymousClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AnonymousClasses.jrag:178
*/
@SuppressWarnings({ "unchecked", "cast" })
public Collection exceptions() {
if (exceptions_computed) {
return exceptions_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
exceptions_value = exceptions_compute();
if (isFinal && num == state().boundariesCrossed)
exceptions_computed = true;
return exceptions_value;
}
/**
* @apilevel internal
*/
private Collection exceptions_compute() {
HashSet set = new HashSet();
if (isInstanceVariable() && hasInit()) {
collectExceptions(set, this);
for (Iterator iter = set.iterator(); iter.hasNext();) {
TypeDecl typeDecl = (TypeDecl) iter.next();
if (!getInit().reachedException(typeDecl))
iter.remove();
}
}
return set;
}
/**
* @attribute syn
* @aspect DataStructures
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DataStructures.jrag:79
*/
public int size() {
ASTNode$State state = state();
try {
return 1;
} finally {
}
}
/**
* @attribute syn
* @aspect DataStructures
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DataStructures.jrag:80
*/
public boolean isEmpty() {
ASTNode$State state = state();
try {
return false;
} finally {
}
}
/**
* @attribute syn
* @aspect DataStructures
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DataStructures.jrag:84
*/
public boolean contains(Object o) {
ASTNode$State state = state();
try {
return this == o;
} finally {
}
}
protected java.util.Map isDAafter_Variable_values;
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:314
*/
@SuppressWarnings({ "unchecked", "cast" })
public boolean isDAafter(Variable v) {
Object _parameters = v;
if (isDAafter_Variable_values == null)
isDAafter_Variable_values = new java.util.HashMap(4);
if (isDAafter_Variable_values.containsKey(_parameters)) {
return ((Boolean) isDAafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDAafter_Variable_value = isDAafter_compute(v);
if (isFinal && num == state().boundariesCrossed)
isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value));
return isDAafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDAafter_compute(Variable v) {
if (v == this)
return hasInit();
return hasInit() ? getInit().isDAafter(v) : isDAbefore(v);
}
protected java.util.Map isDUafter_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:771
*/
@SuppressWarnings({ "unchecked", "cast" })
public boolean isDUafter(Variable v) {
Object _parameters = v;
if (isDUafter_Variable_values == null)
isDUafter_Variable_values = new java.util.HashMap(4);
if (isDUafter_Variable_values.containsKey(_parameters)) {
return ((Boolean) isDUafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDUafter_Variable_value = isDUafter_compute(v);
if (isFinal && num == state().boundariesCrossed)
isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value));
return isDUafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDUafter_compute(Variable v) {
if (v == this)
return !hasInit();
return hasInit() ? getInit().isDUafter(v) : isDUbefore(v);
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:214
*/
public boolean isSynthetic() {
ASTNode$State state = state();
try {
return getModifiers().isSynthetic();
} finally {
}
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:239
*/
public boolean isPublic() {
ASTNode$State state = state();
try {
return getModifiers().isPublic() || hostType().isInterfaceDecl();
} finally {
}
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:240
*/
public boolean isPrivate() {
ASTNode$State state = state();
try {
return getModifiers().isPrivate();
} finally {
}
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:241
*/
public boolean isProtected() {
ASTNode$State state = state();
try {
return getModifiers().isProtected();
} finally {
}
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:242
*/
public boolean isStatic() {
ASTNode$State state = state();
try {
return getModifiers().isStatic() || hostType().isInterfaceDecl();
} finally {
}
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:244
*/
public boolean isFinal() {
ASTNode$State state = state();
try {
return getModifiers().isFinal() || hostType().isInterfaceDecl();
} finally {
}
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:245
*/
public boolean isTransient() {
ASTNode$State state = state();
try {
return getModifiers().isTransient();
} finally {
}
}
/**
* @attribute syn
* @aspect Modifiers
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:246
*/
public boolean isVolatile() {
ASTNode$State state = state();
try {
return getModifiers().isVolatile();
} finally {
}
}
/**
* @attribute syn
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:800
*/
public String dumpString() {
ASTNode$State state = state();
try {
return getClass().getName() + " [" + getID() + "]";
} finally {
}
}
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:251
*/
public TypeDecl type() {
ASTNode$State state = state();
try {
return getTypeAccess().type();
} finally {
}
}
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:271
*/
public boolean isVoid() {
ASTNode$State state = state();
try {
return type().isVoid();
} finally {
}
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:32
*/
public boolean isParameter() {
ASTNode$State state = state();
try {
return false;
} finally {
}
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:34
*/
public boolean isClassVariable() {
ASTNode$State state = state();
try {
return isStatic() || hostType().isInterfaceDecl();
} finally {
}
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:35
*/
public boolean isInstanceVariable() {
ASTNode$State state = state();
try {
return (hostType().isClassDecl() || hostType().isAnonymous()) && !isStatic();
} finally {
}
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:36
*/
public boolean isMethodParameter() {
ASTNode$State state = state();
try {
return false;
} finally {
}
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:37
*/
public boolean isConstructorParameter() {
ASTNode$State state = state();
try {
return false;
} finally {
}
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:38
*/
public boolean isExceptionHandlerParameter() {
ASTNode$State state = state();
try {
return false;
} finally {
}
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:39
*/
public boolean isLocalVariable() {
ASTNode$State state = state();
try {
return false;
} finally {
}
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:41
*/
public boolean isBlank() {
ASTNode$State state = state();
try {
return !hasInit();
} finally {
}
}
/**
* @attribute syn
* @aspect Variables
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:43
*/
public String name() {
ASTNode$State state = state();
try {
return getID();
} finally {
}
}
/**
* @apilevel internal
*/
protected boolean constant_computed = false;
/**
* @apilevel internal
*/
protected Constant constant_value;
/**
* @attribute syn
* @aspect Variables
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:44
*/
@SuppressWarnings({ "unchecked", "cast" })
public Constant constant() {
if (constant_computed) {
return constant_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
constant_value = constant_compute();
if (isFinal && num == state().boundariesCrossed)
constant_computed = true;
return constant_value;
}
/**
* @apilevel internal
*/
private Constant constant_compute() {
return type().cast(getInit().constant());
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:283
*/
public boolean hasAnnotationSuppressWarnings(String s) {
ASTNode$State state = state();
try {
return getModifiers().hasAnnotationSuppressWarnings(s);
} finally {
}
}
/**
* @attribute syn
* @aspect Annotations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:325
*/
public boolean isDeprecated() {
ASTNode$State state = state();
try {
return getModifiers().hasDeprecatedAnnotation();
} finally {
}
}
/**
* @apilevel internal
*/
protected boolean usesTypeVariable_computed = false;
/**
* @apilevel internal
*/
protected boolean usesTypeVariable_value;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1065
*/
@SuppressWarnings({ "unchecked", "cast" })
public boolean usesTypeVariable() {
if (usesTypeVariable_computed) {
return usesTypeVariable_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
usesTypeVariable_value = usesTypeVariable_compute();
if (isFinal && num == state().boundariesCrossed)
usesTypeVariable_computed = true;
return usesTypeVariable_value;
}
/**
* @apilevel internal
*/
private boolean usesTypeVariable_compute() {
return getTypeAccess().usesTypeVariable();
}
/**
* @apilevel internal
*/
protected boolean sourceVariableDecl_computed = false;
/**
* @apilevel internal
*/
protected Variable sourceVariableDecl_value;
/**
* @attribute syn
* @aspect SourceDeclarations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1521
*/
@SuppressWarnings({ "unchecked", "cast" })
public Variable sourceVariableDecl() {
if (sourceVariableDecl_computed) {
return sourceVariableDecl_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
sourceVariableDecl_value = sourceVariableDecl_compute();
if (isFinal && num == state().boundariesCrossed)
sourceVariableDecl_computed = true;
return sourceVariableDecl_value;
}
/**
* @apilevel internal
*/
private Variable sourceVariableDecl_compute() {
return this;
}
/**
* @attribute syn
* @aspect GenericsParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsParTypeDecl.jrag:67
*/
public boolean visibleTypeParameters() {
ASTNode$State state = state();
try {
return !isStatic();
} finally {
}
}
/**
* @attribute syn
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:127
*/
public int sootTypeModifiers() {
ASTNode$State state = state();
try {
int result = 0;
if (isPublic())
result |= soot.Modifier.PUBLIC;
if (isProtected())
result |= soot.Modifier.PROTECTED;
if (isPrivate())
result |= soot.Modifier.PRIVATE;
if (isFinal())
result |= soot.Modifier.FINAL;
if (isStatic())
result |= soot.Modifier.STATIC;
return result;
} finally {
}
}
/**
* @apilevel internal
*/
protected boolean sootRef_computed = false;
/**
* @apilevel internal
*/
protected SootFieldRef sootRef_value;
/**
* @attribute syn
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:355
*/
@SuppressWarnings({ "unchecked", "cast" })
public SootFieldRef sootRef() {
if (sootRef_computed) {
return sootRef_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
sootRef_value = sootRef_compute();
if (isFinal && num == state().boundariesCrossed)
sootRef_computed = true;
return sootRef_value;
}
/**
* @apilevel internal
*/
private SootFieldRef sootRef_compute() {
return Scene.v().makeFieldRef(hostType().getSootClassDecl(), name(), type().getSootType(), isStatic());
}
/**
* @attribute syn
* @aspect GenericsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/GenericsCodegen.jrag:31
*/
public FieldDeclaration erasedField() {
ASTNode$State state = state();
try {
return this;
} finally {
}
}
/**
* @apilevel internal
*/
protected boolean throwTypes_computed = false;
/**
* @apilevel internal
*/
protected Collection<TypeDecl> throwTypes_value;
/**
* @attribute syn
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:22
*/
@SuppressWarnings({ "unchecked", "cast" })
public Collection<TypeDecl> throwTypes() {
if (throwTypes_computed) {
return throwTypes_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
throwTypes_value = throwTypes_compute();
if (isFinal && num == state().boundariesCrossed)
throwTypes_computed = true;
return throwTypes_value;
}
/**
* @apilevel internal
*/
private Collection<TypeDecl> throwTypes_compute() {
Collection<TypeDecl> tts = new LinkedList<TypeDecl>();
tts.add(type());
return tts;
}
/**
* @return true if the modifier list includes the SafeVarargs annotation
* @attribute syn
* @aspect SafeVarargs
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/SafeVarargs.jrag:20
*/
public boolean hasAnnotationSafeVarargs() {
ASTNode$State state = state();
try {
return getModifiers().hasAnnotationSafeVarargs();
} finally {
}
}
/**
* @attribute syn
* @aspect SuppressWarnings
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/SuppressWarnings.jrag:22
*/
public boolean suppressWarnings(String type) {
ASTNode$State state = state();
try {
return hasAnnotationSuppressWarnings(type) || withinSuppressWarnings(type);
} finally {
}
}
/**
* @attribute inh
* @aspect ExceptionHandling
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:48
*/
@SuppressWarnings({ "unchecked", "cast" })
public boolean handlesException(TypeDecl exceptionType) {
ASTNode$State state = state();
boolean handlesException_TypeDecl_value = getParent().Define_boolean_handlesException(this, null,
exceptionType);
return handlesException_TypeDecl_value;
}
/**
* @attribute inh
* @aspect SuppressWarnings
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/SuppressWarnings.jrag:14
*/
@SuppressWarnings({ "unchecked", "cast" })
public boolean withinSuppressWarnings(String s) {
ASTNode$State state = state();
boolean withinSuppressWarnings_String_value = getParent().Define_boolean_withinSuppressWarnings(this, null, s);
return withinSuppressWarnings_String_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:39
* @apilevel internal
*/
public boolean Define_boolean_isSource(ASTNode caller, ASTNode child) {
if (caller == getInitOptNoTransform()) {
return true;
} else {
return getParent().Define_boolean_isSource(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:320
* @apilevel internal
*/
public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) {
if (caller == getInitOptNoTransform()) {
return isDAbefore(v);
} else {
return getParent().Define_boolean_isDAbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:166
* @apilevel internal
*/
public boolean Define_boolean_handlesException(ASTNode caller, ASTNode child, TypeDecl exceptionType) {
if (caller == getInitOptNoTransform()) {
if (hostType().isAnonymous())
return true;
if (!exceptionType.isUncheckedException())
return true;
for (Iterator iter = hostType().constructors().iterator(); iter.hasNext();) {
ConstructorDecl decl = (ConstructorDecl) iter.next();
if (!decl.throwsException(exceptionType))
return false;
}
return true;
} else {
return getParent().Define_boolean_handlesException(this, caller, exceptionType);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:262
* @apilevel internal
*/
public boolean Define_boolean_mayBePublic(ASTNode caller, ASTNode child) {
if (caller == getModifiersNoTransform()) {
return true;
} else {
return getParent().Define_boolean_mayBePublic(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:263
* @apilevel internal
*/
public boolean Define_boolean_mayBeProtected(ASTNode caller, ASTNode child) {
if (caller == getModifiersNoTransform()) {
return true;
} else {
return getParent().Define_boolean_mayBeProtected(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:264
* @apilevel internal
*/
public boolean Define_boolean_mayBePrivate(ASTNode caller, ASTNode child) {
if (caller == getModifiersNoTransform()) {
return true;
} else {
return getParent().Define_boolean_mayBePrivate(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:265
* @apilevel internal
*/
public boolean Define_boolean_mayBeStatic(ASTNode caller, ASTNode child) {
if (caller == getModifiersNoTransform()) {
return true;
} else {
return getParent().Define_boolean_mayBeStatic(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:266
* @apilevel internal
*/
public boolean Define_boolean_mayBeFinal(ASTNode caller, ASTNode child) {
if (caller == getModifiersNoTransform()) {
return true;
} else {
return getParent().Define_boolean_mayBeFinal(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:267
* @apilevel internal
*/
public boolean Define_boolean_mayBeTransient(ASTNode caller, ASTNode child) {
if (caller == getModifiersNoTransform()) {
return true;
} else {
return getParent().Define_boolean_mayBeTransient(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/Modifiers.jrag:268
* @apilevel internal
*/
public boolean Define_boolean_mayBeVolatile(ASTNode caller, ASTNode child) {
if (caller == getModifiersNoTransform()) {
return true;
} else {
return getParent().Define_boolean_mayBeVolatile(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:78
* @apilevel internal
*/
public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {
if (caller == getTypeAccessNoTransform()) {
return NameType.TYPE_NAME;
} else {
return getParent().Define_NameType_nameType(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:260
* @apilevel internal
*/
public TypeDecl Define_TypeDecl_declType(ASTNode caller, ASTNode child) {
if (caller == getInitOptNoTransform()) {
return type();
} else {
return getParent().Define_TypeDecl_declType(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:141
* @apilevel internal
*/
public boolean Define_boolean_inStaticContext(ASTNode caller, ASTNode child) {
if (caller == getInitOptNoTransform()) {
return isStatic() || hostType().isInterfaceDecl();
} else {
return getParent().Define_boolean_inStaticContext(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Annotations.jrag:80
* @apilevel internal
*/
public boolean Define_boolean_mayUseAnnotationTarget(ASTNode caller, ASTNode child, String name) {
if (caller == getModifiersNoTransform()) {
return name.equals("FIELD");
} else {
return getParent().Define_boolean_mayUseAnnotationTarget(this, caller, name);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethodsInference.jrag:35
* @apilevel internal
*/
public TypeDecl Define_TypeDecl_assignConvertedType(ASTNode caller, ASTNode child) {
if (caller == getInitOptNoTransform()) {
return type();
} else {
return getParent().Define_TypeDecl_assignConvertedType(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/InnerClasses.jrag:67
* @apilevel internal
*/
public TypeDecl Define_TypeDecl_expectedType(ASTNode caller, ASTNode child) {
if (caller == getInitOptNoTransform()) {
return type().componentType();
} else {
return getParent().Define_TypeDecl_expectedType(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 48,189
| 25.876743
| 121
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/FieldDeclarationSubstituted.java
|
/* 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 FieldDeclarationSubstituted : {@link FieldDeclaration} ::= <span class="component"><Original:FieldDeclaration></span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.ast:32
*/
public class FieldDeclarationSubstituted extends FieldDeclaration implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
sourceVariableDecl_computed = false;
sourceVariableDecl_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public FieldDeclarationSubstituted clone() throws CloneNotSupportedException {
FieldDeclarationSubstituted node = (FieldDeclarationSubstituted)super.clone();
node.sourceVariableDecl_computed = false;
node.sourceVariableDecl_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public FieldDeclarationSubstituted copy() {
try {
FieldDeclarationSubstituted node = (FieldDeclarationSubstituted) 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 FieldDeclarationSubstituted fullCopy() {
FieldDeclarationSubstituted tree = (FieldDeclarationSubstituted) 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
*
*/
public FieldDeclarationSubstituted() {
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[3];
setChild(new Opt(), 2);
}
/**
* @ast method
*
*/
public FieldDeclarationSubstituted(Modifiers p0, Access p1, String p2, Opt<Expr> p3, FieldDeclaration p4) {
setChild(p0, 0);
setChild(p1, 1);
setID(p2);
setChild(p3, 2);
setOriginal(p4);
}
/**
* @ast method
*
*/
public FieldDeclarationSubstituted(Modifiers p0, Access p1, beaver.Symbol p2, Opt<Expr> p3, FieldDeclaration p4) {
setChild(p0, 0);
setChild(p1, 1);
setID(p2);
setChild(p3, 2);
setOriginal(p4);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Modifiers child.
* @apilevel low-level
* @ast method
*
*/
public Modifiers getModifiersNoTransform() {
return (Modifiers)getChildNoTransform(0);
}
/**
* Replaces the TypeAccess child.
* @param node The new node to replace the TypeAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setTypeAccess(Access node) {
setChild(node, 1);
}
/**
* Retrieves the TypeAccess child.
* @return The current node used as the TypeAccess child.
* @apilevel high-level
* @ast method
*
*/
public Access getTypeAccess() {
return (Access)getChild(1);
}
/**
* Retrieves the TypeAccess child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the TypeAccess child.
* @apilevel low-level
* @ast method
*
*/
public Access getTypeAccessNoTransform() {
return (Access)getChildNoTransform(1);
}
/**
* 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 optional node for the Init child. This is the {@code Opt} node containing the child Init, not the actual child!
* @param opt The new node to be used as the optional node for the Init child.
* @apilevel low-level
* @ast method
*
*/
public void setInitOpt(Opt<Expr> opt) {
setChild(opt, 2);
}
/**
* Check whether the optional Init child exists.
* @return {@code true} if the optional Init child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasInit() {
return getInitOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) Init child.
* @return The Init child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Expr getInit() {
return (Expr)getInitOpt().getChild(0);
}
/**
* Replaces the (optional) Init child.
* @param node The new node to be used as the Init child.
* @apilevel high-level
* @ast method
*
*/
public void setInit(Expr node) {
getInitOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Expr> getInitOpt() {
return (Opt<Expr>)getChild(2);
}
/**
* Retrieves the optional node for child Init. This is the {@code Opt} node containing the child Init, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child Init.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Expr> getInitOptNoTransform() {
return (Opt<Expr>)getChildNoTransform(2);
}
/**
* Replaces the lexeme Original.
* @param value The new value for the lexeme Original.
* @apilevel high-level
* @ast method
*
*/
public void setOriginal(FieldDeclaration value) {
tokenFieldDeclaration_Original = value;
}
/**
* @apilevel internal
* @ast method
*
*/
/**
* @apilevel internal
*/
protected FieldDeclaration tokenFieldDeclaration_Original;
/**
* Retrieves the value for the lexeme Original.
* @return The value for the lexeme Original.
* @apilevel high-level
* @ast method
*
*/
public FieldDeclaration getOriginal() {
return tokenFieldDeclaration_Original;
}
/**
* @apilevel internal
*/
protected boolean sourceVariableDecl_computed = false;
/**
* @apilevel internal
*/
protected Variable sourceVariableDecl_value;
/**
* @attribute syn
* @aspect SourceDeclarations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1522
*/
@SuppressWarnings({"unchecked", "cast"})
public Variable sourceVariableDecl() {
if(sourceVariableDecl_computed) {
return sourceVariableDecl_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
sourceVariableDecl_value = sourceVariableDecl_compute();
if(isFinal && num == state().boundariesCrossed) sourceVariableDecl_computed = true;
return sourceVariableDecl_value;
}
/**
* @apilevel internal
*/
private Variable sourceVariableDecl_compute() { return getOriginal().sourceVariableDecl(); }
/**
* @attribute syn
* @aspect GenericsCodegen
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/GenericsCodegen.jrag:31
*/
public FieldDeclaration erasedField() {
ASTNode$State state = state();
try { return getOriginal().erasedField(); }
finally {
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 10,086
| 25.405759
| 139
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/FieldDescriptor.java
|
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;
/**
* @ast class
*
*/
public class FieldDescriptor extends java.lang.Object {
private BytecodeParser p;
String typeDescriptor;
public FieldDescriptor(BytecodeParser parser, String name) {
p = parser;
int descriptor_index = p.u2();
typeDescriptor = ((CONSTANT_Utf8_Info) p.constantPool[descriptor_index]).string();
if(BytecodeParser.VERBOSE)
p.println(" Field: " + name + ", " + typeDescriptor);
}
public Access type() {
return new TypeDescriptor(p, typeDescriptor).type();
}
public boolean isBoolean() {
return new TypeDescriptor(p, typeDescriptor).isBoolean();
}
}
| 1,133
| 19.618182
| 88
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/FieldInfo.java
|
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;
/**
* @ast class
*
*/
public class FieldInfo extends java.lang.Object {
private BytecodeParser p;
String name;
int flags;
private FieldDescriptor fieldDescriptor;
private Attributes.FieldAttributes attributes;
public FieldInfo(BytecodeParser parser) {
p = parser;
flags = p.u2();
if(BytecodeParser.VERBOSE)
p.print("Flags: " + flags);
int name_index = p.u2();
name = ((CONSTANT_Utf8_Info) p.constantPool[name_index]).string();
fieldDescriptor = new FieldDescriptor(p, name);
attributes = new Attributes.FieldAttributes(p);
}
public BodyDecl bodyDecl() {
FieldDeclaration f;
if((flags & Flags.ACC_ENUM) != 0)
//EnumConstant : FieldDeclaration ::= Modifiers <ID:String> Arg:Expr* BodyDecl* /TypeAccess:Access/ /[Init:Expr]/;
f = new EnumConstant(
BytecodeParser.modifiers(flags),
name,
new List(),
new List()
);
else {
Signatures.FieldSignature s = attributes.fieldSignature;
Access type = s != null ? s.fieldTypeAccess() : fieldDescriptor.type();
f = new FieldDeclaration(
BytecodeParser.modifiers(flags),
type,
name,
new Opt()
);
}
if(attributes.constantValue() != null)
if(fieldDescriptor.isBoolean()) {
f.setInit(attributes.constantValue().exprAsBoolean());
}
else {
f.setInit(attributes.constantValue().expr());
}
if(attributes.annotations != null)
for(Iterator iter = attributes.annotations.iterator(); iter.hasNext(); )
f.getModifiersNoTransform().addModifier((Modifier)iter.next());
return f;
}
public boolean isSynthetic() {
return attributes.isSynthetic();
}
}
| 2,340
| 22.646465
| 122
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/FileNamesPart.java
|
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;
/**
* @ast class
*
*/
public class FileNamesPart extends PathPart {
private HashMap sourceFiles = new HashMap();
private HashSet packages = new HashSet();
public FileNamesPart(Program p) {
isSource = true;
program = p;
}
public boolean hasPackage(String name) { return packages.contains(name); }
public boolean isEmpty() { return sourceFiles.isEmpty(); }
public Collection keySet() { return sourceFiles.keySet(); }
public boolean selectCompilationUnit(String canonicalName) throws IOException {
if(sourceFiles.containsKey(canonicalName)) {
String f = (String)sourceFiles.get(canonicalName);
File classFile = new File(f);
if(classFile.isFile()) {
is = new FileInputStream(classFile);
pathName = classFile.getPath();
relativeName = f;
fullName = canonicalName;
sourceFiles.remove(canonicalName);
return true;
}
}
return false;
}
/**
* Add a source file to be parsed.
* @return The CompilationUnit representing the source file,
* or <code>null</code> if no such file exists
*/
public CompilationUnit addSourceFile(String name) {
try {
File classFile = new File(name);
if(classFile.isFile()) {
is = new FileInputStream(classFile);
this.pathName = classFile.getPath();
relativeName = name;
fullName = name; // is this ok
CompilationUnit u = getCompilationUnit();
if(u != null) {
program.addCompilationUnit(u);
String packageName = u.getPackageDecl();
if(packageName != null && !packages.contains(packageName)) {
packages.add(packageName);
int pos = 0;
while(packageName != null && -1 != (pos = packageName.indexOf('.', pos + 1))) {
String n = packageName.substring(0, pos);
if(!packages.contains(n))
packages.add(n);
}
}
}
return u;
}
} catch (IOException e) {
}
return null;
}
}
| 2,645
| 24.2
| 93
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/FinallyHost.java
|
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;
/**
* @ast interface
*
*/
public interface FinallyHost {
//public Block getFinally();
//public Block getFinally();
public boolean isDUafterFinally(Variable v);
public boolean isDAafterFinally(Variable v);
public void emitFinallyCode(Body b);
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:319
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt label_finally_block();
}
| 1,016
| 21.6
| 112
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/Flags.java
|
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;
/**
* @ast interface
*
*/
public interface Flags {
public int ACC_PUBLIC = 0x0001;
public int ACC_PRIVATE = 0x0002;
public int ACC_PROTECTED = 0x0004;
public int ACC_STATIC = 0x0008;
public int ACC_FINAL = 0x0010;
public int ACC_SUPER = 0x0020;
public int ACC_SYNCHRONIZED = 0x0020;
public int ACC_VOLATILE = 0x0040;
public int ACC_BRIDGE = 0x0040;
public int ACC_TRANSIENT = 0x0080;
public int ACC_VARARGS = 0x0080;
public int ACC_NATIVE = 0x0100;
public int ACC_INTERFACE = 0x0200;
public int ACC_ABSTRACT = 0x0400;
public int ACC_STRICT = 0x0800;
public int ACC_SYNTHETIC = 0x1000;
public int ACC_ANNOTATION = 0x2000;
public int ACC_ENUM = 0x4000;
}
| 1,327
| 15.6
| 41
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/FloatType.java
|
/* 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 FloatType : {@link FloatingPointType};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:62
*/
public class FloatType extends FloatingPointType implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
boxed_computed = false;
boxed_value = null;
jvmName_computed = false;
jvmName_value = null;
getSootType_computed = false;
getSootType_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public FloatType clone() throws CloneNotSupportedException {
FloatType node = (FloatType)super.clone();
node.boxed_computed = false;
node.boxed_value = null;
node.jvmName_computed = false;
node.jvmName_value = null;
node.getSootType_computed = false;
node.getSootType_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public FloatType copy() {
try {
FloatType node = (FloatType) 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 FloatType fullCopy() {
FloatType tree = (FloatType) 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:850
*/
public void toString(StringBuffer s) {
s.append("float");
}
/**
* @ast method
*
*/
public FloatType() {
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[3];
setChild(new Opt(), 1);
setChild(new List(), 2);
}
/**
* @ast method
*
*/
public FloatType(Modifiers p0, String p1, Opt<Access> p2, List<BodyDecl> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @ast method
*
*/
public FloatType(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<BodyDecl> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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 optional node for the SuperClassAccess child. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* @param opt The new node to be used as the optional node for the SuperClassAccess child.
* @apilevel low-level
* @ast method
*
*/
public void setSuperClassAccessOpt(Opt<Access> opt) {
setChild(opt, 1);
}
/**
* Check whether the optional SuperClassAccess child exists.
* @return {@code true} if the optional SuperClassAccess child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasSuperClassAccess() {
return getSuperClassAccessOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) SuperClassAccess child.
* @return The SuperClassAccess child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getSuperClassAccess() {
return (Access)getSuperClassAccessOpt().getChild(0);
}
/**
* Replaces the (optional) SuperClassAccess child.
* @param node The new node to be used as the SuperClassAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setSuperClassAccess(Access node) {
getSuperClassAccessOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOpt() {
return (Opt<Access>)getChild(1);
}
/**
* Retrieves the optional node for child SuperClassAccess. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child SuperClassAccess.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOptNoTransform() {
return (Opt<Access>)getChildNoTransform(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<BodyDecl> 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<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addBodyDeclNoTransform(BodyDecl node) {
List<BodyDecl> 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<BodyDecl> list = getBodyDeclList();
list.setChild(node, i);
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<BodyDecl> getBodyDecls() {
return getBodyDeclList();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclsNoTransform() {
return getBodyDeclListNoTransform();
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclList() {
List<BodyDecl> list = (List<BodyDecl>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclListNoTransform() {
return (List<BodyDecl>)getChildNoTransform(2);
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:160
*/
public Constant cast(Constant c) {
ASTNode$State state = state();
try { return Constant.create(c.floatValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:174
*/
public Constant plus(Constant c) {
ASTNode$State state = state();
try { return c; }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:183
*/
public Constant minus(Constant c) {
ASTNode$State state = state();
try { return Constant.create(-c.floatValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:199
*/
public Constant mul(Constant c1, Constant c2) {
ASTNode$State state = state();
try { return Constant.create(c1.floatValue() * c2.floatValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:208
*/
public Constant div(Constant c1, Constant c2) {
ASTNode$State state = state();
try { return Constant.create(c1.floatValue() / c2.floatValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:217
*/
public Constant mod(Constant c1, Constant c2) {
ASTNode$State state = state();
try { return Constant.create(c1.floatValue() % c2.floatValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:226
*/
public Constant add(Constant c1, Constant c2) {
ASTNode$State state = state();
try { return Constant.create(c1.floatValue() + c2.floatValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:236
*/
public Constant sub(Constant c1, Constant c2) {
ASTNode$State state = state();
try { return Constant.create(c1.floatValue() - c2.floatValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:290
*/
public Constant questionColon(Constant cond, Constant c1, Constant c2) {
ASTNode$State state = state();
try { return Constant.create(cond.booleanValue() ? c1.floatValue() : c2.floatValue()); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:394
*/
public boolean eqIsTrue(Expr left, Expr right) {
ASTNode$State state = state();
try { return left.constant().floatValue() == right.constant().floatValue(); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:405
*/
public boolean ltIsTrue(Expr left, Expr right) {
ASTNode$State state = state();
try { return left.constant().floatValue() < right.constant().floatValue(); }
finally {
}
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:411
*/
public boolean leIsTrue(Expr left, Expr right) {
ASTNode$State state = state();
try { return left.constant().floatValue() <= right.constant().floatValue(); }
finally {
}
}
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:195
*/
public boolean isFloat() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean boxed_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl boxed_value;
/**
* @attribute syn
* @aspect AutoBoxing
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:42
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl boxed() {
if(boxed_computed) {
return boxed_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boxed_value = boxed_compute();
if(isFinal && num == state().boundariesCrossed) boxed_computed = true;
return boxed_value;
}
/**
* @apilevel internal
*/
private TypeDecl boxed_compute() { return lookupType("java.lang", "Float"); }
/**
* @apilevel internal
*/
protected boolean jvmName_computed = false;
/**
* @apilevel internal
*/
protected String jvmName_value;
/**
* @attribute syn
* @aspect Java2Rewrites
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Java2Rewrites.jrag:40
*/
@SuppressWarnings({"unchecked", "cast"})
public String jvmName() {
if(jvmName_computed) {
return jvmName_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
jvmName_value = jvmName_compute();
if(isFinal && num == state().boundariesCrossed) jvmName_computed = true;
return jvmName_value;
}
/**
* @apilevel internal
*/
private String jvmName_compute() { return "F"; }
/**
* @attribute syn
* @aspect Java2Rewrites
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Java2Rewrites.jrag:44
*/
public String primitiveClassName() {
ASTNode$State state = state();
try { return "Float"; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean getSootType_computed = false;
/**
* @apilevel internal
*/
protected Type getSootType_value;
/**
* @attribute syn
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:53
*/
@SuppressWarnings({"unchecked", "cast"})
public Type getSootType() {
if(getSootType_computed) {
return getSootType_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
getSootType_value = getSootType_compute();
if(isFinal && num == state().boundariesCrossed) getSootType_computed = true;
return getSootType_value;
}
/**
* @apilevel internal
*/
private Type getSootType_compute() { return soot.FloatType.v(); }
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 18,414
| 26.986322
| 153
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/FloatingPointLiteral.java
|
/* 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;
/**
* Java floating point literal. Can store any value representable as an
* IEEE 754 32-bit single-precision floating point number.
* @production FloatingPointLiteral : {@link NumericLiteral};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Literals.ast:60
*/
public class FloatingPointLiteral extends NumericLiteral implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
type_computed = false;
type_value = null;
isZero_computed = false;
constant_computed = false;
constant_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public FloatingPointLiteral clone() throws CloneNotSupportedException {
FloatingPointLiteral node = (FloatingPointLiteral)super.clone();
node.type_computed = false;
node.type_value = null;
node.isZero_computed = false;
node.constant_computed = false;
node.constant_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public FloatingPointLiteral copy() {
try {
FloatingPointLiteral node = (FloatingPointLiteral) 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 FloatingPointLiteral fullCopy() {
FloatingPointLiteral tree = (FloatingPointLiteral) 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 TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:581
*/
public void typeCheck() {
if(!isZero() && constant().floatValue() == 0.0f)
error("It is an error for nonzero floating-point " + getLITERAL() + " to round to zero");
if(constant().floatValue() == Float.NEGATIVE_INFINITY || constant().floatValue() == Float.POSITIVE_INFINITY)
error("It is an error for floating-point " + getLITERAL() + " to round to an infinity");
}
/**
* @ast method
* @aspect Expressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:26
*/
public soot.Value eval(Body b) {
return soot.jimple.FloatConstant.v(constant().floatValue());
}
/**
* @ast method
*
*/
public FloatingPointLiteral() {
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() {
}
/**
* @ast method
*
*/
public FloatingPointLiteral(String p0) {
setLITERAL(p0);
}
/**
* @ast method
*
*/
public FloatingPointLiteral(beaver.Symbol p0) {
setLITERAL(p0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return true;
}
/**
* Replaces the lexeme LITERAL.
* @param value The new value for the lexeme LITERAL.
* @apilevel high-level
* @ast method
*
*/
public void setLITERAL(String value) {
tokenString_LITERAL = value;
}
/**
* JastAdd-internal setter for lexeme LITERAL using the Beaver parser.
* @apilevel internal
* @ast method
*
*/
public void setLITERAL(beaver.Symbol symbol) {
if(symbol.value != null && !(symbol.value instanceof String))
throw new UnsupportedOperationException("setLITERAL is only valid for String lexemes");
tokenString_LITERAL = (String)symbol.value;
LITERALstart = symbol.getStart();
LITERALend = symbol.getEnd();
}
/**
* Retrieves the value for the lexeme LITERAL.
* @return The value for the lexeme LITERAL.
* @apilevel high-level
* @ast method
*
*/
public String getLITERAL() {
return tokenString_LITERAL != null ? tokenString_LITERAL : "";
}
/**
* Defer pretty printing to superclass.
* @ast method
* @aspect Literals
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Literals.jrag:105
*/
public void toString(StringBuffer s) {
super.toString(s);
}
/**
* @apilevel internal
*/
protected boolean type_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl type_value;
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:302
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl type() {
if(type_computed) {
return type_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
type_value = type_compute();
if(isFinal && num == state().boundariesCrossed) type_computed = true;
return type_value;
}
/**
* @apilevel internal
*/
private TypeDecl type_compute() { return typeFloat(); }
/**
* @apilevel internal
*/
protected boolean isZero_computed = false;
/**
* @apilevel internal
*/
protected boolean isZero_value;
/**
* @return true if this floating point literal is equivalent to a zero literal
* @attribute syn
* @aspect Literals
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Literals.jrag:22
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isZero() {
if(isZero_computed) {
return isZero_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
isZero_value = isZero_compute();
if(isFinal && num == state().boundariesCrossed) isZero_computed = true;
return isZero_value;
}
/**
* @apilevel internal
*/
private boolean isZero_compute() {
for(int i = 0; i < digits.length(); i++) {
char c = digits.charAt(i);
if (c == 'e' || c == 'p') break;
if (c != '0' && c != '.') {
return false;
}
}
return true;
}
/**
* @apilevel internal
*/
protected boolean constant_computed = false;
/**
* @apilevel internal
*/
protected Constant constant_value;
/**
* Parse this literal and return a fresh Constant.
* @return a fresh Constant representing this FloatingPointLiteral
* @attribute syn
* @aspect Literals
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Literals.jrag:175
*/
@SuppressWarnings({"unchecked", "cast"})
public Constant constant() {
if(constant_computed) {
return constant_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
constant_value = constant_compute();
if(isFinal && num == state().boundariesCrossed) constant_computed = true;
return constant_value;
}
/**
* @apilevel internal
*/
private Constant constant_compute() {
try {
return Constant.create(Float.parseFloat(getDigits()));
}
catch (NumberFormatException e) {
Constant c = Constant.create(0.0f);
c.error = true;
return c;
}
}
/**
* Utility attribute for literal rewriting.
* Any of the NumericLiteral subclasses have already
* been rewritten and/or parsed, and should not be
* rewritten again.
*
* @return true if this literal is a "raw", not-yet-parsed NumericLiteral
* @attribute syn
* @aspect Literals
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Literals.jrag:334
*/
public boolean needsRewrite() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 9,139
| 25.882353
| 112
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/FloatingPointType.java
|
/* 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 FloatingPointType : {@link NumericType};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:61
*/
public class FloatingPointType extends NumericType implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public FloatingPointType clone() throws CloneNotSupportedException {
FloatingPointType node = (FloatingPointType)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public FloatingPointType copy() {
try {
FloatingPointType node = (FloatingPointType) 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 FloatingPointType fullCopy() {
FloatingPointType tree = (FloatingPointType) 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
*
*/
public FloatingPointType() {
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[3];
setChild(new Opt(), 1);
setChild(new List(), 2);
}
/**
* @ast method
*
*/
public FloatingPointType(Modifiers p0, String p1, Opt<Access> p2, List<BodyDecl> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @ast method
*
*/
public FloatingPointType(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<BodyDecl> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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 optional node for the SuperClassAccess child. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* @param opt The new node to be used as the optional node for the SuperClassAccess child.
* @apilevel low-level
* @ast method
*
*/
public void setSuperClassAccessOpt(Opt<Access> opt) {
setChild(opt, 1);
}
/**
* Check whether the optional SuperClassAccess child exists.
* @return {@code true} if the optional SuperClassAccess child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasSuperClassAccess() {
return getSuperClassAccessOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) SuperClassAccess child.
* @return The SuperClassAccess child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getSuperClassAccess() {
return (Access)getSuperClassAccessOpt().getChild(0);
}
/**
* Replaces the (optional) SuperClassAccess child.
* @param node The new node to be used as the SuperClassAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setSuperClassAccess(Access node) {
getSuperClassAccessOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOpt() {
return (Opt<Access>)getChild(1);
}
/**
* Retrieves the optional node for child SuperClassAccess. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child SuperClassAccess.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOptNoTransform() {
return (Opt<Access>)getChildNoTransform(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<BodyDecl> 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<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addBodyDeclNoTransform(BodyDecl node) {
List<BodyDecl> 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<BodyDecl> list = getBodyDeclList();
list.setChild(node, i);
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<BodyDecl> getBodyDecls() {
return getBodyDeclList();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclsNoTransform() {
return getBodyDeclListNoTransform();
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclList() {
List<BodyDecl> list = (List<BodyDecl>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclListNoTransform() {
return (List<BodyDecl>)getChildNoTransform(2);
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 10,635
| 25.790932
| 153
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/FolderPart.java
|
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;
/**
* @ast class
*
*/
public class FolderPart extends PathPart {
/**
* Maps package names to a collection of the names of files in
* the corresponding package directory.
*/
private Map<String, Collection<String>> packageMap =
new HashMap<String, Collection<String>>();
/**
* The root folder of this path part.
*/
private final File folder;
public FolderPart(File folder) {
this.folder = folder;
}
/**
* @param name The qualified package name
* @return <code>true</code> if the given package exists in this source
* folder
*/
public boolean hasPackage(String name) {
return !filesInPackage(name).isEmpty();
}
public boolean hasCompilationUnit(String canonicalName) {
int index = canonicalName.lastIndexOf('.');
String packageName = index == -1 ? "" : canonicalName.substring(0, index);
String typeName = canonicalName.substring(index + 1, canonicalName.length());
String fileName = typeName + fileSuffix();
return filesInPackage(packageName).contains(fileName);
}
/**
* We need to use getCanonicalFile in order to get the case-sensitive
* package name on case-insensitive file systems or we might incorrectly
* report a package name conflict.
*
* NB: This does not work well with symlinks!
*
* @param packageName The qualified name of the package
* @return The names of the files and folders in the package
*/
private Collection<String> filesInPackage(String packageName) {
if (!packageMap.containsKey(packageName)) {
int index = packageName.lastIndexOf('.');
String name = packageName.substring(index == -1 ? 0 : index+1);
String folderName = packageName.replace('.', File.separatorChar);
File pkgFolder = new File(folder, folderName);
Collection<String> fileSet = Collections.emptyList();
try {
// Make sure that there exists a directory with the same name
// (case-sensitive) as the requested package
File canonical = pkgFolder.getCanonicalFile();
if (canonical.isDirectory() && (packageName.isEmpty() ||
canonical.getName().equals(name))) {
String[] files = canonical.list();
if (files.length > 0) {
fileSet = new HashSet<String>();
for (String file: files) {
fileSet.add(file);
}
}
}
} catch (Exception e) {
// Catch IOExceptions etc.
// if the exception was thrown by getCanonicalFile we will put
// the empty list in the packageMap, indicating that the package
// does not exist
}
packageMap.put(packageName, fileSet);
}
return packageMap.get(packageName);
}
public boolean selectCompilationUnit(String canonicalName) throws IOException {
if(hasCompilationUnit(canonicalName)) {
String typeName = canonicalName.replace('.', File.separatorChar);
String fileName = typeName + fileSuffix();
File classFile = new File(folder, fileName);
if(classFile.isFile()) {
is = new FileInputStream(classFile);
age = classFile.lastModified();
pathName = classFile.getPath();
relativeName = fileName + fileSuffix();
fullName = canonicalName;
return true;
}
}
return false;
}
@Override
public String toString() {
return folder.toString();
}
}
| 4,069
| 27.865248
| 83
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ForStmt.java
|
/* 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 ForStmt : {@link BranchTargetStmt} ::= <span class="component">InitStmt:{@link Stmt}*</span> <span class="component">[Condition:{@link Expr}]</span> <span class="component">UpdateStmt:{@link Stmt}*</span> <span class="component">{@link Stmt}</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:210
*/
public class ForStmt extends BranchTargetStmt implements Cloneable, VariableScope {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
targetOf_ContinueStmt_values = null;
targetOf_BreakStmt_values = null;
isDAafter_Variable_values = null;
isDUafter_Variable_values = null;
isDUbeforeCondition_Variable_values = null;
localLookup_String_values = null;
localVariableDeclaration_String_values = null;
canCompleteNormally_computed = false;
cond_label_computed = false;
cond_label_value = null;
begin_label_computed = false;
begin_label_value = null;
update_label_computed = false;
update_label_value = null;
end_label_computed = false;
end_label_value = null;
lookupVariable_String_values = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ForStmt clone() throws CloneNotSupportedException {
ForStmt node = (ForStmt)super.clone();
node.targetOf_ContinueStmt_values = null;
node.targetOf_BreakStmt_values = null;
node.isDAafter_Variable_values = null;
node.isDUafter_Variable_values = null;
node.isDUbeforeCondition_Variable_values = null;
node.localLookup_String_values = null;
node.localVariableDeclaration_String_values = null;
node.canCompleteNormally_computed = false;
node.cond_label_computed = false;
node.cond_label_value = null;
node.begin_label_computed = false;
node.begin_label_value = null;
node.update_label_computed = false;
node.update_label_value = null;
node.end_label_computed = false;
node.end_label_value = null;
node.lookupVariable_String_values = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ForStmt copy() {
try {
ForStmt node = (ForStmt) 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 ForStmt fullCopy() {
ForStmt tree = (ForStmt) 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:604
*/
public void toString(StringBuffer s) {
s.append(indent());
s.append("for(");
if(getNumInitStmt() > 0) {
if(getInitStmt(0) instanceof VariableDeclaration) {
int minDimension = Integer.MAX_VALUE;
for(int i = 0; i < getNumInitStmt(); i++) {
VariableDeclaration v = (VariableDeclaration)getInitStmt(i);
minDimension = Math.min(minDimension, v.type().dimension());
}
VariableDeclaration v = (VariableDeclaration)getInitStmt(0);
v.getModifiers().toString(s);
s.append(v.type().elementType().typeName());
for(int i = minDimension; i > 0; i--)
s.append("[]");
for(int i = 0; i < getNumInitStmt(); i++) {
if(i != 0)
s.append(",");
v = (VariableDeclaration)getInitStmt(i);
s.append(" " + v.name());
for(int j = v.type().dimension() - minDimension; j > 0; j--)
s.append("[]");
if(v.hasInit()) {
s.append(" = ");
v.getInit().toString(s);
}
}
}
else if(getInitStmt(0) instanceof ExprStmt) {
ExprStmt stmt = (ExprStmt)getInitStmt(0);
stmt.getExpr().toString(s);
for(int i = 1; i < getNumInitStmt(); i++) {
s.append(", ");
stmt = (ExprStmt)getInitStmt(i);
stmt.getExpr().toString(s);
}
}
else {
throw new Error("Unexpected initializer in for loop: " + getInitStmt(0));
}
}
s.append("; ");
if(hasCondition()) {
getCondition().toString(s);
}
s.append("; ");
if(getNumUpdateStmt() > 0) {
ExprStmt stmt = (ExprStmt)getUpdateStmt(0);
stmt.getExpr().toString(s);
for(int i = 1; i < getNumUpdateStmt(); i++) {
s.append(", ");
stmt = (ExprStmt)getUpdateStmt(i);
stmt.getExpr().toString(s);
}
}
s.append(") ");
getStmt().toString(s);
}
/**
* @ast method
* @aspect TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:334
*/
public void typeCheck() {
if(hasCondition()) {
TypeDecl cond = getCondition().type();
if(!cond.isBoolean()) {
error("the type of \"" + getCondition() + "\" is " + cond.name() + " which is not boolean");
}
}
}
/**
* @ast method
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:180
*/
public void jimplify2(Body b) {
for (int i=0; i<getNumInitStmt(); i++) {
getInitStmt(i).jimplify2(b);
}
b.addLabel(cond_label());
getCondition().emitEvalBranch(b);
if(getCondition().canBeTrue()) {
b.addLabel(begin_label());
getStmt().jimplify2(b);
b.addLabel(update_label());
for (int i=0; i < getNumUpdateStmt(); i++)
getUpdateStmt(i).jimplify2(b);
b.setLine(this);
b.add(b.newGotoStmt(cond_label(), this));
}
if(canCompleteNormally()) {
b.addLabel(end_label());
}
}
/**
* @ast method
*
*/
public ForStmt() {
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(), 0);
setChild(new Opt(), 1);
setChild(new List(), 2);
}
/**
* @ast method
*
*/
public ForStmt(List<Stmt> p0, Opt<Expr> p1, List<Stmt> p2, Stmt p3) {
setChild(p0, 0);
setChild(p1, 1);
setChild(p2, 2);
setChild(p3, 3);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 4;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return true;
}
/**
* Replaces the InitStmt list.
* @param list The new list node to be used as the InitStmt list.
* @apilevel high-level
* @ast method
*
*/
public void setInitStmtList(List<Stmt> list) {
setChild(list, 0);
}
/**
* Retrieves the number of children in the InitStmt list.
* @return Number of children in the InitStmt list.
* @apilevel high-level
* @ast method
*
*/
public int getNumInitStmt() {
return getInitStmtList().getNumChild();
}
/**
* Retrieves the number of children in the InitStmt list.
* Calling this method will not trigger rewrites..
* @return Number of children in the InitStmt list.
* @apilevel low-level
* @ast method
*
*/
public int getNumInitStmtNoTransform() {
return getInitStmtListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the InitStmt list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the InitStmt list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Stmt getInitStmt(int i) {
return (Stmt)getInitStmtList().getChild(i);
}
/**
* Append an element to the InitStmt list.
* @param node The element to append to the InitStmt list.
* @apilevel high-level
* @ast method
*
*/
public void addInitStmt(Stmt node) {
List<Stmt> list = (parent == null || state == null) ? getInitStmtListNoTransform() : getInitStmtList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addInitStmtNoTransform(Stmt node) {
List<Stmt> list = getInitStmtListNoTransform();
list.addChild(node);
}
/**
* Replaces the InitStmt 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 setInitStmt(Stmt node, int i) {
List<Stmt> list = getInitStmtList();
list.setChild(node, i);
}
/**
* Retrieves the InitStmt list.
* @return The node representing the InitStmt list.
* @apilevel high-level
* @ast method
*
*/
public List<Stmt> getInitStmts() {
return getInitStmtList();
}
/**
* Retrieves the InitStmt list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the InitStmt list.
* @apilevel low-level
* @ast method
*
*/
public List<Stmt> getInitStmtsNoTransform() {
return getInitStmtListNoTransform();
}
/**
* Retrieves the InitStmt list.
* @return The node representing the InitStmt list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Stmt> getInitStmtList() {
List<Stmt> list = (List<Stmt>)getChild(0);
list.getNumChild();
return list;
}
/**
* Retrieves the InitStmt list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the InitStmt list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Stmt> getInitStmtListNoTransform() {
return (List<Stmt>)getChildNoTransform(0);
}
/**
* Replaces the optional node for the Condition child. This is the {@code Opt} node containing the child Condition, not the actual child!
* @param opt The new node to be used as the optional node for the Condition child.
* @apilevel low-level
* @ast method
*
*/
public void setConditionOpt(Opt<Expr> opt) {
setChild(opt, 1);
}
/**
* Check whether the optional Condition child exists.
* @return {@code true} if the optional Condition child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasCondition() {
return getConditionOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) Condition child.
* @return The Condition child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Expr getCondition() {
return (Expr)getConditionOpt().getChild(0);
}
/**
* Replaces the (optional) Condition child.
* @param node The new node to be used as the Condition child.
* @apilevel high-level
* @ast method
*
*/
public void setCondition(Expr node) {
getConditionOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Expr> getConditionOpt() {
return (Opt<Expr>)getChild(1);
}
/**
* Retrieves the optional node for child Condition. This is the {@code Opt} node containing the child Condition, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child Condition.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Expr> getConditionOptNoTransform() {
return (Opt<Expr>)getChildNoTransform(1);
}
/**
* Replaces the UpdateStmt list.
* @param list The new list node to be used as the UpdateStmt list.
* @apilevel high-level
* @ast method
*
*/
public void setUpdateStmtList(List<Stmt> list) {
setChild(list, 2);
}
/**
* Retrieves the number of children in the UpdateStmt list.
* @return Number of children in the UpdateStmt list.
* @apilevel high-level
* @ast method
*
*/
public int getNumUpdateStmt() {
return getUpdateStmtList().getNumChild();
}
/**
* Retrieves the number of children in the UpdateStmt list.
* Calling this method will not trigger rewrites..
* @return Number of children in the UpdateStmt list.
* @apilevel low-level
* @ast method
*
*/
public int getNumUpdateStmtNoTransform() {
return getUpdateStmtListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the UpdateStmt list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the UpdateStmt list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Stmt getUpdateStmt(int i) {
return (Stmt)getUpdateStmtList().getChild(i);
}
/**
* Append an element to the UpdateStmt list.
* @param node The element to append to the UpdateStmt list.
* @apilevel high-level
* @ast method
*
*/
public void addUpdateStmt(Stmt node) {
List<Stmt> list = (parent == null || state == null) ? getUpdateStmtListNoTransform() : getUpdateStmtList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addUpdateStmtNoTransform(Stmt node) {
List<Stmt> list = getUpdateStmtListNoTransform();
list.addChild(node);
}
/**
* Replaces the UpdateStmt 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 setUpdateStmt(Stmt node, int i) {
List<Stmt> list = getUpdateStmtList();
list.setChild(node, i);
}
/**
* Retrieves the UpdateStmt list.
* @return The node representing the UpdateStmt list.
* @apilevel high-level
* @ast method
*
*/
public List<Stmt> getUpdateStmts() {
return getUpdateStmtList();
}
/**
* Retrieves the UpdateStmt list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the UpdateStmt list.
* @apilevel low-level
* @ast method
*
*/
public List<Stmt> getUpdateStmtsNoTransform() {
return getUpdateStmtListNoTransform();
}
/**
* Retrieves the UpdateStmt list.
* @return The node representing the UpdateStmt list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Stmt> getUpdateStmtList() {
List<Stmt> list = (List<Stmt>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the UpdateStmt list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the UpdateStmt list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Stmt> getUpdateStmtListNoTransform() {
return (List<Stmt>)getChildNoTransform(2);
}
/**
* Replaces the Stmt child.
* @param node The new node to replace the Stmt child.
* @apilevel high-level
* @ast method
*
*/
public void setStmt(Stmt node) {
setChild(node, 3);
}
/**
* Retrieves the Stmt child.
* @return The current node used as the Stmt child.
* @apilevel high-level
* @ast method
*
*/
public Stmt getStmt() {
return (Stmt)getChild(3);
}
/**
* Retrieves the Stmt child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Stmt child.
* @apilevel low-level
* @ast method
*
*/
public Stmt getStmtNoTransform() {
return (Stmt)getChildNoTransform(3);
}
protected java.util.Map targetOf_ContinueStmt_values;
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:71
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean targetOf(ContinueStmt stmt) {
Object _parameters = stmt;
if(targetOf_ContinueStmt_values == null) targetOf_ContinueStmt_values = new java.util.HashMap(4);
if(targetOf_ContinueStmt_values.containsKey(_parameters)) {
return ((Boolean)targetOf_ContinueStmt_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean targetOf_ContinueStmt_value = targetOf_compute(stmt);
if(isFinal && num == state().boundariesCrossed) targetOf_ContinueStmt_values.put(_parameters, Boolean.valueOf(targetOf_ContinueStmt_value));
return targetOf_ContinueStmt_value;
}
/**
* @apilevel internal
*/
private boolean targetOf_compute(ContinueStmt stmt) { return !stmt.hasLabel(); }
protected java.util.Map targetOf_BreakStmt_values;
/**
* @attribute syn
* @aspect BranchTarget
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/BranchTarget.jrag:79
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean targetOf(BreakStmt stmt) {
Object _parameters = stmt;
if(targetOf_BreakStmt_values == null) targetOf_BreakStmt_values = new java.util.HashMap(4);
if(targetOf_BreakStmt_values.containsKey(_parameters)) {
return ((Boolean)targetOf_BreakStmt_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean targetOf_BreakStmt_value = targetOf_compute(stmt);
if(isFinal && num == state().boundariesCrossed) targetOf_BreakStmt_values.put(_parameters, Boolean.valueOf(targetOf_BreakStmt_value));
return targetOf_BreakStmt_value;
}
/**
* @apilevel internal
*/
private boolean targetOf_compute(BreakStmt stmt) { return !stmt.hasLabel(); }
protected java.util.Map isDAafter_Variable_values;
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:612
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDAafter(Variable v) {
Object _parameters = v;
if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4);
if(isDAafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDAafter_Variable_value = isDAafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value));
return isDAafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDAafter_compute(Variable v) {
if(!(!hasCondition() || getCondition().isDAafterFalse(v)))
return false;
for(Iterator iter = targetBreaks().iterator(); iter.hasNext(); ) {
BreakStmt stmt = (BreakStmt)iter.next();
if(!stmt.isDAafterReachedFinallyBlocks(v))
return false;
}
return true;
}
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:625
*/
public boolean isDAafterInitialization(Variable v) {
ASTNode$State state = state();
try { return getNumInitStmt() == 0 ? isDAbefore(v) : getInitStmt(getNumInitStmt()-1).isDAafter(v); }
finally {
}
}
protected java.util.Map isDUafter_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:1096
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDUafter(Variable v) {
Object _parameters = v;
if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4);
if(isDUafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDUafter_Variable_value = isDUafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value));
return isDUafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDUafter_compute(Variable v) {
if(!isDUbeforeCondition(v)) // start a circular evaluation here
return false;
if(!(!hasCondition() || getCondition().isDUafterFalse(v))) {
return false;
}
for(Iterator iter = targetBreaks().iterator(); iter.hasNext(); ) {
BreakStmt stmt = (BreakStmt)iter.next();
if(!stmt.isDUafterReachedFinallyBlocks(v))
return false;
}
//if(!isDUafterUpdate(v))
// return false;
return true;
}
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:1116
*/
public boolean isDUafterInit(Variable v) {
ASTNode$State state = state();
try { return getNumInitStmt() == 0 ? isDUbefore(v) : getInitStmt(getNumInitStmt()-1).isDUafter(v); }
finally {
}
}
protected java.util.Map isDUbeforeCondition_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:1118
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDUbeforeCondition(Variable v) {
Object _parameters = v;
if(isDUbeforeCondition_Variable_values == null) isDUbeforeCondition_Variable_values = new java.util.HashMap(4);
ASTNode$State.CircularValue _value;
if(isDUbeforeCondition_Variable_values.containsKey(_parameters)) {
Object _o = isDUbeforeCondition_Variable_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();
isDUbeforeCondition_Variable_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_isDUbeforeCondition_Variable_value;
do {
_value.visited = new Integer(state.CIRCLE_INDEX);
state.CHANGE = false;
new_isDUbeforeCondition_Variable_value = isDUbeforeCondition_compute(v);
if (new_isDUbeforeCondition_Variable_value!=((Boolean)_value.value).booleanValue()) {
state.CHANGE = true;
_value.value = Boolean.valueOf(new_isDUbeforeCondition_Variable_value);
}
state.CIRCLE_INDEX++;
} while (state.CHANGE);
if(isFinal && num == state().boundariesCrossed) {
isDUbeforeCondition_Variable_values.put(_parameters, new_isDUbeforeCondition_Variable_value);
}
else {
isDUbeforeCondition_Variable_values.remove(_parameters);
state.RESET_CYCLE = true;
isDUbeforeCondition_compute(v);
state.RESET_CYCLE = false;
}
state.IN_CIRCLE = false;
return new_isDUbeforeCondition_Variable_value;
}
if(!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) {
_value.visited = new Integer(state.CIRCLE_INDEX);
boolean new_isDUbeforeCondition_Variable_value = isDUbeforeCondition_compute(v);
if (state.RESET_CYCLE) {
isDUbeforeCondition_Variable_values.remove(_parameters);
}
else if (new_isDUbeforeCondition_Variable_value!=((Boolean)_value.value).booleanValue()) {
state.CHANGE = true;
_value.value = new_isDUbeforeCondition_Variable_value;
}
return new_isDUbeforeCondition_Variable_value;
}
return ((Boolean)_value.value).booleanValue();
}
/**
* @apilevel internal
*/
private boolean isDUbeforeCondition_compute(Variable v) {
if(!isDUafterInit(v))
return false;
else if(!isDUafterUpdate(v))
return false;
return true;
}
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:1129
*/
public boolean isDUafterUpdate(Variable v) {
ASTNode$State state = state();
try {
if(!isDUbeforeCondition(v)) // start a circular evaluation here
return false;
if(getNumUpdateStmt() > 0)
return getUpdateStmt(getNumUpdateStmt()-1).isDUafter(v);
if(!getStmt().isDUafter(v))
return false;
for(Iterator iter = targetContinues().iterator(); iter.hasNext(); ) {
ContinueStmt stmt = (ContinueStmt)iter.next();
if(!stmt.isDUafterReachedFinallyBlocks(v))
return false;
}
return true;
}
finally {
}
}
protected java.util.Map localLookup_String_values;
/**
* @attribute syn
* @aspect VariableScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:91
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet localLookup(String name) {
Object _parameters = name;
if(localLookup_String_values == null) localLookup_String_values = new java.util.HashMap(4);
if(localLookup_String_values.containsKey(_parameters)) {
return (SimpleSet)localLookup_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet localLookup_String_value = localLookup_compute(name);
if(isFinal && num == state().boundariesCrossed) localLookup_String_values.put(_parameters, localLookup_String_value);
return localLookup_String_value;
}
/**
* @apilevel internal
*/
private SimpleSet localLookup_compute(String name) {
VariableDeclaration v = localVariableDeclaration(name);
if(v != null) return v;
return lookupVariable(name);
}
protected java.util.Map localVariableDeclaration_String_values;
/**
* @attribute syn
* @aspect VariableScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:123
*/
@SuppressWarnings({"unchecked", "cast"})
public VariableDeclaration localVariableDeclaration(String name) {
Object _parameters = name;
if(localVariableDeclaration_String_values == null) localVariableDeclaration_String_values = new java.util.HashMap(4);
if(localVariableDeclaration_String_values.containsKey(_parameters)) {
return (VariableDeclaration)localVariableDeclaration_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
VariableDeclaration localVariableDeclaration_String_value = localVariableDeclaration_compute(name);
if(isFinal && num == state().boundariesCrossed) localVariableDeclaration_String_values.put(_parameters, localVariableDeclaration_String_value);
return localVariableDeclaration_String_value;
}
/**
* @apilevel internal
*/
private VariableDeclaration localVariableDeclaration_compute(String name) {
for(int i = 0; i < getNumInitStmt(); i++)
if(getInitStmt(i).declaresVariable(name))
return (VariableDeclaration)getInitStmt(i);
return null;
}
/**
* @attribute syn
* @aspect NameCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:401
*/
public boolean continueLabel() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean canCompleteNormally_computed = false;
/**
* @apilevel internal
*/
protected boolean canCompleteNormally_value;
/**
* @attribute syn
* @aspect UnreachableStatements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:102
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean canCompleteNormally() {
if(canCompleteNormally_computed) {
return canCompleteNormally_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
canCompleteNormally_value = canCompleteNormally_compute();
if(isFinal && num == state().boundariesCrossed) canCompleteNormally_computed = true;
return canCompleteNormally_value;
}
/**
* @apilevel internal
*/
private boolean canCompleteNormally_compute() { return reachable() && hasCondition() && (!getCondition().isConstant() || !getCondition().isTrue()) || reachableBreak(); }
/**
* @attribute syn
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:21
*/
public boolean definesLabel() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean cond_label_computed = false;
/**
* @apilevel internal
*/
protected soot.jimple.Stmt cond_label_value;
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:175
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt cond_label() {
if(cond_label_computed) {
return cond_label_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
cond_label_value = cond_label_compute();
if(isFinal && num == state().boundariesCrossed) cond_label_computed = true;
return cond_label_value;
}
/**
* @apilevel internal
*/
private soot.jimple.Stmt cond_label_compute() { return newLabel(); }
/**
* @apilevel internal
*/
protected boolean begin_label_computed = false;
/**
* @apilevel internal
*/
protected soot.jimple.Stmt begin_label_value;
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:176
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt begin_label() {
if(begin_label_computed) {
return begin_label_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
begin_label_value = begin_label_compute();
if(isFinal && num == state().boundariesCrossed) begin_label_computed = true;
return begin_label_value;
}
/**
* @apilevel internal
*/
private soot.jimple.Stmt begin_label_compute() { return newLabel(); }
/**
* @apilevel internal
*/
protected boolean update_label_computed = false;
/**
* @apilevel internal
*/
protected soot.jimple.Stmt update_label_value;
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:177
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt update_label() {
if(update_label_computed) {
return update_label_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
update_label_value = update_label_compute();
if(isFinal && num == state().boundariesCrossed) update_label_computed = true;
return update_label_value;
}
/**
* @apilevel internal
*/
private soot.jimple.Stmt update_label_compute() { return newLabel(); }
/**
* @apilevel internal
*/
protected boolean end_label_computed = false;
/**
* @apilevel internal
*/
protected soot.jimple.Stmt end_label_value;
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:178
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt end_label() {
if(end_label_computed) {
return end_label_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
end_label_value = end_label_compute();
if(isFinal && num == state().boundariesCrossed) end_label_computed = true;
return end_label_value;
}
/**
* @apilevel internal
*/
private soot.jimple.Stmt end_label_compute() { return newLabel(); }
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:200
*/
public soot.jimple.Stmt break_label() {
ASTNode$State state = state();
try { return end_label(); }
finally {
}
}
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:225
*/
public soot.jimple.Stmt continue_label() {
ASTNode$State state = state();
try { return update_label(); }
finally {
}
}
/**
* @attribute syn
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:55
*/
public boolean modifiedInScope(Variable var) {
ASTNode$State state = state();
try {
for (Stmt stmt : getInitStmtList())
if (stmt.modifiedInScope(var))
return true;
for (Stmt stmt : getUpdateStmtList())
if (stmt.modifiedInScope(var))
return true;
return getStmt().modifiedInScope(var);
}
finally {
}
}
protected java.util.Map lookupVariable_String_values;
/**
* @attribute inh
* @aspect VariableScope
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:18
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet lookupVariable(String name) {
Object _parameters = name;
if(lookupVariable_String_values == null) lookupVariable_String_values = new java.util.HashMap(4);
if(lookupVariable_String_values.containsKey(_parameters)) {
return (SimpleSet)lookupVariable_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet lookupVariable_String_value = getParent().Define_SimpleSet_lookupVariable(this, null, name);
if(isFinal && num == state().boundariesCrossed) lookupVariable_String_values.put(_parameters, lookupVariable_String_value);
return lookupVariable_String_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:636
* @apilevel internal
*/
public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) {
if(caller == getUpdateStmtListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
{
if(!getStmt().isDAafter(v))
return false;
for(Iterator iter = targetContinues().iterator(); iter.hasNext(); ) {
ContinueStmt stmt = (ContinueStmt)iter.next();
if(!stmt.isDAafterReachedFinallyBlocks(v))
return false;
}
return true;
}
}
else if(caller == getStmtNoTransform()){
if(hasCondition() && getCondition().isDAafterTrue(v))
return true;
if(!hasCondition() && isDAafterInitialization(v))
return true;
return false;
}
else if(caller == getConditionOptNoTransform()) {
return isDAafterInitialization(v);
}
else if(caller == getInitStmtListNoTransform()) {
int i = caller.getIndexOfChild(child);
return i == 0 ? isDAbefore(v) : getInitStmt(i-1).isDAafter(v);
}
else { return getParent().Define_boolean_isDAbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:1145
* @apilevel internal
*/
public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) {
if(caller == getUpdateStmtListNoTransform()) {
int i = caller.getIndexOfChild(child);
{
if(!isDUbeforeCondition(v)) // start a circular evaluation here
return false;
if(i == 0) {
if(!getStmt().isDUafter(v))
return false;
for(Iterator iter = targetContinues().iterator(); iter.hasNext(); ) {
ContinueStmt stmt = (ContinueStmt)iter.next();
if(!stmt.isDUafterReachedFinallyBlocks(v))
return false;
}
return true;
}
else
return getUpdateStmt(i-1).isDUafter(v);
}
}
else if(caller == getStmtNoTransform()) {
return isDUbeforeCondition(v) && (hasCondition() ?
getCondition().isDUafterTrue(v) : isDUafterInit(v));
}
else if(caller == getConditionOptNoTransform()) {
return isDUbeforeCondition(v);
}
else if(caller == getInitStmtListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return childIndex == 0 ? isDUbefore(v) : getInitStmt(childIndex-1).isDUafter(v);
}
else { return getParent().Define_boolean_isDUbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupVariable.jrag:90
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) {
if(caller == getStmtNoTransform()) {
return localLookup(name);
}
else if(caller == getUpdateStmtListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return localLookup(name);
}
else if(caller == getConditionOptNoTransform()) {
return localLookup(name);
}
else if(caller == getInitStmtListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return localLookup(name);
}
else { return getParent().Define_SimpleSet_lookupVariable(this, caller, name);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:299
* @apilevel internal
*/
public VariableScope Define_VariableScope_outerScope(ASTNode caller, ASTNode child) {
if(caller == getStmtNoTransform()) {
return this;
}
else if(caller == getInitStmtListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return this;
}
else { return getParent().Define_VariableScope_outerScope(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:370
* @apilevel internal
*/
public boolean Define_boolean_insideLoop(ASTNode caller, ASTNode child) {
if(caller == getStmtNoTransform()) {
return true;
}
else { return getParent().Define_boolean_insideLoop(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:103
* @apilevel internal
*/
public boolean Define_boolean_reachable(ASTNode caller, ASTNode child) {
if(caller == getStmtNoTransform()) {
return reachable() && (!hasCondition() || (!getCondition().isConstant() || !getCondition().isFalse()));
}
else { return getParent().Define_boolean_reachable(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:151
* @apilevel internal
*/
public boolean Define_boolean_reportUnreachable(ASTNode caller, ASTNode child) {
if(caller == getStmtNoTransform()) {
return reachable();
}
else { return getParent().Define_boolean_reportUnreachable(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:44
* @apilevel internal
*/
public soot.jimple.Stmt Define_soot_jimple_Stmt_condition_false_label(ASTNode caller, ASTNode child) {
if(caller == getConditionOptNoTransform()) {
return end_label();
}
else { return getParent().Define_soot_jimple_Stmt_condition_false_label(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:45
* @apilevel internal
*/
public soot.jimple.Stmt Define_soot_jimple_Stmt_condition_true_label(ASTNode caller, ASTNode child) {
if(caller == getConditionOptNoTransform()) {
return begin_label();
}
else { return getParent().Define_soot_jimple_Stmt_condition_true_label(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
// Declared in /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag at line 1163
if(!hasCondition()) {
state().duringDU++;
ASTNode result = rewriteRule0();
state().duringDU--;
return result;
}
return super.rewriteTo();
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:1163
* @apilevel internal
*/ private ForStmt rewriteRule0() {
{
setCondition(new BooleanLiteral("true"));
return this;
} }
}
| 43,036
| 31.579107
| 264
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/Frontend.java
|
package soot.JastAddJ;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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;
/**
* @ast class
*
*/
public class Frontend extends java.lang.Object {
private static final Logger logger = LoggerFactory.getLogger(Frontend.class);
protected Program program;
protected Frontend() {
program = new Program();
program.state().reset();
}
public boolean process(String[] args, BytecodeReader reader, JavaParser parser) {
program.initBytecodeReader(reader);
program.initJavaParser(parser);
initOptions();
processArgs(args);
Collection files = program.options().files();
if(program.options().hasOption("-version")) {
printVersion();
return true;
}
if(program.options().hasOption("-help") || files.isEmpty()) {
printUsage();
return true;
}
try {
for(Iterator iter = files.iterator(); iter.hasNext(); ) {
String name = (String)iter.next();
if(!new File(name).exists())
System.err.println("WARNING: file \"" + name + "\" does not exist");
program.addSourceFile(name);
}
for(Iterator iter = program.compilationUnitIterator(); iter.hasNext(); ) {
CompilationUnit unit = (CompilationUnit)iter.next();
if(unit.fromSource()) {
try {
Collection errors = unit.parseErrors();
Collection warnings = new LinkedList();
// compute static semantic errors when there are no parse errors
// or the recover from parse errors option is specified
if(errors.isEmpty() || program.options().hasOption("-recover"))
unit.errorCheck(errors, warnings);
if(!errors.isEmpty()) {
processErrors(errors, unit);
return false;
}
else {
if(!warnings.isEmpty())
processWarnings(warnings, unit);
processNoErrors(unit);
}
} catch (Throwable t) {
System.err.println("Errors:");
System.err.println("Fatal exception while processing " +
unit.pathName() + ":");
logger.error(t.getMessage(), t);
return false;
}
}
}
} catch (Throwable t) {
System.err.println("Errors:");
System.err.println("Fatal exception:");
logger.error(t.getMessage(), t);
return false;
}
return true;
}
protected void initOptions() {
Options options = program.options();
options.initOptions();
options.addKeyOption("-version");
options.addKeyOption("-print");
options.addKeyOption("-g");
options.addKeyOption("-g:none");
options.addKeyOption("-g:lines,vars,source");
options.addKeyOption("-nowarn");
options.addKeyOption("-verbose");
options.addKeyOption("-deprecation");
options.addKeyValueOption("-classpath");
options.addKeyValueOption("-cp");
options.addKeyValueOption("-sourcepath");
options.addKeyValueOption("-bootclasspath");
options.addKeyValueOption("-extdirs");
options.addKeyValueOption("-d");
options.addKeyValueOption("-encoding");
options.addKeyValueOption("-source");
options.addKeyValueOption("-target");
options.addKeyOption("-help");
options.addKeyOption("-O");
options.addKeyOption("-J-Xmx128M");
options.addKeyOption("-recover");
}
protected void processArgs(String[] args) {
program.options().addOptions(args);
}
protected void processErrors(Collection errors, CompilationUnit unit) {
System.err.println("Errors:");
for(Iterator iter2 = errors.iterator(); iter2.hasNext(); ) {
System.err.println(iter2.next());
}
}
protected void processWarnings(Collection warnings, CompilationUnit unit) {
System.err.println("Warnings:");
for(Iterator iter2 = warnings.iterator(); iter2.hasNext(); ) {
System.err.println(iter2.next());
}
}
protected void processNoErrors(CompilationUnit unit) {
}
protected void printUsage() {
printLongVersion();
System.out.println(
"\n" + name() + "\n\n" +
"Usage: java " + name() + " <options> <source files>\n" +
" -verbose Output messages about what the compiler is doing\n" +
" -classpath <path> Specify where to find user class files\n" +
" -sourcepath <path> Specify where to find input source files\n" +
" -bootclasspath <path> Override location of bootstrap class files\n" +
" -extdirs <dirs> Override location of installed extensions\n" +
" -d <directory> Specify where to place generated class files\n" +
" -help Print a synopsis of standard options\n" +
" -version Print version information\n"
);
}
protected void printLongVersion() {
System.out.println(name() + " " + url() + " Version " + version());
}
protected void printVersion() {
System.out.println(name() + " " + version());
}
protected String name() {
return "Java1.4Frontend";
}
protected String url() {
return "(http://jastadd.cs.lth.se)";
}
protected String version() {
return "R20070504";
}
}
| 5,977
| 28.019417
| 92
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/GEExpr.java
|
/* 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 GEExpr : {@link RelationalExpr};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:179
*/
public class GEExpr extends RelationalExpr implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GEExpr clone() throws CloneNotSupportedException {
GEExpr node = (GEExpr)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GEExpr copy() {
try {
GEExpr node = (GEExpr) 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 GEExpr fullCopy() {
GEExpr tree = (GEExpr) 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 BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:288
*/
public soot.Value comparison(Body b, soot.Value left, soot.Value right) {
return b.newGeExpr(asImmediate(b, left), asImmediate(b, right), this);
}
/**
* @ast method
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:310
*/
public soot.Value comparisonInv(Body b, soot.Value left, soot.Value right) {
return b.newLtExpr(asImmediate(b, left), asImmediate(b, right), this);
}
/**
* @ast method
*
*/
public GEExpr() {
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 GEExpr(Expr 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 LeftOperand child.
* @param node The new node to replace the LeftOperand child.
* @apilevel high-level
* @ast method
*
*/
public void setLeftOperand(Expr node) {
setChild(node, 0);
}
/**
* Retrieves the LeftOperand child.
* @return The current node used as the LeftOperand child.
* @apilevel high-level
* @ast method
*
*/
public Expr getLeftOperand() {
return (Expr)getChild(0);
}
/**
* Retrieves the LeftOperand child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the LeftOperand child.
* @apilevel low-level
* @ast method
*
*/
public Expr getLeftOperandNoTransform() {
return (Expr)getChildNoTransform(0);
}
/**
* Replaces the RightOperand child.
* @param node The new node to replace the RightOperand child.
* @apilevel high-level
* @ast method
*
*/
public void setRightOperand(Expr node) {
setChild(node, 1);
}
/**
* Retrieves the RightOperand child.
* @return The current node used as the RightOperand child.
* @apilevel high-level
* @ast method
*
*/
public Expr getRightOperand() {
return (Expr)getChild(1);
}
/**
* Retrieves the RightOperand child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the RightOperand child.
* @apilevel low-level
* @ast method
*
*/
public Expr getRightOperandNoTransform() {
return (Expr)getChildNoTransform(1);
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:91
*/
public Constant constant() {
ASTNode$State state = state();
try { return Constant.create(!binaryNumericPromotedType().ltIsTrue(left(), right())); }
finally {
}
}
/**
* @attribute syn
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:400
*/
public String printOp() {
ASTNode$State state = state();
try { return " >= "; }
finally {
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 5,901
| 24.008475
| 120
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/GLBType.java
|
/* 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 GLBType : {@link ReferenceType} ::= <span class="component">{@link Modifiers}</span> <span class="component"><ID:String></span> <span class="component">{@link BodyDecl}*</span> <span class="component">TypeBound:{@link Access}*</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.ast:47
*/
public class GLBType extends ReferenceType implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
subtype_TypeDecl_values = null;
getSootClassDecl_computed = false;
getSootClassDecl_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GLBType clone() throws CloneNotSupportedException {
GLBType node = (GLBType)super.clone();
node.subtype_TypeDecl_values = null;
node.getSootClassDecl_computed = false;
node.getSootClassDecl_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GLBType copy() {
try {
GLBType node = (GLBType) 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 GLBType fullCopy() {
GLBType tree = (GLBType) 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 LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1482
*/
public HashSet implementedInterfaces(){
HashSet ret = new HashSet();
for (int i = 0; i < getNumTypeBound(); i++) {
ret.addAll(getTypeBound(i).type().implementedInterfaces());
}
return ret;
}
/**
* @ast method
*
*/
public GLBType() {
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[3];
setChild(new List(), 1);
setChild(new List(), 2);
}
/**
* @ast method
*
*/
public GLBType(Modifiers p0, String p1, List<BodyDecl> p2, List<Access> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @ast method
*
*/
public GLBType(Modifiers p0, beaver.Symbol p1, List<BodyDecl> p2, List<Access> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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<BodyDecl> 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<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addBodyDeclNoTransform(BodyDecl node) {
List<BodyDecl> 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<BodyDecl> list = getBodyDeclList();
list.setChild(node, i);
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<BodyDecl> getBodyDecls() {
return getBodyDeclList();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclsNoTransform() {
return getBodyDeclListNoTransform();
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclList() {
List<BodyDecl> list = (List<BodyDecl>)getChild(1);
list.getNumChild();
return list;
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclListNoTransform() {
return (List<BodyDecl>)getChildNoTransform(1);
}
/**
* Replaces the TypeBound list.
* @param list The new list node to be used as the TypeBound list.
* @apilevel high-level
* @ast method
*
*/
public void setTypeBoundList(List<Access> list) {
setChild(list, 2);
}
/**
* Retrieves the number of children in the TypeBound list.
* @return Number of children in the TypeBound list.
* @apilevel high-level
* @ast method
*
*/
public int getNumTypeBound() {
return getTypeBoundList().getNumChild();
}
/**
* Retrieves the number of children in the TypeBound list.
* Calling this method will not trigger rewrites..
* @return Number of children in the TypeBound list.
* @apilevel low-level
* @ast method
*
*/
public int getNumTypeBoundNoTransform() {
return getTypeBoundListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the TypeBound list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the TypeBound list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getTypeBound(int i) {
return (Access)getTypeBoundList().getChild(i);
}
/**
* Append an element to the TypeBound list.
* @param node The element to append to the TypeBound list.
* @apilevel high-level
* @ast method
*
*/
public void addTypeBound(Access node) {
List<Access> list = (parent == null || state == null) ? getTypeBoundListNoTransform() : getTypeBoundList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addTypeBoundNoTransform(Access node) {
List<Access> list = getTypeBoundListNoTransform();
list.addChild(node);
}
/**
* Replaces the TypeBound 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 setTypeBound(Access node, int i) {
List<Access> list = getTypeBoundList();
list.setChild(node, i);
}
/**
* Retrieves the TypeBound list.
* @return The node representing the TypeBound list.
* @apilevel high-level
* @ast method
*
*/
public List<Access> getTypeBounds() {
return getTypeBoundList();
}
/**
* Retrieves the TypeBound list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeBound list.
* @apilevel low-level
* @ast method
*
*/
public List<Access> getTypeBoundsNoTransform() {
return getTypeBoundListNoTransform();
}
/**
* Retrieves the TypeBound list.
* @return The node representing the TypeBound list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getTypeBoundList() {
List<Access> list = (List<Access>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the TypeBound list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeBound list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getTypeBoundListNoTransform() {
return (List<Access>)getChildNoTransform(2);
}
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1472
*/
public String typeName() {
ASTNode$State state = state();
try {
if(getNumTypeBound() == 0)
return "<NOTYPE>";
StringBuffer s = new StringBuffer();
s.append(getTypeBound(0).type().typeName());
for(int i = 1; i < getNumTypeBound(); i++)
s.append(" & " + getTypeBound(i).type().typeName());
return s.toString();
}
finally {
}
}
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:347
*/
public boolean supertypeLUBType(LUBType type) {
ASTNode$State state = state();
try {
ArrayList bounds = new ArrayList(getNumTypeBound());
for (int i = 0; i < getNumTypeBound(); i++) {
bounds.add(getTypeBound(i));
}
return type == lookupLUBType(bounds);
}
finally {
}
}
protected java.util.Map subtype_TypeDecl_values;
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:365
*/
@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.supertypeGLBType(this); }
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:366
*/
public boolean supertypeGLBType(GLBType type) {
ASTNode$State state = state();
try { return this == type; }
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:423
*/
@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();
}
}
| 17,647
| 27.464516
| 255
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/GLBTypeFactory.java
|
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;
/**
* @ast class
*
*/
public class GLBTypeFactory extends java.lang.Object {
// TODO add support for array types.
public static TypeDecl glb(final ArrayList typeList) {
TypeDecl retType = ((TypeDecl) typeList.get(0)).unknownType();
TypeDecl cls = mostSpecificSuperClass(typeList);
if (cls != null) {
ArrayList intersectInterfaceList = new ArrayList();
ArrayList allInterfaceList = new ArrayList();
for (Iterator itera = typeList.iterator(); itera.hasNext();) {
TypeDecl typeDecl = (TypeDecl) itera.next();
addInterfaces(intersectInterfaceList, allInterfaceList, typeDecl);
}
// remove all interfaces that are not most specific.
greatestLowerBounds(intersectInterfaceList);
// check for interface compatibility.
if (checkInterfaceCompatibility(allInterfaceList)
&& checkClassInterfaceCompatibility(cls, intersectInterfaceList)) {
greatestLowerBounds(typeList);
if(typeList.size() == 1) {
retType = (TypeDecl)typeList.iterator().next();
}
else {
retType = retType.lookupGLBType(typeList);
}
}
}
return retType;
}
/**
* @param intersectInterfaceList
* @param allInterfaceList
* @param typeDecl
*/
private static void addInterfaces(ArrayList intersectInterfaceList, ArrayList allInterfaceList, TypeDecl typeDecl) {
if(typeDecl.isInterfaceDecl()) {
intersectInterfaceList.add((InterfaceDecl)typeDecl);
allInterfaceList.add((InterfaceDecl)typeDecl);
}
else if (typeDecl instanceof TypeVariable) {
TypeVariable varTD = (TypeVariable)typeDecl;
// add the interfaces created for type variables to
// interface list to be checked for compatibility
intersectInterfaceList.add(varTD.toInterface());
// add the bounds of the type variable that are interfaces.
allInterfaceList.addAll(varTD.implementedInterfaces());
}
else if (typeDecl instanceof LUBType) {
allInterfaceList.addAll(typeDecl.implementedInterfaces());
}
else if (typeDecl instanceof GLBType) {
allInterfaceList.addAll(typeDecl.implementedInterfaces());
}
}
/**
* See JLS section 4.9 about Intersection Types
* <p>
* For each <i>T<sub>i</sub></i>, 1 ≤ i ≤ n, let <i>C<sub>i</sub></i>
* be the most specific class or array type such that <i>T<sub>i</sub></i>
* <: <i>C<sub>i</sub></i> Then there must be some <i>T<sub>k</sub></i>
* <: <i>C<sub>k</sub></i> such that <i>C<sub>k</sub></i> <:
* <i>C<sub>i</sub></i> for any <i>i</i>, 1 ≤ i ≤ n, or a
* compile-time error occurs.
*
* @param types
* @return the most specific class that all elements in <i>types</i> are a
* subtype of. Or null if no such class exists.
*/
public final static TypeDecl mostSpecificSuperClass(final ArrayList types) {
ArrayList csList = new ArrayList();
for(Iterator iter = types.iterator(); iter.hasNext(); ) {
csList.add(mostSpecificSuperClass((TypeDecl)iter.next()));
}
// find Tk with Ck
greatestLowerBounds(csList);
if(csList.size() == 1) {
// OK
return (TypeDecl) csList.get(0);
}
else {
// Ck does not exist.
return null;
}
}
/**
* Return most specific superclass of t.
*
* @param t
* @return most specific superclass of t
*/
private final static TypeDecl mostSpecificSuperClass(final TypeDecl t) {
HashSet superTypes = new HashSet();
addSuperClasses(t, superTypes);
if (superTypes.isEmpty())
return t.typeObject();
ArrayList result = new ArrayList(superTypes.size());
result.addAll(superTypes);
greatestLowerBounds(result);
if (result.size() == 1)
return (TypeDecl) result.get(0);
else
return (TypeDecl) t.typeObject();
}
/**
* Add the superclasses (<i>C<sub>i</sub></i>) of <i>t</i> to the set
* <i>result</i>.
* <ul>
* <li>If <i>t</i> is a class, then <i>C<sub>i</sub></i> is t itself.</li>
* <li>If <i>t</i> is a type variable, then <i>C<sub>i</sub></i> is the
* first class encountered in it bounds</li>
* <li>It <i>t</i> is an intersection type, then <i>C<sub>i</sub></i>
* is class that is a member of the intersection, otherwise it's Object</li>
* </ul>
*
* @param t
* @param result
*/
private static final void addSuperClasses(final TypeDecl t, final HashSet result) {
if (t == null)
return;
// class
if (t.isClassDecl() && !result.contains(t)) {
result.add((ClassDecl) t);
}
// type variable, probably called from from 1st if case.
else if (t.isTypeVariable()) {
TypeVariable var = (TypeVariable) t;
for (int i = 0; i < var.getNumTypeBound(); i++)
addSuperClasses(var.getTypeBound(i).type(), result);
}
// intersection type
else if (t instanceof LUBType || t instanceof GLBType) {
result.add(t);
}
// interface
else if (t.isInterfaceDecl())
result.add((ClassDecl) t.typeObject());
}
/**
* @param ifaceList
*/
private static boolean checkInterfaceCompatibility(ArrayList ifaceList) {
for (int i = 0; i < ifaceList.size(); i++) {
HashSet superISet_i = Constraints
.parameterizedSupertypes((TypeDecl) ifaceList.get(i));
for (Iterator iter1 = superISet_i.iterator(); iter1.hasNext();) {
InterfaceDecl superIface_i = (InterfaceDecl) iter1.next();
if (superIface_i instanceof ParInterfaceDecl) {
ParInterfaceDecl pi = (ParInterfaceDecl) superIface_i;
for (int j = i + 1; j < ifaceList.size(); j++) {
HashSet superISet_j = Constraints
.parameterizedSupertypes((TypeDecl) ifaceList
.get(j));
for (Iterator iter2 = superISet_j.iterator(); iter2
.hasNext();) {
InterfaceDecl superIface_j = (InterfaceDecl) iter2
.next();
if (superIface_j instanceof ParInterfaceDecl) {
ParInterfaceDecl pj = (ParInterfaceDecl) superIface_j;
if (pi != pj
&& pi.genericDecl() == pj.genericDecl()
&& !pi.sameArgument(pj)) {
return false;
}
}
}
}
}
}
}
return true;
}
/**
* @param t
* @param cls
* @param ifaceList
*/
private static boolean checkClassInterfaceCompatibility(TypeDecl cls,
ArrayList ifaceList) {
HashSet implementedInterfaces = cls.implementedInterfaces();
for (Iterator iter1 = implementedInterfaces.iterator(); iter1.hasNext();) {
InterfaceDecl impInterface = (InterfaceDecl) iter1.next();
if (impInterface instanceof ParInterfaceDecl) {
ParInterfaceDecl impParIface = (ParInterfaceDecl) impInterface;
for (Iterator iter2 = ifaceList.iterator(); iter2.hasNext();) {
InterfaceDecl iface = (InterfaceDecl) iter2.next();
if (iface instanceof ParInterfaceDecl) {
ParInterfaceDecl parIface = (ParInterfaceDecl) iface;
if (parIface != impParIface
&& parIface.genericDecl() == impParIface
.genericDecl()
&& !parIface.sameArgument(impParIface)) {
return false;
}
}
}
}
}
return true;
}
/**
* Find the greatest lower bound(s).
*
* @param types
*/
public static final void greatestLowerBounds(ArrayList types) {
for (int i = 0; i < types.size(); i++) {
TypeDecl U = (TypeDecl) types.get(i);
for (int j = i + 1; j < types.size(); j++) {
TypeDecl V = (TypeDecl) types.get(j);
if (U == null || V == null)
continue;
if (U.instanceOf(V))
types.set(j, null);
else if (V.instanceOf(U))
types.set(i, null);
}
}
// filter null's
removeNullValues(types);
}
/**
* Remove null values from the given list
*
* @param types
*/
public static final void removeNullValues(ArrayList types) {
ArrayList filter = new ArrayList(1);
filter.add(null);
types.removeAll(filter);
}
}
| 10,911
| 36.242321
| 124
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/GTExpr.java
|
/* 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 GTExpr : {@link RelationalExpr};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:177
*/
public class GTExpr extends RelationalExpr implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GTExpr clone() throws CloneNotSupportedException {
GTExpr node = (GTExpr)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GTExpr copy() {
try {
GTExpr node = (GTExpr) 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 GTExpr fullCopy() {
GTExpr tree = (GTExpr) 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 BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:291
*/
public soot.Value comparison(Body b, soot.Value left, soot.Value right) {
return b.newGtExpr(asImmediate(b, left), asImmediate(b, right), this);
}
/**
* @ast method
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:313
*/
public soot.Value comparisonInv(Body b, soot.Value left, soot.Value right) {
return b.newLeExpr(asImmediate(b, left), asImmediate(b, right), this);
}
/**
* @ast method
*
*/
public GTExpr() {
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 GTExpr(Expr 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 LeftOperand child.
* @param node The new node to replace the LeftOperand child.
* @apilevel high-level
* @ast method
*
*/
public void setLeftOperand(Expr node) {
setChild(node, 0);
}
/**
* Retrieves the LeftOperand child.
* @return The current node used as the LeftOperand child.
* @apilevel high-level
* @ast method
*
*/
public Expr getLeftOperand() {
return (Expr)getChild(0);
}
/**
* Retrieves the LeftOperand child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the LeftOperand child.
* @apilevel low-level
* @ast method
*
*/
public Expr getLeftOperandNoTransform() {
return (Expr)getChildNoTransform(0);
}
/**
* Replaces the RightOperand child.
* @param node The new node to replace the RightOperand child.
* @apilevel high-level
* @ast method
*
*/
public void setRightOperand(Expr node) {
setChild(node, 1);
}
/**
* Retrieves the RightOperand child.
* @return The current node used as the RightOperand child.
* @apilevel high-level
* @ast method
*
*/
public Expr getRightOperand() {
return (Expr)getChild(1);
}
/**
* Retrieves the RightOperand child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the RightOperand child.
* @apilevel low-level
* @ast method
*
*/
public Expr getRightOperandNoTransform() {
return (Expr)getChildNoTransform(1);
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:91
*/
public Constant constant() {
ASTNode$State state = state();
try { return Constant.create(!binaryNumericPromotedType().leIsTrue(left(), right())); }
finally {
}
}
/**
* @attribute syn
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:400
*/
public String printOp() {
ASTNode$State state = state();
try { return " > "; }
finally {
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 5,900
| 24.004237
| 120
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/GenericClassDecl.java
|
/* 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 GenericClassDecl : {@link ClassDecl} ::= <span class="component">{@link Modifiers}</span> <span class="component"><ID:String></span> <span class="component">[SuperClassAccess:{@link Access}]</span> <span class="component">Implements:{@link Access}*</span> <span class="component">{@link BodyDecl}*</span> <span class="component">TypeParameter:{@link TypeVariable}*</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.ast:2
*/
public class GenericClassDecl extends ClassDecl implements Cloneable, GenericTypeDecl {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
rawType_computed = false;
rawType_value = null;
lookupParTypeDecl_ArrayList_values = null;
lookupParTypeDecl_ArrayList_list = null; usesTypeVariable_visited = -1;
usesTypeVariable_computed = false;
usesTypeVariable_initialized = false;
subtype_TypeDecl_values = null;
instanceOf_TypeDecl_values = null;
getPlaceholderMethodList_computed = false;
getPlaceholderMethodList_value = null;
lookupParTypeDecl_ParTypeAccess_values = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GenericClassDecl clone() throws CloneNotSupportedException {
GenericClassDecl node = (GenericClassDecl)super.clone();
node.rawType_computed = false;
node.rawType_value = null;
node.lookupParTypeDecl_ArrayList_values = null;
node.lookupParTypeDecl_ArrayList_list = null; node.usesTypeVariable_visited = -1;
node.usesTypeVariable_computed = false;
node.usesTypeVariable_initialized = false;
node.subtype_TypeDecl_values = null;
node.instanceOf_TypeDecl_values = null;
node.getPlaceholderMethodList_computed = false;
node.getPlaceholderMethodList_value = null;
node.lookupParTypeDecl_ParTypeAccess_values = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GenericClassDecl copy() {
try {
GenericClassDecl node = (GenericClassDecl) 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 GenericClassDecl fullCopy() {
GenericClassDecl tree = (GenericClassDecl) 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 GenericsTypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:425
*/
public void typeCheck() {
super.typeCheck();
if(instanceOf(typeThrowable()))
error(" generic class " + typeName() + " may not directly or indirectly inherit java.lang.Throwable");
}
/**
* @ast method
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1324
*/
public ClassDecl substitutedClassDecl(Parameterization parTypeDecl) {
GenericClassDecl c = new GenericClassDeclSubstituted(
(Modifiers)getModifiers().fullCopy(),
getID(),
hasSuperClassAccess() ? new Opt(getSuperClassAccess().type().substitute(parTypeDecl)) : new Opt(),
getImplementsList().substitute(parTypeDecl),
// ES: new List(),
new List(), // delegates TypeParameter lookup to original
this
);
return c;
}
/**
* @ast method
* @aspect GenericsPrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsPrettyPrint.jrag:61
*/
private void ppTypeParameters(StringBuffer s) {
s.append('<');
if (getNumTypeParameter() > 0) {
getTypeParameter(0).toString(s);
for (int i = 1; i < getNumTypeParameter(); i++) {
s.append(", ");
getTypeParameter(i).toString(s);
}
}
s.append('>');
}
/**
* @ast method
* @aspect GenericsPrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsPrettyPrint.jrag:73
*/
public void toString(StringBuffer s) {
getModifiers().toString(s);
s.append("class " + getID());
ppTypeParameters(s);
if(hasSuperClassAccess()) {
s.append(" extends ");
getSuperClassAccess().toString(s);
}
if(getNumImplements() > 0) {
s.append(" implements ");
getImplements(0).toString(s);
for(int i = 1; i < getNumImplements(); i++) {
s.append(", ");
getImplements(i).toString(s);
}
}
/*
s.append(" instantiated with: ");
for(int i = 0; i < getNumParTypeDecl(); i++) {
if(i != 0) s.append(", ");
ParTypeDecl decl = getParTypeDecl(i);
s.append("<");
for(int j = 0; j < decl.getNumArgument(); j++) {
if(j != 0) s.append(", ");
s.append(decl.getArgument(j).type().fullName());
}
s.append(">");
}
*/
ppBodyDecls(s);
/*
for(int i = 0; i < getNumParTypeDecl(); i++) {
ParClassDecl decl = getParTypeDecl(i);
decl.toString(s);
}
*/
}
/**
* @ast method
* @aspect Generics
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:235
*/
public TypeDecl makeGeneric(Signatures.ClassSignature s) {
return (TypeDecl)this;
}
/**
* @ast method
* @aspect GenericsNameBinding
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:489
*/
public SimpleSet addTypeVariables(SimpleSet c, String name) {
GenericTypeDecl original = (GenericTypeDecl)original();
for(int i = 0; i < original.getNumTypeParameter(); i++) {
TypeVariable p = original.getTypeParameter(i);
if(p.name().equals(name))
c = c.add(p);
}
return c;
}
/**
* @ast method
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:799
*/
public List createArgumentList(ArrayList params) {
GenericTypeDecl original = (GenericTypeDecl)original();
List list = new List();
if(params.isEmpty()) {
// Change: Don't add any thing to the list.
// Concern: The previous version seem to add the erasure of the type variable for some reason,
// maybe this is how the raw type is represented (?), but this doesn't really comply with the
// claim that raw types don't have any type variables...?
for(int i = 0; i < original.getNumTypeParameter(); i++)
list.add(original.getTypeParameter(i).erasure().createBoundAccess());
} else
for(Iterator iter = params.iterator(); iter.hasNext(); )
list.add(((TypeDecl)iter.next()).createBoundAccess());
return list;
}
/**
* @ast method
*
*/
public GenericClassDecl() {
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[5];
setChild(new Opt(), 1);
setChild(new List(), 2);
setChild(new List(), 3);
setChild(new List(), 4);
}
/**
* @ast method
*
*/
public GenericClassDecl(Modifiers p0, String p1, Opt<Access> p2, List<Access> p3, List<BodyDecl> p4, List<TypeVariable> p5) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setChild(p4, 3);
setChild(p5, 4);
}
/**
* @ast method
*
*/
public GenericClassDecl(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<Access> p3, List<BodyDecl> p4, List<TypeVariable> p5) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setChild(p4, 3);
setChild(p5, 4);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 5;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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 optional node for the SuperClassAccess child. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* @param opt The new node to be used as the optional node for the SuperClassAccess child.
* @apilevel low-level
* @ast method
*
*/
public void setSuperClassAccessOpt(Opt<Access> opt) {
setChild(opt, 1);
}
/**
* Check whether the optional SuperClassAccess child exists.
* @return {@code true} if the optional SuperClassAccess child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasSuperClassAccess() {
return getSuperClassAccessOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) SuperClassAccess child.
* @return The SuperClassAccess child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getSuperClassAccess() {
return (Access)getSuperClassAccessOpt().getChild(0);
}
/**
* Replaces the (optional) SuperClassAccess child.
* @param node The new node to be used as the SuperClassAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setSuperClassAccess(Access node) {
getSuperClassAccessOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOpt() {
return (Opt<Access>)getChild(1);
}
/**
* Retrieves the optional node for child SuperClassAccess. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child SuperClassAccess.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOptNoTransform() {
return (Opt<Access>)getChildNoTransform(1);
}
/**
* Replaces the Implements list.
* @param list The new list node to be used as the Implements list.
* @apilevel high-level
* @ast method
*
*/
public void setImplementsList(List<Access> list) {
setChild(list, 2);
}
/**
* Retrieves the number of children in the Implements list.
* @return Number of children in the Implements list.
* @apilevel high-level
* @ast method
*
*/
public int getNumImplements() {
return getImplementsList().getNumChild();
}
/**
* Retrieves the number of children in the Implements list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Implements list.
* @apilevel low-level
* @ast method
*
*/
public int getNumImplementsNoTransform() {
return getImplementsListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Implements list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Implements list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getImplements(int i) {
return (Access)getImplementsList().getChild(i);
}
/**
* Append an element to the Implements list.
* @param node The element to append to the Implements list.
* @apilevel high-level
* @ast method
*
*/
public void addImplements(Access node) {
List<Access> list = (parent == null || state == null) ? getImplementsListNoTransform() : getImplementsList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addImplementsNoTransform(Access node) {
List<Access> list = getImplementsListNoTransform();
list.addChild(node);
}
/**
* Replaces the Implements 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 setImplements(Access node, int i) {
List<Access> list = getImplementsList();
list.setChild(node, i);
}
/**
* Retrieves the Implements list.
* @return The node representing the Implements list.
* @apilevel high-level
* @ast method
*
*/
public List<Access> getImplementss() {
return getImplementsList();
}
/**
* Retrieves the Implements list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Implements list.
* @apilevel low-level
* @ast method
*
*/
public List<Access> getImplementssNoTransform() {
return getImplementsListNoTransform();
}
/**
* Retrieves the Implements list.
* @return The node representing the Implements list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getImplementsList() {
List<Access> list = (List<Access>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the Implements list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Implements list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getImplementsListNoTransform() {
return (List<Access>)getChildNoTransform(2);
}
/**
* 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<BodyDecl> list) {
setChild(list, 3);
}
/**
* 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<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addBodyDeclNoTransform(BodyDecl node) {
List<BodyDecl> 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<BodyDecl> list = getBodyDeclList();
list.setChild(node, i);
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<BodyDecl> getBodyDecls() {
return getBodyDeclList();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclsNoTransform() {
return getBodyDeclListNoTransform();
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclList() {
List<BodyDecl> list = (List<BodyDecl>)getChild(3);
list.getNumChild();
return list;
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclListNoTransform() {
return (List<BodyDecl>)getChildNoTransform(3);
}
/**
* Replaces the TypeParameter list.
* @param list The new list node to be used as the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public void setTypeParameterList(List<TypeVariable> list) {
setChild(list, 4);
}
/**
* Retrieves the number of children in the TypeParameter list.
* @return Number of children in the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public int getNumTypeParameter() {
return getTypeParameterList().getNumChild();
}
/**
* Retrieves the number of children in the TypeParameter list.
* Calling this method will not trigger rewrites..
* @return Number of children in the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
public int getNumTypeParameterNoTransform() {
return getTypeParameterListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the TypeParameter list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeVariable getTypeParameter(int i) {
return (TypeVariable)getTypeParameterList().getChild(i);
}
/**
* Append an element to the TypeParameter list.
* @param node The element to append to the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public void addTypeParameter(TypeVariable node) {
List<TypeVariable> list = (parent == null || state == null) ? getTypeParameterListNoTransform() : getTypeParameterList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addTypeParameterNoTransform(TypeVariable node) {
List<TypeVariable> list = getTypeParameterListNoTransform();
list.addChild(node);
}
/**
* Replaces the TypeParameter 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 setTypeParameter(TypeVariable node, int i) {
List<TypeVariable> list = getTypeParameterList();
list.setChild(node, i);
}
/**
* Retrieves the TypeParameter list.
* @return The node representing the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public List<TypeVariable> getTypeParameters() {
return getTypeParameterList();
}
/**
* Retrieves the TypeParameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
public List<TypeVariable> getTypeParametersNoTransform() {
return getTypeParameterListNoTransform();
}
/**
* Retrieves the TypeParameter list.
* @return The node representing the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<TypeVariable> getTypeParameterList() {
List<TypeVariable> list = (List<TypeVariable>)getChild(4);
list.getNumChild();
return list;
}
/**
* Retrieves the TypeParameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<TypeVariable> getTypeParameterListNoTransform() {
return (List<TypeVariable>)getChildNoTransform(4);
}
/**
* @apilevel internal
*/
protected boolean rawType_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl rawType_value;
/**
* @attribute syn
* @aspect Generics
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:176
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl rawType() {
if(rawType_computed) {
return rawType_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
rawType_value = rawType_compute();
if(isFinal && num == state().boundariesCrossed) rawType_computed = true;
return rawType_value;
}
/**
* @apilevel internal
*/
private TypeDecl rawType_compute() { return lookupParTypeDecl(new ArrayList()); }
/**
* @apilevel internal
*/
protected java.util.Map lookupParTypeDecl_ArrayList_values;
/**
* @apilevel internal
*/
protected List lookupParTypeDecl_ArrayList_list;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:715
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl lookupParTypeDecl(ArrayList list) {
Object _parameters = list;
if(lookupParTypeDecl_ArrayList_values == null) lookupParTypeDecl_ArrayList_values = new java.util.HashMap(4);
if(lookupParTypeDecl_ArrayList_values.containsKey(_parameters)) {
return (TypeDecl)lookupParTypeDecl_ArrayList_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
TypeDecl lookupParTypeDecl_ArrayList_value = lookupParTypeDecl_compute(list);
if(lookupParTypeDecl_ArrayList_list == null) {
lookupParTypeDecl_ArrayList_list = new List();
lookupParTypeDecl_ArrayList_list.is$Final = true;
lookupParTypeDecl_ArrayList_list.setParent(this);
}
lookupParTypeDecl_ArrayList_list.add(lookupParTypeDecl_ArrayList_value);
if(lookupParTypeDecl_ArrayList_value != null) {
lookupParTypeDecl_ArrayList_value.is$Final = true;
}
if(true) lookupParTypeDecl_ArrayList_values.put(_parameters, lookupParTypeDecl_ArrayList_value);
return lookupParTypeDecl_ArrayList_value;
}
/**
* @apilevel internal
*/
private TypeDecl lookupParTypeDecl_compute(ArrayList list) {
/*
int size = createParTypeDeclStub_ArrayList_list != null ? createParTypeDeclStub_ArrayList_list.numChildren : 0;
ParClassDecl typeDecl = (ParClassDecl)createParTypeDeclStub(list);
if (size < createParTypeDeclStub_ArrayList_list.numChildren) {
createParTypeDeclBody(list, typeDecl);
}
return typeDecl;
*/
ParClassDecl typeDecl = list.size() == 0 ? new RawClassDecl() : new ParClassDecl();
typeDecl.setModifiers((Modifiers)getModifiers().fullCopy());
typeDecl.setID(getID());
// ES: trying to only so this for ParClassDecl and then later for RawClassDecl
if (!(typeDecl instanceof RawClassDecl))
typeDecl.setArgumentList(createArgumentList(list));
return typeDecl;
}
/**
* @apilevel internal
*/
protected int usesTypeVariable_visited = -1;
/**
* @apilevel internal
*/
protected boolean usesTypeVariable_computed = false;
/**
* @apilevel internal
*/
protected boolean usesTypeVariable_initialized = false;
/**
* @apilevel internal
*/
protected boolean usesTypeVariable_value;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1077
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean usesTypeVariable() {
if(usesTypeVariable_computed) {
return usesTypeVariable_value;
}
ASTNode$State state = state();
if (!usesTypeVariable_initialized) {
usesTypeVariable_initialized = true;
usesTypeVariable_value = false;
}
if (!state.IN_CIRCLE) {
state.IN_CIRCLE = true;
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
do {
usesTypeVariable_visited = state.CIRCLE_INDEX;
state.CHANGE = false;
boolean new_usesTypeVariable_value = usesTypeVariable_compute();
if (new_usesTypeVariable_value!=usesTypeVariable_value)
state.CHANGE = true;
usesTypeVariable_value = new_usesTypeVariable_value;
state.CIRCLE_INDEX++;
} while (state.CHANGE);
if(isFinal && num == state().boundariesCrossed) {
usesTypeVariable_computed = true;
}
else {
state.RESET_CYCLE = true;
usesTypeVariable_compute();
state.RESET_CYCLE = false;
usesTypeVariable_computed = false;
usesTypeVariable_initialized = false;
}
state.IN_CIRCLE = false;
return usesTypeVariable_value;
}
if(usesTypeVariable_visited != state.CIRCLE_INDEX) {
usesTypeVariable_visited = state.CIRCLE_INDEX;
if (state.RESET_CYCLE) {
usesTypeVariable_computed = false;
usesTypeVariable_initialized = false;
usesTypeVariable_visited = -1;
return usesTypeVariable_value;
}
boolean new_usesTypeVariable_value = usesTypeVariable_compute();
if (new_usesTypeVariable_value!=usesTypeVariable_value)
state.CHANGE = true;
usesTypeVariable_value = new_usesTypeVariable_value;
return usesTypeVariable_value;
}
return usesTypeVariable_value;
}
/**
* @apilevel internal
*/
private boolean usesTypeVariable_compute() { return true; }
protected java.util.Map subtype_TypeDecl_values;
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:13
*/
@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.supertypeGenericClassDecl(this); }
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:125
*/
public boolean supertypeParClassDecl(ParClassDecl type) {
ASTNode$State state = state();
try { return type.genericDecl().original().subtype(this); }
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(this); }
finally {
}
}
protected java.util.Map instanceOf_TypeDecl_values;
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:394
*/
@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
*/
protected boolean getPlaceholderMethodList_computed = false;
/**
* @apilevel internal
*/
protected List<PlaceholderMethodDecl> getPlaceholderMethodList_value;
/**
* The placeholder method list for the constructors of this generic
* class.
*
* @return list of placeholder methods
* @attribute syn
* @aspect TypeInference
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/TypeInference.jrag:124
*/
@SuppressWarnings({"unchecked", "cast"})
public List<PlaceholderMethodDecl> getPlaceholderMethodList() {
if(getPlaceholderMethodList_computed) {
return getPlaceholderMethodList_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
getPlaceholderMethodList_value = getPlaceholderMethodList_compute();
getPlaceholderMethodList_value.setParent(this);
getPlaceholderMethodList_value.is$Final = true;
if(true) getPlaceholderMethodList_computed = true;
return getPlaceholderMethodList_value;
}
/**
* @apilevel internal
*/
private List<PlaceholderMethodDecl> getPlaceholderMethodList_compute() {
List<PlaceholderMethodDecl> placeholderMethods =
new List<PlaceholderMethodDecl>();
List<TypeVariable> typeParams = getTypeParameterList();
List<TypeVariable> classTypeVars = new List<TypeVariable>();
List<Access> typeArgs = new List<Access>();
// copy the list of type parameters
int arg = 0;
for (Iterator iter = typeParams.iterator(); iter.hasNext(); ++arg) {
String substName = "#"+arg;
typeArgs.add(new TypeAccess(substName));
TypeVariable typeVar = (TypeVariable) iter.next();
List<Access> typeBounds = new List<Access>();
for (Access typeBound : typeVar.getTypeBoundList())
typeBounds.add((Access) typeBound.cloneSubtree());
classTypeVars.add(
new TypeVariable(
new Modifiers(),
substName,
new List<BodyDecl>(),
typeBounds));
}
ParTypeAccess returnType = new ParTypeAccess(
createQualifiedAccess(),
typeArgs);
for (Iterator iter = constructors().iterator(); iter.hasNext(); ) {
ConstructorDecl decl = (ConstructorDecl)iter.next();
if (decl instanceof ConstructorDeclSubstituted)
decl = ((ConstructorDeclSubstituted) decl).getOriginal();
// filter accessible constructors
if (!decl.accessibleFrom(hostType()))
continue;
Collection<TypeVariable> originalTypeVars =
new LinkedList<TypeVariable>();
List<TypeVariable> typeVars = new List<TypeVariable>();
for (TypeVariable typeVar : typeParams)
originalTypeVars.add(typeVar);
for (TypeVariable typeVar : classTypeVars)
typeVars.add((TypeVariable) typeVar.cloneSubtree());
if (decl instanceof GenericConstructorDecl) {
GenericConstructorDecl genericDecl =
(GenericConstructorDecl) decl;
List<TypeVariable> typeVariables = new List<TypeVariable>();
for (int i = 0; i < genericDecl.getNumTypeParameter(); ++i) {
String substName = "#" + (arg+i);
TypeVariable typeVar = genericDecl.getTypeParameter(i);
originalTypeVars.add(typeVar);
List<Access> typeBounds = new List<Access>();
for (Access typeBound : typeVar.getTypeBoundList())
typeBounds.add((Access) typeBound.cloneSubtree());
typeVars.add(
new TypeVariable(
new Modifiers(),
substName,
new List<BodyDecl>(),
typeBounds));
}
}
List<ParameterDeclaration> substParameters =
new List<ParameterDeclaration>();
for (ParameterDeclaration param : decl.getParameterList()) {
substParameters.add(param.substituted(
originalTypeVars, typeVars));
}
List<Access> substExceptions = new List<Access>();
for (Access exception : decl.getExceptionList()) {
substExceptions.add(exception.substituted(
originalTypeVars, typeVars));
}
PlaceholderMethodDecl placeholderMethod =
new PlaceholderMethodDecl(
(Modifiers) decl.getModifiers().cloneSubtree(),
(Access) returnType.cloneSubtree(),
"#"+getID(),
substParameters,
substExceptions,
new Opt(new Block()),
typeVars);
placeholderMethods.add(placeholderMethod);
}
return placeholderMethods;
}
/**
* @attribute syn
* @aspect Generics
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:158
*/
public boolean isGenericType() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
protected java.util.Map lookupParTypeDecl_ParTypeAccess_values;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:708
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl lookupParTypeDecl(ParTypeAccess p) {
Object _parameters = p;
if(lookupParTypeDecl_ParTypeAccess_values == null) lookupParTypeDecl_ParTypeAccess_values = new java.util.HashMap(4);
if(lookupParTypeDecl_ParTypeAccess_values.containsKey(_parameters)) {
return (TypeDecl)lookupParTypeDecl_ParTypeAccess_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
TypeDecl lookupParTypeDecl_ParTypeAccess_value = lookupParTypeDecl_compute(p);
if(isFinal && num == state().boundariesCrossed) lookupParTypeDecl_ParTypeAccess_values.put(_parameters, lookupParTypeDecl_ParTypeAccess_value);
return lookupParTypeDecl_ParTypeAccess_value;
}
/**
* @apilevel internal
*/
private TypeDecl lookupParTypeDecl_compute(ParTypeAccess p) {
ArrayList typeArguments = new ArrayList();
for(int i = 0; i < p.getNumTypeArgument(); i++)
typeArguments.add(p.getTypeArgument(i).type());
return lookupParTypeDecl(typeArguments);
}
/**
* @attribute inh
* @aspect GenericsTypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:435
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl typeThrowable() {
ASTNode$State state = state();
TypeDecl typeThrowable_value = getParent().Define_TypeDecl_typeThrowable(this, null);
return typeThrowable_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:481
* @apilevel internal
*/
public boolean Define_boolean_isNestedType(ASTNode caller, ASTNode child) {
if(caller == getTypeParameterListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return true;
}
else { return super.Define_boolean_isNestedType(caller, child);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:482
* @apilevel internal
*/
public TypeDecl Define_TypeDecl_enclosingType(ASTNode caller, ASTNode child) {
if(caller == getTypeParameterListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return this;
}
else { return super.Define_TypeDecl_enclosingType(caller, child);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:531
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_lookupType(ASTNode caller, ASTNode child, String name) {
if(caller == getBodyDeclListNoTransform()) {
int index = caller.getIndexOfChild(child);
{
SimpleSet c = memberTypes(name);
if(getBodyDecl(index).visibleTypeParameters())
c = addTypeVariables(c, name);
if(!c.isEmpty())
return c;
// 8.5.2
if(isClassDecl() && isStatic() && !isTopLevelType()) {
for(Iterator iter = lookupType(name).iterator(); iter.hasNext(); ) {
TypeDecl d = (TypeDecl)iter.next();
if(d.isStatic() || (d.enclosingType() != null && instanceOf(d.enclosingType()))) {
c = c.add(d);
}
}
}
else
c = lookupType(name);
if(!c.isEmpty())
return c;
return topLevelType().lookupType(name); // Fix to search imports
// include type parameters if not static
}
}
else if(caller == getTypeParameterListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
{
SimpleSet c = memberTypes(name);
c = addTypeVariables(c, name);
if(!c.isEmpty()) return c;
// 8.5.2
if(isClassDecl() && isStatic() && !isTopLevelType()) {
for(Iterator iter = lookupType(name).iterator(); iter.hasNext(); ) {
TypeDecl d = (TypeDecl)iter.next();
if(d.isStatic() || (d.enclosingType() != null && instanceOf(d.enclosingType()))) {
c = c.add(d);
}
}
}
else
c = lookupType(name);
if(!c.isEmpty())
return c;
return topLevelType().lookupType(name); // Fix to search imports
}
}
else if(caller == getImplementsListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
{
SimpleSet c = addTypeVariables(SimpleSet.emptySet, name);
return !c.isEmpty() ? c : lookupType(name);
}
}
else if(caller == getSuperClassAccessOptNoTransform()){
SimpleSet c = addTypeVariables(SimpleSet.emptySet, name);
return !c.isEmpty() ? c : lookupType(name);
}
else { return super.Define_SimpleSet_lookupType(caller, child, name);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsParTypeDecl.jrag:50
* @apilevel internal
*/
public TypeDecl Define_TypeDecl_genericDecl(ASTNode caller, ASTNode child) {
{
int childIndex = this.getIndexOfChild(caller);
return this;
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 43,486
| 31.022828
| 393
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/GenericClassDeclSubstituted.java
|
/* 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 GenericClassDeclSubstituted : {@link GenericClassDecl} ::= <span class="component"><Original:TypeDecl></span> <span class="component">{@link BodyDecl}*</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.ast:43
*/
public class GenericClassDeclSubstituted extends GenericClassDecl implements Cloneable, MemberSubstitutor {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
getBodyDeclList_computed = false;
getBodyDeclList_value = null;
sourceTypeDecl_computed = false;
sourceTypeDecl_value = null;
instanceOf_TypeDecl_values = null;
subtype_TypeDecl_values = null;
localMethodsSignatureMap_computed = false;
localMethodsSignatureMap_value = null;
localFields_String_values = null;
localTypeDecls_String_values = null;
constructors_computed = false;
constructors_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GenericClassDeclSubstituted clone() throws CloneNotSupportedException {
GenericClassDeclSubstituted node = (GenericClassDeclSubstituted)super.clone();
node.getBodyDeclList_computed = false;
node.getBodyDeclList_value = null;
node.sourceTypeDecl_computed = false;
node.sourceTypeDecl_value = null;
node.instanceOf_TypeDecl_values = null;
node.subtype_TypeDecl_values = null;
node.localMethodsSignatureMap_computed = false;
node.localMethodsSignatureMap_value = null;
node.localFields_String_values = null;
node.localTypeDecls_String_values = null;
node.constructors_computed = false;
node.constructors_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GenericClassDeclSubstituted copy() {
try {
GenericClassDeclSubstituted node = (GenericClassDeclSubstituted) 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 GenericClassDeclSubstituted fullCopy() {
GenericClassDeclSubstituted tree = (GenericClassDeclSubstituted) copy();
if (children != null) {
for (int i = 0; i < children.length; ++i) {
switch (i) {
case 6:
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
*
*/
public GenericClassDeclSubstituted() {
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[5];
setChild(new Opt(), 1);
setChild(new List(), 2);
setChild(new List(), 3);
setChild(new List(), 4);
}
/**
* @ast method
*
*/
public GenericClassDeclSubstituted(Modifiers p0, String p1, Opt<Access> p2, List<Access> p3, List<TypeVariable> p4, TypeDecl p5) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setChild(p4, 3);
setOriginal(p5);
}
/**
* @ast method
*
*/
public GenericClassDeclSubstituted(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<Access> p3, List<TypeVariable> p4, TypeDecl p5) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setChild(p4, 3);
setOriginal(p5);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 4;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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 optional node for the SuperClassAccess child. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* @param opt The new node to be used as the optional node for the SuperClassAccess child.
* @apilevel low-level
* @ast method
*
*/
public void setSuperClassAccessOpt(Opt<Access> opt) {
setChild(opt, 1);
}
/**
* Check whether the optional SuperClassAccess child exists.
* @return {@code true} if the optional SuperClassAccess child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasSuperClassAccess() {
return getSuperClassAccessOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) SuperClassAccess child.
* @return The SuperClassAccess child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getSuperClassAccess() {
return (Access)getSuperClassAccessOpt().getChild(0);
}
/**
* Replaces the (optional) SuperClassAccess child.
* @param node The new node to be used as the SuperClassAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setSuperClassAccess(Access node) {
getSuperClassAccessOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOpt() {
return (Opt<Access>)getChild(1);
}
/**
* Retrieves the optional node for child SuperClassAccess. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child SuperClassAccess.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOptNoTransform() {
return (Opt<Access>)getChildNoTransform(1);
}
/**
* Replaces the Implements list.
* @param list The new list node to be used as the Implements list.
* @apilevel high-level
* @ast method
*
*/
public void setImplementsList(List<Access> list) {
setChild(list, 2);
}
/**
* Retrieves the number of children in the Implements list.
* @return Number of children in the Implements list.
* @apilevel high-level
* @ast method
*
*/
public int getNumImplements() {
return getImplementsList().getNumChild();
}
/**
* Retrieves the number of children in the Implements list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Implements list.
* @apilevel low-level
* @ast method
*
*/
public int getNumImplementsNoTransform() {
return getImplementsListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Implements list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Implements list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getImplements(int i) {
return (Access)getImplementsList().getChild(i);
}
/**
* Append an element to the Implements list.
* @param node The element to append to the Implements list.
* @apilevel high-level
* @ast method
*
*/
public void addImplements(Access node) {
List<Access> list = (parent == null || state == null) ? getImplementsListNoTransform() : getImplementsList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addImplementsNoTransform(Access node) {
List<Access> list = getImplementsListNoTransform();
list.addChild(node);
}
/**
* Replaces the Implements 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 setImplements(Access node, int i) {
List<Access> list = getImplementsList();
list.setChild(node, i);
}
/**
* Retrieves the Implements list.
* @return The node representing the Implements list.
* @apilevel high-level
* @ast method
*
*/
public List<Access> getImplementss() {
return getImplementsList();
}
/**
* Retrieves the Implements list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Implements list.
* @apilevel low-level
* @ast method
*
*/
public List<Access> getImplementssNoTransform() {
return getImplementsListNoTransform();
}
/**
* Retrieves the Implements list.
* @return The node representing the Implements list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getImplementsList() {
List<Access> list = (List<Access>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the Implements list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Implements list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getImplementsListNoTransform() {
return (List<Access>)getChildNoTransform(2);
}
/**
* Replaces the TypeParameter list.
* @param list The new list node to be used as the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public void setTypeParameterList(List<TypeVariable> list) {
setChild(list, 3);
}
/**
* Retrieves the number of children in the TypeParameter list.
* @return Number of children in the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public int getNumTypeParameter() {
return getTypeParameterList().getNumChild();
}
/**
* Retrieves the number of children in the TypeParameter list.
* Calling this method will not trigger rewrites..
* @return Number of children in the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
public int getNumTypeParameterNoTransform() {
return getTypeParameterListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the TypeParameter list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeVariable getTypeParameter(int i) {
return (TypeVariable)getTypeParameterList().getChild(i);
}
/**
* Append an element to the TypeParameter list.
* @param node The element to append to the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public void addTypeParameter(TypeVariable node) {
List<TypeVariable> list = (parent == null || state == null) ? getTypeParameterListNoTransform() : getTypeParameterList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addTypeParameterNoTransform(TypeVariable node) {
List<TypeVariable> list = getTypeParameterListNoTransform();
list.addChild(node);
}
/**
* Replaces the TypeParameter 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 setTypeParameter(TypeVariable node, int i) {
List<TypeVariable> list = getTypeParameterList();
list.setChild(node, i);
}
/**
* Retrieves the TypeParameter list.
* @return The node representing the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public List<TypeVariable> getTypeParameters() {
return getTypeParameterList();
}
/**
* Retrieves the TypeParameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
public List<TypeVariable> getTypeParametersNoTransform() {
return getTypeParameterListNoTransform();
}
/**
* Retrieves the TypeParameter list.
* @return The node representing the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<TypeVariable> getTypeParameterList() {
List<TypeVariable> list = (List<TypeVariable>)getChild(3);
list.getNumChild();
return list;
}
/**
* Retrieves the TypeParameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<TypeVariable> getTypeParameterListNoTransform() {
return (List<TypeVariable>)getChildNoTransform(3);
}
/**
* Replaces the lexeme Original.
* @param value The new value for the lexeme Original.
* @apilevel high-level
* @ast method
*
*/
public void setOriginal(TypeDecl value) {
tokenTypeDecl_Original = value;
}
/**
* @apilevel internal
* @ast method
*
*/
/**
* @apilevel internal
*/
protected TypeDecl tokenTypeDecl_Original;
/**
* Retrieves the value for the lexeme Original.
* @return The value for the lexeme Original.
* @apilevel high-level
* @ast method
*
*/
public TypeDecl getOriginal() {
return tokenTypeDecl_Original;
}
/**
* 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<BodyDecl> list) {
setChild(list, 4);
}
/**
* 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<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addBodyDeclNoTransform(BodyDecl node) {
List<BodyDecl> 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<BodyDecl> list = getBodyDeclList();
list.setChild(node, i);
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<BodyDecl> getBodyDecls() {
return getBodyDeclList();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclsNoTransform() {
return getBodyDeclListNoTransform();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclListNoTransform() {
return (List<BodyDecl>)getChildNoTransform(4);
}
/**
* 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 4;
}
/**
* @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 getOriginal(); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean getBodyDeclList_computed = false;
/**
* @apilevel internal
*/
protected List getBodyDeclList_value;
/**
* @attribute syn nta
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1052
*/
@SuppressWarnings({"unchecked", "cast"})
public List getBodyDeclList() {
if(getBodyDeclList_computed) {
return (List) getChild(getBodyDeclListChildPosition());
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
getBodyDeclList_value = getBodyDeclList_compute();
setBodyDeclList(getBodyDeclList_value);
if(isFinal && num == state().boundariesCrossed) getBodyDeclList_computed = true;
return (List) getChild(getBodyDeclListChildPosition());
}
/**
* @apilevel internal
*/
private List getBodyDeclList_compute() { return new BodyDeclList(); }
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1306
*/
public TypeDecl original() {
ASTNode$State state = state();
try { return getOriginal().original(); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean sourceTypeDecl_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl sourceTypeDecl_value;
/**
* @attribute syn
* @aspect SourceDeclarations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1508
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl sourceTypeDecl() {
if(sourceTypeDecl_computed) {
return sourceTypeDecl_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
sourceTypeDecl_value = sourceTypeDecl_compute();
if(isFinal && num == state().boundariesCrossed) sourceTypeDecl_computed = true;
return sourceTypeDecl_value;
}
/**
* @apilevel internal
*/
private TypeDecl sourceTypeDecl_compute() { return original().sourceTypeDecl(); }
protected java.util.Map instanceOf_TypeDecl_values;
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:488
*/
@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); }
protected java.util.Map subtype_TypeDecl_values;
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:511
*/
@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.supertypeGenericClassDeclSubstituted(this); }
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:513
*/
public boolean supertypeGenericClassDeclSubstituted(GenericClassDeclSubstituted type) {
ASTNode$State state = state();
try { return original() == type.original() && type.enclosingType().subtype(enclosingType()) || super.supertypeGenericClassDeclSubstituted(type); }
finally {
}
}
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:14
*/
public boolean supertypeGenericClassDecl(GenericClassDecl type) {
ASTNode$State state = state();
try { return super.supertypeGenericClassDecl(type) || original().supertypeGenericClassDecl(type); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean localMethodsSignatureMap_computed = false;
/**
* @apilevel internal
*/
protected HashMap localMethodsSignatureMap_value;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1084
*/
@SuppressWarnings({"unchecked", "cast"})
public HashMap localMethodsSignatureMap() {
if(localMethodsSignatureMap_computed) {
return localMethodsSignatureMap_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
localMethodsSignatureMap_value = localMethodsSignatureMap_compute();
if(true) localMethodsSignatureMap_computed = true;
return localMethodsSignatureMap_value;
}
/**
* @apilevel internal
*/
private HashMap localMethodsSignatureMap_compute() {
HashMap map = new HashMap();
for(Iterator iter = original().localMethodsIterator(); iter.hasNext(); ) {
MethodDecl decl = (MethodDecl)iter.next();
/* ES removing this:
if(!decl.isStatic() && (decl.usesTypeVariable() || isRawType())) {
BodyDecl b = decl.substitutedBodyDecl(this);
addBodyDecl(b);
// Here we should access b through an ordinary
// child accessor instead of setting is$Final directly,
// however doing so appears to cause unexpected behaviour!
b.is$Final = true;
decl = (MethodDecl) b;
}
map.put(decl.signature(), decl);
* and replacing with:
*/
if(!decl.isStatic() && (decl.usesTypeVariable() || isRawType())) {
BodyDecl copyDecl = ((BodyDeclList)getBodyDeclList()).localMethodSignatureCopy(decl, this);
decl = (MethodDecl) copyDecl;
}
map.put(decl.signature(), decl);
}
return map;
}
protected java.util.Map localFields_String_values;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1119
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet localFields(String name) {
Object _parameters = name;
if(localFields_String_values == null) localFields_String_values = new java.util.HashMap(4);
if(localFields_String_values.containsKey(_parameters)) {
return (SimpleSet)localFields_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet localFields_String_value = localFields_compute(name);
if(true) localFields_String_values.put(_parameters, localFields_String_value);
return localFields_String_value;
}
/**
* @apilevel internal
*/
private SimpleSet localFields_compute(String name) {
SimpleSet set = SimpleSet.emptySet;
for(Iterator iter = original().localFields(name).iterator(); iter.hasNext(); ) {
FieldDeclaration f = (FieldDeclaration)iter.next();
/* ES removing this:
if(!f.isStatic() && (f.usesTypeVariable() || isRawType())) {
BodyDecl b = f.substitutedBodyDecl(this);
addBodyDecl(b);
// Here we should access b through an ordinary
// child accessor instead of setting is$Final directly,
// however doing so appears to cause unexpected behaviour!
b.is$Final = true;
f = (FieldDeclaration) b;
}
set = set.add(f);
* and replacing with:
*/
if(!f.isStatic() && (f.usesTypeVariable() || isRawType())) {
BodyDecl fCopy = ((BodyDeclList)getBodyDeclList()).localFieldCopy(f, this);
f = (FieldDeclaration) fCopy;
}
set = set.add(f);
}
return set;
}
protected java.util.Map localTypeDecls_String_values;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1154
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet localTypeDecls(String name) {
Object _parameters = name;
if(localTypeDecls_String_values == null) localTypeDecls_String_values = new java.util.HashMap(4);
ASTNode$State.CircularValue _value;
if(localTypeDecls_String_values.containsKey(_parameters)) {
Object _o = localTypeDecls_String_values.get(_parameters);
if(!(_o instanceof ASTNode$State.CircularValue)) {
return (SimpleSet)_o;
}
else
_value = (ASTNode$State.CircularValue)_o;
}
else {
_value = new ASTNode$State.CircularValue();
localTypeDecls_String_values.put(_parameters, _value);
_value.value = SimpleSet.emptySet;
}
ASTNode$State state = state();
if (!state.IN_CIRCLE) {
state.IN_CIRCLE = true;
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet new_localTypeDecls_String_value;
do {
_value.visited = new Integer(state.CIRCLE_INDEX);
state.CHANGE = false;
new_localTypeDecls_String_value = localTypeDecls_compute(name);
if ((new_localTypeDecls_String_value==null && (SimpleSet)_value.value!=null) || (new_localTypeDecls_String_value!=null && !new_localTypeDecls_String_value.equals((SimpleSet)_value.value))) {
state.CHANGE = true;
_value.value = new_localTypeDecls_String_value;
}
state.CIRCLE_INDEX++;
} while (state.CHANGE);
if(true) {
localTypeDecls_String_values.put(_parameters, new_localTypeDecls_String_value);
}
else {
localTypeDecls_String_values.remove(_parameters);
state.RESET_CYCLE = true;
localTypeDecls_compute(name);
state.RESET_CYCLE = false;
}
state.IN_CIRCLE = false;
return new_localTypeDecls_String_value;
}
if(!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) {
_value.visited = new Integer(state.CIRCLE_INDEX);
SimpleSet new_localTypeDecls_String_value = localTypeDecls_compute(name);
if (state.RESET_CYCLE) {
localTypeDecls_String_values.remove(_parameters);
}
else if ((new_localTypeDecls_String_value==null && (SimpleSet)_value.value!=null) || (new_localTypeDecls_String_value!=null && !new_localTypeDecls_String_value.equals((SimpleSet)_value.value))) {
state.CHANGE = true;
_value.value = new_localTypeDecls_String_value;
}
return new_localTypeDecls_String_value;
}
return (SimpleSet)_value.value;
}
/**
* @apilevel internal
*/
private SimpleSet localTypeDecls_compute(String name) {
SimpleSet set = SimpleSet.emptySet;
for(Iterator iter = original().localTypeDecls(name).iterator(); iter.hasNext(); ) {
TypeDecl t = (TypeDecl)iter.next();
/* ES: removing this:
if(t.isStatic())
set = set.add(t);
else {
BodyDecl b;
TypeDecl typeDecl;
if(t instanceof ClassDecl) {
ClassDecl classDecl = (ClassDecl)t;
typeDecl = classDecl.substitutedClassDecl(this);
b = new MemberClassDecl((ClassDecl)typeDecl);
addBodyDecl(b);
// Here we should access b through an ordinary
// child accessor instead of setting is$Final directly,
// however doing so appears to cause unexpected behaviour!
b.is$Final = true;
set = set.add(typeDecl);
}
else if(t instanceof InterfaceDecl) {
InterfaceDecl interfaceDecl = (InterfaceDecl)t;
typeDecl = interfaceDecl.substitutedInterfaceDecl(this);
b = new MemberInterfaceDecl((InterfaceDecl)typeDecl);
addBodyDecl(b);
// Here we should access b through an ordinary
// child accessor instead of setting is$Final directly,
// however doing so appears to cause unexpected behaviour!
b.is$Final = true;
set = set.add(typeDecl);
}
}
* and replacing with:
*/
if(t.isStatic()) {
set = set.add(t);
} else if (t instanceof ClassDecl) {
MemberClassDecl copy = ((BodyDeclList)getBodyDeclList()).localClassDeclCopy((ClassDecl)t, this);
set = set.add(copy.getClassDecl());
} else if (t instanceof InterfaceDecl) {
MemberInterfaceDecl copy = ((BodyDeclList)getBodyDeclList()).localInterfaceDeclCopy((InterfaceDecl)t, this);
set = set.add(copy.getInterfaceDecl());
}
}
return set;
}
/**
* @apilevel internal
*/
protected boolean constructors_computed = false;
/**
* @apilevel internal
*/
protected Collection constructors_value;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1213
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection constructors() {
if(constructors_computed) {
return constructors_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
constructors_value = constructors_compute();
if(isFinal && num == state().boundariesCrossed) constructors_computed = true;
return constructors_value;
}
/**
* @apilevel internal
*/
private Collection constructors_compute() {
Collection set = new ArrayList();
for(Iterator iter = original().constructors().iterator(); iter.hasNext(); ) {
ConstructorDecl c = (ConstructorDecl)iter.next();
/* ES: removing this:
BodyDecl b = c.substitutedBodyDecl(this);
addBodyDecl(b);
// Here we should access b through an ordinary
// child accessor instead of setting is$Final directly,
// however doing so appears to cause unexpected behaviour!
b.is$Final = true;
* and replacing with:
*/
BodyDecl b = ((BodyDeclList)getBodyDeclList()).constructorCopy(c, this);
set.add(b);
}
return set;
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 36,874
| 30.625214
| 201
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/GenericConstructorDecl.java
|
/* 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 GenericConstructorDecl : {@link ConstructorDecl} ::= <span class="component">TypeParameter:{@link TypeVariable}*</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethods.ast:4
*/
public class GenericConstructorDecl extends ConstructorDecl implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GenericConstructorDecl clone() throws CloneNotSupportedException {
GenericConstructorDecl node = (GenericConstructorDecl)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GenericConstructorDecl copy() {
try {
GenericConstructorDecl node = (GenericConstructorDecl) 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 GenericConstructorDecl fullCopy() {
GenericConstructorDecl tree = (GenericConstructorDecl) 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 GenericMethodsPrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethods.jrag:258
*/
public void toString(StringBuffer s) {
s.append(indent());
getModifiers().toString(s);
s.append(" <");
for(int i = 0; i < getNumTypeParameter(); i++) {
if(i != 0) s.append(", ");
original().getTypeParameter(i).toString(s);
}
s.append("> ");
s.append(getID() + "(");
if(getNumParameter() > 0) {
getParameter(0).toString(s);
for(int i = 1; i < getNumParameter(); i++) {
s.append(", ");
getParameter(i).toString(s);
}
}
s.append(")");
if(getNumException() > 0) {
s.append(" throws ");
getException(0).toString(s);
for(int i = 1; i < getNumException(); i++) {
s.append(", ");
getException(i).toString(s);
}
}
s.append(" {");
if(hasConstructorInvocation()) {
s.append(indent());
getConstructorInvocation().toString(s);
}
for(int i = 0; i < getBlock().getNumStmt(); i++) {
s.append(indent());
getBlock().getStmt(i).toString(s);
}
s.append(indent());
s.append("}");
}
/**
* @ast method
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1280
*/
public GenericConstructorDecl original;
/**
* @ast method
*
*/
public GenericConstructorDecl() {
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[6];
setChild(new List(), 1);
setChild(new List(), 2);
setChild(new Opt(), 3);
setChild(new List(), 5);
}
/**
* @ast method
*
*/
public GenericConstructorDecl(Modifiers p0, String p1, List<ParameterDeclaration> p2, List<Access> p3, Opt<Stmt> p4, Block p5, List<TypeVariable> p6) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setChild(p4, 3);
setChild(p5, 4);
setChild(p6, 5);
}
/**
* @ast method
*
*/
public GenericConstructorDecl(Modifiers p0, beaver.Symbol p1, List<ParameterDeclaration> p2, List<Access> p3, Opt<Stmt> p4, Block p5, List<TypeVariable> p6) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setChild(p4, 3);
setChild(p5, 4);
setChild(p6, 5);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 6;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return true;
}
/**
* 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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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 Parameter list.
* @param list The new list node to be used as the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public void setParameterList(List<ParameterDeclaration> list) {
setChild(list, 1);
}
/**
* Retrieves the number of children in the Parameter list.
* @return Number of children in the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public int getNumParameter() {
return getParameterList().getNumChild();
}
/**
* Retrieves the number of children in the Parameter list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Parameter list.
* @apilevel low-level
* @ast method
*
*/
public int getNumParameterNoTransform() {
return getParameterListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Parameter list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Parameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public ParameterDeclaration getParameter(int i) {
return (ParameterDeclaration)getParameterList().getChild(i);
}
/**
* Append an element to the Parameter list.
* @param node The element to append to the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public void addParameter(ParameterDeclaration node) {
List<ParameterDeclaration> list = (parent == null || state == null) ? getParameterListNoTransform() : getParameterList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addParameterNoTransform(ParameterDeclaration node) {
List<ParameterDeclaration> list = getParameterListNoTransform();
list.addChild(node);
}
/**
* Replaces the Parameter 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 setParameter(ParameterDeclaration node, int i) {
List<ParameterDeclaration> list = getParameterList();
list.setChild(node, i);
}
/**
* Retrieves the Parameter list.
* @return The node representing the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public List<ParameterDeclaration> getParameters() {
return getParameterList();
}
/**
* Retrieves the Parameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Parameter list.
* @apilevel low-level
* @ast method
*
*/
public List<ParameterDeclaration> getParametersNoTransform() {
return getParameterListNoTransform();
}
/**
* Retrieves the Parameter list.
* @return The node representing the Parameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<ParameterDeclaration> getParameterList() {
List<ParameterDeclaration> list = (List<ParameterDeclaration>)getChild(1);
list.getNumChild();
return list;
}
/**
* Retrieves the Parameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Parameter list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<ParameterDeclaration> getParameterListNoTransform() {
return (List<ParameterDeclaration>)getChildNoTransform(1);
}
/**
* Replaces the Exception list.
* @param list The new list node to be used as the Exception list.
* @apilevel high-level
* @ast method
*
*/
public void setExceptionList(List<Access> list) {
setChild(list, 2);
}
/**
* Retrieves the number of children in the Exception list.
* @return Number of children in the Exception list.
* @apilevel high-level
* @ast method
*
*/
public int getNumException() {
return getExceptionList().getNumChild();
}
/**
* Retrieves the number of children in the Exception list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Exception list.
* @apilevel low-level
* @ast method
*
*/
public int getNumExceptionNoTransform() {
return getExceptionListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Exception list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Exception list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getException(int i) {
return (Access)getExceptionList().getChild(i);
}
/**
* Append an element to the Exception list.
* @param node The element to append to the Exception list.
* @apilevel high-level
* @ast method
*
*/
public void addException(Access node) {
List<Access> list = (parent == null || state == null) ? getExceptionListNoTransform() : getExceptionList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addExceptionNoTransform(Access node) {
List<Access> list = getExceptionListNoTransform();
list.addChild(node);
}
/**
* Replaces the Exception 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 setException(Access node, int i) {
List<Access> list = getExceptionList();
list.setChild(node, i);
}
/**
* Retrieves the Exception list.
* @return The node representing the Exception list.
* @apilevel high-level
* @ast method
*
*/
public List<Access> getExceptions() {
return getExceptionList();
}
/**
* Retrieves the Exception list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Exception list.
* @apilevel low-level
* @ast method
*
*/
public List<Access> getExceptionsNoTransform() {
return getExceptionListNoTransform();
}
/**
* Retrieves the Exception list.
* @return The node representing the Exception list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getExceptionList() {
List<Access> list = (List<Access>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the Exception list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Exception list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getExceptionListNoTransform() {
return (List<Access>)getChildNoTransform(2);
}
/**
* Replaces the optional node for the ConstructorInvocation child. This is the {@code Opt} node containing the child ConstructorInvocation, not the actual child!
* @param opt The new node to be used as the optional node for the ConstructorInvocation child.
* @apilevel low-level
* @ast method
*
*/
public void setConstructorInvocationOpt(Opt<Stmt> opt) {
setChild(opt, 3);
}
/**
* Check whether the optional ConstructorInvocation child exists.
* @return {@code true} if the optional ConstructorInvocation child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasConstructorInvocation() {
return getConstructorInvocationOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) ConstructorInvocation child.
* @return The ConstructorInvocation child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Stmt getConstructorInvocation() {
return (Stmt)getConstructorInvocationOpt().getChild(0);
}
/**
* Replaces the (optional) ConstructorInvocation child.
* @param node The new node to be used as the ConstructorInvocation child.
* @apilevel high-level
* @ast method
*
*/
public void setConstructorInvocation(Stmt node) {
getConstructorInvocationOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Stmt> getConstructorInvocationOpt() {
return (Opt<Stmt>)getChild(3);
}
/**
* Retrieves the optional node for child ConstructorInvocation. This is the {@code Opt} node containing the child ConstructorInvocation, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child ConstructorInvocation.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Stmt> getConstructorInvocationOptNoTransform() {
return (Opt<Stmt>)getChildNoTransform(3);
}
/**
* Replaces the Block child.
* @param node The new node to replace the Block child.
* @apilevel high-level
* @ast method
*
*/
public void setBlock(Block node) {
setChild(node, 4);
}
/**
* Retrieves the Block child.
* @return The current node used as the Block child.
* @apilevel high-level
* @ast method
*
*/
public Block getBlock() {
return (Block)getChild(4);
}
/**
* Retrieves the Block child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Block child.
* @apilevel low-level
* @ast method
*
*/
public Block getBlockNoTransform() {
return (Block)getChildNoTransform(4);
}
/**
* Replaces the TypeParameter list.
* @param list The new list node to be used as the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public void setTypeParameterList(List<TypeVariable> list) {
setChild(list, 5);
}
/**
* Retrieves the number of children in the TypeParameter list.
* @return Number of children in the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public int getNumTypeParameter() {
return getTypeParameterList().getNumChild();
}
/**
* Retrieves the number of children in the TypeParameter list.
* Calling this method will not trigger rewrites..
* @return Number of children in the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
public int getNumTypeParameterNoTransform() {
return getTypeParameterListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the TypeParameter list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeVariable getTypeParameter(int i) {
return (TypeVariable)getTypeParameterList().getChild(i);
}
/**
* Append an element to the TypeParameter list.
* @param node The element to append to the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public void addTypeParameter(TypeVariable node) {
List<TypeVariable> list = (parent == null || state == null) ? getTypeParameterListNoTransform() : getTypeParameterList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addTypeParameterNoTransform(TypeVariable node) {
List<TypeVariable> list = getTypeParameterListNoTransform();
list.addChild(node);
}
/**
* Replaces the TypeParameter 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 setTypeParameter(TypeVariable node, int i) {
List<TypeVariable> list = getTypeParameterList();
list.setChild(node, i);
}
/**
* Retrieves the TypeParameter list.
* @return The node representing the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public List<TypeVariable> getTypeParameters() {
return getTypeParameterList();
}
/**
* Retrieves the TypeParameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
public List<TypeVariable> getTypeParametersNoTransform() {
return getTypeParameterListNoTransform();
}
/**
* Retrieves the TypeParameter list.
* @return The node representing the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<TypeVariable> getTypeParameterList() {
List<TypeVariable> list = (List<TypeVariable>)getChild(5);
list.getNumChild();
return list;
}
/**
* Retrieves the TypeParameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<TypeVariable> getTypeParameterListNoTransform() {
return (List<TypeVariable>)getChildNoTransform(5);
}
/**
* @attribute syn
* @aspect GenericMethodsNameAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethods.jrag:163
*/
public SimpleSet localLookupType(String name) {
ASTNode$State state = state();
try {
for(int i = 0; i < getNumTypeParameter(); i++) {
if(original().getTypeParameter(i).name().equals(name))
return SimpleSet.emptySet.add(original().getTypeParameter(i));
}
return SimpleSet.emptySet;
}
finally {
}
}
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1279
*/
public GenericConstructorDecl original() {
ASTNode$State state = state();
try { return original != null ? original : this; }
finally {
}
}
/**
* @attribute inh
* @aspect GenericMethodsNameAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethods.jrag:162
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet lookupType(String name) {
ASTNode$State state = state();
SimpleSet lookupType_String_value = getParent().Define_SimpleSet_lookupType(this, null, name);
return lookupType_String_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethods.jrag:160
* @apilevel internal
*/
public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {
if(caller == getTypeParameterListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return NameType.TYPE_NAME;
}
else { return super.Define_NameType_nameType(caller, child);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethods.jrag:170
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_lookupType(ASTNode caller, ASTNode child, String name) {
{
int childIndex = this.getIndexOfChild(caller);
return localLookupType(name).isEmpty() ? lookupType(name) : localLookupType(name);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 22,851
| 27.81715
| 163
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/GenericInterfaceDecl.java
|
/* 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 GenericInterfaceDecl : {@link InterfaceDecl} ::= <span class="component">{@link Modifiers}</span> <span class="component"><ID:String></span> <span class="component">SuperInterfaceId:{@link Access}*</span> <span class="component">{@link BodyDecl}*</span> <span class="component">TypeParameter:{@link TypeVariable}*</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.ast:3
*/
public class GenericInterfaceDecl extends InterfaceDecl implements Cloneable, GenericTypeDecl {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
rawType_computed = false;
rawType_value = null;
lookupParTypeDecl_ArrayList_values = null;
lookupParTypeDecl_ArrayList_list = null; usesTypeVariable_visited = -1;
usesTypeVariable_computed = false;
usesTypeVariable_initialized = false;
subtype_TypeDecl_values = null;
instanceOf_TypeDecl_values = null;
lookupParTypeDecl_ParTypeAccess_values = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GenericInterfaceDecl clone() throws CloneNotSupportedException {
GenericInterfaceDecl node = (GenericInterfaceDecl)super.clone();
node.rawType_computed = false;
node.rawType_value = null;
node.lookupParTypeDecl_ArrayList_values = null;
node.lookupParTypeDecl_ArrayList_list = null; node.usesTypeVariable_visited = -1;
node.usesTypeVariable_computed = false;
node.usesTypeVariable_initialized = false;
node.subtype_TypeDecl_values = null;
node.instanceOf_TypeDecl_values = null;
node.lookupParTypeDecl_ParTypeAccess_values = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GenericInterfaceDecl copy() {
try {
GenericInterfaceDecl node = (GenericInterfaceDecl) 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 GenericInterfaceDecl fullCopy() {
GenericInterfaceDecl tree = (GenericInterfaceDecl) 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 GenericsTypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:430
*/
public void typeCheck() {
super.typeCheck();
if(instanceOf(typeThrowable()))
error(" generic interface " + typeName() + " may not directly or indirectly inherit java.lang.Throwable");
}
/**
* @ast method
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1346
*/
public InterfaceDecl substitutedInterfaceDecl(Parameterization parTypeDecl) {
GenericInterfaceDecl c = new GenericInterfaceDeclSubstituted(
(Modifiers)getModifiers().fullCopy(),
getID(),
getSuperInterfaceIdList().substitute(parTypeDecl),
// ES: new List(),
new List(), // delegates TypeParameter lookup to original
this
);
return c;
}
/**
* @ast method
* @aspect GenericsPrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsPrettyPrint.jrag:115
*/
public void toString(StringBuffer s) {
getModifiers().toString(s);
s.append("interface " + getID());
s.append('<');
if (getNumTypeParameter() > 0) {
getTypeParameter(0).toString(s);
for (int i = 1; i < getNumTypeParameter(); i++) {
s.append(", ");
getTypeParameter(i).toString(s);
}
}
s.append('>');
if(getNumSuperInterfaceId() > 0) {
s.append(" extends ");
getSuperInterfaceId(0).toString(s);
for(int i = 1; i < getNumSuperInterfaceId(); i++) {
s.append(", ");
getSuperInterfaceId(i).toString(s);
}
}
/*
s.append(" instantiated with: ");
for(int i = 0; i < getNumParTypeDecl(); i++) {
if(i != 0) s.append(", ");
ParTypeDecl decl = getParTypeDecl(i);
s.append("<");
for(int j = 0; j < decl.getNumArgument(); j++) {
if(j != 0) s.append(", ");
s.append(decl.getArgument(j).type().fullName());
}
s.append(">");
}
*/
ppBodyDecls(s);
/*
for(int i = 0; i < getNumParTypeDecl(); i++) {
ParInterfaceDecl decl = getParTypeDecl(i);
decl.toString(s);
}
*/
}
/**
* @ast method
* @aspect Generics
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:235
*/
public TypeDecl makeGeneric(Signatures.ClassSignature s) {
return (TypeDecl)this;
}
/**
* @ast method
* @aspect GenericsNameBinding
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:489
*/
public SimpleSet addTypeVariables(SimpleSet c, String name) {
GenericTypeDecl original = (GenericTypeDecl)original();
for(int i = 0; i < original.getNumTypeParameter(); i++) {
TypeVariable p = original.getTypeParameter(i);
if(p.name().equals(name))
c = c.add(p);
}
return c;
}
/**
* @ast method
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:799
*/
public List createArgumentList(ArrayList params) {
GenericTypeDecl original = (GenericTypeDecl)original();
List list = new List();
if(params.isEmpty()) {
// Change: Don't add any thing to the list.
// Concern: The previous version seem to add the erasure of the type variable for some reason,
// maybe this is how the raw type is represented (?), but this doesn't really comply with the
// claim that raw types don't have any type variables...?
for(int i = 0; i < original.getNumTypeParameter(); i++)
list.add(original.getTypeParameter(i).erasure().createBoundAccess());
} else
for(Iterator iter = params.iterator(); iter.hasNext(); )
list.add(((TypeDecl)iter.next()).createBoundAccess());
return list;
}
/**
* @ast method
*
*/
public GenericInterfaceDecl() {
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 GenericInterfaceDecl(Modifiers p0, String p1, List<Access> p2, List<BodyDecl> p3, List<TypeVariable> p4) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setChild(p4, 3);
}
/**
* @ast method
*
*/
public GenericInterfaceDecl(Modifiers p0, beaver.Symbol p1, List<Access> p2, List<BodyDecl> p3, List<TypeVariable> p4) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setChild(p4, 3);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 4;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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<Access> 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<Access> list = (parent == null || state == null) ? getSuperInterfaceIdListNoTransform() : getSuperInterfaceIdList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addSuperInterfaceIdNoTransform(Access node) {
List<Access> 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<Access> list = getSuperInterfaceIdList();
list.setChild(node, i);
}
/**
* Retrieves the SuperInterfaceId list.
* @return The node representing the SuperInterfaceId list.
* @apilevel high-level
* @ast method
*
*/
public List<Access> getSuperInterfaceIds() {
return getSuperInterfaceIdList();
}
/**
* Retrieves the SuperInterfaceId list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the SuperInterfaceId list.
* @apilevel low-level
* @ast method
*
*/
public List<Access> getSuperInterfaceIdsNoTransform() {
return getSuperInterfaceIdListNoTransform();
}
/**
* Retrieves the SuperInterfaceId list.
* @return The node representing the SuperInterfaceId list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getSuperInterfaceIdList() {
List<Access> list = (List<Access>)getChild(1);
list.getNumChild();
return list;
}
/**
* Retrieves the SuperInterfaceId list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the SuperInterfaceId list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getSuperInterfaceIdListNoTransform() {
return (List<Access>)getChildNoTransform(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<BodyDecl> 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<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addBodyDeclNoTransform(BodyDecl node) {
List<BodyDecl> 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<BodyDecl> list = getBodyDeclList();
list.setChild(node, i);
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<BodyDecl> getBodyDecls() {
return getBodyDeclList();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclsNoTransform() {
return getBodyDeclListNoTransform();
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclList() {
List<BodyDecl> list = (List<BodyDecl>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclListNoTransform() {
return (List<BodyDecl>)getChildNoTransform(2);
}
/**
* Replaces the TypeParameter list.
* @param list The new list node to be used as the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public void setTypeParameterList(List<TypeVariable> list) {
setChild(list, 3);
}
/**
* Retrieves the number of children in the TypeParameter list.
* @return Number of children in the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public int getNumTypeParameter() {
return getTypeParameterList().getNumChild();
}
/**
* Retrieves the number of children in the TypeParameter list.
* Calling this method will not trigger rewrites..
* @return Number of children in the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
public int getNumTypeParameterNoTransform() {
return getTypeParameterListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the TypeParameter list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeVariable getTypeParameter(int i) {
return (TypeVariable)getTypeParameterList().getChild(i);
}
/**
* Append an element to the TypeParameter list.
* @param node The element to append to the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public void addTypeParameter(TypeVariable node) {
List<TypeVariable> list = (parent == null || state == null) ? getTypeParameterListNoTransform() : getTypeParameterList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addTypeParameterNoTransform(TypeVariable node) {
List<TypeVariable> list = getTypeParameterListNoTransform();
list.addChild(node);
}
/**
* Replaces the TypeParameter 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 setTypeParameter(TypeVariable node, int i) {
List<TypeVariable> list = getTypeParameterList();
list.setChild(node, i);
}
/**
* Retrieves the TypeParameter list.
* @return The node representing the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public List<TypeVariable> getTypeParameters() {
return getTypeParameterList();
}
/**
* Retrieves the TypeParameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
public List<TypeVariable> getTypeParametersNoTransform() {
return getTypeParameterListNoTransform();
}
/**
* Retrieves the TypeParameter list.
* @return The node representing the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<TypeVariable> getTypeParameterList() {
List<TypeVariable> list = (List<TypeVariable>)getChild(3);
list.getNumChild();
return list;
}
/**
* Retrieves the TypeParameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<TypeVariable> getTypeParameterListNoTransform() {
return (List<TypeVariable>)getChildNoTransform(3);
}
/**
* @apilevel internal
*/
protected boolean rawType_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl rawType_value;
/**
* @attribute syn
* @aspect Generics
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:177
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl rawType() {
if(rawType_computed) {
return rawType_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
rawType_value = rawType_compute();
if(isFinal && num == state().boundariesCrossed) rawType_computed = true;
return rawType_value;
}
/**
* @apilevel internal
*/
private TypeDecl rawType_compute() { return lookupParTypeDecl(new ArrayList()); }
/**
* @apilevel internal
*/
protected java.util.Map lookupParTypeDecl_ArrayList_values;
/**
* @apilevel internal
*/
protected List lookupParTypeDecl_ArrayList_list;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:734
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl lookupParTypeDecl(ArrayList list) {
Object _parameters = list;
if(lookupParTypeDecl_ArrayList_values == null) lookupParTypeDecl_ArrayList_values = new java.util.HashMap(4);
if(lookupParTypeDecl_ArrayList_values.containsKey(_parameters)) {
return (TypeDecl)lookupParTypeDecl_ArrayList_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
TypeDecl lookupParTypeDecl_ArrayList_value = lookupParTypeDecl_compute(list);
if(lookupParTypeDecl_ArrayList_list == null) {
lookupParTypeDecl_ArrayList_list = new List();
lookupParTypeDecl_ArrayList_list.is$Final = true;
lookupParTypeDecl_ArrayList_list.setParent(this);
}
lookupParTypeDecl_ArrayList_list.add(lookupParTypeDecl_ArrayList_value);
if(lookupParTypeDecl_ArrayList_value != null) {
lookupParTypeDecl_ArrayList_value.is$Final = true;
}
if(true) lookupParTypeDecl_ArrayList_values.put(_parameters, lookupParTypeDecl_ArrayList_value);
return lookupParTypeDecl_ArrayList_value;
}
/**
* @apilevel internal
*/
private TypeDecl lookupParTypeDecl_compute(ArrayList list) {
/*
int size = createParTypeDeclStub_ArrayList_list != null ? createParTypeDeclStub_ArrayList_list.numChildren : 0;
ParInterfaceDecl typeDecl = (ParInterfaceDecl)createParTypeDeclStub(list);
if (size < createParTypeDeclStub_ArrayList_list.numChildren) {
createParTypeDeclBody(list, typeDecl);
}
return typeDecl;
*/
ParInterfaceDecl typeDecl = list.size() == 0 ? new RawInterfaceDecl() : new ParInterfaceDecl();
typeDecl.setModifiers((Modifiers)getModifiers().fullCopy());
typeDecl.setID(getID());
// ES: trying to only so this for ParInterfaceDecl and then later for RawInterfaceDecl
if (!(typeDecl instanceof RawInterfaceDecl))
typeDecl.setArgumentList(createArgumentList(list));
return typeDecl;
}
/**
* @apilevel internal
*/
protected int usesTypeVariable_visited = -1;
/**
* @apilevel internal
*/
protected boolean usesTypeVariable_computed = false;
/**
* @apilevel internal
*/
protected boolean usesTypeVariable_initialized = false;
/**
* @apilevel internal
*/
protected boolean usesTypeVariable_value;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1078
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean usesTypeVariable() {
if(usesTypeVariable_computed) {
return usesTypeVariable_value;
}
ASTNode$State state = state();
if (!usesTypeVariable_initialized) {
usesTypeVariable_initialized = true;
usesTypeVariable_value = false;
}
if (!state.IN_CIRCLE) {
state.IN_CIRCLE = true;
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
do {
usesTypeVariable_visited = state.CIRCLE_INDEX;
state.CHANGE = false;
boolean new_usesTypeVariable_value = usesTypeVariable_compute();
if (new_usesTypeVariable_value!=usesTypeVariable_value)
state.CHANGE = true;
usesTypeVariable_value = new_usesTypeVariable_value;
state.CIRCLE_INDEX++;
} while (state.CHANGE);
if(isFinal && num == state().boundariesCrossed) {
usesTypeVariable_computed = true;
}
else {
state.RESET_CYCLE = true;
usesTypeVariable_compute();
state.RESET_CYCLE = false;
usesTypeVariable_computed = false;
usesTypeVariable_initialized = false;
}
state.IN_CIRCLE = false;
return usesTypeVariable_value;
}
if(usesTypeVariable_visited != state.CIRCLE_INDEX) {
usesTypeVariable_visited = state.CIRCLE_INDEX;
if (state.RESET_CYCLE) {
usesTypeVariable_computed = false;
usesTypeVariable_initialized = false;
usesTypeVariable_visited = -1;
return usesTypeVariable_value;
}
boolean new_usesTypeVariable_value = usesTypeVariable_compute();
if (new_usesTypeVariable_value!=usesTypeVariable_value)
state.CHANGE = true;
usesTypeVariable_value = new_usesTypeVariable_value;
return usesTypeVariable_value;
}
return usesTypeVariable_value;
}
/**
* @apilevel internal
*/
private boolean usesTypeVariable_compute() { return true; }
protected java.util.Map subtype_TypeDecl_values;
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:19
*/
@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.supertypeGenericInterfaceDecl(this); }
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:125
*/
public boolean supertypeParClassDecl(ParClassDecl type) {
ASTNode$State state = state();
try { return type.genericDecl().original().subtype(this); }
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(this); }
finally {
}
}
protected java.util.Map instanceOf_TypeDecl_values;
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:395
*/
@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); }
/**
* @attribute syn
* @aspect Generics
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:158
*/
public boolean isGenericType() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
protected java.util.Map lookupParTypeDecl_ParTypeAccess_values;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:708
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl lookupParTypeDecl(ParTypeAccess p) {
Object _parameters = p;
if(lookupParTypeDecl_ParTypeAccess_values == null) lookupParTypeDecl_ParTypeAccess_values = new java.util.HashMap(4);
if(lookupParTypeDecl_ParTypeAccess_values.containsKey(_parameters)) {
return (TypeDecl)lookupParTypeDecl_ParTypeAccess_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
TypeDecl lookupParTypeDecl_ParTypeAccess_value = lookupParTypeDecl_compute(p);
if(isFinal && num == state().boundariesCrossed) lookupParTypeDecl_ParTypeAccess_values.put(_parameters, lookupParTypeDecl_ParTypeAccess_value);
return lookupParTypeDecl_ParTypeAccess_value;
}
/**
* @apilevel internal
*/
private TypeDecl lookupParTypeDecl_compute(ParTypeAccess p) {
ArrayList typeArguments = new ArrayList();
for(int i = 0; i < p.getNumTypeArgument(); i++)
typeArguments.add(p.getTypeArgument(i).type());
return lookupParTypeDecl(typeArguments);
}
/**
* @attribute inh
* @aspect GenericsTypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:436
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl typeThrowable() {
ASTNode$State state = state();
TypeDecl typeThrowable_value = getParent().Define_TypeDecl_typeThrowable(this, null);
return typeThrowable_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:486
* @apilevel internal
*/
public boolean Define_boolean_isNestedType(ASTNode caller, ASTNode child) {
if(caller == getTypeParameterListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return true;
}
else { return super.Define_boolean_isNestedType(caller, child);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:487
* @apilevel internal
*/
public TypeDecl Define_TypeDecl_enclosingType(ASTNode caller, ASTNode child) {
if(caller == getTypeParameterListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return this;
}
else { return super.Define_TypeDecl_enclosingType(caller, child);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:531
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_lookupType(ASTNode caller, ASTNode child, String name) {
if(caller == getBodyDeclListNoTransform()) {
int index = caller.getIndexOfChild(child);
{
SimpleSet c = memberTypes(name);
if(getBodyDecl(index).visibleTypeParameters())
c = addTypeVariables(c, name);
if(!c.isEmpty())
return c;
// 8.5.2
if(isClassDecl() && isStatic() && !isTopLevelType()) {
for(Iterator iter = lookupType(name).iterator(); iter.hasNext(); ) {
TypeDecl d = (TypeDecl)iter.next();
if(d.isStatic() || (d.enclosingType() != null && instanceOf(d.enclosingType()))) {
c = c.add(d);
}
}
}
else
c = lookupType(name);
if(!c.isEmpty())
return c;
return topLevelType().lookupType(name); // Fix to search imports
// include type parameters if not static
}
}
else if(caller == getTypeParameterListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
{
SimpleSet c = memberTypes(name);
c = addTypeVariables(c, name);
if(!c.isEmpty()) return c;
// 8.5.2
if(isClassDecl() && isStatic() && !isTopLevelType()) {
for(Iterator iter = lookupType(name).iterator(); iter.hasNext(); ) {
TypeDecl d = (TypeDecl)iter.next();
if(d.isStatic() || (d.enclosingType() != null && instanceOf(d.enclosingType()))) {
c = c.add(d);
}
}
}
else
c = lookupType(name);
if(!c.isEmpty())
return c;
return topLevelType().lookupType(name); // Fix to search imports
}
}
else if(caller == getSuperInterfaceIdListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
{
SimpleSet c = addTypeVariables(SimpleSet.emptySet, name);
return !c.isEmpty() ? c : lookupType(name);
}
}
else { return super.Define_SimpleSet_lookupType(caller, child, name);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsParTypeDecl.jrag:51
* @apilevel internal
*/
public TypeDecl Define_TypeDecl_genericDecl(ASTNode caller, ASTNode child) {
{
int childIndex = this.getIndexOfChild(caller);
return this;
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 36,597
| 30.991259
| 342
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/GenericInterfaceDeclSubstituted.java
|
/* 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 GenericInterfaceDeclSubstituted : {@link GenericInterfaceDecl} ::= <span class="component"><Original:TypeDecl></span> <span class="component">{@link BodyDecl}*</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.ast:44
*/
public class GenericInterfaceDeclSubstituted extends GenericInterfaceDecl implements Cloneable, MemberSubstitutor {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
getBodyDeclList_computed = false;
getBodyDeclList_value = null;
sourceTypeDecl_computed = false;
sourceTypeDecl_value = null;
instanceOf_TypeDecl_values = null;
subtype_TypeDecl_values = null;
localMethodsSignatureMap_computed = false;
localMethodsSignatureMap_value = null;
localFields_String_values = null;
localTypeDecls_String_values = null;
constructors_computed = false;
constructors_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GenericInterfaceDeclSubstituted clone() throws CloneNotSupportedException {
GenericInterfaceDeclSubstituted node = (GenericInterfaceDeclSubstituted)super.clone();
node.getBodyDeclList_computed = false;
node.getBodyDeclList_value = null;
node.sourceTypeDecl_computed = false;
node.sourceTypeDecl_value = null;
node.instanceOf_TypeDecl_values = null;
node.subtype_TypeDecl_values = null;
node.localMethodsSignatureMap_computed = false;
node.localMethodsSignatureMap_value = null;
node.localFields_String_values = null;
node.localTypeDecls_String_values = null;
node.constructors_computed = false;
node.constructors_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GenericInterfaceDeclSubstituted copy() {
try {
GenericInterfaceDeclSubstituted node = (GenericInterfaceDeclSubstituted) 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 GenericInterfaceDeclSubstituted fullCopy() {
GenericInterfaceDeclSubstituted tree = (GenericInterfaceDeclSubstituted) copy();
if (children != null) {
for (int i = 0; i < children.length; ++i) {
switch (i) {
case 5:
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
*
*/
public GenericInterfaceDeclSubstituted() {
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 GenericInterfaceDeclSubstituted(Modifiers p0, String p1, List<Access> p2, List<TypeVariable> p3, TypeDecl p4) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setOriginal(p4);
}
/**
* @ast method
*
*/
public GenericInterfaceDeclSubstituted(Modifiers p0, beaver.Symbol p1, List<Access> p2, List<TypeVariable> p3, TypeDecl p4) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
setOriginal(p4);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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<Access> 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<Access> list = (parent == null || state == null) ? getSuperInterfaceIdListNoTransform() : getSuperInterfaceIdList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addSuperInterfaceIdNoTransform(Access node) {
List<Access> 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<Access> list = getSuperInterfaceIdList();
list.setChild(node, i);
}
/**
* Retrieves the SuperInterfaceId list.
* @return The node representing the SuperInterfaceId list.
* @apilevel high-level
* @ast method
*
*/
public List<Access> getSuperInterfaceIds() {
return getSuperInterfaceIdList();
}
/**
* Retrieves the SuperInterfaceId list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the SuperInterfaceId list.
* @apilevel low-level
* @ast method
*
*/
public List<Access> getSuperInterfaceIdsNoTransform() {
return getSuperInterfaceIdListNoTransform();
}
/**
* Retrieves the SuperInterfaceId list.
* @return The node representing the SuperInterfaceId list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getSuperInterfaceIdList() {
List<Access> list = (List<Access>)getChild(1);
list.getNumChild();
return list;
}
/**
* Retrieves the SuperInterfaceId list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the SuperInterfaceId list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getSuperInterfaceIdListNoTransform() {
return (List<Access>)getChildNoTransform(1);
}
/**
* Replaces the TypeParameter list.
* @param list The new list node to be used as the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public void setTypeParameterList(List<TypeVariable> list) {
setChild(list, 2);
}
/**
* Retrieves the number of children in the TypeParameter list.
* @return Number of children in the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public int getNumTypeParameter() {
return getTypeParameterList().getNumChild();
}
/**
* Retrieves the number of children in the TypeParameter list.
* Calling this method will not trigger rewrites..
* @return Number of children in the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
public int getNumTypeParameterNoTransform() {
return getTypeParameterListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the TypeParameter list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeVariable getTypeParameter(int i) {
return (TypeVariable)getTypeParameterList().getChild(i);
}
/**
* Append an element to the TypeParameter list.
* @param node The element to append to the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public void addTypeParameter(TypeVariable node) {
List<TypeVariable> list = (parent == null || state == null) ? getTypeParameterListNoTransform() : getTypeParameterList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addTypeParameterNoTransform(TypeVariable node) {
List<TypeVariable> list = getTypeParameterListNoTransform();
list.addChild(node);
}
/**
* Replaces the TypeParameter 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 setTypeParameter(TypeVariable node, int i) {
List<TypeVariable> list = getTypeParameterList();
list.setChild(node, i);
}
/**
* Retrieves the TypeParameter list.
* @return The node representing the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public List<TypeVariable> getTypeParameters() {
return getTypeParameterList();
}
/**
* Retrieves the TypeParameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
public List<TypeVariable> getTypeParametersNoTransform() {
return getTypeParameterListNoTransform();
}
/**
* Retrieves the TypeParameter list.
* @return The node representing the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<TypeVariable> getTypeParameterList() {
List<TypeVariable> list = (List<TypeVariable>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the TypeParameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<TypeVariable> getTypeParameterListNoTransform() {
return (List<TypeVariable>)getChildNoTransform(2);
}
/**
* Replaces the lexeme Original.
* @param value The new value for the lexeme Original.
* @apilevel high-level
* @ast method
*
*/
public void setOriginal(TypeDecl value) {
tokenTypeDecl_Original = value;
}
/**
* @apilevel internal
* @ast method
*
*/
/**
* @apilevel internal
*/
protected TypeDecl tokenTypeDecl_Original;
/**
* Retrieves the value for the lexeme Original.
* @return The value for the lexeme Original.
* @apilevel high-level
* @ast method
*
*/
public TypeDecl getOriginal() {
return tokenTypeDecl_Original;
}
/**
* 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<BodyDecl> list) {
setChild(list, 3);
}
/**
* 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<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addBodyDeclNoTransform(BodyDecl node) {
List<BodyDecl> 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<BodyDecl> list = getBodyDeclList();
list.setChild(node, i);
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<BodyDecl> getBodyDecls() {
return getBodyDeclList();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclsNoTransform() {
return getBodyDeclListNoTransform();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclListNoTransform() {
return (List<BodyDecl>)getChildNoTransform(3);
}
/**
* 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 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 getOriginal(); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean getBodyDeclList_computed = false;
/**
* @apilevel internal
*/
protected List getBodyDeclList_value;
/**
* @attribute syn nta
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1053
*/
@SuppressWarnings({"unchecked", "cast"})
public List getBodyDeclList() {
if(getBodyDeclList_computed) {
return (List) getChild(getBodyDeclListChildPosition());
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
getBodyDeclList_value = getBodyDeclList_compute();
setBodyDeclList(getBodyDeclList_value);
if(isFinal && num == state().boundariesCrossed) getBodyDeclList_computed = true;
return (List) getChild(getBodyDeclListChildPosition());
}
/**
* @apilevel internal
*/
private List getBodyDeclList_compute() { return new BodyDeclList(); }
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1306
*/
public TypeDecl original() {
ASTNode$State state = state();
try { return getOriginal().original(); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean sourceTypeDecl_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl sourceTypeDecl_value;
/**
* @attribute syn
* @aspect SourceDeclarations
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1509
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl sourceTypeDecl() {
if(sourceTypeDecl_computed) {
return sourceTypeDecl_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
sourceTypeDecl_value = sourceTypeDecl_compute();
if(isFinal && num == state().boundariesCrossed) sourceTypeDecl_computed = true;
return sourceTypeDecl_value;
}
/**
* @apilevel internal
*/
private TypeDecl sourceTypeDecl_compute() { return original().sourceTypeDecl(); }
protected java.util.Map instanceOf_TypeDecl_values;
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:489
*/
@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); }
protected java.util.Map subtype_TypeDecl_values;
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:521
*/
@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.supertypeGenericInterfaceDeclSubstituted(this); }
/**
* @attribute syn
* @aspect GenericsSubtype
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:523
*/
public boolean supertypeGenericInterfaceDeclSubstituted(GenericInterfaceDeclSubstituted type) {
ASTNode$State state = state();
try { return original() == type.original() && type.enclosingType().subtype(enclosingType()) || super.supertypeGenericInterfaceDeclSubstituted(type); }
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 super.supertypeGenericInterfaceDecl(type) || original().supertypeGenericInterfaceDecl(type); }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean localMethodsSignatureMap_computed = false;
/**
* @apilevel internal
*/
protected HashMap localMethodsSignatureMap_value;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1084
*/
@SuppressWarnings({"unchecked", "cast"})
public HashMap localMethodsSignatureMap() {
if(localMethodsSignatureMap_computed) {
return localMethodsSignatureMap_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
localMethodsSignatureMap_value = localMethodsSignatureMap_compute();
if(true) localMethodsSignatureMap_computed = true;
return localMethodsSignatureMap_value;
}
/**
* @apilevel internal
*/
private HashMap localMethodsSignatureMap_compute() {
HashMap map = new HashMap();
for(Iterator iter = original().localMethodsIterator(); iter.hasNext(); ) {
MethodDecl decl = (MethodDecl)iter.next();
/* ES removing this:
if(!decl.isStatic() && (decl.usesTypeVariable() || isRawType())) {
BodyDecl b = decl.substitutedBodyDecl(this);
addBodyDecl(b);
// Here we should access b through an ordinary
// child accessor instead of setting is$Final directly,
// however doing so appears to cause unexpected behaviour!
b.is$Final = true;
decl = (MethodDecl) b;
}
map.put(decl.signature(), decl);
* and replacing with:
*/
if(!decl.isStatic() && (decl.usesTypeVariable() || isRawType())) {
BodyDecl copyDecl = ((BodyDeclList)getBodyDeclList()).localMethodSignatureCopy(decl, this);
decl = (MethodDecl) copyDecl;
}
map.put(decl.signature(), decl);
}
return map;
}
protected java.util.Map localFields_String_values;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1119
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet localFields(String name) {
Object _parameters = name;
if(localFields_String_values == null) localFields_String_values = new java.util.HashMap(4);
if(localFields_String_values.containsKey(_parameters)) {
return (SimpleSet)localFields_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet localFields_String_value = localFields_compute(name);
if(true) localFields_String_values.put(_parameters, localFields_String_value);
return localFields_String_value;
}
/**
* @apilevel internal
*/
private SimpleSet localFields_compute(String name) {
SimpleSet set = SimpleSet.emptySet;
for(Iterator iter = original().localFields(name).iterator(); iter.hasNext(); ) {
FieldDeclaration f = (FieldDeclaration)iter.next();
/* ES removing this:
if(!f.isStatic() && (f.usesTypeVariable() || isRawType())) {
BodyDecl b = f.substitutedBodyDecl(this);
addBodyDecl(b);
// Here we should access b through an ordinary
// child accessor instead of setting is$Final directly,
// however doing so appears to cause unexpected behaviour!
b.is$Final = true;
f = (FieldDeclaration) b;
}
set = set.add(f);
* and replacing with:
*/
if(!f.isStatic() && (f.usesTypeVariable() || isRawType())) {
BodyDecl fCopy = ((BodyDeclList)getBodyDeclList()).localFieldCopy(f, this);
f = (FieldDeclaration) fCopy;
}
set = set.add(f);
}
return set;
}
protected java.util.Map localTypeDecls_String_values;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1154
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet localTypeDecls(String name) {
Object _parameters = name;
if(localTypeDecls_String_values == null) localTypeDecls_String_values = new java.util.HashMap(4);
ASTNode$State.CircularValue _value;
if(localTypeDecls_String_values.containsKey(_parameters)) {
Object _o = localTypeDecls_String_values.get(_parameters);
if(!(_o instanceof ASTNode$State.CircularValue)) {
return (SimpleSet)_o;
}
else
_value = (ASTNode$State.CircularValue)_o;
}
else {
_value = new ASTNode$State.CircularValue();
localTypeDecls_String_values.put(_parameters, _value);
_value.value = SimpleSet.emptySet;
}
ASTNode$State state = state();
if (!state.IN_CIRCLE) {
state.IN_CIRCLE = true;
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet new_localTypeDecls_String_value;
do {
_value.visited = new Integer(state.CIRCLE_INDEX);
state.CHANGE = false;
new_localTypeDecls_String_value = localTypeDecls_compute(name);
if ((new_localTypeDecls_String_value==null && (SimpleSet)_value.value!=null) || (new_localTypeDecls_String_value!=null && !new_localTypeDecls_String_value.equals((SimpleSet)_value.value))) {
state.CHANGE = true;
_value.value = new_localTypeDecls_String_value;
}
state.CIRCLE_INDEX++;
} while (state.CHANGE);
if(true) {
localTypeDecls_String_values.put(_parameters, new_localTypeDecls_String_value);
}
else {
localTypeDecls_String_values.remove(_parameters);
state.RESET_CYCLE = true;
localTypeDecls_compute(name);
state.RESET_CYCLE = false;
}
state.IN_CIRCLE = false;
return new_localTypeDecls_String_value;
}
if(!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) {
_value.visited = new Integer(state.CIRCLE_INDEX);
SimpleSet new_localTypeDecls_String_value = localTypeDecls_compute(name);
if (state.RESET_CYCLE) {
localTypeDecls_String_values.remove(_parameters);
}
else if ((new_localTypeDecls_String_value==null && (SimpleSet)_value.value!=null) || (new_localTypeDecls_String_value!=null && !new_localTypeDecls_String_value.equals((SimpleSet)_value.value))) {
state.CHANGE = true;
_value.value = new_localTypeDecls_String_value;
}
return new_localTypeDecls_String_value;
}
return (SimpleSet)_value.value;
}
/**
* @apilevel internal
*/
private SimpleSet localTypeDecls_compute(String name) {
SimpleSet set = SimpleSet.emptySet;
for(Iterator iter = original().localTypeDecls(name).iterator(); iter.hasNext(); ) {
TypeDecl t = (TypeDecl)iter.next();
/* ES: removing this:
if(t.isStatic())
set = set.add(t);
else {
BodyDecl b;
TypeDecl typeDecl;
if(t instanceof ClassDecl) {
ClassDecl classDecl = (ClassDecl)t;
typeDecl = classDecl.substitutedClassDecl(this);
b = new MemberClassDecl((ClassDecl)typeDecl);
addBodyDecl(b);
// Here we should access b through an ordinary
// child accessor instead of setting is$Final directly,
// however doing so appears to cause unexpected behaviour!
b.is$Final = true;
set = set.add(typeDecl);
}
else if(t instanceof InterfaceDecl) {
InterfaceDecl interfaceDecl = (InterfaceDecl)t;
typeDecl = interfaceDecl.substitutedInterfaceDecl(this);
b = new MemberInterfaceDecl((InterfaceDecl)typeDecl);
addBodyDecl(b);
// Here we should access b through an ordinary
// child accessor instead of setting is$Final directly,
// however doing so appears to cause unexpected behaviour!
b.is$Final = true;
set = set.add(typeDecl);
}
}
* and replacing with:
*/
if(t.isStatic()) {
set = set.add(t);
} else if (t instanceof ClassDecl) {
MemberClassDecl copy = ((BodyDeclList)getBodyDeclList()).localClassDeclCopy((ClassDecl)t, this);
set = set.add(copy.getClassDecl());
} else if (t instanceof InterfaceDecl) {
MemberInterfaceDecl copy = ((BodyDeclList)getBodyDeclList()).localInterfaceDeclCopy((InterfaceDecl)t, this);
set = set.add(copy.getInterfaceDecl());
}
}
return set;
}
/**
* @apilevel internal
*/
protected boolean constructors_computed = false;
/**
* @apilevel internal
*/
protected Collection constructors_value;
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1213
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection constructors() {
if(constructors_computed) {
return constructors_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
constructors_value = constructors_compute();
if(isFinal && num == state().boundariesCrossed) constructors_computed = true;
return constructors_value;
}
/**
* @apilevel internal
*/
private Collection constructors_compute() {
Collection set = new ArrayList();
for(Iterator iter = original().constructors().iterator(); iter.hasNext(); ) {
ConstructorDecl c = (ConstructorDecl)iter.next();
/* ES: removing this:
BodyDecl b = c.substitutedBodyDecl(this);
addBodyDecl(b);
// Here we should access b through an ordinary
// child accessor instead of setting is$Final directly,
// however doing so appears to cause unexpected behaviour!
b.is$Final = true;
* and replacing with:
*/
BodyDecl b = ((BodyDeclList)getBodyDeclList()).constructorCopy(c, this);
set.add(b);
}
return set;
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 35,061
| 30.845595
| 201
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/GenericMethodDecl.java
|
/* 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 GenericMethodDecl : {@link MethodDecl} ::= <span class="component">TypeParameter:{@link TypeVariable}*</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethods.ast:2
*/
public class GenericMethodDecl extends MethodDecl implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
rawMethodDecl_computed = false;
rawMethodDecl_value = null;
lookupParMethodDecl_java_util_List_values = null;
lookupParMethodDecl_java_util_List_list = null; }
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GenericMethodDecl clone() throws CloneNotSupportedException {
GenericMethodDecl node = (GenericMethodDecl)super.clone();
node.rawMethodDecl_computed = false;
node.rawMethodDecl_value = null;
node.lookupParMethodDecl_java_util_List_values = null;
node.lookupParMethodDecl_java_util_List_list = null; node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public GenericMethodDecl copy() {
try {
GenericMethodDecl node = (GenericMethodDecl) 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 GenericMethodDecl fullCopy() {
GenericMethodDecl tree = (GenericMethodDecl) 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 GenericMethods
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethods.jrag:103
*/
public ParMethodDecl newParMethodDecl(java.util.List typeArguments) {
ParMethodDecl methodDecl = typeArguments.isEmpty() ? new RawMethodDecl() : new ParMethodDecl();
// adding a link to GenericMethodDecl to be used during substitution
// instead of the not yet existing parent link
methodDecl.setGenericMethodDecl(this);
List list = new List();
if(typeArguments.isEmpty()) {
GenericMethodDecl original = original();
for(int i = 0; i < original.getNumTypeParameter(); i++)
list.add(original.getTypeParameter(i).erasure().createBoundAccess());
}
else {
for(Iterator iter = typeArguments.iterator(); iter.hasNext(); )
list.add(((TypeDecl)iter.next()).createBoundAccess());
}
methodDecl.setTypeArgumentList(list);
methodDecl.setModifiers((Modifiers)getModifiers().fullCopy());
methodDecl.setTypeAccess(getTypeAccess().type().substituteReturnType(methodDecl));
methodDecl.setID(getID());
methodDecl.setParameterList(getParameterList().substitute(methodDecl));
methodDecl.setExceptionList(getExceptionList().substitute(methodDecl));
return methodDecl;
}
/**
* @ast method
* @aspect GenericMethodsPrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethods.jrag:216
*/
private void ppTypeParameters(StringBuffer s) {
s.append(" <");
for(int i = 0; i < getNumTypeParameter(); i++) {
if(i != 0) s.append(", ");
original().getTypeParameter(i).toString(s);
}
s.append("> ");
}
/**
* @ast method
* @aspect GenericMethodsPrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethods.jrag:225
*/
public void toString(StringBuffer s) {
s.append(indent());
getModifiers().toString(s);
ppTypeParameters(s);
getTypeAccess().toString(s);
s.append(" " + getID());
s.append("(");
if(getNumParameter() > 0) {
getParameter(0).toString(s);
for(int i = 1; i < getNumParameter(); i++) {
s.append(", ");
getParameter(i).toString(s);
}
}
s.append(")");
if(getNumException() > 0) {
s.append(" throws ");
getException(0).toString(s);
for(int i = 1; i < getNumException(); i++) {
s.append(", ");
getException(i).toString(s);
}
}
if(hasBlock()) {
s.append(" ");
getBlock().toString(s);
}
else {
s.append(";\n");
}
}
/**
* @ast method
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1261
*/
public BodyDecl substitutedBodyDecl(Parameterization parTypeDecl) {
//System.out.println("Begin substituting generic " + signature() + " in " + hostType().typeName() + " with " + parTypeDecl.typeSignature());
GenericMethodDecl m = new GenericMethodDecl(
(Modifiers)getModifiers().fullCopy(),
getTypeAccess().type().substituteReturnType(parTypeDecl),
getID(),
getParameterList().substitute(parTypeDecl),
getExceptionList().substitute(parTypeDecl),
new Opt(),
(List)getTypeParameterList().fullCopy()
);
m.original = this;
//System.out.println("End substituting generic " + signature());
return m;
}
/**
* @ast method
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1277
*/
public GenericMethodDecl original;
/**
* @ast method
*
*/
public GenericMethodDecl() {
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[6];
setChild(new List(), 2);
setChild(new List(), 3);
setChild(new Opt(), 4);
setChild(new List(), 5);
}
/**
* @ast method
*
*/
public GenericMethodDecl(Modifiers p0, Access p1, String p2, List<ParameterDeclaration> p3, List<Access> p4, Opt<Block> p5, List<TypeVariable> p6) {
setChild(p0, 0);
setChild(p1, 1);
setID(p2);
setChild(p3, 2);
setChild(p4, 3);
setChild(p5, 4);
setChild(p6, 5);
}
/**
* @ast method
*
*/
public GenericMethodDecl(Modifiers p0, Access p1, beaver.Symbol p2, List<ParameterDeclaration> p3, List<Access> p4, Opt<Block> p5, List<TypeVariable> p6) {
setChild(p0, 0);
setChild(p1, 1);
setID(p2);
setChild(p3, 2);
setChild(p4, 3);
setChild(p5, 4);
setChild(p6, 5);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 6;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Modifiers child.
* @apilevel low-level
* @ast method
*
*/
public Modifiers getModifiersNoTransform() {
return (Modifiers)getChildNoTransform(0);
}
/**
* Replaces the TypeAccess child.
* @param node The new node to replace the TypeAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setTypeAccess(Access node) {
setChild(node, 1);
}
/**
* Retrieves the TypeAccess child.
* @return The current node used as the TypeAccess child.
* @apilevel high-level
* @ast method
*
*/
public Access getTypeAccess() {
return (Access)getChild(1);
}
/**
* Retrieves the TypeAccess child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the TypeAccess child.
* @apilevel low-level
* @ast method
*
*/
public Access getTypeAccessNoTransform() {
return (Access)getChildNoTransform(1);
}
/**
* 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 Parameter list.
* @param list The new list node to be used as the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public void setParameterList(List<ParameterDeclaration> list) {
setChild(list, 2);
}
/**
* Retrieves the number of children in the Parameter list.
* @return Number of children in the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public int getNumParameter() {
return getParameterList().getNumChild();
}
/**
* Retrieves the number of children in the Parameter list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Parameter list.
* @apilevel low-level
* @ast method
*
*/
public int getNumParameterNoTransform() {
return getParameterListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Parameter list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Parameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public ParameterDeclaration getParameter(int i) {
return (ParameterDeclaration)getParameterList().getChild(i);
}
/**
* Append an element to the Parameter list.
* @param node The element to append to the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public void addParameter(ParameterDeclaration node) {
List<ParameterDeclaration> list = (parent == null || state == null) ? getParameterListNoTransform() : getParameterList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addParameterNoTransform(ParameterDeclaration node) {
List<ParameterDeclaration> list = getParameterListNoTransform();
list.addChild(node);
}
/**
* Replaces the Parameter 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 setParameter(ParameterDeclaration node, int i) {
List<ParameterDeclaration> list = getParameterList();
list.setChild(node, i);
}
/**
* Retrieves the Parameter list.
* @return The node representing the Parameter list.
* @apilevel high-level
* @ast method
*
*/
public List<ParameterDeclaration> getParameters() {
return getParameterList();
}
/**
* Retrieves the Parameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Parameter list.
* @apilevel low-level
* @ast method
*
*/
public List<ParameterDeclaration> getParametersNoTransform() {
return getParameterListNoTransform();
}
/**
* Retrieves the Parameter list.
* @return The node representing the Parameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<ParameterDeclaration> getParameterList() {
List<ParameterDeclaration> list = (List<ParameterDeclaration>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the Parameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Parameter list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<ParameterDeclaration> getParameterListNoTransform() {
return (List<ParameterDeclaration>)getChildNoTransform(2);
}
/**
* Replaces the Exception list.
* @param list The new list node to be used as the Exception list.
* @apilevel high-level
* @ast method
*
*/
public void setExceptionList(List<Access> list) {
setChild(list, 3);
}
/**
* Retrieves the number of children in the Exception list.
* @return Number of children in the Exception list.
* @apilevel high-level
* @ast method
*
*/
public int getNumException() {
return getExceptionList().getNumChild();
}
/**
* Retrieves the number of children in the Exception list.
* Calling this method will not trigger rewrites..
* @return Number of children in the Exception list.
* @apilevel low-level
* @ast method
*
*/
public int getNumExceptionNoTransform() {
return getExceptionListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the Exception list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the Exception list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getException(int i) {
return (Access)getExceptionList().getChild(i);
}
/**
* Append an element to the Exception list.
* @param node The element to append to the Exception list.
* @apilevel high-level
* @ast method
*
*/
public void addException(Access node) {
List<Access> list = (parent == null || state == null) ? getExceptionListNoTransform() : getExceptionList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addExceptionNoTransform(Access node) {
List<Access> list = getExceptionListNoTransform();
list.addChild(node);
}
/**
* Replaces the Exception 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 setException(Access node, int i) {
List<Access> list = getExceptionList();
list.setChild(node, i);
}
/**
* Retrieves the Exception list.
* @return The node representing the Exception list.
* @apilevel high-level
* @ast method
*
*/
public List<Access> getExceptions() {
return getExceptionList();
}
/**
* Retrieves the Exception list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Exception list.
* @apilevel low-level
* @ast method
*
*/
public List<Access> getExceptionsNoTransform() {
return getExceptionListNoTransform();
}
/**
* Retrieves the Exception list.
* @return The node representing the Exception list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getExceptionList() {
List<Access> list = (List<Access>)getChild(3);
list.getNumChild();
return list;
}
/**
* Retrieves the Exception list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the Exception list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<Access> getExceptionListNoTransform() {
return (List<Access>)getChildNoTransform(3);
}
/**
* Replaces the optional node for the Block child. This is the {@code Opt} node containing the child Block, not the actual child!
* @param opt The new node to be used as the optional node for the Block child.
* @apilevel low-level
* @ast method
*
*/
public void setBlockOpt(Opt<Block> opt) {
setChild(opt, 4);
}
/**
* Check whether the optional Block child exists.
* @return {@code true} if the optional Block child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasBlock() {
return getBlockOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) Block child.
* @return The Block child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Block getBlock() {
return (Block)getBlockOpt().getChild(0);
}
/**
* Replaces the (optional) Block child.
* @param node The new node to be used as the Block child.
* @apilevel high-level
* @ast method
*
*/
public void setBlock(Block node) {
getBlockOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Block> getBlockOpt() {
return (Opt<Block>)getChild(4);
}
/**
* Retrieves the optional node for child Block. This is the {@code Opt} node containing the child Block, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child Block.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Block> getBlockOptNoTransform() {
return (Opt<Block>)getChildNoTransform(4);
}
/**
* Replaces the TypeParameter list.
* @param list The new list node to be used as the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public void setTypeParameterList(List<TypeVariable> list) {
setChild(list, 5);
}
/**
* Retrieves the number of children in the TypeParameter list.
* @return Number of children in the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public int getNumTypeParameter() {
return getTypeParameterList().getNumChild();
}
/**
* Retrieves the number of children in the TypeParameter list.
* Calling this method will not trigger rewrites..
* @return Number of children in the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
public int getNumTypeParameterNoTransform() {
return getTypeParameterListNoTransform().getNumChildNoTransform();
}
/**
* Retrieves the element at index {@code i} in the TypeParameter list..
* @param i Index of the element to return.
* @return The element at position {@code i} in the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeVariable getTypeParameter(int i) {
return (TypeVariable)getTypeParameterList().getChild(i);
}
/**
* Append an element to the TypeParameter list.
* @param node The element to append to the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public void addTypeParameter(TypeVariable node) {
List<TypeVariable> list = (parent == null || state == null) ? getTypeParameterListNoTransform() : getTypeParameterList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addTypeParameterNoTransform(TypeVariable node) {
List<TypeVariable> list = getTypeParameterListNoTransform();
list.addChild(node);
}
/**
* Replaces the TypeParameter 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 setTypeParameter(TypeVariable node, int i) {
List<TypeVariable> list = getTypeParameterList();
list.setChild(node, i);
}
/**
* Retrieves the TypeParameter list.
* @return The node representing the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
public List<TypeVariable> getTypeParameters() {
return getTypeParameterList();
}
/**
* Retrieves the TypeParameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
public List<TypeVariable> getTypeParametersNoTransform() {
return getTypeParameterListNoTransform();
}
/**
* Retrieves the TypeParameter list.
* @return The node representing the TypeParameter list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<TypeVariable> getTypeParameterList() {
List<TypeVariable> list = (List<TypeVariable>)getChild(5);
list.getNumChild();
return list;
}
/**
* Retrieves the TypeParameter list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the TypeParameter list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<TypeVariable> getTypeParameterListNoTransform() {
return (List<TypeVariable>)getChildNoTransform(5);
}
/**
* @apilevel internal
*/
protected boolean rawMethodDecl_computed = false;
/**
* @apilevel internal
*/
protected MethodDecl rawMethodDecl_value;
/**
* @attribute syn
* @aspect GenericMethods
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethods.jrag:34
*/
@SuppressWarnings({"unchecked", "cast"})
public MethodDecl rawMethodDecl() {
if(rawMethodDecl_computed) {
return rawMethodDecl_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
rawMethodDecl_value = rawMethodDecl_compute();
if(true) rawMethodDecl_computed = true;
return rawMethodDecl_value;
}
/**
* @apilevel internal
*/
private MethodDecl rawMethodDecl_compute() { return lookupParMethodDecl(new ArrayList()); }
/**
* @apilevel internal
*/
protected java.util.Map lookupParMethodDecl_java_util_List_values;
/**
* @apilevel internal
*/
protected List lookupParMethodDecl_java_util_List_list;
/* ES: replacing this:
syn lazy MethodDecl GenericMethodDecl.lookupParMethodDecl(java.util.List typeArguments) {
l: for(int i = 0; i < getNumParMethodDecl(); i++) {
ParMethodDecl decl = getParMethodDecl(i);
if(decl instanceof RawMethodDecl) {
if(typeArguments.isEmpty())
return decl;
}
else if(decl.getNumTypeArgument() == typeArguments.size()) {
for(int j = 0; j < decl.getNumTypeArgument(); j++)
if(decl.getTypeArgument(j).type() != typeArguments.get(j))
continue l;
return decl;
}
}
return newParMethodDecl(typeArguments);
}
with:
* @attribute syn
* @aspect GenericMethods
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethods.jrag:74
*/
@SuppressWarnings({"unchecked", "cast"})
public MethodDecl lookupParMethodDecl(java.util.List typeArguments) {
Object _parameters = typeArguments;
if(lookupParMethodDecl_java_util_List_values == null) lookupParMethodDecl_java_util_List_values = new java.util.HashMap(4);
if(lookupParMethodDecl_java_util_List_values.containsKey(_parameters)) {
return (MethodDecl)lookupParMethodDecl_java_util_List_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
MethodDecl lookupParMethodDecl_java_util_List_value = lookupParMethodDecl_compute(typeArguments);
if(lookupParMethodDecl_java_util_List_list == null) {
lookupParMethodDecl_java_util_List_list = new List();
lookupParMethodDecl_java_util_List_list.is$Final = true;
lookupParMethodDecl_java_util_List_list.setParent(this);
}
lookupParMethodDecl_java_util_List_list.add(lookupParMethodDecl_java_util_List_value);
if(lookupParMethodDecl_java_util_List_value != null) {
lookupParMethodDecl_java_util_List_value.is$Final = true;
}
if(true) lookupParMethodDecl_java_util_List_values.put(_parameters, lookupParMethodDecl_java_util_List_value);
return lookupParMethodDecl_java_util_List_value;
}
/**
* @apilevel internal
*/
private MethodDecl lookupParMethodDecl_compute(java.util.List typeArguments) {
return newParMethodDecl(typeArguments);
}
/**
* @attribute syn
* @aspect GenericMethodsNameAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethods.jrag:147
*/
public SimpleSet localLookupType(String name) {
ASTNode$State state = state();
try {
for(int i = 0; i < getNumTypeParameter(); i++) {
if(original().getTypeParameter(i).name().equals(name))
return SimpleSet.emptySet.add(original().getTypeParameter(i));
}
return SimpleSet.emptySet;
}
finally {
}
}
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1276
*/
public GenericMethodDecl original() {
ASTNode$State state = state();
try { return original != null ? original : this; }
finally {
}
}
/**
* @attribute inh
* @aspect GenericMethodsNameAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethods.jrag:146
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet lookupType(String name) {
ASTNode$State state = state();
SimpleSet lookupType_String_value = getParent().Define_SimpleSet_lookupType(this, null, name);
return lookupType_String_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethods.jrag:144
* @apilevel internal
*/
public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {
if(caller == getTypeParameterListNoTransform()) {
int childIndex = caller.getIndexOfChild(child);
return NameType.TYPE_NAME;
}
else { return super.Define_NameType_nameType(caller, child);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericMethods.jrag:154
* @apilevel internal
*/
public SimpleSet Define_SimpleSet_lookupType(ASTNode caller, ASTNode child, String name) {
{
int childIndex = this.getIndexOfChild(caller);
return localLookupType(name).isEmpty() ? lookupType(name) : localLookupType(name);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 28,471
| 29.289362
| 157
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/GenericTypeDecl.java
|
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;
/**
* @ast interface
*
*/
public interface GenericTypeDecl {
TypeDecl original();
int getNumTypeParameter();
TypeVariable getTypeParameter(int index);
List getTypeParameterList();
public String fullName();
public String typeName();
public TypeDecl makeGeneric(Signatures.ClassSignature s);
public SimpleSet addTypeVariables(SimpleSet c, String name);
public List createArgumentList(ArrayList params);
/**
* @attribute syn
* @aspect Generics
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:158
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isGenericType();
/**
* @attribute syn
* @aspect Generics
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:163
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl rawType();
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:708
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl lookupParTypeDecl(ParTypeAccess p);
/**
* @attribute syn
* @aspect LookupParTypeDecl
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:714
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl lookupParTypeDecl(ArrayList list);
}
| 1,940
| 23.884615
| 103
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/IdUse.java
|
/* 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 IdUse : {@link ASTNode} ::= <span class="component"><ID:String></span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:102
*/
public class IdUse extends ASTNode<ASTNode> implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public IdUse clone() throws CloneNotSupportedException {
IdUse node = (IdUse)super.clone();
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public IdUse copy() {
try {
IdUse node = (IdUse) 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 IdUse fullCopy() {
IdUse tree = (IdUse) 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
*
*/
public IdUse() {
super();
is$Final(true);
}
/**
* Initializes the child array to the correct size.
* Initializes List and Opt nta children.
* @apilevel internal
* @ast method
* @ast method
*
*/
public void init$Children() {
}
/**
* @ast method
*
*/
public IdUse(String p0) {
setID(p0);
is$Final(true);
}
/**
* @ast method
*
*/
public IdUse(beaver.Symbol p0) {
setID(p0);
is$Final(true);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* 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;
}
/**
* @apilevel internal
* @ast method
*
*/
/**
* @apilevel internal
*/
protected String tokenString_ID;
/**
* @ast method
*
*/
public int IDstart;
/**
* @ast method
*
*/
public int IDend;
/**
* 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 : "";
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 4,271
| 20.467337
| 96
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/IfStmt.java
|
/* 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 IfStmt : {@link Stmt} ::= <span class="component">Condition:{@link Expr}</span> <span class="component">Then:{@link Stmt}</span> <span class="component">[Else:{@link Stmt}]</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:207
*/
public class IfStmt extends Stmt implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
isDAafter_Variable_values = null;
isDUafter_Variable_values = null;
canCompleteNormally_computed = false;
else_branch_label_computed = false;
else_branch_label_value = null;
then_branch_label_computed = false;
then_branch_label_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public IfStmt clone() throws CloneNotSupportedException {
IfStmt node = (IfStmt)super.clone();
node.isDAafter_Variable_values = null;
node.isDUafter_Variable_values = null;
node.canCompleteNormally_computed = false;
node.else_branch_label_computed = false;
node.else_branch_label_value = null;
node.then_branch_label_computed = false;
node.then_branch_label_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public IfStmt copy() {
try {
IfStmt node = (IfStmt) 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 IfStmt fullCopy() {
IfStmt tree = (IfStmt) 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 NodeConstructors
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NodeConstructors.jrag:66
*/
public IfStmt(Expr cond, Stmt thenBranch) {
this(cond, thenBranch, new Opt());
}
/**
* @ast method
* @aspect NodeConstructors
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NodeConstructors.jrag:70
*/
public IfStmt(Expr cond, Stmt thenBranch, Stmt elseBranch) {
this(cond, thenBranch, new Opt(elseBranch));
}
/**
* @ast method
* @aspect PrettyPrint
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:574
*/
public void toString(StringBuffer s) {
s.append(indent());
s.append("if(");
getCondition().toString(s);
s.append(") ");
getThen().toString(s);
if(hasElse()) {
s.append(indent());
s.append("else ");
getElse().toString(s);
}
}
/**
* @ast method
* @aspect TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:316
*/
public void typeCheck() {
TypeDecl cond = getCondition().type();
if(!cond.isBoolean()) {
error("the type of \"" + getCondition() + "\" is " + cond.name() + " which is not boolean");
}
}
/**
* @ast method
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:115
*/
public void jimplify2(Body b) {
soot.jimple.Stmt endBranch = newLabel();
if(getCondition().isConstant()) {
if(getCondition().isTrue())
getThen().jimplify2(b);
else if(getCondition().isFalse() && hasElse())
getElse().jimplify2(b);
}
else {
soot.jimple.Stmt elseBranch = else_branch_label();
soot.jimple.Stmt thenBranch = then_branch_label();
getCondition().emitEvalBranch(b);
b.addLabel(thenBranch);
getThen().jimplify2(b);
if(getThen().canCompleteNormally() && hasElse()) {
b.setLine(this);
b.add(b.newGotoStmt(endBranch, this));
}
b.addLabel(elseBranch);
if(hasElse())
getElse().jimplify2(b);
}
if(getThen().canCompleteNormally() && hasElse())
b.addLabel(endBranch);
}
/**
* @ast method
*
*/
public IfStmt() {
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[3];
setChild(new Opt(), 2);
}
/**
* @ast method
*
*/
public IfStmt(Expr p0, Stmt p1, Opt<Stmt> p2) {
setChild(p0, 0);
setChild(p1, 1);
setChild(p2, 2);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the Condition child.
* @param node The new node to replace the Condition child.
* @apilevel high-level
* @ast method
*
*/
public void setCondition(Expr node) {
setChild(node, 0);
}
/**
* Retrieves the Condition child.
* @return The current node used as the Condition child.
* @apilevel high-level
* @ast method
*
*/
public Expr getCondition() {
return (Expr)getChild(0);
}
/**
* Retrieves the Condition child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Condition child.
* @apilevel low-level
* @ast method
*
*/
public Expr getConditionNoTransform() {
return (Expr)getChildNoTransform(0);
}
/**
* Replaces the Then child.
* @param node The new node to replace the Then child.
* @apilevel high-level
* @ast method
*
*/
public void setThen(Stmt node) {
setChild(node, 1);
}
/**
* Retrieves the Then child.
* @return The current node used as the Then child.
* @apilevel high-level
* @ast method
*
*/
public Stmt getThen() {
return (Stmt)getChild(1);
}
/**
* Retrieves the Then child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Then child.
* @apilevel low-level
* @ast method
*
*/
public Stmt getThenNoTransform() {
return (Stmt)getChildNoTransform(1);
}
/**
* Replaces the optional node for the Else child. This is the {@code Opt} node containing the child Else, not the actual child!
* @param opt The new node to be used as the optional node for the Else child.
* @apilevel low-level
* @ast method
*
*/
public void setElseOpt(Opt<Stmt> opt) {
setChild(opt, 2);
}
/**
* Check whether the optional Else child exists.
* @return {@code true} if the optional Else child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasElse() {
return getElseOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) Else child.
* @return The Else child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Stmt getElse() {
return (Stmt)getElseOpt().getChild(0);
}
/**
* Replaces the (optional) Else child.
* @param node The new node to be used as the Else child.
* @apilevel high-level
* @ast method
*
*/
public void setElse(Stmt node) {
getElseOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Stmt> getElseOpt() {
return (Opt<Stmt>)getChild(2);
}
/**
* Retrieves the optional node for child Else. This is the {@code Opt} node containing the child Else, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child Else.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Stmt> getElseOptNoTransform() {
return (Opt<Stmt>)getChildNoTransform(2);
}
protected java.util.Map isDAafter_Variable_values;
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:525
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDAafter(Variable v) {
Object _parameters = v;
if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4);
if(isDAafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDAafter_Variable_value = isDAafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value));
return isDAafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDAafter_compute(Variable v) { return hasElse() ? getThen().isDAafter(v) && getElse().isDAafter(v) : getThen().isDAafter(v) && getCondition().isDAafterFalse(v); }
protected java.util.Map isDUafter_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:994
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDUafter(Variable v) {
Object _parameters = v;
if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4);
if(isDUafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDUafter_Variable_value = isDUafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value));
return isDUafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDUafter_compute(Variable v) { return hasElse() ? getThen().isDUafter(v) && getElse().isDUafter(v) : getThen().isDUafter(v) && getCondition().isDUafterFalse(v); }
/**
* @apilevel internal
*/
protected boolean canCompleteNormally_computed = false;
/**
* @apilevel internal
*/
protected boolean canCompleteNormally_value;
/**
* @attribute syn
* @aspect UnreachableStatements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:141
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean canCompleteNormally() {
if(canCompleteNormally_computed) {
return canCompleteNormally_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
canCompleteNormally_value = canCompleteNormally_compute();
if(isFinal && num == state().boundariesCrossed) canCompleteNormally_computed = true;
return canCompleteNormally_value;
}
/**
* @apilevel internal
*/
private boolean canCompleteNormally_compute() { return (reachable() && !hasElse()) || (getThen().canCompleteNormally() ||
(hasElse() && getElse().canCompleteNormally())); }
/**
* @attribute syn
* @aspect BooleanExpressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:21
*/
public boolean definesLabel() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean else_branch_label_computed = false;
/**
* @apilevel internal
*/
protected soot.jimple.Stmt else_branch_label_value;
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:113
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt else_branch_label() {
if(else_branch_label_computed) {
return else_branch_label_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
else_branch_label_value = else_branch_label_compute();
if(isFinal && num == state().boundariesCrossed) else_branch_label_computed = true;
return else_branch_label_value;
}
/**
* @apilevel internal
*/
private soot.jimple.Stmt else_branch_label_compute() { return newLabel(); }
/**
* @apilevel internal
*/
protected boolean then_branch_label_computed = false;
/**
* @apilevel internal
*/
protected soot.jimple.Stmt then_branch_label_value;
/**
* @attribute syn
* @aspect Statements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Statements.jrag:114
*/
@SuppressWarnings({"unchecked", "cast"})
public soot.jimple.Stmt then_branch_label() {
if(then_branch_label_computed) {
return then_branch_label_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
then_branch_label_value = then_branch_label_compute();
if(isFinal && num == state().boundariesCrossed) then_branch_label_computed = true;
return then_branch_label_value;
}
/**
* @apilevel internal
*/
private soot.jimple.Stmt then_branch_label_compute() { return newLabel(); }
/**
* @attribute syn
* @aspect PreciseRethrow
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/PreciseRethrow.jrag:55
*/
public boolean modifiedInScope(Variable var) {
ASTNode$State state = state();
try {
if (getThen().modifiedInScope(var))
return true;
return hasElse() && getElse().modifiedInScope(var);
}
finally {
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:528
* @apilevel internal
*/
public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) {
if(caller == getElseOptNoTransform()) {
return getCondition().isDAafterFalse(v);
}
else if(caller == getThenNoTransform()) {
return getCondition().isDAafterTrue(v);
}
else if(caller == getConditionNoTransform()) {
return isDAbefore(v);
}
else { return getParent().Define_boolean_isDAbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:997
* @apilevel internal
*/
public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) {
if(caller == getElseOptNoTransform()) {
return getCondition().isDUafterFalse(v);
}
else if(caller == getThenNoTransform()) {
return getCondition().isDUafterTrue(v);
}
else if(caller == getConditionNoTransform()) {
return isDUbefore(v);
}
else { return getParent().Define_boolean_isDUbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:144
* @apilevel internal
*/
public boolean Define_boolean_reachable(ASTNode caller, ASTNode child) {
if(caller == getElseOptNoTransform()) {
return reachable();
}
else if(caller == getThenNoTransform()) {
return reachable();
}
else { return getParent().Define_boolean_reachable(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:150
* @apilevel internal
*/
public boolean Define_boolean_reportUnreachable(ASTNode caller, ASTNode child) {
if(caller == getElseOptNoTransform()) {
return reachable();
}
else if(caller == getThenNoTransform()) {
return reachable();
}
else { return getParent().Define_boolean_reportUnreachable(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:38
* @apilevel internal
*/
public soot.jimple.Stmt Define_soot_jimple_Stmt_condition_false_label(ASTNode caller, ASTNode child) {
if(caller == getConditionNoTransform()) {
return else_branch_label();
}
else { return getParent().Define_soot_jimple_Stmt_condition_false_label(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/BooleanExpressions.jrag:39
* @apilevel internal
*/
public soot.jimple.Stmt Define_soot_jimple_Stmt_condition_true_label(ASTNode caller, ASTNode child) {
if(caller == getConditionNoTransform()) {
return then_branch_label();
}
else { return getParent().Define_soot_jimple_Stmt_condition_true_label(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 18,351
| 29.791946
| 195
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/IllegalLiteral.java
|
/* 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;
/**
* Literal produced when the compiler tries to parse
* a malformatted NumericLiteral.
* This literal kind has an associated error message.
* @production IllegalLiteral : {@link Literal};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Literals.ast:11
*/
public class IllegalLiteral extends Literal implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
type_computed = false;
type_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public IllegalLiteral clone() throws CloneNotSupportedException {
IllegalLiteral node = (IllegalLiteral)super.clone();
node.type_computed = false;
node.type_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public IllegalLiteral copy() {
try {
IllegalLiteral node = (IllegalLiteral) 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 IllegalLiteral fullCopy() {
IllegalLiteral tree = (IllegalLiteral) 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;
}
/**
* Error processing for literals.
* Include the token range from parsing.
* @ast method
* @aspect Literals
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Literals.jrag:469
*/
public void collectErrors() {
int line = getLine(LITERALstart);
int column = getColumn(LITERALstart);
int endLine = getLine(LITERALend);
int endColumn = getColumn(LITERALend);
compilationUnit().errors.add(new Problem(sourceFile(),
getLITERAL(), line, column, endLine, endColumn,
Problem.Severity.ERROR, Problem.Kind.LEXICAL));
}
/**
* @ast method
*
*/
public IllegalLiteral() {
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() {
}
/**
* @ast method
*
*/
public IllegalLiteral(String p0) {
setLITERAL(p0);
}
/**
* @ast method
*
*/
public IllegalLiteral(beaver.Symbol p0) {
setLITERAL(p0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 0;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the lexeme LITERAL.
* @param value The new value for the lexeme LITERAL.
* @apilevel high-level
* @ast method
*
*/
public void setLITERAL(String value) {
tokenString_LITERAL = value;
}
/**
* JastAdd-internal setter for lexeme LITERAL using the Beaver parser.
* @apilevel internal
* @ast method
*
*/
public void setLITERAL(beaver.Symbol symbol) {
if(symbol.value != null && !(symbol.value instanceof String))
throw new UnsupportedOperationException("setLITERAL is only valid for String lexemes");
tokenString_LITERAL = (String)symbol.value;
LITERALstart = symbol.getStart();
LITERALend = symbol.getEnd();
}
/**
* Retrieves the value for the lexeme LITERAL.
* @return The value for the lexeme LITERAL.
* @apilevel high-level
* @ast method
*
*/
public String getLITERAL() {
return tokenString_LITERAL != null ? tokenString_LITERAL : "";
}
/**
* @apilevel internal
*/
protected boolean type_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl type_value;
/**
* The type of an IllegalLiteral does not matter,
* as it is only a placeholder literal for error messages.
* @attribute syn
* @aspect Literals
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/Literals.jrag:457
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl type() {
if(type_computed) {
return type_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
type_value = type_compute();
if(isFinal && num == state().boundariesCrossed) type_computed = true;
return type_value;
}
/**
* @apilevel internal
*/
private TypeDecl type_compute() { return unknownType(); }
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 5,822
| 24.539474
| 101
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/ImportDecl.java
|
/* 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 ImportDecl : {@link ASTNode} ::= <span class="component">{@link Access}</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:10
*/
public abstract class ImportDecl extends ASTNode<ASTNode> implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
importedTypes_String_values = null;
importedFields_String_values = null;
importedMethods_String_values = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public ImportDecl clone() throws CloneNotSupportedException {
ImportDecl node = (ImportDecl)super.clone();
node.importedTypes_String_values = null;
node.importedFields_String_values = null;
node.importedMethods_String_values = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @ast method
*
*/
public ImportDecl() {
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[1];
}
/**
* @ast method
*
*/
public ImportDecl(Access p0) {
setChild(p0, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 1;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Access child.
* @apilevel low-level
* @ast method
*
*/
public Access getAccessNoTransform() {
return (Access)getChildNoTransform(0);
}
protected java.util.Map importedTypes_String_values;
/**
* @attribute syn
* @aspect TypeScopePropagation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:322
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet importedTypes(String name) {
Object _parameters = name;
if(importedTypes_String_values == null) importedTypes_String_values = new java.util.HashMap(4);
if(importedTypes_String_values.containsKey(_parameters)) {
return (SimpleSet)importedTypes_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet importedTypes_String_value = importedTypes_compute(name);
if(isFinal && num == state().boundariesCrossed) importedTypes_String_values.put(_parameters, importedTypes_String_value);
return importedTypes_String_value;
}
/**
* @apilevel internal
*/
private SimpleSet importedTypes_compute(String name) { return SimpleSet.emptySet; }
/**
* @attribute syn
* @aspect TypeScopePropagation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:351
*/
public boolean isOnDemand() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect Names
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/QualifiedNames.jrag:51
*/
public String typeName() {
ASTNode$State state = state();
try {
Access a = getAccess().lastAccess();
String name = a.isTypeAccess() ? ((TypeAccess)a).nameWithPackage() : "";
while(a.hasPrevExpr() && a.prevExpr() instanceof Access) {
Access pred = (Access)a.prevExpr();
if(pred.isTypeAccess())
name = ((TypeAccess)pred).nameWithPackage() + "." + name;
a = pred;
}
return name;
}
finally {
}
}
protected java.util.Map importedFields_String_values;
/**
* @attribute syn
* @aspect StaticImports
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/StaticImports.jrag:30
*/
@SuppressWarnings({"unchecked", "cast"})
public SimpleSet importedFields(String name) {
Object _parameters = name;
if(importedFields_String_values == null) importedFields_String_values = new java.util.HashMap(4);
if(importedFields_String_values.containsKey(_parameters)) {
return (SimpleSet)importedFields_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
SimpleSet importedFields_String_value = importedFields_compute(name);
if(isFinal && num == state().boundariesCrossed) importedFields_String_values.put(_parameters, importedFields_String_value);
return importedFields_String_value;
}
/**
* @apilevel internal
*/
private SimpleSet importedFields_compute(String name) { return SimpleSet.emptySet; }
protected java.util.Map importedMethods_String_values;
/**
* @attribute syn
* @aspect StaticImports
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/StaticImports.jrag:41
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection importedMethods(String name) {
Object _parameters = name;
if(importedMethods_String_values == null) importedMethods_String_values = new java.util.HashMap(4);
if(importedMethods_String_values.containsKey(_parameters)) {
return (Collection)importedMethods_String_values.get(_parameters);
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
Collection importedMethods_String_value = importedMethods_compute(name);
if(isFinal && num == state().boundariesCrossed) importedMethods_String_values.put(_parameters, importedMethods_String_value);
return importedMethods_String_value;
}
/**
* @apilevel internal
*/
private Collection importedMethods_compute(String name) { return Collections.EMPTY_LIST; }
/**
* @attribute inh
* @aspect TypeScopePropagation
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/LookupType.jrag:349
*/
@SuppressWarnings({"unchecked", "cast"})
public String packageName() {
ASTNode$State state = state();
String packageName_value = getParent().Define_String_packageName(this, null);
return packageName_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:23
* @apilevel internal
*/
public boolean Define_boolean_isDest(ASTNode caller, ASTNode child) {
if(caller == getAccessNoTransform()) {
return false;
}
else { return getParent().Define_boolean_isDest(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:32
* @apilevel internal
*/
public boolean Define_boolean_isSource(ASTNode caller, ASTNode child) {
if(caller == getAccessNoTransform()) {
return true;
}
else { return getParent().Define_boolean_isSource(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 8,363
| 29.525547
| 131
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/InstanceInitializer.java
|
/* 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 InstanceInitializer : {@link BodyDecl} ::= <span class="component">{@link Block}</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:73
*/
public class InstanceInitializer extends BodyDecl implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
exceptions_computed = false;
exceptions_value = null;
isDAafter_Variable_values = null;
isDUafter_Variable_values = null;
handlesException_TypeDecl_values = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public InstanceInitializer clone() throws CloneNotSupportedException {
InstanceInitializer node = (InstanceInitializer)super.clone();
node.exceptions_computed = false;
node.exceptions_value = null;
node.isDAafter_Variable_values = null;
node.isDUafter_Variable_values = null;
node.handlesException_TypeDecl_values = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public InstanceInitializer copy() {
try {
InstanceInitializer node = (InstanceInitializer) 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 InstanceInitializer fullCopy() {
InstanceInitializer tree = (InstanceInitializer) 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:106
*/
public void toString(StringBuffer s) {
if(getBlock().getNumStmt() == 0) return;
s.append(indent());
getBlock().toString(s);
}
/**
* @ast method
* @aspect UnreachableStatements
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:22
*/
void checkUnreachableStmt() {
if(!getBlock().canCompleteNormally())
error("instance initializer in " + hostType().fullName() + " can not complete normally");
}
/**
* @ast method
*
*/
public InstanceInitializer() {
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[1];
}
/**
* @ast method
*
*/
public InstanceInitializer(Block p0) {
setChild(p0, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 1;
}
/**
* @apilevel internal
* @ast method
*
*/
public boolean mayHaveRewrite() {
return false;
}
/**
* Replaces the Block child.
* @param node The new node to replace the Block child.
* @apilevel high-level
* @ast method
*
*/
public void setBlock(Block node) {
setChild(node, 0);
}
/**
* Retrieves the Block child.
* @return The current node used as the Block child.
* @apilevel high-level
* @ast method
*
*/
public Block getBlock() {
return (Block)getChild(0);
}
/**
* Retrieves the Block child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Block child.
* @apilevel low-level
* @ast method
*
*/
public Block getBlockNoTransform() {
return (Block)getChildNoTransform(0);
}
/**
* @apilevel internal
*/
protected boolean exceptions_computed = false;
/**
* @apilevel internal
*/
protected Collection exceptions_value;
/**
* @attribute syn
* @aspect AnonymousClasses
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/AnonymousClasses.jrag:191
*/
@SuppressWarnings({"unchecked", "cast"})
public Collection exceptions() {
if(exceptions_computed) {
return exceptions_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
exceptions_value = exceptions_compute();
if(isFinal && num == state().boundariesCrossed) exceptions_computed = true;
return exceptions_value;
}
/**
* @apilevel internal
*/
private Collection exceptions_compute() {
HashSet set = new HashSet();
collectExceptions(set, this);
for(Iterator iter = set.iterator(); iter.hasNext(); ) {
TypeDecl typeDecl = (TypeDecl)iter.next();
if(!getBlock().reachedException(typeDecl))
iter.remove();
}
return set;
}
protected java.util.Map isDAafter_Variable_values;
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:292
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDAafter(Variable v) {
Object _parameters = v;
if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4);
if(isDAafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDAafter_Variable_value = isDAafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value));
return isDAafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDAafter_compute(Variable v) { return getBlock().isDAafter(v); }
protected java.util.Map isDUafter_Variable_values;
/**
* @attribute syn
* @aspect DU
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:749
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean isDUafter(Variable v) {
Object _parameters = v;
if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4);
if(isDUafter_Variable_values.containsKey(_parameters)) {
return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean isDUafter_Variable_value = isDUafter_compute(v);
if(isFinal && num == state().boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value));
return isDUafter_Variable_value;
}
/**
* @apilevel internal
*/
private boolean isDUafter_compute(Variable v) { return getBlock().isDUafter(v); }
protected java.util.Map handlesException_TypeDecl_values;
/**
* @attribute inh
* @aspect ExceptionHandling
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:46
*/
@SuppressWarnings({"unchecked", "cast"})
public boolean handlesException(TypeDecl exceptionType) {
Object _parameters = exceptionType;
if(handlesException_TypeDecl_values == null) handlesException_TypeDecl_values = new java.util.HashMap(4);
if(handlesException_TypeDecl_values.containsKey(_parameters)) {
return ((Boolean)handlesException_TypeDecl_values.get(_parameters)).booleanValue();
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boolean handlesException_TypeDecl_value = getParent().Define_boolean_handlesException(this, null, exceptionType);
if(isFinal && num == state().boundariesCrossed) handlesException_TypeDecl_values.put(_parameters, Boolean.valueOf(handlesException_TypeDecl_value));
return handlesException_TypeDecl_value;
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:438
* @apilevel internal
*/
public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) {
if(caller == getBlockNoTransform()) {
return isDAbefore(v);
}
else { return getParent().Define_boolean_isDAbefore(this, caller, v);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:180
* @apilevel internal
*/
public boolean Define_boolean_handlesException(ASTNode caller, ASTNode child, TypeDecl exceptionType) {
if(caller == getBlockNoTransform()){
if(hostType().isAnonymous())
return true;
if(!exceptionType.isUncheckedException())
return true;
for(Iterator iter = hostType().constructors().iterator(); iter.hasNext(); ) {
ConstructorDecl decl = (ConstructorDecl)iter.next();
if(!decl.throwsException(exceptionType))
return false;
}
return true;
}
else { return getParent().Define_boolean_handlesException(this, caller, exceptionType);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/NameCheck.jrag:248
* @apilevel internal
*/
public ASTNode Define_ASTNode_enclosingBlock(ASTNode caller, ASTNode child) {
if(caller == getBlockNoTransform()) {
return this;
}
else { return getParent().Define_ASTNode_enclosingBlock(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeHierarchyCheck.jrag:140
* @apilevel internal
*/
public boolean Define_boolean_inStaticContext(ASTNode caller, ASTNode child) {
if(caller == getBlockNoTransform()) {
return false;
}
else { return getParent().Define_boolean_inStaticContext(this, caller);
}
}
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:35
* @apilevel internal
*/
public boolean Define_boolean_reachable(ASTNode caller, ASTNode child) {
if(caller == getBlockNoTransform()) {
return true;
}
else { return getParent().Define_boolean_reachable(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 11,559
| 30.671233
| 154
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/InstanceOfExpr.java
|
/* 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 InstanceOfExpr : {@link Expr} ::= <span class="component">{@link Expr}</span> <span class="component">TypeAccess:{@link Access}</span>;
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:185
*/
public class InstanceOfExpr extends Expr implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
type_computed = false;
type_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public InstanceOfExpr clone() throws CloneNotSupportedException {
InstanceOfExpr node = (InstanceOfExpr)super.clone();
node.type_computed = false;
node.type_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public InstanceOfExpr copy() {
try {
InstanceOfExpr node = (InstanceOfExpr) 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 InstanceOfExpr fullCopy() {
InstanceOfExpr tree = (InstanceOfExpr) 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:421
*/
public void toString(StringBuffer s) {
getExpr().toString(s);
s.append(" instanceof ");
getTypeAccess().toString(s);
}
/**
* @ast method
* @aspect TypeCheck
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeCheck.jrag:235
*/
public void typeCheck() {
TypeDecl relationalExpr = getExpr().type();
TypeDecl referenceType = getTypeAccess().type();
if(!relationalExpr.isUnknown()) {
if(!relationalExpr.isReferenceType() && !relationalExpr.isNull())
error("The relational expression in instance of must be reference or null type");
if(!referenceType.isReferenceType())
error("The reference expression in instance of must be reference type");
if(!relationalExpr.castingConversionTo(referenceType))
error("The type " + relationalExpr.typeName() + " of the relational expression " +
getExpr() + " can not be cast into the type " + referenceType.typeName());
if(getExpr().isTypeAccess())
error("The relational expression " + getExpr() + " must not be a type name");
}
}
/**
* @ast method
* @aspect Expressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:902
*/
public soot.Value eval(Body b) {
return b.newInstanceOfExpr(
asImmediate(b, getExpr().eval(b)),
getTypeAccess().type().getSootType(),
this
);
}
/**
* @ast method
*
*/
public InstanceOfExpr() {
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 InstanceOfExpr(Expr p0, Access 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 Expr child.
* @param node The new node to replace the Expr child.
* @apilevel high-level
* @ast method
*
*/
public void setExpr(Expr node) {
setChild(node, 0);
}
/**
* Retrieves the Expr child.
* @return The current node used as the Expr child.
* @apilevel high-level
* @ast method
*
*/
public Expr getExpr() {
return (Expr)getChild(0);
}
/**
* Retrieves the Expr child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the Expr child.
* @apilevel low-level
* @ast method
*
*/
public Expr getExprNoTransform() {
return (Expr)getChildNoTransform(0);
}
/**
* Replaces the TypeAccess child.
* @param node The new node to replace the TypeAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setTypeAccess(Access node) {
setChild(node, 1);
}
/**
* Retrieves the TypeAccess child.
* @return The current node used as the TypeAccess child.
* @apilevel high-level
* @ast method
*
*/
public Access getTypeAccess() {
return (Access)getChild(1);
}
/**
* Retrieves the TypeAccess child.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The current node used as the TypeAccess child.
* @apilevel low-level
* @ast method
*
*/
public Access getTypeAccessNoTransform() {
return (Access)getChildNoTransform(1);
}
/**
* @attribute syn
* @aspect ConstantExpression
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java7Frontend/ConstantExpression.jrag:336
*/
public boolean isConstant() {
ASTNode$State state = state();
try { return false; }
finally {
}
}
/**
* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:333
*/
public boolean isDAafterFalse(Variable v) {
ASTNode$State state = state();
try { return isDAafter(v); }
finally {
}
}
/*eq Stmt.isDAafter(Variable v) {
//System.out.println("### isDAafter reached in " + getClass().getName());
//throw new NullPointerException();
throw new Error("Can not compute isDAafter for " + getClass().getName() + " at " + errorPrefix());
}* @attribute syn
* @aspect DA
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:332
*/
public boolean isDAafterTrue(Variable v) {
ASTNode$State state = state();
try { return isDAafter(v); }
finally {
}
}
/**
* @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 {
}
}
/**
* @apilevel internal
*/
protected boolean type_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl type_value;
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:361
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl type() {
if(type_computed) {
return type_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
type_value = type_compute();
if(isFinal && num == state().boundariesCrossed) type_computed = true;
return type_value;
}
/**
* @apilevel internal
*/
private TypeDecl type_compute() { return typeBoolean(); }
/**
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:89
* @apilevel internal
*/
public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) {
if(caller == getTypeAccessNoTransform()) {
return NameType.TYPE_NAME;
}
else { return getParent().Define_NameType_nameType(this, caller);
}
}
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 9,380
| 26.429825
| 150
|
java
|
soot
|
soot-master/src/main/generated/jastadd/soot/JastAddJ/IntType.java
|
/* 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 IntType : {@link IntegralType};
* @ast node
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/java.ast:58
*/
public class IntType extends IntegralType implements Cloneable {
/**
* @apilevel low-level
*/
public void flushCache() {
super.flushCache();
boxed_computed = false;
boxed_value = null;
jvmName_computed = false;
jvmName_value = null;
getSootType_computed = false;
getSootType_value = null;
}
/**
* @apilevel internal
*/
public void flushCollectionCache() {
super.flushCollectionCache();
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public IntType clone() throws CloneNotSupportedException {
IntType node = (IntType)super.clone();
node.boxed_computed = false;
node.boxed_value = null;
node.jvmName_computed = false;
node.jvmName_value = null;
node.getSootType_computed = false;
node.getSootType_value = null;
node.in$Circle(false);
node.is$Final(false);
return node;
}
/**
* @apilevel internal
*/
@SuppressWarnings({"unchecked", "cast"})
public IntType copy() {
try {
IntType node = (IntType) 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 IntType fullCopy() {
IntType tree = (IntType) 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:841
*/
public void toString(StringBuffer s) {
s.append("int");
}
/**
* @ast method
* @aspect Expressions
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:42
*/
public static soot.Value emitConstant(int i) {
return IntConstant.v(i);
}
/**
* @ast method
*
*/
public IntType() {
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[3];
setChild(new Opt(), 1);
setChild(new List(), 2);
}
/**
* @ast method
*
*/
public IntType(Modifiers p0, String p1, Opt<Access> p2, List<BodyDecl> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @ast method
*
*/
public IntType(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<BodyDecl> p3) {
setChild(p0, 0);
setID(p1);
setChild(p2, 1);
setChild(p3, 2);
}
/**
* @apilevel low-level
* @ast method
*
*/
protected int numChildren() {
return 3;
}
/**
* @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.
* <p><em>This method does not invoke AST transformations.</em></p>
* @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 optional node for the SuperClassAccess child. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* @param opt The new node to be used as the optional node for the SuperClassAccess child.
* @apilevel low-level
* @ast method
*
*/
public void setSuperClassAccessOpt(Opt<Access> opt) {
setChild(opt, 1);
}
/**
* Check whether the optional SuperClassAccess child exists.
* @return {@code true} if the optional SuperClassAccess child exists, {@code false} if it does not.
* @apilevel high-level
* @ast method
*
*/
public boolean hasSuperClassAccess() {
return getSuperClassAccessOpt().getNumChild() != 0;
}
/**
* Retrieves the (optional) SuperClassAccess child.
* @return The SuperClassAccess child, if it exists. Returns {@code null} otherwise.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Access getSuperClassAccess() {
return (Access)getSuperClassAccessOpt().getChild(0);
}
/**
* Replaces the (optional) SuperClassAccess child.
* @param node The new node to be used as the SuperClassAccess child.
* @apilevel high-level
* @ast method
*
*/
public void setSuperClassAccess(Access node) {
getSuperClassAccessOpt().setChild(node, 0);
}
/**
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOpt() {
return (Opt<Access>)getChild(1);
}
/**
* Retrieves the optional node for child SuperClassAccess. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child!
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The optional node for child SuperClassAccess.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public Opt<Access> getSuperClassAccessOptNoTransform() {
return (Opt<Access>)getChildNoTransform(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<BodyDecl> 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<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
list.addChild(node);
}
/**
* @apilevel low-level
* @ast method
*
*/
public void addBodyDeclNoTransform(BodyDecl node) {
List<BodyDecl> 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<BodyDecl> list = getBodyDeclList();
list.setChild(node, i);
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
public List<BodyDecl> getBodyDecls() {
return getBodyDeclList();
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
public List<BodyDecl> getBodyDeclsNoTransform() {
return getBodyDeclListNoTransform();
}
/**
* Retrieves the BodyDecl list.
* @return The node representing the BodyDecl list.
* @apilevel high-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclList() {
List<BodyDecl> list = (List<BodyDecl>)getChild(2);
list.getNumChild();
return list;
}
/**
* Retrieves the BodyDecl list.
* <p><em>This method does not invoke AST transformations.</em></p>
* @return The node representing the BodyDecl list.
* @apilevel low-level
* @ast method
*
*/
@SuppressWarnings({"unchecked", "cast"})
public List<BodyDecl> getBodyDeclListNoTransform() {
return (List<BodyDecl>)getChildNoTransform(2);
}
/**
* @attribute syn
* @aspect TypeAnalysis
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:191
*/
public boolean isInt() {
ASTNode$State state = state();
try { return true; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean boxed_computed = false;
/**
* @apilevel internal
*/
protected TypeDecl boxed_value;
/**
* @attribute syn
* @aspect AutoBoxing
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:40
*/
@SuppressWarnings({"unchecked", "cast"})
public TypeDecl boxed() {
if(boxed_computed) {
return boxed_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
boxed_value = boxed_compute();
if(isFinal && num == state().boundariesCrossed) boxed_computed = true;
return boxed_value;
}
/**
* @apilevel internal
*/
private TypeDecl boxed_compute() { return lookupType("java.lang", "Integer"); }
/**
* @apilevel internal
*/
protected boolean jvmName_computed = false;
/**
* @apilevel internal
*/
protected String jvmName_value;
/**
* @attribute syn
* @aspect Java2Rewrites
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Java2Rewrites.jrag:38
*/
@SuppressWarnings({"unchecked", "cast"})
public String jvmName() {
if(jvmName_computed) {
return jvmName_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
jvmName_value = jvmName_compute();
if(isFinal && num == state().boundariesCrossed) jvmName_computed = true;
return jvmName_value;
}
/**
* @apilevel internal
*/
private String jvmName_compute() { return "I"; }
/**
* @attribute syn
* @aspect Java2Rewrites
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Backend/Java2Rewrites.jrag:44
*/
public String primitiveClassName() {
ASTNode$State state = state();
try { return "Integer"; }
finally {
}
}
/**
* @apilevel internal
*/
protected boolean getSootType_computed = false;
/**
* @apilevel internal
*/
protected Type getSootType_value;
/**
* @attribute syn
* @aspect EmitJimple
* @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/EmitJimple.jrag:50
*/
@SuppressWarnings({"unchecked", "cast"})
public Type getSootType() {
if(getSootType_computed) {
return getSootType_value;
}
ASTNode$State state = state();
int num = state.boundariesCrossed;
boolean isFinal = this.is$Final();
getSootType_value = getSootType_compute();
if(isFinal && num == state().boundariesCrossed) getSootType_computed = true;
return getSootType_value;
}
/**
* @apilevel internal
*/
private Type getSootType_compute() { return soot.IntType.v(); }
/**
* @apilevel internal
*/
public ASTNode rewriteTo() {
return super.rewriteTo();
}
}
| 14,370
| 25.911985
| 153
|
java
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.