Struct lrp::lalr::Lalr

source ·
pub struct Lalr<T>
where T: PartialEq + Ord + Clone + Debug,
{ pub table: Tabler<T>, pub raws: Map<State<T>, State<T>>, }

Fields§

§table: Tabler<T>§raws: Map<State<T>, State<T>>

Describes the “raw states” (states without lookahead symbol) in table.kernels, using it raw kernel as key and value being its final kernel

Implementations§

source§

impl<T> Lalr<T>
where T: PartialEq + Ord + Clone + Debug,

source

pub fn proc_closures_first_row(&mut self)

source

pub fn without_look(state: &State<T>) -> State<T>

source

pub fn prop_closure(&self, seed: State<T>) -> State<T>

source

pub fn update_closures( &mut self, main: &State<T>, inc: State<T>, closures: State<T> ) -> Option<State<T>>

source

pub fn update_state( &mut self, main: &State<T>, inc: State<T>, closures: State<T> ) -> Option<State<T>>

Trait Implementations§

source§

impl<T> Clone for Lalr<T>
where T: PartialEq + Ord + Clone + Debug + Clone,

source§

fn clone(&self) -> Lalr<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> Debug for Lalr<T>
where T: PartialEq + Ord + Clone + Debug + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Ord for Lalr<T>
where T: PartialEq + Ord + Clone + Debug + Ord,

source§

fn cmp(&self, other: &Lalr<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<T> Parser<T> for Lalr<T>
where T: PartialEq + Ord + Clone + Debug,

source§

fn new(grammar: Grammar<T>) -> Self
where Self: Sized,

source§

fn with_table(table: Tabler<T>) -> Self

source§

fn uninit(table: Tabler<T>) -> Self

source§

fn tables(&self) -> &Tabler<T>

source§

fn tables_mut(&mut self) -> &mut Tabler<T>

source§

fn final_kernel<'a>(&'a self, kernel: &'a State<T>) -> Option<&'a State<T>>

source§

fn dfa<M, I: Iterator<Item = Token<M, T>>>( &self, buffer: I, maps: ReductMap<M, T> ) -> Dfa<M, T, I>
where M: Clone,

source§

fn simple_dfa<I: IntoIterator<Item = Token<(), T>>>( &self, buffer: I ) -> Dfa<(), T, I::IntoIter>

source§

fn cloned<I: Iterator<Item = Token<T, T>>>(&self) -> ReductMap<T, T>

source§

fn empty<I: Iterator<Item = Token<(), T>>>(&self) -> ReductMap<(), T>

source§

fn parse<M, I: IntoIterator<Item = Token<M, T>>>( &self, buffer: I, maps: ReductMap<M, T> ) -> BaseResult<M, Error<T>>
where M: Clone,

Errors Read more
source§

fn validate<I: IntoIterator<Item = Token<(), T>>>(&self, buffer: I) -> bool

Runs Parser::parse and checks by errors
source§

fn state_from_kernel(&self, kernel: &State<T>) -> Option<usize>

Returns the state’s index generated from that passed kernel
source§

fn merged(states: State<T>) -> State<T>

Merges positions that contains the same body, but different lookaheads. I.e: merged({ [S -> C.C; $], [S -> C.C; c]}) = { [S -> C.C; $ c] } Read more
source§

fn reduce_equals(&mut self)

source§

impl<T> PartialEq for Lalr<T>
where T: PartialEq + Ord + Clone + Debug + PartialEq,

source§

fn eq(&self, other: &Lalr<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialOrd for Lalr<T>
where T: PartialEq + Ord + Clone + Debug + PartialOrd,

source§

fn partial_cmp(&self, other: &Lalr<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T> Eq for Lalr<T>
where T: PartialEq + Ord + Clone + Debug + Eq,

source§

impl<T> StructuralEq for Lalr<T>
where T: PartialEq + Ord + Clone + Debug,

source§

impl<T> StructuralPartialEq for Lalr<T>
where T: PartialEq + Ord + Clone + Debug,

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Lalr<T>
where T: RefUnwindSafe,

§

impl<T> !Send for Lalr<T>

§

impl<T> !Sync for Lalr<T>

§

impl<T> Unpin for Lalr<T>
where T: Unpin,

§

impl<T> UnwindSafe for Lalr<T>

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<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<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.