Class BoxIfElse
java.lang.Object
ortus.boxlang.compiler.ast.BoxNode
ortus.boxlang.compiler.ast.BoxStatement
ortus.boxlang.compiler.ast.statement.BoxIfElse
- All Implemented Interfaces:
BoxVisitable
AST Node representing a if statement
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionBoxIfElse
(BoxExpression condition, BoxStatement thenBody, BoxStatement elseBody, Position position, String sourceText) Creates the AST node -
Method Summary
Modifier and TypeMethodDescriptionAccept method for replacing visitor support.void
Accept method for visitor support.void
setCondition
(BoxExpression condition) void
setElseBody
(BoxStatement elseBody) void
setThenBody
(BoxStatement thenBody) toMap()
Methods inherited from class ortus.boxlang.compiler.ast.BoxNode
addComment, associateComments, endsOnSameLineAs, enumToMap, getAncestors, getChildren, getComments, getDescendants, getDescendantsOfType, getDocComment, getFirstAncestorOfType, getFirstAncestorOfType, getFirstNodeOfType, getFirstNodeOfType, getFirstNodeOfTypes, getParent, getPosition, getSourceText, isAfter, isBefore, isInside, replaceChildren, replaceChildren, setComments, setParent, setPosition, setSourceText, startsOnEndLineOf, toJSON, toString
-
Constructor Details
-
BoxIfElse
public BoxIfElse(BoxExpression condition, BoxStatement thenBody, BoxStatement elseBody, Position position, String sourceText) Creates the AST node- Parameters:
condition
- expression representing the condition to testthenBody
- list of the statements to execute when the condition is trueelseBody
- list of the statements foe the else, empty if the else body is not presentposition
- position of the statement in the source codesourceText
- source code that originated the Node
-
-
Method Details
-
getCondition
-
getThenBody
-
getElseBody
-
setCondition
-
setThenBody
-
setElseBody
-
toMap
-
accept
Description copied from interface:BoxVisitable
Accept method for visitor support.- Parameters:
v
- the visitor implementation
-
accept
Description copied from interface:BoxVisitable
Accept method for replacing visitor support. Each accept returns the node, or a replacement node.- Parameters:
v
- the visitor implementation
-