Package eu.bandm.tools.lexic
Class Automaton<L,T>
java.lang.Object
eu.bandm.tools.lexic.Automaton<L,T>
- Type Parameters:
L
- the type of labels of this automatonT
- the type of transitions of this automaton
- All Implemented Interfaces:
FormatClient
- Direct Known Subclasses:
DAutomaton
,NAutomaton
Base class of finite automata.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static final class
State of an automaton.static interface
Iterator-like mutable API for tracking the consumption of an input sequence of code points by an automaton.protected class
Base class for depth-first-search transformers. -
Field Summary
Modifier and TypeFieldDescriptionprotected final Automaton.State
The initial state of the automaton.protected final Map<Automaton.State,
Behavior<L, T>> The behavioral table of the automaton. -
Constructor Summary
ModifierConstructorDescriptionprotected
Automaton
(Automaton.State initial, Map<Automaton.State, Behavior<L, T>> table) Creates a new instance. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.bandm.tools.format.spi.FormatClient
format
-
Field Details
-
initial
The initial state of the automaton. -
table
The behavioral table of the automaton.
-
-
Constructor Details
-
Automaton
Creates a new instance.The caller must ensure that the given behavioral table is closed, i.e., the initial state and all states that occur in behavior values do also occur as keys. That property is essential for correct operation, but not checked by this constructor.
- Parameters:
initial
- the initial state of the automatontable
- the behavioral table of the automaton
-
-
Method Details
-
size
public int size()Returns the number of states of this automaton.- Returns:
- the number of states of this automaton
-