Interface of finite automaton, which is provided to algorithms for operations with finite automata. More...
#include <iautomaton.h>
Public Types | |
typedef QList< QSharedPointer < IAutomaton > > | TAutomataList |
typedef QMap< QString, QPointF > | TPositioningMap |
Public Member Functions | |
virtual | ~IAutomaton () |
virtual bool | allowRedundantTransitions () const =0 |
virtual QSharedPointer< IState > | createState (const QString &name, const QString &label, bool initial, bool final)=0 |
Creates and adds state to automaton (returns NULL if failed). | |
virtual QSharedPointer < ITransition > | createTransition (const QString &source, const QString &dest, const ITransition::TCharSet &characters)=0 |
virtual ITransition::TCharSet | getAlphabet () const =0 |
virtual QString | getAlphabetSymbol () const =0 |
virtual QString | getEpsilonSymbol () const =0 |
virtual IState::TIStateList | getFinalStates () const =0 |
virtual IState::TIStateList | getInitialStates () const =0 |
virtual QSharedPointer< IState > | getState (const QString &name) const =0 |
virtual IState::TIStateNameList | getStateNameList () const =0 |
virtual IState::TIStateList | getStates () const =0 |
virtual ITransition::TITransitionList | getTransitions () const =0 |
virtual QSharedPointer < ITransitionTable > | getTransitionTable () const =0 |
virtual bool | removeState (const QString &stateName)=0 |
virtual bool | removeState (const QSharedPointer< IState > &state)=0 |
virtual bool | removeTransition (const QSharedPointer< ITransition > &tr)=0 |
virtual bool | renameState (const QSharedPointer< IState > &state, const QString &newName)=0 |
Renames state and effects changed on transitions. | |
virtual void | setAllowRedundantTransitions (bool allow)=0 |
Sets whether automaton should allow redundant transitions or not. | |
virtual void | setAlphabet (const ITransition::TCharSet &alphabet)=0 |
virtual void | setAlphabetSymbol (const QString &alphabetSymbol)=0 |
virtual void | setEpsilonSymbol (const QString &epsilonSymbol)=0 |
Methods giving informations about automaton | |
virtual bool | hasMultipleInitials () const =0 |
virtual bool | hasEpsilonTransitions () const =0 |
virtual bool | isDeterministic () const =0 |
virtual bool | hasState (const QString &name) const =0 |
virtual ITransition::TCharSet | getTransitionSymbols (const QString &source, const QString &dest) const =0 |
Positioning methods | |
virtual bool | hasPositions () const =0 |
virtual TPositioningMap | getPositioningMap () const =0 |
Returns positioning map. | |
virtual void | setPositioningMap (const TPositioningMap &map)=0 |
Sets map with positions of states. | |
Simulation support methods | |
virtual void | reset ()=0 |
virtual bool | processCharacter (const QString &character)=0 |
Process input character. | |
virtual bool | isConfigurationAccepted () const =0 |
Returns true if current configuration is ACCEPTed. | |
virtual IState::TIStateList | getActiveStates () const =0 |
Returns currently active states. | |
virtual QStringList | getActiveStatesNames () const =0 |
Returns active states names in QStringList. | |
virtual QStringList | getProcessedString () const =0 |
Returns currently accepted string (nothing after reset()). |
Interface of finite automaton, which is provided to algorithms for operations with finite automata.
Definition at line 59 of file iautomaton.h.
typedef QList<QSharedPointer<IAutomaton> > IAutomaton::TAutomataList |
Definition at line 63 of file iautomaton.h.
typedef QMap<QString, QPointF> IAutomaton::TPositioningMap |
Definition at line 64 of file iautomaton.h.
virtual IAutomaton::~IAutomaton | ( | ) | [inline, virtual] |
Definition at line 66 of file iautomaton.h.
virtual bool IAutomaton::allowRedundantTransitions | ( | ) | const [pure virtual] |
If returns true, no transitions with the same characters between the same states are allowed. In that case, automaton automatically merges created transitions in the way, that there can be maximally two transition's instances for each pair of states in automaton. One of them is reserved for epsilon transition, the second is for other characters.
Implemented in AutomatonImpl.
virtual QSharedPointer<IState> IAutomaton::createState | ( | const QString & | name, | |
const QString & | label, | |||
bool | initial, | |||
bool | final | |||
) | [pure virtual] |
Creates and adds state to automaton (returns NULL if failed).
Implemented in AutomatonImpl.
virtual QSharedPointer<ITransition> IAutomaton::createTransition | ( | const QString & | source, | |
const QString & | dest, | |||
const ITransition::TCharSet & | characters | |||
) | [pure virtual] |
Creates and adds transition to automaton (returns NULL if failed). If transitions with same parameters currently exists, is silently returned as if it has been already created.
Implemented in AutomatonImpl.
virtual IState::TIStateList IAutomaton::getActiveStates | ( | ) | const [pure virtual] |
Returns currently active states.
Implemented in AutomatonImpl.
virtual QStringList IAutomaton::getActiveStatesNames | ( | ) | const [pure virtual] |
Returns active states names in QStringList.
Implemented in AutomatonImpl.
virtual ITransition::TCharSet IAutomaton::getAlphabet | ( | ) | const [pure virtual] |
Implemented in AutomatonImpl.
virtual QString IAutomaton::getAlphabetSymbol | ( | ) | const [pure virtual] |
Implemented in AutomatonImpl.
virtual QString IAutomaton::getEpsilonSymbol | ( | ) | const [pure virtual] |
Implemented in AutomatonImpl.
virtual IState::TIStateList IAutomaton::getFinalStates | ( | ) | const [pure virtual] |
Implemented in AutomatonImpl.
virtual IState::TIStateList IAutomaton::getInitialStates | ( | ) | const [pure virtual] |
Implemented in AutomatonImpl.
virtual TPositioningMap IAutomaton::getPositioningMap | ( | ) | const [pure virtual] |
Returns positioning map.
Implemented in AutomatonImpl.
virtual QStringList IAutomaton::getProcessedString | ( | ) | const [pure virtual] |
Returns currently accepted string (nothing after reset()).
Implemented in AutomatonImpl.
virtual QSharedPointer<IState> IAutomaton::getState | ( | const QString & | name | ) | const [pure virtual] |
Implemented in AutomatonImpl.
virtual IState::TIStateNameList IAutomaton::getStateNameList | ( | ) | const [pure virtual] |
Implemented in AutomatonImpl.
virtual IState::TIStateList IAutomaton::getStates | ( | ) | const [pure virtual] |
Implemented in AutomatonImpl.
virtual ITransition::TITransitionList IAutomaton::getTransitions | ( | ) | const [pure virtual] |
Implemented in AutomatonImpl.
virtual ITransition::TCharSet IAutomaton::getTransitionSymbols | ( | const QString & | source, | |
const QString & | dest | |||
) | const [pure virtual] |
Implemented in AutomatonImpl.
virtual QSharedPointer<ITransitionTable> IAutomaton::getTransitionTable | ( | ) | const [pure virtual] |
Implemented in AutomatonImpl.
virtual bool IAutomaton::hasEpsilonTransitions | ( | ) | const [pure virtual] |
Implemented in AutomatonImpl.
virtual bool IAutomaton::hasMultipleInitials | ( | ) | const [pure virtual] |
Implemented in AutomatonImpl.
virtual bool IAutomaton::hasPositions | ( | ) | const [pure virtual] |
Implemented in AutomatonImpl.
virtual bool IAutomaton::hasState | ( | const QString & | name | ) | const [pure virtual] |
Implemented in AutomatonImpl.
virtual bool IAutomaton::isConfigurationAccepted | ( | ) | const [pure virtual] |
Returns true if current configuration is ACCEPTed.
Implemented in AutomatonImpl.
virtual bool IAutomaton::isDeterministic | ( | ) | const [pure virtual] |
Implemented in AutomatonImpl.
virtual bool IAutomaton::processCharacter | ( | const QString & | character | ) | [pure virtual] |
Process input character.
Implemented in AutomatonImpl.
virtual bool IAutomaton::removeState | ( | const QSharedPointer< IState > & | state | ) | [pure virtual] |
Implemented in AutomatonImpl.
virtual bool IAutomaton::removeState | ( | const QString & | stateName | ) | [pure virtual] |
Implemented in AutomatonImpl.
virtual bool IAutomaton::removeTransition | ( | const QSharedPointer< ITransition > & | tr | ) | [pure virtual] |
Implemented in AutomatonImpl.
virtual bool IAutomaton::renameState | ( | const QSharedPointer< IState > & | state, | |
const QString & | newName | |||
) | [pure virtual] |
Renames state and effects changed on transitions.
Implemented in AutomatonImpl.
virtual void IAutomaton::reset | ( | ) | [pure virtual] |
Implemented in AutomatonImpl.
virtual void IAutomaton::setAllowRedundantTransitions | ( | bool | allow | ) | [pure virtual] |
Sets whether automaton should allow redundant transitions or not.
Implemented in AutomatonImpl.
virtual void IAutomaton::setAlphabet | ( | const ITransition::TCharSet & | alphabet | ) | [pure virtual] |
Implemented in AutomatonImpl.
virtual void IAutomaton::setAlphabetSymbol | ( | const QString & | alphabetSymbol | ) | [pure virtual] |
Implemented in AutomatonImpl.
virtual void IAutomaton::setEpsilonSymbol | ( | const QString & | epsilonSymbol | ) | [pure virtual] |
Implemented in AutomatonImpl.
virtual void IAutomaton::setPositioningMap | ( | const TPositioningMap & | map | ) | [pure virtual] |
Sets map with positions of states.
Implemented in AutomatonImpl.