Class: ScopeTypeDeclaration
compiler.ScopeTypeDeclaration
Represents the definition of a type such as a class or interface in a scope.
Since
0.11.0
Hierarchy
-
↳
ScopeTypeDeclaration
Table of contents
Constructors
Properties
Accessors
- builtInStructure
- hasValue
- identifier
- isBuiltIn
- isCallable
- isDefined
- node
- programCtx
- scope
- semanticData
- type
- typeValue
Methods
Constructors
constructor
• Protected
new ScopeTypeDeclaration(_declaration?
, _builtInType?
, _universeScope?
)
Parameters
Name | Type |
---|---|
_declaration? |
TypeDeclaration <TypeDeclarationSemantics , TypeDeclarationTypeSemantics > |
_builtInType? |
BuiltInType |
_universeScope? |
UniverseScope |
Overrides
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts:16
Properties
_builtInType
• Protected
Optional
Readonly
_builtInType: BuiltInType
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts:18
_declaration
• Protected
Optional
Readonly
_declaration: TypeDeclaration
<TypeDeclarationSemantics
, TypeDeclarationTypeSemantics
>
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts:17
_universeScope
• Protected
Optional
Readonly
_universeScope: UniverseScope
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts:19
Accessors
builtInStructure
• get
builtInStructure(): undefined
| BuiltInType
Returns the built-in structure of this declaration, if this declaration is based on one.
Since
0.11.0
Returns
undefined
| BuiltInType
Overrides
ScopeDeclaration.builtInStructure
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts:55
hasValue
• get
hasValue(): true
Returns whether the declaration has a value.
As this is a type, it will always be true;
Since
0.11.0
Returns
true
Overrides
ScopeDeclaration.hasValue
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts:122
identifier
• get
identifier(): string
The identifier of this type.
Returns
string
Overrides
ScopeDeclaration.identifier
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts:78
isBuiltIn
• get
isBuiltIn(): boolean
Returns whether this type declaration is a built-in type.
Since
0.11.0
Returns
boolean
Overrides
ScopeDeclaration.isBuiltIn
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts:47
isCallable
• get
isCallable(): false
Returns whether the declaration has a callable value (function).
As this is a type, it will always be false.
Since
0.11.0
Returns
false
Overrides
ScopeDeclaration.isCallable
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts:132
isDefined
• get
isDefined(): true
Returns whether the declaration is defined.
As this is a type, it will always be true;
Since
0.11.0
Returns
true
Overrides
ScopeDeclaration.isDefined
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts:105
node
• get
node(): undefined
| TypeDeclaration
<TypeDeclarationSemantics
, TypeDeclarationTypeSemantics
>
Returns the InterfaceDeclaration or AST node this scope type declaration bases on.
Returns
undefined
| TypeDeclaration
<TypeDeclarationSemantics
, TypeDeclarationTypeSemantics
>
Overrides
ScopeDeclaration.node
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts:71
programCtx
• get
programCtx(): undefined
| KipperProgramContext
Fetches the program context instance for this token.
Returns
undefined
| KipperProgramContext
Inherited from
ScopeDeclaration.programCtx
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-declaration.ts:25
scope
• get
scope(): LocalScope
| ClassScope
| GlobalScope
| UniverseScope
Returns the scope associated with this ScopeDeclaration.
Returns
LocalScope
| ClassScope
| GlobalScope
| UniverseScope
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts:112
semanticData
• Private
get
semanticData(): undefined
| TypeDeclarationSemantics
The semantic data of this declaration.
Throws
UndefinedSemanticsError If this is accessed, before semantic analysis was performed.
Returns
undefined
| TypeDeclarationSemantics
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts:64
type
• get
type(): ProcessedType
The type of this type. This is always "type".
Since
0.11.0
Returns
Overrides
ScopeDeclaration.type
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts:86
typeValue
• get
typeValue(): ProcessedType
| CustomType
The value of this type, which is the type itself i.e. what value does this type represent.
Throws
If this is accessed, before the type for the declaration finished.
Since
0.11.0
Returns
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts:95
Methods
fromBuiltInType
▸ Static
fromBuiltInType(builtInType
, universeScope
): ScopeTypeDeclaration
Creates a new scope type declaration from a built-in type.
Since
0.11.0
Parameters
Name | Type | Description |
---|---|---|
builtInType |
BuiltInType |
The built-in type. |
universeScope |
UniverseScope |
The universe scope this type is associated with. |
Returns
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts:39
fromTypeDeclaration
▸ Static
fromTypeDeclaration(node
): ScopeTypeDeclaration
Creates a new scope type declaration from a type declaration.
Since
0.11.0
Parameters
Name | Type | Description |
---|---|---|
node |
TypeDeclaration <TypeDeclarationSemantics , TypeDeclarationTypeSemantics > |
The type declaration node. |
Returns
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts:29