Class: ScopeFunctionDeclaration
compiler.ScopeFunctionDeclaration
Represents the definition of a function inside a Scope.
Since
0.1.2
Hierarchy
-
↳
ScopeFunctionDeclaration
Table of contents
Constructors
Properties
Accessors
- hasValue
- identifier
- isCallable
- isDefined
- node
- params
- programCtx
- returnType
- semanticData
- type
- typeData
Constructors
constructor
• new ScopeFunctionDeclaration(node)
Parameters
| Name | Type |
|---|---|
node |
FunctionDeclaration |
Overrides
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts:21
Properties
_node
• Private Readonly _node: FunctionDeclaration
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts:19
Accessors
hasValue
• get hasValue(): boolean
Returns whether the function declaration has a value.
Since
0.10.0
Returns
boolean
Overrides
ScopeDeclaration.hasValue
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts:96
identifier
• get identifier(): string
The identifier of this function.
Returns
string
Overrides
ScopeDeclaration.identifier
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts:54
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-function-declaration.ts:104
isDefined
• get isDefined(): boolean
Returns whether the function declaration is defined and has a function body set during declaration.
Since
0.3.0
Returns
boolean
Overrides
ScopeDeclaration.isDefined
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts:88
node
• get node(): FunctionDeclaration
Returns the AST node this scope function declaration bases on.
Returns
Overrides
ScopeDeclaration.node
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts:47
params
• get params(): ParameterDeclaration[]
The parameters that are accepted inside this function. These are represented using the ParameterDeclaration class.
The index in the array represents the position inside the function. Meaning the first item in the array maps to the first parameter inside the function.
Returns
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts:80
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
returnType
• get returnType(): CheckedType
The return type of this function. This can be every KipperType except KipperFuncType.
Returns
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts:69
semanticData
• Private get semanticData(): FunctionDeclarationSemantics
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-function-declaration.ts:31
type
• get type(): CheckedType
The type of this function. This is always "func".
Since
0.10.0
Returns
Overrides
ScopeDeclaration.type
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts:62
typeData
• Private get typeData(): FunctionDeclarationTypeSemantics
The type data of this declaration.
Throws
UndefinedSemanticsError If this is accessed, before type checking was performed.
Returns
FunctionDeclarationTypeSemantics
Defined in
kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts:40