Struct rustemo::LRContext

source ·
pub struct LRContext<'i, I: Input + ?Sized, S, TK> { /* private fields */ }
Expand description

Context implementation for LR parsing

Implementations§

source§

impl<'i, I: Input + ?Sized, S: Default, TK> LRContext<'i, I, S, TK>

source

pub fn new(position: usize) -> Self

Trait Implementations§

source§

impl<'i, I, S, TK> Context<'i, I, S, TK> for LRContext<'i, I, S, TK>
where I: Input + ?Sized, S: State,

source§

fn state(&self) -> S

The current parser state.
source§

fn set_state(&mut self, state: S)

source§

fn position(&self) -> usize

An absolute position in the input sequence Read more
source§

fn set_position(&mut self, position: usize)

source§

fn location(&self) -> Location

A span in the input sequence, possibly in line-column style.
source§

fn set_location(&mut self, location: Location)

source§

fn range(&self) -> Range<usize>

A span in the input sequence
source§

fn set_range(&mut self, range: Range<usize>)

source§

fn token_ahead(&self) -> Option<&Token<'i, I, TK>>

Next token recognized in the input at the current parsing location
source§

fn set_token_ahead(&mut self, token: Token<'i, I, TK>)

source§

fn layout_ahead(&self) -> Option<&'i I>

A layout before the token ahead
source§

fn set_layout_ahead(&mut self, layout: Option<&'i I>)

source§

impl<'i, I: Debug + Input + ?Sized, S: Debug, TK: Debug> Debug for LRContext<'i, I, S, TK>

source§

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

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

impl<'i, I: Input + ?Sized, S: Default, TK> Default for LRContext<'i, I, S, TK>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'i, I: ?Sized, S, TK> RefUnwindSafe for LRContext<'i, I, S, TK>

§

impl<'i, I: ?Sized, S, TK> Send for LRContext<'i, I, S, TK>
where I: Sync, S: Send, TK: Send,

§

impl<'i, I: ?Sized, S, TK> Sync for LRContext<'i, I, S, TK>
where I: Sync, S: Sync, TK: Sync,

§

impl<'i, I: ?Sized, S, TK> Unpin for LRContext<'i, I, S, TK>
where S: Unpin, TK: Unpin,

§

impl<'i, I: ?Sized, S, TK> UnwindSafe for LRContext<'i, I, S, TK>

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