|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jrubyparser.ast.Node
public abstract class Node
Base class for all Nodes in the AST
| Constructor Summary | |
|---|---|
Node(SourcePosition position)
|
|
| Method Summary | |
|---|---|
abstract Object |
accept(NodeVisitor visitor)
|
Node |
adopt(Node child)
|
Node |
adopt(Node child,
int index)
|
protected Node |
adoptUsingNodesPosition(Node node)
Adopt the node in it's proper location amongst the children of this node. |
List<Node> |
childNodes()
|
int |
comparePositionWith(Node testNode)
Is the testNode before, inside, or after this node? |
protected static List<Node> |
createList(Node... nodes)
|
IScope |
getClosestIScope()
Get the most immediate ParameterScope. |
IModuleScope |
getClosestModule()
Get closest parent Module/Class/SClass for this node |
Node |
getGrandParent()
|
CommentNode |
getInlineComment()
Get the comment which happens to appear on the same line as this node immediately after it. |
IterNode |
getInnermostIter()
Return closest iter node unless this is contained within a non-block scope and then return null instead. |
MethodDefNode |
getMethodFor()
Which method is this node contained in? |
Node |
getNodeAt(int offset)
Find the leaf node (which is not invisible) at the specified offset). |
protected String |
getNodeName()
|
abstract NodeType |
getNodeType()
|
IterNode |
getOutermostIter()
|
Node |
getParent()
|
SourcePosition |
getPosition()
Location of this node within the source |
SourcePosition |
getPositionIncludingComments()
|
List<CommentNode> |
getPreviousComments()
Look for all comment nodes immediately preceeding this one. |
void |
insertAfter(Node newNode)
|
void |
insertAll(List<? extends Node> nodes)
Put entire list of nodes into their proper positions based on the SourcePosition specified by each node in the list. |
void |
insertBefore(Node newNode)
|
void |
insertNode(Node node)
|
boolean |
isBlockParameter()
Is this node specifying a parameter in a block statement? |
boolean |
isDescendentOf(Node testParent)
Is this node the same or a descendent of the supplied testParent node? |
boolean |
isLeaf()
Is this AST node considered a leaf node? |
boolean |
isMethodParameter()
Is this node specifying a parameter in a method definition? |
boolean |
isSame(Node other)
Checks node for 'sameness' for diffing. |
void |
setParent(Node parent)
|
void |
setPosition(SourcePosition position)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Node(SourcePosition position)
| Method Detail |
|---|
public SourcePosition getPosition()
getPosition in interface ISourcePositionHolderpublic Node adopt(Node child)
public Node adopt(Node child,
int index)
public boolean isSame(Node other)
other - The node to be compared to.
protected Node adoptUsingNodesPosition(Node node)
public Node getParent()
public Node getGrandParent()
public void setParent(Node parent)
public boolean isDescendentOf(Node testParent)
public void setPosition(SourcePosition position)
setPosition in interface ISourcePositionHolderpublic abstract Object accept(NodeVisitor visitor)
public List<Node> childNodes()
protected static List<Node> createList(Node... nodes)
public String toString()
toString in class Objectprotected String getNodeName()
public SourcePosition getPositionIncludingComments()
public boolean isLeaf()
public abstract NodeType getNodeType()
public void insertAll(List<? extends Node> nodes)
nodes - public void insertNode(Node node)
public void insertBefore(Node newNode)
public void insertAfter(Node newNode)
public int comparePositionWith(Node testNode)
public List<CommentNode> getPreviousComments()
public CommentNode getInlineComment()
public Node getNodeAt(int offset)
offset - in characters into the source unitpublic MethodDefNode getMethodFor()
public IModuleScope getClosestModule()
public IterNode getInnermostIter()
public IterNode getOutermostIter()
public IScope getClosestIScope()
public boolean isBlockParameter()
public boolean isMethodParameter()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||