AnyNodeData

Trait AnyNodeData 

Source
pub trait AnyNodeData {
    // Required method
    fn fmt_indefinite(&self, fmt: &mut Formatter<'_>) -> Result;

    // Provided methods
    fn as_data(&self) -> &dyn AnyNodeData
       where Self: Sized { ... }
    fn get_name(&self) -> Option<Spanned<Name>> { ... }
    fn fmt_definite(&self, fmt: &mut Formatter<'_>) -> Result { ... }
    fn format_indefinite(&self) -> FormatNodeIndefinite<'_>
       where Self: Sized { ... }
    fn format_definite(&self) -> FormatNodeDefinite<'_>
       where Self: Sized { ... }
    fn to_indefinite_string(&self) -> String
       where Self: Sized { ... }
    fn to_definite_string(&self) -> String
       where Self: Sized { ... }
}
Expand description

Common details of an AST node.

Required Methods§

Source

fn fmt_indefinite(&self, fmt: &mut Formatter<'_>) -> Result

Describe this node for diagnostics in indefinite form, e.g. “entity”.

This should not include any node name. Generally, we want to describe the kind of node to the user, for example as in “cannot use at this point in the code”.

Provided Methods§

Source

fn as_data(&self) -> &dyn AnyNodeData
where Self: Sized,

Source

fn get_name(&self) -> Option<Spanned<Name>>

Get this node’s name, or None if it does not have one.

Source

fn fmt_definite(&self, fmt: &mut Formatter<'_>) -> Result

Describe this node for diagnostics in definite form, e.g. “entity ‘top’”.

If the node has a name, this should include it. Generally, we want to provide enough information for the user to pinpoint an exact node in their design.

Source

fn format_indefinite(&self) -> FormatNodeIndefinite<'_>
where Self: Sized,

Describe this node for diagnostics in indefinite form, e.g. “entity”.

Source

fn format_definite(&self) -> FormatNodeDefinite<'_>
where Self: Sized,

Describe this node for diagnostics in definite form, e.g. “entity ‘top’”.

Source

fn to_indefinite_string(&self) -> String
where Self: Sized,

Describe this node for diagnostics in indefinite form, e.g. “entity”.

Source

fn to_definite_string(&self) -> String
where Self: Sized,

Describe this node for diagnostics in definite form, e.g. “entity ‘top’”.

Implementors§

Source§

impl AnyNodeData for ForeachIndexData

Source§

impl AnyNodeData for GenerateCaseData

Source§

impl AnyNodeData for ImportItemData

Source§

impl<'a> AnyNodeData for DataTypeData<'a>

Source§

impl<'a> AnyNodeData for DpiDeclData<'a>

Source§

impl<'a> AnyNodeData for ExprData<'a>

Source§

impl<'a> AnyNodeData for ItemData<'a>

Source§

impl<'a> AnyNodeData for ModportPortData<'a>

Source§

impl<'a> AnyNodeData for PackedDimData<'a>

Source§

impl<'a> AnyNodeData for PathSegmentData<'a>

Source§

impl<'a> AnyNodeData for PatternFieldData<'a>

Source§

impl<'a> AnyNodeData for PortConnData<'a>

Source§

impl<'a> AnyNodeData for PortData<'a>

Source§

impl<'a> AnyNodeData for TypeKindData<'a>

Source§

impl<'a> AnyNodeData for TypeOrExpr<'a>

Source§

impl<'a> AnyNodeData for UnpackedDimData<'a>

Source§

impl<'a> AnyNodeData for VarDimData<'a>

Source§

impl<'a> AnyNodeData for CallArgData<'a>

Source§

impl<'a> AnyNodeData for ClassDeclData<'a>

Source§

impl<'a> AnyNodeData for ContAssignData<'a>

Source§

impl<'a> AnyNodeData for EnumData<'a>

Source§

impl<'a> AnyNodeData for EnumNameData<'a>

Source§

impl<'a> AnyNodeData for GenerateBlockData<'a>

Source§

impl<'a> AnyNodeData for GenerateForData<'a>

Source§

impl<'a> AnyNodeData for GenerateIfData<'a>

Source§

impl<'a> AnyNodeData for GenvarDeclData<'a>

Source§

impl<'a> AnyNodeData for ImplicitDataTypeData<'a>

Source§

impl<'a> AnyNodeData for ImportDeclData<'a>

Source§

impl<'a> AnyNodeData for InstData<'a>

Source§

impl<'a> AnyNodeData for InstNameData<'a>

Source§

impl<'a> AnyNodeData for InterfaceData<'a>

Source§

impl<'a> AnyNodeData for ModportData<'a>

Source§

impl<'a> AnyNodeData for ModportNameData<'a>

Source§

impl<'a> AnyNodeData for ModportSimplePortData<'a>

Source§

impl<'a> AnyNodeData for ModuleData<'a>

Source§

impl<'a> AnyNodeData for NetDeclData<'a>

Source§

impl<'a> AnyNodeData for PackageData<'a>

Source§

impl<'a> AnyNodeData for ParamDeclData<'a>

Source§

impl<'a> AnyNodeData for ParamTypeDeclData<'a>

Source§

impl<'a> AnyNodeData for ParamValueDeclData<'a>

Source§

impl<'a> AnyNodeData for PortDeclData<'a>

Source§

impl<'a> AnyNodeData for ProcedureData<'a>

Source§

impl<'a> AnyNodeData for RootData<'a>

Source§

impl<'a> AnyNodeData for SourceFileData<'a>

Source§

impl<'a> AnyNodeData for StmtData<'a>

Source§

impl<'a> AnyNodeData for StructData<'a>

Source§

impl<'a> AnyNodeData for StructMemberData<'a>

Source§

impl<'a> AnyNodeData for SubroutineDeclData<'a>

Source§

impl<'a> AnyNodeData for SubroutinePortData<'a>

Source§

impl<'a> AnyNodeData for SubroutinePortDeclData<'a>

Source§

impl<'a> AnyNodeData for SubroutinePrototypeData<'a>

Source§

impl<'a> AnyNodeData for TypeData<'a>

Source§

impl<'a> AnyNodeData for TypedefData<'a>

Source§

impl<'a> AnyNodeData for VarDeclData<'a>

Source§

impl<'a> AnyNodeData for VarDeclNameData<'a>

Source§

impl<'a, T> AnyNodeData for Node<'a, T>
where T: AnyNodeData,

Automatically implement AnyNodeData for Node<T> if the inner node implements it.