[][src]Trait antlr_rust::recognizer::Recognizer

pub trait Recognizer<'input>: TokenAware<'input> {
    type Node: ParserNodeType<'input, TF = Self::TF>;
    fn sempred(
        &mut self,
        localctx: Option<&<Self::Node as ParserNodeType<'input>>::Type>,
        rule_index: isize,
        action_index: isize
    ) -> bool
    where
        Self: Sized
, { ... }
fn action(
        &mut self,
        localctx: Option<&<Self::Node as ParserNodeType<'input>>::Type>,
        rule_index: isize,
        action_index: isize
    )
    where
        Self: Sized
, { ... }
fn get_rule_names(&self) -> &[&str] { ... }
fn get_vocabulary(&self) -> &dyn Vocabulary { ... }
fn get_grammar_file_name(&self) -> &str { ... }
fn get_atn(&self) -> &ATN { ... } }

! Usually generated by ANTLR !

Associated Types

type Node: ParserNodeType<'input, TF = Self::TF>

Loading content...

Provided methods

fn sempred(
    &mut self,
    localctx: Option<&<Self::Node as ParserNodeType<'input>>::Type>,
    rule_index: isize,
    action_index: isize
) -> bool where
    Self: Sized

fn action(
    &mut self,
    localctx: Option<&<Self::Node as ParserNodeType<'input>>::Type>,
    rule_index: isize,
    action_index: isize
) where
    Self: Sized

fn get_rule_names(&self) -> &[&str]

Returns array of rule names. Used for debugging and error reporting

fn get_vocabulary(&self) -> &dyn Vocabulary

fn get_grammar_file_name(&self) -> &str

Name of the file this recognizer was generated from

fn get_atn(&self) -> &ATN

Loading content...

Implementors

impl<'input, Ext, I, Ctx, T: ?Sized> Recognizer<'input> for BaseParser<'input, Ext, I, Ctx, T> where
    Ext: ParserRecog<'input, Self> + 'static,
    I: TokenStream<'input>,
    Ctx: ParserNodeType<'input, TF = I::TF>,
    T: ParseTreeListener<'input, Ctx>, 
[src]

type Node = Ctx

impl<'input, T, Input, TF> Recognizer<'input> for BaseLexer<'input, T, Input, TF> where
    T: LexerRecog<'input, Self> + 'static,
    Input: CharStream<TF::From>,
    TF: TokenFactory<'input>, 
[src]

type Node = EmptyContextType<'input, TF>

Loading content...