|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectast.ASTNode
ast.Stmt
ast.IfStmt
public class IfStmt
The IfStmt class represents a if-then-else statement appearing in a method declaration. It contains a predicate expression (predExpr), a then statement (thenStmt), and an else statement (elseStmt).
ASTNode,
Stmt| Field Summary | |
|---|---|
protected Stmt |
elseStmt
The else statement |
protected Expr |
predExpr
The predicate expression |
protected Stmt |
thenStmt
The then statement |
| Fields inherited from class ast.ASTNode |
|---|
charNum, lineNum, lineStr |
| Constructor Summary | |
|---|---|
IfStmt(int lineNum,
Expr predExpr,
Stmt thenStmt,
Stmt elseStmt)
IfStmt constructor |
|
| Method Summary | |
|---|---|
java.lang.Object |
accept(Visitor v)
Visitor method |
Stmt |
getElseStmt()
Get the else statement |
Expr |
getPredExpr()
Get the predicate expression |
Stmt |
getThenStmt()
Get the then statement |
| Methods inherited from class ast.ASTNode |
|---|
getLineNum |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Expr predExpr
protected Stmt thenStmt
protected Stmt elseStmt
| Constructor Detail |
|---|
public IfStmt(int lineNum,
Expr predExpr,
Stmt thenStmt,
Stmt elseStmt)
lineNum - source line number corresponding to this AST nodepredExpr - the predicate expressionthenStmt - the then statementelseStmt - the else statement| Method Detail |
|---|
public Expr getPredExpr()
public Stmt getThenStmt()
public Stmt getElseStmt()
public java.lang.Object accept(Visitor v)
accept in class Stmtv - visitor object
Visitor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||