class Automaton
Declaration
template <typename ActionT>
class Automaton { /* full declaration omitted */ };
Description
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.
Declared at: llvm/include/llvm/Support/Automaton.h:162
Templates
- ActionT
Method Overview
- public Automaton<ActionT>(const Automaton<ActionT> & Other)
- public template <typename InfoT> Automaton<ActionT>(ArrayRef<InfoT> Transitions, ArrayRef<llvm::NfaStatePair> TranscriptionTable = {})
- public bool add(const ActionT & A)
- public bool canAdd(const ActionT & A)
- public void enableTranscription(bool Enable = true)
- public ArrayRef<llvm::NfaPath> getNfaPaths()
- public void reset()
Methods
¶Automaton<ActionT>(
const Automaton<ActionT>& Other)
Automaton<ActionT>(
const Automaton<ActionT>& Other)
Declared at: llvm/include/llvm/Support/Automaton.h:205
Parameters
- const Automaton<ActionT>& Other
¶template <typename InfoT>
Automaton<ActionT>(ArrayRef<InfoT> Transitions,
ArrayRef<llvm::NfaStatePair>
TranscriptionTable = {})
template <typename InfoT>
Automaton<ActionT>(ArrayRef<InfoT> Transitions,
ArrayRef<llvm::NfaStatePair>
TranscriptionTable = {})
Description
Create an automaton. 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.
Declared at: llvm/include/llvm/Support/Automaton.h:193
Templates
- InfoT
Parameters
- ArrayRef<InfoT> 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 >.
- ArrayRef<llvm::NfaStatePair> TranscriptionTable = {}
- The TransitionInfo table as created by TableGen.
¶bool add(const ActionT& A)
bool add(const ActionT& A)
Description
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.
Declared at: llvm/include/llvm/Support/Automaton.h:235
Parameters
- const ActionT& A
¶bool canAdd(const ActionT& A)
bool canAdd(const ActionT& A)
Description
Return true if the automaton can be transitioned based on input symbol A.
Declared at: llvm/include/llvm/Support/Automaton.h:246
Parameters
- const ActionT& A
¶void enableTranscription(bool Enable = true)
void enableTranscription(bool Enable = true)
Description
Enable or disable transcription. Transcription is only available if TranscriptionTable was provided to the constructor.
Declared at: llvm/include/llvm/Support/Automaton.h:222
Parameters
- bool Enable = true
¶ArrayRef<llvm::NfaPath> getNfaPaths()
ArrayRef<llvm::NfaPath> getNfaPaths()
Description
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.
Declared at: llvm/include/llvm/Support/Automaton.h:254
¶void reset()
void reset()
Description
Reset the automaton to its initial state.
Declared at: llvm/include/llvm/Support/Automaton.h:214