org.jruby.ast
Class Node

java.lang.Object
  extended by org.jruby.ast.Node
All Implemented Interfaces:
ISourcePositionHolder
Direct Known Subclasses:
AliasNode, AndNode, ArgsCatNode, ArgsNode, ArgsPushNode, ArgumentNode, AssignableNode, AttrAssignNode, BackRefNode, BeginNode, BignumNode, BlockArgNode, BlockPassNode, BreakNode, CallNode, CaseNode, ClassNode, ClassVarNode, Colon3Node, CommentNode, ConstNode, DefinedNode, DotNode, DVarNode, EnsureNode, EvStrNode, FalseNode, FCallNode, FixnumNode, FlipNode, FloatNode, GlobalVarNode, HashNode, IfNode, InstVarNode, IterNode, ListNode, LocalVarNode, Match2Node, Match3Node, MatchNode, MethodDefNode, ModuleNode, NewlineNode, NextNode, NilNode, NotNode, NthRefNode, OpAsgnAndNode, OpAsgnNode, OpAsgnOrNode, OpElementAsgnNode, OrNode, RedoNode, RegexpNode, RescueBodyNode, RescueNode, RetryNode, ReturnNode, RootNode, SClassNode, SelfNode, SplatNode, StarNode, StrNode, SuperNode, SValueNode, SymbolNode, ToAryNode, TrueNode, UndefNode, UntilNode, VAliasNode, VCallNode, WhenNode, WhileNode, XStrNode, YieldNode, ZArrayNode, ZeroArgNode, ZSuperNode

public abstract class Node
extends java.lang.Object
implements ISourcePositionHolder

Base class for all Nodes in the AST


Field Summary
static java.util.List<CommentNode> EMPTY_COMMENT_LIST
           
static ISourcePosition INVALID_POSITION
           
 NodeType nodeId
           
 
Constructor Summary
Node(ISourcePosition position, NodeType id)
           
 
Method Summary
abstract  Instruction accept(NodeVisitor visitor)
           
 void addComment(CommentNode comment)
           
 void addComments(java.util.Collection<CommentNode> moreComments)
           
 IRubyObject assign(Ruby runtime, ThreadContext context, IRubyObject self, IRubyObject value, Block block, boolean checkArity)
           
abstract  java.util.List<Node> childNodes()
           
protected static java.util.List<Node> createList(Node... nodes)
           
 java.lang.String definition(Ruby runtime, ThreadContext context, IRubyObject self, Block aBlock)
           
 java.util.Collection<CommentNode> getComments()
           
protected  java.lang.String getNodeName()
           
 ISourcePosition getPosition()
          Location of this node within the source
 ISourcePosition getPositionIncludingComments()
           
 boolean hasComments()
           
 IRubyObject interpret(Ruby runtime, ThreadContext context, IRubyObject self, Block aBlock)
           
 boolean isInvisible()
          Is the current node something that is syntactically visible in the AST.
 void setPosition(ISourcePosition position)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INVALID_POSITION

public static final ISourcePosition INVALID_POSITION

EMPTY_COMMENT_LIST

public static final java.util.List<CommentNode> EMPTY_COMMENT_LIST

nodeId

public final NodeType nodeId
Constructor Detail

Node

public Node(ISourcePosition position,
            NodeType id)
Method Detail

getPosition

public ISourcePosition getPosition()
Location of this node within the source

Specified by:
getPosition in interface ISourcePositionHolder

setPosition

public void setPosition(ISourcePosition position)
Specified by:
setPosition in interface ISourcePositionHolder

accept

public abstract Instruction accept(NodeVisitor visitor)

childNodes

public abstract java.util.List<Node> childNodes()

createList

protected static java.util.List<Node> createList(Node... nodes)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getNodeName

protected java.lang.String getNodeName()

addComment

public void addComment(CommentNode comment)

addComments

public void addComments(java.util.Collection<CommentNode> moreComments)

getComments

public java.util.Collection<CommentNode> getComments()

hasComments

public boolean hasComments()

getPositionIncludingComments

public ISourcePosition getPositionIncludingComments()

isInvisible

public boolean isInvisible()
Is the current node something that is syntactically visible in the AST. IDE consumers should ignore these elements.


interpret

public IRubyObject interpret(Ruby runtime,
                             ThreadContext context,
                             IRubyObject self,
                             Block aBlock)

assign

public IRubyObject assign(Ruby runtime,
                          ThreadContext context,
                          IRubyObject self,
                          IRubyObject value,
                          Block block,
                          boolean checkArity)

definition

public java.lang.String definition(Ruby runtime,
                                   ThreadContext context,
                                   IRubyObject self,
                                   Block aBlock)


Copyright © 2002-2007 JRuby Team. All Rights Reserved.