[−][src]Struct lrpar::parser::Parser
Methods
impl<'a, StorageT: 'static + Debug + Hash + PrimInt + Unsigned, ActionT: 'static> Parser<'a, StorageT, ActionT> where
usize: AsPrimitive<StorageT>,
u32: AsPrimitive<StorageT>,
[src]
usize: AsPrimitive<StorageT>,
u32: AsPrimitive<StorageT>,
pub fn lr(
&self,
laidx: usize,
pstack: &mut Vec<StIdx>,
astack: &mut Vec<AStackType<ActionT, StorageT>>,
errors: &mut Vec<LexParseError<StorageT>>
) -> Option<ActionT>
[src]
&self,
laidx: usize,
pstack: &mut Vec<StIdx>,
astack: &mut Vec<AStackType<ActionT, StorageT>>,
errors: &mut Vec<LexParseError<StorageT>>
) -> Option<ActionT>
Start parsing text at laidx
(using the lexeme in lexeme_prefix
, if it is not None
,
as the first lexeme) up to (but excluding) end_laidx
(if it's specified). Parsing
continues as long as possible (assuming that any errors encountered can be recovered from)
unless end_laidx
is None
, at which point this function returns as soon as it
encounters an error.
Note that if lexeme_prefix
is specified, laidx
will still be incremented, and thus
end_laidx
must be set to laidx + 1
in order that the parser doesn't skip the real
lexeme at position laidx
.
Return Some(value)
if the parse reached an accept state (i.e. all the input was consumed,
possibly after making repairs) or None
(i.e. some of the input was not consumed, even
after possibly making repairs) otherwise.
pub fn lr_upto(
&self,
lexeme_prefix: Option<Lexeme<StorageT>>,
laidx: usize,
end_laidx: usize,
pstack: &mut Vec<StIdx>,
astack: &mut Option<&mut Vec<AStackType<ActionT, StorageT>>>
) -> usize
[src]
&self,
lexeme_prefix: Option<Lexeme<StorageT>>,
laidx: usize,
end_laidx: usize,
pstack: &mut Vec<StIdx>,
astack: &mut Option<&mut Vec<AStackType<ActionT, StorageT>>>
) -> usize
Parse from laidx
up to (but excluding) end_laidx
mutating pstack
as parsing occurs.
Returns the index of the token it parsed up to (by definition <= end_laidx: can be less if
the input is < end_laidx, or if an error is encountered). Does not do any form of error
recovery.
Auto Trait Implementations
impl<'a, StorageT, ActionT> !Send for Parser<'a, StorageT, ActionT>
impl<'a, StorageT, ActionT> !Sync for Parser<'a, StorageT, ActionT>
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
U: TryFrom<T>,