slang::ast::AssertionExpr class

The base class for assertion expressions (sequences and properties).

Derived classes

class AbortAssertionExpr
Represents an abort (accept_on / reject_on) property expression.
class BinaryAssertionExpr
Represents a binary operator in a sequence or property expression.
class CaseAssertionExpr
Represents a case operator in a property expression.
class ClockingAssertionExpr
Represents an assertion expression with attached clocking control.
class ConditionalAssertionExpr
Represents a conditional operator in a property expression.
class DisableIffAssertionExpr
Represents a disable iff condition in a property spec.
class FirstMatchAssertionExpr
Represents a first_match operator in a sequence expression.
class InvalidAssertionExpr
Represents an invalid expression.
class SequenceConcatExpr
Represents an assertion expression defined as a delayed concatenation of other expressions.
class SequenceWithMatchExpr
Represents a sequence expression along with a list of actions to perform upon matching and/or instructions for repetition.
class SimpleAssertionExpr
Represents an assertion expression defined as a simple regular expression.
class StrongWeakAssertionExpr
Represents a strong or weak operator in a property expression.
class UnaryAssertionExpr
Represents a unary operator in a property expression.

Public functions

void requireSequence(const ASTContext& context) const
Reports an error if the assertion expression is not valid in a sequence.
void requireSequence(const ASTContext& context, DiagCode code) const
Reports an error if the assertion expression is not valid in a sequence.
auto bad() const -> bool
Indicates whether the expression is invalid.
auto admitsEmpty() const -> bool
template<typename T>
auto as() -> T&
Casts this expression to the given concrete derived type.
template<typename T>
auto as() const -> const T&
Casts this expression to the given concrete derived type.
template<typename T>
auto as_if() -> T*
Tries to cast this expression to the given concrete derived type.
template<typename T>
auto as_if() const -> const T*
Tries to cast this expression to the given concrete derived type.
template<typename TVisitor, typename... Args>
auto visit(TVisitor& visitor, Args && ... args) const -> decltype(auto)
Visits this expression's concrete derived type via the provided visitor object.

Public variables

AssertionExprKind kind
The kind of expression; indicates the type of derived class.
const syntax::SyntaxNode* syntax
The syntax used to create the expression, if any.

Function documentation

bool slang::ast::AssertionExpr::admitsEmpty() const

Returns true if this is a sequence expression that admits an empty match, and false otherwise.

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

Casts this expression to the given concrete derived type.

Asserts that the type is appropriate given this expression's kind.

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

Casts this expression to the given concrete derived type.

Asserts that the type is appropriate given this expression's kind.

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

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

If the type is not appropriate given this expression's kind, returns nullptr.

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

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

If the type is not appropriate given this expression's kind, returns nullptr.

Variable documentation

const syntax::SyntaxNode* slang::ast::AssertionExpr::syntax

The syntax used to create the expression, if any.

An expression tree can be created manually in which case it may not have a syntax representation.