• 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: UniverseScope

    compiler.UniverseScope

    The universal scope which only defines built-ins and is not bound to any specific context.

    Since

    0.11.0

    Hierarchy

    • Scope<never, never, BuiltInType>

      ↳ UniverseScope

    Table of contents

    Constructors

    • constructor

    Properties

    • _entries
    • ctx
    • parent

    Accessors

    • entries

    Methods

    • addFunction
    • addType
    • addVariable
    • clearUniversalFunctions
    • clearUniversalVariables
    • ensureNotUsed
    • getEntry
    • getEntryRecursively
    • init

    Constructors

    constructor

    • new UniverseScope(ctx)

    Parameters

    Name Type
    ctx KipperProgramContext

    Overrides

    Scope.constructor

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/universe-scope.ts:77

    Properties

    _entries

    • Protected Readonly _entries: Map<string, ScopeDeclaration>

    Inherited from

    Scope._entries

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/base/scope.ts:21


    ctx

    • ctx: KipperProgramContext

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/universe-scope.ts:77


    parent

    • Readonly parent: undefined

    The parent scope of this scope.

    Since

    0.10.0

    Overrides

    Scope.parent

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/universe-scope.ts:75

    Accessors

    entries

    • get entries(): Map<string, ScopeDeclaration>

    Returns the entries in this scope (symbol table entries).

    Since

    0.10.0

    Returns

    Map<string, ScopeDeclaration>

    Inherited from

    Scope.entries

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/base/scope.ts:37

    Methods

    addFunction

    ▸ addFunction(declaration): ScopeFunctionDeclaration

    Adds a built-in function to the universal scope.

    Since

    0.11.0

    Parameters

    Name Type Description
    declaration BuiltInFunction The built-in function to add.

    Returns

    ScopeFunctionDeclaration

    The scope declaration of the added function.

    Overrides

    Scope.addFunction

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/universe-scope.ts:128


    addType

    ▸ addType(declaration): ScopeTypeDeclaration

    Adds a built-in type to the universal scope.

    Since

    0.11.0

    Parameters

    Name Type Description
    declaration BuiltInType The built-in type to add.

    Returns

    ScopeTypeDeclaration

    The scope declaration of the added type.

    Overrides

    Scope.addType

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/universe-scope.ts:141


    addVariable

    ▸ addVariable(declaration): ScopeVariableDeclaration

    Adds a built-in variable to the universal scope.

    Since

    0.11.0

    Parameters

    Name Type Description
    declaration BuiltInVariable The built-in variable to add.

    Returns

    ScopeVariableDeclaration

    The scope declaration of the added variable.

    Overrides

    Scope.addVariable

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/universe-scope.ts:115


    clearUniversalFunctions

    ▸ clearUniversalFunctions(): void

    DANGEROUS METHOD! Clears all the universal functions and create dangling references.

    Since

    0.11.0

    Returns

    void

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/universe-scope.ts:172


    clearUniversalVariables

    ▸ clearUniversalVariables(): void

    DANGEROUS METHOD! Clears all the universal variables and create dangling references.

    Since

    0.11.0

    Returns

    void

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/universe-scope.ts:180


    ensureNotUsed

    ▸ Private ensureNotUsed(identifier): void

    Ensures that the given declaration is not already used in the current scope.

    Since

    0.12.0

    Parameters

    Name Type Description
    identifier string The identifier to check.

    Returns

    void

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/universe-scope.ts:103


    getEntry

    ▸ getEntry(identifier): undefined | ScopeDeclaration

    Retrieves a scope declaration from the universal scope.

    Since

    0.11.0

    Parameters

    Name Type Description
    identifier string The identifier of the declaration to retrieve.

    Returns

    undefined | ScopeDeclaration

    The scope declaration if it exists, otherwise undefined.

    Overrides

    Scope.getEntry

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/universe-scope.ts:154


    getEntryRecursively

    ▸ getEntryRecursively(identifier): undefined | ScopeDeclaration

    Retrieves a scope declaration from the universal scope recursively.

    Since

    0.11.0

    Parameters

    Name Type Description
    identifier string The identifier of the declaration to retrieve.

    Returns

    undefined | ScopeDeclaration

    The scope declaration if it exists, otherwise undefined.

    Overrides

    Scope.getEntryRecursively

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/universe-scope.ts:164


    init

    ▸ init(): void

    Initializes the universal scope by adding all built-in types, functions and variables.

    Since

    0.11.0

    Returns

    void

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/universe-scope.ts:85

  • 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.