Top Description Fields Constructors Methods
org.jruby.ast

public Class ModuleNode

extends Node
implements IScopingNode
Class Inheritance
All Implemented Interfaces
org.jruby.ast.IScopingNode
Imports
java.util.List, org.jruby.ast.visitor.NodeVisitor, org.jruby.parser.StaticScope

Represents a module definition.

Field Summary

Modifier and TypeField and Description
private final Node
private final Colon3Node
private final int
private final StaticScope
Inherited from org.jruby.ast.Node:
containsVariableAssignmentEMPTY_LISTnewline

Constructor Summary

AccessConstructor and Description
public
ModuleNode(int line, Colon3Node cpath, StaticScope scope, Node bodyNode, int endLine)

Method Summary

Modifier and TypeMethod and Description
public <T> T
accept(NodeVisitor<T>
the visitor
iVisitor
)

Implements abstract org.jruby.ast.Node.accept.

Accept for the visitor pattern.

public List<Node>
public boolean
public Node

Returns:

the contents
getBodyNode
()

Implements org.jruby.ast.IScopingNode.getBodyNode.

Gets the body of this class.

public Colon3Node

Returns:

Representation of the module path+name
getCPath
()

Implements org.jruby.ast.IScopingNode.getCPath.

Gets the name.

public int
getEndLine()

Gets line where the 'end' was for this module.

public NodeType
public StaticScope

Returns:

the scoping info
getScope
()

Implements org.jruby.ast.IScopingNode.getScope.

Get the static scoping information.

Inherited from org.jruby.ast.Node:
containsVariableAssignmentcreateListcreateListcreateListcreateListgetFilegetLinegetNodeNameisNewlineisNilneedsDefinitionChecksetLinesetNewlinetoStringtoStringtoStringExtraInfotoStringInternalunsetNewline

Field Detail

bodyNodeback to summary
private final Node bodyNode
cpathback to summary
private final Colon3Node cpath
endLineback to summary
private final int endLine
scopeback to summary
private final StaticScope scope

Constructor Detail

ModuleNodeback to summary
public ModuleNode(int line, Colon3Node cpath, StaticScope scope, Node bodyNode, int endLine)

Method Detail

acceptback to summary
public <T> T accept(NodeVisitor<T> iVisitor)

Implements abstract org.jruby.ast.Node.accept.

Accept for the visitor pattern.

Parameters
iVisitor:NodeVisitor<T>

the visitor

childNodesback to summary
public List<Node> childNodes()

Implements abstract org.jruby.ast.Node.childNodes.

executesOnceback to summary
public boolean executesOnce()

Overrides org.jruby.ast.Node.executesOnce.

Returns:boolean

Doc from org.jruby.ast.Node.executesOnce.

is it possible this node will execute only once.

Note

This is not comprehensive. It is used to look from root node down to class/module nodes to make sure that narrow case can execute once. It is possible much deeper down the tree some nodes can only execute once but it will be marked as false because that case is not what this is for.

Annotations
@Override
getBodyNodeback to summary
public Node getBodyNode()

Implements org.jruby.ast.IScopingNode.getBodyNode.

Gets the body of this class.

Returns:Node

the contents

getCPathback to summary
public Colon3Node getCPath()

Implements org.jruby.ast.IScopingNode.getCPath.

Gets the name.

Returns:Colon3Node

Representation of the module path+name

getEndLineback to summary
public int getEndLine()

Gets line where the 'end' was for this module.

getNodeTypeback to summary
public NodeType getNodeType()

Implements abstract org.jruby.ast.Node.getNodeType.

Returns:NodeType

Doc from org.jruby.ast.Node.getNodeType.

the nodeId

getScopeback to summary
public StaticScope getScope()

Implements org.jruby.ast.IScopingNode.getScope.

Get the static scoping information.

Returns:StaticScope

the scoping info