org.jruby.ast
Class ArgsNode

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

public class ArgsNode
extends Node

arguments for a function. this is used both in the function definition and in actual function calls

Author:
jpetersen
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jruby.ast.Node
instruction, 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 childNodes()
           
 ListNode getArgs()
          Gets main arguments (as Tokens)
 int getArgsCount()
           
 Arity getArity()
           
 BlockArgNode getBlockArgNode()
          Gets the blockArgNode.
 ListNode getOptArgs()
          Gets the optArgs.
 int getRestArg()
          Gets the restArg.
 ArgumentNode getRestArgNode()
          Gets the restArgNode.
 
Methods inherited from class org.jruby.ast.Node
addComment, addComments, createList, createList, createList, createList, getComments, getNodeName, getPosition, getPositionIncludingComments, hasComments, 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()

getArgsCount

public int getArgsCount()

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 childNodes()
Specified by:
childNodes in class Node


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