• Kipper

    v0.12.1
  • Downloads

  • Docs

  • Playground

  • Changelog

  • Kipper

    v0.12.1
    • Downloads

    • Docs

    • Playground

    • Changelog

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

    Edit page

    Class: LexerOrParserSyntaxError<Token>

    errors.LexerOrParserSyntaxError

    Error that is thrown whenever the parser or lexer report a syntax error.

    Since

    0.10.0

    Type parameters

    Name
    Token

    Hierarchy

    • KipperSyntaxError

      ↳ LexerOrParserSyntaxError

    Table of contents

    Constructors

    • constructor

    Properties

    • _error
    • _msg
    • _offendingSymbol
    • _recognizer
    • tracebackData

    Accessors

    • col
    • error
    • filePath
    • line
    • msg
    • offendingSymbol
    • programCtx
    • recognizer
    • tokenSrc

    Methods

    • getTraceback
    • setTracebackData

    Constructors

    constructor

    • new LexerOrParserSyntaxError<Token>(recognizer, offendingSymbol, msg, error)

    Create a new LexerOrParserSyntaxError instance.

    Type parameters

    Name
    Token

    Parameters

    Name Type Description
    recognizer Recognizer<Token, any> The Antlr4 Parser - should normally always be KipperParser.
    offendingSymbol undefined | Token The token that caused the error.
    msg string The msg that was generated as the error message in the Parser.
    error undefined | FailedPredicateException | RecognitionException | NoViableAltException | LexerNoViableAltException | InputMismatchException The error instance that raised the syntax error in the Lexer.

    Overrides

    KipperSyntaxError.constructor

    Defined in

    kipper/core/src/errors.ts:390

    Properties

    _error

    • Private Readonly _error: undefined | FailedPredicateException | RecognitionException | NoViableAltException | LexerNoViableAltException | InputMismatchException

    Defined in

    kipper/core/src/errors.ts:375


    _msg

    • Private Readonly _msg: string

    Defined in

    kipper/core/src/errors.ts:374


    _offendingSymbol

    • Private Readonly _offendingSymbol: undefined | Token

    Defined in

    kipper/core/src/errors.ts:373


    _recognizer

    • Private Readonly _recognizer: Recognizer<Token, any>

    Defined in

    kipper/core/src/errors.ts:372


    tracebackData

    • tracebackData: TracebackMetadata

    The traceback metadata for this error. It contains the line and column of the error, the path to the file, the line of code that caused the error, and the token stream (source code) of the program.

    Since

    0.3.0

    Inherited from

    KipperSyntaxError.tracebackData

    Defined in

    kipper/core/src/errors.ts:56

    Accessors

    col

    • get col(): undefined | number

    Returns the column where the error occurred.

    Since

    0.4.0

    Returns

    undefined | number

    Inherited from

    KipperSyntaxError.col

    Defined in

    kipper/core/src/errors.ts:147


    error

    • get error(): undefined | FailedPredicateException | RecognitionException | NoViableAltException | LexerNoViableAltException | InputMismatchException

    Returns the error instance that raised the syntax error in the Lexer.

    Returns

    undefined | FailedPredicateException | RecognitionException | NoViableAltException | LexerNoViableAltException | InputMismatchException

    Defined in

    kipper/core/src/errors.ts:433


    filePath

    • get filePath(): undefined | string

    The path to the file where the error occurred.

    Since

    0.4.0

    Returns

    undefined | string

    Inherited from

    KipperSyntaxError.filePath

    Defined in

    kipper/core/src/errors.ts:155


    line

    • get line(): undefined | number

    Returns the line where the error occurred.

    Since

    0.4.0

    Returns

    undefined | number

    Inherited from

    KipperSyntaxError.line

    Defined in

    kipper/core/src/errors.ts:139


    msg

    • get msg(): string

    Returns the msg that was generated as the error message in the Parser.

    Returns

    string

    Defined in

    kipper/core/src/errors.ts:426


    offendingSymbol

    • get offendingSymbol(): undefined | Token

    Returns the token that caused the error.

    Returns

    undefined | Token

    Defined in

    kipper/core/src/errors.ts:419


    programCtx

    • get programCtx(): undefined | KipperProgramContext

    Returns the program ctx containing the metadata of the program compilation in which the error occurred.

    Since

    0.10.2

    Returns

    undefined | KipperProgramContext

    Inherited from

    KipperSyntaxError.programCtx

    Defined in

    kipper/core/src/errors.ts:178


    recognizer

    • get recognizer(): Recognizer<Token, any>

    Returns the Antlr4 Parser - should normally always be KipperParser.

    Returns

    Recognizer<Token, any>

    Defined in

    kipper/core/src/errors.ts:412


    tokenSrc

    • get tokenSrc(): undefined | string

    Returns the token source where the error occurred.

    Since

    0.4.0

    Returns

    undefined | string

    Inherited from

    KipperSyntaxError.tokenSrc

    Defined in

    kipper/core/src/errors.ts:163

    Methods

    getTraceback

    ▸ getTraceback(): string

    Get the traceback of this item.

    Note

    The metadata in this traceback should be set using setTracebackData.

    Since

    0.3.0

    Returns

    string

    Inherited from

    KipperSyntaxError.getTraceback

    Defined in

    kipper/core/src/errors.ts:84


    setTracebackData

    ▸ setTracebackData(traceback): void

    Update traceback context data that are associated with this error.

    Since

    0.3.0

    Parameters

    Name Type Description
    traceback TracebackMetadata The traceback data.

    Returns

    void

    Inherited from

    KipperSyntaxError.setTracebackData

    Defined in

    kipper/core/src/errors.ts:75

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