AstNode

Trait AstNode 

Source
pub trait AstNode<M: AstInfo>: FromPairs<M> {
    // Required methods
    fn ast_info(&self) -> &M;
    fn sort(&self) -> &'static str;
    fn constructor(&self) -> &'static str;

    // Provided methods
    fn as_str<'a>(&'a self) -> &'a str
       where M: SpannedAstInfo + 'a { ... }
    fn traverse<F>(&self, _f: F)
       where Self: Sized,
             F: FnMut(&dyn AstNode<M>) { ... }
}

Required Methods§

Source

fn ast_info(&self) -> &M

Source

fn sort(&self) -> &'static str

Source

fn constructor(&self) -> &'static str

Provided Methods§

Source

fn as_str<'a>(&'a self) -> &'a str
where M: SpannedAstInfo + 'a,

Source

fn traverse<F>(&self, _f: F)
where Self: Sized, F: FnMut(&dyn AstNode<M>),

Implementations on Foreign Types§

Source§

impl<M: AstInfo, T> AstNode<M> for Box<T>
where T: AstNode<M>,

Source§

fn ast_info(&self) -> &M

Source§

fn sort(&self) -> &'static str

Source§

fn constructor(&self) -> &'static str

Implementors§