use crate::atn::ATN;
use crate::tree::{NodeKindType, TreeNode};
use crate::vocabulary::Vocabulary;
pub trait Recognizer<'input, 'arena>
where
'input: 'arena,
{
type Node: NodeKindType<'arena>;
fn sempred(
&mut self,
_localctx: Option<&'arena TreeNode<'input, 'arena, Self::Node>>,
_rule_index: i32,
_action_index: i32,
) -> bool
where
Self: Sized,
{
true
}
fn action(
&mut self,
_localctx: Option<&'arena TreeNode<'input, 'arena, Self::Node>>,
_rule_index: i32,
_action_index: i32,
) where
Self: Sized,
{
}
fn get_rule_names(&self) -> &[&str] {
&[]
}
fn get_vocabulary(&self) -> &dyn Vocabulary {
unimplemented!()
}
fn get_grammar_file_name(&self) -> &str {
""
}
fn get_atn(&self) -> &ATN {
unimplemented!()
}
}
pub trait Actions<'input, 'arena, P>
where
'input: 'arena,
P: Recognizer<'input, 'arena>,
{
fn sempred(
_localctx: Option<&'arena TreeNode<'input, 'arena, P::Node>>,
_rule_index: i32,
_action_index: i32,
_recog: &mut P,
) -> bool {
true
}
fn action(
_localctx: Option<&'arena TreeNode<'input, 'arena, P::Node>>,
_rule_index: i32,
_action_index: i32,
_recog: &mut P,
) {
}
fn get_rule_names(&self) -> &[&str] {
&[]
}
fn get_vocabulary(&self) -> &dyn Vocabulary {
unimplemented!()
}
fn get_grammar_file_name(&self) -> &str {
""
}
fn get_atn(&self) -> &ATN {
unimplemented!()
}
}