Package org.prism
Class Nodes.BlockNode
java.lang.Object
org.prism.Nodes.Node
org.prism.Nodes.BlockNode
- Enclosing class:
- Nodes
Represents a block of ruby code. [1, 2, 3].each { |i| puts x } ^^^^^^^^^^^^^^
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Nodes.Node
The body of the block.final String[]
The local variables declared in the block.final Nodes.Node
The parameters of the block.Fields inherited from class org.prism.Nodes.Node
EMPTY_ARRAY, length, nodeId, startOffset
-
Constructor Summary
ConstructorsConstructorDescriptionBlockNode
(int nodeId, int startOffset, int length, String[] locals, Nodes.Node parameters, Nodes.Node body) -
Method Summary
Modifier and TypeMethodDescription<T> T
accept
(AbstractNodeVisitor<T> visitor) protected String
<T> void
visitChildNodes
(AbstractNodeVisitor<T> visitor) Methods inherited from class org.prism.Nodes.Node
endOffset, hasNewLineFlag, setNewLineFlag, setNewLineFlag, toString
-
Field Details
-
locals
The local variables declared in the block. [1, 2, 3].each { |i| puts x } # locals: [:i] ^
-
parameters
The parameters of the block. [1, 2, 3].each { |i| puts x } ^^^ [1, 2, 3].each { puts _1 } ^^^^^^^^^^^ [1, 2, 3].each { puts it } ^^^^^^^^^^^
-
body
The body of the block. [1, 2, 3].each { |i| puts x } ^^^^^^
-
-
Constructor Details
-
BlockNode
public BlockNode(int nodeId, int startOffset, int length, String[] locals, Nodes.Node parameters, Nodes.Node body)
-
-
Method Details
-
visitChildNodes
- Specified by:
visitChildNodes
in classNodes.Node
-
childNodes
- Specified by:
childNodes
in classNodes.Node
-
accept
- Specified by:
accept
in classNodes.Node
-
toString
- Specified by:
toString
in classNodes.Node
-