• 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: Scope<VarT, FuncT, TypeT>

    compiler.Scope

    A scope in a Kipper program, which can contain variables, functions and function arguments.

    A scope can be a child of another scope or the global scope of a program.

    Since

    0.8.0

    Type parameters

    Name Type
    VarT any
    FuncT any
    TypeT any

    Hierarchy

    • Scope

      ↳ UniverseScope

    Implements

    • SymbolTable

    Table of contents

    Constructors

    • constructor

    Properties

    • _entries
    • parent

    Accessors

    • entries

    Methods

    • addFunction
    • addType
    • addVariable
    • getEntry
    • getEntryRecursively

    Constructors

    constructor

    • Protected new Scope<VarT, FuncT, TypeT>()

    Type parameters

    Name Type
    VarT any
    FuncT any
    TypeT any

    Defined in

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

    Properties

    _entries

    • Protected Readonly _entries: Map<string, ScopeDeclaration>

    Defined in

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


    parent

    • Optional Abstract parent: SymbolTable

    The parent scope of this scope.

    Since

    0.10.0

    Implementation of

    SymbolTable.parent

    Defined in

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

    Accessors

    entries

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

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

    Since

    0.10.0

    Returns

    Map<string, ScopeDeclaration>

    Implementation of

    SymbolTable.entries

    Defined in

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

    Methods

    addFunction

    ▸ Abstract addFunction(declaration): ScopeFunctionDeclaration

    Adds a new function declaration to the symbol table entries.

    Since

    0.8.0

    Parameters

    Name Type Description
    declaration FuncT The declaration to add.

    Returns

    ScopeFunctionDeclaration

    The generated scope declaration.

    Defined in

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


    addType

    ▸ Abstract addType(declaration): ScopeTypeDeclaration

    Adds a new type declaration to the symbol table entries.

    Since

    0.11.0

    Parameters

    Name Type Description
    declaration TypeT The declaration to add.

    Returns

    ScopeTypeDeclaration

    The generated scope declaration.

    Defined in

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


    addVariable

    ▸ Abstract addVariable(declaration): ScopeVariableDeclaration

    Adds a new variable declaration to the symbol table entries.

    Since

    0.8.0

    Parameters

    Name Type Description
    declaration VarT The declaration to add.

    Returns

    ScopeVariableDeclaration

    The generated scope declaration.

    Defined in

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


    getEntry

    ▸ Abstract 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.

    Defined in

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


    getEntryRecursively

    ▸ Abstract 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.

    Defined in

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

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