slang::ast::ConditionalExpression class

Represents a conditional operator expression.

Base classes

class Expression
The base class for all expressions in SystemVerilog.

Public types

struct Condition
A condition.

Public functions

auto left() const -> const Expression&
auto left() -> Expression&
auto right() const -> const Expression&
auto right() -> Expression&
auto knownSide() const -> const Expression*
If the condition for this expression is a known constant value, this method returns the side of the expression that will be selected (i.e.

Public variables

std::span<const Condition> conditions
The list of conditions controlling the expression.
SourceLocation opLoc
The location of the conditional '?' operator token.

Function documentation

const Expression& slang::ast::ConditionalExpression::left() const

Returns the left-hand side operand

Expression& slang::ast::ConditionalExpression::left()

Returns the left-hand side operand

const Expression& slang::ast::ConditionalExpression::right() const

Returns the right-hand side operand

Expression& slang::ast::ConditionalExpression::right()

Returns the right-hand side operand

const Expression* slang::ast::ConditionalExpression::knownSide() const

If the condition for this expression is a known constant value, this method returns the side of the expression that will be selected (i.e.

the left or right expression). Otherwise returns nullptr.