• Kipper

    v0.12.1
  • Downloads

  • Docs

  • Playground

  • Changelog

  • Kipper

    v0.12.1
    • Downloads

    • Docs

    • Playground

    • Changelog

      • latest /
      • 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

      • Type Consistency

      • Runtime Type Casting

      • Strict Compiler Inspection

      • Integrated Runtime Library

    • 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

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

    Edit page

    Class: GlobalScope

    compiler.GlobalScope

    The global scope of a KipperProgramContext, which contains the global variables and functions of a Kipper program.

    Since

    0.8.0

    Hierarchy

    • UserScope<VariableDeclaration, FunctionDeclaration, TypeDeclaration>

      ↳ GlobalScope

    Table of contents

    Constructors

    • constructor

    Properties

    • _entries
    • ctx
    • parent
    • universe

    Accessors

    • entries

    Methods

    • addFunction
    • addType
    • addVariable
    • ensureNotUsed
    • getEntry
    • getEntryRecursively

    Constructors

    constructor

    • new GlobalScope(ctx, universe)

    Parameters

    Name Type
    ctx RootASTNode
    universe UniverseScope

    Overrides

    UserScope<VariableDeclaration, FunctionDeclaration, TypeDeclaration\>.constructor

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/global-scope.ts:18

    Properties

    _entries

    • Protected Readonly _entries: Map<string, ScopeDeclaration>

    Inherited from

    UserScope._entries

    Defined in

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


    ctx

    • Readonly ctx: RootASTNode

    Inherited from

    UserScope.ctx

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/global-scope.ts:19


    parent

    • parent: UniverseScope

    The parent scope of this global scope. This is always undefined.

    Since

    0.10.0

    Overrides

    UserScope.parent

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/global-scope.ts:29


    universe

    • Readonly universe: UniverseScope

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/global-scope.ts:20

    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

    UserScope.entries

    Defined in

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

    Methods

    addFunction

    ▸ addFunction(declaration): ScopeFunctionDeclaration

    Parameters

    Name Type
    declaration FunctionDeclaration

    Returns

    ScopeFunctionDeclaration

    Overrides

    UserScope.addFunction

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/global-scope.ts:31


    addType

    ▸ addType(declaration): ScopeTypeDeclaration

    Parameters

    Name Type
    declaration TypeDeclaration<TypeDeclarationSemantics, TypeDeclarationTypeSemantics>

    Returns

    ScopeTypeDeclaration

    Overrides

    UserScope.addType

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/global-scope.ts:49


    addVariable

    ▸ addVariable(declaration): ScopeVariableDeclaration

    Parameters

    Name Type
    declaration VariableDeclaration

    Returns

    ScopeVariableDeclaration

    Overrides

    UserScope.addVariable

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/global-scope.ts:40


    ensureNotUsed

    ▸ Private ensureNotUsed(identifier, declaration): 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.
    declaration Declaration<DeclarationSemantics, DeclarationTypeSemantics> The declaration to check.

    Returns

    void

    Inherited from

    UserScope.ensureNotUsed

    Defined in

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


    getEntry

    ▸ getEntry(identifier): undefined | ScopeDeclaration

    Parameters

    Name Type
    identifier string

    Returns

    undefined | ScopeDeclaration

    Overrides

    UserScope.getEntry

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/global-scope.ts:60


    getEntryRecursively

    ▸ getEntryRecursively(identifier): undefined | ScopeDeclaration

    Parameters

    Name Type
    identifier string

    Returns

    undefined | ScopeDeclaration

    Overrides

    UserScope.getEntryRecursively

    Defined in

    kipper/core/src/compiler/semantics/symbol-table/global-scope.ts:64

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