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

    compiler.KipperTargetBuiltInGenerator

    Generator for the Kipper built-ins that are specific for a target.

    This class must be specified when using a KipperCompileTarget and is used to generate the required built-in functions that can be called during runtime in the target language.

    The functions in this class are automatically called by generateRequirements when used inside a KipperProgramContext, so there is no need to call it yourself.

    Since

    0.10.0

    Table of contents

    Constructors

    • constructor

    Methods

    • __name__
    • boolToNum
    • boolToStr
    • index
    • len
    • nullToStr
    • numToStr
    • print
    • repeatString
    • slice
    • strToNum
    • undefinedToStr
    • voidToStr

    Constructors

    constructor

    • new KipperTargetBuiltInGenerator()

    Methods

    __name__

    ▸ Abstract name(varSpec, programCtx): Promise<TranslatedCodeLine[]>

    Built-in variable 'name' that provides the name of the current file being run.

    Since

    0.10.0

    Parameters

    Name Type Description
    varSpec BuiltInVariable The specification for the variable. This contains the overall metadata for the variable that should be followed. This is auto-inserted by the code-generator in KipperProgramContext.
    programCtx KipperProgramContext The program context of the environment that is being compiled.

    Returns

    Promise<TranslatedCodeLine[]>

    Defined in

    kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts:144


    boolToNum

    ▸ Abstract boolToNum(func, programCtx): Promise<TranslatedCodeLine[]>

    Conversion function which provides 'bool' to 'num' type conversion functionality.

    Since

    0.10.0

    Parameters

    Name Type Description
    func InternalFunction The specification for the function. This contains the overall metadata for the function that should be followed. This is auto-inserted by the code-generator in KipperProgramContext.
    programCtx KipperProgramContext The program context of the environment that is being compiled.

    Returns

    Promise<TranslatedCodeLine[]>

    Defined in

    kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts:82


    boolToStr

    ▸ Abstract boolToStr(func, programCtx): Promise<TranslatedCodeLine[]>

    Conversion function which provides 'bool' to 'str' type conversion functionality.

    Since

    0.10.0

    Parameters

    Name Type Description
    func InternalFunction The specification for the function. This contains the overall metadata for the function that should be followed. This is auto-inserted by the code-generator in KipperProgramContext.
    programCtx KipperProgramContext The program context of the environment that is being compiled.

    Returns

    Promise<TranslatedCodeLine[]>

    Defined in

    kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts:37


    index

    ▸ Abstract index(funcSpec, programCtx): Promise<TranslatedCodeLine[]>

    Index function which provides the ability to index an iterable object-like type.

    This is used to get a specific index from an iterable object-like type, such as a string or array. Though unlike in JavaScript this will assert that the index is within the bounds of the iterable object-like type. Otherwise, an error will be thrown.

    Parameters

    Name Type Description
    funcSpec InternalFunction The specification for the function. This contains the overall metadata for the function that should be followed. This is auto-inserted by the code-generator in KipperProgramContext.
    programCtx KipperProgramContext The program context of the environment that is being compiled.

    Returns

    Promise<TranslatedCodeLine[]>

    Defined in

    kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts:105


    len

    ▸ Abstract len(funcSpec, programCtx): Promise<TranslatedCodeLine[]>

    Len function which provides the ability to get the length of an iterable array-like type.

    Since

    0.10.0

    Parameters

    Name Type Description
    funcSpec BuiltInFunction The specification for the function. This contains the overall metadata for the function that should be followed. This is auto-inserted by the code-generator in KipperProgramContext.
    programCtx KipperProgramContext The program context of the environment that is being compiled.

    Returns

    Promise<TranslatedCodeLine[]>

    Defined in

    kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts:135


    nullToStr

    ▸ Abstract nullToStr(func, programCtx): Promise<TranslatedCodeLine[]>

    Conversion function which provides 'null' to 'str' type conversion functionality.

    Since

    0.11.0

    Parameters

    Name Type Description
    func InternalFunction The specification for the function. This contains the overall metadata for the function that should be followed. This is auto-inserted by the code-generator in KipperProgramContext.
    programCtx KipperProgramContext The program context of the environment that is being compiled.

    Returns

    Promise<TranslatedCodeLine[]>

    Defined in

    kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts:55


    numToStr

    ▸ Abstract numToStr(func, programCtx): Promise<TranslatedCodeLine[]>

    Conversion function which provides 'num' to 'str' type conversion functionality.

    Since

    0.10.0

    Parameters

    Name Type Description
    func InternalFunction The specification for the function. This contains the overall metadata for the function that should be followed. This is auto-inserted by the code-generator in KipperProgramContext.
    programCtx KipperProgramContext The program context of the environment that is being compiled.

    Returns

    Promise<TranslatedCodeLine[]>

    Defined in

    kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts:28


    print

    ▸ Abstract print(funcSpec, programCtx): Promise<TranslatedCodeLine[]>

    Print function which provides default IO console output functionality.

    Since

    0.10.0

    Parameters

    Name Type Description
    funcSpec BuiltInFunction The specification for the function. This contains the overall metadata for the function that should be followed. This is auto-inserted by the code-generator in KipperProgramContext.
    programCtx KipperProgramContext The program context of the environment that is being compiled.

    Returns

    Promise<TranslatedCodeLine[]>

    Defined in

    kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts:126


    repeatString

    ▸ Abstract repeatString(funcSpec, programCtx): Promise<TranslatedCodeLine[]>

    Repeat string function which provides the ability to repeat a string a given number of times.

    Since

    0.10.0

    Parameters

    Name Type Description
    funcSpec InternalFunction The specification for the function. This contains the overall metadata for the function that should be followed. This is auto-inserted by the code-generator in KipperProgramContext.
    programCtx KipperProgramContext The program context of the environment that is being compiled.

    Returns

    Promise<TranslatedCodeLine[]>

    Defined in

    kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts:114


    slice

    ▸ Abstract slice(funcSpec, programCtx): Promise<TranslatedCodeLine[]>

    Slice function which provides the ability to slice an iterable object-like type.

    This function is used to slice types, such as a string or array, into a new object-like or primitive type. This is used to get a substring from a string, or a sub-array from an array.

    Parameters

    Name Type Description
    funcSpec InternalFunction The specification for the function. This contains the overall metadata for the function that should be followed. This is auto-inserted by the code-generator in KipperProgramContext.
    programCtx KipperProgramContext The program context of the environment that is being compiled.

    Returns

    Promise<TranslatedCodeLine[]>

    Defined in

    kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts:93


    strToNum

    ▸ Abstract strToNum(func, programCtx): Promise<TranslatedCodeLine[]>

    Conversion function which provides 'str' to 'num' type conversion functionality.

    Since

    0.10.0

    Parameters

    Name Type Description
    func InternalFunction The specification for the function. This contains the overall metadata for the function that should be followed. This is auto-inserted by the code-generator in KipperProgramContext.
    programCtx KipperProgramContext The program context of the environment that is being compiled.

    Returns

    Promise<TranslatedCodeLine[]>

    Defined in

    kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts:73


    undefinedToStr

    ▸ Abstract undefinedToStr(func, programCtx): Promise<TranslatedCodeLine[]>

    Conversion function which provides 'undefined' to 'str' type conversion functionality.

    Since

    0.11.0

    Parameters

    Name Type Description
    func InternalFunction The specification for the function. This contains the overall metadata for the function that should be followed. This is auto-inserted by the code-generator in KipperProgramContext.
    programCtx KipperProgramContext The program context of the environment that is being compiled.

    Returns

    Promise<TranslatedCodeLine[]>

    Defined in

    kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts:64


    voidToStr

    ▸ Abstract voidToStr(func, programCtx): Promise<TranslatedCodeLine[]>

    Conversion function which provides 'str' to 'str' type conversion functionality.

    Since

    0.11.0

    Parameters

    Name Type Description
    func InternalFunction The specification for the function. This contains the overall metadata for the function that should be followed. This is auto-inserted by the code-generator in KipperProgramContext.
    programCtx KipperProgramContext The program context of the environment that is being compiled.

    Returns

    Promise<TranslatedCodeLine[]>

    Defined in

    kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts:46

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