|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.teatrove.tea.parsetree.Node
org.teatrove.tea.parsetree.Statement
org.teatrove.tea.parsetree.ReturnStatement
public class ReturnStatement
A ReturnStatement allows the values of Expressions to be returned from an execution scope. If the expression is null, then void is returned.
| Constructor Summary | |
|---|---|
ReturnStatement(Expression expr)
Construct a ReturnStatement from just an expression and its SourceInfo. |
|
ReturnStatement(SourceInfo info)
Construct a ReturnStatement that returns void. |
|
ReturnStatement(SourceInfo info,
Expression expr)
|
|
| Method Summary | |
|---|---|
Object |
accept(NodeVisitor visitor)
Every subclass of Node must override this method with the following: return visitor.visit(this). |
Object |
clone()
Returns a clone of this Node and all its children. |
Expression |
getExpression()
Returns the expression to return or null if void is returned. |
boolean |
isBreak()
Returns true if Statement 'breaks' during its execution. |
boolean |
isReturn()
Returns true if Statement definitely returns from its method either from a return statement or a throw statement. |
void |
setExpression(Expression expr)
|
| Methods inherited from class org.teatrove.tea.parsetree.Node |
|---|
getSourceInfo, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ReturnStatement(SourceInfo info,
Expression expr)
public ReturnStatement(Expression expr)
public ReturnStatement(SourceInfo info)
| Method Detail |
|---|
public Object accept(NodeVisitor visitor)
Nodereturn visitor.visit(this).
accept in class Statementvisitor - A visitor of this Node
NodeVisitorpublic Object clone()
Node
clone in class Nodepublic boolean isReturn()
Statement
isReturn in class Statementpublic boolean isBreak()
Statement
isBreak in class Statementpublic Expression getExpression()
public void setExpression(Expression expr)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||