slang::ParserMetadata struct

Various bits of metadata collected during parsing.

Public types

struct Node
Collection of metadata that can be associated with a syntax node at parse time.

Public variables

flat_hash_map<const SyntaxNode*, Node> nodeMap
flat_hash_set<string_view> globalInstances
std::vector<const IdentifierNameSyntax*> classPackageNames
std::vector<const PackageImportDeclarationSyntax*> packageImports
A list of all package import declarations parsed.
std::vector<const DefParamSyntax*> defparams
A list of all defparams parsed.
std::vector<const ClassDeclarationSyntax*> classDecls
A list of all class declarations parsed.
std::vector<const BindDirectiveSyntax*> bindDirectives
A list of all bind directives parsed.
Token eofToken

Variable documentation

flat_hash_map<const SyntaxNode*, Node> slang::ParserMetadata::nodeMap

Specific metadata that was in effect when certain syntax nodes were parsed (such as various bits of preprocessor state).

flat_hash_set<string_view> slang::ParserMetadata::globalInstances

A set of names of all instantiations of global modules/interfaces/programs. This can be used to determine which modules should be considered as top-level roots of the design.

std::vector<const IdentifierNameSyntax*> slang::ParserMetadata::classPackageNames

A list of all names parsed that could represent a package or class name, since they are simple names that appear on the left-hand side of a double colon.

Token slang::ParserMetadata::eofToken

The EOF token, if one has already been consumed by the parser. Otherwise an empty token.