Module moore_svlog_syntax::resolve [] [src]

This module provides name resolution for ASTs. The targeted approach is as follows:

  1. Perform a first pass where names are collected and scopes are assembled. Scopes shall be collected into a scope map, indexed by the item ID.
  2. Perform a second pass where names are resolved against the ones collected in step 1. This should then allow for proper resolution of imports, hierarchical names, and paths (pkg::name and intf.modport).

Todo

Implement a more efficient way of resolving names. In a first pass, iterate over all globally visible items, and items that are accessible through hierarchical names, and store them in a lookup table. Then perform a second pass where we go through each and every item in the AST and resolve names. In this second pass we keep a stack of local scopes that we use to resolve variable names and other local declarations. Whenever we cannot find something, we resolve to checking the lookup table discussed above. Be wary of the precedence between the lookup table and the individual local scopes.

Structs

Def

Enums

DefId

Functions

resolve

Type Definitions

NameResolution

The result of name resolution: An association between every identifier in the AST and a definition it points to.