[−][src]Macro open_vaf::resolve_hierarchical
A macro that hides the boiler plate required for name resolution of hieraichal Identifiers using the resolver struct
It is defined in the name_resolution
module but due to limitations of rustdoc can't be shown there in the documentation
If $name
wasn't found or doesn't math any SymbolDeclaration
::$declaration
the appropriate errors are added to $self
.errors and execution continuous after the macro
Arguments
-
$fold
- identifer refering to anFold
instance -
$name
- The Identifier (typeIdent
) that should be resolved
The following three arguments can be repeated as often as necessary (like in a match block)
-
$declaration
An identifier of anSymbolDeclaration
variant which you wish to resolve$name
as -
$id
The identifier under which the ID of the resolved declaration will be available inside the associated `$block -
$block
A block ({
statements}
) which will be executed when$name
is resolved as aSymbolDeclaration
::$declaration
Examples
The following tries to resolve ident as a Nature
use OpenVAF::symbol_table::SymbolDeclaration::Net; use OpenVAF::symbol_table::SymbolDeclaration::Port; resolve_hierarchical!(fold; ident as Net(id) => { print!("Resolved net") } Port(id) => { print!("Resolved port") } ); println!("Not found or not a port/net")