goldengine.java
Class LRActionTable

java.lang.Object
  |
  +--goldengine.java.LRActionTable

public class LRActionTable
extends java.lang.Object

-------------------------------------------------------------------------------------------
Source File: LRActionTable.java
Author: Devin Cook, Matthew Hawkins
Description: The table of LALR Actions associated with this grammar.
-------------------------------------------------------------------------------------------
Revision List

      Author          Version         Description
      ------          -------         -----------
      MPH             1.0             First Issue

-------------------------------------------------------------------------------------------
IMPORT: java.util
-------------------------------------------------------------------------------------------


Constructor Summary
LRActionTable()
           
 
Method Summary
 int actionIndexForSymbol(int symbolIndex)
          actionIndexForSymbol This method will return the index in the symbol table for the symbol in the action table specified by symbolIndex.
 void addItem(Symbol theSym, int theActionConstant, int theValue)
          addItem This method will add a symbol to the action table.
 int count()
          count
 LRAction item(int n)
          item This method will return the LRAction at the specified index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LRActionTable

public LRActionTable()
Method Detail

actionIndexForSymbol

public int actionIndexForSymbol(int symbolIndex)
actionIndexForSymbol This method will return the index in the symbol table for the symbol in the action table specified by symbolIndex.
Parameters:
symbolIndex - The index in the action table of the Symbol
Returns:
The index in the Symbol Table of the Symbol specified.

addItem

public void addItem(Symbol theSym,
                    int theActionConstant,
                    int theValue)
addItem This method will add a symbol to the action table. It will create a new LRAction, set its value and actionConstant, and then increment the member count after adding it.
Parameters:
theSym - The symbol in the LRAction.
theActionConstant - The action constant of the LRAction.
theValue - The value of the LRAction.

count

public int count()
count
Returns:

item

public LRAction item(int n)
item This method will return the LRAction at the specified index. It will only return if and only if the index is a valid number.
Parameters:
n - The index in the LRActionTable to look at.
Returns:
The LRAction at the specified index.