Package org.jruby.ast
Class LocalAsgnNode
java.lang.Object
org.jruby.ast.Node
org.jruby.ast.AssignableNode
org.jruby.ast.LocalAsgnNode
- All Implemented Interfaces:
IScopedNode
,INameNode
An assignment to a local variable.
-
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.int
getDepth()
How many scopes should we burrow down to until we need to set the block variable value.int
getIndex()
Gets the index within the scope construct that actually holds the eval'd value of this local variablegetName()
Name of the local assignment.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.AssignableNode
getValueNode, setValueNode
Methods inherited from class org.jruby.ast.Node
containsVariableAssignment, createList, createList, createList, createList, executesOnce, getFile, getLine, getNodeName, isNewline, isNil, setLine, setNewline, toString, toString, toStringExtraInfo, toStringInternal, unsetNewline
-
Constructor Details
-
LocalAsgnNode
-
-
Method Details
-
getNodeType
- Specified by:
getNodeType
in classNode
- Returns:
- the nodeId
-
accept
Accept for the visitor pattern. -
getName
Name of the local assignment. -
getDepth
public int getDepth()How many scopes should we burrow down to until we need to set the block variable value.- Specified by:
getDepth
in interfaceIScopedNode
- Returns:
- 0 for current scope, 1 for one down, ...
-
getIndex
public int getIndex()Gets the index within the scope construct that actually holds the eval'd value of this local variable- Specified by:
getIndex
in interfaceIScopedNode
- Returns:
- Returns an int offset into storage structure
-
childNodes
- Specified by:
childNodes
in classNode
-
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
-