pub struct Dfa<T> { /* private fields */ }Implementations§
Source§impl<T> Dfa<T>
impl<T> Dfa<T>
pub fn with_log(log: BufLog) -> Self
pub fn get_state_graph(&self) -> &BTreeMap<StateId, BTreeMap<Segments, StateId>>
pub fn get_initial_state(&self) -> &Option<StateId>
pub fn get_end_states(&self) -> &BTreeMap<StateId, Terminal>
pub fn get_first_end_state(&self) -> &Option<StateId>
Sourcepub fn is_normalized(&self) -> bool
pub fn is_normalized(&self) -> bool
Checks if the DFA is normalized: incremental state numbers, starting at 0, with all the accepting states at the end.
Sourcepub fn normalize(self) -> Dfa<Normalized>
pub fn normalize(self) -> Dfa<Normalized>
Normalizes the DFA: incremental state number0, starting at 0, with all the accepting states at the end.
Sourcepub fn optimize(self) -> Dfa<Normalized>
pub fn optimize(self) -> Dfa<Normalized>
Optimizes the number of states from self.state_graph. Returns a map to convert old
state ids to new state ids.
Source§impl Dfa<Normalized>
impl Dfa<Normalized>
pub fn gen_tables_source_code(&self, indent: usize) -> String
Trait Implementations§
Source§impl BuildFrom<Dfa<Normalized>> for LexerGen
impl BuildFrom<Dfa<Normalized>> for LexerGen
Source§fn build_from(dfa: Dfa<Normalized>) -> Self
fn build_from(dfa: Dfa<Normalized>) -> Self
Converts to this type from the input type.
Source§impl BuildFrom<DfaBuilder> for Dfa<General>
impl BuildFrom<DfaBuilder> for Dfa<General>
Source§fn build_from(dfa_builder: DfaBuilder) -> Self
fn build_from(dfa_builder: DfaBuilder) -> Self
Builds a Dfa::<General> from a DfaBuilder.
If an error is encountered or was already encountered before, an empty shell object is built with the log detailing the error(s).
Source§impl BuildFrom<DfaBundle> for Dfa<General>
impl BuildFrom<DfaBundle> for Dfa<General>
Source§fn build_from(bundle: DfaBundle) -> Self
fn build_from(bundle: DfaBundle) -> Self
Builds a Dfa::<General> from multiple DFAs, each related to one mode.
If an error is encountered or was already encountered before, an empty shell object is built with the log detailing the error(s).
Source§impl BuildFrom<DfaTables> for Dfa<Normalized>
impl BuildFrom<DfaTables> for Dfa<Normalized>
Source§fn build_from(source: DfaTables) -> Self
fn build_from(source: DfaTables) -> Self
Converts to this type from the input type.
Source§impl<T> HasBuildErrorSource for Dfa<T>
impl<T> HasBuildErrorSource for Dfa<T>
const SOURCE: BuildErrorSource = BuildErrorSource::Dfa
fn get_build_error_source() -> BuildErrorSource
Auto Trait Implementations§
impl<T> Freeze for Dfa<T>
impl<T> RefUnwindSafe for Dfa<T>where
T: RefUnwindSafe,
impl<T> Send for Dfa<T>where
T: Send,
impl<T> Sync for Dfa<T>where
T: Sync,
impl<T> Unpin for Dfa<T>where
T: Unpin,
impl<T> UnwindSafe for Dfa<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<S> BuildFrom<S> for S
impl<S> BuildFrom<S> for S
Source§fn build_from(source: S) -> S
fn build_from(source: S) -> S
Converts to this type from the input type.
Source§impl<S, T> BuildInto<T> for Swhere
T: BuildFrom<S>,
impl<S, T> BuildInto<T> for Swhere
T: BuildFrom<S>,
Source§fn build_into(self) -> T
fn build_into(self) -> T
Calls T::from(self) to convert a [S] into a [T].
Source§impl<S, T> TryBuildFrom<S> for Twhere
S: LogReader<Item = BufLog> + HasBuildErrorSource,
T: LogReader<Item = BufLog> + BuildFrom<S> + HasBuildErrorSource,
impl<S, T> TryBuildFrom<S> for Twhere
S: LogReader<Item = BufLog> + HasBuildErrorSource,
T: LogReader<Item = BufLog> + BuildFrom<S> + HasBuildErrorSource,
Source§type Error = BuildError
type Error = BuildError
The type returned in the event of a conversion error.
Source§fn try_build_from(source: S) -> Result<T, <T as TryBuildFrom<S>>::Error>
fn try_build_from(source: S) -> Result<T, <T as TryBuildFrom<S>>::Error>
Performs the conversion.
Source§impl<S, T> TryBuildInto<T> for Swhere
T: TryBuildFrom<S>,
impl<S, T> TryBuildInto<T> for Swhere
T: TryBuildFrom<S>,
Source§type Error = <T as TryBuildFrom<S>>::Error
type Error = <T as TryBuildFrom<S>>::Error
The type returned in the event of a conversion error.
Source§fn try_build_into(self) -> Result<T, <T as TryBuildFrom<S>>::Error>
fn try_build_into(self) -> Result<T, <T as TryBuildFrom<S>>::Error>
Performs the conversion.