| java.lang.Object net.sourceforge.chaperon.build.Automaton
Automaton | public class Automaton (Code) | | This class contains a automaton of states.
author: Stephan Michels version: CVS $Id: Automaton.java,v 1.8 2003/12/09 19:55:53 benedikta Exp $ |
Constructor Summary | |
public | Automaton(Grammar grammar) Create a new automaton of states, calculated with the aid of the grammar. | public | Automaton(Grammar grammar, Log log) Create a new automaton of states, calculated with the aid of the grammar. |
Method Summary | |
public int | addState(State state) Add a state to this automaton.
Parameters: state - State. | public boolean | contains(State state) If this automaton contains the state.
Parameters: state - State, which should be found. | public Grammar | getGrammar() | public State | getState(int index) Return an state given by an index.
Parameters: index - Index of the state. | public int | getStateCount() | public int | indexOf(State state) Return the index of an state. | public String | toString() Return a string representation of the automaton. |
Automaton | public Automaton(Grammar grammar)(Code) | | Create a new automaton of states, calculated with the aid of the grammar. The constructor
calculates all state and transitions and combine all states with the same core.
Parameters: grammar - Grammar. |
Automaton | public Automaton(Grammar grammar, Log log)(Code) | | Create a new automaton of states, calculated with the aid of the grammar. The constructor
calculates all state and transitions and combine all states with the same core.
Parameters: grammar - Grammar Parameters: firstsets - First sets. Parameters: log - Log, which should be used. |
addState | public int addState(State state)(Code) | | Add a state to this automaton.
Parameters: state - State. Index of the state in the automaton. |
contains | public boolean contains(State state)(Code) | | If this automaton contains the state.
Parameters: state - State, which should be found. True, if the automaton contains the state. |
getState | public State getState(int index)(Code) | | Return an state given by an index.
Parameters: index - Index of the state. State. |
getStateCount | public int getStateCount()(Code) | | Return the count of states in this automaton
Count of states. |
indexOf | public int indexOf(State state)(Code) | | Return the index of an state. If the automaton does not contain the state, then return this
method will return -1.
Parameters: state - State, which should be found. Index of the state. |
toString | public String toString()(Code) | | Return a string representation of the automaton.
String representation of the automaton. |
|
|