Class: ScopeParameterDeclaration
compiler.ScopeParameterDeclaration
Represents the definition of a parameter inside a function.
Since
0.10.0
Hierarchy
-
↳
ScopeParameterDeclaration
Table of contents
Constructors
Properties
Accessors
- builtInStructure
- func
- hasValue
- identifier
- isBuiltIn
- isCallable
- isDefined
- node
- programCtx
- scope
- semanticData
- type
- typeData
Methods
Constructors
constructor
• Private
new ScopeParameterDeclaration(node
)
Parameters
Name | Type |
---|---|
node |
ParameterDeclaration |
Overrides
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts:25
Properties
_node
• Private
Readonly
_node: ParameterDeclaration
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts:23
Accessors
builtInStructure
• get
builtInStructure(): undefined
Returns the built-in structure of this declaration, if this declaration is based on one.
This will always be undefined, since a parameter declaration is never a built-in declaration.
Since
0.11.0
Returns
undefined
Overrides
ScopeDeclaration.builtInStructure
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts:54
func
• get
func(): FunctionDeclaration
| LambdaPrimaryExpression
| ClassMethodDeclaration
| ClassConstructorDeclaration
Returns the function this parameter is defined in.
Since
0.10.0
Returns
FunctionDeclaration
| LambdaPrimaryExpression
| ClassMethodDeclaration
| ClassConstructorDeclaration
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts:114
hasValue
• get
hasValue(): boolean
Returns whether the parameter declaration has a value.
This is always true, since a parameter declaration always has a value, even if it is not set or is set to 'undefined'.
Since
0.10.0
Returns
boolean
Overrides
ScopeDeclaration.hasValue
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts:140
identifier
• get
identifier(): string
The identifier of this parameter.
Since
0.10.0
Returns
string
Overrides
ScopeDeclaration.identifier
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts:90
isBuiltIn
• get
isBuiltIn(): false
Returns whether this parameter declaration is a built-in declaration.
This will always be false, since a parameter declaration is never a built-in declaration.
Since
0.11.0
Returns
false
Overrides
ScopeDeclaration.isBuiltIn
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts:44
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/semantics/symbol-table/entry/scope-parameter-declaration.ts:148
isDefined
• get
isDefined(): boolean
Returns whether the parameter declaration is defined and has a value set during declaration.
This will always be true, since a parameter declaration always has a value, even if it is not set or is set to 'undefined'.
Since
0.10.0
Returns
boolean
Overrides
ScopeDeclaration.isDefined
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts:129
node
• get
node(): ParameterDeclaration
Returns the AST node this scope parameter declaration bases on.
Since
0.10.0
Returns
Overrides
ScopeDeclaration.node
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts:82
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(): FunctionScope
Returns the scope associated with this ScopeDeclaration.
Since
0.10.0
Returns
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts:106
semanticData
• Private
get
semanticData(): ParameterDeclarationSemantics
The semantic data of this declaration.
Throws
UndefinedSemanticsError If this is accessed, before semantic analysis was performed.
Since
0.10.0
Returns
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts:64
type
• get
type(): ProcessedType
The type of this parameter.
Since
0.10.0
Returns
Overrides
ScopeDeclaration.type
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts:98
typeData
• Private
get
typeData(): ParameterDeclarationTypeSemantics
The type data of this declaration.
Throws
UndefinedSemanticsError If this is accessed, before type checking was performed.
Since
0.10.0
Returns
ParameterDeclarationTypeSemantics
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts:74
Methods
fromParameterDeclaration
▸ Static
fromParameterDeclaration(node
): ScopeParameterDeclaration
Creates a new scope parameter declaration from a parameter declaration.
Parameters
Name | Type | Description |
---|---|---|
node |
ParameterDeclaration |
The parameter declaration node. |
Returns
Defined in
kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts:34