org.jruby.ast
Class LiteralNode

java.lang.Object
  extended by org.jruby.ast.Node
      extended by org.jruby.ast.LiteralNode
All Implemented Interfaces:
InvisibleNode, ISourcePositionHolder

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.


Field Summary
 
Fields inherited from class org.jruby.ast.Node
ASSIGNMENT_BYTELIST, CLASS_VARIABLE_BYTELIST, CONSTANT_BYTELIST, EXPRESSION_BYTELIST, FALSE_BYTELIST, GLOBAL_VARIABLE_BYTELIST, INSTANCE_VARIABLE_BYTELIST, LOCAL_VARIABLE_BYTELIST, LOCAL_VARIABLE_IN_BLOCK_BYTELIST, METHOD_BYTELIST, NIL_BYTELIST, SELF_BYTELIST, SUPER_BYTELIST, TRUE_BYTELIST, YIELD_BYTELIST
 
Constructor Summary
LiteralNode(Token token)
           
 
Method Summary
 java.lang.Object accept(NodeVisitor iVisitor)
          Accept for the visitor pattern.
 java.util.List<Node> childNodes()
           
 java.lang.String getName()
           
 NodeType getNodeType()
           
 
Methods inherited from class org.jruby.ast.Node
assign, createList, definition, getNodeName, getPosition, interpret, isInvisible, setPosition, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LiteralNode

public LiteralNode(Token token)
Method Detail

getName

public java.lang.String getName()

accept

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

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

childNodes

public java.util.List<Node> childNodes()
Specified by:
childNodes in class Node

getNodeType

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


Copyright © 2002-2009 JRuby Team. All Rights Reserved.