Class: ScopeVariableDeclaration
compiler.ScopeVariableDeclaration
Represents a variable scope entry that may be a child of the global scope or local scope.
Since
0.1.0
Hierarchy
-
↳
ScopeVariableDeclaration
Table of contents
Constructors
Properties
Accessors
- hasValue
- identifier
- isCallable
- isDefined
- node
- programCtx
- scope
- semanticData
- storageType
- type
- typeData
Constructors
constructor
• new ScopeVariableDeclaration(node
)
Parameters
Name | Type |
---|---|
node |
VariableDeclaration |
Overrides
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts:24
Properties
_node
• Private
Readonly
_node: VariableDeclaration
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts:16
valueWasUpdated
• valueWasUpdated: boolean
= false
Returns whether the variable has been updated after its initial declaration.
Since
0.10.0
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts:22
Accessors
hasValue
• get
hasValue(): boolean
Returns whether the variable declaration has a value.
This is different from isDefined, since this also considers variable assignments after the initial declaration.
Since
0.10.0
Returns
boolean
Overrides
ScopeDeclaration.hasValue
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts:96
identifier
• get
identifier(): string
The identifier of this variable.
Returns
string
Overrides
ScopeDeclaration.identifier
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts:57
isCallable
• get
isCallable(): boolean
Returns whether the declaration has a callable value (function).
Since
0.10.0
Returns
boolean
Overrides
ScopeDeclaration.isCallable
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts:104
isDefined
• get
isDefined(): boolean
Returns whether the variable declaration is defined and has a value set during declaration.
Returns
boolean
Overrides
ScopeDeclaration.isDefined
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts:85
node
• get
node(): VariableDeclaration
Returns the AST node this scope declaration bases on.
Returns
Overrides
ScopeDeclaration.node
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts:50
programCtx
• get
programCtx(): KipperProgramContext
Fetches the program context instance for this token.
Returns
Inherited from
ScopeDeclaration.programCtx
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-declaration.ts:25
scope
• get
scope(): Scope
Returns the scope associated with this ScopeDeclaration.
Returns
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts:78
semanticData
• Private
get
semanticData(): VariableDeclarationSemantics
The semantic data of this declaration.
Throws
UndefinedSemanticsError If this is accessed, before semantic analysis was performed.
Returns
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts:34
storageType
• get
storageType(): KipperStorageType
The storage type of this variable.
Returns
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts:71
type
• get
type(): CheckedType
The value type of this variable.
Returns
Overrides
ScopeDeclaration.type
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts:64
typeData
• Private
get
typeData(): VariableDeclarationTypeSemantics
The type data of this declaration.
Throws
UndefinedSemanticsError If this is accessed, before type checking was performed.
Returns
VariableDeclarationTypeSemantics
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts:43