[][src]Trait moore_svlog_syntax::ast::AnyNode

pub trait AnyNode<'a>: BasicNode<'a> + AnyNodeData + Display + Send + Sync {
    pub fn id(&self) -> NodeId;
pub fn span(&self) -> Span;
pub fn order(&self) -> usize; pub fn human_span(&self) -> Span { ... }
pub fn get_parent(&self) -> Option<&'a dyn AnyNode<'a>> { ... }
pub fn link(
        &'a self,
        parent: Option<&'a dyn AnyNode<'a>>,
        order: &mut usize
    ) { ... }
pub fn link_attach(&'a self, parent: &'a dyn AnyNode<'a>, order: usize) { ... }
pub fn as_ptr(&self) -> *const u8 { ... } }

An AST node.

Required methods

pub fn id(&self) -> NodeId[src]

Get this node's unique ID.

pub fn span(&self) -> Span[src]

Get this node's span in the input.

pub fn order(&self) -> usize[src]

Get this node's lexical order.

Loading content...

Provided methods

pub fn human_span(&self) -> Span[src]

Get a span that is terse and suitable to pinpoint the node for a human.

pub fn get_parent(&self) -> Option<&'a dyn AnyNode<'a>>[src]

Get this node's parent.

Link up this node.

Link up this node as an expansion of another node.

All subnodes inherit the order from their parent. Useful if a node is generated as part of a later expansion/analysis pass, but needs to hook into the AST somewhere.

pub fn as_ptr(&self) -> *const u8[src]

Convert this node reference to a pointer for identity comparisons.

Loading content...

Trait Implementations

impl<'a> Eq for &'a dyn AnyNode<'a>[src]

impl<'a> Hash for &'a dyn AnyNode<'a>[src]

impl<'a> PartialEq<&'a (dyn AnyNode<'a> + 'a)> for &'a dyn AnyNode<'a>[src]

Implementors

impl<'a> AnyNode<'a> for TypeOrExpr<'a>[src]

impl<'a, T> AnyNode<'a> for Node<'a, T> where
    Self: BasicNode<'a> + Display + AnyNodeData,
    T: Debug + ForEachChild<'a> + Send + Sync
[src]

Automatically implement AnyNode for Node<T> if enough information is present.

Loading content...