LLVM 20.0.0git
|
A deterministic finite-state automaton. More...
#include "llvm/Support/Automaton.h"
Public Member Functions | |
template<typename InfoT > | |
Automaton (ArrayRef< InfoT > Transitions, ArrayRef< NfaStatePair > TranscriptionTable={}) | |
Create an automaton. | |
Automaton (const Automaton &Other) | |
void | reset () |
Reset the automaton to its initial state. | |
void | enableTranscription (bool Enable=true) |
Enable or disable transcription. | |
bool | add (const ActionT &A) |
Transition the automaton based on input symbol A. | |
bool | canAdd (const ActionT &A) |
Return true if the automaton can be transitioned based on input symbol A. | |
ArrayRef< NfaPath > | getNfaPaths () |
Obtain a set of possible paths through the input nondeterministic automaton that could be obtained from the sequence of input actions presented to this deterministic automaton. | |
A deterministic finite-state automaton.
The automaton is defined in TableGen; this object drives an automaton defined by tblgen-emitted tables.
An automaton accepts a sequence of input tokens ("actions"). This class is templated on the type of these actions.
Definition at line 160 of file Automaton.h.
|
inline |
Create an automaton.
Transitions | The Transitions table as created by TableGen. Note that because the action type differs per automaton, the table type is templated as ArrayRef<InfoT>. |
TranscriptionTable | The TransitionInfo table as created by TableGen. |
Providing the TranscriptionTable argument as non-empty will enable the use of transcription, which analyzes the possible paths in the original NFA taken by the DFA. NOTE: This is substantially more work than simply driving the DFA, so unless you require the getPaths() method leave this empty.
Definition at line 191 of file Automaton.h.
|
inline |
Definition at line 203 of file Automaton.h.
References llvm::Other.
|
inline |
Transition the automaton based on input symbol A.
Return true if the automaton transitioned to a valid state, false if the automaton transitioned to an invalid state.
If this function returns false, all methods are undefined until reset() is called.
Definition at line 233 of file Automaton.h.
Referenced by llvm::DFAPacketizer::reserveResources().
|
inline |
Return true if the automaton can be transitioned based on input symbol A.
Definition at line 244 of file Automaton.h.
Referenced by llvm::DFAPacketizer::canReserveResources().
|
inline |
Enable or disable transcription.
Transcription is only available if TranscriptionTable was provided to the constructor.
Definition at line 220 of file Automaton.h.
References assert(), and llvm::Enable.
|
inline |
Obtain a set of possible paths through the input nondeterministic automaton that could be obtained from the sequence of input actions presented to this deterministic automaton.
Definition at line 252 of file Automaton.h.
References assert().
Referenced by llvm::DFAPacketizer::getUsedResources().
|
inline |
Reset the automaton to its initial state.
Definition at line 212 of file Automaton.h.