|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.ast.Node
org.jruby.ast.ArgsNode
public class ArgsNode
Represents the argument declarations of a method. The fields: foo(p1, ..., pn, o1 = v1, ..., on = v2, *r, q1, ..., qn) p1...pn = pre arguments o1...on = optional arguments r = rest argument q1...qn = post arguments (only in 1.9)
Field Summary | |
---|---|
protected Arity |
arity
|
protected boolean |
hasMasgnArgs
|
protected boolean |
hasOptArgs
|
protected boolean |
isSimple
|
protected int |
maxArgsCount
|
protected int |
restArg
|
protected ArgumentNode |
restArgNode
|
Constructor Summary | |
---|---|
ArgsNode(ISourcePosition position,
ListNode pre,
ListNode optionalArguments,
RestArgNode rest,
ListNode post,
BlockArgNode blockArgNode)
|
Methods inherited from class org.jruby.ast.Node |
---|
assign, createList, definition, getNodeName, getPosition, interpret, isInvisible, setPosition, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final ArgumentNode restArgNode
protected final int restArg
protected Arity arity
protected final boolean hasOptArgs
protected final boolean hasMasgnArgs
protected int maxArgsCount
protected final boolean isSimple
Constructor Detail |
---|
public ArgsNode(ISourcePosition position, ListNode pre, ListNode optionalArguments, RestArgNode rest, ListNode post, BlockArgNode blockArgNode)
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 argumentsrestArgNode
- The rest argument (*args).blockArgNode
- An optional block argument (&arg).Method Detail |
---|
public NodeType getNodeType()
getNodeType
in class Node
protected Arity calculateArity()
protected boolean hasMasgnArgs()
public java.lang.Object accept(NodeVisitor iVisitor)
accept
in class Node
iVisitor
- the visitorpublic ListNode getPre()
@Deprecated public ListNode getArgs()
public Arity getArity()
public int getRequiredArgsCount()
public int getOptionalArgsCount()
public ListNode getPost()
public int getMaxArgumentsCount()
public ListNode getOptArgs()
public int getRestArg()
public ArgumentNode getRestArgNode()
@Deprecated public BlockArgNode getBlockArgNode()
public BlockArgNode getBlock()
public int getPostCount()
public int getPostIndex()
public int getPreCount()
public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, IRubyObject[] args, Block block)
public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, Block block)
public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, IRubyObject arg0, Block block)
public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, IRubyObject arg0, IRubyObject arg1, Block block)
public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block block)
public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, Block block)
public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, Block block)
public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, Block block)
public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, Block block)
public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, IRubyObject arg8, Block block)
public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, IRubyObject arg5, IRubyObject arg6, IRubyObject arg7, IRubyObject arg8, IRubyObject arg9, Block block)
public void checkArgCount(Ruby runtime, int argsLength)
protected void prepareOptOrRestArgs(ThreadContext context, Ruby runtime, DynamicScope scope, IRubyObject self, IRubyObject[] args)
protected int prepareOptionalArguments(ThreadContext context, Ruby runtime, IRubyObject self, IRubyObject[] args)
protected void prepareRestArg(ThreadContext context, Ruby runtime, DynamicScope scope, IRubyObject[] args, int givenArgsCount)
protected int assignOptArgs(IRubyObject[] args, Ruby runtime, ThreadContext context, IRubyObject self, int givenArgsCount)
protected void processBlockArg(DynamicScope scope, Ruby runtime, Block block)
public java.util.List<Node> childNodes()
childNodes
in class Node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |