A non-deterministic automaton that represents a TESLA assertion.
An NFA isn't easy to write recognition code for, but it is simple to construct, allow us to perform visual inspection and can be mechanically converted to a DFA.
The flow is, therefore: C -> TESLA IR -> NFA -> DFA -> instrumentation.
Objects of this type might accidentally be realisable (that is, DFAs), but the type system makes no guarantees.
Definition at line 140 of file Automaton.h.
#include "Automaton.h"
Public Member Functions | |
NFA * | Link (const AutomataMap &Desc) |
Construct a version of this Automaton with all sub-automata transitions replaced by real NFA elements (states and transitions). More... | |
![]() | |
virtual | ~Automaton () |
virtual bool | IsRealisable () const |
size_t | ID () const |
const AutomatonDescription & | getAssertion () const |
const Usage * | Use () const |
size_t | StateCount () const |
size_t | TransitionCount () const |
std::string | Name () const |
Short, unique name. More... | |
std::string | String () const |
Human-readable representation. More... | |
std::string | Dot () const |
GraphViz representation. More... | |
TransitionSets::const_iterator | begin () const |
Iterate over state transitions. More... | |
TransitionSets::const_iterator | end () const |
Static Public Member Functions | |
static NFA * | Parse (const AutomatonDescription *, const Usage *, unsigned int id) |
Friends | |
class | DFA |
class | internal::NFAParser |
Additional Inherited Members | |
![]() | |
enum | Type { Unlinked, Linked, Deterministic } |
Automata representations, in increasing order of realisability. More... | |
typedef llvm::SmallVector < State *, 10 > | StateVector |
![]() | |
Automaton (size_t id, const AutomatonDescription &, const Usage *, llvm::StringRef Name, llvm::ArrayRef< State * >, const TransitionSets &) | |
![]() | |
const size_t | id |
const AutomatonDescription & | assertion |
Automaton states. More... | |
const Usage * | use |
How the automaton is used. More... | |
const std::string | name |
StateVector | States |
TransitionSets | Transitions |
NFA * tesla::NFA::Link | ( | const AutomataMap & | Desc | ) |
Construct a version of this Automaton with all sub-automata transitions replaced by real NFA elements (states and transitions).
Desc | where to find definitions of sub-automata |
Definition at line 239 of file Automaton.cpp.
References tesla::internal::NFAParser::AllowSubAutomata(), tesla::Automaton::assertion, tesla::internal::NFAParser::Parse(), and tesla::Automaton::use.
|
static |
Definition at line 230 of file Automaton.cpp.
References tesla::internal::NFAParser::Parse().
|
friend |
Definition at line 141 of file Automaton.h.
|
friend |
Definition at line 159 of file Automaton.h.