Package org.jruby.ast

Class IterNode

java.lang.Object
org.jruby.ast.Node
org.jruby.ast.IterNode
All Implemented Interfaces:
DefNode
Direct Known Subclasses:
ForNode, LambdaNode, PostExeNode, PreExeNode

public class IterNode extends Node implements DefNode
Represents a block.
  • Constructor Details

    • IterNode

      public IterNode(int line, Node args, StaticScope scope, Node body, int endLine)
      Used by ForNode only. This is to support 1.8-style assignments which only 'for' expressions use.
    • IterNode

      public IterNode(int line, ArgsNode args, Node body, StaticScope scope, int endLine)
      Used for all non-for types of blocks.
  • Method Details

    • getNodeType

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

      public <T> T accept(NodeVisitor<T> iVisitor)
      Accept for the visitor pattern.
      Specified by:
      accept in class Node
      Parameters:
      iVisitor - the visitor
    • getArgsNode

      public ArgsNode getArgsNode()
      Description copied from interface: DefNode
      Gets the argsNode.
      Specified by:
      getArgsNode in interface DefNode
      Returns:
      Returns a Node
    • getScope

      public StaticScope getScope()
      Description copied from interface: DefNode
      Get the static scoping information.
      Specified by:
      getScope in interface DefNode
      Returns:
      the scoping info
    • getBodyNode

      public Node getBodyNode()
      Gets the bodyNode.
      Specified by:
      getBodyNode in interface DefNode
      Returns:
      Returns a Node
    • getVarNode

      public Node getVarNode()
      Gets the varNode.
      Returns:
      Returns a Node
    • childNodes

      public List<Node> childNodes()
      Specified by:
      childNodes in class Node
    • getEndLine

      public int getEndLine()
      Description copied from interface: DefNode
      Which line if the end keyword located
      Specified by:
      getEndLine in interface DefNode
      Returns:
      the line (zero-offset)