slang::ValueSymbol class

A base class for symbols that represent a value (for example a variable or a parameter). The common functionality is that they all have a type.

Base classes

class Symbol

Derived classes

class EnumValueSymbol
Represents an enumerated value / member.
class NetSymbol
Represents a net declaration.
class ParameterSymbol
Represents a parameter value.
class PortSymbol
class VariableSymbol
Represents a variable declaration.

Public functions

auto getType() const -> const Type&
Gets the type of the value.
void setType(const Type& type)
Sets the type of the value.
auto getDeclaredType() const -> not_null<const DeclaredType*>
Gets access to the symbol's declared type.
void setDeclaredType(const DataTypeSyntax& newType)
Sets the symbol's declared type.
auto getInitializer() const -> const Expression*
Gets the initializer for this value, if it has one.
void setInitializer(const Expression& expr)
Sets the initializer for this value.
void setInitializerSyntax(const ExpressionSyntax& syntax, SourceLocation initLocation)
Sets the expression tree used to initialize this value.
void setFromDeclarator(const DeclaratorSyntax& decl)
Initializes the value's dimension and initializer syntax from the given declarator.