slang::ast::LookupLocation class

This type denotes the ordering of symbols within a particular scope, for the purposes of determining whether a found symbol is visible compared to the given location.

For example, variables cannot be referenced before they are declared.

Public static variables

static const LookupLocation max
A special location that should always compare after any other.
static const LookupLocation min
A special location that should always compare before any other.

Public static functions

static auto before(const Symbol& symbol) -> LookupLocation
Places a location just before the given symbol in its parent scope.
static auto after(const Symbol& symbol) -> LookupLocation
Places a location just after the given symbol in its parent scope.

Public functions

auto getScope() const -> const Scope*
Gets the scope of the lookup. Note that this can be null.
auto getIndex() const -> SymbolIndex
Gets the index within the scope for the lookup.
auto operator==(const LookupLocation& other) const -> bool defaulted
Default equality operator.
auto operator<=>(const LookupLocation& other) const -> std::strong_ordering
Default comparison operator.

Function documentation

SymbolIndex slang::ast::LookupLocation::getIndex() const

Gets the index within the scope for the lookup.

This can be a sentinel value for the special max and min lookup locations.