• Kipper

    v0.12.1
  • Downloads

  • Docs

  • Playground

  • Changelog

  • Kipper

    v0.12.1
    • Downloads

    • Docs

    • Playground

    • Changelog

      • next /
      • Kipper API /
      • Module /
      • @kipper/core /
      • compiler
    Kipper Docs
    • next
    • latest
    • 0.11.0
    • 0.10.4
    • 0.9.2
    • Overview

    • Quickstart

    • Goals for Kipper

    • Supported platforms

    • Usage Examples

      • Overview

    • Variables

      • Overview

      • String Type

      • Number Type

      • Boolean Type

      • Void Type

      • Null Type

      • Undefined Type

      • Array Type

      • Overview

      • Tangled Expression

      • Arithmetic Expression

      • Assignment Expression

      • Conditional Expressions

      • Logical Expressions

      • Bitwise Expression

      • Relational Expressions

      • Convert Or Cast Expression

      • F-String Expression

      • Member Access Expression

      • Function Call Expression

      • Lambda Expression

      • Matches Expression

      • Overview

      • Expression Statement

      • If Statement

      • While Loop

      • Do-While Loop

      • For Loop

      • Compound Statement

      • Jump Statement

    • Functions

    • Interfaces

    • Classes

    • Comments

    • Built-in Functions

      • Overview

      • Compiler Setup

        • Overview

          • index

          • compiler

          • errors

          • logger

          • utils

          • config

          • index

          • index

        • Overview

        • new

        • run

        • compile

        • help

        • version

      • next /
      • Kipper API /
      • Module /
      • @kipper/core /
      • compiler
    • next /
    • Kipper API /
    • Module /
    • @kipper/core /
    • compiler

    Edit page

    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

    • ScopeDeclaration

      ↳ ScopeVariableDeclaration

    Table of contents

    Constructors

    • constructor

    Properties

    • _builtInVariable
    • _declaration
    • _universeScope
    • _valueWasUpdated

    Accessors

    • builtInStructure
    • hasValue
    • identifier
    • isBuiltIn
    • isCallable
    • isDefined
    • node
    • programCtx
    • scope
    • semanticData
    • storageType
    • type
    • typeData
    • valueWasUpdated

    Methods

    • notifyOfUpdate
    • fromBuiltInVariable
    • fromClassPropertyDeclaration
    • fromVariableDeclaration

    Constructors

    constructor

    • Protected new ScopeVariableDeclaration(_declaration?, _builtInVariable?, _universeScope?)

    Parameters

    Name Type
    _declaration? VariableDeclaration | ClassPropertyDeclaration
    _builtInVariable? BuiltInVariable
    _universeScope? UniverseScope

    Overrides

    ScopeDeclaration.constructor

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:26

    Properties

    _builtInVariable

    • Private Optional Readonly _builtInVariable: BuiltInVariable

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:28


    _declaration

    • Private Optional Readonly _declaration: VariableDeclaration | ClassPropertyDeclaration

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:27


    _universeScope

    • Private Optional Readonly _universeScope: UniverseScope

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:29


    _valueWasUpdated

    • Private _valueWasUpdated: boolean = false

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:24

    Accessors

    builtInStructure

    • get builtInStructure(): undefined | BuiltInVariable

    Returns the built-in structure of this declaration, if this declaration is based on one.

    Since

    0.11.0

    Returns

    undefined | BuiltInVariable

    Overrides

    ScopeDeclaration.builtInStructure

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:74


    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/semantics/symbol-table/entry/scope-variable-declaration.ts:163


    identifier

    • get identifier(): string

    The identifier of this variable.

    Returns

    string

    Overrides

    ScopeDeclaration.identifier

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:106


    isBuiltIn

    • get isBuiltIn(): boolean

    Returns whether this variable declaration is a built-in declaration.

    Since

    0.11.0

    Returns

    boolean

    Overrides

    ScopeDeclaration.isBuiltIn

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:66


    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-variable-declaration.ts:171


    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/semantics/symbol-table/entry/scope-variable-declaration.ts:134


    node

    • get node(): undefined | VariableDeclaration | ClassPropertyDeclaration

    Returns the AST node this scope declaration bases on.

    Returns

    undefined | VariableDeclaration | ClassPropertyDeclaration

    Overrides

    ScopeDeclaration.node

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:99


    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-variable-declaration.ts:127


    semanticData

    • Private get semanticData(): undefined | VariableDeclarationSemantics | ClassPropertyDeclarationSemantics

    The semantic data of this declaration.

    Throws

    UndefinedSemanticsError If this is accessed, before semantic analysis was performed.

    Returns

    undefined | VariableDeclarationSemantics | ClassPropertyDeclarationSemantics

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:83


    storageType

    • get storageType(): KipperStorageType

    The storage type of this variable.

    Returns

    KipperStorageType

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:120


    type

    • get type(): ProcessedType

    The value type of this variable.

    Returns

    ProcessedType

    Overrides

    ScopeDeclaration.type

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:113


    typeData

    • Private get typeData(): undefined | VariableDeclarationTypeSemantics | ClassPropertyDeclarationTypeSemantics

    The type data of this declaration.

    Throws

    UndefinedSemanticsError If this is accessed, before type checking was performed.

    Returns

    undefined | VariableDeclarationTypeSemantics | ClassPropertyDeclarationTypeSemantics

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:92


    valueWasUpdated

    • get valueWasUpdated(): boolean

    Returns whether the value of the variable was updated after the initial declaration.

    Since

    0.10.0

    Returns

    boolean

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:142

    Methods

    notifyOfUpdate

    ▸ notifyOfUpdate(): void

    Notifies the declaration that the value was updated.

    Sets the valueWasUpdated property to true.

    Since

    0.11.0

    Returns

    void

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:152


    fromBuiltInVariable

    ▸ Static fromBuiltInVariable(builtInVariable, universeScope): ScopeVariableDeclaration

    Creates a new scope variable declaration from a built-in variable.

    Parameters

    Name Type Description
    builtInVariable BuiltInVariable The built-in variable.
    universeScope UniverseScope The universe scope this variable is associated with.

    Returns

    ScopeVariableDeclaration

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:55


    fromClassPropertyDeclaration

    ▸ Static fromClassPropertyDeclaration(declaration): ScopeVariableDeclaration

    Creates a new scope variable declaration from a given class property declaration.

    Parameters

    Name Type Description
    declaration ClassPropertyDeclaration The class property declaration.

    Returns

    ScopeVariableDeclaration

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:46


    fromVariableDeclaration

    ▸ Static fromVariableDeclaration(declaration): ScopeVariableDeclaration

    Creates a new scope variable declaration from a variable declaration.

    Parameters

    Name Type Description
    declaration VariableDeclaration The variable declaration node.

    Returns

    ScopeVariableDeclaration

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts:38

  • Developed at:

    • Releases
    • GitHub
    • Security
    • Issue Tracker
    • License
  • Copyright © 2021-2026 Luna Klatzer, 2024-2025 Lorenz Holzbauer & Fabian Baitura.
    Kipper is licensed under the GPL-3.0-or-later license.