Package org.jruby.ast
Class NilNode
java.lang.Object
org.jruby.ast.Node
org.jruby.ast.NilNode
- All Implemented Interfaces:
SideEffectFree
- Direct Known Subclasses:
NilImplicitNode
represents 'nil'
-
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
isNil()
Whether the node evaluates to nil and has no side effects.boolean
Check whether the given node is considered always "defined" or whether it has some form of definition check.Methods inherited from class org.jruby.ast.Node
containsVariableAssignment, createList, createList, createList, createList, executesOnce, getFile, getLine, getNodeName, isNewline, setLine, setNewline, toString, toString, toStringExtraInfo, toStringInternal, unsetNewline
-
Constructor Details
-
NilNode
public NilNode(int line)
-
-
Method Details
-
getNodeType
- Specified by:
getNodeType
in classNode
- Returns:
- the nodeId
-
accept
Accept for the visitor pattern. -
childNodes
- Specified by:
childNodes
in classNode
-
isNil
public boolean isNil()Description copied from class:Node
Whether the node evaluates to nil and has no side effects. -
needsDefinitionCheck
public boolean needsDefinitionCheck()Description copied from class:Node
Check whether the given node is considered always "defined" or whether it has some form of definition check.- Overrides:
needsDefinitionCheck
in classNode
- Returns:
- Whether the type of node represents a possibly undefined construct
-