code.symbols
Class Symbol

java.lang.Object
  extended by code.symbols.Symbol
Direct Known Subclasses:
DataSymbol, TypeSymbol

public abstract class Symbol
extends java.lang.Object

Abstracts a Symbol in the term rewrite system.

Since:
October 22, 2002
Author:
jimeng

Field Summary
static int DefaultVisibility
          Constant for DefaultVisibility Visibility of a symbol.
 java.lang.String moduleName
          The name of the module file that contains this symbol.
static int Private
          Constant for Private Visibility of a symbol.
static int Public
          Constant for Public Visibility of a symbol.
 java.lang.String symbolName
          Symbols's Name
 int visibility
          Specifies the Visibility of this symbol.
 
Constructor Summary
Symbol(java.lang.String moduleName, java.lang.String symbolName, int visibility)
          Constructor for the Symbol object
 
Method Summary
abstract  java.lang.Object accept(SymbolVisitor v, java.lang.Object o)
          Description of the Method
 boolean equals(java.lang.Object anObject)
          This method compares whether a given object is equal to this Symbol object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Public

public static final int Public
Constant for Public Visibility of a symbol.

See Also:
Constant Field Values

Private

public static final int Private
Constant for Private Visibility of a symbol.

See Also:
Constant Field Values

DefaultVisibility

public static final int DefaultVisibility
Constant for DefaultVisibility Visibility of a symbol. TODO: This constant should go away eventually. it is used in exactly 2 places right now. one of them is (table) slated to be removed shortly.

See Also:
Constant Field Values

symbolName

public final java.lang.String symbolName
Symbols's Name


moduleName

public final java.lang.String moduleName
The name of the module file that contains this symbol.


visibility

public final int visibility
Specifies the Visibility of this symbol. The valid values are defined by the static data members of this class Public, Private and DefaultVisibility

Constructor Detail

Symbol

public Symbol(java.lang.String moduleName,
              java.lang.String symbolName,
              int visibility)
Constructor for the Symbol object

Parameters:
moduleName - Symbol's ModuleName.
symbolName - Symbol's Name
visibility - Symbol's Visibility
Method Detail

accept

public abstract java.lang.Object accept(SymbolVisitor v,
                                        java.lang.Object o)
Description of the Method

Parameters:
v - Description of the Parameter
o - Description of the Parameter
Returns:
Description of the Return Value

equals

public boolean equals(java.lang.Object anObject)
This method compares whether a given object is equal to this Symbol object. This is true if it is a Symbol object and both its symbolName and moduleName fields are equal to this object's value for those fields. Otherwise, false is returned,

Overrides:
equals in class java.lang.Object
Parameters:
anObject - The object to compare this Symbol against.
Returns:
True if the two Symbols are equal, false otherwise.