slang::ast::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
Base class for all symbols (logical code constructs) such as modules, types, functions, variables, etc.

Derived classes

class EnumValueSymbol final
Represents an enumerated value / member.
class ModportPortSymbol final
Represents a single port specifier in a modport declaration.
class NetSymbol final
Represents a net declaration.
class ParameterSymbol final
Represents a parameter value.
class PrimitivePortSymbol final
Represents a primitive port declaration.
class SpecparamSymbol final
Represents a specify parameter.
class VariableSymbol
Represents a variable declaration.

Public functions

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