Computer Laboratory

Detailed Description

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"

+ Inheritance diagram for tesla::NFA:
+ Collaboration diagram for tesla::NFA:

Public Member Functions

NFALink (const AutomataMap &Desc)
 Construct a version of this Automaton with all sub-automata transitions replaced by real NFA elements (states and transitions). More...
 
- Public Member Functions inherited from tesla::Automaton
virtual ~Automaton ()
 
virtual bool IsRealisable () const
 
size_t ID () const
 
const AutomatonDescriptiongetAssertion () const
 
const UsageUse () 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 NFAParse (const AutomatonDescription *, const Usage *, unsigned int id)
 

Friends

class DFA
 
class internal::NFAParser
 

Additional Inherited Members

- Public Types inherited from tesla::Automaton
enum  Type { Unlinked, Linked, Deterministic }
 Automata representations, in increasing order of realisability. More...
 
typedef llvm::SmallVector
< State *, 10 > 
StateVector
 
- Protected Member Functions inherited from tesla::Automaton
 Automaton (size_t id, const AutomatonDescription &, const Usage *, llvm::StringRef Name, llvm::ArrayRef< State * >, const TransitionSets &)
 
- Protected Attributes inherited from tesla::Automaton
const size_t id
 
const AutomatonDescriptionassertion
 Automaton states. More...
 
const Usageuse
 How the automaton is used. More...
 
const std::string name
 
StateVector States
 
TransitionSets Transitions
 

Member Function Documentation

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).

Parameters
Descwhere 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.

239  {
240  assert(id < 1000);
241 
242  OwningPtr<NFA> N;
243  internal::NFAParser(assertion, use, &Descriptions)
244  .AllowSubAutomata(false)
245  .Parse(N, id);
246  assert(N);
247 
248  return N.take();
249 }

+ Here is the call graph for this function:

NFA * tesla::NFA::Parse ( const AutomatonDescription A,
const Usage Use,
unsigned int  id 
)
static

Definition at line 230 of file Automaton.cpp.

References tesla::internal::NFAParser::Parse().

231  {
232  OwningPtr<NFA> N;
233  internal::NFAParser(*A, Use).Parse(N, id);
234  assert(N);
235 
236  return N.take();
237 }

+ Here is the call graph for this function:

Friends And Related Function Documentation

friend class DFA
friend

Definition at line 141 of file Automaton.h.

friend class internal::NFAParser
friend

Definition at line 159 of file Automaton.h.


The documentation for this class was generated from the following files: