slang::Statement::StatementContext struct

Additional information passed along during statement binding.


Public functions

auto tryGetBlock(Compilation& compilation, const SyntaxNode& syntax) -> BlockStatement*
auto enterLoop() -> auto

Public variables

span<const StatementBlockSymbol*const > blocks
bitmask<StatementFlags> flags
Tracks various bits of context about where we are in statement binding.

Function documentation

BlockStatement* slang::Statement::StatementContext::tryGetBlock(Compilation& compilation, const SyntaxNode& syntax)

Attempts to match up the head of the block list with the given statement syntax node. If they match, the block symbol is popped and returned wrapped inside a BlockStatement. Otherwise nullptr is returned.

auto slang::Statement::StatementContext::enterLoop()

Records that we've entered a loop, and returns a guard that will revert back to the previous state on destruction.

Variable documentation

span<const StatementBlockSymbol*const > slang::Statement::StatementContext::blocks

A series of block symbols that are expected to be bound, in order, during the creation of the statement tree. Each statement created can pop blocks off the beginning of this list.