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.
<init>(int line, org.jruby.runtime.DynamicScope scope, org.jruby.ast.Node bodyNode, String file)<init>(int line, org.jruby.runtime.DynamicScope scope, org.jruby.ast.Node bodyNode, String file, int coverageMode)getAST() · also: get_astFirst real AST node to be interpreted
Returns: real top AST node
getCoverageMode() · also: get_coverage_modeReturn the dynamic scope for this AST. The variable backed by this is transient so for serialization this is null. In that case we use staticScope to rebuild the dynamic scope. The real reason for this method is supporting bindings+eval. We need to pass our live dynamic scope in so when we eval we can use that dynamic scope.
Returns: dynamic scope of this AST
getEncoding() · also: get_encodingexecutesOnce()getFile() · also: get_fileThe 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
containsVariableAssignment()Does this node or one of its children contain an assignment?
getLine() · also: get_linesetLine(int line) · also: set_lineneedsDefinitionCheck()Check whether the given node is considered always "defined" or whether it has some form of definition check.
Returns: Whether the type of node represents a possibly undefined construct
isNewline() · also: is_newlineisNil() · also: is_nilWhether the node evaluates to nil and has no side effects.
Returns: true if nil, false otherwise
setNewline()toString()toString(boolean indent, int indentation)toStringExtraInfo()Not all interesting info in the AST is from Node data. This method will print out anything else of note (e.g. FixnumNode's long value).
Returns: null for no extra info or something otherwise.
unsetNewline()getLine() · also: get_line