org.jruby.ast
Class ArgsNode

java.lang.Object
  extended by org.jruby.ast.Node
      extended by org.jruby.ast.ArgsNode
All Implemented Interfaces:
ISourcePositionHolder

public class ArgsNode
extends Node

Arguments for a function definition.


Field Summary
 
Fields inherited from class org.jruby.ast.Node
EMPTY_COMMENT_LIST, INVALID_POSITION, nodeId
 
Constructor Summary
ArgsNode(ISourcePosition position, ListNode arguments, ListNode optionalArguments, int restArguments, ArgumentNode restArgNode, BlockArgNode blockArgNode)
           
 
Method Summary
 Instruction accept(NodeVisitor iVisitor)
          Accept for the visitor pattern.
 java.util.List<Node> childNodes()
           
 ListNode getArgs()
          Gets main arguments (as Tokens)
 Arity getArity()
           
 BlockArgNode getBlockArgNode()
          Gets the blockArgNode.
 ListNode getOptArgs()
          Gets the optArgs.
 int getOptionalArgsCount()
           
 int getRequiredArgsCount()
           
 int getRestArg()
          Gets the restArg.
 ArgumentNode getRestArgNode()
          Gets the restArgNode.
 
Methods inherited from class org.jruby.ast.Node
addComment, addComments, assign, createList, definition, getComments, getNodeName, getPosition, getPositionIncludingComments, hasComments, interpret, isInvisible, setPosition, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArgsNode

public ArgsNode(ISourcePosition position,
                ListNode arguments,
                ListNode optionalArguments,
                int restArguments,
                ArgumentNode restArgNode,
                BlockArgNode blockArgNode)
Parameters:
optionalArguments - Node describing the optional arguments This Block will contain assignments to locals (LAsgnNode)
restArguments - index of the rest argument in the local table (the array argument prefixed by a * which collects all additional params) or -1 if there is none.
argsCount - number of regular arguments
restArgNode - The rest argument (*args).
blockArgNode - An optional block argument (&arg).
Method Detail

accept

public Instruction accept(NodeVisitor iVisitor)
Accept for the visitor pattern.

Specified by:
accept in class Node
Parameters:
iVisitor - the visitor

getArgs

public ListNode getArgs()
Gets main arguments (as Tokens)


getArity

public Arity getArity()

getRequiredArgsCount

public int getRequiredArgsCount()

getOptionalArgsCount

public int getOptionalArgsCount()

getOptArgs

public ListNode getOptArgs()
Gets the optArgs.

Returns:
Returns a ListNode

getRestArg

public int getRestArg()
Gets the restArg.

Returns:
Returns a int

getRestArgNode

public ArgumentNode getRestArgNode()
Gets the restArgNode.

Returns:
Returns an ArgumentNode

getBlockArgNode

public BlockArgNode getBlockArgNode()
Gets the blockArgNode.

Returns:
Returns a BlockArgNode

childNodes

public java.util.List<Node> childNodes()
Specified by:
childNodes in class Node


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