|
||||||||||
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 |
hasOptArgs
|
protected int |
maxArgsCount
|
protected int |
restArg
|
protected ArgumentNode |
restArgNode
|
Fields inherited from class org.jruby.ast.Node |
---|
EMPTY_COMMENT_LIST, INVALID_POSITION, nodeId |
Constructor Summary | |
---|---|
ArgsNode(ISourcePosition position,
ListNode pre,
ListNode optionalArguments,
RestArgNode rest,
ListNode post,
BlockArgNode blockArgNode)
|
Method Summary | |
---|---|
Instruction |
accept(NodeVisitor iVisitor)
Accept for the visitor pattern. |
protected int |
assignOptArgs(IRubyObject[] args,
Ruby runtime,
ThreadContext context,
IRubyObject self,
int givenArgsCount)
|
protected Arity |
calculateArity()
|
void |
checkArgCount(Ruby runtime,
int argsLength)
|
java.util.List<Node> |
childNodes()
|
ListNode |
getArgs()
Deprecated. |
Arity |
getArity()
|
BlockArgNode |
getBlock()
Gets the explicit block argument of the parameter list (&block). |
BlockArgNode |
getBlockArgNode()
Deprecated. |
int |
getMaxArgumentsCount()
|
ListNode |
getOptArgs()
Gets the optArgs. |
int |
getOptionalArgsCount()
|
ListNode |
getPost()
|
ListNode |
getPre()
Gets the required arguments at the beginning of the argument definition |
int |
getRequiredArgsCount()
|
int |
getRestArg()
Gets the restArg. |
ArgumentNode |
getRestArgNode()
Gets the restArgNode. |
void |
prepare(ThreadContext context,
Ruby runtime,
IRubyObject self,
Block block)
|
void |
prepare(ThreadContext context,
Ruby runtime,
IRubyObject self,
IRubyObject[] args,
Block block)
|
void |
prepare(ThreadContext context,
Ruby runtime,
IRubyObject self,
IRubyObject arg0,
Block block)
|
void |
prepare(ThreadContext context,
Ruby runtime,
IRubyObject self,
IRubyObject arg0,
IRubyObject arg1,
Block block)
|
void |
prepare(ThreadContext context,
Ruby runtime,
IRubyObject self,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
Block block)
|
void |
prepare(ThreadContext context,
Ruby runtime,
IRubyObject self,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
IRubyObject arg3,
Block block)
|
protected int |
prepareOptionalArguments(ThreadContext context,
Ruby runtime,
IRubyObject self,
IRubyObject[] args)
|
protected void |
prepareOptOrRestArgs(ThreadContext context,
Ruby runtime,
DynamicScope scope,
IRubyObject self,
IRubyObject[] args)
|
protected void |
prepareRestArg(ThreadContext context,
Ruby runtime,
DynamicScope scope,
IRubyObject[] args,
int givenArgsCount)
|
protected void |
processBlockArg(DynamicScope scope,
Ruby runtime,
Block block)
|
Methods inherited from class org.jruby.ast.Node |
---|
addComment, addComments, assign, createList, definition, getComments, getNodeName, getPosition, getPositionIncludingComments, hasComments, interpret, isInvisible, setPosition, toString, when |
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 int maxArgsCount
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 |
---|
protected Arity calculateArity()
public Instruction 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 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 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 |