Top Description Fields Constructors Methods
org.jruby.ast

public Class ArgsNode

extends Node
Class Inheritance
Imports
java.util.List, org.jruby.ast.visitor.NodeVisitor, org.jruby.lexer.LexingCommon, org.jruby.runtime.Helpers

Represents the argument declarations of a method. The fields: foo(p1, ..., pn, o1 = v1, ..., on = v2, *r, q1, ..., qn, k1:, ..., kn:, **K, &b) p1...pn = pre arguments o1...on = optional arguments r = rest argument q1...qn = post arguments (only in 1.9) k1...kn = keyword arguments K = keyword rest argument b = block arg

Field Summary

Modifier and TypeField and Description
private final Node[]
private final BlockArgNode
private final KeywordRestArgNode
private final short
private static final Node[]
private final short
private final short
protected final RestArgNode
Inherited from org.jruby.ast.Node:
containsVariableAssignmentEMPTY_LISTnewline

Constructor Summary

AccessConstructor and Description
public
ArgsNode(int line, ListNode pre, ListNode optionalArguments, RestArgNode rest, ListNode post, BlockArgNode blockArgNode)

Construct a new ArgsNode with no keyword arguments.

public
ArgsNode(int line, ListNode pre, ListNode optionalArguments, RestArgNode rest, ListNode post, ListNode keywords, KeywordRestArgNode keyRest, BlockArgNode blockArgNode)

Construct a new ArgsNode with keyword arguments.

Method Summary

Modifier and TypeMethod and Description
public <T> T
accept(NodeVisitor<T>
the visitor
iVisitor
)

Implements abstract org.jruby.ast.Node.accept.

Accept for the visitor pattern.

public boolean
public List<Node>
public Node[]
public BlockArgNode

Returns:

Returns a BlockArgNode
getBlock
()

Gets the explicit block argument of the parameter list (&block).

public KeywordRestArgNode
public int
public ListNode
public int
public NodeType
public int
public ListNode

Returns:

Returns a ListNode
getOptArgs
()

Gets the optArgs.

public int
public ListNode
public int
public int
public ListNode
getPre()

Gets the required arguments at the beginning of the argument definition

public int
public int
public int
getRequiredKeywordCount()

How many of the keywords listed happen to be required keyword args.

public RestArgNode

Returns:

Returns an ArgumentNode
getRestArgNode
()

Gets the restArgNode.

public boolean
public boolean
public boolean
public boolean
Inherited from org.jruby.ast.Node:
containsVariableAssignmentcreateListcreateListcreateListcreateListexecutesOncegetFilegetLinegetNodeNameisNewlineisNilneedsDefinitionChecksetLinesetNewlinetoStringtoStringtoStringExtraInfotoStringInternalunsetNewline

Field Detail

argsback to summary
private final Node[] args
blockArgNodeback to summary
private final BlockArgNode blockArgNode
keyRestback to summary
private final KeywordRestArgNode keyRest
keywordsIndexback to summary
private final short keywordsIndex
NO_ARGSback to summary
private static final Node[] NO_ARGS
optIndexback to summary
private final short optIndex
postIndexback to summary
private final short postIndex
restArgNodeback to summary
protected final RestArgNode restArgNode

Constructor Detail

ArgsNodeback to summary
public ArgsNode(int line, ListNode pre, ListNode optionalArguments, RestArgNode rest, ListNode post, BlockArgNode blockArgNode)

Construct a new ArgsNode with no keyword arguments.

ArgsNodeback to summary
public ArgsNode(int line, ListNode pre, ListNode optionalArguments, RestArgNode rest, ListNode post, ListNode keywords, KeywordRestArgNode keyRest, BlockArgNode blockArgNode)

Construct a new ArgsNode with keyword arguments.

Method Detail

acceptback to summary
public <T> T accept(NodeVisitor<T> iVisitor)

Implements abstract org.jruby.ast.Node.accept.

Accept for the visitor pattern.

Parameters
iVisitor:NodeVisitor<T>

the visitor

Annotations
@Override
cannotAcceptKwargsback to summary
public boolean cannotAcceptKwargs()
childNodesback to summary
public List<Node> childNodes()

Implements abstract org.jruby.ast.Node.childNodes.

Annotations
@Override
getArgsback to summary
public Node[] getArgs()
getBlockback to summary
public BlockArgNode getBlock()

Gets the explicit block argument of the parameter list (&block).

Returns:BlockArgNode

Returns a BlockArgNode

getKeyRestback to summary
public KeywordRestArgNode getKeyRest()
getKeywordCountback to summary
public int getKeywordCount()
getKeywordsback to summary
public ListNode getKeywords()
getKeywordsIndexback to summary
public int getKeywordsIndex()
getNodeTypeback to summary
public NodeType getNodeType()

Implements abstract org.jruby.ast.Node.getNodeType.

Returns:NodeType

Doc from org.jruby.ast.Node.getNodeType.

the nodeId

Annotations
@Override
getOptArgIndexback to summary
public int getOptArgIndex()
getOptArgsback to summary
public ListNode getOptArgs()

Gets the optArgs.

Returns:ListNode

Returns a ListNode

getOptionalArgsCountback to summary
public int getOptionalArgsCount()
getPostback to summary
public ListNode getPost()
getPostCountback to summary
public int getPostCount()
getPostIndexback to summary
public int getPostIndex()
getPreback to summary
public ListNode getPre()

Gets the required arguments at the beginning of the argument definition

getPreCountback to summary
public int getPreCount()
getRequiredArgsCountback to summary
public int getRequiredArgsCount()
getRequiredKeywordCountback to summary
public int getRequiredKeywordCount()

How many of the keywords listed happen to be required keyword args.

Note

total kwargs - req kwarg = opt kwargs.

getRestArgNodeback to summary
public RestArgNode getRestArgNode()

Gets the restArgNode.

Returns:RestArgNode

Returns an ArgumentNode

hasKeyRestback to summary
public boolean hasKeyRest()
hasKwargsback to summary
public boolean hasKwargs()
hasRestArgback to summary
public boolean hasRestArg()
isEmptyback to summary
public boolean isEmpty()