goldengine.java
Class Symbol

java.lang.Object
  |
  +--goldengine.java.Symbol
All Implemented Interfaces:
SymbolTypeConstants

public class Symbol
extends java.lang.Object
implements SymbolTypeConstants

-------------------------------------------------------------------------------------------
Source File: Symbol.java
Author: Devin Cook, Matthew Hawkins
Description: A representation of a symbol associated with this grammar.
-------------------------------------------------------------------------------------------
Revision List

      Author          Version         Description
      ------          -------         -----------
      MPH             1.0             First Issue
      MPH             1.1             Added isEqual method

-------------------------------------------------------------------------------------------
IMPORT: NONE
-------------------------------------------------------------------------------------------


Fields inherited from interface goldengine.java.SymbolTypeConstants
symbolTypeCommentEnd, symbolTypeCommentLine, symbolTypeCommentStart, symbolTypeEnd, symbolTypeError, symbolTypeNonterminal, symbolTypeTerminal, symbolTypeWhitespace
 
Constructor Summary
Symbol()
          Symbol The constructor simply initialises the table index.
 
Method Summary
 int getKind()
          getKind This method gets the kind of symbol (defined in SymbolTypeConstants).
 java.lang.String getName()
          getName This method gets the name of the symbol.
 int getTableIndex()
          getTableIndex This method gets the table index of this symbol.
 java.lang.String getText()
          getText This method will create a text representation of this Symbol.
 boolean isEqual(Symbol other)
          isEqual #ver1.1# This method will check equality of two Symbols - this and the one passed in.
 void setKind(int newKind)
          setKind This method sets the kind of the symbol (defined in SymbolTypeConstants).
 void setName(java.lang.String newName)
          setName This method sets the name of the symbol.
 void setTableIndex(int newTab)
          setTableIndex This method sets the table index of the symbol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Symbol

public Symbol()
Symbol The constructor simply initialises the table index.
Method Detail

getName

public java.lang.String getName()
getName This method gets the name of the symbol.
Returns:
The name of the symbol.

getKind

public int getKind()
getKind This method gets the kind of symbol (defined in SymbolTypeConstants).
Returns:
The kind of symbol.

getTableIndex

public int getTableIndex()
getTableIndex This method gets the table index of this symbol.
Returns:
The table index of this symbol.

setName

public void setName(java.lang.String newName)
setName This method sets the name of the symbol.
Parameters:
newName - The name of the symbol.

setKind

public void setKind(int newKind)
setKind This method sets the kind of the symbol (defined in SymbolTypeConstants).
Parameters:
newKind -

setTableIndex

public void setTableIndex(int newTab)
setTableIndex This method sets the table index of the symbol.
Parameters:
newTab - The kind of symbol.

getText

public java.lang.String getText()
getText This method will create a text representation of this Symbol. What text is returned depends on the kind of Symbol. If it is a Non-Terminal, angular brackets are placed before and after, if it is a Terminal, then it is formatted. Everything else is placed in parenthesis.
Returns:
The String representation of this Symbol.

isEqual

public boolean isEqual(Symbol other)
isEqual #ver1.1# This method will check equality of two Symbols - this and the one passed in.
Parameters:
other - The symbol to check against this one.
Returns:
True if it is equal, false if not.