[−][src]Trait moore_svlog::ast::AnyNode
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.
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> + 'a)>
[src]
Get this node's parent.
pub fn link(
&'a self,
parent: Option<&'a (dyn AnyNode<'a> + 'a)>,
order: &mut usize
)
[src]
&'a self,
parent: Option<&'a (dyn AnyNode<'a> + 'a)>,
order: &mut usize
)
Link up this node.
pub fn link_attach(&'a self, parent: &'a (dyn AnyNode<'a> + 'a), order: usize)
[src]
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.
Trait Implementations
impl<'a> Eq for &'a (dyn AnyNode<'a> + 'a)
[src]
impl<'a> Hash for &'a (dyn AnyNode<'a> + 'a)
[src]
pub fn hash<H>(&self, h: &mut H) where
H: Hasher,
[src]
H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a> PartialEq<&'a (dyn AnyNode<'a> + 'a)> for &'a (dyn AnyNode<'a> + 'a)
[src]
Implementors
impl<'a> AnyNode<'a> for TypeOrExpr<'a>
[src]
pub fn id(&self) -> NodeId
[src]
pub fn span(&self) -> Span
[src]
pub fn human_span(&self) -> Span
[src]
pub fn order(&self) -> usize
[src]
pub fn get_parent(&self) -> Option<&'a (dyn AnyNode<'a> + 'a)>
[src]
pub fn link(
&'a self,
parent: Option<&'a (dyn AnyNode<'a> + 'a)>,
order: &mut usize
)
[src]
&'a self,
parent: Option<&'a (dyn AnyNode<'a> + 'a)>,
order: &mut usize
)
pub fn link_attach(&'a self, parent: &'a (dyn AnyNode<'a> + 'a), order: usize)
[src]
impl<'a> AnyNode<'a> for DefNode<'a>
[src]
impl<'a, T> AnyNode<'a> for Node<'a, T> where
T: Debug + ForEachChild<'a> + Send + Sync,
Node<'a, T>: BasicNode<'a>,
Node<'a, T>: Display,
Node<'a, T>: AnyNodeData,
[src]
T: Debug + ForEachChild<'a> + Send + Sync,
Node<'a, T>: BasicNode<'a>,
Node<'a, T>: Display,
Node<'a, T>: AnyNodeData,
Automatically implement AnyNode
for Node<T>
if enough information is
present.
pub fn id(&self) -> NodeId
[src]
pub fn span(&self) -> Span
[src]
pub fn order(&self) -> usize
[src]
pub fn get_parent(&self) -> Option<&'a (dyn AnyNode<'a> + 'a)>
[src]
pub fn link(
&'a self,
parent: Option<&'a (dyn AnyNode<'a> + 'a)>,
order: &mut usize
)
[src]
&'a self,
parent: Option<&'a (dyn AnyNode<'a> + 'a)>,
order: &mut usize
)