|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.pfl.dynamic.codegen.impl.AttributedObjectBase
org.glassfish.pfl.dynamic.codegen.impl.NodeBase
org.glassfish.pfl.dynamic.codegen.impl.StatementBase
org.glassfish.pfl.dynamic.codegen.impl.BlockStatement
public class BlockStatement
Main factory for creating statements. Represents a block of statements which also defines a scope for local variable declarations.
| Method Summary | |
|---|---|
void |
accept(Visitor visitor)
Accept the visitor and allow it to perform actions on this Node. |
void |
addAssign(Expression left,
Expression right)
|
void |
addBreak()
Add a break statement to this BlockStatement. |
Expression |
addDefinition(Type type,
String ident,
Expression value)
|
void |
addExpression(Expression expr)
|
IfStatement |
addIf(Expression cond)
|
void |
addReturn()
Add an empty return to this BlockStatement. |
void |
addReturn(Expression expr)
Add a return with an expression to this BlockStatement. |
SwitchStatement |
addSwitch(Expression value)
|
void |
addThrow(Expression expr)
|
TryStatement |
addTry()
|
WhileStatement |
addWhile(Expression expr)
|
List<Statement> |
body()
Return the list of Statements in this BlockStatement. |
ExpressionFactory |
exprFactory()
Return the ExpressionFactory that must be used to create any expressions occuring either in expressions added to the body, or in other statements immediately contained in this BlockStatement. |
Variable |
getVar(String ident)
Look up the ident to see if it has an associated Variable in this block. |
boolean |
isEmpty()
Return true iff this BlockStatement contains no local variables or statements. |
| Methods inherited from class org.glassfish.pfl.dynamic.codegen.impl.NodeBase |
|---|
copy, copy, getAncestor, id, parent, parent, postCopy, preCopy, toString |
| Methods inherited from class org.glassfish.pfl.dynamic.codegen.impl.AttributedObjectBase |
|---|
attributes, get, set |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.glassfish.pfl.dynamic.codegen.impl.Node |
|---|
copy, copy, getAncestor, id, parent, parent |
| Methods inherited from interface org.glassfish.pfl.dynamic.codegen.impl.AttributedObject |
|---|
attributes, get, set |
| Method Detail |
|---|
public Variable getVar(String ident)
public boolean isEmpty()
public List<Statement> body()
public ExpressionFactory exprFactory()
public void addBreak()
public void addReturn()
public void addReturn(Expression expr)
public IfStatement addIf(Expression cond)
public TryStatement addTry()
public void addThrow(Expression expr)
public SwitchStatement addSwitch(Expression value)
public WhileStatement addWhile(Expression expr)
public void addExpression(Expression expr)
public void addAssign(Expression left,
Expression right)
public Expression addDefinition(Type type,
String ident,
Expression value)
public void accept(Visitor visitor)
Node
accept in interface Nodeaccept in class NodeBase
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||