Package org.jruby.ast
Class WhileNode
java.lang.Object
org.jruby.ast.Node
org.jruby.ast.WhileNode
Represents a while statement. This could be the both versions:
while <condition>
<body>
end
and
<body> 'while' <condition>
-
Field Summary
Fields inherited from class org.jruby.ast.Node
containsVariableAssignment, newline
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> T
accept
(NodeVisitor<T> iVisitor) Accept for the visitor pattern.boolean
Determine whether this is while or do whileGets the bodyNode.Gets the conditionNode.Methods inherited from class org.jruby.ast.Node
containsVariableAssignment, createList, createList, createList, createList, executesOnce, getFile, getLine, getNodeName, isNewline, isNil, needsDefinitionCheck, setLine, setNewline, toString, toString, toStringExtraInfo, toStringInternal, unsetNewline
-
Constructor Details
-
WhileNode
-
WhileNode
-
-
Method Details
-
getNodeType
- Specified by:
getNodeType
in classNode
- Returns:
- the nodeId
-
accept
Accept for the visitor pattern. -
getBodyNode
Gets the bodyNode.- Returns:
- Returns a Node
-
getConditionNode
Gets the conditionNode.- Returns:
- Returns a Node
-
evaluateAtStart
public boolean evaluateAtStart()Determine whether this is while or do while- Returns:
- true if you are a while, false if do while
-
childNodes
- Specified by:
childNodes
in classNode
-