public abstract class Node extends Object implements ISourcePositionHolder, ParseResult, ISourcePosition
Modifier and Type | Field and Description |
---|---|
protected boolean |
containsVariableAssignment |
protected boolean |
newline |
Constructor and Description |
---|
Node(ISourcePosition position,
boolean containsAssignment) |
Modifier and Type | Method and Description |
---|---|
abstract <T> T |
accept(NodeVisitor<T> visitor) |
abstract List<Node> |
childNodes() |
boolean |
containsVariableAssignment()
Does this node or one of its children contain an assignment?
|
protected static List<Node> |
createList(Node... nodes) |
protected static List<Node> |
createList(Node node) |
protected static List<Node> |
createList(Node node1,
Node node2) |
protected static List<Node> |
createList(Node node1,
Node node2,
Node node3) |
<T extends Node> |
findFirstChild(Class<T> nodeClass) |
String |
getFile()
Which file does this source position live in?
|
int |
getLine()
Which is the first(start) line that this source position occurs on (zero-based)
|
protected String |
getNodeName() |
abstract NodeType |
getNodeType() |
ISourcePosition |
getPosition()
Location of this node within the source
|
boolean |
isNewline() |
boolean |
isNil()
Whether the node evaluates to nil and has no side effects.
|
boolean |
needsDefinitionCheck()
Check whether the given node is considered always "defined" or whether it
has some form of definition check.
|
void |
setNewline() |
void |
setPosition(ISourcePosition position) |
String |
toString() |
String |
toString(boolean indent,
int indentation) |
protected String |
toStringInternal()
Overridden by nodes that have additional internal state to be displated in toString.
|
protected boolean containsVariableAssignment
protected boolean newline
public Node(ISourcePosition position, boolean containsAssignment)
public void setNewline()
public boolean isNewline()
public ISourcePosition getPosition()
getPosition
in interface ISourcePositionHolder
public int getLine()
ISourcePosition
getLine
in interface ISourcePosition
getLine
in interface PositionAware
public String getFile()
ISourcePosition
getFile
in interface ISourcePosition
getFile
in interface PositionAware
public void setPosition(ISourcePosition position)
setPosition
in interface ISourcePositionHolder
public abstract <T> T accept(NodeVisitor<T> visitor)
public String toString(boolean indent, int indentation)
protected String toStringInternal()
protected String getNodeName()
public abstract NodeType getNodeType()
public boolean isNil()
public boolean needsDefinitionCheck()
public boolean containsVariableAssignment()
Copyright © 2001-2017 JRuby. All Rights Reserved.