Definition at line 78 of file Automaton.cpp.
Definition at line 80 of file Automaton.cpp.
83 : Automaton(A), Use(Use), Descriptions(Descriptions),
84 SubAutomataAllowed(
true)
NFAParser & tesla::internal::NFAParser::AllowSubAutomata |
( |
bool |
Allow | ) |
|
Definition at line 260 of file Automaton.cpp.
Referenced by tesla::NFA::Link().
261 assert(Allow || Descriptions != NULL &&
"need a source of subautomata");
262 SubAutomataAllowed = Allow;
void tesla::internal::NFAParser::Parse |
( |
OwningPtr< NFA > & |
Out, |
|
|
unsigned int |
id |
|
) |
| |
Parse the NFA, assign it ID id and put it in Out.
- Parameters
-
[out] | Out | where to store the NFA |
[in] | id | an integer ID for the resulting NFA |
Definition at line 267 of file Automaton.cpp.
References tesla::Usage::beginning, tesla::State::Builder::Build(), tesla::Transition::Copy(), tesla::debugs(), tesla::Usage::end, tesla::Transition::FieldAssign, tesla::Transition::Fn, tesla::Transition::GroupClasses(), tesla::State::NewBuilder(), tesla::Transition::Now, tesla::Transition::Null, tesla::panic(), tesla::State::Builder::SetRefCount(), tesla::State::Builder::SetStartState(), tesla::ShortName(), and tesla::Transition::SubAutomaton.
Referenced by tesla::NFA::Link(), and tesla::NFA::Parse().
268 debugs(
"tesla.automata.parsing")
271 size_t VariableRefs = 0;
273 if (A.type() == Argument::Variable)
282 if (Use && Use->has_beginning()) {
286 TextFormat::PrintToString(Use->
beginning(), &Str);
287 panic(
"failed to parse automaton 'beginning' event: " + Str);
297 if (Use && Use->has_end()) {
298 End =
Parse(Use->
end(), *End,
false,
true);
301 TextFormat::PrintToString(Use->
end(), &Str);
302 panic(
"failed to parse automaton 'end' event: " + Str);
308 debugs(
"tesla.automata.parsing.out-of-scope") <<
"out-of-scope events:\n";
309 vector<const Transition*> OutOfScope;
310 for (
const Transition *T : Transitions) {
317 bool AlreadyHave =
false;
318 for (
const Transition *Existing : OutOfScope)
319 if (Existing->EquivalentTo(*T)) {
324 if (!AlreadyHave && !T->IsStrict() && !T->RequiresInit()) {
325 OutOfScope.push_back(T);
326 debugs(
"tesla.automata.parsing.out-of-scope")
327 <<
" " << T->String() <<
"\n";
331 for (
auto *T : OutOfScope) {
332 State& Destination = *(T->RequiresCleanup() ? End : Start);
334 switch (T->getKind()) {
347 const Identifier &ID = Automaton.
identifier();
350 TextFormat::PrintToString(Automaton, &Description);
355 Out.reset(
new NFA(
id, Automaton, Use,
ShortName(ID), States, TEquivClasses));
357 debugs(
"tesla.automata.parsing") <<
"parsed '" << Out->Name() <<
"'.\n\n";
The documentation for this class was generated from the following file: