Struct rustemo::GlrParser

source ·
pub struct GlrParser<'i, S: State, L: Lexer<'i, GssHead<'i, I, S, TK>, S, TK, Input = I>, P, TK: Default, NTK, D: ParserDefinition<S, P, TK, NTK> + 'static, I: Input + ?Sized, B> { /* private fields */ }
Expand description

An implementation of Right-Nulled GLR parsing (RNGLR)

Implementations§

source§

impl<'i, S, L, P, TK, NTK, D, I, B> GlrParser<'i, S, L, P, TK, NTK, D, I, B>
where I: Input + ?Sized + Debug, L: Lexer<'i, GssHead<'i, I, S, TK>, S, TK, Input = I>, S: State + Ord + Debug, D: ParserDefinition<S, P, TK, NTK>, TK: Copy + Default + PartialEq + Ord + Debug + 'i, P: Copy + Debug + Into<NTK> + PartialEq,

source

pub fn new( definition: &'static D, partial_parse: bool, has_layout: bool, lexer: L ) -> Self

Trait Implementations§

source§

impl<'i, I, S, TK, NTK, L, P, D, B> Parser<'i, I, GssHead<'i, I, S, TK>, S, TK> for GlrParser<'i, S, L, P, TK, NTK, D, I, B>
where I: Input + ?Sized + Debug, L: Lexer<'i, GssHead<'i, I, S, TK>, S, TK, Input = I>, S: State + Debug + Ord, P: Copy + Debug + Into<NTK> + PartialEq, TK: Copy + Debug + Ord + Default + 'i, D: ParserDefinition<S, P, TK, NTK>,

§

type Output = Forest<'i, I, P, TK>

source§

fn parse(&self, input: &'i I) -> Result<Self::Output>

Parse the given input and produce the result. The output type is set by the parser implementers and it is usually defined by the builder if the building is done during the parse process.
source§

fn parse_with_context( &self, context: &mut GssHead<'i, I, S, TK>, input: &'i I ) -> Result<Self::Output>

Parse with the given context which has information about the current parsing state (e.g. position, location). Used in situation when we need to continue parsing from a specific state, like in parsing the layout from the current location.
source§

fn parse_file<'a, F: AsRef<Path>>(&'a mut self, file: F) -> Result<Self::Output>
where 'a: 'i,

A convenience method for loading the content from the given file and calling parse. The parser will own the content being parsed and thus has to outlive Self::Output if it borrows from the content loaded from the file.

Auto Trait Implementations§

§

impl<'i, S, L, P, TK, NTK, D, I, B> !RefUnwindSafe for GlrParser<'i, S, L, P, TK, NTK, D, I, B>

§

impl<'i, S, L, P, TK, NTK, D, I, B> !Send for GlrParser<'i, S, L, P, TK, NTK, D, I, B>

§

impl<'i, S, L, P, TK, NTK, D, I, B> !Sync for GlrParser<'i, S, L, P, TK, NTK, D, I, B>

§

impl<'i, S, L, P, TK, NTK, D, I: ?Sized, B> Unpin for GlrParser<'i, S, L, P, TK, NTK, D, I, B>
where B: Unpin, I: Unpin, NTK: Unpin, P: Unpin, S: Unpin, <I as ToOwned>::Owned: Unpin,

§

impl<'i, S, L, P, TK, NTK, D, I: ?Sized, B> UnwindSafe for GlrParser<'i, S, L, P, TK, NTK, D, I, B>

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.