LexerGen

Struct LexerGen 

Source
pub struct LexerGen {
    pub max_utf8_chars: u32,
    pub nbr_groups: u32,
    pub initial_state: StateId,
    pub first_end_state: StateId,
    pub nbr_states: StateId,
    pub ascii_to_group: Vec<GroupId>,
    pub utf8_to_group: HashMap<char, GroupId>,
    pub seg_to_group: SegMap<GroupId>,
    pub state_table: Vec<StateId>,
    pub terminal_table: Vec<Terminal>,
    pub symbol_table: Option<SymbolTable>,
    /* private fields */
}

Fields§

§max_utf8_chars: u32§nbr_groups: u32§initial_state: StateId§first_end_state: StateId§nbr_states: StateId§ascii_to_group: Vec<GroupId>§utf8_to_group: HashMap<char, GroupId>§seg_to_group: SegMap<GroupId>§state_table: Vec<StateId>§terminal_table: Vec<Terminal>§symbol_table: Option<SymbolTable>

Implementations§

Source§

impl LexerGen

Source

pub const DEFAULT_UTF8_TABLE_SIZE: u32 = 128u32

Source

pub fn add_header<T: Into<String>>(&mut self, header: T)

Source

pub fn extend_headers<I: IntoIterator<Item = T>, T: Into<String>>( &mut self, headers: I, )

Source

pub fn use_full_lib(&mut self, use_full_lib: bool)

Source

pub fn set_crate(&mut self, lcrate: LexigramCrate)

Source

pub fn build_from_dfa(dfa: Dfa<Normalized>, max_utf8_chars: u32) -> Self

Source

pub fn write_source_code( &self, file: Option<File>, indent: usize, ) -> Result<(), Error>

Source

pub fn gen_source_code(&self, indent: usize) -> String

Source

pub fn try_gen_source_code( self, indent: usize, ) -> Result<(BufLog, String), BuildError>

Trait Implementations§

Source§

impl BuildFrom<Dfa<Normalized>> for LexerGen

Source§

fn build_from(dfa: Dfa<Normalized>) -> Self

Converts to this type from the input type.
Source§

impl BuildFrom<LexerGen> for LexerTables

Source§

fn build_from(lexer_gen: LexerGen) -> LexerTables

Converts to this type from the input type.
Source§

impl HasBuildErrorSource for LexerGen

Source§

impl LogReader for LexerGen

Source§

type Item = BufLog

Source§

fn get_log(&self) -> &Self::Item

Source§

fn give_log(self) -> Self::Item

Source§

impl TryBuildFrom<LexerGen> for LexerTables

Source§

type Error = BuildError

The type returned in the event of a conversion error.
Source§

fn try_build_from(source: LexerGen) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<S> BuildFrom<S> for S

Source§

fn build_from(source: S) -> S

Converts to this type from the input type.
Source§

impl<S, T> BuildInto<T> for S
where T: BuildFrom<S>,

Source§

fn build_into(self) -> T

Calls T::from(self) to convert a [S] into a [T].

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<S, T> TryBuildFrom<S> for T

Source§

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>

Performs the conversion.
Source§

impl<S, T> TryBuildInto<T> for S
where T: TryBuildFrom<S>,

Source§

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>

Performs the conversion.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.