All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class epp.Symbol

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

public class Symbol
extends Token
The Symbol class allows symbols of languages such as lisp to be used in Java. To use this class, the Symbol plug-in is required.

Symbol is an important data type that is used for many purposes in EPP. The followin are examples of the usage of Symbol.

	Symbol x = :foo;
	Symbol y = :"foo";
	Symbol z = Symbol.intern("foo");
	System.out.println(x == :foo);	// true
	System.out.println(y == :foo);	// true
	System.out.println(z == :foo);	// true

In expressions, Symbols are expressed as a colon followed by an identifier as in :foo. The portion following the colon is called "the name of the Symbol". Names with symbol characters and spaces can also be expressed by enclosing the name of the Symbol with double quotes as in :"." or :"long name".

Symbols can be compared using the == operator. The result will be true if the name of the two Symbols match.

Symbols can also be used as keys of java.util.Hashtable. It is faster than using strings as keys.

The Symbol class is actually a subclass of class Token, and is used as result values of the lexical analyzer.

Symbol is used for many purposes in the source code of EPP, including the following.

See Also:
Token, Tree, Dynamic

Constructor Index

 o Symbol()

Method Index

 o intern(String)
Converts a string into a Symbol.
 o isSymbol()
Returns true if this token is a Symbol and false otherwise.
 o main(String[])
 o maybeIdentifier()
 o setMaybeIdentifierFlag()
 o toString()
Converts a Symbol into a string.

Constructors

 o Symbol
 public Symbol()

Methods

 o intern
 public static Symbol intern(String name)
Converts a string into a Symbol.

 o toString
 public String toString()
Converts a Symbol into a string.

Overrides:
toString in class Object
 o isSymbol
 public boolean isSymbol()
Returns true if this token is a Symbol and false otherwise.

Overrides:
isSymbol in class Token
See Also:
Token
 o setMaybeIdentifierFlag
 public void setMaybeIdentifierFlag()
 o maybeIdentifier
 public boolean maybeIdentifier()
 o main
 public static void main(String argv[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index