A state in a TESLA DFA.
Definition at line 50 of file State.h.
#include "State.h"
Definition at line 59 of file State.cpp.
60 for (Transition *T : Transitions)
delete T;
void tesla::State::AddTransition |
( |
llvm::OwningPtr< Transition > & |
| ) |
|
string tesla::State::Dot |
( |
| ) |
const |
Definition at line 153 of file State.cpp.
References tesla::InstanceName().
154 assert(VariableReferences);
155 string NameExtra = name.empty() ?
"" : (
"\\n\\\"" + name +
"\\\"");
160 +
"state " + Twine(
ID())
size_t tesla::State::ID |
( |
| ) |
const |
|
inline |
bool tesla::State::IsAcceptingState |
( |
| ) |
const |
|
inline |
bool tesla::State::IsStartState |
( |
| ) |
const |
|
inline |
uint32_t tesla::State::Mask |
( |
| ) |
const |
Definition at line 113 of file State.cpp.
117 for (
size_t i = 0; i < Refs.size(); i++) {
118 if (Refs[i] && Refs[i]->type() == Argument::Variable)
string tesla::State::Name |
( |
bool |
QuoteNonNumeric = true | ) |
const |
Definition at line 126 of file State.cpp.
127 std::stringstream ss;
131 auto Quote = (QuoteNonNumeric ?
"'" :
"");
132 ss << Quote << name << Quote;
string tesla::State::String |
( |
| ) |
const |
void tesla::State::UpdateReferences |
( |
const Transition & |
T | ) |
|
Definition at line 68 of file State.cpp.
References tesla::Transition::InScope(), and tesla::Transition::ReferencesThusFar().
Referenced by tesla::Transition::Register().
70 if (VariableReferences && !T.InScope())
73 OwningArrayPtr<const Argument*> Args;
75 T.ReferencesThusFar(Args, NewRefs);
77 assert(!VariableReferences
78 || (NewRefs.size() == 0)
79 || (Refs.size() == NewRefs.size()));
80 const size_t Len = NewRefs.size();
81 assert(Len < 8 *
sizeof(
Mask()));
83 if (!VariableReferences) {
85 VariableReferences.reset(
new const Argument*[Len]);
86 memcpy(VariableReferences.get(), NewRefs.data(), Len *
sizeof(Refs[0]));
94 for (
auto *Arg : NewRefs) {
98 assert(Arg->type() == Argument::Variable);
99 assert(((
size_t) Arg->index()) <= Len);
102 uint32_t NewMask = 0;
103 for (
size_t i = 0; i < Len; i++) {
108 assert((
Mask() & NewMask) == NewMask);
The documentation for this class was generated from the following files: