Package org.jruby.ast

Class LiteralNode

java.lang.Object
org.jruby.ast.Node
org.jruby.ast.LiteralNode
All Implemented Interfaces:
InvisibleNode

public class LiteralNode extends Node implements InvisibleNode
This is not a node in the classic sense in that it has no defined or interpret method which can be called. It just stores the position of the literal and the name/value of the literal. We made it a node so that the parser needs to work less hard in its productions. dynamic literals are nodes and by having literals also be nodes means they have a common subtype which is not Object. Used by alias and undef.
  • Constructor Details

    • LiteralNode

      public LiteralNode(int line, RubySymbol name)
  • Method Details

    • getName

      public String getName()
    • getByteName

      public ByteList getByteName()
    • getSymbolName

      public RubySymbol getSymbolName()
    • accept

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

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

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