//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
// PLEASE DO NOT EDIT WITHOUT THE EXPLICIT CONSENT OF THE AUTHOR! \\
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
using System.Collections;
using Ilog.Language.Util;
namespace Ilog.Language.Parsing
{
/**
* This is the class of states of the parsing automaton used at parse
* time.
*
* @version Last modified on Sun May 29 09:14:52 2005 by hak
* @author Hassan Aït-Kaci
* @copyright © 2000 ILOG, S.A.
*/
public class State : ArrayIndexed
{
/**
* Constructs a parser state with the specified index.
*/
public State (int index)
: base(GenericParser.States, index)
{
}
/**
* This state's action table.
*/
private Hashtable actionTable;
internal Hashtable ActionTable
{
get { return actionTable; }
}
/**
* This state's goto table.
*/
private Hashtable gotoTable;
internal Hashtable GotoTable
{
get { return gotoTable; }
}
/**
* This state's dynamic actions.
*/
private Action[][] dynamicActions;
internal Action[][] DynamicActions
{
get { return dynamicActions; }
set { dynamicActions = value; }
}
/**
* Sets the action and goto table to the specified tables.
*/
public void SetTables (Hashtable actionTable, Hashtable gotoTable)
{
this.actionTable = actionTable;
this.gotoTable = gotoTable;
}
/**
* Returns the parser's action associated with the specified
* terminal in this state.
*/
public Action GetAction (Terminal symbol)
{
return (Action)actionTable[symbol];
}
/**
* Returns the parser's state to move to upon seeing the specified
* nonterminal on the parser stack in this state.
*/
public State GetGoto (NonTerminal symbol)
{
return (State)gotoTable[symbol];
}
}
}