[][src]Struct gramatica::Parser

pub struct Parser<'a, T, Tables: ParsingTablesTrait<T>> {
    pub sets: Vec<StateSet<T>>,
    pub source: &'a str,
    pub source_index: usize,
    pub tokens: Vec<T>,
    pub tokens_range: Vec<(usize, usize)>,
    pub regex_map: HashMap<String, Regex>,
    pub phantom: PhantomData<Tables>,
}

Fields

sets: Vec<StateSet<T>>source: &'a strsource_index: usizetokens: Vec<T>tokens_range: Vec<(usize, usize)>regex_map: HashMap<String, Regex>phantom: PhantomData<Tables>

Implementations

impl<'a, T: Default + PartialEq + Clone + Debug, Tables: ParsingTablesTrait<T>> Parser<'a, T, Tables>[src]

pub fn parse(source: &str, initial: Option<usize>) -> Result<T, ParsingError>[src]

pub fn re(&mut self, regex: &'a str, source: &str) -> Option<(usize, String)>[src]

pub fn keyword(&mut self, key: &str, source: &str) -> Option<(usize, String)>[src]

pub fn tokenize(&mut self)[src]

pub fn earley(&mut self) -> Result<T, ParsingError>[src]

pub fn compute_value(&mut self, set_index: usize, state_index: usize)[src]

Auto Trait Implementations

impl<'a, T, Tables> !RefUnwindSafe for Parser<'a, T, Tables>

impl<'a, T, Tables> Send for Parser<'a, T, Tables> where
    T: Send,
    Tables: Send

impl<'a, T, Tables> Sync for Parser<'a, T, Tables> where
    T: Sync,
    Tables: Sync

impl<'a, T, Tables> Unpin for Parser<'a, T, Tables> where
    T: Unpin,
    Tables: Unpin

impl<'a, T, Tables> UnwindSafe for Parser<'a, T, Tables> where
    T: UnwindSafe,
    Tables: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.