• Kipper

    v0.12.1
  • Downloads

  • Docs

  • Playground

  • Changelog

  • Kipper

    v0.12.1
    • Downloads

    • Docs

    • Playground

    • Changelog

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

      • Compiler Setup

        • Overview

          • index

          • compiler

          • errors

          • logger

          • utils

          • config

          • index

          • index

        • Overview

        • new

        • run

        • compile

        • help

        • version

    • Variables

      • Overview

      • String Type

      • Number Type

      • Boolean Type

      • Void Type

      • Null Type

      • Undefined Type

      • Array Type

      • Overview

      • Arithmetic Expression

      • Assignment Expression

      • Conditional Expressions

      • Logical Expressions

      • Bitwise Expression

      • Relational Expressions

      • Convert Expression

      • F-String Expression

      • Member Access Expression

      • Function Call Expression

      • Overview

      • Expression Statement

      • If Statement

      • While Loop

      • Do-While Loop

      • For Loop

      • Compound Statement

      • Jump Statement

    • Functions

    • Comments

    • Built-in Functions

      • 0.11.0 /
      • Kipper API /
      • Module /
      • @kipper/core /
      • compiler
    • 0.11.0 /
    • 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

    • Scope

      ↳ GlobalScope

    Table of contents

    Constructors

    • constructor

    Properties

    • _entries
    • parent
    • programCtx

    Accessors

    • entries

    Methods

    • addFunction
    • addVariable
    • getEntry
    • getEntryRecursively

    Constructors

    constructor

    • new GlobalScope(programCtx)

    Parameters

    Name Type
    programCtx KipperProgramContext

    Overrides

    Scope.constructor

    Defined in

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

    Properties

    _entries

    • Protected Readonly _entries: Map<string, ScopeDeclaration>

    Inherited from

    Scope._entries

    Defined in

    kipper/core/src/compiler/analysis/symbol-table/scope.ts:17


    parent

    • parent: undefined = undefined

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

    Since

    0.10.0

    Overrides

    Scope.parent

    Defined in

    kipper/core/src/compiler/analysis/symbol-table/global-scope.ts:26


    programCtx

    • programCtx: KipperProgramContext

    Defined in

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

    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/analysis/symbol-table/scope.ts:33

    Methods

    addFunction

    ▸ addFunction(declaration): ScopeFunctionDeclaration

    Adds a new function declaration to the symbol table entries.

    Since

    0.8.0

    Parameters

    Name Type Description
    declaration FunctionDeclaration The declaration to add.

    Returns

    ScopeFunctionDeclaration

    The generated scope declaration.

    Overrides

    Scope.addFunction

    Defined in

    kipper/core/src/compiler/analysis/symbol-table/global-scope.ts:28


    addVariable

    ▸ addVariable(declaration): ScopeVariableDeclaration

    Adds a new variable declaration to the symbol table entries.

    Since

    0.8.0

    Parameters

    Name Type Description
    declaration VariableDeclaration The declaration to add.

    Returns

    ScopeVariableDeclaration

    The generated scope declaration.

    Overrides

    Scope.addVariable

    Defined in

    kipper/core/src/compiler/analysis/symbol-table/global-scope.ts:39


    getEntry

    ▸ getEntry(identifier): undefined | ScopeDeclaration

    Searches for a reference/entry with the specific identifier in the local hash table entries (local scope).

    If no reference is found, undefined will be returned.

    Since

    0.8.0

    Parameters

    Name Type Description
    identifier string The identifier to search for.

    Returns

    undefined | ScopeDeclaration

    The found reference or undefined.

    Overrides

    Scope.getEntry

    Defined in

    kipper/core/src/compiler/analysis/symbol-table/global-scope.ts:50


    getEntryRecursively

    ▸ getEntryRecursively(identifier): undefined | ScopeDeclaration

    Searches for a reference/entry with the specific identifier in the local hash table entries (local scope) and all parent scopes.

    If no reference is found, undefined will be returned.

    Since

    0.10.0

    Parameters

    Name Type Description
    identifier string The identifier to search for.

    Returns

    undefined | ScopeDeclaration

    The found reference or undefined.

    Overrides

    Scope.getEntryRecursively

    Defined in

    kipper/core/src/compiler/analysis/symbol-table/global-scope.ts:54

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