org.jrubyparser.ast
Class RootNode
java.lang.Object
org.jrubyparser.ast.Node
org.jrubyparser.ast.RootNode
- All Implemented Interfaces:
- ILocalScope, IScope, ISourcePositionHolder
public class RootNode
- extends Node
- implements ILocalScope
Represents the top of the AST. This is a node not present in MRI. It was created to
hold the top-most static scope in an easy to grab way and it also exists to hold BEGIN
and END nodes. These can then be interpreted/compiled in the same places as the rest
of the code.
| Methods inherited from class org.jrubyparser.ast.Node |
adopt, adopt, adoptUsingNodesPosition, childNodes, comparePositionWith, createList, getClosestIScope, getClosestModule, getGrandParent, getInlineComment, getInnermostIter, getMethodFor, getNodeAt, getNodeName, getOutermostIter, getParent, getPosition, getPositionIncludingComments, getPreviousComments, insertAfter, insertAll, insertBefore, insertNode, isBlockParameter, isDescendentOf, isLeaf, isMethodParameter, isSame, setParent, setPosition, toString |
RootNode
public RootNode(SourcePosition position,
StaticScope scope,
Node bodyNode)
getNodeType
public NodeType getNodeType()
- Specified by:
getNodeType in class Node
- Returns:
- the nodeId
getStaticScope
public StaticScope getStaticScope()
- The static scoping relationships that should get set first thing before interpretation
of the code represented by this AST. Actually, we use getScope first since that also
can contain a live dynamic scope. We rely on this method only for interpreting a root
node from a serialized format.
- Returns:
- the top static scope for the AST
getBody
public Node getBody()
- First real AST node to be interpreted
- Returns:
- real top AST node
getBodyNode
@Deprecated
public Node getBodyNode()
- Deprecated.
setBody
public void setBody(Node body)
accept
public Object accept(NodeVisitor iVisitor)
- Specified by:
accept in class Node
getVariableReferencesNamed
public List<ILocalVariable> getVariableReferencesNamed(String name)
- Specified by:
getVariableReferencesNamed in interface IScope
Copyright © 2013. All Rights Reserved.