edu.uci.eecs.doc.cascade.controlflow
Class ReturnStatement
java.lang.Object
edu.uci.eecs.doc.cascade.controlflow.Node
edu.uci.eecs.doc.cascade.controlflow.Statement
edu.uci.eecs.doc.cascade.controlflow.ReturnStatement
- All Implemented Interfaces:
- Iterable<Node>
public class ReturnStatement
- extends Statement
Represents return statements in control flow graphs and trees. This also
includes implicit return instructions added by the compiler in methods that
return void.
- Author:
- Trevor Harmon
Methods inherited from class edu.uci.eecs.doc.cascade.controlflow.Node |
getBlock, getEnclosingLoop, getFirstInstruction, getInstructions, getLastInstruction, getMethodInvocations, getNext, getOutermostLoop, getParent, getScope, getSourceCodeLineNumber, getStartAddress, getTree, iterator, lastNode, setNext |
ReturnStatement
public ReturnStatement(Tree tree,
int scope,
Node parent,
ReturnBlock returnBlock,
List<InstructionHandle> instructions)
- Creates a new ReturnStatement object.
- Parameters:
tree
- the control flow tree to which this node belongsscope
- the lexical scope of the node (0 = top-level scope)parent
- the node's parent (null if the node has no parent)returnBlock
- a JODE object representing the return statementinstructions
- the list of instructions in the return statement's method
(the whole method, not just the statement)
getMethodInvocations
public List<MethodInvocation> getMethodInvocations()
- Returns the methods that this statement invokes.
- Overrides:
getMethodInvocations
in class Statement
- Returns:
- a set of Java method handles, or an empty set if this statement does
not invoke any methods
toString
public String toString()
- Converts the if-then-else construct to a string.
- Overrides:
toString
in class Statement
- Returns:
- a source-code-like string representing the return statement