All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class epp.LiteralToken

java.lang.Object
   |
   +----epp.Token
           |
           +----epp.LiteralToken

public class LiteralToken
extends Token
The LiteralToken class is a token that describes a literal.

All literals are described as instances of this class. The type of a literal is expressed by data of type Symbol, and information about the contents of a literal is expressed by data of type String called literalContents.

Examples:
123       (int "123")
1.2       (double "1.2")
"abc"     (string "abc")
"\n"      (string "\\n")
'c'       (char "c")

See Also:
Token

Constructor Index

 o LiteralToken(Symbol, String)

Method Index

 o isLiteralToken()
Returns true is this token is LiteralToken, false otherwise.
 o literalContents()
Returns literalContents if this token is a LiteralToken.
 o literalTag()
Returns literalTag if this token is a LiteralTag.
 o toString()
Converts a LiteralToken into a String for debugging.

Constructors

 o LiteralToken
 public LiteralToken(Symbol tag,
                     String contents)

Methods

 o isLiteralToken
 public boolean isLiteralToken()
Returns true is this token is LiteralToken, false otherwise.

Overrides:
isLiteralToken in class Token
 o literalTag
 public Symbol literalTag()
Returns literalTag if this token is a LiteralTag. If this token is not a LiteralTag, a fatal error occurs.

Overrides:
literalTag in class Token
 o literalContents
 public String literalContents()
Returns literalContents if this token is a LiteralToken. If this token is not a LiteralToken, a fatal error occurs.

Overrides:
literalContents in class Token
 o toString
 public String toString()
Converts a LiteralToken into a String for debugging. It converts the literalTag and literalContens into a string, enclosing them together within parentheses. For example, a LiteralToken that expresses 123 will converted into a string such as "(int \"123\")".

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index