slang::ast::RandSequenceStatement::ProdBase struct

The base class for productions in a rule.

Derived classes

struct CaseProd
A production that chooses an item with a case statement.
struct CodeBlockProd
A block of procedural code that runs as part of a rule.
struct IfElseProd
A production that chooses between items based on a condition.
struct ProdItem
A production item, which invokes another production.
struct RepeatProd
A production that repeats an item a number of times.

Public functions

template<typename T>
T& as()
Casts this production to the given concrete derived type.
template<typename T>
const T& as() const
Casts this production to the given concrete derived type.
template<typename T>
T* as_if()
Tries to cast this production to the given concrete derived type.
template<typename T>
const T* as_if() const
Tries to cast this production to the given concrete derived type.
template<typename TVisitor, typename... Args>
decltype(auto) visit(TVisitor& visitor, Args && ... args) const
Visits this production's concrete derived type via the provided visitor.

Public variables

ProdKind kind
The kind of production.

Function documentation

template<typename T>
T& slang::ast::RandSequenceStatement::ProdBase::as()

Casts this production to the given concrete derived type.

Asserts that the kind matches.

template<typename T>
const T& slang::ast::RandSequenceStatement::ProdBase::as() const

Casts this production to the given concrete derived type.

Asserts that the kind matches.

template<typename T>
T* slang::ast::RandSequenceStatement::ProdBase::as_if()

Tries to cast this production to the given concrete derived type.

Returns nullptr if the kind doesn't match.

template<typename T>
const T* slang::ast::RandSequenceStatement::ProdBase::as_if() const

Tries to cast this production to the given concrete derived type.

Returns nullptr if the kind doesn't match.