org.jrubyparser.ast
Class BlockArgNode

java.lang.Object
  extended by org.jrubyparser.ast.Node
      extended by org.jrubyparser.ast.NamedNode
          extended by org.jrubyparser.ast.BlockArgNode
All Implemented Interfaces:
ILocalVariable, INameMatchable, INameNode, IParameter, ISourcePositionHolder

public class BlockArgNode
extends NamedNode
implements IParameter

An explicit block argument (&my_block) in a declaration (at call sites see BlockPassNode).


Constructor Summary
BlockArgNode(SourcePosition position, ArgumentNode argNode)
           
BlockArgNode(SourcePosition position, int count, String name)
           
 
Method Summary
 Object accept(NodeVisitor iVisitor)
          Accept for the visitor pattern.
 int getCount()
          Gets the count.
 ILocalVariable getDeclaration()
          Retrieve the node which is responsible for declaring this one.
 IScope getDefinedScope()
          Which Variable Scope does this variable belong to? Note that RootNode is a special ILocalScope for the implicit scope created at top-level.
 String getLexicalName()
          Get the name including any leading sigils.
 SourcePosition getLexicalNamePosition()
          The position of the name + any sigils that come with it.
 SourcePosition getNamePosition()
          The position of just the name part of the node.
 NodeType getNodeType()
           
 List<ILocalVariable> getOccurrences()
          Find all occurences of this variable including itself.
 boolean isBlockParameter()
          Is this node specifying a parameter in a block statement?
 boolean isSame(Node other)
          Checks node for 'sameness' for diffing.
 
Methods inherited from class org.jrubyparser.ast.NamedNode
getName, isNameMatch, setName
 
Methods inherited from class org.jrubyparser.ast.Node
adopt, adopt, adoptUsingNodesPosition, childNodes, comparePositionWith, createList, getClosestIScope, getClosestModule, getGrandParent, getInlineComment, getInnermostIter, getMethodFor, getNodeAt, getNodeName, getOutermostIter, getParent, getPosition, getPositionIncludingComments, getPreviousComments, insertAfter, insertAll, insertBefore, insertNode, isDescendentOf, isLeaf, isMethodParameter, setParent, setPosition, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jrubyparser.ast.INameNode
getName, setName
 
Methods inherited from interface org.jrubyparser.ast.INameMatchable
isNameMatch
 

Constructor Detail

BlockArgNode

public BlockArgNode(SourcePosition position,
                    int count,
                    String name)

BlockArgNode

public BlockArgNode(SourcePosition position,
                    ArgumentNode argNode)
Method Detail

isSame

public boolean isSame(Node other)
Checks node for 'sameness' for diffing.

Overrides:
isSame in class NamedNode
Parameters:
other - to be compared to
Returns:
Returns a boolean

getNodeType

public NodeType getNodeType()
Specified by:
getNodeType in class Node
Returns:
the nodeId

getLexicalName

public String getLexicalName()
Description copied from interface: INameNode
Get the name including any leading sigils.

Specified by:
getLexicalName in interface INameNode
Overrides:
getLexicalName in class NamedNode

accept

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

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

getCount

public int getCount()
Gets the count.

Returns:
Returns a int

isBlockParameter

public boolean isBlockParameter()
Description copied from class: Node
Is this node specifying a parameter in a block statement?

Overrides:
isBlockParameter in class Node

getDefinedScope

public IScope getDefinedScope()
Description copied from interface: ILocalVariable
Which Variable Scope does this variable belong to? Note that RootNode is a special ILocalScope for the implicit scope created at top-level.

Specified by:
getDefinedScope in interface ILocalVariable

getOccurrences

public List<ILocalVariable> getOccurrences()
Description copied from interface: ILocalVariable
Find all occurences of this variable including itself.

Specified by:
getOccurrences in interface ILocalVariable

getDeclaration

public ILocalVariable getDeclaration()
Description copied from interface: ILocalVariable
Retrieve the node which is responsible for declaring this one. This can be a variable or a parameter.

Specified by:
getDeclaration in interface ILocalVariable

getNamePosition

public SourcePosition getNamePosition()
Description copied from interface: INameNode
The position of just the name part of the node.

Specified by:
getNamePosition in interface INameNode
Overrides:
getNamePosition in class NamedNode

getLexicalNamePosition

public SourcePosition getLexicalNamePosition()
Description copied from interface: INameNode
The position of the name + any sigils that come with it.

Specified by:
getLexicalNamePosition in interface INameNode
Overrides:
getLexicalNamePosition in class NamedNode


Copyright © 2013. All Rights Reserved.