public class ASTConditional extends ASTStatement
condition is true when the code is encountered during execution. The
conditional statement can optionally contain an additional block of code
(the "else" block) that is executed if the condition evaluates to false.ASTNode.DataType| Modifier and Type | Field and Description |
|---|---|
ASTExpression |
condition |
ASTBlock |
elseBlock |
ASTBlock |
ifBlock |
attributes| Constructor and Description |
|---|
ASTConditional(ASTExpression condition,
ASTBlock ifBlock) |
ASTConditional(ASTExpression condition,
ASTBlock ifBlock,
ASTBlock elseBlock) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasElseBlock() |
void |
traverse(ASTVisitor visitor)
Generic traversal method for the visitor pattern.
|
getASTTypeStr, getDepth, getParent, getSourceInfo, getType, setDepth, setParent, setSourceInfo, setType, typeToStringpublic ASTExpression condition
public ASTBlock ifBlock
public ASTBlock elseBlock
public ASTConditional(ASTExpression condition, ASTBlock ifBlock)
public ASTConditional(ASTExpression condition, ASTBlock ifBlock, ASTBlock elseBlock)
public boolean hasElseBlock()
public void traverse(ASTVisitor visitor)
ASTNodeCopyright © 2019. All rights reserved.