|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectspiglet.meta.SpigletStatement
public final class SpigletStatement
This class represents the metadata of a single statement in a Spiglet thread.
It encodes the information necessary to do calculation on a control flow
graph. This includes the label of the statement (if it exists), the
def and use sets, the label of the statement that it can
jump to, and whether it falls through the next statement.
| Nested Class Summary | |
|---|---|
static class |
SpigletStatement.Type
|
| Field Summary | |
|---|---|
protected SpigletStatement.Type |
type
An enum value indicating what type this statement is. |
| Constructor Summary | |
|---|---|
SpigletStatement(Label lbl,
Stmt stmt)
Creates a statement metadata object. |
|
SpigletStatement(SimpleExp exp)
Creates a "statement" metadata object that encodes the information in a SimpleExp expression as if it was a statement. |
|
| Method Summary | |
|---|---|
java.util.Set<SpigletTemp> |
def()
Returns the set of variables that are in the def set of this
statement. |
boolean |
falls()
Returns true if this statement falls through the next one. |
SpigletLabel |
getJump()
Returns the label of the statement to where this statement can have a control flow to jump. |
SpigletLabel |
getLabel()
Returns the label that preclude this statement, if it exists. |
SpigletStatement.Type |
getType()
Returns the type of this statement. |
java.lang.String |
toString()
Returns a one line string representation of this Spiglet statement followed by its metadata, in the form (Label)? Stmt [def={...}, use={...}, jump=(Label), falls=(bool)]. |
java.util.Set<SpigletTemp> |
use()
Returns the set of variables that are in the use set of this
statement. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected SpigletStatement.Type type
| Constructor Detail |
|---|
public SpigletStatement(Label lbl,
Stmt stmt)
def and
use variables in the statement. The constructor method visits
and analyzes the given stmt node to generate the def
and use sets.
lbl - the label (optional) AST of the processed statementstmt - the Spiglet statement AST to be processedpublic SpigletStatement(SimpleExp exp)
SimpleExp expression as if it was a statement. Used in encoding
the use set of a returned expression in Spiglet. Ultimately,
as an exit block in a control flow graph. The "statement" is classified
as non-jumping, non-falling through, and label-less.
exp - the return expression to analyze| Method Detail |
|---|
public SpigletLabel getLabel()
null otherwise.
public SpigletLabel getJump()
null if there is no such jump.
public boolean falls()
true if this statement falls through the next one.
true if this statement falls through the next onepublic SpigletStatement.Type getType()
public java.util.Set<SpigletTemp> def()
def set of this
statement.
def set of
this statementpublic java.util.Set<SpigletTemp> use()
use set of this
statement.
use set of
this statementpublic java.lang.String toString()
(Label)? Stmt [def={...}, use={...}, jump=(Label), falls=(bool)].
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||