| java.lang.Object net.sourceforge.chaperon.build.State
State | public class State (Code) | | This class represents a set of items, which means positions of production, in production. These
states were used to decribes states.
author: Stephan Michels version: CVS $Id: State.java,v 1.8 2003/12/09 19:55:53 benedikta Exp $ |
Constructor Summary | |
public | State(Grammar grammar) Create an empty set of items. |
State | public State(Grammar grammar)(Code) | | Create an empty set of items.
Parameters: grammar - Grammar. |
addItem | public boolean addItem(Production production, int position)(Code) | | Add a item to this set.
Parameters: production - Production. Parameters: position - Position in this production. True, if this item was added |
addShiftAction | public boolean addShiftAction(Symbol symbol, State state)(Code) | | Add a transition to this state.
Parameters: symbol - Symbol, which forces a transition into another state. Parameters: state - Destination state. |
contains | public boolean contains(State state)(Code) | | Test, if all items from a other state exists in this state
Parameters: state - Other state. True, if the state contains all items. |
equals | public boolean equals(Object o)(Code) | | Compares two states.
Parameters: o - Other state. True, if the states are equal. |
getItemCount | public int getItemCount()(Code) | | Returns the count of items in this set.
Count of items of the core. |
getShiftAction | public ShiftAction getShiftAction(Symbol symbol)(Code) | | Returns the destination state of a transition.
Parameters: symbol - Symbol, which force the transition. Destination state. |
isEmpty | public boolean isEmpty()(Code) | | Returns true, if this set is empty.
True, if this set is empty. |
jump | public State jump(Symbol symbol)(Code) | | Calculates the next state by a transition through the symbol X.
Parameters: symbol - A Symbol, which can be a terminal or a nonterminal symbol. The next state, represented by an state. |
toString | public String toString()(Code) | | Return a string representation of this state.
String representation of this state. |
|
|