class
#include <slang/ast/symbols/ValueSymbol.h>
ValueSymbol 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
- Represents an enumerated value / member.
- class ModportPortSymbol
- Represents a single port specifier in a modport declaration.
- class NetSymbol
- Represents a net declaration.
- class ParameterSymbol
- Represents a parameter value.
- class SpecparamSymbol
- Represents a specify parameter.
- 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 syntax::
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 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.