public abstract class Node extends java.lang.Object implements ISourcePositionHolder, 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 java.util.List<Node> |
childNodes() |
boolean |
containsVariableAssignment()
Does this node or one of its children contain an assignment?
|
protected static java.util.List<Node> |
createList(Node... nodes) |
protected static java.util.List<Node> |
createList(Node node) |
protected static java.util.List<Node> |
createList(Node node1,
Node node2) |
protected static java.util.List<Node> |
createList(Node node1,
Node node2,
Node node3) |
<T extends Node> |
findFirstChild(java.lang.Class<T> nodeClass) |
java.lang.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 java.lang.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) |
java.lang.String |
toString() |
java.lang.String |
toString(boolean indent,
int indentation) |
protected java.lang.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 java.lang.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 abstract java.util.List<Node> childNodes()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(boolean indent, int indentation)
protected java.lang.String toStringInternal()
protected java.lang.String getNodeName()
public <T extends Node> T findFirstChild(java.lang.Class<T> nodeClass)
public abstract NodeType getNodeType()
public boolean isNil()
public boolean needsDefinitionCheck()
public boolean containsVariableAssignment()
Copyright © 2001-2018 JRuby. All Rights Reserved.