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

    compiler.InterfaceMethodDeclaration

    Represents a class declaration in the Kipper language, which may contain methods and fields.

    Since

    0.12.0

    Hierarchy

    • InterfaceMemberDeclaration<InterfaceMethodDeclarationSemantics, InterfaceMethodDeclarationTypeSemantics>

      ↳ InterfaceMethodDeclaration

    Table of contents

    Constructors

    • constructor

    Properties

    • _antlrRuleCtx
    • _children
    • _errors
    • _parent
    • _scopeDeclaration
    • _semanticData
    • _skippedSemanticAnalysis
    • _skippedSemanticTypeChecking
    • _skippedTargetSemanticAnalysis
    • _typeSemantics
    • checkForWarnings
    • primarySemanticTypeChecking
    • targetCodeGenerator
    • targetSemanticAnalysis
    • kind
    • ruleName

    Accessors

    • antlrRuleCtx
    • children
    • closestHigherLevelParent
    • codeGenerator
    • compileConfig
    • errors
    • hasFailed
    • kind
    • parent
    • parser
    • programCtx
    • ruleName
    • scope
    • scopeCtx
    • scopeDeclaration
    • semanticAnalyser
    • semanticData
    • skippedSemanticAnalysis
    • skippedSemanticTypeChecking
    • sourceCode
    • target
    • tokenStream
    • typeSemantics

    Methods

    • addError
    • addNewChild
    • ensureScopeDeclarationAvailableIfNeeded
    • ensureSemanticallyValid
    • ensureTypeSemanticallyValid
    • getAntlrRuleChildren
    • getScopeDeclaration
    • getSemanticData
    • getTypeSemanticData
    • handleSemanticError
    • hasSideEffects
    • preliminaryTypeChecking
    • preliminaryTypeCheckingChildren
    • primaryPreliminaryTypeChecking
    • primarySemanticAnalysis
    • recursivelyCheckForWarnings
    • semanticAnalysis
    • semanticTypeChecking
    • semanticallyAnalyseChildren
    • semanticallyTypeCheckChildren
    • targetSemanticallyAnalyseChildren
    • translateCtxAndChildren
    • wrapUpSemanticAnalysis

    Constructors

    constructor

    • new InterfaceMethodDeclaration(antlrRuleCtx, parent)

    Parameters

    Name Type
    antlrRuleCtx InterfaceMethodDeclarationContext
    parent CompilableNodeParent

    Overrides

    InterfaceMemberDeclaration.constructor

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts:76

    Properties

    _antlrRuleCtx

    • Readonly Private _antlrRuleCtx: InterfaceMethodDeclarationContext

    parent The private field '_antlrRuleCtx' that actually stores the variable data, which is returned inside the this.antlrRuleCtx.

    Overrides

    InterfaceMemberDeclaration._antlrRuleCtx

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts:30


    _children

    • Protected _children: CompilableNodeChild[]

    Inherited from

    InterfaceMemberDeclaration._children

    Defined in

    kipper/core/src/compiler/ast/compilable-ast-node.ts:86


    _errors

    • Protected _errors: KipperError[]

    Inherited from

    InterfaceMemberDeclaration._errors

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:75


    _parent

    • Protected _parent: CompilableNodeParent

    Inherited from

    InterfaceMemberDeclaration._parent

    Defined in

    kipper/core/src/compiler/ast/compilable-ast-node.ts:56


    _scopeDeclaration

    • Private _scopeDeclaration: undefined | ScopeTypeDeclaration

    The private field '_scopeDeclaration' that actually stores the variable data, which is returned inside the this.scopeDeclaration.

    Overrides

    InterfaceMemberDeclaration._scopeDeclaration

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts:37


    _semanticData

    • Protected _semanticData: undefined | InterfaceMethodDeclarationSemantics

    Inherited from

    InterfaceMemberDeclaration._semanticData

    Defined in

    kipper/core/src/compiler/ast/ast-node.ts:56


    _skippedSemanticAnalysis

    • Protected _skippedSemanticAnalysis: boolean

    Inherited from

    InterfaceMemberDeclaration._skippedSemanticAnalysis

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:85


    _skippedSemanticTypeChecking

    • Protected _skippedSemanticTypeChecking: boolean

    Inherited from

    InterfaceMemberDeclaration._skippedSemanticTypeChecking

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:96


    _skippedTargetSemanticAnalysis

    • Protected _skippedTargetSemanticAnalysis: boolean

    Inherited from

    InterfaceMemberDeclaration._skippedTargetSemanticAnalysis

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:43


    _typeSemantics

    • Protected _typeSemantics: undefined | InterfaceMethodDeclarationTypeSemantics

    Inherited from

    InterfaceMemberDeclaration._typeSemantics

    Defined in

    kipper/core/src/compiler/ast/ast-node.ts:75


    checkForWarnings

    • checkForWarnings: undefined = undefined

    Semantically analyses the code inside this AST node and checks for possible warnings or problematic code.

    This will log all warnings using programCtx.logger and store them in warnings.

    Since

    0.12.0

    Overrides

    InterfaceMemberDeclaration.checkForWarnings

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts:174


    primarySemanticTypeChecking

    • Readonly primarySemanticTypeChecking: undefined

    Overrides

    InterfaceMemberDeclaration.primarySemanticTypeChecking

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts:166


    targetCodeGenerator

    • Readonly targetCodeGenerator: TargetASTNodeCodeGenerator<InterfaceMethodDeclaration, TranslatedCodeLine[]>

    Code generator function that is specific for the target language.

    Since

    0.8.0

    Overrides

    InterfaceMemberDeclaration.targetCodeGenerator

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts:177


    targetSemanticAnalysis

    • Readonly targetSemanticAnalysis: undefined | TargetASTNodeSemanticAnalyser<InterfaceMethodDeclaration>

    Semantic analyser function that is specific for the target. This only should perform logical analysis and not interpret the code/modify the semanticData field.

    If this is undefined then it means there is no target specific semantic analysis that needs to be done.

    Since

    0.8.0

    Overrides

    InterfaceMemberDeclaration.targetSemanticAnalysis

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts:176


    kind

    ▪ Static Readonly kind: 18

    /**

    • The static kind for this AST Node. *

    Since

    0.12.0

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts:44


    ruleName

    ▪ Static Readonly ruleName: "RULE_interfaceMethodDeclaration"

    The static rule name for this AST Node.

    Since

    0.12.0

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts:62

    Accessors

    antlrRuleCtx

    • get antlrRuleCtx(): InterfaceMethodDeclarationContext

    The antlr context containing the antlr4 metadata for this expression.

    Returns

    InterfaceMethodDeclarationContext

    Overrides

    InterfaceMemberDeclaration.antlrRuleCtx

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts:84


    children

    • get children(): CompilableNodeChild[]

    The children of this AST node.

    Since

    0.8.0

    Returns

    CompilableNodeChild[]

    Inherited from

    InterfaceMemberDeclaration.children

    Defined in

    kipper/core/src/compiler/ast/compilable-ast-node.ts:92


    closestHigherLevelParent

    • get closestHigherLevelParent(): undefined | Statement<StatementSemantics, StatementTypeSemantics> | Declaration<DeclarationSemantics, DeclarationTypeSemantics>

    Recursively traces back the parent stack and searches for the closest parent that is a Statement or Declaration.

    Since

    0.13.0

    Returns

    undefined | Statement<StatementSemantics, StatementTypeSemantics> | Declaration<DeclarationSemantics, DeclarationTypeSemantics>

    The closest parent that is a Statement or Declaration, or undefined if the current node is already at the top level (and as such naturally also a Statement or Declaration).

    Inherited from

    InterfaceMemberDeclaration.closestHigherLevelParent

    Defined in

    kipper/core/src/compiler/ast/compilable-ast-node.ts:73


    codeGenerator

    • get codeGenerator(): KipperTargetCodeGenerator

    The code generator, which will generate the code for this specific token into the this.target target language.

    Since

    0.8.0

    Returns

    KipperTargetCodeGenerator

    Inherited from

    InterfaceMemberDeclaration.codeGenerator

    Defined in

    kipper/core/src/compiler/ast/compilable-ast-node.ts:125


    compileConfig

    • get compileConfig(): EvaluatedCompileConfig

    The compilation config for the program of this AST node.

    Since

    0.10.0

    Returns

    EvaluatedCompileConfig

    Inherited from

    InterfaceMemberDeclaration.compileConfig

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:120


    errors

    • get errors(): KipperError[]

    The errors that were caused by this node. Includes all errors from children.

    Since

    0.10.0

    Returns

    KipperError[]

    Inherited from

    InterfaceMemberDeclaration.errors

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:81


    hasFailed

    • get hasFailed(): boolean

    Returns true if the this.primarySemanticAnalysis semantic analysis or this.primarySemanticTypeChecking type checking of this node or any children nodes failed.

    This indicates that the node is not valid and can not be translated.

    Since

    0.10.0

    Returns

    boolean

    Inherited from

    InterfaceMemberDeclaration.hasFailed

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:132


    kind

    • get kind(): 18

    Returns the kind of this AST node. This represents the specific type of the antlrRuleCtx that this AST node wraps.

    This may be compared using the rule fields, for example RULE_declaration.

    Since

    0.12.0

    Returns

    18

    Overrides

    InterfaceMemberDeclaration.kind

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts:54


    parent

    • get parent(): CompilableNodeParent

    Returns the parent that has this node as a child.

    Since

    0.8.0

    Returns

    CompilableNodeParent

    Inherited from

    InterfaceMemberDeclaration.parent

    Defined in

    kipper/core/src/compiler/ast/compilable-ast-node.ts:62


    parser

    • get parser(): KipperParser

    The parser that generated the parse tree and antlr rule context.

    Since

    0.8.0

    Returns

    KipperParser

    Inherited from

    InterfaceMemberDeclaration.parser

    Defined in

    kipper/core/src/compiler/ast/compilable-ast-node.ts:100


    programCtx

    • get programCtx(): KipperProgramContext

    The file context instance containing the metadata for the listener and this AST node.

    Since

    0.8.0

    Returns

    KipperProgramContext

    Inherited from

    InterfaceMemberDeclaration.programCtx

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:112


    ruleName

    • get ruleName(): "RULE_interfaceMethodDeclaration"

    Returns the rule name of this AST Node. This represents the specific type of the antlrRuleCtx that this AST node wraps.

    This may be compared using the rule fields, for example RULE_declaration.

    Since

    0.12.0

    Returns

    "RULE_interfaceMethodDeclaration"

    Overrides

    InterfaceMemberDeclaration.ruleName

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts:72


    scope

    • get scope(): LocalScope | ClassScope | GlobalScope

    The scope of this AST node.

    Since

    0.8.0

    Returns

    LocalScope | ClassScope | GlobalScope

    Inherited from

    InterfaceMemberDeclaration.scope

    Defined in

    kipper/core/src/compiler/ast/compilable-ast-node.ts:133


    scopeCtx

    • get scopeCtx(): ScopeNode<LocalScope | ClassScope | GlobalScope>

    The context / AST node of the scope.

    Since

    0.8.0

    Returns

    ScopeNode<LocalScope | ClassScope | GlobalScope>

    Inherited from

    InterfaceMemberDeclaration.scopeCtx

    Defined in

    kipper/core/src/compiler/ast/compilable-ast-node.ts:141


    scopeDeclaration

    • get scopeDeclaration(): undefined | ScopeTypeDeclaration

    The ScopeDeclaration context instance for this declaration, which is used to register the declaration in the parent scope.

    Since

    0.12.0

    Returns

    undefined | ScopeTypeDeclaration

    Overrides

    InterfaceMemberDeclaration.scopeDeclaration

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts:92

    • set scopeDeclaration(declaration): void

    Parameters

    Name Type
    declaration undefined | ScopeTypeDeclaration

    Returns

    void

    Overrides

    InterfaceMemberDeclaration.scopeDeclaration

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts:96


    semanticAnalyser

    • get semanticAnalyser(): KipperTargetSemanticAnalyser

    The translation-specific semantic analyser, which will perform semantic analysis specific for the this.target target language.

    Since

    0.8.0

    Returns

    KipperTargetSemanticAnalyser

    Inherited from

    InterfaceMemberDeclaration.semanticAnalyser

    Defined in

    kipper/core/src/compiler/ast/compilable-ast-node.ts:159


    semanticData

    • get semanticData(): undefined | Semantics

    Returns the semantic data of this AST node.

    Since

    0.8.0

    Returns

    undefined | Semantics

    Inherited from

    InterfaceMemberDeclaration.semanticData

    Defined in

    kipper/core/src/compiler/ast/ast-node.ts:62

    • set semanticData(value): void

    Sets the semantic data of this AST node.

    Since

    0.8.0

    Parameters

    Name Type Description
    value undefined | Semantics The semantic data that should be written onto this AST node.

    Returns

    void

    Inherited from

    InterfaceMemberDeclaration.semanticData

    Defined in

    kipper/core/src/compiler/ast/ast-node.ts:71


    skippedSemanticAnalysis

    • get skippedSemanticAnalysis(): boolean

    Returns true if the this.primarySemanticAnalysis semantic analysis of this node was skipped, due to required semantic data being missing. This indicates that the node is impossible to analyse as the required semantic data from other nodes is missing.

    Returns

    boolean

    Inherited from

    InterfaceMemberDeclaration.skippedSemanticAnalysis

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:92


    skippedSemanticTypeChecking

    • get skippedSemanticTypeChecking(): boolean

    Returns true if the this.primarySemanticTypeChecking type checking of this node was skipped, due to required semantic data being missing. This indicates that the node is impossible to type check as the required semantic data from other nodes is missing.

    Since

    0.10.0

    Returns

    boolean

    Inherited from

    InterfaceMemberDeclaration.skippedSemanticTypeChecking

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:104


    sourceCode

    • get sourceCode(): string

    The Kipper source code that was used to generate this CompilableASTNode.

    Any left-over whitespaces will be removed using trim().

    Since

    0.8.0

    Returns

    string

    Inherited from

    InterfaceMemberDeclaration.sourceCode

    Defined in

    kipper/core/src/compiler/ast/ast-node.ts:133


    target

    • get target(): KipperCompileTarget

    The compilation translation for this specific token.

    Since

    0.8.0

    Returns

    KipperCompileTarget

    Inherited from

    InterfaceMemberDeclaration.target

    Defined in

    kipper/core/src/compiler/ast/compilable-ast-node.ts:116


    tokenStream

    • get tokenStream(): TokenStream

    Returns the token stream source for this token.

    Since

    0.8.0

    Returns

    TokenStream

    Inherited from

    InterfaceMemberDeclaration.tokenStream

    Defined in

    kipper/core/src/compiler/ast/compilable-ast-node.ts:108


    typeSemantics

    • get typeSemantics(): undefined | TypeSemantics

    Returns the type data of this AST node.

    Since

    0.10.0

    Returns

    undefined | TypeSemantics

    Inherited from

    InterfaceMemberDeclaration.typeSemantics

    Defined in

    kipper/core/src/compiler/ast/ast-node.ts:81

    • set typeSemantics(value): void

    Sets the type data of this AST node.

    Since

    0.10.0

    Parameters

    Name Type Description
    value undefined | TypeSemantics The semantic data that should be written onto this AST node.

    Returns

    void

    Inherited from

    InterfaceMemberDeclaration.typeSemantics

    Defined in

    kipper/core/src/compiler/ast/ast-node.ts:90

    Methods

    addError

    ▸ addError(error): void

    Adds the specified error to the list of errors caused by this node.

    This is not the same as reportError, since that function automatically logs the error as well and this function does not! This is only intended to keep track if a node has failed.

    Parameters

    Name Type Description
    error KipperError The error to add.

    Returns

    void

    Inherited from

    InterfaceMemberDeclaration.addError

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:143


    addNewChild

    ▸ addNewChild(newChild): void

    Adds new child ctx item to this AST node. The child item should be in the order that they appeared in the this.antlrCtx parse tree.

    This will also automatically set the parent of newChild to this instance.

    Since

    0.8.0

    Parameters

    Name Type
    newChild CompilableNodeChild

    Returns

    void

    Inherited from

    InterfaceMemberDeclaration.addNewChild

    Defined in

    kipper/core/src/compiler/ast/compilable-ast-node.ts:170


    ensureScopeDeclarationAvailableIfNeeded

    ▸ ensureScopeDeclarationAvailableIfNeeded(): void

    Ensures that this node has a scope declaration available. This will be primarily used by declarations in their own analysis.

    This will throw an error if the scope declaration is not available.

    This is primarily used by the semanticTypeChecking method, which often requires the scope declaration to be available. As such this is a helper method which ensures the control flow is correct and no invalid errors are thrown. (E.g. an internal error is thrown after a normal semantic analysis error).

    Intentionally this will also likely cause an UndefinedSemanticsError in case the scopeDeclaration is missing and hasFailed is returning false. Since that's an automatic contradiction, it's better to ignore it here and let the UndefinedSemanticsError be thrown later.

    Throws

    If the scope declaration is not available.

    Since

    0.11.0

    Returns

    void

    Inherited from

    InterfaceMemberDeclaration.ensureScopeDeclarationAvailableIfNeeded

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/declaration.ts:126


    ensureSemanticallyValid

    ▸ Protected ensureSemanticallyValid(): void

    Ensures that this node successfully passed the semantic analysis. This will be primarily used by statements and declarations, which depend on other nodes to be semantically valid.

    This is done by checking if the hasFailed property is set to true and if the semanticData property is undefined. If both of these conditions are met, then the node failed in an intended way and the parent should not continue processing, as it will cause errors.

    This is used to help the control flow and also to ensure that other nodes do not try to access the semantic data of a node that failed, as that would cause an UndefinedSemanticsError.

    Intentionally this will also likely cause an UndefinedSemanticsError in case the semantic data is missing and hasFailed is returning false. Since that's an automatic contradiction, it's better to ignore it here and let the UndefinedSemanticsError be thrown later.

    Throws

    If the child failed and the semantic data is undefined. Note that this is not like UndefinedSemanticsError, as that error is thrown when the semantic data is undefined in an unintended or unexpected way. This error on the other will be handled by the compiler and influence the control flow.

    Since

    0.10.0

    Returns

    void

    Inherited from

    InterfaceMemberDeclaration.ensureSemanticallyValid

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:168


    ensureTypeSemanticallyValid

    ▸ Protected ensureTypeSemanticallyValid(): void

    Ensures that this node successfully passed the type checking step of semantic analysis. This will be primarily used by statements and declarations, which depend on other nodes to be semantically valid.

    This is done by checking if the hasFailed property is set to true and if the typeSemantics property is undefined. If both of these conditions are met, then the child failed in an intended way and the parent should not continue processing, as it will cause errors.

    This is used to help the control flow and also to ensure that the parent node does not try to access the type semantic data of a child node that has failed.

    Intentionally this will also likely cause an UndefinedSemanticsError in case the semantic data is missing and hasFailed is returning false. Since that's an automatic contradiction, it's better to ignore it here and let the UndefinedSemanticsError be thrown later.

    Throws

    If the child failed and the semantic data is undefined. Note that this is not like UndefinedSemanticsError, as that error is thrown when the semantic data is undefined in an unintended or unexpected way. This error on the other will be handled by the compiler and influence the control flow.

    Since

    0.10.0

    Returns

    void

    Inherited from

    InterfaceMemberDeclaration.ensureTypeSemanticallyValid

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:195


    getAntlrRuleChildren

    ▸ getAntlrRuleChildren(): ParseTree[]

    Returns the children of the antlrRuleCtx and throws an error in case they are undefined.

    Throws

    If antlrRuleCtx.children is undefined.

    Since

    0.8.0

    Returns

    ParseTree[]

    Inherited from

    InterfaceMemberDeclaration.getAntlrRuleChildren

    Defined in

    kipper/core/src/compiler/ast/ast-node.ts:161


    getScopeDeclaration

    ▸ getScopeDeclaration(): ScopeTypeDeclaration

    Returns the scope declaration ctx of this declaration and throws an error in case it is undefined.

    Throws

    UndefinedDeclarationCtx If scopeDeclaration is undefined.

    Since

    0.10.0

    Returns

    ScopeTypeDeclaration

    Overrides

    InterfaceMemberDeclaration.getScopeDeclaration

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts:100


    getSemanticData

    ▸ getSemanticData(): InterfaceMethodDeclarationSemantics

    Returns the semantic data of this AST node and throws an error in case it is undefined.

    Throws

    If semanticData is undefined.

    Since

    0.8.0

    Returns

    InterfaceMethodDeclarationSemantics

    Inherited from

    InterfaceMemberDeclaration.getSemanticData

    Defined in

    kipper/core/src/compiler/ast/ast-node.ts:174


    getTypeSemanticData

    ▸ getTypeSemanticData(): InterfaceMethodDeclarationTypeSemantics

    Returns the type semantic data of this AST node and throws an error in case it is undefined.

    Throws

    UndefinedSemanticsError If semanticData is undefined.

    Since

    0.10.0

    Returns

    InterfaceMethodDeclarationTypeSemantics

    Inherited from

    InterfaceMemberDeclaration.getTypeSemanticData

    Defined in

    kipper/core/src/compiler/ast/ast-node.ts:187


    handleSemanticError

    ▸ Protected handleSemanticError(error): void

    Handles the specified error that occurred during the semantic analysis of this node in a standardised way.

    Since

    0.10.0

    Parameters

    Name Type Description
    error KipperError | Error The error to handle.

    Returns

    void

    Inherited from

    InterfaceMemberDeclaration.handleSemanticError

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:343


    hasSideEffects

    ▸ hasSideEffects(): boolean

    Returns whether this AST node has any side effects. This means that the node will change the state of the program in some way and not only return a value.

    This specifically can mean it assigns or modifies a variable, calls a function, or throws an error.

    Since

    0.11.0

    Returns

    boolean

    Inherited from

    InterfaceMemberDeclaration.hasSideEffects

    Defined in

    kipper/core/src/compiler/ast/compilable-ast-node.ts:181


    preliminaryTypeChecking

    ▸ preliminaryTypeChecking(): Promise<void>

    Performs preliminary type checking on this AST node and all this.children children nodes. This uses the this.semanticData semantic data that was evaluated during this.semanticAnalysis semantic analysis.

    This preliminarily sets the this.typeSemantics type semantics of this node and allows the use of this.getTypeSemanticData in any child that may need the data, without getting any error.

    This is a special step in the type checking process, where the type semantics are evaluated before the actual type checking is done. This is useful for cases where children need parent data to be already evaluated, like for example inside a class when the class type is needed for checking the "this" keyword.

    We will call this "Ahead of time" type evaluation, as it is done before the actual proper type checking of the node, preceding any other type checking in the entire tree.

    Since

    0.12.0

    Returns

    Promise<void>

    Inherited from

    InterfaceMemberDeclaration.preliminaryTypeChecking

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:246


    preliminaryTypeCheckingChildren

    ▸ Protected preliminaryTypeCheckingChildren(): Promise<void>

    Runs preliminaryTypeChecking of all children nodes.

    Since

    0.12.0

    Returns

    Promise<void>

    Inherited from

    InterfaceMemberDeclaration.preliminaryTypeCheckingChildren

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:367


    primaryPreliminaryTypeChecking

    ▸ primaryPreliminaryTypeChecking(): Promise<void>

    Preliminary registers the class declaration type to allow for internal self-referential type checking.

    This is part of the "Ahead of time" type evaluation, which is done before the main type checking.

    Since

    0.12.0

    Returns

    Promise<void>

    Overrides

    InterfaceMemberDeclaration.primaryPreliminaryTypeChecking

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts:157


    primarySemanticAnalysis

    ▸ primarySemanticAnalysis(): Promise<void>

    Performs the semantic analysis for this Kipper token. This will log all warnings using programCtx.logger and throw errors if encountered.

    This will not run in case that this.hasFailed is true, as that indicates that the semantic analysis of the children has already failed and as such no parent node should run type checking.

    Returns

    Promise<void>

    Overrides

    InterfaceMemberDeclaration.primarySemanticAnalysis

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts:112


    recursivelyCheckForWarnings

    ▸ recursivelyCheckForWarnings(): Promise<void>

    Recursively checks for warnings by calling this function on all this.children children and calling checkForWarnings on this class as well.

    Since

    0.10.0

    Returns

    Promise<void>

    Inherited from

    InterfaceMemberDeclaration.recursivelyCheckForWarnings

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:327


    semanticAnalysis

    ▸ semanticAnalysis(): Promise<void>

    Semantically analyses the code inside this AST node and all this.children children nodes.

    This function will recursively call itself on the this.children instances and analyse the deepest children nodes first, working up as the tokens get more complex. This way the parent tokens can access the semantics of the children and properly process itself.

    This function will set the this.semanticData property and allow the use of this.getSemanticData, without getting any error.

    Since

    0.8.0

    Returns

    Promise<void>

    Inherited from

    InterfaceMemberDeclaration.semanticAnalysis

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:212


    semanticTypeChecking

    ▸ semanticTypeChecking(): Promise<void>

    Performs type checking on this AST node and all this.children children nodes. This uses the this.semanticData semantic data that was evaluated during this.semanticAnalysis semantic analysis.

    Since

    0.10.0

    Returns

    Promise<void>

    Inherited from

    InterfaceMemberDeclaration.semanticTypeChecking

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:269


    semanticallyAnalyseChildren

    ▸ Protected semanticallyAnalyseChildren(): Promise<void>

    Runs semanticAnalysis of all children nodes.

    Since

    0.10.0

    Returns

    Promise<void>

    Inherited from

    InterfaceMemberDeclaration.semanticallyAnalyseChildren

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:352


    semanticallyTypeCheckChildren

    ▸ Protected semanticallyTypeCheckChildren(): Promise<void>

    Runs semanticTypeChecking of all children nodes.

    Since

    0.10.0

    Returns

    Promise<void>

    Inherited from

    InterfaceMemberDeclaration.semanticallyTypeCheckChildren

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:382


    targetSemanticallyAnalyseChildren

    ▸ Protected targetSemanticallyAnalyseChildren(): Promise<void>

    Runs semanticTypeChecking of all children nodes.

    Since

    0.10.0

    Returns

    Promise<void>

    Inherited from

    InterfaceMemberDeclaration.targetSemanticallyAnalyseChildren

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:397


    translateCtxAndChildren

    ▸ translateCtxAndChildren(): Promise<TranslatedCodeLine[]>

    Generates the typescript code for this item, and all children (if they exist).

    Since

    0.8.0

    Returns

    Promise<TranslatedCodeLine[]>

    Inherited from

    InterfaceMemberDeclaration.translateCtxAndChildren

    Defined in

    kipper/core/src/compiler/ast/nodes/declarations/declaration.ts:136


    wrapUpSemanticAnalysis

    ▸ wrapUpSemanticAnalysis(): Promise<void>

    Wrap-up semantic analysis, which analyses this AST node and all this.children children nodes, and checks whether they are semantically valid for the this.target target language. This uses the this.semanticData semantic data and this.typeData type data that was evaluated during the previous this.semanticAnalysis semantic analysis and this.semanticTypeChecking type checking steps.

    Since

    0.10.0

    Returns

    Promise<void>

    Inherited from

    InterfaceMemberDeclaration.wrapUpSemanticAnalysis

    Defined in

    kipper/core/src/compiler/ast/analysable-ast-node.ts:301

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