From 3c365fc32be87e3726d84064f54827ac7d209251 Mon Sep 17 00:00:00 2001 From: Fabian Date: Fri, 12 Jul 2024 11:11:42 +0200 Subject: [PATCH] Merged origin/dev-next into 526-feature-add-full-object-support-and-translation-for-jsts-targets --- .../src/evaluated-kipper-config-file.ts | 2 +- kipper/core/KipperParser.g4 | 24 +- kipper/core/src/compiler/ast/ast-generator.ts | 867 ++--- .../core/src/compiler/ast/common/ast-types.ts | 13 +- .../compiler/ast/mapping/ast-node-mapper.ts | 20 +- .../ast/nodes/declarations/declaration.ts | 5 +- .../function-declaration.ts | 26 +- .../parameter-declaration.ts | 22 +- .../interface-declaration/index.ts | 1 + .../interface-declaration-semantics.ts | 8 + .../interface-declaration.ts | 38 +- .../interface-member-declaration/index.ts | 9 + .../interface-member-declaration-semantics.ts | 13 + ...rface-member-declaration-type-semantics.ts | 7 + .../interface-member-declaration.ts | 43 + .../interface-method-declaration/index.ts | 3 + .../interface-method-declaration-semantics.ts | 28 + ...rface-method-declaration-type-semantics.ts | 15 + .../interface-method-declaration.ts | 183 ++ .../interface-property-declaration/index.ts | 3 + ...nterface-property-declaration-semantics.ts | 27 + ...ace-property-declaration-type-semantics.ts | 15 + .../interface-property-declaration.ts | 156 + .../type-declaration-type-semantics.ts | 5 +- .../type-declaration/type-declaration.ts | 11 +- .../variable-declaration.ts | 22 +- .../assignment-expression.ts | 22 +- .../bitwise-and-expression.ts | 17 +- .../bitwise-or-expression.ts | 10 +- .../bitwise-shift-expression.ts | 9 +- .../bitwise-xor-expression.ts | 13 +- .../cast-or-convert-expression.ts | 15 +- .../equality-expression.ts | 15 +- .../relational-expression.ts | 15 +- .../conditional-expression.ts | 15 +- .../ast/nodes/expressions/expression.ts | 17 +- .../function-call-expression.ts | 15 +- .../lambda-expression/lambda-expression.ts | 39 +- .../logical-and-expression.ts | 16 +- .../logical-or-expression.ts | 16 +- .../member-access-expression.ts | 16 +- ...crement-or-decrement-postfix-expression.ts | 16 +- .../array-primary-expression.ts | 16 +- .../bool-primary-expression.ts | 16 +- .../fstring-primary-expression.ts | 16 +- .../identifier-primary-expression.ts | 16 +- .../number-primary-expression.ts | 16 +- .../object-primary-expression.ts | 9 +- .../object-property-semantics.ts | 7 +- .../object-property/object-property.ts | 38 +- .../tangled-primary-expression.ts | 16 +- ...or-null-or-undefined-primary-expression.ts | 16 +- .../generic-type-specifier-expression.ts | 16 +- .../identifier-type-specifier-expression.ts | 16 +- .../typeof-type-specifier-expression.ts | 16 +- ...increment-or-decrement-unary-expression.ts | 16 +- .../operator-modified-unary-expression.ts | 16 +- .../compound-statement/compound-statement.ts | 60 +- .../expression-statement.ts | 44 +- .../statements/if-statement/if-statement.ts | 42 +- .../do-while-loop-iteration-statement.ts | 42 +- .../for-loop-iteration-statement.ts | 43 +- .../while-loop-iteration-statement.ts | 42 +- .../jump-statement/jump-statement.ts | 42 +- .../return-statement/return-statement.ts | 23 +- .../switch-statement/switch-statement.ts | 23 +- .../lexer-parser/antlr/KipperLexer.ts | 9 - .../lexer-parser/antlr/KipperParser.interp | 7 +- .../lexer-parser/antlr/KipperParser.ts | 2907 +++++++---------- .../antlr/KipperParserListener.ts | 46 +- .../lexer-parser/antlr/KipperParserVisitor.ts | 30 +- .../lexer-parser/parse-rule-kind-mapping.ts | 4 +- .../target-presets/semantic-analyser.ts | 16 +- .../translation/code-generator.ts | 21 +- kipper/target-js/src/code-generator.ts | 29 +- kipper/target-js/src/semantic-analyser.ts | 25 +- kipper/target-ts/src/code-generator.ts | 79 +- test.kip | 4 - test/kipper-files/empty-interface.kip | 0 test/kipper-files/populated-interface.kip | 0 test/module/core/core-functionality.test.ts | 105 + .../errors/type-errors/lambda-expression.ts | 63 - test/module/core/pragma.test.ts | 31 - 83 files changed, 3146 insertions(+), 2669 deletions(-) create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/index.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-member-declaration-semantics.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-member-declaration-type-semantics.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-member-declaration.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/index.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration-semantics.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration-type-semantics.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration/index.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration/interface-property-declaration-semantics.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration/interface-property-declaration-type-semantics.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration/interface-property-declaration.ts delete mode 100644 test.kip create mode 100644 test/kipper-files/empty-interface.kip create mode 100644 test/kipper-files/populated-interface.kip delete mode 100644 test/module/core/errors/type-errors/lambda-expression.ts delete mode 100644 test/module/core/pragma.test.ts diff --git a/kipper/config/src/evaluated-kipper-config-file.ts b/kipper/config/src/evaluated-kipper-config-file.ts index f09c6093c..532ecf6c1 100644 --- a/kipper/config/src/evaluated-kipper-config-file.ts +++ b/kipper/config/src/evaluated-kipper-config-file.ts @@ -1,4 +1,4 @@ -import { EvaluatedConfigValue } from "./abstract"; +import type { EvaluatedConfigValue } from "./abstract"; import type { EvaluatedConfigFile } from "./abstract"; import type * as semver from "semver"; import type { CompileConfig, KipperCompileTarget } from "@kipper/core"; diff --git a/kipper/core/KipperParser.g4 b/kipper/core/KipperParser.g4 index 2588eb8f7..44c61d930 100644 --- a/kipper/core/KipperParser.g4 +++ b/kipper/core/KipperParser.g4 @@ -85,11 +85,25 @@ parameterDeclaration ; interfaceDeclaration - : 'interface' Identifier '{' '}' - ; + : 'interface' declarator '{' interfaceMemberDeclaration* '}' + ; + +interfaceMemberDeclaration + : interfacePropertyDeclaration + | interfaceMethodDeclaration + ; + +interfacePropertyDeclaration + : declarator ':' typeSpecifierExpression SemiColon + ; + +interfaceMethodDeclaration + : declarator '(' parameterList? ')' ':' typeSpecifierExpression SemiColon + ; + classDeclaration - : 'class' Identifier '{' '}' + : 'class' declarator '{' '}' ; // -- Statements @@ -163,6 +177,7 @@ returnStatement primaryExpression // Primary expressions, which build up the rest of the more complex expressions : tangledPrimaryExpression + | lambdaPrimaryExpression | arrayPrimaryExpression | objectPrimaryExpression | boolPrimaryExpression @@ -171,10 +186,9 @@ primaryExpression // Primary expressions, which build up the rest of the more co | fStringPrimaryExpression | numberPrimaryExpression | voidOrNullOrUndefinedPrimaryExpression - | lambdaExpression ; -lambdaExpression +lambdaPrimaryExpression : '(' parameterList? ')' ':' typeSpecifierExpression '->' (expression | compoundStatement) ; diff --git a/kipper/core/src/compiler/ast/ast-generator.ts b/kipper/core/src/compiler/ast/ast-generator.ts index 7e6894834..ffdca57e9 100644 --- a/kipper/core/src/compiler/ast/ast-generator.ts +++ b/kipper/core/src/compiler/ast/ast-generator.ts @@ -29,6 +29,7 @@ import type { ArrayPrimaryExpressionContext, BoolPrimaryExpressionContext, BracketNotationMemberAccessExpressionContext, + ClassDeclarationContext, CompilationUnitContext, CompoundStatementContext, DeclarationContext, @@ -52,10 +53,13 @@ import type { IncrementOrDecrementUnaryExpressionContext, InitDeclaratorContext, InitializerContext, + InterfaceDeclarationContext, + InterfaceMethodDeclarationContext, + InterfacePropertyDeclarationContext, JumpStatementContext, KipperParserListener, KipperParserRuleContext, - LambdaExpressionContext, + LambdaPrimaryExpressionContext, LogicalAndExpressionContext, NumberPrimaryExpressionContext, ObjectPrimaryExpressionContext, @@ -76,6 +80,7 @@ import type { VariableDeclarationContext, VoidOrNullOrUndefinedPrimaryExpressionContext, WhileLoopIterationStatementContext, + InterfaceMemberDeclarationContext, } from "../lexer-parser"; import type { KipperProgramContext } from "../program-ctx"; import type { CompilableASTNode } from "./compilable-ast-node"; @@ -90,112 +95,317 @@ import { KipperInternalError } from "../../errors"; * @since 0.10.0 */ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeListener { + private readonly _rootNode: RootASTNode; + private readonly _expressionFactory: ExpressionASTNodeFactory; + private readonly _statementFactory: StatementASTNodeFactory; + private readonly _declarationFactory: DeclarationASTNodeFactory; + + /** + * The current Kipper AST node that is being walked through right now. This is the instance where current metadata + * should be added to and read from, as this instance will represent and handle the context rules that were walked + * through during this operation. + */ + private _currentPrimaryNode: Declaration | Statement | Expression | undefined; + + constructor(programCtx: KipperProgramContext, rootNode: CompilationUnitContext) { + this._rootNode = new RootASTNode(programCtx, rootNode); + this._currentPrimaryNode = undefined; + this._expressionFactory = new ExpressionASTNodeFactory(); + this._statementFactory = new StatementASTNodeFactory(); + this._declarationFactory = new DeclarationASTNodeFactory(); + } + + /** + * The root node of the generated abstract syntax tree. + * @since 0.8.0 + */ + public get rootNode(): RootASTNode { + return this._rootNode; + } + + /** + * Returns the {@link KipperProgramContext program context} that owns this listener and the root node. + * @since 0.10.0 + */ + public get programCtx(): KipperProgramContext { + return this._rootNode.programCtx; + } + + /** + * Returns the {@link ExpressionASTNodeFactory expression factory} that is used to create new expression nodes + * based on the current Antlr4 context that is being walked through. + * @since 0.10.0 + */ + public get expressionFactory(): ExpressionASTNodeFactory { + return this._expressionFactory; + } + + /** + * Returns the {@link StatementASTNodeFactory statement factory} that is used to create new statement nodes based on + * the current Antlr4 context that is being walked through. + * @since 0.10.0 + */ + public get statementFactory(): StatementASTNodeFactory { + return this._statementFactory; + } + + /** + * Returns the {@link DeclarationASTNodeFactory declaration factory} that is used to create new declaration nodes + * based on the current Antlr4 context that is being walked through. + */ + public get declarationFactory(): DeclarationASTNodeFactory { + return this._declarationFactory; + } + + private isStatementContext(ctx: ASTNodeParserContext): boolean { + return this.statementFactory.ruleIds.includes(ctx.astSyntaxKind); + } + + private isDeclarationContext(ctx: ASTNodeParserContext): boolean { + return this.declarationFactory.ruleIds.includes(ctx.astSyntaxKind); + } + + private isExpressionContext(ctx: ASTNodeParserContext): boolean { + return this.expressionFactory.ruleIds.includes(ctx.astSyntaxKind); + } + + /** + * Returns which token is being processed at the moment and where meta-data should be assigned to. + * @private + */ + private get currentNode(): CompilableASTNode | RootASTNode { + if (this._currentPrimaryNode) { + return this._currentPrimaryNode; + } else { + return this.rootNode; + } + } + + /** + * Handles an incoming statement context. The handling algorithm is as following: + * - If {@link _currentPrimaryNode} is undefined, then it will be created and set as a child of + * {@link _rootNode} + * - Otherwise, generate a new {@link Statement} instance, which will be added to the {@link _currentPrimaryNode} as + * a child. Afterwards {@link _currentPrimaryNode} will be set to this new instance, as all new context instances + * must be assigned to it. When the context is left, then the old {@link _currentPrimaryNode} will be restored as + * {@link _currentPrimaryNode}, and all further context instances will be assigned to it. + * @private + */ + private handleEnteringTreeNode(ctx: ASTNodeParserContext) { + if (this.isStatementContext(ctx)) { + this._currentPrimaryNode = this.statementFactory.create(ctx, this.currentNode); + } else if (this.isDeclarationContext(ctx)) { + this._currentPrimaryNode = this.declarationFactory.create(ctx, this.currentNode); + } else if (this.isExpressionContext(ctx)) { + /* istanbul ignore if: internal errors should rarely happen if ever, and only in very very bad situations */ + if (this.currentNode instanceof RootASTNode) { + throw new KipperInternalError( + "An expression may not have the root file token as a parent. It must be child to a statement or a" + + " definition.", + ); + } + this._currentPrimaryNode = this.expressionFactory.create(ctx, this.currentNode); + } else { + throw new KipperInternalError(`The context '${ctx.astSyntaxKind}' is not supported by any of the factories.`); + } + + this.programCtx.logger.debug( + `Created AST node of type '${this.currentNode.constructor.name}' for context '${ctx.astSyntaxKind}'` + + `(Loc: ${ctx.start.line}:${ctx.start.charPositionInLine})`, + ); + } + + /** + * Handles an exiting node context. This is required to properly generate the AST node hierarchy. + * @private + */ + private handleExitingTreeNode() { + const parent = this._currentPrimaryNode?.parent; + if (parent instanceof Declaration || parent instanceof Statement || parent instanceof Expression) { + this._currentPrimaryNode = parent; + } else { + this._currentPrimaryNode = undefined; + } + } + + /** + * Function that is called every time an item is entered. + * @param ctx The context of the rule. + */ + public enterEveryRule?(/*@NotNull*/ ctx: ParserRuleContext | KipperParserRuleContext): void; + + /** + * Function that is called every time an item is exited. + * @param ctx The context of the rule. + */ + public exitEveryRule?(/*@NotNull*/ ctx: ParserRuleContext | KipperParserRuleContext): void; + + // ------------------------------------------------------------------------------------------------------------------- + // Root Item section + // ------------------------------------------------------------------------------------------------------------------- + + /** + * Enter a parse tree produced by the `externalItem`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + */ + public enterExternalItem?: (ctx: ExternalItemContext) => void = undefined; + + /** + * Exit a parse tree produced by the `externalItem`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + */ + public exitExternalItem?: (ctx: ExternalItemContext) => void = undefined; + + // ------------------------------------------------------------------------------------------------------------------- + // Expression section + // ------------------------------------------------------------------------------------------------------------------- + /** * Enter a parse tree produced by `KipperParser.identifierPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterIdentifierPrimaryExpression: (ctx: IdentifierPrimaryExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.identifierPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitIdentifierPrimaryExpression: (ctx: IdentifierPrimaryExpressionContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by `KipperParser.stringPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterStringPrimaryExpression: (ctx: StringPrimaryExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.stringPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitStringPrimaryExpression: (ctx: StringPrimaryExpressionContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by `KipperParser.fStringPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterFStringPrimaryExpression: (ctx: FStringPrimaryExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.fStringPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitFStringPrimaryExpression: (ctx: FStringPrimaryExpressionContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by `KipperParser.tangledPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterTangledPrimaryExpression: (ctx: TangledPrimaryExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.tangledPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitTangledPrimaryExpression: (ctx: TangledPrimaryExpressionContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by `KipperParser.numberPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterNumberPrimaryExpression: (ctx: NumberPrimaryExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.numberPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitNumberPrimaryExpression: (ctx: NumberPrimaryExpressionContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by `KipperParser.arrayPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterArrayPrimaryExpression: (ctx: ArrayPrimaryExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.arrayPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitArrayPrimaryExpression: (ctx: ArrayPrimaryExpressionContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by `KipperParser.objectPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterObjectPrimaryExpression: (ctx: ObjectPrimaryExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.objectPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitObjectPrimaryExpression: (ctx: ObjectPrimaryExpressionContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by `KipperParser.objectProperty`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). * @since 0.11.0 */ public enterObjectProperty: (ctx: ObjectPropertyContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.objectProperty`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). * @since 0.11.0 */ public exitObjectProperty: (ctx: ObjectPropertyContext) => void = this.handleExitingTreeNode; + + /** + * Enter a parse tree produced by the `actualBitwiseShiftExpression + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + */ + public enterLambdaPrimaryExpression: (ctx: LambdaPrimaryExpressionContext) => void = this.handleEnteringTreeNode; + + /** + * Exit a parse tree produced by the `actualBitwiseShiftExpression + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + */ + public exitLambdaPrimaryExpression: (ctx: LambdaPrimaryExpressionContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by `KipperParser.boolPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterBoolPrimaryExpression: (ctx: BoolPrimaryExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.boolPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitBoolPrimaryExpression: (ctx: BoolPrimaryExpressionContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by `KipperParser.voidOrNullOrUndefinedPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterVoidOrNullOrUndefinedPrimaryExpression: (ctx: VoidOrNullOrUndefinedPrimaryExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.voidOrNullOrUndefinedPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitVoidOrNullOrUndefinedPrimaryExpression: (ctx: VoidOrNullOrUndefinedPrimaryExpressionContext) => void = this.handleExitingTreeNode; + + // NOTE: + // We are ignoring the 'computedPrimaryExpression' rule, and only going to handle the rules + // 'functionCallExpression' and 'memberAccessExpression' as they are the only ones which implements a more precise + // 'computedPrimaryExpression' rule. + // + // This is to simplify the walking process, without having to check if the expression is actually used every time + // an expression is called. + /** * Enter a parse tree produced by the `dotNotationMemberAccessExpression` * Labeled alternative in `KipperParser.computedPrimaryExpression`. @@ -204,9 +414,6 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi public enterDotNotationMemberAccessExpression: (ctx: DotNotationMemberAccessExpressionContext) => void = this.handleEnteringTreeNode; - // ------------------------------------------------------------------------------------------------------------------- - // Root Item section - // ------------------------------------------------------------------------------------------------------------------- /** * Exit a parse tree produced by the `dotNotationMemberAccessExpression` * Labeled alternative in `KipperParser.computedPrimaryExpression`. @@ -214,6 +421,7 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi */ public exitDotNotationMemberAccessExpression: (ctx: DotNotationMemberAccessExpressionContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by the `bracketNotationMemberAccessExpression` * Labeled alternative in `KipperParser.computedPrimaryExpression`. @@ -222,9 +430,6 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi public enterBracketNotationMemberAccessExpression: (ctx: BracketNotationMemberAccessExpressionContext) => void = this.handleEnteringTreeNode; - // ------------------------------------------------------------------------------------------------------------------- - // Expression section - // ------------------------------------------------------------------------------------------------------------------- /** * Exit a parse tree produced by the `bracketNotationMemberAccessExpression` * Labeled alternative in `KipperParser.computedPrimaryExpression`. @@ -232,6 +437,7 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi */ public exitBracketNotationMemberAccessExpression: (ctx: BracketNotationMemberAccessExpressionContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by the `sliceNotationMemberAccessExpression` * Labeled alternative in `KipperParser.computedPrimaryExpression`. @@ -239,6 +445,7 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi */ public enterSliceNotationMemberAccessExpression: (ctx: SliceNotationMemberAccessExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by the `sliceNotationMemberAccessExpression` * Labeled alternative in `KipperParser.computedPrimaryExpression`. @@ -246,18 +453,21 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi */ public exitSliceNotationMemberAccessExpression: (ctx: SliceNotationMemberAccessExpressionContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by the `functionCallExpression` * Labeled alternative in `KipperParser.computedPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}).. */ public enterFunctionCallExpression: (ctx: FunctionCallExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by the `functionCallExpression` * Labeled alternative in `KipperParser.computedPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}).. */ public exitFunctionCallExpression: (ctx: FunctionCallExpressionContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by the `explicitCallFunctionCallExpression` * Labeled alternative in `KipperParser.computedPrimaryExpression`. @@ -265,6 +475,7 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi */ public enterExplicitCallFunctionCallExpression: (ctx: ExplicitCallFunctionCallExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by the `explicitCallFunctionCallExpression` * Labeled alternative in `KipperParser.computedPrimaryExpression`. @@ -272,42 +483,71 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi */ public exitExplicitCallFunctionCallExpression: (ctx: ExplicitCallFunctionCallExpressionContext) => void = this.handleExitingTreeNode; + + // NOTE: + // We are ignoring the 'postfixExpression' rule, and only going to handle the rule + // 'incrementOrDecrementPostfixExpression', which implements a more precise 'postfixExpression' rule. + // + // This is to simplify the walking process, without having to check if the expression is actually used every time + // an expression is called. + /** * Enter a parse tree produced by `KipperParser.incrementOrDecrementPostfixExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterIncrementOrDecrementPostfixExpression: (ctx: IncrementOrDecrementPostfixExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.incrementOrDecrementPostfixExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitIncrementOrDecrementPostfixExpression: (ctx: IncrementOrDecrementPostfixExpressionContext) => void = this.handleExitingTreeNode; + + // NOTE: + // We are ignoring the 'unaryExpression' rule, and only going to handle the rules + // 'incrementOrDecrementUnaryExpression' and 'operatorModifiedUnaryExpression', which implement a more precise + // 'unaryExpression' rule. + // + // This is to simplify the walking process, without having to check if the expression is actually used every time + // an expression is called. + /** * Enter a parse tree produced by `KipperParser.incrementOrDecrementUnaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterIncrementOrDecrementUnaryExpression: (ctx: IncrementOrDecrementUnaryExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.incrementOrDecrementUnaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitIncrementOrDecrementUnaryExpression: (ctx: IncrementOrDecrementUnaryExpressionContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by `KipperParser.operatorModifiedUnaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterOperatorModifiedUnaryExpression: (ctx: OperatorModifiedUnaryExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.operatorModifiedUnaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitOperatorModifiedUnaryExpression: (ctx: OperatorModifiedUnaryExpressionContext) => void = this.handleExitingTreeNode; + + // NOTE: + // We are ignoring the 'castOrConvertExpression' rule, and only going to handle the rule + // 'actualCastOrConvertExpression', which implements a more precise 'castOrConvertExpression' rule. + // + // This is to simplify the walking process, without having to check if the expression is actually used every time + // an expression is called. + /** * Enter a parse tree produced by the `actualCastOrConvertExpression` * labeled alternative in `KipperParser.castOrConvertExpression`. @@ -315,6 +555,7 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi */ public enterActualCastOrConvertExpression: (ctx: ActualCastOrConvertExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by the `actualCastOrConvertExpression` * labeled alternative in `KipperParser.castOrConvertExpression`. @@ -322,6 +563,14 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi */ public exitActualCastOrConvertExpression: (ctx: ActualCastOrConvertExpressionContext) => void = this.handleExitingTreeNode; + + // NOTE: + // We are ignoring the 'multiplicativeExpression' rule, and only going to handle the rule + // 'actualMultiplicativeExpression', which implements a more precise 'multiplicativeExpression' rule. + // + // This is to simplify the walking process, without having to check if the expression is actually used every time + // an expression is called. + /** * Enter a parse tree produced by the `actualMultiplicativeExpression` * Labeled alternative in `KipperParser.multiplicativeExpression`. @@ -329,6 +578,7 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi */ public enterActualMultiplicativeExpression: (ctx: ActualMultiplicativeExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by the `actualMultiplicativeExpression` * Labeled alternative in `KipperParser.multiplicativeExpression`. @@ -336,18 +586,35 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi */ public exitActualMultiplicativeExpression: (ctx: ActualMultiplicativeExpressionContext) => void = this.handleExitingTreeNode; - /** - * Enter a parse tree produced by the `actualAdditiveExpression` - * labeled alternative in `KipperParser.additiveExpression`. - * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). - */ - public enterActualAdditiveExpression: (ctx: ActualAdditiveExpressionContext) => void = this.handleEnteringTreeNode; - /** + + // NOTE: + // We are ignoring the 'additiveExpression' rule, and only going to handle the rule 'actualAdditiveExpression', + // which implements a more precise 'additiveExpression' rule. + // + // This is to simplify the walking process, without having to check if the expression is actually used every time + // an expression is called. + + /** + * Enter a parse tree produced by the `actualAdditiveExpression` + * labeled alternative in `KipperParser.additiveExpression`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + */ + public enterActualAdditiveExpression: (ctx: ActualAdditiveExpressionContext) => void = this.handleEnteringTreeNode; + + /** * Exit a parse tree produced by the `actualAdditiveExpression` * labeled alternative in `KipperParser.additiveExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitActualAdditiveExpression: (ctx: ActualAdditiveExpressionContext) => void = this.handleExitingTreeNode; + + // NOTE: + // We are ignoring the 'relationalExpression' rule, and only going to handle the rule + // 'actualRelationalExpression', which implements a more precise 'relationalExpression' rule. + // + // This is to simplify the walking process, without having to check if the expression is actually used every time an + // expression is called. + /** * Enter a parse tree produced by the `actualRelationalExpression` * labeled alternative in `KipperParser.relationalExpression`. @@ -356,39 +623,67 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi public enterActualRelationalExpression: (ctx: ActualRelationalExpressionContext) => void = this.handleEnteringTreeNode; - // NOTE: - // We are ignoring the 'computedPrimaryExpression' rule, and only going to handle the rules - // 'functionCallExpression' and 'memberAccessExpression' as they are the only ones which implements a more precise - // 'computedPrimaryExpression' rule. - // - // This is to simplify the walking process, without having to check if the expression is actually used every time - // an expression is called. /** * Exit a parse tree produced by the `actualRelationalExpression` * labeled alternative in `KipperParser.relationalExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitActualRelationalExpression: (ctx: ActualRelationalExpressionContext) => void = this.handleExitingTreeNode; + + // NOTE: + // We are ignoring the 'equalityExpression' rule, and only going to handle the rule 'actualEqualityExpression', + // which implements a more precise 'equalityExpression' rule. + // + // This is to simplify the walking process, without having to check if the expression is actually used every time an + // expression is called. + /** * Enter a parse tree produced by the `actualEqualityExpression` * labeled alternative in `KipperParser.equalityExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterActualEqualityExpression: (ctx: ActualEqualityExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by the `actualEqualityExpression` * labeled alternative in `KipperParser.equalityExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitActualEqualityExpression: (ctx: ActualEqualityExpressionContext) => void = this.handleExitingTreeNode; + + // NOTE: + // We are ignoring logical and expressions, and only going to handle the rules 'passOnLogicalAndExpression', + // and 'actualLogicalAndExpression', which implement a more precise 'logicalAndExpression' rule. + // + // This is to simplify the walking process, without having to check if the expression is actually used every time an + // expression is called. + /** - * Enter a parse tree produced by the `actualBitwiseShiftExpression` + * Enter a parse tree produced by `KipperParser.logicalAndExpression`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + */ + public enterLogicalAndExpression?(ctx: LogicalAndExpressionContext): void; // Unspecific parent -> skip + + /** + * Exit a parse tree produced by `KipperParser.logicalAndExpression`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ - public enterLambdaExpression: (ctx: LambdaExpressionContext) => void = this.handleEnteringTreeNode; + public exitLogicalAndExpression?(ctx: LogicalAndExpressionContext): void; // Unspecific parent -> skip + + /** + * Enter a parse tree produced by the `passOnLogicalAndExpression` + * Labeled alternative in `KipperParser.logicalAndExpression`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + */ + public enterPassOnLogicalAndExpression?(ctx: PassOnLogicalAndExpressionContext): void; // Pass-on -> skip + /** - * Exit a parse tree produced by the `actualBitwiseShiftExpression` + * Exit a parse tree produced by the `passOnLogicalAndExpression` + * Labeled alternative in `KipperParser.logicalAndExpression`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ - public exitLambdaExpression: (ctx: LambdaExpressionContext) => void = this.handleExitingTreeNode; + public exitPassOnLogicalAndExpression?(ctx: PassOnLogicalAndExpressionContext): void; // Pass-on -> skip + /** * Enter a parse tree produced by the `actualLogicalAndExpression` * Labeled alternative in `KipperParser.logicalAndExpression`. @@ -396,82 +691,90 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi */ public enterActualLogicalAndExpression: (ctx: ActualLogicalAndExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by the `actualLogicalAndExpression` * Labeled alternative in `KipperParser.logicalAndExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitActualLogicalAndExpression: (ctx: ActualLogicalAndExpressionContext) => void = this.handleExitingTreeNode; + + // NOTE: + // We are ignoring the 'logicalOrExpression' rule, and only going to handle the rule 'actualLogicalOrExpression', + // which implements a more precise 'logicalOrExpression' rule. + // + // This is to simplify the walking process, without having to check if the expression is actually used every time an + // expression is called. + /** * Enter a parse tree produced by the `actualLogicalOrExpression` * Labeled alternative in `KipperParser.logicalOrExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterActualLogicalOrExpression: (ctx: ActualLogicalOrExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by the `actualLogicalOrExpression` * Labeled alternative in `KipperParser.logicalOrExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitActualLogicalOrExpression: (ctx: ActualLogicalOrExpressionContext) => void = this.handleExitingTreeNode; + + // NOTE: + // We are ignoring the 'bitwiseOrExpression' rule, and only going to handle the rule 'actualBitwiseOrExpression', + // which implements a more precise 'bitwiseOrExpression' rule. + /** * Enter a parse tree produced by the KipperParser.bitwiseOrExpression */ public enterActualBitwiseOrExpression: (ctx: ActualBitwiseOrExpressionContext) => void = this.handleEnteringTreeNode; - // NOTE: - // We are ignoring the 'postfixExpression' rule, and only going to handle the rule - // 'incrementOrDecrementPostfixExpression', which implements a more precise 'postfixExpression' rule. - // - // This is to simplify the walking process, without having to check if the expression is actually used every time - // an expression is called. /** * Exit a parse tree produced by the KipperParser.bitwiseOrExpression */ public exitActualBitwiseOrExpression: (ctx: ActualBitwiseOrExpressionContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by the KipperParser.bitwiseAndExpression */ public enterActualBitwiseAndExpression: (ctx: ActualBitwiseAndExpressionContext) => void = this.handleEnteringTreeNode; - // NOTE: - // We are ignoring the 'unaryExpression' rule, and only going to handle the rules - // 'incrementOrDecrementUnaryExpression' and 'operatorModifiedUnaryExpression', which implement a more precise - // 'unaryExpression' rule. - // - // This is to simplify the walking process, without having to check if the expression is actually used every time - // an expression is called. /** * Exit a parse tree produced by the KipperParser.bitwiseAndExpression */ public exitActualBitwiseAndExpression: (ctx: ActualBitwiseAndExpressionContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by the KipperParser.bitwiseXorExpression */ public enterActualBitwiseXorExpression: (ctx: ActualBitwiseXorExpressionContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by the KipperParser.bitwiseXorExpression */ public exitActualBitwiseXorExpression: (ctx: ActualBitwiseXorExpressionContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by the KipperParser.bitwiseShiftExpression */ public enterActualBitwiseShiftExpression: (ctx: ActualBitwiseShiftExpressionContext) => void = this.handleEnteringTreeNode; - // NOTE: - // We are ignoring the 'castOrConvertExpression' rule, and only going to handle the rule - // 'actualCastOrConvertExpression', which implements a more precise 'castOrConvertExpression' rule. - // - // This is to simplify the walking process, without having to check if the expression is actually used every time - // an expression is called. /** * Exit a parse tree produced by the KipperParser.bitwiseShiftExpression */ public exitActualBitwiseShiftExpression: (ctx: ActualBitwiseShiftExpressionContext) => void = this.handleExitingTreeNode; + + // NOTE: + // We are ignoring the 'conditionalExpression' rule, and only going to handle the rule + // 'actualConditionalExpression', which implements a more precise 'conditionalExpression' rule. + // + // This is to simplify the walking process, without having to check if the expression is actually used every time an + // expression is called. + /** * Enter a parse tree produced by the `actualConditionalExpression` * Labeled alternative in `KipperParser.conditionalExpression`. @@ -480,12 +783,6 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi public enterActualConditionalExpression: (ctx: ActualConditionalExpressionContext) => void = this.handleEnteringTreeNode; - // NOTE: - // We are ignoring the 'multiplicativeExpression' rule, and only going to handle the rule - // 'actualMultiplicativeExpression', which implements a more precise 'multiplicativeExpression' rule. - // - // This is to simplify the walking process, without having to check if the expression is actually used every time - // an expression is called. /** * Exit a parse tree produced by the `actualConditionalExpression` * Labeled alternative in `KipperParser.conditionalExpression`. @@ -493,6 +790,14 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi */ public exitActualConditionalExpression: (ctx: ActualConditionalExpressionContext) => void = this.handleExitingTreeNode; + + // NOTE: + // We are ignoring the 'assignmentExpression' rule, and only going to handle the rule + // 'actualAssignmentExpression', which implements a more precise 'assignmentExpression' rule. + // + // This is to simplify the walking process, without having to check if the expression is actually used every time an + // expression is called. + /** * Enter a parse tree produced by the `actualAssignmentExpression` * Labeled alternative in `KipperParser.assignmentExpression`. @@ -501,64 +806,84 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi public enterActualAssignmentExpression: (ctx: ActualAssignmentExpressionContext) => void = this.handleEnteringTreeNode; - // NOTE: - // We are ignoring the 'additiveExpression' rule, and only going to handle the rule 'actualAdditiveExpression', - // which implements a more precise 'additiveExpression' rule. - // - // This is to simplify the walking process, without having to check if the expression is actually used every time - // an expression is called. /** * Exit a parse tree produced by the `actualAssignmentExpression` * Labeled alternative in `KipperParser.assignmentExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitActualAssignmentExpression: (ctx: ActualAssignmentExpressionContext) => void = this.handleExitingTreeNode; + + // -- NOTE: We are ignoring standard expressions, as the children rules will handle everything. -- + /** - * Enter a parse tree produced by `KipperParser.expressionStatement`. + * Enter a parse tree produced by `KipperParser.expression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ - public enterExpressionStatement: (ctx: ExpressionStatementContext) => void = this.handleEnteringTreeNode; + public enterExpression?(ctx: ExpressionContext): void; + + /** + * Exit a parse tree produced by `KipperParser.expression`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + */ + public exitExpression?(ctx: ExpressionContext): void; + // ------------------------------------------------------------------------------------------------------------------- + // Statement section + // ------------------------------------------------------------------------------------------------------------------- + // // NOTE: - // We are ignoring the 'relationalExpression' rule, and only going to handle the rule - // 'actualRelationalExpression', which implements a more precise 'relationalExpression' rule. + // We are ignoring the 'statement' rule, and only going to handle the rules 'expressionStatement', 'labeledStatement' + // 'selectionStatement', 'iterationStatement' (do-while, while and loop), 'jumpStatement' and 'compoundStatement', + // which implement a more precise 'statement' rule. // // This is to simplify the walking process, without having to check if the expression is actually used every time an // expression is called. + + /** + * Enter a parse tree produced by `KipperParser.expressionStatement`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + */ + public enterExpressionStatement: (ctx: ExpressionStatementContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.expressionStatement`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitExpressionStatement: (ctx: ExpressionStatementContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by `KipperParser.compoundStatement`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterCompoundStatement: (ctx: CompoundStatementContext) => void = this.handleEnteringTreeNode; - // NOTE: - // We are ignoring the 'equalityExpression' rule, and only going to handle the rule 'actualEqualityExpression', - // which implements a more precise 'equalityExpression' rule. - // - // This is to simplify the walking process, without having to check if the expression is actually used every time an - // expression is called. /** * Exit a parse tree produced by `KipperParser.compoundStatement`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitCompoundStatement: (ctx: CompoundStatementContext) => void = this.handleExitingTreeNode; + + // NOTE: + // We are ignoring the 'selectionStatement' rule, and only going to handle the rules 'ifStatement' and + // 'switchStatement', which implement a more precise 'selectionStatement' rule. + // + // This is to simplify the walking process, without having to check if the expression is actually used every time an + // expression is called. + /** * Enter a parse tree produced by the `ifStatement` * labeled alternative in `KipperParser.selectionStatement`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterIfStatement: (ctx: IfStatementContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by the `ifStatement` * labeled alternative in `KipperParser.selectionStatement`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitIfStatement: (ctx: IfStatementContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by the `switchStatement` * labeled alternative in `KipperParser.selectionStatement`. @@ -566,40 +891,63 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi */ public enterSwitchStatement: (ctx: SwitchStatementContext) => void = this.handleEnteringTreeNode; - // NOTE: - // We are ignoring logical and expressions, and only going to handle the rules 'passOnLogicalAndExpression', - // and 'actualLogicalAndExpression', which implement a more precise 'logicalAndExpression' rule. - // - // This is to simplify the walking process, without having to check if the expression is actually used every time an - // expression is called. /** * Exit a parse tree produced by the `switchStatement` * labeled alternative in `KipperParser.selectionStatement`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitSwitchStatement: (ctx: SwitchStatementContext) => void = this.handleExitingTreeNode; + + /** + * Enter a parse tree produced by `KipperParser.labeledStatement`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + */ + public enterSwitchLabeledStatement(ctx: SwitchLabeledStatementContext): void { + // TODO! Implement switch statements + } + + /** + * Exit a parse tree produced by `KipperParser.labeledStatement`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + */ + public exitSwitchLabeledStatement(ctx: SwitchLabeledStatementContext): void { + // TODO! Implement switch statements + } + + // NOTE: + // We are ignoring the 'iterationStatement' rule, and only going to handle the rules 'forLoopIterationStatement', + // 'whileLoopIterationStatement' and 'doWhileLoopIterationStatement', which implement a more precise + // 'iterationStatement' rule. + // + // This is to simplify the walking process, without having to check if the expression is actually used every time an + // expression is called. + /** * Enter a parse tree produced by `KipperParser.forLoopIterationStatement`. * @param ctx the parse tree */ public enterForLoopIterationStatement: (ctx: ForLoopIterationStatementContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.forLoopIterationStatement`. * @param ctx the parse tree */ public exitForLoopIterationStatement: (ctx: ForLoopIterationStatementContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by `KipperParser.whileLoopIterationStatement`. * @param ctx the parse tree */ public enterWhileLoopIterationStatement: (ctx: WhileLoopIterationStatementContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.whileLoopIterationStatement`. * @param ctx the parse tree */ public exitWhileLoopIterationStatement: (ctx: WhileLoopIterationStatementContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by `KipperParser.doWhileLoopIterationStatement`. * @param ctx the parse tree @@ -607,363 +955,211 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi public enterDoWhileLoopIterationStatement: (ctx: DoWhileLoopIterationStatementContext) => void = this.handleEnteringTreeNode; - // NOTE: - // We are ignoring the 'logicalOrExpression' rule, and only going to handle the rule 'actualLogicalOrExpression', - // which implements a more precise 'logicalOrExpression' rule. - // - // This is to simplify the walking process, without having to check if the expression is actually used every time an - // expression is called. /** * Exit a parse tree produced by `KipperParser.doWhileLoopIterationStatement`. * @param ctx the parse tree */ public exitDoWhileLoopIterationStatement: (ctx: DoWhileLoopIterationStatementContext) => void = this.handleExitingTreeNode; + + // -- Special statements + /** * Enter a parse tree produced by `KipperParser.returnStatement`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterReturnStatement: (ctx: ReturnStatementContext) => void = this.handleEnteringTreeNode; - // NOTE: - // We are ignoring the 'bitwiseOrExpression' rule, and only going to handle the rule 'actualBitwiseOrExpression', - // which implements a more precise 'bitwiseOrExpression' rule. /** * Exit a parse tree produced by `KipperParser.returnStatement`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitReturnStatement: (ctx: ReturnStatementContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by `KipperParser.jumpStatement`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterJumpStatement: (ctx: JumpStatementContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.jumpStatement`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitJumpStatement: (ctx: JumpStatementContext) => void = this.handleExitingTreeNode; + + // ------------------------------------------------------------------------------------------------------------------- + // Declaration section + // ------------------------------------------------------------------------------------------------------------------- + + /** + * Enter a parse tree produced by `KipperParser.declaration`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + */ + public enterDeclaration?(ctx: DeclarationContext): void; + + /** + * Exit a parse tree produced by `KipperParser.declaration`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + */ + public exitDeclaration?(ctx: DeclarationContext): void; + /** * Enter a parse tree produced by `KipperParser.variableDeclaration`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterVariableDeclaration: (ctx: VariableDeclarationContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.variableDeclaration`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitVariableDeclaration: (ctx: VariableDeclarationContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by `KipperParser.functionDefinition`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterFunctionDeclaration: (ctx: FunctionDeclarationContext) => void = this.handleEnteringTreeNode; + /** * Exit a parse tree produced by `KipperParser.functionDefinition`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitFunctionDeclaration: (ctx: FunctionDeclarationContext) => void = this.handleExitingTreeNode; + /** * Enter a parse tree produced by `KipperParser.parameterDeclaration`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterParameterDeclaration: (ctx: ParameterDeclarationContext) => void = this.handleEnteringTreeNode; - // NOTE: - // We are ignoring the 'conditionalExpression' rule, and only going to handle the rule - // 'actualConditionalExpression', which implements a more precise 'conditionalExpression' rule. - // - // This is to simplify the walking process, without having to check if the expression is actually used every time an - // expression is called. /** * Exit a parse tree produced by `KipperParser.parameterDeclaration`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitParameterDeclaration: (ctx: ParameterDeclarationContext) => void = this.handleExitingTreeNode; - /** - * Enter a parse tree produced by `KipperParser.identifierTypeSpecifier`. - * @param ctx the parse tree - */ - public enterIdentifierTypeSpecifierExpression: (ctx: IdentifierTypeSpecifierExpressionContext) => void = - this.handleEnteringTreeNode; - // NOTE: - // We are ignoring the 'assignmentExpression' rule, and only going to handle the rule - // 'actualAssignmentExpression', which implements a more precise 'assignmentExpression' rule. - // - // This is to simplify the walking process, without having to check if the expression is actually used every time an - // expression is called. - /** - * Exit a parse tree produced by `KipperParser.identifierTypeSpecifier`. - * @param ctx the parse tree - */ - public exitIdentifierTypeSpecifierExpression: (ctx: IdentifierTypeSpecifierExpressionContext) => void = - this.handleExitingTreeNode; /** - * Enter a parse tree produced by `KipperParser.genericTypeSpecifier`. - * @param ctx the parse tree + * Enter a parse tree produced by `KipperParser.interfaceDeclaration`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ - public enterGenericTypeSpecifierExpression: (ctx: GenericTypeSpecifierExpressionContext) => void = - this.handleEnteringTreeNode; + public enterInterfaceDeclaration: (ctx: InterfaceDeclarationContext) => void = this.handleEnteringTreeNode; - // -- NOTE: We are ignoring standard expressions, as the children rules will handle everything. -- /** - * Exit a parse tree produced by `KipperParser.genericTypeSpecifier`. - * @param ctx the parse tree + * Exit a parse tree produced by `KipperParser.interfaceDeclaration`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ - public exitGenericTypeSpecifierExpression: (ctx: GenericTypeSpecifierExpressionContext) => void = - this.handleExitingTreeNode; + public exitInterfaceDeclaration: (ctx: InterfaceDeclarationContext) => void = this.handleExitingTreeNode; + /** - * Enter a parse tree produced by `KipperParser.typeofTypeSpecifier`. - * @param ctx the parse tree + * Enter a parse tree produced by `KipperParser.interfacePropertyDeclaration`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ - public enterTypeofTypeSpecifierExpression: (ctx: TypeofTypeSpecifierExpressionContext) => void = + public enterInterfacePropertyDeclaration: (ctx: InterfacePropertyDeclarationContext) => void = this.handleEnteringTreeNode; - // ------------------------------------------------------------------------------------------------------------------- - // Statement section - // ------------------------------------------------------------------------------------------------------------------- - // - // NOTE: - // We are ignoring the 'statement' rule, and only going to handle the rules 'expressionStatement', 'labeledStatement' - // 'selectionStatement', 'iterationStatement' (do-while, while and loop), 'jumpStatement' and 'compoundStatement', - // which implement a more precise 'statement' rule. - // - // This is to simplify the walking process, without having to check if the expression is actually used every time an - // expression is called. /** - * Exit a parse tree produced by `KipperParser.typeofTypeSpecifier`. - * @param ctx the parse tree + * Exit a parse tree produced by `KipperParser.interfacePropertyDeclaration`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ - public exitTypeofTypeSpecifierExpression: (ctx: TypeofTypeSpecifierExpressionContext) => void = + public exitInterfacePropertyDeclaration: (ctx: InterfacePropertyDeclarationContext) => void = this.handleExitingTreeNode; - private readonly _rootNode: RootASTNode; - private readonly _expressionFactory: ExpressionASTNodeFactory; - private readonly _statementFactory: StatementASTNodeFactory; - // NOTE: - // We are ignoring the 'selectionStatement' rule, and only going to handle the rules 'ifStatement' and - // 'switchStatement', which implement a more precise 'selectionStatement' rule. - // - // This is to simplify the walking process, without having to check if the expression is actually used every time an - // expression is called. - private readonly _declarationFactory: DeclarationASTNodeFactory; - /** - * If this is true, the current context is inside an external item and automatically indicates - * {@link _isFunctionDefinition} is false. - */ - private _isExternalItem: boolean; /** - * If this is true, the current context is inside a function definition and automatically indicates - * {@link _isExternalItem} is false. - */ - private _isFunctionDefinition: boolean; - /** - * The current Kipper AST node that is being walked through right now. This is the instance where current metadata - * should be added to and read from, as this instance will represent and handle the context rules that were walked - * through during this operation. - */ - private _currentPrimaryNode: Declaration | Statement | Expression | undefined; - - constructor(programCtx: KipperProgramContext, rootNode: CompilationUnitContext) { - this._rootNode = new RootASTNode(programCtx, rootNode); - this._isExternalItem = false; - this._isFunctionDefinition = false; - this._currentPrimaryNode = undefined; - this._expressionFactory = new ExpressionASTNodeFactory(); - this._statementFactory = new StatementASTNodeFactory(); - this._declarationFactory = new DeclarationASTNodeFactory(); - } - - /** - * The root node of the generated abstract syntax tree. - * @since 0.8.0 - */ - public get rootNode(): RootASTNode { - return this._rootNode; - } - - // NOTE: - // We are ignoring the 'iterationStatement' rule, and only going to handle the rules 'forLoopIterationStatement', - // 'whileLoopIterationStatement' and 'doWhileLoopIterationStatement', which implement a more precise - // 'iterationStatement' rule. - // - // This is to simplify the walking process, without having to check if the expression is actually used every time an - // expression is called. - - /** - * Returns the {@link KipperProgramContext program context} that owns this listener and the root node. - * @since 0.10.0 - */ - public get programCtx(): KipperProgramContext { - return this._rootNode.programCtx; - } - - /** - * Returns the {@link ExpressionASTNodeFactory expression factory} that is used to create new expression nodes - * based on the current Antlr4 context that is being walked through. - * @since 0.10.0 - */ - public get expressionFactory(): ExpressionASTNodeFactory { - return this._expressionFactory; - } - - /** - * Returns the {@link StatementASTNodeFactory statement factory} that is used to create new statement nodes based on - * the current Antlr4 context that is being walked through. - * @since 0.10.0 - */ - public get statementFactory(): StatementASTNodeFactory { - return this._statementFactory; - } - - /** - * Returns the {@link DeclarationASTNodeFactory declaration factory} that is used to create new declaration nodes - * based on the current Antlr4 context that is being walked through. - */ - public get declarationFactory(): DeclarationASTNodeFactory { - return this._declarationFactory; - } - - /** - * Returns which token is being processed at the moment and where meta-data should be assigned to. - * @private - */ - private get currentNode(): CompilableASTNode | RootASTNode { - if (this._currentPrimaryNode) { - return this._currentPrimaryNode; - } else { - return this.rootNode; - } - } - - /** - * Function that is called every time an item is entered. - * @param ctx The context of the rule. - */ - public enterEveryRule?(/*@NotNull*/ ctx: ParserRuleContext | KipperParserRuleContext): void; - - // -- Special statements - - /** - * Function that is called every time an item is exited. - * @param ctx The context of the rule. + * Enter a parse tree produced by `KipperParser.interfaceMethodDeclaration`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ - public exitEveryRule?(/*@NotNull*/ ctx: ParserRuleContext | KipperParserRuleContext): void; + public enterInterfaceMethodDeclaration: (ctx: InterfaceMethodDeclarationContext) => void = + this.handleEnteringTreeNode; /** - * Enter a parse tree produced by the `externalItem`. + * Exit a parse tree produced by `KipperParser.interfaceMethodDeclaration`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ - public enterExternalItem(ctx: ExternalItemContext): void { - this._isExternalItem = true; - } + public exitInterfaceMethodDeclaration: (ctx: InterfaceMethodDeclarationContext) => void = this.handleExitingTreeNode; /** - * Exit a parse tree produced by the `externalItem`. + * Enter a parse tree produced by `KipperParser.classDeclaration`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ - public exitExternalItem(ctx: ExternalItemContext): void { - this._isExternalItem = false; - } + public enterClassDeclaration: (ctx: ClassDeclarationContext) => void = this.handleEnteringTreeNode; /** - * Enter a parse tree produced by `KipperParser.logicalAndExpression`. + * Exit a parse tree produced by `KipperParser.classDeclaration`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ - public enterLogicalAndExpression?(ctx: LogicalAndExpressionContext): void; // Unspecific parent -> skip + public exitClassDeclaration: (ctx: ClassDeclarationContext) => void = this.handleExitingTreeNode; // ------------------------------------------------------------------------------------------------------------------- - // Declaration section + // Other // ------------------------------------------------------------------------------------------------------------------- /** - * Exit a parse tree produced by `KipperParser.logicalAndExpression`. - * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). - */ - public exitLogicalAndExpression?(ctx: LogicalAndExpressionContext): void; // Unspecific parent -> skip - - /** - * Enter a parse tree produced by the `passOnLogicalAndExpression` - * Labeled alternative in `KipperParser.logicalAndExpression`. - * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). - */ - public enterPassOnLogicalAndExpression?(ctx: PassOnLogicalAndExpressionContext): void; // Pass-on -> skip - - /** - * Exit a parse tree produced by the `passOnLogicalAndExpression` - * Labeled alternative in `KipperParser.logicalAndExpression`. - * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). - */ - public exitPassOnLogicalAndExpression?(ctx: PassOnLogicalAndExpressionContext): void; // Pass-on -> skip - - /** - * Enter a parse tree produced by `KipperParser.expression`. + * Enter a parse tree produced by `KipperParser.storageTypeSpecifier`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ - public enterExpression?(ctx: ExpressionContext): void; + public enterStorageTypeSpecifier?(ctx: StorageTypeSpecifierContext): void; /** - * Exit a parse tree produced by `KipperParser.expression`. + * Exit a parse tree produced by `KipperParser.storageTypeSpecifier`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ - public exitExpression?(ctx: ExpressionContext): void; + public exitStorageTypeSpecifier?(ctx: StorageTypeSpecifierContext): void; /** - * Enter a parse tree produced by `KipperParser.labeledStatement`. + * Enter a parse tree produced by `KipperParser.initDeclarator`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ - public enterSwitchLabeledStatement(ctx: SwitchLabeledStatementContext): void { - // TODO! Implement switch statements - } + public enterInitDeclarator?(ctx: InitDeclaratorContext): void; /** - * Exit a parse tree produced by `KipperParser.labeledStatement`. + * Exit a parse tree produced by `KipperParser.initDeclarator`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ - public exitSwitchLabeledStatement(ctx: SwitchLabeledStatementContext): void { - // TODO! Implement switch statements - } + public exitInitDeclarator?(ctx: InitDeclaratorContext): void; /** - * Enter a parse tree produced by `KipperParser.declaration`. - * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + * Enter a parse tree produced by `KipperParser.identifierTypeSpecifier`. + * @param ctx the parse tree */ - public enterDeclaration?(ctx: DeclarationContext): void; - - // ------------------------------------------------------------------------------------------------------------------- - // Other - // ------------------------------------------------------------------------------------------------------------------- + public enterIdentifierTypeSpecifierExpression: (ctx: IdentifierTypeSpecifierExpressionContext) => void = + this.handleEnteringTreeNode; /** - * Exit a parse tree produced by `KipperParser.declaration`. - * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + * Exit a parse tree produced by `KipperParser.identifierTypeSpecifier`. + * @param ctx the parse tree */ - public exitDeclaration?(ctx: DeclarationContext): void; + public exitIdentifierTypeSpecifierExpression: (ctx: IdentifierTypeSpecifierExpressionContext) => void = + this.handleExitingTreeNode; /** - * Enter a parse tree produced by `KipperParser.storageTypeSpecifier`. - * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + * Enter a parse tree produced by `KipperParser.genericTypeSpecifier`. + * @param ctx the parse tree */ - public enterStorageTypeSpecifier?(ctx: StorageTypeSpecifierContext): void; + public enterGenericTypeSpecifierExpression: (ctx: GenericTypeSpecifierExpressionContext) => void = + this.handleEnteringTreeNode; /** - * Exit a parse tree produced by `KipperParser.storageTypeSpecifier`. - * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + * Exit a parse tree produced by `KipperParser.genericTypeSpecifier`. + * @param ctx the parse tree */ - public exitStorageTypeSpecifier?(ctx: StorageTypeSpecifierContext): void; + public exitGenericTypeSpecifierExpression: (ctx: GenericTypeSpecifierExpressionContext) => void = + this.handleExitingTreeNode; /** - * Enter a parse tree produced by `KipperParser.initDeclarator`. - * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + * Enter a parse tree produced by `KipperParser.typeofTypeSpecifier`. + * @param ctx the parse tree */ - public enterInitDeclarator?(ctx: InitDeclaratorContext): void; + public enterTypeofTypeSpecifierExpression: (ctx: TypeofTypeSpecifierExpressionContext) => void = + this.handleEnteringTreeNode; /** - * Exit a parse tree produced by `KipperParser.initDeclarator`. - * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + * Exit a parse tree produced by `KipperParser.typeofTypeSpecifier`. + * @param ctx the parse tree */ - public exitInitDeclarator?(ctx: InitDeclaratorContext): void; + public exitTypeofTypeSpecifierExpression: (ctx: TypeofTypeSpecifierExpressionContext) => void = + this.handleExitingTreeNode; /** * Enter a parse tree produced by `KipperParser.typeSpecifier`. @@ -1024,63 +1220,4 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitInitializer?(ctx: InitializerContext): void; // Unspecific parent -> skip - - /** - * Handles an incoming statement context. The handling algorithm is as following: - * - If {@link _currentPrimaryNode} is undefined, then it will be created and set as a child of - * {@link _rootNode} - * - Otherwise, generate a new {@link Statement} instance, which will be added to the {@link _currentPrimaryNode} as - * a child. Afterwards {@link _currentPrimaryNode} will be set to this new instance, as all new context instances - * must be assigned to it. When the context is left, then the old {@link _currentPrimaryNode} will be restored as - * {@link _currentPrimaryNode}, and all further context instances will be assigned to it. - * @private - */ - private handleEnteringTreeNode(ctx: ASTNodeParserContext) { - if (this.isStatementContext(ctx)) { - this._currentPrimaryNode = this.statementFactory.create(ctx, this.currentNode); - } else if (this.isDeclarationContext(ctx)) { - this._currentPrimaryNode = this.declarationFactory.create(ctx, this.currentNode); - } else if (this.isExpressionContext(ctx)) { - /* istanbul ignore if: internal errors should rarely happen if ever, and only in very very bad situations */ - if (this.currentNode instanceof RootASTNode) { - throw new KipperInternalError( - "An expression may not have the root file token as a parent. It must be child to a statement or a" + - " definition.", - ); - } - this._currentPrimaryNode = this.expressionFactory.create(ctx, this.currentNode); - } else { - throw new KipperInternalError(`The context '${ctx.astSyntaxKind}' is not supported by any of the factories.`); - } - - this.programCtx.logger.debug( - `Created AST node of type '${this.currentNode.constructor.name}' for context '${ctx.astSyntaxKind}'` + - `(Loc: ${ctx.start.line}:${ctx.start.charPositionInLine})`, - ); - } - - private isStatementContext(ctx: ASTNodeParserContext): boolean { - return this.statementFactory.ruleIds.includes(ctx.astSyntaxKind); - } - - private isDeclarationContext(ctx: ASTNodeParserContext): boolean { - return this.declarationFactory.ruleIds.includes(ctx.astSyntaxKind); - } - - private isExpressionContext(ctx: ASTNodeParserContext): boolean { - return this.expressionFactory.ruleIds.includes(ctx.astSyntaxKind); - } - - /** - * Handles an exiting node context. This is required to properly generate the AST node hierarchy. - * @private - */ - private handleExitingTreeNode() { - const parent = this._currentPrimaryNode?.parent; - if (parent instanceof Declaration || parent instanceof Statement || parent instanceof Expression) { - this._currentPrimaryNode = parent; - } else { - this._currentPrimaryNode = undefined; - } - } } diff --git a/kipper/core/src/compiler/ast/common/ast-types.ts b/kipper/core/src/compiler/ast/common/ast-types.ts index 06ba63395..e2bb8c468 100644 --- a/kipper/core/src/compiler/ast/common/ast-types.ts +++ b/kipper/core/src/compiler/ast/common/ast-types.ts @@ -31,6 +31,9 @@ import type { IncrementOrDecrementPostfixExpressionContext, IncrementOrDecrementUnaryExpressionContext, InterfaceDeclarationContext, + InterfaceMethodDeclarationContext, + InterfacePropertyDeclarationContext, + InterfaceMemberDeclarationContext, JumpStatementContext, KindParseRuleMapping, LogicalAndExpressionContext, @@ -111,6 +114,8 @@ export type ParserDeclarationContext = | ParameterDeclarationContext | VariableDeclarationContext | InterfaceDeclarationContext + | InterfacePropertyDeclarationContext + | InterfaceMethodDeclarationContext | ClassDeclarationContext; /** @@ -132,6 +137,8 @@ export type ASTDeclarationKind = | typeof ParseRuleKindMapping.RULE_parameterDeclaration | typeof ParseRuleKindMapping.RULE_variableDeclaration | typeof ParseRuleKindMapping.RULE_interfaceDeclaration + | typeof ParseRuleKindMapping.RULE_interfacePropertyDeclaration + | typeof ParseRuleKindMapping.RULE_interfaceMethodDeclaration | typeof ParseRuleKindMapping.RULE_classDeclaration; /** @@ -188,7 +195,7 @@ export type ASTExpressionKind = | typeof ParseRuleKindMapping.RULE_bitwiseAndExpression | typeof ParseRuleKindMapping.RULE_bitwiseXorExpression | typeof ParseRuleKindMapping.RULE_bitwiseShiftExpression - | typeof ParseRuleKindMapping.RULE_lambdaExpression + | typeof ParseRuleKindMapping.RULE_lambdaPrimaryExpression | typeof ParseRuleKindMapping.RULE_memberAccessExpression; /** @@ -210,6 +217,8 @@ export type ASTDeclarationRuleName = | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_parameterDeclaration] | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_variableDeclaration] | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_interfaceDeclaration] + | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_interfacePropertyDeclaration] + | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_interfaceMethodDeclaration] | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_classDeclaration]; /** @@ -264,7 +273,7 @@ export type ASTExpressionRuleName = | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_bitwiseAndExpression] | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_bitwiseXorExpression] | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_bitwiseShiftExpression] - | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_lambdaExpression] + | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_lambdaPrimaryExpression] | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_memberAccessExpression]; /** diff --git a/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts b/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts index e67558bd6..dadcd4ff3 100644 --- a/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts +++ b/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts @@ -33,8 +33,11 @@ import { IncrementOrDecrementPostfixExpressionContext, IncrementOrDecrementUnaryExpressionContext, InterfaceDeclarationContext, + InterfaceMemberDeclarationContext, + InterfaceMethodDeclarationContext, + InterfacePropertyDeclarationContext, JumpStatementContext, - LambdaExpressionContext, + LambdaPrimaryExpressionContext, LogicalAndExpressionContext, LogicalOrExpressionContext, MultiplicativeExpressionContext, @@ -64,6 +67,7 @@ import type { ASTStatementRuleName, } from "../common"; import type { Declaration, Expression, Statement } from "../nodes"; +import { InterfaceMemberDeclaration, InterfaceMemberDeclarationSemantics } from "../nodes"; import { AdditiveExpression, ArrayPrimaryExpression, @@ -112,6 +116,8 @@ import { VoidOrNullOrUndefinedPrimaryExpression, WhileLoopIterationStatement, } from "../nodes"; +import { InterfacePropertyDeclaration } from "../nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration"; +import { InterfaceMethodDeclaration } from "../nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration"; /** * Mapper class which maps kind ids or rule names to their corresponding AST classes. @@ -130,6 +136,8 @@ export class ASTNodeMapper { [ParseRuleKindMapping.RULE_variableDeclaration]: VariableDeclaration, [ParseRuleKindMapping.RULE_parameterDeclaration]: ParameterDeclaration, [ParseRuleKindMapping.RULE_interfaceDeclaration]: InterfaceDeclaration, + [ParseRuleKindMapping.RULE_interfacePropertyDeclaration]: InterfacePropertyDeclaration, + [ParseRuleKindMapping.RULE_interfaceMethodDeclaration]: InterfaceMethodDeclaration, [ParseRuleKindMapping.RULE_classDeclaration]: ClassDeclaration, } satisfies Record>; @@ -170,7 +178,7 @@ export class ASTNodeMapper { [ParseRuleKindMapping.RULE_bitwiseAndExpression]: BitwiseAndExpression, [ParseRuleKindMapping.RULE_bitwiseXorExpression]: BitwiseXorExpression, [ParseRuleKindMapping.RULE_bitwiseShiftExpression]: BitwiseShiftExpression, - [ParseRuleKindMapping.RULE_lambdaExpression]: LambdaExpression, + [ParseRuleKindMapping.RULE_lambdaPrimaryExpression]: LambdaExpression, } satisfies Record>; /** @@ -200,6 +208,8 @@ export class ASTNodeMapper { [ParseRuleKindMapping.RULE_variableDeclaration]: VariableDeclarationContext, [ParseRuleKindMapping.RULE_parameterDeclaration]: ParameterDeclarationContext, [ParseRuleKindMapping.RULE_interfaceDeclaration]: InterfaceDeclarationContext, + [ParseRuleKindMapping.RULE_interfacePropertyDeclaration]: InterfacePropertyDeclarationContext, + [ParseRuleKindMapping.RULE_interfaceMethodDeclaration]: InterfaceMethodDeclarationContext, [ParseRuleKindMapping.RULE_classDeclaration]: ClassDeclarationContext, } satisfies Record; @@ -239,7 +249,7 @@ export class ASTNodeMapper { [ParseRuleKindMapping.RULE_bitwiseAndExpression]: BitwiseAndExpressionContext, [ParseRuleKindMapping.RULE_bitwiseXorExpression]: BitwiseXorExpressionContext, [ParseRuleKindMapping.RULE_bitwiseShiftExpression]: BitwiseShiftExpressionContext, - [ParseRuleKindMapping.RULE_lambdaExpression]: LambdaExpressionContext, + [ParseRuleKindMapping.RULE_lambdaPrimaryExpression]: LambdaPrimaryExpressionContext, [ParseRuleKindMapping.RULE_memberAccessExpression]: [ // Due to the nature of the parser not handling the notations as one rule, it's an array DotNotationMemberAccessExpressionContext, @@ -275,6 +285,8 @@ export class ASTNodeMapper { RULE_variableDeclaration: VariableDeclaration, RULE_parameterDeclaration: ParameterDeclaration, RULE_interfaceDeclaration: InterfaceDeclaration, + RULE_interfacePropertyDeclaration: InterfacePropertyDeclaration, + RULE_interfaceMethodDeclaration: InterfaceMethodDeclaration, RULE_classDeclaration: ClassDeclaration, } satisfies Record>; @@ -315,7 +327,7 @@ export class ASTNodeMapper { RULE_bitwiseAndExpression: BitwiseAndExpression, RULE_bitwiseXorExpression: BitwiseXorExpression, RULE_bitwiseShiftExpression: BitwiseShiftExpression, - RULE_lambdaExpression: LambdaExpression, + RULE_lambdaPrimaryExpression: LambdaExpression, } satisfies Record>; /** diff --git a/kipper/core/src/compiler/ast/nodes/declarations/declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/declaration.ts index 079f63e0c..fe1dff331 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/declaration.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/declaration.ts @@ -33,8 +33,6 @@ export abstract class Declaration< Semantics extends DeclarationSemantics = DeclarationSemantics, TypeData extends DeclarationTypeSemantics = DeclarationTypeSemantics, > extends CompilableASTNode { - public abstract targetSemanticAnalysis: TargetASTNodeSemanticAnalyser | undefined; - public abstract targetCodeGenerator: TargetASTNodeCodeGenerator>; /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -138,4 +136,7 @@ export abstract class Declaration< public async translateCtxAndChildren(): Promise> { return await this.targetCodeGenerator(this); } + + public abstract targetSemanticAnalysis: TargetASTNodeSemanticAnalyser | undefined; + public abstract targetCodeGenerator: TargetASTNodeCodeGenerator>; } diff --git a/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration.ts index f94a81715..000f581ff 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration.ts @@ -37,27 +37,20 @@ export class FunctionDeclaration * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_functionDeclaration; - /* /** - * + + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.functionDeclaration; - readonly targetCodeGenerator = this.codeGenerator.functionDeclaration; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. * @private */ protected override readonly _antlrRuleCtx: FunctionDeclarationContext; + /** * The private field '_innerScope' that actually stores the variable data, * which is returned inside the {@link this.innerScope}. @@ -216,4 +209,15 @@ export class FunctionDeclaration // Ensure that all code paths return a value this.programCtx.typeCheck(this).validReturnCodePathsInFunctionBody(this); } + + /** + * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. + * + * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. + * @since 0.9.0 + */ + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.functionDeclaration; + readonly targetCodeGenerator = this.codeGenerator.functionDeclaration; } diff --git a/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration.ts index 6399ecdf9..614bf0a24 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration.ts @@ -26,20 +26,13 @@ export class ParameterDeclaration extends Declaration< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_parameterDeclaration; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.parameterDeclaration; - readonly targetCodeGenerator = this.codeGenerator.parameterDeclaration; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -168,4 +161,15 @@ export class ParameterDeclaration extends Declaration< valueType: valueType, }; } + + /** + * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. + * + * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. + * @since 0.9.0 + */ + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.parameterDeclaration; + readonly targetCodeGenerator = this.codeGenerator.parameterDeclaration; } diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/index.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/index.ts index 3bba5b835..072e0ab08 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/index.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/index.ts @@ -6,3 +6,4 @@ export * from "./interface-declaration"; export * from "./interface-declaration-semantics"; export * from "./interface-declaration-type-semantics"; +export * from "./interface-member-declaration/"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration-semantics.ts index 8448441ea..e0f77a03d 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration-semantics.ts @@ -3,6 +3,8 @@ * @since 0.11.0 */ import type { TypeDeclarationSemantics } from "../type-declaration-semantics"; +import type { InterfaceMemberDeclaration } from "./interface-member-declaration"; +import { InterfaceMemberDeclarationSemantics } from "./interface-member-declaration"; /** * Semantics for AST Node {@link ClassDeclaration}. @@ -14,4 +16,10 @@ export interface InterfaceDeclarationSemantics extends TypeDeclarationSemantics * @since 0.11.0 */ identifier: string; + + /** + * The members of this interface. + * @since 0.11.0 + */ + members: Array; } diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration.ts index a458613ea..468a31b43 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration.ts @@ -7,8 +7,9 @@ import type { InterfaceDeclarationTypeSemantics } from "./interface-declaration- import type { CompilableNodeParent } from "../../../../compilable-ast-node"; import type { ScopeTypeDeclaration } from "../../../../../semantics"; import type { InterfaceDeclarationContext } from "../../../../../lexer-parser"; +import type { InterfaceMemberDeclaration } from "./interface-member-declaration"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import { KipperNotImplementedError } from "../../../../../../errors"; +import { KipperNotImplementedError, UnableToDetermineSemanticDataError } from "../../../../../../errors"; import { TypeDeclaration } from "../type-declaration"; /** @@ -25,20 +26,13 @@ export class InterfaceDeclaration extends TypeDeclaration< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_interfaceDeclaration; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.11.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.interfaceDeclaration; - readonly targetCodeGenerator = this.codeGenerator.interfaceDeclaration; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -115,9 +109,16 @@ export class InterfaceDeclaration extends TypeDeclaration< * the children has already failed and as such no parent node should run type checking. */ public async primarySemanticAnalysis(): Promise { - this.programCtx - .semanticCheck(this) - .notImplementedError(new KipperNotImplementedError("Interface declarations are not yet implemented.")); + const antlrChildren = this.antlrRuleCtx.children; + if (!antlrChildren?.length) { + throw new UnableToDetermineSemanticDataError(); + } + const identifier = antlrChildren[1].text; + + this.semanticData = { + identifier: identifier, + members: [...this.children] as Array, + }; } /** @@ -133,4 +134,15 @@ export class InterfaceDeclaration extends TypeDeclaration< .semanticCheck(this) .notImplementedError(new KipperNotImplementedError("Interface declarations are not yet implemented.")); } + + /** + * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. + * + * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. + * @since 0.11.0 + */ + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.interfaceDeclaration; + readonly targetCodeGenerator = this.codeGenerator.interfaceDeclaration; } diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/index.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/index.ts new file mode 100644 index 000000000..34f164fca --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/index.ts @@ -0,0 +1,9 @@ +/** + * Interface member declaration AST nodes and related semantics. + * @since 0.12.0 + */ +export * from "./interface-member-declaration"; +export * from "./interface-member-declaration-semantics"; +export * from "./interface-member-declaration-semantics"; +export * from "./interface-method-declaration/"; +export * from "./interface-property-declaration/"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-member-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-member-declaration-semantics.ts new file mode 100644 index 000000000..e9183e830 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-member-declaration-semantics.ts @@ -0,0 +1,13 @@ +import type { TypeDeclarationSemantics } from "../../type-declaration-semantics"; + +/** + * Semantics for AST Node {@link InterfacePropertyDeclaration}. + * @since 0.12.0 + */ +export interface InterfaceMemberDeclarationSemantics extends TypeDeclarationSemantics { + /** + * The identifier of the interface member. + * @since 0.12.0 + */ + identifier: string; +} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-member-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-member-declaration-type-semantics.ts new file mode 100644 index 000000000..3199a1a39 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-member-declaration-type-semantics.ts @@ -0,0 +1,7 @@ +import type { TypeDeclarationTypeSemantics } from "../../type-declaration-type-semantics"; + +/** + * Type semantics for a {@link InterfaceMemberDeclaration}. + * @since 0.12.0 + */ +export interface InterfaceMemberDeclarationTypeSemantics extends TypeDeclarationTypeSemantics {} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-member-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-member-declaration.ts new file mode 100644 index 000000000..fa64361b0 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-member-declaration.ts @@ -0,0 +1,43 @@ +import type { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../../lexer-parser"; +import type { ASTNodeMapper } from "../../../../../mapping"; +import type { InterfaceMemberDeclarationSemantics } from "./interface-member-declaration-semantics"; +import type { InterfaceMemberDeclarationTypeSemantics } from "./interface-member-declaration-type-semantics"; +import { TypeDeclaration } from "../../type-declaration"; + +/** + * Union type of all possible {@link ParserASTNode.kind} values for a constructable {@link InterfaceMemberDeclaration} AST node. + * @since 0.12.0 + */ +export type ASTInterfaceMemberDeclarationKind = + | typeof ParseRuleKindMapping.RULE_interfacePropertyDeclaration + | typeof ParseRuleKindMapping.RULE_interfaceMethodDeclaration; + +/** + * Union type of all possible {@link ParserASTNode} context classes for a constructable {@link InterfaceMemberDeclaration} AST node. + * @since 0.12.0 + */ +export type ParserInterfaceMemberDeclarationContext = InstanceType< + (typeof ASTNodeMapper.declarationKindToRuleContextMap)[ASTInterfaceMemberDeclarationKind] +>; + +/** + * Union type of all possible {@link ParserASTNode.ruleName} values for a constructable {@link InterfaceMemberDeclaration} + * AST node. + * @since 0.12.0 + */ +// eslint-disable-next-line no-undef +export type ParserInterfaceMemberDeclarationRuleName = (typeof KindParseRuleMapping)[ASTInterfaceMemberDeclarationKind]; + +/** + * Abstract interface member declaration class which represents a member declaration (either method or proeprty) + * inside an interface. + * @since 0.12.0 + */ +export abstract class InterfaceMemberDeclaration< + Semantics extends InterfaceMemberDeclarationSemantics = InterfaceMemberDeclarationSemantics, + TypeSemantics extends InterfaceMemberDeclarationTypeSemantics = InterfaceMemberDeclarationTypeSemantics, +> extends TypeDeclaration { + protected abstract readonly _antlrRuleCtx: ParserInterfaceMemberDeclarationContext; + public abstract get kind(): ASTInterfaceMemberDeclarationKind; + public abstract get ruleName(): ParserInterfaceMemberDeclarationRuleName; +} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/index.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/index.ts new file mode 100644 index 000000000..b20b8e269 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/index.ts @@ -0,0 +1,3 @@ +export * from "./interface-method-declaration"; +export * from "./interface-method-declaration-semantics"; +export * from "./interface-method-declaration-type-semantics"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration-semantics.ts new file mode 100644 index 000000000..55afeda11 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration-semantics.ts @@ -0,0 +1,28 @@ +import type { TypeDeclarationSemantics } from "../../../type-declaration-semantics"; +import type { IdentifierTypeSpecifierExpression } from "../../../../../expressions"; +import type { ParameterDeclaration } from "../../../../parameter-declaration"; +import type { RawType } from "../../../../../../../semantics"; + +/** + * Semantics for AST Node {@link InterfacePropertyDeclaration}. + * @since 0.12.0 + */ +export interface InterfaceMethodDeclarationSemantics extends TypeDeclarationSemantics { + /** + * The identifier of this member property. + * @since 0.12.0 + */ + identifier: string; + + /** + * The return type of this method. + * @since 0.12.0 + */ + parameters: Array; + + /** + * The return type of this method. + * @since 0.12.0 + */ + returnType: IdentifierTypeSpecifierExpression; +} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration-type-semantics.ts new file mode 100644 index 000000000..768616c10 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration-type-semantics.ts @@ -0,0 +1,15 @@ +import type { TypeDeclarationTypeSemantics } from "../../../type-declaration-type-semantics"; +import type { ProcessedType } from "../../../../../../../semantics"; +import { CustomType } from "../../../../../../../semantics"; + +/** + * + * @since 0.12.0 + */ +export interface InterfaceMethodDeclarationTypeSemantics extends TypeDeclarationTypeSemantics { + /** + * The processed type of this member property. + * @since 0.12.0 + */ + type: ProcessedType; +} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts new file mode 100644 index 000000000..900b5f203 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration/interface-method-declaration.ts @@ -0,0 +1,183 @@ +/** + * Represents a class declaration in the Kipper language, which may contain methods and fields. + * @since 0.12.0 + */ +import type { ScopeTypeDeclaration } from "../../../../../../../semantics"; +import { BuiltInTypes } from "../../../../../../../semantics"; +import { RawType } from "../../../../../../../semantics"; +import type { InterfaceMethodDeclarationContext } from "../../../../../../../lexer-parser"; +import { CompoundStatementContext, DeclaratorContext } from "../../../../../../../lexer-parser"; +import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../../../lexer-parser"; +import { InterfaceMemberDeclaration } from "../interface-member-declaration"; +import type { CompilableNodeParent } from "../../../../../../compilable-ast-node"; +import { KipperNotImplementedError, UnableToDetermineSemanticDataError } from "../../../../../../../../errors"; +import type { InterfaceMethodDeclarationSemantics } from "./interface-method-declaration-semantics"; +import type { InterfaceMethodDeclarationTypeSemantics } from "./interface-method-declaration-type-semantics"; +import type { IdentifierTypeSpecifierExpression } from "../../../../../expressions"; +import { ParameterDeclaration } from "../../../../parameter-declaration"; + +/** + * Represents a class declaration in the Kipper language, which may contain methods and fields. + * @since 0.12.0 + */ +export class InterfaceMethodDeclaration extends InterfaceMemberDeclaration< + InterfaceMethodDeclarationSemantics, + InterfaceMethodDeclarationTypeSemantics +> { + /**parent + * The private field '_antlrRuleCtx' that actually stores the variable data, + * which is returned inside the {@link this.antlrRuleCtx}. + * @private + */ + protected override readonly _antlrRuleCtx: InterfaceMethodDeclarationContext; + + /** + * The private field '_scopeDeclaration' that actually stores the variable data, + * which is returned inside the {@link this.scopeDeclaration}. + * @private + */ + protected override _scopeDeclaration: ScopeTypeDeclaration | undefined; + + /** + /** + * The static kind for this AST Node. + * @since 0.12.0 + */ + public static readonly kind = ParseRuleKindMapping.RULE_interfaceMethodDeclaration; + + /** + * Returns the kind of this AST node. This represents the specific type of the {@link antlrRuleCtx} that this AST + * node wraps. + * + * This may be compared using the {@link ParseRuleKindMapping rule fields}, for example + * {@link ParseRuleKindMapping.RULE_declaration}. + * @since 0.12.0 + */ + public override get kind() { + return InterfaceMethodDeclaration.kind; + } + + /** + * The static rule name for this AST Node. + * @since 0.12.0 + */ + public static readonly ruleName = KindParseRuleMapping[this.kind]; + + /** + * Returns the rule name of this AST Node. This represents the specific type of the {@link antlrRuleCtx} that this + * AST node wraps. + * + * This may be compared using the {@link ParseRuleKindMapping rule fields}, for example + * {@link ParseRuleKindMapping.RULE_declaration}. + * @since 0.12.0 + */ + public override get ruleName() { + return InterfaceMethodDeclaration.ruleName; + } + + constructor(antlrRuleCtx: InterfaceMethodDeclarationContext, parent: CompilableNodeParent) { + super(antlrRuleCtx, parent); + this._antlrRuleCtx = antlrRuleCtx; + } + + /** + * The antlr context containing the antlr4 metadata for this expression. + */ + public override get antlrRuleCtx(): InterfaceMethodDeclarationContext { + return this._antlrRuleCtx; + } + /** + * The {@link ScopeDeclaration} context instance for this declaration, which is used to register the declaration + * in the {@link scope parent scope}. + * @since 0.12.0 + */ + public get scopeDeclaration(): ScopeTypeDeclaration | undefined { + return this._scopeDeclaration; + } + + protected set scopeDeclaration(declaration: ScopeTypeDeclaration | undefined) { + this._scopeDeclaration = declaration; + } + + public getScopeDeclaration(): ScopeTypeDeclaration { + /* istanbul ignore next: super function already being run/tested */ + return super.getScopeDeclaration(); + } + + /** + * Performs the semantic analysis for this Kipper token. This will log all warnings using {@link programCtx.logger} + * and throw errors if encountered. + * + * This will not run in case that {@link 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. + */ + public async primarySemanticAnalysis(): Promise { + const parseTreeChildren = this.getAntlrRuleChildren(); + let declaratorCtx = ( + parseTreeChildren.find((val) => val instanceof DeclaratorContext) + ); + + let retTypeSpecifier: IdentifierTypeSpecifierExpression | undefined; + let params: Array = []; + + // Create shallow copy of the children + let children = [...this.children]; + + // Evaluate the primary semantic data for the function + while (children.length > 0) { + let child = children.shift(); + + if (child instanceof ParameterDeclaration) { + params.push(child); + } else { + // Once the return type has been reached, stop, as the last two items should be the return type and func body + retTypeSpecifier = child; + break; + } + } + + // Ensure that the children are fully present and not undefined + // Also make sure the scope has the required argument field for the function (is of type 'FunctionScope') + if (!declaratorCtx || !retTypeSpecifier) { + throw new UnableToDetermineSemanticDataError(); + } + + const identifier = this.tokenStream.getText(declaratorCtx.sourceInterval); + + this.semanticData = { + identifier: identifier, + returnType: retTypeSpecifier, + parameters: params, + }; + } + + /** + * Performs type checking for this AST Node. This will log all warnings using {@link programCtx.logger} + * and throw errors if encountered. + * + * This will not run in case that {@link this.hasFailed} is true, as that indicates that the type checking of + * the children has already failed and as such no parent node should run type checking. + * @since 0.12.0 + */ + public async primarySemanticTypeChecking(): Promise { + const semanticData = this.getSemanticData(); + + // Get the type that will be returned using the return type specifier + const returnType = semanticData.returnType.getTypeSemanticData().storedType; + this.typeSemantics = { + returnType: returnType, + type: BuiltInTypes.func, + }; + } + + /** + * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. + * + * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. + * @since 0.12.0 + */ + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.interfaceMethodDeclaration; + readonly targetCodeGenerator = this.codeGenerator.interfaceMethodDeclaration; +} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration/index.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration/index.ts new file mode 100644 index 000000000..44204d7e8 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration/index.ts @@ -0,0 +1,3 @@ +export * from "./interface-property-declaration"; +export * from "./interface-property-declaration-semantics"; +export * from "./interface-property-declaration-type-semantics"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration/interface-property-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration/interface-property-declaration-semantics.ts new file mode 100644 index 000000000..7dc7e620f --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration/interface-property-declaration-semantics.ts @@ -0,0 +1,27 @@ +import type { TypeDeclarationSemantics } from "../../../type-declaration-semantics"; +import type { IdentifierTypeSpecifierExpression } from "../../../../../expressions"; +import type { RawType } from "../../../../../../../semantics"; + +/** + * Semantics for AST Node {@link InterfacePropertyDeclaration}. + * @since 0.12.0 + */ +export interface InterfacePropertyDeclarationSemantics extends TypeDeclarationSemantics { + /** + * The identifier of this member property. + * @since 0.12.0 + */ + identifier: string; + /** + * The type of this member property. + * @since 0.12.0 + */ + typeSpecifier: IdentifierTypeSpecifierExpression; + /** + * The type of the value as a string. + * + * The identifier of the {@link typeSpecifier.semanticData.identifier typeSpecifier}. + * @since 0.12.0 + */ + type: RawType; +} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration/interface-property-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration/interface-property-declaration-type-semantics.ts new file mode 100644 index 000000000..764c928d6 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration/interface-property-declaration-type-semantics.ts @@ -0,0 +1,15 @@ +import type { TypeDeclarationTypeSemantics } from "../../../type-declaration-type-semantics"; +import type { ProcessedType } from "../../../../../../../semantics"; +import { CustomType } from "../../../../../../../semantics"; + +/** + * Type semantics for AST Node {@link InterfacePropertyDeclaration}. + * @since 0.12.0 + */ +export interface InterfacePropertyDeclarationTypeSemantics extends TypeDeclarationTypeSemantics { + /** + * The processed type of this member property. + * @since 0.12.0 + */ + type: ProcessedType; +} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration/interface-property-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration/interface-property-declaration.ts new file mode 100644 index 000000000..e0bb70a57 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration/interface-property-declaration.ts @@ -0,0 +1,156 @@ +/** + * Represents a class declaration in the Kipper language, which may contain methods and fields. + * @since 0.12.0 + */ +import type { ScopeTypeDeclaration } from "../../../../../../../semantics"; +import { RawType } from "../../../../../../../semantics"; +import type { InterfacePropertyDeclarationContext } from "../../../../../../../lexer-parser"; +import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../../../lexer-parser"; +import { InterfaceMemberDeclaration } from "../interface-member-declaration"; +import type { InterfacePropertyDeclarationSemantics } from "./interface-property-declaration-semantics"; +import type { InterfacePropertyDeclarationTypeSemantics } from "./interface-property-declaration-type-semantics"; +import type { CompilableNodeParent } from "../../../../../../compilable-ast-node"; +import { UnableToDetermineSemanticDataError } from "../../../../../../../../errors"; +import type { IdentifierTypeSpecifierExpression } from "../../../../../expressions"; + +/** + * Represents a class declaration in the Kipper language, which may contain methods and fields. + * @since 0.12.0 + */ +export class InterfacePropertyDeclaration extends InterfaceMemberDeclaration< + InterfacePropertyDeclarationSemantics, + InterfacePropertyDeclarationTypeSemantics +> { + /**parent + * The private field '_antlrRuleCtx' that actually stores the variable data, + * which is returned inside the {@link this.antlrRuleCtx}. + * @private + */ + protected override readonly _antlrRuleCtx: InterfacePropertyDeclarationContext; + + /** + * The private field '_scopeDeclaration' that actually stores the variable data, + * which is returned inside the {@link this.scopeDeclaration}. + * @private + */ + protected override _scopeDeclaration: ScopeTypeDeclaration | undefined; + + /** + /** + * The static kind for this AST Node. + * @since 0.12.0 + */ + public static readonly kind = ParseRuleKindMapping.RULE_interfacePropertyDeclaration; + + /** + * Returns the kind of this AST node. This represents the specific type of the {@link antlrRuleCtx} that this AST + * node wraps. + * + * This may be compared using the {@link ParseRuleKindMapping rule fields}, for example + * {@link ParseRuleKindMapping.RULE_declaration}. + * @since 0.12.0 + */ + public override get kind() { + return InterfacePropertyDeclaration.kind; + } + + /** + * The static rule name for this AST Node. + * @since 0.12.0 + */ + public static readonly ruleName = KindParseRuleMapping[this.kind]; + + /** + * Returns the rule name of this AST Node. This represents the specific type of the {@link antlrRuleCtx} that this + * AST node wraps. + * + * This may be compared using the {@link ParseRuleKindMapping rule fields}, for example + * {@link ParseRuleKindMapping.RULE_declaration}. + * @since 0.12.0 + */ + public override get ruleName() { + return InterfacePropertyDeclaration.ruleName; + } + + constructor(antlrRuleCtx: InterfacePropertyDeclarationContext, parent: CompilableNodeParent) { + super(antlrRuleCtx, parent); + this._antlrRuleCtx = antlrRuleCtx; + } + + /** + * The antlr context containing the antlr4 metadata for this expression. + */ + public override get antlrRuleCtx(): InterfacePropertyDeclarationContext { + return this._antlrRuleCtx; + } + /** + * The {@link ScopeDeclaration} context instance for this declaration, which is used to register the declaration + * in the {@link scope parent scope}. + * @since 0.12.0 + */ + public get scopeDeclaration(): ScopeTypeDeclaration | undefined { + return this._scopeDeclaration; + } + + protected set scopeDeclaration(declaration: ScopeTypeDeclaration | undefined) { + this._scopeDeclaration = declaration; + } + + public getScopeDeclaration(): ScopeTypeDeclaration { + /* istanbul ignore next: super function already being run/tested */ + return super.getScopeDeclaration(); + } + + /** + * Performs the semantic analysis for this Kipper token. This will log all warnings using {@link programCtx.logger} + * and throw errors if encountered. + * + * This will not run in case that {@link 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. + */ + public async primarySemanticAnalysis(): Promise { + const antlrChildren = this.antlrRuleCtx.children; + if (!antlrChildren?.length) { + throw new UnableToDetermineSemanticDataError(); + } + + const identifier = antlrChildren[0].text; + const typeSpecifier = this.children[0]; + + this.semanticData = { + identifier: identifier, + typeSpecifier: typeSpecifier, + type: typeSpecifier.getSemanticData().typeIdentifier, + }; + } + + /** + * Performs type checking for this AST Node. This will log all warnings using {@link programCtx.logger} + * and throw errors if encountered. + * + * This will not run in case that {@link this.hasFailed} is true, as that indicates that the type checking of + * the children has already failed and as such no parent node should run type checking. + * @since 0.12.0 + */ + public async primarySemanticTypeChecking(): Promise { + const semanticData = this.getSemanticData(); + + // Get the type that will be returned using the value type specifier + semanticData.typeSpecifier.ensureTypeSemanticallyValid(); // Ensure the type specifier didn't fail + const valueType = semanticData.typeSpecifier.getTypeSemanticData().storedType; + this.typeSemantics = { + type: valueType, + }; + } + + /** + * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. + * + * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. + * @since 0.12.0 + */ + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.interfacePropertyDeclaration; + readonly targetCodeGenerator = this.codeGenerator.interfacePropertyDeclaration; +} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-type-semantics.ts index 928e1899d..051ce11ac 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-type-semantics.ts @@ -1,5 +1,6 @@ import type { TypeData } from "../../../ast-node"; -import type { CustomType } from "../../../../semantics"; +import type { ProcessedType } from "../../../../semantics"; +import { CustomType } from "../../../../semantics"; /** * Type semantics for a {@link TypeDeclaration}. @@ -10,5 +11,5 @@ export interface TypeDeclarationTypeSemantics extends TypeData { * The processed type of the type declaration. * @since 0.11.0 */ - type: CustomType; + type: ProcessedType; } diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration.ts index 63531ecd1..c22e6eb43 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration.ts @@ -2,19 +2,21 @@ import type { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../lex import type { ASTNodeMapper } from "../../../mapping"; import type { TypeDeclarationSemantics } from "./type-declaration-semantics"; import type { TypeDeclarationTypeSemantics } from "./type-declaration-type-semantics"; +import type { ASTInterfaceMemberDeclarationKind } from "./interface-declaration"; import { Declaration } from "../declaration"; /** * Union type of all possible {@link ParserASTNode.kind} values for a constructable {@link TypeDeclaration} AST node. - * @since 0.10.0 + * @since 0.11.0 */ export type ASTTypeDeclarationKind = + | ASTInterfaceMemberDeclarationKind | typeof ParseRuleKindMapping.RULE_interfaceDeclaration | typeof ParseRuleKindMapping.RULE_classDeclaration; /** * Union type of all possible {@link ParserASTNode} context classes for a constructable {@link TypeDeclaration} AST node. - * @since 0.10.0 + * @since 0.11.0 */ export type ParserTypeDeclarationContext = InstanceType< (typeof ASTNodeMapper.declarationKindToRuleContextMap)[ASTTypeDeclarationKind] @@ -28,9 +30,8 @@ export type ParserTypeDeclarationContext = InstanceType< export type ParserTypeDeclarationRuleName = (typeof KindParseRuleMapping)[ASTTypeDeclarationKind]; /** - * Abstract comparative expression class representing a comparative expression, which can be used to compare two - * expressions. This abstract class only exists to provide the commonality between the different comparative expressions. - * @since 0.9.0 + * Abstract type declaration which represents user-defined types such as interfaces or classes. + * @since 0.11.0 */ export abstract class TypeDeclaration< Semantics extends TypeDeclarationSemantics = TypeDeclarationSemantics, diff --git a/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration.ts index 4438c25fe..b4f8f2508 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration.ts @@ -36,20 +36,13 @@ export class VariableDeclaration extends Declaration extends CompilableASTNode { - public abstract targetCodeGenerator: TargetASTNodeCodeGenerator; - /** - * The private field '_antlrRuleCtx' that actually stores the variable data, - * which is returned inside the {@link this.antlrRuleCtx}. - * @private - */ - protected override readonly _antlrRuleCtx: ParserExpressionContext; - protected constructor(antlrRuleCtx: ParserExpressionContext, parent: CompilableASTNode) { super(antlrRuleCtx, parent); this._antlrRuleCtx = antlrRuleCtx; @@ -174,4 +166,13 @@ export abstract class Expression< public override async translateCtxAndChildren(): Promise { return await this.targetCodeGenerator(this); } + + /** + * The private field '_antlrRuleCtx' that actually stores the variable data, + * which is returned inside the {@link this.antlrRuleCtx}. + * @private + */ + protected override readonly _antlrRuleCtx: ParserExpressionContext; + + public abstract targetCodeGenerator: TargetASTNodeCodeGenerator; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/function-call-expression/function-call-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/function-call-expression/function-call-expression.ts index f4525e1a6..79c668621 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/function-call-expression/function-call-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/function-call-expression/function-call-expression.ts @@ -39,15 +39,7 @@ export class FunctionCallExpression extends Expression< * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.functionCallExpression; - readonly targetCodeGenerator = this.codeGenerator.functionCallExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -154,4 +146,9 @@ export class FunctionCallExpression extends Expression< func: calledFunc, }; } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.functionCallExpression; + readonly targetCodeGenerator = this.codeGenerator.functionCallExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/lambda-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/lambda-expression.ts index 5f4459f90..4563c4155 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/lambda-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/lambda-expression.ts @@ -7,7 +7,7 @@ import { Expression } from "../expression"; import type { LambdaExpressionSemantics } from "./lambda-expression-semantics"; import type { LambdaExpressionTypeSemantics } from "./lambda-expression-type-semantics"; -import type { LambdaExpressionContext } from "../../../../lexer-parser"; +import type { LambdaPrimaryExpressionContext } from "../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../lexer-parser"; import type { CompilableASTNode } from "../../../compilable-ast-node"; import type { ScopeNode } from "../../../scope-node"; @@ -36,27 +36,27 @@ export class LambdaExpression * The static kind for this AST Node. * @since 0.11.0 */ - public static readonly kind = ParseRuleKindMapping.RULE_lambdaExpression; + public static readonly kind = ParseRuleKindMapping.RULE_lambdaPrimaryExpression; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - public checkForWarnings = undefined; - readonly targetSemanticAnalysis = this.semanticAnalyser.lambdaExpression; - readonly targetCodeGenerator = this.codeGenerator.lambdaExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. * @private */ - protected override readonly _antlrRuleCtx: LambdaExpressionContext; + protected override readonly _antlrRuleCtx: LambdaPrimaryExpressionContext; + /** * The inner scope of this lambda expression. */ private readonly _innerScope: LambdaScope; - constructor(antlrRuleCtx: LambdaExpressionContext, parent: CompilableASTNode) { + constructor(antlrRuleCtx: LambdaPrimaryExpressionContext, parent: CompilableASTNode) { super(antlrRuleCtx, parent); this._antlrRuleCtx = antlrRuleCtx; this._innerScope = new LambdaScope(this); @@ -75,7 +75,7 @@ export class LambdaExpression * node wraps. * * This may be compared using the {@link ParseRuleKindMapping rule fields}, for example - * {@link ParseRuleKindMapping.RULE_lambdaExpression}. + * {@link ParseRuleKindMapping.RULE_lambdaPrimaryExpression}. * @since 0.11.0 */ public override get kind() { @@ -94,10 +94,18 @@ export class LambdaExpression /** * The antlr context containing the antlr4 metadata for this expression. */ - public override get antlrRuleCtx(): LambdaExpressionContext { + public override get antlrRuleCtx(): LambdaPrimaryExpressionContext { return this._antlrRuleCtx; } + /** + * Performs the semantic analysis for this Kipper token. This will log all warnings using {@link programCtx.logger} + * and throw errors if encountered. + * + * This will not run in case that {@link 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. + * @since 0.11.0 + */ public async primarySemanticAnalysis(): Promise { let body: Statement | undefined; let retTypeSpecifier: IdentifierTypeSpecifierExpression | undefined; @@ -134,6 +142,14 @@ export class LambdaExpression }; } + /** + * Performs type checking for this AST Node. This will log all warnings using {@link programCtx.logger} + * and throw errors if encountered. + * + * This will not run in case that {@link this.hasFailed} is true, as that indicates that the type checking of + * the children has already failed and as such no parent node should run type checking. + * @since 0.11.0 + */ public async primarySemanticTypeChecking(): Promise { const semanticData = this.getSemanticData(); @@ -149,4 +165,9 @@ export class LambdaExpression this.programCtx.typeCheck(this).validReturnCodePathsInFunctionBody(this); } } + + public checkForWarnings = undefined; + + readonly targetSemanticAnalysis = this.semanticAnalyser.lambdaPrimaryExpression; + readonly targetCodeGenerator = this.codeGenerator.lambdaPrimaryExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/logical-expression/logical-and-expression/logical-and-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/logical-expression/logical-and-expression/logical-and-expression.ts index 78e92a4b4..3ec18cd6e 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/logical-expression/logical-and-expression/logical-and-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/logical-expression/logical-and-expression/logical-and-expression.ts @@ -37,20 +37,13 @@ export class LogicalAndExpression extends LogicalExpression< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_logicalAndExpression; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.logicalAndExpression; - readonly targetCodeGenerator = this.codeGenerator.logicalAndExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -132,4 +125,9 @@ export class LogicalAndExpression extends LogicalExpression< evaluatedType: BuiltInTypes.bool, }; } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.logicalAndExpression; + readonly targetCodeGenerator = this.codeGenerator.logicalAndExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/logical-expression/logical-or-expression/logical-or-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/logical-expression/logical-or-expression/logical-or-expression.ts index 3dffbb39b..03143f21e 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/logical-expression/logical-or-expression/logical-or-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/logical-expression/logical-or-expression/logical-or-expression.ts @@ -38,20 +38,13 @@ export class LogicalOrExpression extends LogicalExpression< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_logicalOrExpression; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.logicalOrExpression; - readonly targetCodeGenerator = this.codeGenerator.logicalOrExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -133,4 +126,9 @@ export class LogicalOrExpression extends LogicalExpression< evaluatedType: BuiltInTypes.bool, }; } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.logicalOrExpression; + readonly targetCodeGenerator = this.codeGenerator.logicalOrExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/member-access-expression/member-access-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/member-access-expression/member-access-expression.ts index 33738de77..9ee43026b 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/member-access-expression/member-access-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/member-access-expression/member-access-expression.ts @@ -41,20 +41,13 @@ export class MemberAccessExpression extends Expression< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_memberAccessExpression; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.memberAccessExpression; - readonly targetCodeGenerator = this.codeGenerator.memberAccessExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -176,4 +169,9 @@ export class MemberAccessExpression extends Expression< evaluatedType: type, }; } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.memberAccessExpression; + readonly targetCodeGenerator = this.codeGenerator.memberAccessExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/postfix-expression/increment-or-decrement-postfix-expression/increment-or-decrement-postfix-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/postfix-expression/increment-or-decrement-postfix-expression/increment-or-decrement-postfix-expression.ts index b2a63ed17..5ac030abb 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/postfix-expression/increment-or-decrement-postfix-expression/increment-or-decrement-postfix-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/postfix-expression/increment-or-decrement-postfix-expression/increment-or-decrement-postfix-expression.ts @@ -32,20 +32,13 @@ export class IncrementOrDecrementPostfixExpression extends PostfixExpression< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_incrementOrDecrementPostfixExpression; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.incrementOrDecrementPostfixExpression; - readonly targetCodeGenerator = this.codeGenerator.incrementOrDecrementPostfixExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -132,4 +125,9 @@ export class IncrementOrDecrementPostfixExpression extends PostfixExpression< // Ensure that this expression is valid (e.g. the operand is a number) this.programCtx.typeCheck(this).validUnaryExpression(this); } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.incrementOrDecrementPostfixExpression; + readonly targetCodeGenerator = this.codeGenerator.incrementOrDecrementPostfixExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/array-primary-expression/array-primary-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/array-primary-expression/array-primary-expression.ts index 1b272246d..04bdffafa 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/array-primary-expression/array-primary-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/array-primary-expression/array-primary-expression.ts @@ -23,20 +23,13 @@ export class ArrayPrimaryExpression extends PrimaryExpression< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_arrayPrimaryExpression; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.arrayPrimaryExpression; - readonly targetCodeGenerator = this.codeGenerator.arrayPrimaryExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -107,4 +100,9 @@ export class ArrayPrimaryExpression extends PrimaryExpression< evaluatedType: BuiltInTypes.list, }; } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.arrayPrimaryExpression; + readonly targetCodeGenerator = this.codeGenerator.arrayPrimaryExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/bool-primary-expression/bool-primary-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/bool-primary-expression/bool-primary-expression.ts index 57116c4ff..5b89af8bb 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/bool-primary-expression/bool-primary-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/bool-primary-expression/bool-primary-expression.ts @@ -24,20 +24,13 @@ export class BoolPrimaryExpression extends PrimaryExpression< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_boolPrimaryExpression; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.boolPrimaryExpression; - readonly targetCodeGenerator = this.codeGenerator.boolPrimaryExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -108,4 +101,9 @@ export class BoolPrimaryExpression extends PrimaryExpression< evaluatedType: BuiltInTypes.bool, }; } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.boolPrimaryExpression; + readonly targetCodeGenerator = this.codeGenerator.boolPrimaryExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/fstring-primary-expression/fstring-primary-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/fstring-primary-expression/fstring-primary-expression.ts index d582e697d..be9e19e4b 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/fstring-primary-expression/fstring-primary-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/fstring-primary-expression/fstring-primary-expression.ts @@ -32,20 +32,13 @@ export class FStringPrimaryExpression extends Expression< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_fStringPrimaryExpression; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.fStringPrimaryExpression; - readonly targetCodeGenerator = this.codeGenerator.fStringPrimaryExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -134,4 +127,9 @@ export class FStringPrimaryExpression extends Expression< evaluatedType: BuiltInTypes.str, }; } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.fStringPrimaryExpression; + readonly targetCodeGenerator = this.codeGenerator.fStringPrimaryExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/identifier-primary-expression/identifier-primary-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/identifier-primary-expression/identifier-primary-expression.ts index a633daa5f..cca4adeb7 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/identifier-primary-expression/identifier-primary-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/identifier-primary-expression/identifier-primary-expression.ts @@ -28,20 +28,13 @@ export class IdentifierPrimaryExpression extends PrimaryExpression< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_identifierPrimaryExpression; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.identifierPrimaryExpression; - readonly targetCodeGenerator = this.codeGenerator.identifierPrimaryExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -135,4 +128,9 @@ export class IdentifierPrimaryExpression extends PrimaryExpression< evaluatedType: refTarget.type, }; } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.identifierPrimaryExpression; + readonly targetCodeGenerator = this.codeGenerator.identifierPrimaryExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/number-primary-expression/number-primary-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/number-primary-expression/number-primary-expression.ts index 78a7beeb9..7ce1ed987 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/number-primary-expression/number-primary-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/number-primary-expression/number-primary-expression.ts @@ -23,20 +23,13 @@ export class NumberPrimaryExpression extends PrimaryExpression< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_numberPrimaryExpression; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.numberPrimaryExpression; - readonly targetCodeGenerator = this.codeGenerator.numberPrimaryExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -109,4 +102,9 @@ export class NumberPrimaryExpression extends PrimaryExpression< evaluatedType: BuiltInTypes.num, }; } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.numberPrimaryExpression; + readonly targetCodeGenerator = this.codeGenerator.numberPrimaryExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/object-primary-expression/object-primary-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/object-primary-expression/object-primary-expression.ts index e7bd85fbe..6fcf7e2ab 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/object-primary-expression/object-primary-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/object-primary-expression/object-primary-expression.ts @@ -9,6 +9,7 @@ import type { ObjectPrimaryExpressionContext } from "../../../../../lexer-parser import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; import { KipperNotImplementedError } from "../../../../../../errors"; import { PrimaryExpression } from "../primary-expression"; +import { ObjectProperty } from "./object-property"; /** * Object literal constant, which represents an object that was defined in the source code. @@ -74,9 +75,11 @@ export class ObjectPrimaryExpression extends PrimaryExpression< * the children has already failed and as such no parent node should run type checking. */ public async primarySemanticAnalysis(): Promise { - throw this.programCtx - .semanticCheck(this) - .notImplementedError(new KipperNotImplementedError("Object Literals have not been implemented yet.")); + const objectProperties = this.children; + + this.semanticData = { + keyValuePairs: objectProperties + }; } /** diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/object-primary-expression/object-property/object-property-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/object-primary-expression/object-property/object-property-semantics.ts index 74aac8b66..030d958bf 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/object-primary-expression/object-property/object-property-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/object-primary-expression/object-property/object-property-semantics.ts @@ -1,7 +1,12 @@ import type { PrimaryExpressionSemantics } from "../../primary-expression-semantics"; +import { Expression } from "../../../expression"; +import { StringPrimaryExpression } from "../../string-primary-expression"; /** * Semantics for AST Node {@link ObjectPrimaryExpression}. * @since 0.11.0 */ -export interface ObjectPropertySemantics extends PrimaryExpressionSemantics {} +export interface ObjectPropertySemantics extends PrimaryExpressionSemantics { + identifier: string + expressoDepresso: Expression +} diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/object-primary-expression/object-property/object-property.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/object-primary-expression/object-property/object-property.ts index ec3ba2a57..e32b01c08 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/object-primary-expression/object-property/object-property.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/object-primary-expression/object-property/object-property.ts @@ -4,6 +4,7 @@ import type { ObjectPropertyContext } from "../../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../../lexer-parser"; import { PrimaryExpression } from "../../primary-expression"; import type { CompilableASTNode } from "../../../../../compilable-ast-node"; +import type { StringPrimaryExpression } from "../../string-primary-expression"; /** * Object property, which represents a property inside an {@link ObjectPrimaryExpression object}. This is a key-value @@ -16,20 +17,13 @@ export class ObjectProperty extends PrimaryExpression { - return; // For now, we don't have any semantic analysis for object properties. + let id; + let expression; + + if(this.children.length < 2) { + id = this.antlrRuleCtx.children![0].text; + expression = this.children[0]; + } else { + id = ( this.children[0]).getSemanticData().value; + expression = this.children[1]; + } + + this.semanticData = { + identifier: id, + expressoDepresso: expression + }; } /** @@ -93,6 +101,14 @@ export class ObjectProperty extends PrimaryExpression { - return; // For now, we don't have any type checking for object properties. + const semanticData = this.getSemanticData(); + + const expression = semanticData.expressoDepresso; + expression } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.objectProperty; + readonly targetCodeGenerator = this.codeGenerator.objectProperty; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/tangled-primary-expression/tangled-primary-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/tangled-primary-expression/tangled-primary-expression.ts index 0070c6cae..ab67dfde0 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/tangled-primary-expression/tangled-primary-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/tangled-primary-expression/tangled-primary-expression.ts @@ -30,20 +30,13 @@ export class TangledPrimaryExpression extends PrimaryExpression< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_tangledPrimaryExpression; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.tangledPrimaryExpression; - readonly targetCodeGenerator = this.codeGenerator.tangledPrimaryExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -124,4 +117,9 @@ export class TangledPrimaryExpression extends PrimaryExpression< evaluatedType: exp.getTypeSemanticData().evaluatedType, }; } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.tangledPrimaryExpression; + readonly targetCodeGenerator = this.codeGenerator.tangledPrimaryExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/void-or-null-or-undefined-primary-expression/void-or-null-or-undefined-primary-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/void-or-null-or-undefined-primary-expression/void-or-null-or-undefined-primary-expression.ts index 2887586ba..ff63f76a3 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/void-or-null-or-undefined-primary-expression/void-or-null-or-undefined-primary-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/void-or-null-or-undefined-primary-expression/void-or-null-or-undefined-primary-expression.ts @@ -24,20 +24,13 @@ export class VoidOrNullOrUndefinedPrimaryExpression extends PrimaryExpression< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_voidOrNullOrUndefinedPrimaryExpression; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.voidOrNullOrUndefinedPrimaryExpression; - readonly targetCodeGenerator = this.codeGenerator.voidOrNullOrUndefinedPrimaryExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -110,4 +103,9 @@ export class VoidOrNullOrUndefinedPrimaryExpression extends PrimaryExpression< evaluatedType: BuiltInTypes[semanticData.constantIdentifier], }; } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.voidOrNullOrUndefinedPrimaryExpression; + readonly targetCodeGenerator = this.codeGenerator.voidOrNullOrUndefinedPrimaryExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/generic-type-specifier-expression/generic-type-specifier-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/generic-type-specifier-expression/generic-type-specifier-expression.ts index ede851a5f..dc39d27a4 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/generic-type-specifier-expression/generic-type-specifier-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/generic-type-specifier-expression/generic-type-specifier-expression.ts @@ -27,20 +27,13 @@ export class GenericTypeSpecifierExpression extends TypeSpecifierExpression< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_genericTypeSpecifierExpression; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.genericTypeSpecifierExpression; - readonly targetCodeGenerator = this.codeGenerator.genericTypeSpecifierExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -107,4 +100,9 @@ export class GenericTypeSpecifierExpression extends TypeSpecifierExpression< .semanticCheck(this) .notImplementedError(new KipperNotImplementedError("Generic Type Expressions have not been implemented yet.")); } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.genericTypeSpecifierExpression; + readonly targetCodeGenerator = this.codeGenerator.genericTypeSpecifierExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/identifier-type-specifier-expression/identifier-type-specifier-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/identifier-type-specifier-expression/identifier-type-specifier-expression.ts index c5dd01fc8..f39b14fee 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/identifier-type-specifier-expression/identifier-type-specifier-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/identifier-type-specifier-expression/identifier-type-specifier-expression.ts @@ -33,20 +33,13 @@ export class IdentifierTypeSpecifierExpression extends TypeSpecifierExpression< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_identifierTypeSpecifierExpression; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.identifierTypeSpecifierExpression; - readonly targetCodeGenerator = this.codeGenerator.identifierTypeSpecifierExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -119,4 +112,9 @@ export class IdentifierTypeSpecifierExpression extends TypeSpecifierExpression< storedType: valueType, }; } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.identifierTypeSpecifierExpression; + readonly targetCodeGenerator = this.codeGenerator.identifierTypeSpecifierExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/typeof-type-specifier-expression/typeof-type-specifier-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/typeof-type-specifier-expression/typeof-type-specifier-expression.ts index 9c0aee2d7..f0fb4357c 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/typeof-type-specifier-expression/typeof-type-specifier-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/typeof-type-specifier-expression/typeof-type-specifier-expression.ts @@ -23,20 +23,13 @@ export class TypeofTypeSpecifierExpression extends TypeSpecifierExpression< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_typeofTypeSpecifierExpression; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.typeofTypeSpecifierExpression; - readonly targetCodeGenerator = this.codeGenerator.typeofTypeSpecifierExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -103,4 +96,9 @@ export class TypeofTypeSpecifierExpression extends TypeSpecifierExpression< .semanticCheck(this) .notImplementedError(new KipperNotImplementedError("Typeof Type Expressions have not been implemented yet.")); } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.typeofTypeSpecifierExpression; + readonly targetCodeGenerator = this.codeGenerator.typeofTypeSpecifierExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/unary-expression/increment-or-decrement-unary-expression/increment-or-decrement-unary-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/unary-expression/increment-or-decrement-unary-expression/increment-or-decrement-unary-expression.ts index 293d12547..5f0a8a935 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/unary-expression/increment-or-decrement-unary-expression/increment-or-decrement-unary-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/unary-expression/increment-or-decrement-unary-expression/increment-or-decrement-unary-expression.ts @@ -32,20 +32,13 @@ export class IncrementOrDecrementUnaryExpression extends UnaryExpression< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_incrementOrDecrementUnaryExpression; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.incrementOrDecrementUnaryExpression; - readonly targetCodeGenerator = this.codeGenerator.incrementOrDecrementUnaryExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -132,4 +125,9 @@ export class IncrementOrDecrementUnaryExpression extends UnaryExpression< // Ensure that this expression is valid (e.g. the operand is a number) this.programCtx.typeCheck(this).validUnaryExpression(this); } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.incrementOrDecrementUnaryExpression; + readonly targetCodeGenerator = this.codeGenerator.incrementOrDecrementUnaryExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/unary-expression/operator-modified-unary-expression/operator-modified-unary-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/unary-expression/operator-modified-unary-expression/operator-modified-unary-expression.ts index 59cb5076f..63a110bd0 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/unary-expression/operator-modified-unary-expression/operator-modified-unary-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/unary-expression/operator-modified-unary-expression/operator-modified-unary-expression.ts @@ -35,20 +35,13 @@ export class OperatorModifiedUnaryExpression extends UnaryExpression< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_operatorModifiedUnaryExpression; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.operatorModifiedUnaryExpression; - readonly targetCodeGenerator = this.codeGenerator.operatorModifiedUnaryExpression; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -145,4 +138,9 @@ export class OperatorModifiedUnaryExpression extends UnaryExpression< // Ensure the operator is compatible with the type of the operand this.programCtx.typeCheck(this).validUnaryExpression(this); } + + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.operatorModifiedUnaryExpression; + readonly targetCodeGenerator = this.codeGenerator.operatorModifiedUnaryExpression; } diff --git a/kipper/core/src/compiler/ast/nodes/statements/compound-statement/compound-statement.ts b/kipper/core/src/compiler/ast/nodes/statements/compound-statement/compound-statement.ts index 9964e223c..e2fb1e87b 100644 --- a/kipper/core/src/compiler/ast/nodes/statements/compound-statement/compound-statement.ts +++ b/kipper/core/src/compiler/ast/nodes/statements/compound-statement/compound-statement.ts @@ -24,44 +24,22 @@ export class CompoundStatement * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_compoundStatement; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Performs the semantic analysis for this Kipper token. This will log all warnings using {@link programCtx.logger} - * and throw errors if encountered. - * - * This will not run in case that {@link 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. - */ - public primarySemanticAnalysis = undefined; // Compound statements will never have semantic data - /** - * Performs type checking for this AST Node. This will log all warnings using {@link programCtx.logger} - * and throw errors if encountered. - * - * This will not run in case that {@link this.hasFailed} is true, as that indicates that the type checking of - * the children has already failed and as such no parent node should run type checking. - * @since 0.7.0 - */ - public primarySemanticTypeChecking = undefined; // Compound statements will never have type checking - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.compoundStatement; - readonly targetCodeGenerator = this.codeGenerator.compoundStatement; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. * @private */ protected override readonly _antlrRuleCtx: CompoundStatementContext; + protected readonly _children: Array; + private readonly _innerScope: LocalScope; constructor(antlrRuleCtx: CompoundStatementContext, parent: CompilableNodeParent) { @@ -119,4 +97,34 @@ export class CompoundStatement public get innerScope(): LocalScope { return this._innerScope; } + + /** + * Performs the semantic analysis for this Kipper token. This will log all warnings using {@link programCtx.logger} + * and throw errors if encountered. + * + * This will not run in case that {@link 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. + */ + public primarySemanticAnalysis = undefined; // Compound statements will never have semantic data + + /** + * Performs type checking for this AST Node. This will log all warnings using {@link programCtx.logger} + * and throw errors if encountered. + * + * This will not run in case that {@link this.hasFailed} is true, as that indicates that the type checking of + * the children has already failed and as such no parent node should run type checking. + * @since 0.7.0 + */ + public primarySemanticTypeChecking = undefined; // Compound statements will never have type checking + + /** + * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. + * + * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. + * @since 0.9.0 + */ + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.compoundStatement; + readonly targetCodeGenerator = this.codeGenerator.compoundStatement; } diff --git a/kipper/core/src/compiler/ast/nodes/statements/expression-statement/expression-statement.ts b/kipper/core/src/compiler/ast/nodes/statements/expression-statement/expression-statement.ts index af8663d1c..172777c63 100644 --- a/kipper/core/src/compiler/ast/nodes/statements/expression-statement/expression-statement.ts +++ b/kipper/core/src/compiler/ast/nodes/statements/expression-statement/expression-statement.ts @@ -18,36 +18,20 @@ export class ExpressionStatement extends Statement; constructor(antlrRuleCtx: ExpressionStatementContext, parent: CompilableNodeParent) { @@ -105,4 +89,26 @@ export class ExpressionStatement extends Statement { this.programCtx.warningCheck(this).uselessStatement(this); } + + /** + * Performs the semantic analysis for this Kipper token. This will log all warnings using {@link programCtx.logger} + * and throw errors if encountered. + * + * This will not run in case that {@link 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. + */ + public primarySemanticAnalysis = undefined; // Expression statements will never have semantic data + + /** + * Performs type checking for this AST Node. This will log all warnings using {@link programCtx.logger} + * and throw errors if encountered. + * + * This will not run in case that {@link this.hasFailed} is true, as that indicates that the type checking of + * the children has already failed and as such no parent node should run type checking. + * @since 0.7.0 + */ + public primarySemanticTypeChecking = undefined; // Expression statements will never have type checking + + readonly targetSemanticAnalysis = this.semanticAnalyser.expressionStatement; + readonly targetCodeGenerator = this.codeGenerator.expressionStatement; } diff --git a/kipper/core/src/compiler/ast/nodes/statements/if-statement/if-statement.ts b/kipper/core/src/compiler/ast/nodes/statements/if-statement/if-statement.ts index 115c2a20e..b781f9227 100644 --- a/kipper/core/src/compiler/ast/nodes/statements/if-statement/if-statement.ts +++ b/kipper/core/src/compiler/ast/nodes/statements/if-statement/if-statement.ts @@ -21,35 +21,20 @@ export class IfStatement extends Statement; constructor(antlrRuleCtx: IfStatementContext, parent: CompilableNodeParent) { @@ -125,4 +110,25 @@ export class IfStatement extends Statement; constructor(antlrRuleCtx: DoWhileLoopIterationStatementContext, parent: CompilableNodeParent) { @@ -115,4 +100,25 @@ export class DoWhileLoopIterationStatement extends IterationStatement< loopBody: loopBody, }; } + + /** + * Performs type checking for this AST Node. This will log all warnings using {@link programCtx.logger} + * and throw errors if encountered. + * + * This will not run in case that {@link this.hasFailed} is true, as that indicates that the type checking of + * the children has already failed and as such no parent node should run type checking. + * @since 0.7.0 + */ + public primarySemanticTypeChecking: undefined = undefined; + + /** + * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. + * + * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. + * @since 0.9.0 + */ + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.doWhileLoopIterationStatement; + readonly targetCodeGenerator = this.codeGenerator.doWhileLoopIterationStatement; } diff --git a/kipper/core/src/compiler/ast/nodes/statements/iteration-statement/for-loop-iteration-statement/for-loop-iteration-statement.ts b/kipper/core/src/compiler/ast/nodes/statements/iteration-statement/for-loop-iteration-statement/for-loop-iteration-statement.ts index 949730301..80d9b3a56 100644 --- a/kipper/core/src/compiler/ast/nodes/statements/iteration-statement/for-loop-iteration-statement/for-loop-iteration-statement.ts +++ b/kipper/core/src/compiler/ast/nodes/statements/iteration-statement/for-loop-iteration-statement/for-loop-iteration-statement.ts @@ -27,36 +27,22 @@ export class ForLoopIterationStatement * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_forLoopIterationStatement; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Performs type checking for this AST Node. This will log all warnings using {@link programCtx.logger} - * and throw errors if encountered. - * - * This will not run in case that {@link this.hasFailed} is true, as that indicates that the type checking of - * the children has already failed and as such no parent node should run type checking. - * @since 0.7.0 - */ - public primarySemanticTypeChecking = undefined; // For-loop statements will never have type checking - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.forLoopIterationStatement; - readonly targetCodeGenerator = this.codeGenerator.forLoopIterationStatement; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. * @private */ protected override readonly _antlrRuleCtx: ForLoopIterationStatementContext; + protected readonly _children: Array; + /** * The private field '_innerScope' that actually stores the variable data, * which is returned inside the {@link this.innerScope}. @@ -143,4 +129,25 @@ export class ForLoopIterationStatement loopBody: loopBody, }; } + + /** + * Performs type checking for this AST Node. This will log all warnings using {@link programCtx.logger} + * and throw errors if encountered. + * + * This will not run in case that {@link this.hasFailed} is true, as that indicates that the type checking of + * the children has already failed and as such no parent node should run type checking. + * @since 0.7.0 + */ + public primarySemanticTypeChecking = undefined; // For-loop statements will never have type checking + + /** + * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. + * + * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. + * @since 0.9.0 + */ + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.forLoopIterationStatement; + readonly targetCodeGenerator = this.codeGenerator.forLoopIterationStatement; } diff --git a/kipper/core/src/compiler/ast/nodes/statements/iteration-statement/while-loop-iteration-statement/while-loop-iteration-statement.ts b/kipper/core/src/compiler/ast/nodes/statements/iteration-statement/while-loop-iteration-statement/while-loop-iteration-statement.ts index 1096b291c..830f976f0 100644 --- a/kipper/core/src/compiler/ast/nodes/statements/iteration-statement/while-loop-iteration-statement/while-loop-iteration-statement.ts +++ b/kipper/core/src/compiler/ast/nodes/statements/iteration-statement/while-loop-iteration-statement/while-loop-iteration-statement.ts @@ -24,35 +24,20 @@ export class WhileLoopIterationStatement extends IterationStatement< * @since 0.11.0 */ public static readonly kind = ParseRuleKindMapping.RULE_whileLoopIterationStatement; + /** * The static rule name for this AST Node. * @since 0.11.0 */ public static readonly ruleName = KindParseRuleMapping[this.kind]; - /** - * Performs type checking for this AST Node. This will log all warnings using {@link programCtx.logger} - * and throw errors if encountered. - * - * This will not run in case that {@link this.hasFailed} is true, as that indicates that the type checking of - * the children has already failed and as such no parent node should run type checking. - * @since 0.7.0 - */ - public primarySemanticTypeChecking = undefined; // While-loop statements will never have type checking - /** - * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. - * - * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. - * @since 0.9.0 - */ - public checkForWarnings = undefined; // TODO! - readonly targetSemanticAnalysis = this.semanticAnalyser.whileLoopIterationStatement; - readonly targetCodeGenerator = this.codeGenerator.whileLoopIterationStatement; + /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. * @private */ protected override readonly _antlrRuleCtx: WhileLoopIterationStatementContext; + protected readonly _children: Array; constructor(antlrRuleCtx: WhileLoopIterationStatementContext, parent: CompilableNodeParent) { @@ -116,4 +101,25 @@ export class WhileLoopIterationStatement extends IterationStatement< loopBody: loopBody, }; } + + /** + * Performs type checking for this AST Node. This will log all warnings using {@link programCtx.logger} + * and throw errors if encountered. + * + * This will not run in case that {@link this.hasFailed} is true, as that indicates that the type checking of + * the children has already failed and as such no parent node should run type checking. + * @since 0.7.0 + */ + public primarySemanticTypeChecking = undefined; // While-loop statements will never have type checking + + /** + * Semantically analyses the code inside this AST node and checks for possible warnings or problematic code. + * + * This will log all warnings using {@link programCtx.logger} and store them in {@link KipperProgramContext.warnings}. + * @since 0.9.0 + */ + public checkForWarnings = undefined; // TODO! + + readonly targetSemanticAnalysis = this.semanticAnalyser.whileLoopIterationStatement; + readonly targetCodeGenerator = this.codeGenerator.whileLoopIterationStatement; } diff --git a/kipper/core/src/compiler/ast/nodes/statements/jump-statement/jump-statement.ts b/kipper/core/src/compiler/ast/nodes/statements/jump-statement/jump-statement.ts index 80ef65a2f..56f487c8b 100644 --- a/kipper/core/src/compiler/ast/nodes/statements/jump-statement/jump-statement.ts +++ b/kipper/core/src/compiler/ast/nodes/statements/jump-statement/jump-statement.ts @@ -20,35 +20,20 @@ export class JumpStatement extends Statement; constructor(antlrRuleCtx: JumpStatementContext, parent: CompilableNodeParent) { @@ -111,4 +96,25 @@ export class JumpStatement extends Statement; constructor(antlrRuleCtx: ReturnStatementContext, parent: CompilableNodeParent) { @@ -124,4 +118,15 @@ export class ReturnStatement extends Statement; constructor(antlrRuleCtx: SwitchStatementContext, parent: CompilableNodeParent) { @@ -110,4 +104,15 @@ export class SwitchStatement extends Statement\t>\x04?\t?\x04@\t@\x04A\tA\x04B\tB\x04C\tC\x04D\tD\x04E\tE\x04" + "F\tF\x04G\tG\x04H\tH\x04I\tI\x04J\tJ\x04K\tK\x04L\tL\x04M\tM\x04N\tN\x04" + - "O\tO\x04P\tP\x03\x02\x05\x02\xA2\n\x02\x03\x02\x03\x02\x03\x03\x06\x03" + - "\xA7\n\x03\r\x03\x0E\x03\xA8\x03\x04\x03\x04\x03\x05\x06\x05\xAE\n\x05" + - "\r\x05\x0E\x05\xAF\x03\x06\x03\x06\x03\x06\x05\x06\xB5\n\x06\x03\x07\x03" + - "\x07\x03\x07\x03\x07\x03\x07\x03\x07\x05\x07\xBD\n\x07\x03\b\x03\b\x03" + - "\b\x03\t\x03\t\x03\n\x03\n\x03\n\x03\n\x03\n\x05\n\xC9\n\n\x03\v\x03\v" + - "\x03\f\x03\f\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0E\x03\x0E\x05\x0E\xD5\n" + - "\x0E\x03\x0E\x03\x0E\x03\x0E\x03\x0E\x05\x0E\xDB\n\x0E\x03\x0F\x03\x0F" + - "\x03\x0F\x07\x0F\xE0\n\x0F\f\x0F\x0E\x0F\xE3\v\x0F\x03\x10\x03\x10\x03" + - "\x10\x03\x10\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x12\x03\x12\x03" + - "\x12\x03\x12\x03\x12\x03\x13\x03\x13\x03\x13\x03\x13\x03\x13\x03\x13\x05" + - "\x13\xF9\n\x13\x03\x14\x03\x14\x03\x14\x05\x14\xFE\n\x14\x03\x14\x03\x14" + - "\x03\x15\x03\x15\x03\x15\x03\x15\x03\x15\x03\x16\x03\x16\x05\x16\u0109" + - "\n\x16\x03\x17\x03\x17\x03\x17\x03\x17\x03\x17\x03\x17\x03\x17\x05\x17" + - "\u0112\n\x17\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x07\x18\u011A" + - "\n\x18\f\x18\x0E\x18\u011D\v\x18\x03\x18\x03\x18\x03\x19\x03\x19\x03\x19" + - "\x03\x19\x03\x19\x03\x19\x03\x19\x03\x19\x05\x19\u0129\n\x19\x03\x1A\x03" + - "\x1A\x03\x1A\x05\x1A\u012E\n\x1A\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x05\x1B" + - "\u0134\n\x1B\x03\x1B\x03\x1B\x05\x1B\u0138\n\x1B\x03\x1B\x03\x1B\x03\x1B" + - "\x03\x1B\x05\x1B\u013E\n\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x05\x1B\u0144" + - "\n\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C" + - "\x03\x1C\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D" + - "\x03\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x05\x1F\u015C\n\x1F\x03\x1F\x03" + - "\x1F\x03 \x03 \x03 \x03 \x03 \x03 \x03 \x03 \x03 \x03 \x05 \u016A\n \x03" + - '!\x03!\x05!\u016E\n!\x03!\x03!\x03!\x03!\x03!\x03!\x05!\u0176\n!\x03"' + - '\x03"\x03"\x03"\x03#\x03#\x03$\x03$\x03%\x03%\x03&\x03&\x05&\u0184' + - "\n&\x03'\x03'\x03(\x03(\x07(\u018A\n(\f(\x0E(\u018D\v(\x03(\x03(\x03" + - "(\x07(\u0192\n(\f(\x0E(\u0195\v(\x03(\x05(\u0198\n(\x03)\x03)\x03)\x05" + - ")\u019D\n)\x03)\x05)\u01A0\n)\x03*\x03*\x03*\x05*\u01A5\n*\x03*\x05*\u01A8" + - "\n*\x03+\x03+\x03,\x03,\x03,\x03,\x07,\u01B0\n,\f,\x0E,\u01B3\v,\x05," + - "\u01B5\n,\x03,\x05,\u01B8\n,\x03,\x03,\x03-\x03-\x03-\x03-\x07-\u01C0" + - "\n-\f-\x0E-\u01C3\v-\x05-\u01C5\n-\x03-\x05-\u01C8\n-\x03-\x03-\x03.\x03" + - ".\x03.\x03.\x03/\x03/\x030\x030\x030\x030\x030\x030\x050\u01D8\n0\x03" + - "0\x030\x030\x050\u01DD\n0\x030\x030\x030\x050\u01E2\n0\x030\x030\x030" + - "\x030\x030\x030\x030\x030\x030\x030\x030\x030\x030\x030\x070\u01F2\n0" + - "\f0\x0E0\u01F5\v0\x031\x031\x031\x071\u01FA\n1\f1\x0E1\u01FD\v1\x032\x03" + - "2\x032\x033\x033\x033\x033\x034\x034\x034\x034\x054\u020A\n4\x034\x03" + - "4\x034\x034\x054\u0210\n4\x034\x034\x035\x035\x055\u0216\n5\x036\x036" + - "\x036\x037\x037\x037\x057\u021E\n7\x038\x038\x038\x039\x039\x039\x03:" + - "\x03:\x03;\x03;\x03<\x03<\x03<\x03<\x03<\x05<\u022F\n<\x03=\x03=\x03=" + - "\x03=\x03=\x03=\x07=\u0237\n=\f=\x0E=\u023A\v=\x03>\x03>\x03>\x03>\x03" + - ">\x03>\x07>\u0242\n>\f>\x0E>\u0245\v>\x03?\x03?\x03?\x03?\x03?\x03?\x03" + - "?\x07?\u024E\n?\f?\x0E?\u0251\v?\x03@\x03@\x03A\x03A\x03A\x03A\x03A\x03" + - "A\x07A\u025B\nA\fA\x0EA\u025E\vA\x03B\x03B\x03B\x03B\x03B\x03B\x07B\u0266" + - "\nB\fB\x0EB\u0269\vB\x03C\x03C\x03C\x03C\x03C\x03C\x07C\u0271\nC\fC\x0E" + - "C\u0274\vC\x03D\x03D\x03D\x03D\x03D\x03D\x07D\u027C\nD\fD\x0ED\u027F\v" + - "D\x03E\x03E\x03E\x03E\x03E\x03E\x07E\u0287\nE\fE\x0EE\u028A\vE\x03F\x03" + - "F\x03F\x03F\x03F\x03F\x07F\u0292\nF\fF\x0EF\u0295\vF\x03G\x03G\x03G\x03" + - "G\x03G\x03G\x07G\u029D\nG\fG\x0EG\u02A0\vG\x03H\x03H\x03H\x03H\x03H\x03" + - "H\x03H\x05H\u02A9\nH\x03I\x03I\x03I\x03I\x03I\x05I\u02B0\nI\x03J\x03J" + - "\x03K\x03K\x03K\x07K\u02B7\nK\fK\x0EK\u02BA\vK\x03L\x03L\x03L\x05L\u02BF" + - "\nL\x03M\x03M\x03N\x03N\x03N\x03N\x03N\x03O\x03O\x03O\x03O\x03O\x03P\x03" + - "P\x03P\x02\x02\r^xz|\x80\x82\x84\x86\x88\x8A\x8CQ\x02\x02\x04\x02\x06" + - "\x02\b\x02\n\x02\f\x02\x0E\x02\x10\x02\x12\x02\x14\x02\x16\x02\x18\x02" + - '\x1A\x02\x1C\x02\x1E\x02 \x02"\x02$\x02&\x02(\x02*\x02,\x02.\x020\x02' + - "2\x024\x026\x028\x02:\x02<\x02>\x02@\x02B\x02D\x02F\x02H\x02J\x02L\x02" + - "N\x02P\x02R\x02T\x02V\x02X\x02Z\x02\\\x02^\x02`\x02b\x02d\x02f\x02h\x02" + - "j\x02l\x02n\x02p\x02r\x02t\x02v\x02x\x02z\x02|\x02~\x02\x80\x02\x82\x02" + - "\x84\x02\x86\x02\x88\x02\x8A\x02\x8C\x02\x8E\x02\x90\x02\x92\x02\x94\x02" + - "\x96\x02\x98\x02\x9A\x02\x9C\x02\x9E\x02\x02\x11\x03\x02\x07\b\x03\x02" + - "\x0E\x0F\x03\x02\x1C\x1D\x03\x02NO\x04\x02MMPP\x03\x02\x1F!\x04\x02.." + - "00\x06\x02--//77GG\x03\x0214\x04\x02--//\x03\x02HJ\x03\x02@C\x03\x02>" + - "?\x03\x028=\x04\x02\x1F!LL\x02\u02D2\x02\xA1\x03\x02\x02\x02\x04\xA6\x03" + - "\x02\x02\x02\x06\xAA\x03\x02\x02\x02\b\xAD\x03\x02\x02\x02\n\xB4\x03\x02" + - "\x02\x02\f\xBC\x03\x02\x02\x02\x0E\xBE\x03\x02\x02\x02\x10\xC1\x03\x02" + - "\x02\x02\x12\xC3\x03\x02\x02\x02\x14\xCA\x03\x02\x02\x02\x16\xCC\x03\x02" + - "\x02\x02\x18\xCE\x03\x02\x02\x02\x1A\xD0\x03\x02\x02\x02\x1C\xDC\x03\x02" + - '\x02\x02\x1E\xE4\x03\x02\x02\x02 \xE8\x03\x02\x02\x02"\xED\x03\x02\x02' + - "\x02$\xF8\x03\x02\x02\x02&\xFA\x03\x02\x02\x02(\u0101\x03\x02\x02\x02" + - "*\u0108\x03\x02\x02\x02,\u010A\x03\x02\x02\x02.\u0113\x03\x02\x02\x02" + - "0\u0128\x03\x02\x02\x022\u012D\x03\x02\x02\x024\u012F\x03\x02\x02\x02" + - "6\u0148\x03\x02\x02\x028\u014E\x03\x02\x02\x02:\u0156\x03\x02\x02\x02" + - "<\u0159\x03\x02\x02\x02>\u0169\x03\x02\x02\x02@\u016B\x03\x02\x02\x02" + - "B\u0177\x03\x02\x02\x02D\u017B\x03\x02\x02\x02F\u017D\x03\x02\x02\x02" + - "H\u017F\x03\x02\x02\x02J\u0183\x03\x02\x02\x02L\u0185\x03\x02\x02\x02" + - "N\u0197\x03\x02\x02\x02P\u019F\x03\x02\x02\x02R\u01A7\x03\x02\x02\x02" + - "T\u01A9\x03\x02\x02\x02V\u01AB\x03\x02\x02\x02X\u01BB\x03\x02\x02\x02" + - "Z\u01CB\x03\x02\x02\x02\\\u01CF\x03\x02\x02\x02^\u01DC\x03\x02\x02\x02" + - "`\u01F6\x03\x02\x02\x02b\u01FE\x03\x02\x02\x02d\u0201\x03\x02\x02\x02" + - "f\u0205\x03\x02\x02\x02h\u0215\x03\x02\x02\x02j\u0217\x03\x02\x02\x02" + - "l\u021D\x03\x02\x02\x02n\u021F\x03\x02\x02\x02p\u0222\x03\x02\x02\x02" + - "r\u0225\x03\x02\x02\x02t\u0227\x03\x02\x02\x02v\u022E\x03\x02\x02\x02" + - "x\u0230\x03\x02\x02\x02z\u023B\x03\x02\x02\x02|\u0246\x03\x02\x02\x02" + - "~\u0252\x03\x02\x02\x02\x80\u0254\x03\x02\x02\x02\x82\u025F\x03\x02\x02" + - "\x02\x84\u026A\x03\x02\x02\x02\x86\u0275\x03\x02\x02\x02\x88\u0280\x03" + - "\x02\x02\x02\x8A\u028B\x03\x02\x02\x02\x8C\u0296\x03\x02\x02\x02\x8E\u02A8" + - "\x03\x02\x02\x02\x90\u02AF\x03\x02\x02\x02\x92\u02B1\x03\x02\x02\x02\x94" + - "\u02B3\x03\x02\x02\x02\x96\u02BE\x03\x02\x02\x02\x98\u02C0\x03\x02\x02" + - "\x02\x9A\u02C2\x03\x02\x02\x02\x9C\u02C7\x03\x02\x02\x02\x9E\u02CC\x03" + - "\x02\x02\x02\xA0\xA2\x05\x04\x03\x02\xA1\xA0\x03\x02\x02\x02\xA1\xA2\x03" + - "\x02\x02\x02\xA2\xA3\x03\x02\x02\x02\xA3\xA4\x07\x02\x02\x03\xA4\x03\x03" + - "\x02\x02\x02\xA5\xA7\x05\x06\x04\x02\xA6\xA5\x03\x02\x02\x02\xA7\xA8\x03" + - "\x02\x02\x02\xA8\xA6\x03\x02\x02\x02\xA8\xA9\x03\x02\x02\x02\xA9\x05\x03" + - "\x02\x02\x02\xAA\xAB\x05\b\x05\x02\xAB\x07\x03\x02\x02\x02\xAC\xAE\x05" + - "\n\x06\x02\xAD\xAC\x03\x02\x02\x02\xAE\xAF\x03\x02\x02\x02\xAF\xAD\x03" + - "\x02\x02\x02\xAF\xB0\x03\x02\x02\x02\xB0\t\x03\x02\x02\x02\xB1\xB5\x05" + - "$\x13\x02\xB2\xB5\x05\f\x07\x02\xB3\xB5\x07#\x02\x02\xB4\xB1\x03\x02\x02" + - "\x02\xB4\xB2\x03\x02\x02\x02\xB4\xB3\x03\x02\x02\x02\xB5\v\x03\x02\x02" + - "\x02\xB6\xB7\x05\x0E\b\x02\xB7\xB8\x07#\x02\x02\xB8\xBD\x03\x02\x02\x02" + - '\xB9\xBD\x05\x1A\x0E\x02\xBA\xBD\x05 \x11\x02\xBB\xBD\x05"\x12\x02\xBC' + - "\xB6\x03\x02\x02\x02\xBC\xB9\x03\x02\x02\x02\xBC\xBA\x03\x02\x02\x02\xBC" + - "\xBB\x03\x02\x02\x02\xBD\r\x03\x02\x02\x02\xBE\xBF\x05\x10\t\x02\xBF\xC0" + - "\x05\x12\n\x02\xC0\x0F\x03\x02\x02\x02\xC1\xC2\t\x02\x02\x02\xC2\x11\x03" + - "\x02\x02\x02\xC3\xC4\x05\x16\f\x02\xC4\xC5\x07%\x02\x02\xC5\xC8\x05\x96" + - "L\x02\xC6\xC7\x078\x02\x02\xC7\xC9\x05\x14\v\x02\xC8\xC6\x03\x02\x02\x02" + - "\xC8\xC9\x03\x02\x02\x02\xC9\x13\x03\x02\x02\x02\xCA\xCB\x05\x90I\x02" + - "\xCB\x15\x03\x02\x02\x02\xCC\xCD\x05\x18\r\x02\xCD\x17\x03\x02\x02\x02" + - "\xCE\xCF\x07L\x02\x02\xCF\x19\x03\x02\x02\x02\xD0\xD1\x07\x16\x02\x02" + - "\xD1\xD2\x05\x16\f\x02\xD2\xD4\x07&\x02\x02\xD3\xD5\x05\x1C\x0F\x02\xD4" + - "\xD3\x03\x02\x02\x02\xD4\xD5\x03\x02\x02\x02\xD5\xD6\x03\x02\x02\x02\xD6" + - "\xD7\x07'\x02\x02\xD7\xD8\x07\x19\x02\x02\xD8\xDA\x05\x96L\x02\xD9\xDB" + - "\x05&\x14\x02\xDA\xD9\x03\x02\x02\x02\xDA\xDB\x03\x02\x02\x02\xDB\x1B" + - '\x03\x02\x02\x02\xDC\xE1\x05\x1E\x10\x02\xDD\xDE\x07"\x02\x02\xDE\xE0' + - "\x05\x1E\x10\x02\xDF\xDD\x03\x02\x02\x02\xE0\xE3\x03\x02\x02\x02\xE1\xDF" + - "\x03\x02\x02\x02\xE1\xE2\x03\x02\x02\x02\xE2\x1D\x03\x02\x02\x02\xE3\xE1" + - "\x03\x02\x02\x02\xE4\xE5\x05\x16\f\x02\xE5\xE6\x07%\x02\x02\xE6\xE7\x05" + - "\x96L\x02\xE7\x1F\x03\x02\x02\x02\xE8\xE9\x07\x1B\x02\x02\xE9\xEA\x07" + - "L\x02\x02\xEA\xEB\x07+\x02\x02\xEB\xEC\x07,\x02\x02\xEC!\x03\x02\x02\x02" + - "\xED\xEE\x07\x1A\x02\x02\xEE\xEF\x07L\x02\x02\xEF\xF0\x07+\x02\x02\xF0" + - "\xF1\x07,\x02\x02\xF1#\x03\x02\x02\x02\xF2\xF9\x05(\x15\x02\xF3\xF9\x05" + - "*\x16\x02\xF4\xF9\x052\x1A\x02\xF5\xF9\x05:\x1E\x02\xF6\xF9\x05<\x1F\x02" + - "\xF7\xF9\x05&\x14\x02\xF8\xF2\x03\x02\x02\x02\xF8\xF3\x03\x02\x02\x02" + - "\xF8\xF4\x03\x02\x02\x02\xF8\xF5\x03\x02\x02\x02\xF8\xF6\x03\x02\x02\x02" + - "\xF8\xF7\x03\x02\x02\x02\xF9%\x03\x02\x02\x02\xFA\xFB\x06\x14\x02\x02" + - "\xFB\xFD\x07+\x02\x02\xFC\xFE\x05\b\x05\x02\xFD\xFC\x03\x02\x02\x02\xFD" + - "\xFE\x03\x02\x02\x02\xFE\xFF\x03\x02\x02\x02\xFF\u0100\x07,\x02\x02\u0100" + - "'\x03\x02\x02\x02\u0101\u0102\b\x15\x01\x02\u0102\u0103\x05\x94K\x02" + - "\u0103\u0104\x07#\x02\x02\u0104\u0105\b\x15\x01\x02\u0105)\x03\x02\x02" + - "\x02\u0106\u0109\x05,\x17\x02\u0107\u0109\x05.\x18\x02\u0108\u0106\x03" + - "\x02\x02\x02\u0108\u0107\x03\x02\x02\x02\u0109+\x03\x02\x02\x02\u010A" + - "\u010B\x07\x12\x02\x02\u010B\u010C\x07&\x02\x02\u010C\u010D\x05\x94K\x02" + - "\u010D\u010E\x07'\x02\x02\u010E\u0111\x05$\x13\x02\u010F\u0110\x07\x13" + - "\x02\x02\u0110\u0112\x05$\x13\x02\u0111\u010F\x03\x02\x02\x02\u0111\u0112" + - "\x03\x02\x02\x02\u0112-\x03\x02\x02\x02\u0113\u0114\x07\v\x02\x02\u0114" + - "\u0115\x07&\x02\x02\u0115\u0116\x05\x94K\x02\u0116\u0117\x07'\x02\x02" + - "\u0117\u011B\x07+\x02\x02\u0118\u011A\x050\x19\x02\u0119\u0118\x03\x02" + - "\x02\x02\u011A\u011D\x03\x02\x02\x02\u011B\u0119\x03\x02\x02\x02\u011B" + - "\u011C\x03\x02\x02\x02\u011C\u011E\x03\x02\x02\x02\u011D\u011B\x03\x02" + - "\x02\x02\u011E\u011F\x07,\x02\x02\u011F/\x03\x02\x02\x02\u0120\u0121\x07" + - "\f\x02\x02\u0121\u0122\x05\x94K\x02\u0122\u0123\x07%\x02\x02\u0123\u0124" + - "\x05$\x13\x02\u0124\u0129\x03\x02\x02\x02\u0125\u0126\x07\r\x02\x02\u0126" + - "\u0127\x07%\x02\x02\u0127\u0129\x05$\x13\x02\u0128\u0120\x03\x02\x02\x02" + - "\u0128\u0125\x03\x02\x02\x02\u01291\x03\x02\x02\x02\u012A\u012E\x054\x1B" + - "\x02\u012B\u012E\x056\x1C\x02\u012C\u012E\x058\x1D\x02\u012D\u012A\x03" + - "\x02\x02\x02\u012D\u012B\x03\x02\x02\x02\u012D\u012C\x03\x02\x02\x02\u012E" + - "3\x03\x02\x02\x02\u012F\u0130\x07\x14\x02\x02\u0130\u0137\x07&\x02\x02" + - "\u0131\u0134\x05\x0E\b\x02\u0132\u0134\x05\x94K\x02\u0133\u0131\x03\x02" + - "\x02\x02\u0133\u0132\x03\x02\x02\x02\u0134\u0135\x03\x02\x02\x02\u0135" + - "\u0136\b\x1B\x01\x02\u0136\u0138\x03\x02\x02\x02\u0137\u0133\x03\x02\x02" + - "\x02\u0137\u0138\x03\x02\x02\x02\u0138\u0139\x03\x02\x02\x02\u0139\u013D" + - "\x07#\x02\x02\u013A\u013B\x05\x94K\x02\u013B\u013C\b\x1B\x01\x02\u013C" + - "\u013E\x03\x02\x02\x02\u013D\u013A\x03\x02\x02\x02\u013D\u013E\x03\x02" + - "\x02\x02\u013E\u013F\x03\x02\x02\x02\u013F\u0143\x07#\x02\x02\u0140\u0141" + - "\x05\x94K\x02\u0141\u0142\b\x1B\x01\x02\u0142\u0144\x03\x02\x02\x02\u0143" + - "\u0140\x03\x02\x02\x02\u0143\u0144\x03\x02\x02\x02\u0144\u0145\x03\x02" + - "\x02\x02\u0145\u0146\x07'\x02\x02\u0146\u0147\x05$\x13\x02\u01475\x03" + - "\x02\x02\x02\u0148\u0149\x07\x11\x02\x02\u0149\u014A\x07&\x02\x02\u014A" + - "\u014B\x05\x94K\x02\u014B\u014C\x07'\x02\x02\u014C\u014D\x05$\x13\x02" + - "\u014D7\x03\x02\x02\x02\u014E\u014F\x07\x10\x02\x02\u014F\u0150\x05$\x13" + - "\x02\u0150\u0151\x07\x11\x02\x02\u0151\u0152\x07&\x02\x02\u0152\u0153" + - "\x05\x94K\x02\u0153\u0154\x07'\x02\x02\u0154\u0155\x07#\x02\x02\u0155" + - "9\x03\x02\x02\x02\u0156\u0157\t\x03\x02\x02\u0157\u0158\x07#\x02\x02\u0158" + - ";\x03\x02\x02\x02\u0159\u015B\x07\x17\x02\x02\u015A\u015C\x05\x94K\x02" + - "\u015B\u015A\x03\x02\x02\x02\u015B\u015C\x03\x02\x02\x02\u015C\u015D\x03" + - "\x02\x02\x02\u015D\u015E\x07#\x02\x02\u015E=\x03\x02\x02\x02\u015F\u016A" + - '\x05B"\x02\u0160\u016A\x05V,\x02\u0161\u016A\x05X-\x02\u0162\u016A\x05' + - "D#\x02\u0163\u016A\x05F$\x02\u0164\u016A\x05L'\x02\u0165\u016A\x05N(" + - "\x02\u0166\u016A\x05T+\x02\u0167\u016A\x05\\/\x02\u0168\u016A\x05@!\x02" + - "\u0169\u015F\x03\x02\x02\x02\u0169\u0160\x03\x02\x02\x02\u0169\u0161\x03" + - "\x02\x02\x02\u0169\u0162\x03\x02\x02\x02\u0169\u0163\x03\x02\x02\x02\u0169" + - "\u0164\x03\x02\x02\x02\u0169\u0165\x03\x02\x02\x02\u0169\u0166\x03\x02" + - "\x02\x02\u0169\u0167\x03\x02\x02\x02\u0169\u0168\x03\x02\x02\x02\u016A" + - "?\x03\x02\x02\x02\u016B\u016D\x07&\x02\x02\u016C\u016E\x05\x1C\x0F\x02" + - "\u016D\u016C\x03\x02\x02\x02\u016D\u016E\x03\x02\x02\x02\u016E\u016F\x03" + - "\x02\x02\x02\u016F\u0170\x07'\x02\x02\u0170\u0171\x07%\x02\x02\u0171" + - "\u0172\x05\x96L\x02\u0172\u0175\x07\x19\x02\x02\u0173\u0176\x05\x94K\x02" + - "\u0174\u0176\x05&\x14\x02\u0175\u0173\x03\x02\x02\x02\u0175\u0174\x03" + - "\x02\x02\x02\u0176A\x03\x02\x02\x02\u0177\u0178\x07&\x02\x02\u0178\u0179" + - "\x05\x94K\x02\u0179\u017A\x07'\x02\x02\u017AC\x03\x02\x02\x02\u017B\u017C" + - "\t\x04\x02\x02\u017CE\x03\x02\x02\x02\u017D\u017E\x05H%\x02\u017EG\x03" + - "\x02\x02\x02\u017F\u0180\x07L\x02\x02\u0180I\x03\x02\x02\x02\u0181\u0184" + - "\x05H%\x02\u0182\u0184\x05L'\x02\u0183\u0181\x03\x02\x02\x02\u0183\u0182" + - "\x03\x02\x02\x02\u0184K\x03\x02\x02\x02\u0185\u0186\t\x05\x02\x02\u0186" + - "M\x03\x02\x02\x02\u0187\u018B\x07S\x02\x02\u0188\u018A\x05P)\x02\u0189" + - "\u0188\x03\x02\x02\x02\u018A\u018D\x03\x02\x02\x02\u018B\u0189\x03\x02" + - "\x02\x02\u018B\u018C\x03\x02\x02\x02\u018C\u018E\x03\x02\x02\x02\u018D" + - "\u018B\x03\x02\x02\x02\u018E\u0198\x07U\x02\x02\u018F\u0193\x07T\x02\x02" + - "\u0190\u0192\x05R*\x02\u0191\u0190\x03\x02\x02\x02\u0192\u0195\x03\x02" + - "\x02\x02\u0193\u0191\x03\x02\x02\x02\u0193\u0194\x03\x02\x02\x02\u0194" + - "\u0196\x03\x02\x02\x02\u0195\u0193\x03\x02\x02\x02\u0196\u0198\x07W\x02" + - "\x02\u0197\u0187\x03\x02\x02\x02\u0197\u018F\x03\x02\x02\x02\u0198O\x03" + - "\x02\x02\x02\u0199\u01A0\x07V\x02\x02\u019A\u019C\x07\x03\x02\x02\u019B" + - "\u019D\x05\x94K\x02\u019C\u019B\x03\x02\x02\x02\u019C\u019D\x03\x02\x02" + - "\x02\u019D\u019E\x03\x02\x02\x02\u019E\u01A0\x07*\x02\x02\u019F\u0199" + - "\x03\x02\x02\x02\u019F\u019A\x03\x02\x02\x02\u01A0Q\x03\x02\x02\x02\u01A1" + - "\u01A8\x07X\x02\x02\u01A2\u01A4\x07\x03\x02\x02\u01A3\u01A5\x05\x94K\x02" + - "\u01A4\u01A3\x03\x02\x02\x02\u01A4\u01A5\x03\x02\x02\x02\u01A5\u01A6\x03" + - "\x02\x02\x02\u01A6\u01A8\x07*\x02\x02\u01A7\u01A1\x03\x02\x02\x02\u01A7" + - "\u01A2\x03\x02\x02\x02\u01A8S\x03\x02\x02\x02\u01A9\u01AA\t\x06\x02\x02" + - "\u01AAU\x03\x02\x02\x02\u01AB\u01B4\x07(\x02\x02\u01AC\u01B1\x05\x94K" + - '\x02\u01AD\u01AE\x07"\x02\x02\u01AE\u01B0\x05\x94K\x02\u01AF\u01AD\x03' + - "\x02\x02\x02\u01B0\u01B3\x03\x02\x02\x02\u01B1\u01AF\x03\x02\x02\x02\u01B1" + - "\u01B2\x03\x02\x02\x02\u01B2\u01B5\x03\x02\x02\x02\u01B3\u01B1\x03\x02" + - "\x02\x02\u01B4\u01AC\x03\x02\x02\x02\u01B4\u01B5\x03\x02\x02\x02\u01B5" + - '\u01B7\x03\x02\x02\x02\u01B6\u01B8\x07"\x02\x02\u01B7\u01B6\x03\x02\x02' + - "\x02\u01B7\u01B8\x03\x02\x02\x02\u01B8\u01B9\x03\x02\x02\x02\u01B9\u01BA" + - "\x07)\x02\x02\u01BAW\x03\x02\x02\x02\u01BB\u01C4\x07+\x02\x02\u01BC\u01C1" + - '\x05Z.\x02\u01BD\u01BE\x07"\x02\x02\u01BE\u01C0\x05Z.\x02\u01BF\u01BD' + - "\x03\x02\x02\x02\u01C0\u01C3\x03\x02\x02\x02\u01C1\u01BF\x03\x02\x02\x02" + - "\u01C1\u01C2\x03\x02\x02\x02\u01C2\u01C5\x03\x02\x02\x02\u01C3\u01C1\x03" + - "\x02\x02\x02\u01C4\u01BC\x03\x02\x02\x02\u01C4\u01C5\x03\x02\x02\x02\u01C5" + - '\u01C7\x03\x02\x02\x02\u01C6\u01C8\x07"\x02\x02\u01C7\u01C6\x03\x02\x02' + - "\x02\u01C7\u01C8\x03\x02\x02\x02\u01C8\u01C9\x03\x02\x02\x02\u01C9\u01CA" + - "\x07,\x02\x02\u01CAY\x03\x02\x02\x02\u01CB\u01CC\x05J&\x02\u01CC\u01CD" + - "\x07%\x02\x02\u01CD\u01CE\x05\x94K\x02\u01CE[\x03\x02\x02\x02\u01CF\u01D0" + - "\t\x07\x02\x02\u01D0]\x03\x02\x02\x02\u01D1\u01D2\b0\x01\x02\u01D2\u01DD" + - "\x05> \x02\u01D3\u01D4\x07\x18\x02\x02\u01D4\u01D5\x05^0\x02\u01D5\u01D7" + - "\x07&\x02\x02\u01D6\u01D8\x05`1\x02\u01D7\u01D6\x03\x02\x02\x02\u01D7" + - "\u01D8\x03\x02\x02\x02\u01D8\u01D9\x03\x02\x02\x02\u01D9\u01DA\x07'\x02" + - "\x02\u01DA\u01DB\b0\x01\x02\u01DB\u01DD\x03\x02\x02\x02\u01DC\u01D1\x03" + - "\x02\x02\x02\u01DC\u01D3\x03\x02\x02\x02\u01DD\u01F3\x03\x02\x02\x02\u01DE" + - "\u01DF\f\x07\x02\x02\u01DF\u01E1\x07&\x02\x02\u01E0\u01E2\x05`1\x02\u01E1" + - "\u01E0\x03\x02\x02\x02\u01E1\u01E2\x03\x02\x02\x02\u01E2\u01E3\x03\x02" + - "\x02\x02\u01E3\u01E4\x07'\x02\x02\u01E4\u01F2\b0\x01\x02\u01E5\u01E6" + - "\f\x05\x02\x02\u01E6\u01E7\x05b2\x02\u01E7\u01E8\b0\x01\x02\u01E8\u01F2" + - "\x03\x02\x02\x02\u01E9\u01EA\f\x04\x02\x02\u01EA\u01EB\x05d3\x02\u01EB" + - "\u01EC\b0\x01\x02\u01EC\u01F2\x03\x02\x02\x02\u01ED\u01EE\f\x03\x02\x02" + - "\u01EE\u01EF\x05f4\x02\u01EF\u01F0\b0\x01\x02\u01F0\u01F2\x03\x02\x02" + - "\x02\u01F1\u01DE\x03\x02\x02\x02\u01F1\u01E5\x03\x02\x02\x02\u01F1\u01E9" + - "\x03\x02\x02\x02\u01F1\u01ED\x03\x02\x02\x02\u01F2\u01F5\x03\x02\x02\x02" + - "\u01F3\u01F1\x03\x02\x02\x02\u01F3\u01F4\x03\x02\x02\x02\u01F4_\x03\x02" + - "\x02\x02\u01F5\u01F3\x03\x02\x02\x02\u01F6\u01FB\x05\x90I\x02\u01F7\u01F8" + - '\x07"\x02\x02\u01F8\u01FA\x05\x90I\x02\u01F9\u01F7\x03\x02\x02\x02\u01FA' + - "\u01FD\x03\x02\x02\x02\u01FB\u01F9\x03\x02\x02\x02\u01FB\u01FC\x03\x02" + - "\x02\x02\u01FCa\x03\x02\x02\x02\u01FD\u01FB\x03\x02\x02\x02\u01FE\u01FF" + - "\x07K\x02\x02\u01FF\u0200\x05H%\x02\u0200c\x03\x02\x02\x02\u0201\u0202" + - "\x07(\x02\x02\u0202\u0203\x05\x94K\x02\u0203\u0204\x07)\x02\x02\u0204" + - "e\x03\x02\x02\x02\u0205\u0209\x07(\x02\x02\u0206\u0207\x05\x94K\x02\u0207" + - "\u0208\b4\x01\x02\u0208\u020A\x03\x02\x02\x02\u0209\u0206\x03\x02\x02" + - "\x02\u0209\u020A\x03\x02\x02\x02\u020A\u020B\x03\x02\x02\x02\u020B\u020F" + - "\x07%\x02\x02\u020C\u020D\x05\x94K\x02\u020D\u020E\b4\x01\x02\u020E\u0210" + - "\x03\x02\x02\x02\u020F\u020C\x03\x02\x02\x02\u020F\u0210\x03\x02\x02\x02" + - "\u0210\u0211\x03\x02\x02\x02\u0211\u0212\x07)\x02\x02\u0212g\x03\x02\x02" + - "\x02\u0213\u0216\x05^0\x02\u0214\u0216\x05j6\x02\u0215\u0213\x03\x02\x02" + - "\x02\u0215\u0214\x03\x02\x02\x02\u0216i\x03\x02\x02\x02\u0217\u0218\x05" + - "^0\x02\u0218\u0219\x05r:\x02\u0219k\x03\x02\x02\x02\u021A\u021E\x05h5" + - "\x02\u021B\u021E\x05n8\x02\u021C\u021E\x05p9\x02\u021D\u021A\x03\x02\x02" + - "\x02\u021D\u021B\x03\x02\x02\x02\u021D\u021C\x03\x02\x02\x02\u021Em\x03" + - "\x02\x02\x02\u021F\u0220\x05r:\x02\u0220\u0221\x05h5\x02\u0221o\x03\x02" + - "\x02\x02\u0222\u0223\x05t;\x02\u0223\u0224\x05h5\x02\u0224q\x03\x02\x02" + - "\x02\u0225\u0226\t\b\x02\x02\u0226s\x03\x02"; + "O\tO\x04P\tP\x04Q\tQ\x04R\tR\x04S\tS\x03\x02\x05\x02\xA8\n\x02\x03\x02" + + "\x03\x02\x03\x03\x06\x03\xAD\n\x03\r\x03\x0E\x03\xAE\x03\x04\x03\x04\x03" + + "\x05\x06\x05\xB4\n\x05\r\x05\x0E\x05\xB5\x03\x06\x03\x06\x03\x06\x05\x06" + + "\xBB\n\x06\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x05\x07\xC3" + + "\n\x07\x03\b\x03\b\x03\b\x03\t\x03\t\x03\n\x03\n\x03\n\x03\n\x03\n\x05" + + "\n\xCF\n\n\x03\v\x03\v\x03\f\x03\f\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0E" + + "\x03\x0E\x05\x0E\xDB\n\x0E\x03\x0E\x03\x0E\x03\x0E\x03\x0E\x05\x0E\xE1" + + "\n\x0E\x03\x0F\x03\x0F\x03\x0F\x07\x0F\xE6\n\x0F\f\x0F\x0E\x0F\xE9\v\x0F" + + "\x03\x10\x03\x10\x03\x10\x03\x10\x03\x11\x03\x11\x03\x11\x03\x11\x07\x11" + + "\xF3\n\x11\f\x11\x0E\x11\xF6\v\x11\x03\x11\x03\x11\x03\x12\x03\x12\x05" + + "\x12\xFC\n\x12\x03\x13\x03\x13\x03\x13\x03\x13\x03\x13\x03\x14\x03\x14" + + "\x03\x14\x05\x14\u0106\n\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03\x14\x03" + + "\x15\x03\x15\x03\x15\x03\x15\x03\x15\x03\x16\x03\x16\x03\x16\x03\x16\x03" + + "\x16\x03\x16\x05\x16\u0118\n\x16\x03\x17\x03\x17\x03\x17\x05\x17\u011D" + + "\n\x17\x03\x17\x03\x17\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x19" + + "\x03\x19\x05\x19\u0128\n\x19\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03" + + "\x1A\x03\x1A\x05\x1A\u0131\n\x1A\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B" + + "\x03\x1B\x07\x1B\u0139\n\x1B\f\x1B\x0E\x1B\u013C\v\x1B\x03\x1B\x03\x1B" + + "\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x05\x1C" + + "\u0148\n\x1C\x03\x1D\x03\x1D\x03\x1D\x05\x1D\u014D\n\x1D\x03\x1E\x03\x1E" + + "\x03\x1E\x03\x1E\x05\x1E\u0153\n\x1E\x03\x1E\x03\x1E\x05\x1E\u0157\n\x1E" + + "\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x05\x1E\u015D\n\x1E\x03\x1E\x03\x1E\x03" + + "\x1E\x03\x1E\x05\x1E\u0163\n\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F" + + "\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03 \x03 \x03 \x03 \x03 \x03 \x03 \x03" + + ' \x03!\x03!\x03!\x03"\x03"\x05"\u017B\n"\x03"\x03"\x03#\x03#\x03' + + "#\x03#\x03#\x03#\x03#\x03#\x03#\x03#\x05#\u0189\n#\x03$\x03$\x05$\u018D" + + "\n$\x03$\x03$\x03$\x03$\x03$\x03$\x05$\u0195\n$\x03%\x03%\x03%\x03%\x03" + + "&\x03&\x03'\x03'\x03(\x03(\x03)\x03)\x05)\u01A3\n)\x03*\x03*\x03+\x03" + + "+\x07+\u01A9\n+\f+\x0E+\u01AC\v+\x03+\x03+\x03+\x07+\u01B1\n+\f+\x0E+" + + "\u01B4\v+\x03+\x05+\u01B7\n+\x03,\x03,\x03,\x05,\u01BC\n,\x03,\x05,\u01BF" + + "\n,\x03-\x03-\x03-\x05-\u01C4\n-\x03-\x05-\u01C7\n-\x03.\x03.\x03/\x03" + + "/\x03/\x03/\x07/\u01CF\n/\f/\x0E/\u01D2\v/\x05/\u01D4\n/\x03/\x05/\u01D7" + + "\n/\x03/\x03/\x030\x030\x030\x030\x070\u01DF\n0\f0\x0E0\u01E2\v0\x050" + + "\u01E4\n0\x030\x050\u01E7\n0\x030\x030\x031\x031\x031\x031\x032\x032\x03" + + "3\x033\x033\x033\x033\x033\x053\u01F7\n3\x033\x033\x033\x053\u01FC\n3" + + "\x033\x033\x033\x053\u0201\n3\x033\x033\x033\x033\x033\x033\x033\x033" + + "\x033\x033\x033\x033\x033\x033\x073\u0211\n3\f3\x0E3\u0214\v3\x034\x03" + + "4\x034\x074\u0219\n4\f4\x0E4\u021C\v4\x035\x035\x035\x036\x036\x036\x03" + + "6\x037\x037\x037\x037\x057\u0229\n7\x037\x037\x037\x037\x057\u022F\n7" + + "\x037\x037\x038\x038\x058\u0235\n8\x039\x039\x039\x03:\x03:\x03:\x05:" + + "\u023D\n:\x03;\x03;\x03;\x03<\x03<\x03<\x03=\x03=\x03>\x03>\x03?\x03?" + + "\x03?\x03?\x03?\x05?\u024E\n?\x03@\x03@\x03@\x03@\x03@\x03@\x07@\u0256" + + "\n@\f@\x0E@\u0259\v@\x03A\x03A\x03A\x03A\x03A\x03A\x07A\u0261\nA\fA\x0E" + + "A\u0264\vA\x03B\x03B\x03B\x03B\x03B\x03B\x03B\x07B\u026D\nB\fB\x0EB\u0270" + + "\vB\x03C\x03C\x03D\x03D\x03D\x03D\x03D\x03D\x07D\u027A\nD\fD\x0ED\u027D" + + "\vD\x03E\x03E\x03E\x03E\x03E\x03E\x07E\u0285\nE\fE\x0EE\u0288\vE\x03F" + + "\x03F\x03F\x03F\x03F\x03F\x07F\u0290\nF\fF\x0EF\u0293\vF\x03G\x03G\x03" + + "G\x03G\x03G\x03G\x07G\u029B\nG\fG\x0EG\u029E\vG\x03H\x03H\x03H\x03H\x03" + + "H\x03H\x07H\u02A6\nH\fH\x0EH\u02A9\vH\x03I\x03I\x03I\x03I\x03I\x03I\x07" + + "I\u02B1\nI\fI\x0EI\u02B4\vI\x03J\x03J\x03J\x03J\x03J\x03J\x07J\u02BC\n" + + "J\fJ\x0EJ\u02BF\vJ\x03K\x03K\x03K\x03K\x03K\x03K\x03K\x05K\u02C8\nK\x03" + + "L\x03L\x03L\x03L\x03L\x05L\u02CF\nL\x03M\x03M\x03N\x03N\x03N\x07N\u02D6" + + "\nN\fN\x0EN\u02D9\vN\x03O\x03O\x03O\x05O\u02DE\nO\x03P\x03P\x03Q\x03Q" + + "\x03Q\x03Q\x03Q\x03R\x03R\x03R\x03R\x03R\x03S\x03S\x03S\x02\x02\rd~\x80" + + "\x82\x86\x88\x8A\x8C\x8E\x90\x92T\x02\x02\x04\x02\x06\x02\b\x02\n\x02" + + "\f\x02\x0E\x02\x10\x02\x12\x02\x14\x02\x16\x02\x18\x02\x1A\x02\x1C\x02" + + '\x1E\x02 \x02"\x02$\x02&\x02(\x02*\x02,\x02.\x020\x022\x024\x026\x02' + + "8\x02:\x02<\x02>\x02@\x02B\x02D\x02F\x02H\x02J\x02L\x02N\x02P\x02R\x02" + + "T\x02V\x02X\x02Z\x02\\\x02^\x02`\x02b\x02d\x02f\x02h\x02j\x02l\x02n\x02" + + "p\x02r\x02t\x02v\x02x\x02z\x02|\x02~\x02\x80\x02\x82\x02\x84\x02\x86\x02" + + "\x88\x02\x8A\x02\x8C\x02\x8E\x02\x90\x02\x92\x02\x94\x02\x96\x02\x98\x02" + + "\x9A\x02\x9C\x02\x9E\x02\xA0\x02\xA2\x02\xA4\x02\x02\x11\x03\x02\x07\b" + + "\x03\x02\x0E\x0F\x03\x02\x1C\x1D\x03\x02NO\x04\x02MMPP\x03\x02\x1F!\x04" + + "\x02..00\x06\x02--//77GG\x03\x0214\x04\x02--//\x03\x02HJ\x03\x02@C\x03" + + "\x02>?\x03\x028=\x04\x02\x1F!LL\x02\u02F1\x02\xA7\x03\x02\x02\x02\x04" + + "\xAC\x03\x02\x02\x02\x06\xB0\x03\x02\x02\x02\b\xB3\x03\x02\x02\x02\n\xBA" + + "\x03\x02\x02\x02\f\xC2\x03\x02\x02\x02\x0E\xC4\x03\x02\x02\x02\x10\xC7" + + "\x03\x02\x02\x02\x12\xC9\x03\x02\x02\x02\x14\xD0\x03\x02\x02\x02\x16\xD2" + + "\x03\x02\x02\x02\x18\xD4\x03\x02\x02\x02\x1A\xD6\x03\x02\x02\x02\x1C\xE2" + + '\x03\x02\x02\x02\x1E\xEA\x03\x02\x02\x02 \xEE\x03\x02\x02\x02"\xFB\x03' + + "\x02\x02\x02$\xFD\x03\x02\x02\x02&\u0102\x03\x02\x02\x02(\u010C\x03\x02" + + "\x02\x02*\u0117\x03\x02\x02\x02,\u0119\x03\x02\x02\x02.\u0120\x03\x02" + + "\x02\x020\u0127\x03\x02\x02\x022\u0129\x03\x02\x02\x024\u0132\x03\x02" + + "\x02\x026\u0147\x03\x02\x02\x028\u014C\x03\x02\x02\x02:\u014E\x03\x02" + + "\x02\x02<\u0167\x03\x02\x02\x02>\u016D\x03\x02\x02\x02@\u0175\x03\x02" + + "\x02\x02B\u0178\x03\x02\x02\x02D\u0188\x03\x02\x02\x02F\u018A\x03\x02" + + "\x02\x02H\u0196\x03\x02\x02\x02J\u019A\x03\x02\x02\x02L\u019C\x03\x02" + + "\x02\x02N\u019E\x03\x02\x02\x02P\u01A2\x03\x02\x02\x02R\u01A4\x03\x02" + + "\x02\x02T\u01B6\x03\x02\x02\x02V\u01BE\x03\x02\x02\x02X\u01C6\x03\x02" + + "\x02\x02Z\u01C8\x03\x02\x02\x02\\\u01CA\x03\x02\x02\x02^\u01DA\x03\x02" + + "\x02\x02`\u01EA\x03\x02\x02\x02b\u01EE\x03\x02\x02\x02d\u01FB\x03\x02" + + "\x02\x02f\u0215\x03\x02\x02\x02h\u021D\x03\x02\x02\x02j\u0220\x03\x02" + + "\x02\x02l\u0224\x03\x02\x02\x02n\u0234\x03\x02\x02\x02p\u0236\x03\x02" + + "\x02\x02r\u023C\x03\x02\x02\x02t\u023E\x03\x02\x02\x02v\u0241\x03\x02" + + "\x02\x02x\u0244\x03\x02\x02\x02z\u0246\x03\x02\x02\x02|\u024D\x03\x02" + + "\x02\x02~\u024F\x03\x02\x02\x02\x80\u025A\x03\x02\x02\x02\x82\u0265\x03" + + "\x02\x02\x02\x84\u0271\x03\x02\x02\x02\x86\u0273\x03\x02\x02\x02\x88\u027E" + + "\x03\x02\x02\x02\x8A\u0289\x03\x02\x02\x02\x8C\u0294\x03\x02\x02\x02\x8E" + + "\u029F\x03\x02\x02\x02\x90\u02AA\x03\x02\x02\x02\x92\u02B5\x03\x02\x02" + + "\x02\x94\u02C7\x03\x02\x02\x02\x96\u02CE\x03\x02\x02\x02\x98\u02D0\x03" + + "\x02\x02\x02\x9A\u02D2\x03\x02\x02\x02\x9C\u02DD\x03\x02\x02\x02\x9E\u02DF" + + "\x03\x02\x02\x02\xA0\u02E1\x03\x02\x02\x02\xA2\u02E6\x03\x02\x02\x02\xA4" + + "\u02EB\x03\x02\x02\x02\xA6\xA8\x05\x04\x03\x02\xA7\xA6\x03\x02\x02\x02" + + "\xA7\xA8\x03\x02\x02\x02\xA8\xA9\x03\x02\x02\x02\xA9\xAA\x07\x02\x02\x03" + + "\xAA\x03\x03\x02\x02\x02\xAB\xAD\x05\x06\x04\x02\xAC\xAB\x03\x02\x02\x02" + + "\xAD\xAE\x03\x02\x02\x02\xAE\xAC\x03\x02\x02\x02\xAE\xAF\x03\x02\x02\x02" + + "\xAF\x05\x03\x02\x02\x02\xB0\xB1\x05\b\x05\x02\xB1\x07\x03\x02\x02\x02" + + "\xB2\xB4\x05\n\x06\x02\xB3\xB2\x03\x02\x02\x02\xB4\xB5\x03\x02\x02\x02" + + "\xB5\xB3\x03\x02\x02\x02\xB5\xB6\x03\x02\x02\x02\xB6\t\x03\x02\x02\x02" + + "\xB7\xBB\x05*\x16\x02\xB8\xBB\x05\f\x07\x02\xB9\xBB\x07#\x02\x02\xBA\xB7" + + "\x03\x02\x02\x02\xBA\xB8\x03\x02\x02\x02\xBA\xB9\x03\x02\x02\x02\xBB\v" + + "\x03\x02\x02\x02\xBC\xBD\x05\x0E\b\x02\xBD\xBE\x07#\x02\x02\xBE\xC3\x03" + + "\x02\x02\x02\xBF\xC3\x05\x1A\x0E\x02\xC0\xC3\x05 \x11\x02\xC1\xC3\x05" + + "(\x15\x02\xC2\xBC\x03\x02\x02\x02\xC2\xBF\x03\x02\x02\x02\xC2\xC0\x03" + + "\x02\x02\x02\xC2\xC1\x03\x02\x02\x02\xC3\r\x03\x02\x02\x02\xC4\xC5\x05" + + "\x10\t\x02\xC5\xC6\x05\x12\n\x02\xC6\x0F\x03\x02\x02\x02\xC7\xC8\t\x02" + + "\x02\x02\xC8\x11\x03\x02\x02\x02\xC9\xCA\x05\x16\f\x02\xCA\xCB\x07%\x02" + + "\x02\xCB\xCE\x05\x9CO\x02\xCC\xCD\x078\x02\x02\xCD\xCF\x05\x14\v\x02\xCE" + + "\xCC\x03\x02\x02\x02\xCE\xCF\x03\x02\x02\x02\xCF\x13\x03\x02\x02\x02\xD0" + + "\xD1\x05\x96L\x02\xD1\x15\x03\x02\x02\x02\xD2\xD3\x05\x18\r\x02\xD3\x17" + + "\x03\x02\x02\x02\xD4\xD5\x07L\x02\x02\xD5\x19\x03\x02\x02\x02\xD6\xD7" + + "\x07\x16\x02\x02\xD7\xD8\x05\x16\f\x02\xD8\xDA\x07&\x02\x02\xD9\xDB\x05" + + "\x1C\x0F\x02\xDA\xD9\x03\x02\x02\x02\xDA\xDB\x03\x02\x02\x02\xDB\xDC\x03" + + "\x02\x02\x02\xDC\xDD\x07'\x02\x02\xDD\xDE\x07\x19\x02\x02\xDE\xE0\x05" + + "\x9CO\x02\xDF\xE1\x05,\x17\x02\xE0\xDF\x03\x02\x02\x02\xE0\xE1\x03\x02" + + '\x02\x02\xE1\x1B\x03\x02\x02\x02\xE2\xE7\x05\x1E\x10\x02\xE3\xE4\x07"' + + "\x02\x02\xE4\xE6\x05\x1E\x10\x02\xE5\xE3\x03\x02\x02\x02\xE6\xE9\x03\x02" + + "\x02\x02\xE7\xE5\x03\x02\x02\x02\xE7\xE8\x03\x02\x02\x02\xE8\x1D\x03\x02" + + "\x02\x02\xE9\xE7\x03\x02\x02\x02\xEA\xEB\x05\x16\f\x02\xEB\xEC\x07%\x02" + + "\x02\xEC\xED\x05\x9CO\x02\xED\x1F\x03\x02\x02\x02\xEE\xEF\x07\x1B\x02" + + '\x02\xEF\xF0\x05\x16\f\x02\xF0\xF4\x07+\x02\x02\xF1\xF3\x05"\x12\x02' + + "\xF2\xF1\x03\x02\x02\x02\xF3\xF6\x03\x02\x02\x02\xF4\xF2\x03\x02\x02\x02" + + "\xF4\xF5\x03\x02\x02\x02\xF5\xF7\x03\x02\x02\x02\xF6\xF4\x03\x02\x02\x02" + + "\xF7\xF8\x07,\x02\x02\xF8!\x03\x02\x02\x02\xF9\xFC\x05$\x13\x02\xFA\xFC" + + "\x05&\x14\x02\xFB\xF9\x03\x02\x02\x02\xFB\xFA\x03\x02\x02\x02\xFC#\x03" + + "\x02\x02\x02\xFD\xFE\x05\x16\f\x02\xFE\xFF\x07%\x02\x02\xFF\u0100\x05" + + "\x9CO\x02\u0100\u0101\x07#\x02\x02\u0101%\x03\x02\x02\x02\u0102\u0103" + + "\x05\x16\f\x02\u0103\u0105\x07&\x02\x02\u0104\u0106\x05\x1C\x0F\x02\u0105" + + "\u0104\x03\x02\x02\x02\u0105\u0106\x03\x02\x02\x02\u0106\u0107\x03\x02" + + "\x02\x02\u0107\u0108\x07'\x02\x02\u0108\u0109\x07%\x02\x02\u0109\u010A" + + "\x05\x9CO\x02\u010A\u010B\x07#\x02\x02\u010B'\x03\x02\x02\x02\u010C\u010D" + + "\x07\x1A\x02\x02\u010D\u010E\x05\x16\f\x02\u010E\u010F\x07+\x02\x02\u010F" + + "\u0110\x07,\x02\x02\u0110)\x03\x02\x02\x02\u0111\u0118\x05.\x18\x02\u0112" + + "\u0118\x050\x19\x02\u0113\u0118\x058\x1D\x02\u0114\u0118\x05@!\x02\u0115" + + '\u0118\x05B"\x02\u0116\u0118\x05,\x17\x02\u0117\u0111\x03\x02\x02\x02' + + "\u0117\u0112\x03\x02\x02\x02\u0117\u0113\x03\x02\x02\x02\u0117\u0114\x03" + + "\x02\x02\x02\u0117\u0115\x03\x02\x02\x02\u0117\u0116\x03\x02\x02\x02\u0118" + + "+\x03\x02\x02\x02\u0119\u011A\x06\x17\x02\x02\u011A\u011C\x07+\x02\x02" + + "\u011B\u011D\x05\b\x05\x02\u011C\u011B\x03\x02\x02\x02\u011C\u011D\x03" + + "\x02\x02\x02\u011D\u011E\x03\x02\x02\x02\u011E\u011F\x07,\x02\x02\u011F" + + "-\x03\x02\x02\x02\u0120\u0121\b\x18\x01\x02\u0121\u0122\x05\x9AN\x02\u0122" + + "\u0123\x07#\x02\x02\u0123\u0124\b\x18\x01\x02\u0124/\x03\x02\x02\x02\u0125" + + "\u0128\x052\x1A\x02\u0126\u0128\x054\x1B\x02\u0127\u0125\x03\x02\x02\x02" + + "\u0127\u0126\x03\x02\x02\x02\u01281\x03\x02\x02\x02\u0129\u012A\x07\x12" + + "\x02\x02\u012A\u012B\x07&\x02\x02\u012B\u012C\x05\x9AN\x02\u012C\u012D" + + "\x07'\x02\x02\u012D\u0130\x05*\x16\x02\u012E\u012F\x07\x13\x02\x02\u012F" + + "\u0131\x05*\x16\x02\u0130\u012E\x03\x02\x02\x02\u0130\u0131\x03\x02\x02" + + "\x02\u01313\x03\x02\x02\x02\u0132\u0133\x07\v\x02\x02\u0133\u0134\x07" + + "&\x02\x02\u0134\u0135\x05\x9AN\x02\u0135\u0136\x07'\x02\x02\u0136\u013A" + + "\x07+\x02\x02\u0137\u0139\x056\x1C\x02\u0138\u0137\x03\x02\x02\x02\u0139" + + "\u013C\x03\x02\x02\x02\u013A\u0138\x03\x02\x02\x02\u013A\u013B\x03\x02" + + "\x02\x02\u013B\u013D\x03\x02\x02\x02\u013C\u013A\x03\x02\x02\x02\u013D" + + "\u013E\x07,\x02\x02\u013E5\x03\x02\x02\x02\u013F\u0140\x07\f\x02\x02\u0140" + + "\u0141\x05\x9AN\x02\u0141\u0142\x07%\x02\x02\u0142\u0143\x05*\x16\x02" + + "\u0143\u0148\x03\x02\x02\x02\u0144\u0145\x07\r\x02\x02\u0145\u0146\x07" + + "%\x02\x02\u0146\u0148\x05*\x16\x02\u0147\u013F\x03\x02\x02\x02\u0147\u0144" + + "\x03\x02\x02\x02\u01487\x03\x02\x02\x02\u0149\u014D\x05:\x1E\x02\u014A" + + "\u014D\x05<\x1F\x02\u014B\u014D\x05> \x02\u014C\u0149\x03\x02\x02\x02" + + "\u014C\u014A\x03\x02\x02\x02\u014C\u014B\x03\x02\x02\x02\u014D9\x03\x02" + + "\x02\x02\u014E\u014F\x07\x14\x02\x02\u014F\u0156\x07&\x02\x02\u0150\u0153" + + "\x05\x0E\b\x02\u0151\u0153\x05\x9AN\x02\u0152\u0150\x03\x02\x02\x02\u0152" + + "\u0151\x03\x02\x02\x02\u0153\u0154\x03\x02\x02\x02\u0154\u0155\b\x1E\x01" + + "\x02\u0155\u0157\x03\x02\x02\x02\u0156\u0152\x03\x02\x02\x02\u0156\u0157" + + "\x03\x02\x02\x02\u0157\u0158\x03\x02\x02\x02\u0158\u015C\x07#\x02\x02" + + "\u0159\u015A\x05\x9AN\x02\u015A\u015B\b\x1E\x01\x02\u015B\u015D\x03\x02" + + "\x02\x02\u015C\u0159\x03\x02\x02\x02\u015C\u015D\x03\x02\x02\x02\u015D" + + "\u015E\x03\x02\x02\x02\u015E\u0162\x07#\x02\x02\u015F\u0160\x05\x9AN\x02" + + "\u0160\u0161\b\x1E\x01\x02\u0161\u0163\x03\x02\x02\x02\u0162\u015F\x03" + + "\x02\x02\x02\u0162\u0163\x03\x02\x02\x02\u0163\u0164\x03\x02\x02\x02\u0164" + + "\u0165\x07'\x02\x02\u0165\u0166\x05*\x16\x02\u0166;\x03\x02\x02\x02\u0167" + + "\u0168\x07\x11\x02\x02\u0168\u0169\x07&\x02\x02\u0169\u016A\x05\x9AN\x02" + + "\u016A\u016B\x07'\x02\x02\u016B\u016C\x05*\x16\x02\u016C=\x03\x02\x02" + + "\x02\u016D\u016E\x07\x10\x02\x02\u016E\u016F\x05*\x16\x02\u016F\u0170" + + "\x07\x11\x02\x02\u0170\u0171\x07&\x02\x02\u0171\u0172\x05\x9AN\x02\u0172" + + "\u0173\x07'\x02\x02\u0173\u0174\x07#\x02\x02\u0174?\x03\x02\x02\x02\u0175" + + "\u0176\t\x03\x02\x02\u0176\u0177\x07#\x02\x02\u0177A\x03\x02\x02\x02\u0178" + + "\u017A\x07\x17\x02\x02\u0179\u017B\x05\x9AN\x02\u017A\u0179\x03\x02\x02" + + "\x02\u017A\u017B\x03\x02\x02\x02\u017B\u017C\x03\x02\x02\x02\u017C\u017D" + + "\x07#\x02\x02\u017DC\x03\x02\x02\x02\u017E\u0189\x05H%\x02\u017F\u0189" + + "\x05F$\x02\u0180\u0189\x05\\/\x02\u0181\u0189\x05^0\x02\u0182\u0189\x05" + + "J&\x02\u0183\u0189\x05L'\x02\u0184\u0189\x05R*\x02\u0185\u0189\x05T+" + + "\x02\u0186\u0189\x05Z.\x02\u0187\u0189\x05b2\x02\u0188\u017E\x03\x02\x02" + + "\x02\u0188\u017F\x03\x02\x02\x02\u0188\u0180\x03\x02\x02\x02\u0188\u0181" + + "\x03\x02\x02\x02\u0188\u0182\x03\x02\x02\x02\u0188\u0183\x03\x02\x02\x02" + + "\u0188\u0184\x03\x02\x02\x02\u0188\u0185\x03\x02\x02\x02\u0188\u0186\x03" + + "\x02\x02\x02\u0188\u0187\x03\x02\x02\x02\u0189E\x03\x02\x02\x02\u018A" + + "\u018C\x07&\x02\x02\u018B\u018D\x05\x1C\x0F\x02\u018C\u018B\x03\x02\x02" + + "\x02\u018C\u018D\x03\x02\x02\x02\u018D\u018E\x03\x02\x02\x02\u018E\u018F" + + "\x07'\x02\x02\u018F\u0190\x07%\x02\x02\u0190\u0191\x05\x9CO\x02\u0191" + + "\u0194\x07\x19\x02\x02\u0192\u0195\x05\x9AN\x02\u0193\u0195\x05,\x17\x02" + + "\u0194\u0192\x03\x02\x02\x02\u0194\u0193\x03\x02\x02\x02\u0195G\x03\x02" + + "\x02\x02\u0196\u0197\x07&\x02\x02\u0197\u0198\x05\x9AN\x02\u0198\u0199" + + "\x07'\x02\x02\u0199I\x03\x02\x02\x02\u019A\u019B\t\x04\x02\x02\u019B" + + "K\x03\x02\x02\x02\u019C\u019D\x05N(\x02\u019DM\x03\x02\x02\x02\u019E\u019F" + + "\x07L\x02\x02\u019FO\x03\x02\x02\x02\u01A0\u01A3\x05N(\x02\u01A1\u01A3" + + "\x05R*\x02\u01A2\u01A0\x03\x02\x02\x02\u01A2\u01A1\x03\x02\x02\x02\u01A3" + + "Q\x03\x02\x02\x02\u01A4\u01A5\t\x05\x02\x02\u01A5S\x03\x02\x02\x02\u01A6" + + "\u01AA\x07S\x02\x02\u01A7\u01A9\x05V,\x02\u01A8\u01A7\x03\x02\x02\x02" + + "\u01A9\u01AC\x03\x02\x02\x02\u01AA\u01A8\x03\x02\x02\x02\u01AA\u01AB\x03" + + "\x02\x02\x02\u01AB\u01AD\x03\x02\x02\x02\u01AC\u01AA\x03\x02\x02\x02\u01AD" + + "\u01B7\x07U\x02\x02\u01AE\u01B2\x07T\x02\x02\u01AF\u01B1\x05X-\x02\u01B0" + + "\u01AF\x03\x02\x02\x02\u01B1\u01B4\x03\x02\x02\x02\u01B2\u01B0\x03\x02" + + "\x02\x02\u01B2\u01B3\x03\x02\x02\x02\u01B3\u01B5\x03\x02\x02\x02\u01B4" + + "\u01B2\x03\x02\x02\x02\u01B5\u01B7\x07W\x02\x02\u01B6\u01A6\x03\x02\x02" + + "\x02\u01B6\u01AE\x03\x02\x02\x02\u01B7U\x03\x02\x02\x02\u01B8\u01BF\x07" + + "V\x02\x02\u01B9\u01BB\x07\x03\x02\x02\u01BA\u01BC\x05\x9AN\x02\u01BB\u01BA" + + "\x03\x02\x02\x02\u01BB\u01BC\x03\x02\x02\x02\u01BC\u01BD\x03\x02\x02\x02" + + "\u01BD\u01BF\x07*\x02\x02\u01BE\u01B8\x03\x02\x02\x02\u01BE\u01B9\x03" + + "\x02\x02\x02\u01BFW\x03\x02\x02\x02\u01C0\u01C7\x07X\x02\x02\u01C1\u01C3" + + "\x07\x03\x02\x02\u01C2\u01C4\x05\x9AN\x02\u01C3\u01C2\x03\x02\x02\x02" + + "\u01C3\u01C4\x03\x02\x02\x02\u01C4\u01C5\x03\x02\x02\x02\u01C5\u01C7\x07" + + "*\x02\x02\u01C6\u01C0\x03\x02\x02\x02\u01C6\u01C1\x03\x02\x02\x02\u01C7" + + "Y\x03\x02\x02\x02\u01C8\u01C9\t\x06\x02\x02\u01C9[\x03\x02\x02\x02\u01CA" + + '\u01D3\x07(\x02\x02\u01CB\u01D0\x05\x9AN\x02\u01CC\u01CD\x07"\x02\x02' + + "\u01CD\u01CF\x05\x9AN\x02\u01CE\u01CC\x03\x02\x02\x02\u01CF\u01D2\x03" + + "\x02\x02\x02\u01D0\u01CE\x03\x02\x02\x02\u01D0\u01D1\x03\x02\x02\x02\u01D1" + + "\u01D4\x03\x02\x02\x02\u01D2\u01D0\x03\x02\x02\x02\u01D3\u01CB\x03\x02" + + "\x02\x02\u01D3\u01D4\x03\x02\x02\x02\u01D4\u01D6\x03\x02\x02\x02\u01D5" + + '\u01D7\x07"\x02\x02\u01D6\u01D5\x03\x02\x02\x02\u01D6\u01D7\x03\x02\x02' + + "\x02\u01D7\u01D8\x03\x02\x02\x02\u01D8\u01D9\x07)\x02\x02\u01D9]\x03\x02" + + "\x02\x02\u01DA\u01E3\x07+\x02\x02\u01DB\u01E0\x05`1\x02\u01DC\u01DD\x07" + + '"\x02\x02\u01DD\u01DF\x05`1\x02\u01DE\u01DC\x03\x02\x02\x02\u01DF\u01E2' + + "\x03\x02\x02\x02\u01E0\u01DE\x03\x02\x02\x02\u01E0\u01E1\x03\x02\x02\x02" + + "\u01E1\u01E4\x03\x02\x02\x02\u01E2\u01E0\x03\x02\x02\x02\u01E3\u01DB\x03" + + "\x02\x02\x02\u01E3\u01E4\x03\x02\x02\x02\u01E4\u01E6\x03\x02\x02\x02\u01E5" + + '\u01E7\x07"\x02\x02\u01E6\u01E5\x03\x02\x02\x02\u01E6\u01E7\x03\x02\x02' + + "\x02\u01E7\u01E8\x03\x02\x02\x02\u01E8\u01E9\x07,\x02\x02\u01E9_\x03\x02" + + "\x02\x02\u01EA\u01EB\x05P)\x02\u01EB\u01EC\x07%\x02\x02\u01EC\u01ED\x05" + + "\x9AN\x02\u01EDa\x03\x02\x02\x02\u01EE\u01EF\t\x07\x02\x02\u01EFc\x03" + + "\x02\x02\x02\u01F0\u01F1\b3\x01\x02\u01F1\u01FC\x05D#\x02\u01F2\u01F3" + + "\x07\x18\x02\x02\u01F3\u01F4\x05d3\x02\u01F4\u01F6\x07&\x02\x02\u01F5" + + "\u01F7\x05f4\x02\u01F6\u01F5\x03\x02\x02\x02\u01F6\u01F7\x03\x02\x02\x02" + + "\u01F7\u01F8\x03\x02\x02\x02\u01F8\u01F9\x07'\x02\x02\u01F9\u01FA\b3" + + "\x01\x02\u01FA\u01FC\x03\x02\x02\x02\u01FB\u01F0\x03\x02\x02\x02\u01FB" + + "\u01F2\x03\x02\x02\x02\u01FC\u0212\x03\x02\x02\x02\u01FD\u01FE\f\x07\x02" + + "\x02\u01FE\u0200\x07&\x02\x02\u01FF\u0201\x05f4\x02\u0200\u01FF\x03\x02" + + "\x02\x02\u0200\u0201\x03\x02\x02\x02\u0201\u0202\x03\x02\x02\x02\u0202" + + "\u0203\x07'\x02\x02\u0203\u0211\b3\x01\x02\u0204\u0205\f\x05\x02\x02" + + "\u0205\u0206\x05h5\x02\u0206\u0207\b3\x01\x02\u0207\u0211\x03\x02\x02" + + "\x02\u0208\u0209\f\x04\x02\x02\u0209\u020A\x05j6\x02\u020A\u020B\b3\x01" + + "\x02\u020B\u0211\x03\x02\x02\x02\u020C\u020D\f\x03\x02\x02\u020D\u020E" + + "\x05l7\x02\u020E\u020F\b3\x01\x02\u020F\u0211\x03\x02\x02\x02\u0210\u01FD" + + "\x03\x02\x02\x02\u0210\u0204\x03\x02\x02\x02\u0210\u0208\x03\x02\x02\x02" + + "\u0210\u020C\x03\x02\x02\x02\u0211\u0214\x03\x02\x02\x02\u0212\u0210\x03" + + "\x02\x02\x02\u0212\u0213\x03\x02\x02\x02\u0213e\x03\x02\x02\x02\u0214" + + '\u0212\x03\x02\x02\x02\u0215\u021A\x05\x96L\x02\u0216\u0217\x07"\x02' + + "\x02\u0217\u0219\x05\x96L\x02\u0218\u0216\x03\x02\x02\x02\u0219\u021C" + + "\x03\x02\x02\x02\u021A\u0218\x03\x02\x02\x02\u021A\u021B\x03\x02\x02\x02" + + "\u021Bg\x03\x02\x02\x02\u021C\u021A\x03\x02\x02\x02\u021D\u021E\x07K\x02" + + "\x02\u021E\u021F\x05N(\x02\u021Fi\x03\x02"; private static readonly _serializedATNSegment1: string = - "\x02\x02\u0227\u0228\t\t\x02\x02\u0228u\x03\x02\x02\x02\u0229\u022F\x05" + - "l7\x02\u022A\u022B\x05l7\x02\u022B\u022C\x07\t\x02\x02\u022C\u022D\x05" + - "\x96L\x02\u022D\u022F\x03\x02\x02\x02\u022E\u0229\x03\x02\x02\x02\u022E" + - "\u022A\x03\x02\x02\x02\u022Fw\x03\x02\x02\x02\u0230\u0231\b=\x01\x02\u0231" + - "\u0232\x05v<\x02\u0232\u0238\x03\x02\x02\x02\u0233\u0234\f\x03\x02\x02" + - "\u0234\u0235\t\n\x02\x02\u0235\u0237\x05v<\x02\u0236\u0233\x03\x02\x02" + - "\x02\u0237\u023A\x03\x02\x02\x02\u0238\u0236\x03\x02\x02\x02\u0238\u0239" + - "\x03\x02\x02\x02\u0239y\x03\x02\x02\x02\u023A\u0238\x03\x02\x02\x02\u023B" + - "\u023C\b>\x01\x02\u023C\u023D\x05x=\x02\u023D\u0243\x03\x02\x02\x02\u023E" + - "\u023F\f\x03\x02\x02\u023F\u0240\t\v\x02\x02\u0240\u0242\x05x=\x02\u0241" + - "\u023E\x03\x02\x02\x02\u0242\u0245\x03\x02\x02\x02\u0243\u0241\x03\x02" + - "\x02\x02\u0243\u0244\x03\x02\x02\x02\u0244{\x03\x02\x02\x02\u0245\u0243" + - "\x03\x02\x02\x02\u0246\u0247\b?\x01\x02\u0247\u0248\x05z>\x02\u0248\u024F" + - "\x03\x02\x02\x02\u0249\u024A\f\x03\x02\x02\u024A\u024B\x05~@\x02\u024B" + - "\u024C\x05\x84C\x02\u024C\u024E\x03\x02\x02\x02\u024D\u0249\x03\x02\x02" + - "\x02\u024E\u0251\x03\x02\x02\x02\u024F\u024D\x03\x02\x02\x02\u024F\u0250" + - "\x03\x02\x02\x02\u0250}\x03\x02\x02\x02\u0251\u024F\x03\x02\x02\x02\u0252" + - "\u0253\t\f\x02\x02\u0253\x7F\x03\x02\x02\x02\u0254\u0255\bA\x01\x02\u0255" + - "\u0256\x05|?\x02\u0256\u025C\x03\x02\x02\x02\u0257\u0258\f\x03\x02\x02" + - "\u0258\u0259\t\r\x02\x02\u0259\u025B\x05|?\x02\u025A\u0257\x03\x02\x02" + - "\x02\u025B\u025E\x03\x02\x02\x02\u025C\u025A\x03\x02\x02\x02\u025C\u025D" + - "\x03\x02\x02\x02\u025D\x81\x03\x02\x02\x02\u025E\u025C\x03\x02\x02\x02" + - "\u025F\u0260\bB\x01\x02\u0260\u0261\x05\x80A\x02\u0261\u0267\x03\x02\x02" + - "\x02\u0262\u0263\f\x03\x02\x02\u0263\u0264\t\x0E\x02\x02\u0264\u0266\x05" + - "\x80A\x02\u0265\u0262\x03\x02\x02\x02\u0266\u0269\x03\x02\x02\x02\u0267" + - "\u0265\x03\x02\x02\x02\u0267\u0268\x03\x02\x02\x02\u0268\x83\x03\x02\x02" + - "\x02\u0269\u0267\x03\x02\x02\x02\u026A\u026B\bC\x01\x02\u026B\u026C\x05" + - "\x82B\x02\u026C\u0272\x03\x02\x02\x02\u026D\u026E\f\x03\x02\x02\u026E" + - "\u026F\x07D\x02\x02\u026F\u0271\x05\x82B\x02\u0270\u026D\x03\x02\x02\x02" + - "\u0271\u0274\x03\x02\x02\x02\u0272\u0270\x03\x02\x02\x02\u0272\u0273\x03" + - "\x02\x02\x02\u0273\x85\x03\x02\x02\x02\u0274\u0272\x03\x02\x02\x02\u0275" + - "\u0276\bD\x01\x02\u0276\u0277\x05\x84C\x02\u0277\u027D\x03\x02\x02\x02" + - "\u0278\u0279\f\x03\x02\x02\u0279\u027A\x07F\x02\x02\u027A\u027C\x05\x84" + - "C\x02\u027B\u0278\x03\x02\x02\x02\u027C\u027F\x03\x02\x02\x02\u027D\u027B" + - "\x03\x02\x02\x02\u027D\u027E\x03\x02\x02\x02\u027E\x87\x03\x02\x02\x02" + - "\u027F\u027D\x03\x02\x02\x02\u0280\u0281\bE\x01\x02\u0281\u0282\x05\x86" + - "D\x02\u0282\u0288\x03\x02\x02\x02\u0283\u0284\f\x03\x02\x02\u0284\u0285" + - "\x07E\x02\x02\u0285\u0287\x05\x86D\x02\u0286\u0283\x03\x02\x02\x02\u0287" + - "\u028A\x03\x02\x02\x02\u0288\u0286\x03\x02\x02\x02\u0288\u0289\x03\x02" + - "\x02\x02\u0289\x89\x03\x02\x02\x02\u028A\u0288\x03\x02\x02\x02\u028B\u028C" + - "\bF\x01\x02\u028C\u028D\x05\x88E\x02\u028D\u0293\x03\x02\x02\x02\u028E" + - "\u028F\f\x03\x02\x02\u028F\u0290\x075\x02\x02\u0290\u0292\x05\x88E\x02" + - "\u0291\u028E\x03\x02\x02\x02\u0292\u0295\x03\x02\x02\x02\u0293\u0291\x03" + - "\x02\x02\x02\u0293\u0294\x03\x02\x02\x02\u0294\x8B\x03\x02\x02\x02\u0295" + - "\u0293\x03\x02\x02\x02\u0296\u0297\bG\x01\x02\u0297\u0298\x05\x8AF\x02" + - "\u0298\u029E\x03\x02\x02\x02\u0299\u029A\f\x03\x02\x02\u029A\u029B\x07" + - "6\x02\x02\u029B\u029D\x05\x8AF\x02\u029C\u0299\x03\x02\x02\x02\u029D\u02A0" + - "\x03\x02\x02\x02\u029E\u029C\x03\x02\x02\x02\u029E\u029F\x03\x02\x02\x02" + - "\u029F\x8D\x03\x02\x02\x02\u02A0\u029E\x03\x02\x02\x02\u02A1\u02A9\x05" + - "\x8CG\x02\u02A2\u02A3\x05\x8CG\x02\u02A3\u02A4\x07$\x02\x02\u02A4\u02A5" + - "\x05\x8EH\x02\u02A5\u02A6\x07%\x02\x02\u02A6\u02A7\x05\x8EH\x02\u02A7" + - "\u02A9\x03\x02\x02\x02\u02A8\u02A1\x03\x02\x02\x02\u02A8\u02A2\x03\x02" + - "\x02\x02\u02A9\x8F\x03\x02\x02\x02\u02AA\u02B0\x05\x8EH\x02\u02AB\u02AC" + - "\x05^0\x02\u02AC\u02AD\x05\x92J\x02\u02AD\u02AE\x05\x90I\x02\u02AE\u02B0" + - "\x03\x02\x02\x02\u02AF\u02AA\x03\x02\x02\x02\u02AF\u02AB\x03\x02\x02\x02" + - "\u02B0\x91\x03\x02\x02\x02\u02B1\u02B2\t\x0F\x02\x02\u02B2\x93\x03\x02" + - '\x02\x02\u02B3\u02B8\x05\x90I\x02\u02B4\u02B5\x07"\x02\x02\u02B5\u02B7' + - "\x05\x90I\x02\u02B6\u02B4\x03\x02\x02\x02\u02B7\u02BA\x03\x02\x02\x02" + - "\u02B8\u02B6\x03\x02\x02\x02\u02B8\u02B9\x03\x02\x02\x02\u02B9\x95\x03" + - "\x02\x02\x02\u02BA\u02B8\x03\x02\x02\x02\u02BB\u02BF\x05\x98M\x02\u02BC" + - "\u02BF\x05\x9AN\x02\u02BD\u02BF\x05\x9CO\x02\u02BE\u02BB\x03\x02\x02\x02" + - "\u02BE\u02BC\x03\x02\x02\x02\u02BE\u02BD\x03\x02\x02\x02\u02BF\x97\x03" + - "\x02\x02\x02\u02C0\u02C1\x05\x9EP\x02\u02C1\x99\x03\x02\x02\x02\u02C2" + - "\u02C3\x05\x9EP\x02\u02C3\u02C4\x07@\x02\x02\u02C4\u02C5\x05\x9EP\x02" + - "\u02C5\u02C6\x07B\x02\x02\u02C6\x9B\x03\x02\x02\x02\u02C7\u02C8\x07\x1E" + - "\x02\x02\u02C8\u02C9\x07&\x02\x02\u02C9\u02CA\x05\x9EP\x02\u02CA\u02CB" + - "\x07'\x02\x02\u02CB\x9D\x03\x02\x02\x02\u02CC\u02CD\t\x10\x02\x02\u02CD" + - "\x9F\x03\x02\x02\x02A\xA1\xA8\xAF\xB4\xBC\xC8\xD4\xDA\xE1\xF8\xFD\u0108" + - "\u0111\u011B\u0128\u012D\u0133\u0137\u013D\u0143\u015B\u0169\u016D\u0175" + - "\u0183\u018B\u0193\u0197\u019C\u019F\u01A4\u01A7\u01B1\u01B4\u01B7\u01C1" + - "\u01C4\u01C7\u01D7\u01DC\u01E1\u01F1\u01F3\u01FB\u0209\u020F\u0215\u021D" + - "\u022E\u0238\u0243\u024F\u025C\u0267\u0272\u027D\u0288\u0293\u029E\u02A8" + - "\u02AF\u02B8\u02BE"; + "\x02\x02\u0220\u0221\x07(\x02\x02\u0221\u0222\x05\x9AN\x02\u0222\u0223" + + "\x07)\x02\x02\u0223k\x03\x02\x02\x02\u0224\u0228\x07(\x02\x02\u0225\u0226" + + "\x05\x9AN\x02\u0226\u0227\b7\x01\x02\u0227\u0229\x03\x02\x02\x02\u0228" + + "\u0225\x03\x02\x02\x02\u0228\u0229\x03\x02\x02\x02\u0229\u022A\x03\x02" + + "\x02\x02\u022A\u022E\x07%\x02\x02\u022B\u022C\x05\x9AN\x02\u022C\u022D" + + "\b7\x01\x02\u022D\u022F\x03\x02\x02\x02\u022E\u022B\x03\x02\x02\x02\u022E" + + "\u022F\x03\x02\x02\x02\u022F\u0230\x03\x02\x02\x02\u0230\u0231\x07)\x02" + + "\x02\u0231m\x03\x02\x02\x02\u0232\u0235\x05d3\x02\u0233\u0235\x05p9\x02" + + "\u0234\u0232\x03\x02\x02\x02\u0234\u0233\x03\x02\x02\x02\u0235o\x03\x02" + + "\x02\x02\u0236\u0237\x05d3\x02\u0237\u0238\x05x=\x02\u0238q\x03\x02\x02" + + "\x02\u0239\u023D\x05n8\x02\u023A\u023D\x05t;\x02\u023B\u023D\x05v<\x02" + + "\u023C\u0239\x03\x02\x02\x02\u023C\u023A\x03\x02\x02\x02\u023C\u023B\x03" + + "\x02\x02\x02\u023Ds\x03\x02\x02\x02\u023E\u023F\x05x=\x02\u023F\u0240" + + "\x05n8\x02\u0240u\x03\x02\x02\x02\u0241\u0242\x05z>\x02\u0242\u0243\x05" + + "n8\x02\u0243w\x03\x02\x02\x02\u0244\u0245\t\b\x02\x02\u0245y\x03\x02\x02" + + "\x02\u0246\u0247\t\t\x02\x02\u0247{\x03\x02\x02\x02\u0248\u024E\x05r:" + + "\x02\u0249\u024A\x05r:\x02\u024A\u024B\x07\t\x02\x02\u024B\u024C\x05\x9C" + + "O\x02\u024C\u024E\x03\x02\x02\x02\u024D\u0248\x03\x02\x02\x02\u024D\u0249" + + "\x03\x02\x02\x02\u024E}\x03\x02\x02\x02\u024F\u0250\b@\x01\x02\u0250\u0251" + + "\x05|?\x02\u0251\u0257\x03\x02\x02\x02\u0252\u0253\f\x03\x02\x02\u0253" + + "\u0254\t\n\x02\x02\u0254\u0256\x05|?\x02\u0255\u0252\x03\x02\x02\x02\u0256" + + "\u0259\x03\x02\x02\x02\u0257\u0255\x03\x02\x02\x02\u0257\u0258\x03\x02" + + "\x02\x02\u0258\x7F\x03\x02\x02\x02\u0259\u0257\x03\x02\x02\x02\u025A\u025B" + + "\bA\x01\x02\u025B\u025C\x05~@\x02\u025C\u0262\x03\x02\x02\x02\u025D\u025E" + + "\f\x03\x02\x02\u025E\u025F\t\v\x02\x02\u025F\u0261\x05~@\x02\u0260\u025D" + + "\x03\x02\x02\x02\u0261\u0264\x03\x02\x02\x02\u0262\u0260\x03\x02\x02\x02" + + "\u0262\u0263\x03\x02\x02\x02\u0263\x81\x03\x02\x02\x02\u0264\u0262\x03" + + "\x02\x02\x02\u0265\u0266\bB\x01\x02\u0266\u0267\x05\x80A\x02\u0267\u026E" + + "\x03\x02\x02\x02\u0268\u0269\f\x03\x02\x02\u0269\u026A\x05\x84C\x02\u026A" + + "\u026B\x05\x8AF\x02\u026B\u026D\x03\x02\x02\x02\u026C\u0268\x03\x02\x02" + + "\x02\u026D\u0270\x03\x02\x02\x02\u026E\u026C\x03\x02\x02\x02\u026E\u026F" + + "\x03\x02\x02\x02\u026F\x83\x03\x02\x02\x02\u0270\u026E\x03\x02\x02\x02" + + "\u0271\u0272\t\f\x02\x02\u0272\x85\x03\x02\x02\x02\u0273\u0274\bD\x01" + + "\x02\u0274\u0275\x05\x82B\x02\u0275\u027B\x03\x02\x02\x02\u0276\u0277" + + "\f\x03\x02\x02\u0277\u0278\t\r\x02\x02\u0278\u027A\x05\x82B\x02\u0279" + + "\u0276\x03\x02\x02\x02\u027A\u027D\x03\x02\x02\x02\u027B\u0279\x03\x02" + + "\x02\x02\u027B\u027C\x03\x02\x02\x02\u027C\x87\x03\x02\x02\x02\u027D\u027B" + + "\x03\x02\x02\x02\u027E\u027F\bE\x01\x02\u027F\u0280\x05\x86D\x02\u0280" + + "\u0286\x03\x02\x02\x02\u0281\u0282\f\x03\x02\x02\u0282\u0283\t\x0E\x02" + + "\x02\u0283\u0285\x05\x86D\x02\u0284\u0281\x03\x02\x02\x02\u0285\u0288" + + "\x03\x02\x02\x02\u0286\u0284\x03\x02\x02\x02\u0286\u0287\x03\x02\x02\x02" + + "\u0287\x89\x03\x02\x02\x02\u0288\u0286\x03\x02\x02\x02\u0289\u028A\bF" + + "\x01\x02\u028A\u028B\x05\x88E\x02\u028B\u0291\x03\x02\x02\x02\u028C\u028D" + + "\f\x03\x02\x02\u028D\u028E\x07D\x02\x02\u028E\u0290\x05\x88E\x02\u028F" + + "\u028C\x03\x02\x02\x02\u0290\u0293\x03\x02\x02\x02\u0291\u028F\x03\x02" + + "\x02\x02\u0291\u0292\x03\x02\x02\x02\u0292\x8B\x03\x02\x02\x02\u0293\u0291" + + "\x03\x02\x02\x02\u0294\u0295\bG\x01\x02\u0295\u0296\x05\x8AF\x02\u0296" + + "\u029C\x03\x02\x02\x02\u0297\u0298\f\x03\x02\x02\u0298\u0299\x07F\x02" + + "\x02\u0299\u029B\x05\x8AF\x02\u029A\u0297\x03\x02\x02\x02\u029B\u029E" + + "\x03\x02\x02\x02\u029C\u029A\x03\x02\x02\x02\u029C\u029D\x03\x02\x02\x02" + + "\u029D\x8D\x03\x02\x02\x02\u029E\u029C\x03\x02\x02\x02\u029F\u02A0\bH" + + "\x01\x02\u02A0\u02A1\x05\x8CG\x02\u02A1\u02A7\x03\x02\x02\x02\u02A2\u02A3" + + "\f\x03\x02\x02\u02A3\u02A4\x07E\x02\x02\u02A4\u02A6\x05\x8CG\x02\u02A5" + + "\u02A2\x03\x02\x02\x02\u02A6\u02A9\x03\x02\x02\x02\u02A7\u02A5\x03\x02" + + "\x02\x02\u02A7\u02A8\x03\x02\x02\x02\u02A8\x8F\x03\x02\x02\x02\u02A9\u02A7" + + "\x03\x02\x02\x02\u02AA\u02AB\bI\x01\x02\u02AB\u02AC\x05\x8EH\x02\u02AC" + + "\u02B2\x03\x02\x02\x02\u02AD\u02AE\f\x03\x02\x02\u02AE\u02AF\x075\x02" + + "\x02\u02AF\u02B1\x05\x8EH\x02\u02B0\u02AD\x03\x02\x02\x02\u02B1\u02B4" + + "\x03\x02\x02\x02\u02B2\u02B0\x03\x02\x02\x02\u02B2\u02B3\x03\x02\x02\x02" + + "\u02B3\x91\x03\x02\x02\x02\u02B4\u02B2\x03\x02\x02\x02\u02B5\u02B6\bJ" + + "\x01\x02\u02B6\u02B7\x05\x90I\x02\u02B7\u02BD\x03\x02\x02\x02\u02B8\u02B9" + + "\f\x03\x02\x02\u02B9\u02BA\x076\x02\x02\u02BA\u02BC\x05\x90I\x02\u02BB" + + "\u02B8\x03\x02\x02\x02\u02BC\u02BF\x03\x02\x02\x02\u02BD\u02BB\x03\x02" + + "\x02\x02\u02BD\u02BE\x03\x02\x02\x02\u02BE\x93\x03\x02\x02\x02\u02BF\u02BD" + + "\x03\x02\x02\x02\u02C0\u02C8\x05\x92J\x02\u02C1\u02C2\x05\x92J\x02\u02C2" + + "\u02C3\x07$\x02\x02\u02C3\u02C4\x05\x94K\x02\u02C4\u02C5\x07%\x02\x02" + + "\u02C5\u02C6\x05\x94K\x02\u02C6\u02C8\x03\x02\x02\x02\u02C7\u02C0\x03" + + "\x02\x02\x02\u02C7\u02C1\x03\x02\x02\x02\u02C8\x95\x03\x02\x02\x02\u02C9" + + "\u02CF\x05\x94K\x02\u02CA\u02CB\x05d3\x02\u02CB\u02CC\x05\x98M\x02\u02CC" + + "\u02CD\x05\x96L\x02\u02CD\u02CF\x03\x02\x02\x02\u02CE\u02C9\x03\x02\x02" + + "\x02\u02CE\u02CA\x03\x02\x02\x02\u02CF\x97\x03\x02\x02\x02\u02D0\u02D1" + + "\t\x0F\x02\x02\u02D1\x99\x03\x02\x02\x02\u02D2\u02D7\x05\x96L\x02\u02D3" + + '\u02D4\x07"\x02\x02\u02D4\u02D6\x05\x96L\x02\u02D5\u02D3\x03\x02\x02' + + "\x02\u02D6\u02D9\x03\x02\x02\x02\u02D7\u02D5\x03\x02\x02\x02\u02D7\u02D8" + + "\x03\x02\x02\x02\u02D8\x9B\x03\x02\x02\x02\u02D9\u02D7\x03\x02\x02\x02" + + "\u02DA\u02DE\x05\x9EP\x02\u02DB\u02DE\x05\xA0Q\x02\u02DC\u02DE\x05\xA2" + + "R\x02\u02DD\u02DA\x03\x02\x02\x02\u02DD\u02DB\x03\x02\x02\x02\u02DD\u02DC" + + "\x03\x02\x02\x02\u02DE\x9D\x03\x02\x02\x02\u02DF\u02E0\x05\xA4S\x02\u02E0" + + "\x9F\x03\x02\x02\x02\u02E1\u02E2\x05\xA4S\x02\u02E2\u02E3\x07@\x02\x02" + + "\u02E3\u02E4\x05\xA4S\x02\u02E4\u02E5\x07B\x02\x02\u02E5\xA1\x03\x02\x02" + + "\x02\u02E6\u02E7\x07\x1E\x02\x02\u02E7\u02E8\x07&\x02\x02\u02E8\u02E9" + + "\x05\xA4S\x02\u02E9\u02EA\x07'\x02\x02\u02EA\xA3\x03\x02\x02\x02\u02EB" + + "\u02EC\t\x10\x02\x02\u02EC\xA5\x03\x02\x02\x02D\xA7\xAE\xB5\xBA\xC2\xCE" + + "\xDA\xE0\xE7\xF4\xFB\u0105\u0117\u011C\u0127\u0130\u013A\u0147\u014C\u0152" + + "\u0156\u015C\u0162\u017A\u0188\u018C\u0194\u01A2\u01AA\u01B2\u01B6\u01BB" + + "\u01BE\u01C3\u01C6\u01D0\u01D3\u01D6\u01E0\u01E3\u01E6\u01F6\u01FB\u0200" + + "\u0210\u0212\u021A\u0228\u022E\u0234\u023C\u024D\u0257\u0262\u026E\u027B" + + "\u0286\u0291\u029C\u02A7\u02B2\u02BD\u02C7\u02CE\u02D7\u02DD"; public static readonly _serializedATN: string = Utils.join( [KipperParser._serializedATNSegment0, KipperParser._serializedATNSegment1], "", @@ -5137,34 +5202,28 @@ export class CompilationUnitContext extends KipperParserRuleContext { public EOF(): TerminalNode { return this.getToken(KipperParser.EOF, 0); } - public translationUnit(): TranslationUnitContext | undefined { return this.tryGetRuleContext(0, TranslationUnitContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_compilationUnit; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterCompilationUnit) { listener.enterCompilationUnit(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitCompilationUnit) { listener.exitCompilationUnit(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitCompilationUnit) { @@ -5185,30 +5244,25 @@ export class TranslationUnitContext extends KipperParserRuleContext { return this.getRuleContext(i, ExternalItemContext); } } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_translationUnit; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTranslationUnit) { listener.enterTranslationUnit(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitTranslationUnit) { listener.exitTranslationUnit(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitTranslationUnit) { @@ -5223,41 +5277,34 @@ export class ExternalItemContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_externalItem; } - public copyFrom(ctx: ExternalItemContext): void { super.copyFrom(ctx); } } - export class ExternalBlockItemContext extends ExternalItemContext { public blockItemList(): BlockItemListContext { return this.getRuleContext(0, BlockItemListContext); } - constructor(ctx: ExternalItemContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterExternalBlockItem) { listener.enterExternalBlockItem(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitExternalBlockItem) { listener.exitExternalBlockItem(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitExternalBlockItem) { @@ -5278,30 +5325,25 @@ export class BlockItemListContext extends KipperParserRuleContext { return this.getRuleContext(i, BlockItemContext); } } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_blockItemList; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBlockItemList) { listener.enterBlockItemList(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitBlockItemList) { listener.exitBlockItemList(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitBlockItemList) { @@ -5316,38 +5358,31 @@ export class BlockItemContext extends KipperParserRuleContext { public statement(): StatementContext | undefined { return this.tryGetRuleContext(0, StatementContext); } - public declaration(): DeclarationContext | undefined { return this.tryGetRuleContext(0, DeclarationContext); } - public SemiColon(): TerminalNode | undefined { return this.tryGetToken(KipperParser.SemiColon, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_blockItem; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBlockItem) { listener.enterBlockItem(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitBlockItem) { listener.exitBlockItem(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitBlockItem) { @@ -5362,46 +5397,37 @@ export class DeclarationContext extends KipperParserRuleContext { public variableDeclaration(): VariableDeclarationContext | undefined { return this.tryGetRuleContext(0, VariableDeclarationContext); } - public SemiColon(): TerminalNode | undefined { return this.tryGetToken(KipperParser.SemiColon, 0); } - public functionDeclaration(): FunctionDeclarationContext | undefined { return this.tryGetRuleContext(0, FunctionDeclarationContext); } - public interfaceDeclaration(): InterfaceDeclarationContext | undefined { return this.tryGetRuleContext(0, InterfaceDeclarationContext); } - public classDeclaration(): ClassDeclarationContext | undefined { return this.tryGetRuleContext(0, ClassDeclarationContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_declaration; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDeclaration) { listener.enterDeclaration(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitDeclaration) { listener.exitDeclaration(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitDeclaration) { @@ -5416,34 +5442,28 @@ export class VariableDeclarationContext extends KipperParserRuleContext { public storageTypeSpecifier(): StorageTypeSpecifierContext { return this.getRuleContext(0, StorageTypeSpecifierContext); } - public initDeclarator(): InitDeclaratorContext { return this.getRuleContext(0, InitDeclaratorContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_variableDeclaration; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterVariableDeclaration) { listener.enterVariableDeclaration(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitVariableDeclaration) { listener.exitVariableDeclaration(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitVariableDeclaration) { @@ -5458,34 +5478,28 @@ export class StorageTypeSpecifierContext extends KipperParserRuleContext { public Var(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Var, 0); } - public Const(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Const, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_storageTypeSpecifier; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStorageTypeSpecifier) { listener.enterStorageTypeSpecifier(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitStorageTypeSpecifier) { listener.exitStorageTypeSpecifier(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitStorageTypeSpecifier) { @@ -5500,46 +5514,37 @@ export class InitDeclaratorContext extends KipperParserRuleContext { public declarator(): DeclaratorContext { return this.getRuleContext(0, DeclaratorContext); } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } - public typeSpecifierExpression(): TypeSpecifierExpressionContext { return this.getRuleContext(0, TypeSpecifierExpressionContext); } - public Assign(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Assign, 0); } - public initializer(): InitializerContext | undefined { return this.tryGetRuleContext(0, InitializerContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_initDeclarator; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterInitDeclarator) { listener.enterInitDeclarator(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitInitDeclarator) { listener.exitInitDeclarator(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitInitDeclarator) { @@ -5554,30 +5559,25 @@ export class InitializerContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext { return this.getRuleContext(0, AssignmentExpressionContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_initializer; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterInitializer) { listener.enterInitializer(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitInitializer) { listener.exitInitializer(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitInitializer) { @@ -5592,30 +5592,25 @@ export class DeclaratorContext extends KipperParserRuleContext { public directDeclarator(): DirectDeclaratorContext { return this.getRuleContext(0, DirectDeclaratorContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_declarator; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDeclarator) { listener.enterDeclarator(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitDeclarator) { listener.exitDeclarator(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitDeclarator) { @@ -5630,30 +5625,25 @@ export class DirectDeclaratorContext extends KipperParserRuleContext { public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_directDeclarator; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDirectDeclarator) { listener.enterDirectDeclarator(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitDirectDeclarator) { listener.exitDirectDeclarator(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitDirectDeclarator) { @@ -5668,58 +5658,46 @@ export class FunctionDeclarationContext extends KipperParserRuleContext { public DefFunc(): TerminalNode { return this.getToken(KipperParser.DefFunc, 0); } - public declarator(): DeclaratorContext { return this.getRuleContext(0, DeclaratorContext); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } - public RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } - public RetIndicator(): TerminalNode { return this.getToken(KipperParser.RetIndicator, 0); } - public typeSpecifierExpression(): TypeSpecifierExpressionContext { return this.getRuleContext(0, TypeSpecifierExpressionContext); } - public parameterList(): ParameterListContext | undefined { return this.tryGetRuleContext(0, ParameterListContext); } - public compoundStatement(): CompoundStatementContext | undefined { return this.tryGetRuleContext(0, CompoundStatementContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_functionDeclaration; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFunctionDeclaration) { listener.enterFunctionDeclaration(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitFunctionDeclaration) { listener.exitFunctionDeclaration(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitFunctionDeclaration) { @@ -5740,7 +5718,6 @@ export class ParameterListContext extends KipperParserRuleContext { return this.getRuleContext(i, ParameterDeclarationContext); } } - public Comma(): TerminalNode[]; public Comma(i: number): TerminalNode; public Comma(i?: number): TerminalNode | TerminalNode[] { @@ -5750,30 +5727,25 @@ export class ParameterListContext extends KipperParserRuleContext { return this.getToken(KipperParser.Comma, i); } } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_parameterList; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterParameterList) { listener.enterParameterList(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitParameterList) { listener.exitParameterList(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitParameterList) { @@ -5788,38 +5760,31 @@ export class ParameterDeclarationContext extends KipperParserRuleContext { public declarator(): DeclaratorContext { return this.getRuleContext(0, DeclaratorContext); } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } - public typeSpecifierExpression(): TypeSpecifierExpressionContext { return this.getRuleContext(0, TypeSpecifierExpressionContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_parameterDeclaration; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterParameterDeclaration) { listener.enterParameterDeclaration(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitParameterDeclaration) { listener.exitParameterDeclaration(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitParameterDeclaration) { @@ -5834,42 +5799,45 @@ export class InterfaceDeclarationContext extends KipperParserRuleContext { public Interface(): TerminalNode { return this.getToken(KipperParser.Interface, 0); } - - public Identifier(): TerminalNode { - return this.getToken(KipperParser.Identifier, 0); + public declarator(): DeclaratorContext { + return this.getRuleContext(0, DeclaratorContext); } - public LeftBrace(): TerminalNode { return this.getToken(KipperParser.LeftBrace, 0); } - public RightBrace(): TerminalNode { return this.getToken(KipperParser.RightBrace, 0); } - + public interfaceMemberDeclaration(): InterfaceMemberDeclarationContext[]; + public interfaceMemberDeclaration(i: number): InterfaceMemberDeclarationContext; + public interfaceMemberDeclaration( + i?: number, + ): InterfaceMemberDeclarationContext | InterfaceMemberDeclarationContext[] { + if (i === undefined) { + return this.getRuleContexts(InterfaceMemberDeclarationContext); + } else { + return this.getRuleContext(i, InterfaceMemberDeclarationContext); + } + } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_interfaceDeclaration; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterInterfaceDeclaration) { listener.enterInterfaceDeclaration(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitInterfaceDeclaration) { listener.exitInterfaceDeclaration(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitInterfaceDeclaration) { @@ -5880,46 +5848,167 @@ export class InterfaceDeclarationContext extends KipperParserRuleContext { } } -export class ClassDeclarationContext extends KipperParserRuleContext { - public Class(): TerminalNode { - return this.getToken(KipperParser.Class, 0); - } - - public Identifier(): TerminalNode { - return this.getToken(KipperParser.Identifier, 0); +export class InterfaceMemberDeclarationContext extends KipperParserRuleContext { + public interfacePropertyDeclaration(): InterfacePropertyDeclarationContext | undefined { + return this.tryGetRuleContext(0, InterfacePropertyDeclarationContext); } - - public LeftBrace(): TerminalNode { - return this.getToken(KipperParser.LeftBrace, 0); + public interfaceMethodDeclaration(): InterfaceMethodDeclarationContext | undefined { + return this.tryGetRuleContext(0, InterfaceMethodDeclarationContext); } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return KipperParser.RULE_interfaceMemberDeclaration; + } + // @Override + public enterRule(listener: KipperParserListener): void { + if (listener.enterInterfaceMemberDeclaration) { + listener.enterInterfaceMemberDeclaration(this); + } + } + // @Override + public exitRule(listener: KipperParserListener): void { + if (listener.exitInterfaceMemberDeclaration) { + listener.exitInterfaceMemberDeclaration(this); + } + } + // @Override + public accept(visitor: KipperParserVisitor): Result { + if (visitor.visitInterfaceMemberDeclaration) { + return visitor.visitInterfaceMemberDeclaration(this); + } else { + return visitor.visitChildren(this); + } + } +} - public RightBrace(): TerminalNode { - return this.getToken(KipperParser.RightBrace, 0); +export class InterfacePropertyDeclarationContext extends KipperParserRuleContext { + public declarator(): DeclaratorContext { + return this.getRuleContext(0, DeclaratorContext); + } + public Colon(): TerminalNode { + return this.getToken(KipperParser.Colon, 0); + } + public typeSpecifierExpression(): TypeSpecifierExpressionContext { + return this.getRuleContext(0, TypeSpecifierExpressionContext); + } + public SemiColon(): TerminalNode { + return this.getToken(KipperParser.SemiColon, 0); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { + return KipperParser.RULE_interfacePropertyDeclaration; + } + // @Override + public enterRule(listener: KipperParserListener): void { + if (listener.enterInterfacePropertyDeclaration) { + listener.enterInterfacePropertyDeclaration(this); + } } + // @Override + public exitRule(listener: KipperParserListener): void { + if (listener.exitInterfacePropertyDeclaration) { + listener.exitInterfacePropertyDeclaration(this); + } + } + // @Override + public accept(visitor: KipperParserVisitor): Result { + if (visitor.visitInterfacePropertyDeclaration) { + return visitor.visitInterfacePropertyDeclaration(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class InterfaceMethodDeclarationContext extends KipperParserRuleContext { + public declarator(): DeclaratorContext { + return this.getRuleContext(0, DeclaratorContext); + } + public LeftParen(): TerminalNode { + return this.getToken(KipperParser.LeftParen, 0); + } + public RightParen(): TerminalNode { + return this.getToken(KipperParser.RightParen, 0); + } + public Colon(): TerminalNode { + return this.getToken(KipperParser.Colon, 0); + } + public typeSpecifierExpression(): TypeSpecifierExpressionContext { + return this.getRuleContext(0, TypeSpecifierExpressionContext); + } + public SemiColon(): TerminalNode { + return this.getToken(KipperParser.SemiColon, 0); + } + public parameterList(): ParameterListContext | undefined { + return this.tryGetRuleContext(0, ParameterListContext); + } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } + // @Override + public get ruleIndex(): number { + return KipperParser.RULE_interfaceMethodDeclaration; + } + // @Override + public enterRule(listener: KipperParserListener): void { + if (listener.enterInterfaceMethodDeclaration) { + listener.enterInterfaceMethodDeclaration(this); + } + } + // @Override + public exitRule(listener: KipperParserListener): void { + if (listener.exitInterfaceMethodDeclaration) { + listener.exitInterfaceMethodDeclaration(this); + } + } + // @Override + public accept(visitor: KipperParserVisitor): Result { + if (visitor.visitInterfaceMethodDeclaration) { + return visitor.visitInterfaceMethodDeclaration(this); + } else { + return visitor.visitChildren(this); + } + } +} +export class ClassDeclarationContext extends KipperParserRuleContext { + public Class(): TerminalNode { + return this.getToken(KipperParser.Class, 0); + } + public declarator(): DeclaratorContext { + return this.getRuleContext(0, DeclaratorContext); + } + public LeftBrace(): TerminalNode { + return this.getToken(KipperParser.LeftBrace, 0); + } + public RightBrace(): TerminalNode { + return this.getToken(KipperParser.RightBrace, 0); + } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } // @Override public get ruleIndex(): number { return KipperParser.RULE_classDeclaration; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterClassDeclaration) { listener.enterClassDeclaration(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitClassDeclaration) { listener.exitClassDeclaration(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitClassDeclaration) { @@ -5934,50 +6023,40 @@ export class StatementContext extends KipperParserRuleContext { public expressionStatement(): ExpressionStatementContext | undefined { return this.tryGetRuleContext(0, ExpressionStatementContext); } - public selectionStatement(): SelectionStatementContext | undefined { return this.tryGetRuleContext(0, SelectionStatementContext); } - public iterationStatement(): IterationStatementContext | undefined { return this.tryGetRuleContext(0, IterationStatementContext); } - public jumpStatement(): JumpStatementContext | undefined { return this.tryGetRuleContext(0, JumpStatementContext); } - public returnStatement(): ReturnStatementContext | undefined { return this.tryGetRuleContext(0, ReturnStatementContext); } - public compoundStatement(): CompoundStatementContext | undefined { return this.tryGetRuleContext(0, CompoundStatementContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_statement; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStatement) { listener.enterStatement(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitStatement) { listener.exitStatement(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitStatement) { @@ -5992,38 +6071,31 @@ export class CompoundStatementContext extends KipperParserRuleContext { public LeftBrace(): TerminalNode { return this.getToken(KipperParser.LeftBrace, 0); } - public RightBrace(): TerminalNode { return this.getToken(KipperParser.RightBrace, 0); } - public blockItemList(): BlockItemListContext | undefined { return this.tryGetRuleContext(0, BlockItemListContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_compoundStatement; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterCompoundStatement) { listener.enterCompoundStatement(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitCompoundStatement) { listener.exitCompoundStatement(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitCompoundStatement) { @@ -6038,34 +6110,28 @@ export class ExpressionStatementContext extends KipperParserRuleContext { public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } - public SemiColon(): TerminalNode { return this.getToken(KipperParser.SemiColon, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_expressionStatement; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterExpressionStatement) { listener.enterExpressionStatement(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitExpressionStatement) { listener.exitExpressionStatement(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitExpressionStatement) { @@ -6080,34 +6146,28 @@ export class SelectionStatementContext extends KipperParserRuleContext { public ifStatement(): IfStatementContext | undefined { return this.tryGetRuleContext(0, IfStatementContext); } - public switchStatement(): SwitchStatementContext | undefined { return this.tryGetRuleContext(0, SwitchStatementContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_selectionStatement; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSelectionStatement) { listener.enterSelectionStatement(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitSelectionStatement) { listener.exitSelectionStatement(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitSelectionStatement) { @@ -6122,19 +6182,15 @@ export class IfStatementContext extends KipperParserRuleContext { public If(): TerminalNode { return this.getToken(KipperParser.If, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } - public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } - public RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } - public statement(): StatementContext[]; public statement(i: number): StatementContext; public statement(i?: number): StatementContext | StatementContext[] { @@ -6144,34 +6200,28 @@ export class IfStatementContext extends KipperParserRuleContext { return this.getRuleContext(i, StatementContext); } } - public Else(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Else, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_ifStatement; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIfStatement) { listener.enterIfStatement(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitIfStatement) { listener.exitIfStatement(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitIfStatement) { @@ -6186,27 +6236,21 @@ export class SwitchStatementContext extends KipperParserRuleContext { public Switch(): TerminalNode { return this.getToken(KipperParser.Switch, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } - public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } - public RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } - public LeftBrace(): TerminalNode { return this.getToken(KipperParser.LeftBrace, 0); } - public RightBrace(): TerminalNode { return this.getToken(KipperParser.RightBrace, 0); } - public switchLabeledStatement(): SwitchLabeledStatementContext[]; public switchLabeledStatement(i: number): SwitchLabeledStatementContext; public switchLabeledStatement(i?: number): SwitchLabeledStatementContext | SwitchLabeledStatementContext[] { @@ -6216,30 +6260,25 @@ export class SwitchStatementContext extends KipperParserRuleContext { return this.getRuleContext(i, SwitchLabeledStatementContext); } } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_switchStatement; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSwitchStatement) { listener.enterSwitchStatement(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitSwitchStatement) { listener.exitSwitchStatement(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitSwitchStatement) { @@ -6254,46 +6293,37 @@ export class SwitchLabeledStatementContext extends KipperParserRuleContext { public Case(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Case, 0); } - public expression(): ExpressionContext | undefined { return this.tryGetRuleContext(0, ExpressionContext); } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } - public statement(): StatementContext { return this.getRuleContext(0, StatementContext); } - public Default(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Default, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_switchLabeledStatement; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSwitchLabeledStatement) { listener.enterSwitchLabeledStatement(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitSwitchLabeledStatement) { listener.exitSwitchLabeledStatement(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitSwitchLabeledStatement) { @@ -6308,38 +6338,31 @@ export class IterationStatementContext extends KipperParserRuleContext { public forLoopIterationStatement(): ForLoopIterationStatementContext | undefined { return this.tryGetRuleContext(0, ForLoopIterationStatementContext); } - public whileLoopIterationStatement(): WhileLoopIterationStatementContext | undefined { return this.tryGetRuleContext(0, WhileLoopIterationStatementContext); } - public doWhileLoopIterationStatement(): DoWhileLoopIterationStatementContext | undefined { return this.tryGetRuleContext(0, DoWhileLoopIterationStatementContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_iterationStatement; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIterationStatement) { listener.enterIterationStatement(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitIterationStatement) { listener.exitIterationStatement(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitIterationStatement) { @@ -6354,15 +6377,12 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { public _forDeclaration: boolean = false; public _forCondition: boolean = false; public _forIterationExp: boolean = false; - public For(): TerminalNode { return this.getToken(KipperParser.For, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } - public SemiColon(): TerminalNode[]; public SemiColon(i: number): TerminalNode; public SemiColon(i?: number): TerminalNode | TerminalNode[] { @@ -6372,15 +6392,12 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { return this.getToken(KipperParser.SemiColon, i); } } - public RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } - public statement(): StatementContext { return this.getRuleContext(0, StatementContext); } - public expression(): ExpressionContext[]; public expression(i: number): ExpressionContext; public expression(i?: number): ExpressionContext | ExpressionContext[] { @@ -6390,34 +6407,28 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { return this.getRuleContext(i, ExpressionContext); } } - public variableDeclaration(): VariableDeclarationContext | undefined { return this.tryGetRuleContext(0, VariableDeclarationContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_forLoopIterationStatement; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterForLoopIterationStatement) { listener.enterForLoopIterationStatement(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitForLoopIterationStatement) { listener.exitForLoopIterationStatement(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitForLoopIterationStatement) { @@ -6432,46 +6443,37 @@ export class WhileLoopIterationStatementContext extends KipperParserRuleContext public While(): TerminalNode { return this.getToken(KipperParser.While, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } - public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } - public RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } - public statement(): StatementContext { return this.getRuleContext(0, StatementContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_whileLoopIterationStatement; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterWhileLoopIterationStatement) { listener.enterWhileLoopIterationStatement(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitWhileLoopIterationStatement) { listener.exitWhileLoopIterationStatement(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitWhileLoopIterationStatement) { @@ -6486,54 +6488,43 @@ export class DoWhileLoopIterationStatementContext extends KipperParserRuleContex public Do(): TerminalNode { return this.getToken(KipperParser.Do, 0); } - public statement(): StatementContext { return this.getRuleContext(0, StatementContext); } - public While(): TerminalNode { return this.getToken(KipperParser.While, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } - public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } - public RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } - public SemiColon(): TerminalNode { return this.getToken(KipperParser.SemiColon, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_doWhileLoopIterationStatement; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDoWhileLoopIterationStatement) { listener.enterDoWhileLoopIterationStatement(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitDoWhileLoopIterationStatement) { listener.exitDoWhileLoopIterationStatement(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitDoWhileLoopIterationStatement) { @@ -6548,38 +6539,31 @@ export class JumpStatementContext extends KipperParserRuleContext { public SemiColon(): TerminalNode { return this.getToken(KipperParser.SemiColon, 0); } - public Continue(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Continue, 0); } - public Break(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Break, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_jumpStatement; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterJumpStatement) { listener.enterJumpStatement(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitJumpStatement) { listener.exitJumpStatement(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitJumpStatement) { @@ -6594,38 +6578,31 @@ export class ReturnStatementContext extends KipperParserRuleContext { public Return(): TerminalNode { return this.getToken(KipperParser.Return, 0); } - public SemiColon(): TerminalNode { return this.getToken(KipperParser.SemiColon, 0); } - public expression(): ExpressionContext | undefined { return this.tryGetRuleContext(0, ExpressionContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_returnStatement; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterReturnStatement) { listener.enterReturnStatement(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitReturnStatement) { listener.exitReturnStatement(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitReturnStatement) { @@ -6640,66 +6617,52 @@ export class PrimaryExpressionContext extends KipperParserRuleContext { public tangledPrimaryExpression(): TangledPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, TangledPrimaryExpressionContext); } - + public lambdaPrimaryExpression(): LambdaPrimaryExpressionContext | undefined { + return this.tryGetRuleContext(0, LambdaPrimaryExpressionContext); + } public arrayPrimaryExpression(): ArrayPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, ArrayPrimaryExpressionContext); } - public objectPrimaryExpression(): ObjectPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, ObjectPrimaryExpressionContext); } - public boolPrimaryExpression(): BoolPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, BoolPrimaryExpressionContext); } - public identifierPrimaryExpression(): IdentifierPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, IdentifierPrimaryExpressionContext); } - public stringPrimaryExpression(): StringPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, StringPrimaryExpressionContext); } - public fStringPrimaryExpression(): FStringPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, FStringPrimaryExpressionContext); } - public numberPrimaryExpression(): NumberPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, NumberPrimaryExpressionContext); } - public voidOrNullOrUndefinedPrimaryExpression(): VoidOrNullOrUndefinedPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, VoidOrNullOrUndefinedPrimaryExpressionContext); } - - public lambdaExpression(): LambdaExpressionContext | undefined { - return this.tryGetRuleContext(0, LambdaExpressionContext); - } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_primaryExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPrimaryExpression) { listener.enterPrimaryExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitPrimaryExpression) { listener.exitPrimaryExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitPrimaryExpression) { @@ -6710,66 +6673,54 @@ export class PrimaryExpressionContext extends KipperParserRuleContext { } } -export class LambdaExpressionContext extends KipperParserRuleContext { +export class LambdaPrimaryExpressionContext extends KipperParserRuleContext { public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } - public RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } - public typeSpecifierExpression(): TypeSpecifierExpressionContext { return this.getRuleContext(0, TypeSpecifierExpressionContext); } - public RetIndicator(): TerminalNode { return this.getToken(KipperParser.RetIndicator, 0); } - public expression(): ExpressionContext | undefined { return this.tryGetRuleContext(0, ExpressionContext); } - public compoundStatement(): CompoundStatementContext | undefined { return this.tryGetRuleContext(0, CompoundStatementContext); } - public parameterList(): ParameterListContext | undefined { return this.tryGetRuleContext(0, ParameterListContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { - return KipperParser.RULE_lambdaExpression; + return KipperParser.RULE_lambdaPrimaryExpression; } - // @Override public enterRule(listener: KipperParserListener): void { - if (listener.enterLambdaExpression) { - listener.enterLambdaExpression(this); + if (listener.enterLambdaPrimaryExpression) { + listener.enterLambdaPrimaryExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { - if (listener.exitLambdaExpression) { - listener.exitLambdaExpression(this); + if (listener.exitLambdaPrimaryExpression) { + listener.exitLambdaPrimaryExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { - if (visitor.visitLambdaExpression) { - return visitor.visitLambdaExpression(this); + if (visitor.visitLambdaPrimaryExpression) { + return visitor.visitLambdaPrimaryExpression(this); } else { return visitor.visitChildren(this); } @@ -6780,38 +6731,31 @@ export class TangledPrimaryExpressionContext extends KipperParserRuleContext { public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } - public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } - public RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_tangledPrimaryExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTangledPrimaryExpression) { listener.enterTangledPrimaryExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitTangledPrimaryExpression) { listener.exitTangledPrimaryExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitTangledPrimaryExpression) { @@ -6826,34 +6770,28 @@ export class BoolPrimaryExpressionContext extends KipperParserRuleContext { public True(): TerminalNode | undefined { return this.tryGetToken(KipperParser.True, 0); } - public False(): TerminalNode | undefined { return this.tryGetToken(KipperParser.False, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_boolPrimaryExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBoolPrimaryExpression) { listener.enterBoolPrimaryExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitBoolPrimaryExpression) { listener.exitBoolPrimaryExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitBoolPrimaryExpression) { @@ -6868,30 +6806,25 @@ export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext public identifier(): IdentifierContext { return this.getRuleContext(0, IdentifierContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_identifierPrimaryExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierPrimaryExpression) { listener.enterIdentifierPrimaryExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitIdentifierPrimaryExpression) { listener.exitIdentifierPrimaryExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitIdentifierPrimaryExpression) { @@ -6906,30 +6839,25 @@ export class IdentifierContext extends KipperParserRuleContext { public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_identifier; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifier) { listener.enterIdentifier(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitIdentifier) { listener.exitIdentifier(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitIdentifier) { @@ -6944,34 +6872,28 @@ export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRule public identifier(): IdentifierContext | undefined { return this.tryGetRuleContext(0, IdentifierContext); } - public stringPrimaryExpression(): StringPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, StringPrimaryExpressionContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_identifierOrStringPrimaryExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierOrStringPrimaryExpression) { listener.enterIdentifierOrStringPrimaryExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitIdentifierOrStringPrimaryExpression) { listener.exitIdentifierOrStringPrimaryExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitIdentifierOrStringPrimaryExpression) { @@ -6986,34 +6908,28 @@ export class StringPrimaryExpressionContext extends KipperParserRuleContext { public SingleQuoteStringLiteral(): TerminalNode | undefined { return this.tryGetToken(KipperParser.SingleQuoteStringLiteral, 0); } - public DoubleQuoteStringLiteral(): TerminalNode | undefined { return this.tryGetToken(KipperParser.DoubleQuoteStringLiteral, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_stringPrimaryExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStringPrimaryExpression) { listener.enterStringPrimaryExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitStringPrimaryExpression) { listener.exitStringPrimaryExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitStringPrimaryExpression) { @@ -7028,11 +6944,9 @@ export class FStringPrimaryExpressionContext extends KipperParserRuleContext { public FStringSingleQuoteStart(): TerminalNode | undefined { return this.tryGetToken(KipperParser.FStringSingleQuoteStart, 0); } - public FStringSingleQuoteEnd(): TerminalNode | undefined { return this.tryGetToken(KipperParser.FStringSingleQuoteEnd, 0); } - public fStringSingleQuoteAtom(): FStringSingleQuoteAtomContext[]; public fStringSingleQuoteAtom(i: number): FStringSingleQuoteAtomContext; public fStringSingleQuoteAtom(i?: number): FStringSingleQuoteAtomContext | FStringSingleQuoteAtomContext[] { @@ -7042,15 +6956,12 @@ export class FStringPrimaryExpressionContext extends KipperParserRuleContext { return this.getRuleContext(i, FStringSingleQuoteAtomContext); } } - public FStringDoubleQuoteStart(): TerminalNode | undefined { return this.tryGetToken(KipperParser.FStringDoubleQuoteStart, 0); } - public FStringDoubleQuoteEnd(): TerminalNode | undefined { return this.tryGetToken(KipperParser.FStringDoubleQuoteEnd, 0); } - public fStringDoubleQuoteAtom(): FStringDoubleQuoteAtomContext[]; public fStringDoubleQuoteAtom(i: number): FStringDoubleQuoteAtomContext; public fStringDoubleQuoteAtom(i?: number): FStringDoubleQuoteAtomContext | FStringDoubleQuoteAtomContext[] { @@ -7060,30 +6971,25 @@ export class FStringPrimaryExpressionContext extends KipperParserRuleContext { return this.getRuleContext(i, FStringDoubleQuoteAtomContext); } } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_fStringPrimaryExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringPrimaryExpression) { listener.enterFStringPrimaryExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitFStringPrimaryExpression) { listener.exitFStringPrimaryExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitFStringPrimaryExpression) { @@ -7098,42 +7004,34 @@ export class FStringSingleQuoteAtomContext extends KipperParserRuleContext { public FStringSingleQuoteAtom(): TerminalNode | undefined { return this.tryGetToken(KipperParser.FStringSingleQuoteAtom, 0); } - public FStringExpStart(): TerminalNode | undefined { return this.tryGetToken(KipperParser.FStringExpStart, 0); } - public FStringExpEnd(): TerminalNode | undefined { return this.tryGetToken(KipperParser.FStringExpEnd, 0); } - public expression(): ExpressionContext | undefined { return this.tryGetRuleContext(0, ExpressionContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_fStringSingleQuoteAtom; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringSingleQuoteAtom) { listener.enterFStringSingleQuoteAtom(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitFStringSingleQuoteAtom) { listener.exitFStringSingleQuoteAtom(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitFStringSingleQuoteAtom) { @@ -7148,42 +7046,34 @@ export class FStringDoubleQuoteAtomContext extends KipperParserRuleContext { public FStringDoubleQuoteAtom(): TerminalNode | undefined { return this.tryGetToken(KipperParser.FStringDoubleQuoteAtom, 0); } - public FStringExpStart(): TerminalNode | undefined { return this.tryGetToken(KipperParser.FStringExpStart, 0); } - public FStringExpEnd(): TerminalNode | undefined { return this.tryGetToken(KipperParser.FStringExpEnd, 0); } - public expression(): ExpressionContext | undefined { return this.tryGetRuleContext(0, ExpressionContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_fStringDoubleQuoteAtom; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringDoubleQuoteAtom) { listener.enterFStringDoubleQuoteAtom(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitFStringDoubleQuoteAtom) { listener.exitFStringDoubleQuoteAtom(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitFStringDoubleQuoteAtom) { @@ -7198,34 +7088,28 @@ export class NumberPrimaryExpressionContext extends KipperParserRuleContext { public IntegerConstant(): TerminalNode | undefined { return this.tryGetToken(KipperParser.IntegerConstant, 0); } - public FloatingConstant(): TerminalNode | undefined { return this.tryGetToken(KipperParser.FloatingConstant, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_numberPrimaryExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterNumberPrimaryExpression) { listener.enterNumberPrimaryExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitNumberPrimaryExpression) { listener.exitNumberPrimaryExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitNumberPrimaryExpression) { @@ -7240,11 +7124,9 @@ export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { public LeftBracket(): TerminalNode { return this.getToken(KipperParser.LeftBracket, 0); } - public RightBracket(): TerminalNode { return this.getToken(KipperParser.RightBracket, 0); } - public expression(): ExpressionContext[]; public expression(i: number): ExpressionContext; public expression(i?: number): ExpressionContext | ExpressionContext[] { @@ -7254,7 +7136,6 @@ export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { return this.getRuleContext(i, ExpressionContext); } } - public Comma(): TerminalNode[]; public Comma(i: number): TerminalNode; public Comma(i?: number): TerminalNode | TerminalNode[] { @@ -7264,30 +7145,25 @@ export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { return this.getToken(KipperParser.Comma, i); } } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_arrayPrimaryExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterArrayPrimaryExpression) { listener.enterArrayPrimaryExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitArrayPrimaryExpression) { listener.exitArrayPrimaryExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitArrayPrimaryExpression) { @@ -7302,11 +7178,9 @@ export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { public LeftBrace(): TerminalNode { return this.getToken(KipperParser.LeftBrace, 0); } - public RightBrace(): TerminalNode { return this.getToken(KipperParser.RightBrace, 0); } - public objectProperty(): ObjectPropertyContext[]; public objectProperty(i: number): ObjectPropertyContext; public objectProperty(i?: number): ObjectPropertyContext | ObjectPropertyContext[] { @@ -7316,7 +7190,6 @@ export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { return this.getRuleContext(i, ObjectPropertyContext); } } - public Comma(): TerminalNode[]; public Comma(i: number): TerminalNode; public Comma(i?: number): TerminalNode | TerminalNode[] { @@ -7326,30 +7199,25 @@ export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { return this.getToken(KipperParser.Comma, i); } } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_objectPrimaryExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterObjectPrimaryExpression) { listener.enterObjectPrimaryExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitObjectPrimaryExpression) { listener.exitObjectPrimaryExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitObjectPrimaryExpression) { @@ -7364,38 +7232,31 @@ export class ObjectPropertyContext extends KipperParserRuleContext { public identifierOrStringPrimaryExpression(): IdentifierOrStringPrimaryExpressionContext { return this.getRuleContext(0, IdentifierOrStringPrimaryExpressionContext); } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } - public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_objectProperty; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterObjectProperty) { listener.enterObjectProperty(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitObjectProperty) { listener.exitObjectProperty(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitObjectProperty) { @@ -7410,38 +7271,31 @@ export class VoidOrNullOrUndefinedPrimaryExpressionContext extends KipperParserR public Void(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Void, 0); } - public Null(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Null, 0); } - public Undefined(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Undefined, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_voidOrNullOrUndefinedPrimaryExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterVoidOrNullOrUndefinedPrimaryExpression) { listener.enterVoidOrNullOrUndefinedPrimaryExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitVoidOrNullOrUndefinedPrimaryExpression) { listener.exitVoidOrNullOrUndefinedPrimaryExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitVoidOrNullOrUndefinedPrimaryExpression) { @@ -7454,46 +7308,38 @@ export class VoidOrNullOrUndefinedPrimaryExpressionContext extends KipperParserR export class ComputedPrimaryExpressionContext extends KipperParserRuleContext { public _labelASTKind: ASTKind | undefined; - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_computedPrimaryExpression; } - public copyFrom(ctx: ComputedPrimaryExpressionContext): void { super.copyFrom(ctx); this._labelASTKind = ctx._labelASTKind; } } - export class PassOncomputedPrimaryExpressionContext extends ComputedPrimaryExpressionContext { public primaryExpression(): PrimaryExpressionContext { return this.getRuleContext(0, PrimaryExpressionContext); } - constructor(ctx: ComputedPrimaryExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPassOncomputedPrimaryExpression) { listener.enterPassOncomputedPrimaryExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitPassOncomputedPrimaryExpression) { listener.exitPassOncomputedPrimaryExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitPassOncomputedPrimaryExpression) { @@ -7503,43 +7349,35 @@ export class PassOncomputedPrimaryExpressionContext extends ComputedPrimaryExpre } } } - export class FunctionCallExpressionContext extends ComputedPrimaryExpressionContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext { return this.getRuleContext(0, ComputedPrimaryExpressionContext); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } - public RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } - public argumentExpressionList(): ArgumentExpressionListContext | undefined { return this.tryGetRuleContext(0, ArgumentExpressionListContext); } - constructor(ctx: ComputedPrimaryExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFunctionCallExpression) { listener.enterFunctionCallExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitFunctionCallExpression) { listener.exitFunctionCallExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitFunctionCallExpression) { @@ -7549,47 +7387,38 @@ export class FunctionCallExpressionContext extends ComputedPrimaryExpressionCont } } } - export class ExplicitCallFunctionCallExpressionContext extends ComputedPrimaryExpressionContext { public CallFunc(): TerminalNode { return this.getToken(KipperParser.CallFunc, 0); } - public computedPrimaryExpression(): ComputedPrimaryExpressionContext { return this.getRuleContext(0, ComputedPrimaryExpressionContext); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } - public RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } - public argumentExpressionList(): ArgumentExpressionListContext | undefined { return this.tryGetRuleContext(0, ArgumentExpressionListContext); } - constructor(ctx: ComputedPrimaryExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterExplicitCallFunctionCallExpression) { listener.enterExplicitCallFunctionCallExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitExplicitCallFunctionCallExpression) { listener.exitExplicitCallFunctionCallExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitExplicitCallFunctionCallExpression) { @@ -7599,35 +7428,29 @@ export class ExplicitCallFunctionCallExpressionContext extends ComputedPrimaryEx } } } - export class DotNotationMemberAccessExpressionContext extends ComputedPrimaryExpressionContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext { return this.getRuleContext(0, ComputedPrimaryExpressionContext); } - public dotNotation(): DotNotationContext { return this.getRuleContext(0, DotNotationContext); } - constructor(ctx: ComputedPrimaryExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDotNotationMemberAccessExpression) { listener.enterDotNotationMemberAccessExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitDotNotationMemberAccessExpression) { listener.exitDotNotationMemberAccessExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitDotNotationMemberAccessExpression) { @@ -7637,35 +7460,29 @@ export class DotNotationMemberAccessExpressionContext extends ComputedPrimaryExp } } } - export class BracketNotationMemberAccessExpressionContext extends ComputedPrimaryExpressionContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext { return this.getRuleContext(0, ComputedPrimaryExpressionContext); } - public bracketNotation(): BracketNotationContext { return this.getRuleContext(0, BracketNotationContext); } - constructor(ctx: ComputedPrimaryExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBracketNotationMemberAccessExpression) { listener.enterBracketNotationMemberAccessExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitBracketNotationMemberAccessExpression) { listener.exitBracketNotationMemberAccessExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitBracketNotationMemberAccessExpression) { @@ -7675,35 +7492,29 @@ export class BracketNotationMemberAccessExpressionContext extends ComputedPrimar } } } - export class SliceNotationMemberAccessExpressionContext extends ComputedPrimaryExpressionContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext { return this.getRuleContext(0, ComputedPrimaryExpressionContext); } - public sliceNotation(): SliceNotationContext { return this.getRuleContext(0, SliceNotationContext); } - constructor(ctx: ComputedPrimaryExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSliceNotationMemberAccessExpression) { listener.enterSliceNotationMemberAccessExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitSliceNotationMemberAccessExpression) { listener.exitSliceNotationMemberAccessExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitSliceNotationMemberAccessExpression) { @@ -7724,7 +7535,6 @@ export class ArgumentExpressionListContext extends KipperParserRuleContext { return this.getRuleContext(i, AssignmentExpressionContext); } } - public Comma(): TerminalNode[]; public Comma(i: number): TerminalNode; public Comma(i?: number): TerminalNode | TerminalNode[] { @@ -7734,30 +7544,25 @@ export class ArgumentExpressionListContext extends KipperParserRuleContext { return this.getToken(KipperParser.Comma, i); } } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_argumentExpressionList; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterArgumentExpressionList) { listener.enterArgumentExpressionList(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitArgumentExpressionList) { listener.exitArgumentExpressionList(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitArgumentExpressionList) { @@ -7772,34 +7577,28 @@ export class DotNotationContext extends KipperParserRuleContext { public Dot(): TerminalNode { return this.getToken(KipperParser.Dot, 0); } - public identifier(): IdentifierContext { return this.getRuleContext(0, IdentifierContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_dotNotation; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDotNotation) { listener.enterDotNotation(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitDotNotation) { listener.exitDotNotation(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitDotNotation) { @@ -7814,38 +7613,31 @@ export class BracketNotationContext extends KipperParserRuleContext { public LeftBracket(): TerminalNode { return this.getToken(KipperParser.LeftBracket, 0); } - public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } - public RightBracket(): TerminalNode { return this.getToken(KipperParser.RightBracket, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_bracketNotation; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBracketNotation) { listener.enterBracketNotation(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitBracketNotation) { listener.exitBracketNotation(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitBracketNotation) { @@ -7859,19 +7651,15 @@ export class BracketNotationContext extends KipperParserRuleContext { export class SliceNotationContext extends KipperParserRuleContext { public sliceStart: boolean = false; public sliceEnd: boolean = false; - public LeftBracket(): TerminalNode { return this.getToken(KipperParser.LeftBracket, 0); } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } - public RightBracket(): TerminalNode { return this.getToken(KipperParser.RightBracket, 0); } - public expression(): ExpressionContext[]; public expression(i: number): ExpressionContext; public expression(i?: number): ExpressionContext | ExpressionContext[] { @@ -7881,30 +7669,25 @@ export class SliceNotationContext extends KipperParserRuleContext { return this.getRuleContext(i, ExpressionContext); } } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_sliceNotation; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSliceNotation) { listener.enterSliceNotation(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitSliceNotation) { listener.exitSliceNotation(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitSliceNotation) { @@ -7919,34 +7702,28 @@ export class PostfixExpressionContext extends KipperParserRuleContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, ComputedPrimaryExpressionContext); } - public incrementOrDecrementPostfixExpression(): IncrementOrDecrementPostfixExpressionContext | undefined { return this.tryGetRuleContext(0, IncrementOrDecrementPostfixExpressionContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_postfixExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPostfixExpression) { listener.enterPostfixExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitPostfixExpression) { listener.exitPostfixExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitPostfixExpression) { @@ -7961,34 +7738,28 @@ export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRu public computedPrimaryExpression(): ComputedPrimaryExpressionContext { return this.getRuleContext(0, ComputedPrimaryExpressionContext); } - public incrementOrDecrementOperator(): IncrementOrDecrementOperatorContext { return this.getRuleContext(0, IncrementOrDecrementOperatorContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementPostfixExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementPostfixExpression) { listener.enterIncrementOrDecrementPostfixExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitIncrementOrDecrementPostfixExpression) { listener.exitIncrementOrDecrementPostfixExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitIncrementOrDecrementPostfixExpression) { @@ -8003,38 +7774,31 @@ export class UnaryExpressionContext extends KipperParserRuleContext { public postfixExpression(): PostfixExpressionContext | undefined { return this.tryGetRuleContext(0, PostfixExpressionContext); } - public incrementOrDecrementUnaryExpression(): IncrementOrDecrementUnaryExpressionContext | undefined { return this.tryGetRuleContext(0, IncrementOrDecrementUnaryExpressionContext); } - public operatorModifiedUnaryExpression(): OperatorModifiedUnaryExpressionContext | undefined { return this.tryGetRuleContext(0, OperatorModifiedUnaryExpressionContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_unaryExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterUnaryExpression) { listener.enterUnaryExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitUnaryExpression) { listener.exitUnaryExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitUnaryExpression) { @@ -8049,34 +7813,28 @@ export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRule public incrementOrDecrementOperator(): IncrementOrDecrementOperatorContext { return this.getRuleContext(0, IncrementOrDecrementOperatorContext); } - public postfixExpression(): PostfixExpressionContext { return this.getRuleContext(0, PostfixExpressionContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementUnaryExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementUnaryExpression) { listener.enterIncrementOrDecrementUnaryExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitIncrementOrDecrementUnaryExpression) { listener.exitIncrementOrDecrementUnaryExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitIncrementOrDecrementUnaryExpression) { @@ -8091,34 +7849,28 @@ export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleCont public unaryOperator(): UnaryOperatorContext { return this.getRuleContext(0, UnaryOperatorContext); } - public postfixExpression(): PostfixExpressionContext { return this.getRuleContext(0, PostfixExpressionContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_operatorModifiedUnaryExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterOperatorModifiedUnaryExpression) { listener.enterOperatorModifiedUnaryExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitOperatorModifiedUnaryExpression) { listener.exitOperatorModifiedUnaryExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitOperatorModifiedUnaryExpression) { @@ -8133,34 +7885,28 @@ export class IncrementOrDecrementOperatorContext extends KipperParserRuleContext public PlusPlus(): TerminalNode | undefined { return this.tryGetToken(KipperParser.PlusPlus, 0); } - public MinusMinus(): TerminalNode | undefined { return this.tryGetToken(KipperParser.MinusMinus, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementOperator; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementOperator) { listener.enterIncrementOrDecrementOperator(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitIncrementOrDecrementOperator) { listener.exitIncrementOrDecrementOperator(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitIncrementOrDecrementOperator) { @@ -8175,42 +7921,34 @@ export class UnaryOperatorContext extends KipperParserRuleContext { public Plus(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Plus, 0); } - public Minus(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Minus, 0); } - public Not(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Not, 0); } - public BitwiseNot(): TerminalNode | undefined { return this.tryGetToken(KipperParser.BitwiseNot, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_unaryOperator; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterUnaryOperator) { listener.enterUnaryOperator(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitUnaryOperator) { listener.exitUnaryOperator(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitUnaryOperator) { @@ -8225,41 +7963,34 @@ export class CastOrConvertExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_castOrConvertExpression; } - public copyFrom(ctx: CastOrConvertExpressionContext): void { super.copyFrom(ctx); } } - export class PassOnCastOrConvertExpressionContext extends CastOrConvertExpressionContext { public unaryExpression(): UnaryExpressionContext { return this.getRuleContext(0, UnaryExpressionContext); } - constructor(ctx: CastOrConvertExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPassOnCastOrConvertExpression) { listener.enterPassOnCastOrConvertExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitPassOnCastOrConvertExpression) { listener.exitPassOnCastOrConvertExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitPassOnCastOrConvertExpression) { @@ -8269,39 +8000,32 @@ export class PassOnCastOrConvertExpressionContext extends CastOrConvertExpressio } } } - export class ActualCastOrConvertExpressionContext extends CastOrConvertExpressionContext { public unaryExpression(): UnaryExpressionContext { return this.getRuleContext(0, UnaryExpressionContext); } - public As(): TerminalNode { return this.getToken(KipperParser.As, 0); } - public typeSpecifierExpression(): TypeSpecifierExpressionContext { return this.getRuleContext(0, TypeSpecifierExpressionContext); } - constructor(ctx: CastOrConvertExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterActualCastOrConvertExpression) { listener.enterActualCastOrConvertExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitActualCastOrConvertExpression) { listener.exitActualCastOrConvertExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitActualCastOrConvertExpression) { @@ -8316,41 +8040,34 @@ export class MultiplicativeExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_multiplicativeExpression; } - public copyFrom(ctx: MultiplicativeExpressionContext): void { super.copyFrom(ctx); } } - export class PassOnMultiplicativeExpressionContext extends MultiplicativeExpressionContext { public castOrConvertExpression(): CastOrConvertExpressionContext { return this.getRuleContext(0, CastOrConvertExpressionContext); } - constructor(ctx: MultiplicativeExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPassOnMultiplicativeExpression) { listener.enterPassOnMultiplicativeExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitPassOnMultiplicativeExpression) { listener.exitPassOnMultiplicativeExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitPassOnMultiplicativeExpression) { @@ -8360,51 +8077,41 @@ export class PassOnMultiplicativeExpressionContext extends MultiplicativeExpress } } } - export class ActualMultiplicativeExpressionContext extends MultiplicativeExpressionContext { public multiplicativeExpression(): MultiplicativeExpressionContext { return this.getRuleContext(0, MultiplicativeExpressionContext); } - public castOrConvertExpression(): CastOrConvertExpressionContext { return this.getRuleContext(0, CastOrConvertExpressionContext); } - public Star(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Star, 0); } - public Div(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Div, 0); } - public Mod(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Mod, 0); } - public PowerTo(): TerminalNode | undefined { return this.tryGetToken(KipperParser.PowerTo, 0); } - constructor(ctx: MultiplicativeExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterActualMultiplicativeExpression) { listener.enterActualMultiplicativeExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitActualMultiplicativeExpression) { listener.exitActualMultiplicativeExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitActualMultiplicativeExpression) { @@ -8419,41 +8126,34 @@ export class AdditiveExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_additiveExpression; } - public copyFrom(ctx: AdditiveExpressionContext): void { super.copyFrom(ctx); } } - export class PassOnAdditiveExpressionContext extends AdditiveExpressionContext { public multiplicativeExpression(): MultiplicativeExpressionContext { return this.getRuleContext(0, MultiplicativeExpressionContext); } - constructor(ctx: AdditiveExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPassOnAdditiveExpression) { listener.enterPassOnAdditiveExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitPassOnAdditiveExpression) { listener.exitPassOnAdditiveExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitPassOnAdditiveExpression) { @@ -8463,43 +8163,35 @@ export class PassOnAdditiveExpressionContext extends AdditiveExpressionContext { } } } - export class ActualAdditiveExpressionContext extends AdditiveExpressionContext { public additiveExpression(): AdditiveExpressionContext { return this.getRuleContext(0, AdditiveExpressionContext); } - public multiplicativeExpression(): MultiplicativeExpressionContext { return this.getRuleContext(0, MultiplicativeExpressionContext); } - public Plus(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Plus, 0); } - public Minus(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Minus, 0); } - constructor(ctx: AdditiveExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterActualAdditiveExpression) { listener.enterActualAdditiveExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitActualAdditiveExpression) { listener.exitActualAdditiveExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitActualAdditiveExpression) { @@ -8514,41 +8206,34 @@ export class BitwiseShiftExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_bitwiseShiftExpression; } - public copyFrom(ctx: BitwiseShiftExpressionContext): void { super.copyFrom(ctx); } } - export class PassOnBitwiseShiftExpressionContext extends BitwiseShiftExpressionContext { public additiveExpression(): AdditiveExpressionContext { return this.getRuleContext(0, AdditiveExpressionContext); } - constructor(ctx: BitwiseShiftExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPassOnBitwiseShiftExpression) { listener.enterPassOnBitwiseShiftExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitPassOnBitwiseShiftExpression) { listener.exitPassOnBitwiseShiftExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitPassOnBitwiseShiftExpression) { @@ -8558,39 +8243,32 @@ export class PassOnBitwiseShiftExpressionContext extends BitwiseShiftExpressionC } } } - export class ActualBitwiseShiftExpressionContext extends BitwiseShiftExpressionContext { public bitwiseShiftExpression(): BitwiseShiftExpressionContext { return this.getRuleContext(0, BitwiseShiftExpressionContext); } - public bitwiseShiftOperators(): BitwiseShiftOperatorsContext { return this.getRuleContext(0, BitwiseShiftOperatorsContext); } - public bitwiseAndExpression(): BitwiseAndExpressionContext { return this.getRuleContext(0, BitwiseAndExpressionContext); } - constructor(ctx: BitwiseShiftExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterActualBitwiseShiftExpression) { listener.enterActualBitwiseShiftExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitActualBitwiseShiftExpression) { listener.exitActualBitwiseShiftExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitActualBitwiseShiftExpression) { @@ -8605,38 +8283,31 @@ export class BitwiseShiftOperatorsContext extends KipperParserRuleContext { public BitwiseZeroFillLeftShift(): TerminalNode | undefined { return this.tryGetToken(KipperParser.BitwiseZeroFillLeftShift, 0); } - public BitwiseSignedRightShift(): TerminalNode | undefined { return this.tryGetToken(KipperParser.BitwiseSignedRightShift, 0); } - public BitwiseZeroFillRightShift(): TerminalNode | undefined { return this.tryGetToken(KipperParser.BitwiseZeroFillRightShift, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_bitwiseShiftOperators; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBitwiseShiftOperators) { listener.enterBitwiseShiftOperators(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitBitwiseShiftOperators) { listener.exitBitwiseShiftOperators(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitBitwiseShiftOperators) { @@ -8651,41 +8322,34 @@ export class RelationalExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_relationalExpression; } - public copyFrom(ctx: RelationalExpressionContext): void { super.copyFrom(ctx); } } - export class PassOnRelationalExpressionContext extends RelationalExpressionContext { public bitwiseShiftExpression(): BitwiseShiftExpressionContext { return this.getRuleContext(0, BitwiseShiftExpressionContext); } - constructor(ctx: RelationalExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPassOnRelationalExpression) { listener.enterPassOnRelationalExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitPassOnRelationalExpression) { listener.exitPassOnRelationalExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitPassOnRelationalExpression) { @@ -8695,51 +8359,41 @@ export class PassOnRelationalExpressionContext extends RelationalExpressionConte } } } - export class ActualRelationalExpressionContext extends RelationalExpressionContext { public relationalExpression(): RelationalExpressionContext { return this.getRuleContext(0, RelationalExpressionContext); } - public bitwiseShiftExpression(): BitwiseShiftExpressionContext { return this.getRuleContext(0, BitwiseShiftExpressionContext); } - public Less(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Less, 0); } - public Greater(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Greater, 0); } - public LessEqual(): TerminalNode | undefined { return this.tryGetToken(KipperParser.LessEqual, 0); } - public GreaterEqual(): TerminalNode | undefined { return this.tryGetToken(KipperParser.GreaterEqual, 0); } - constructor(ctx: RelationalExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterActualRelationalExpression) { listener.enterActualRelationalExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitActualRelationalExpression) { listener.exitActualRelationalExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitActualRelationalExpression) { @@ -8754,41 +8408,34 @@ export class EqualityExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_equalityExpression; } - public copyFrom(ctx: EqualityExpressionContext): void { super.copyFrom(ctx); } } - export class PassOnEqualityExpressionContext extends EqualityExpressionContext { public relationalExpression(): RelationalExpressionContext { return this.getRuleContext(0, RelationalExpressionContext); } - constructor(ctx: EqualityExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPassOnEqualityExpression) { listener.enterPassOnEqualityExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitPassOnEqualityExpression) { listener.exitPassOnEqualityExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitPassOnEqualityExpression) { @@ -8798,43 +8445,35 @@ export class PassOnEqualityExpressionContext extends EqualityExpressionContext { } } } - export class ActualEqualityExpressionContext extends EqualityExpressionContext { public equalityExpression(): EqualityExpressionContext { return this.getRuleContext(0, EqualityExpressionContext); } - public relationalExpression(): RelationalExpressionContext { return this.getRuleContext(0, RelationalExpressionContext); } - public Equal(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Equal, 0); } - public NotEqual(): TerminalNode | undefined { return this.tryGetToken(KipperParser.NotEqual, 0); } - constructor(ctx: EqualityExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterActualEqualityExpression) { listener.enterActualEqualityExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitActualEqualityExpression) { listener.exitActualEqualityExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitActualEqualityExpression) { @@ -8849,41 +8488,34 @@ export class BitwiseAndExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_bitwiseAndExpression; } - public copyFrom(ctx: BitwiseAndExpressionContext): void { super.copyFrom(ctx); } } - export class PassOnBitwiseAndExpressionContext extends BitwiseAndExpressionContext { public equalityExpression(): EqualityExpressionContext { return this.getRuleContext(0, EqualityExpressionContext); } - constructor(ctx: BitwiseAndExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPassOnBitwiseAndExpression) { listener.enterPassOnBitwiseAndExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitPassOnBitwiseAndExpression) { listener.exitPassOnBitwiseAndExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitPassOnBitwiseAndExpression) { @@ -8893,39 +8525,32 @@ export class PassOnBitwiseAndExpressionContext extends BitwiseAndExpressionConte } } } - export class ActualBitwiseAndExpressionContext extends BitwiseAndExpressionContext { public bitwiseAndExpression(): BitwiseAndExpressionContext { return this.getRuleContext(0, BitwiseAndExpressionContext); } - public BitwiseAnd(): TerminalNode { return this.getToken(KipperParser.BitwiseAnd, 0); } - public equalityExpression(): EqualityExpressionContext { return this.getRuleContext(0, EqualityExpressionContext); } - constructor(ctx: BitwiseAndExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterActualBitwiseAndExpression) { listener.enterActualBitwiseAndExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitActualBitwiseAndExpression) { listener.exitActualBitwiseAndExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitActualBitwiseAndExpression) { @@ -8940,41 +8565,34 @@ export class BitwiseXorExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_bitwiseXorExpression; } - public copyFrom(ctx: BitwiseXorExpressionContext): void { super.copyFrom(ctx); } } - export class PassOnBitwiseXorExpressionContext extends BitwiseXorExpressionContext { public bitwiseAndExpression(): BitwiseAndExpressionContext { return this.getRuleContext(0, BitwiseAndExpressionContext); } - constructor(ctx: BitwiseXorExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPassOnBitwiseXorExpression) { listener.enterPassOnBitwiseXorExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitPassOnBitwiseXorExpression) { listener.exitPassOnBitwiseXorExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitPassOnBitwiseXorExpression) { @@ -8984,39 +8602,32 @@ export class PassOnBitwiseXorExpressionContext extends BitwiseXorExpressionConte } } } - export class ActualBitwiseXorExpressionContext extends BitwiseXorExpressionContext { public bitwiseXorExpression(): BitwiseXorExpressionContext { return this.getRuleContext(0, BitwiseXorExpressionContext); } - public BitwiseXor(): TerminalNode { return this.getToken(KipperParser.BitwiseXor, 0); } - public bitwiseAndExpression(): BitwiseAndExpressionContext { return this.getRuleContext(0, BitwiseAndExpressionContext); } - constructor(ctx: BitwiseXorExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterActualBitwiseXorExpression) { listener.enterActualBitwiseXorExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitActualBitwiseXorExpression) { listener.exitActualBitwiseXorExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitActualBitwiseXorExpression) { @@ -9031,41 +8642,34 @@ export class BitwiseOrExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_bitwiseOrExpression; } - public copyFrom(ctx: BitwiseOrExpressionContext): void { super.copyFrom(ctx); } } - export class PassOnBitwiseOrExpressionContext extends BitwiseOrExpressionContext { public bitwiseXorExpression(): BitwiseXorExpressionContext { return this.getRuleContext(0, BitwiseXorExpressionContext); } - constructor(ctx: BitwiseOrExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPassOnBitwiseOrExpression) { listener.enterPassOnBitwiseOrExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitPassOnBitwiseOrExpression) { listener.exitPassOnBitwiseOrExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitPassOnBitwiseOrExpression) { @@ -9075,39 +8679,32 @@ export class PassOnBitwiseOrExpressionContext extends BitwiseOrExpressionContext } } } - export class ActualBitwiseOrExpressionContext extends BitwiseOrExpressionContext { public bitwiseOrExpression(): BitwiseOrExpressionContext { return this.getRuleContext(0, BitwiseOrExpressionContext); } - public BitwiseOr(): TerminalNode { return this.getToken(KipperParser.BitwiseOr, 0); } - public bitwiseXorExpression(): BitwiseXorExpressionContext { return this.getRuleContext(0, BitwiseXorExpressionContext); } - constructor(ctx: BitwiseOrExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterActualBitwiseOrExpression) { listener.enterActualBitwiseOrExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitActualBitwiseOrExpression) { listener.exitActualBitwiseOrExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitActualBitwiseOrExpression) { @@ -9122,41 +8719,34 @@ export class LogicalAndExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_logicalAndExpression; } - public copyFrom(ctx: LogicalAndExpressionContext): void { super.copyFrom(ctx); } } - export class PassOnLogicalAndExpressionContext extends LogicalAndExpressionContext { public bitwiseOrExpression(): BitwiseOrExpressionContext { return this.getRuleContext(0, BitwiseOrExpressionContext); } - constructor(ctx: LogicalAndExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPassOnLogicalAndExpression) { listener.enterPassOnLogicalAndExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitPassOnLogicalAndExpression) { listener.exitPassOnLogicalAndExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitPassOnLogicalAndExpression) { @@ -9166,39 +8756,32 @@ export class PassOnLogicalAndExpressionContext extends LogicalAndExpressionConte } } } - export class ActualLogicalAndExpressionContext extends LogicalAndExpressionContext { public logicalAndExpression(): LogicalAndExpressionContext { return this.getRuleContext(0, LogicalAndExpressionContext); } - public AndAnd(): TerminalNode { return this.getToken(KipperParser.AndAnd, 0); } - public bitwiseOrExpression(): BitwiseOrExpressionContext { return this.getRuleContext(0, BitwiseOrExpressionContext); } - constructor(ctx: LogicalAndExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterActualLogicalAndExpression) { listener.enterActualLogicalAndExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitActualLogicalAndExpression) { listener.exitActualLogicalAndExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitActualLogicalAndExpression) { @@ -9213,41 +8796,34 @@ export class LogicalOrExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_logicalOrExpression; } - public copyFrom(ctx: LogicalOrExpressionContext): void { super.copyFrom(ctx); } } - export class PassOnLogicalOrExpressionContext extends LogicalOrExpressionContext { public logicalAndExpression(): LogicalAndExpressionContext { return this.getRuleContext(0, LogicalAndExpressionContext); } - constructor(ctx: LogicalOrExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPassOnLogicalOrExpression) { listener.enterPassOnLogicalOrExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitPassOnLogicalOrExpression) { listener.exitPassOnLogicalOrExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitPassOnLogicalOrExpression) { @@ -9257,39 +8833,32 @@ export class PassOnLogicalOrExpressionContext extends LogicalOrExpressionContext } } } - export class ActualLogicalOrExpressionContext extends LogicalOrExpressionContext { public logicalOrExpression(): LogicalOrExpressionContext { return this.getRuleContext(0, LogicalOrExpressionContext); } - public OrOr(): TerminalNode { return this.getToken(KipperParser.OrOr, 0); } - public logicalAndExpression(): LogicalAndExpressionContext { return this.getRuleContext(0, LogicalAndExpressionContext); } - constructor(ctx: LogicalOrExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterActualLogicalOrExpression) { listener.enterActualLogicalOrExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitActualLogicalOrExpression) { listener.exitActualLogicalOrExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitActualLogicalOrExpression) { @@ -9304,41 +8873,34 @@ export class ConditionalExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_conditionalExpression; } - public copyFrom(ctx: ConditionalExpressionContext): void { super.copyFrom(ctx); } } - export class PassOnConditionalExpressionContext extends ConditionalExpressionContext { public logicalOrExpression(): LogicalOrExpressionContext { return this.getRuleContext(0, LogicalOrExpressionContext); } - constructor(ctx: ConditionalExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPassOnConditionalExpression) { listener.enterPassOnConditionalExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitPassOnConditionalExpression) { listener.exitPassOnConditionalExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitPassOnConditionalExpression) { @@ -9348,16 +8910,13 @@ export class PassOnConditionalExpressionContext extends ConditionalExpressionCon } } } - export class ActualConditionalExpressionContext extends ConditionalExpressionContext { public logicalOrExpression(): LogicalOrExpressionContext { return this.getRuleContext(0, LogicalOrExpressionContext); } - public QuestionMark(): TerminalNode { return this.getToken(KipperParser.QuestionMark, 0); } - public conditionalExpression(): ConditionalExpressionContext[]; public conditionalExpression(i: number): ConditionalExpressionContext; public conditionalExpression(i?: number): ConditionalExpressionContext | ConditionalExpressionContext[] { @@ -9367,30 +8926,25 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon return this.getRuleContext(i, ConditionalExpressionContext); } } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } - constructor(ctx: ConditionalExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterActualConditionalExpression) { listener.enterActualConditionalExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitActualConditionalExpression) { listener.exitActualConditionalExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitActualConditionalExpression) { @@ -9405,41 +8959,34 @@ export class AssignmentExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_assignmentExpression; } - public copyFrom(ctx: AssignmentExpressionContext): void { super.copyFrom(ctx); } } - export class PassOnAssignmentExpressionContext extends AssignmentExpressionContext { public conditionalExpression(): ConditionalExpressionContext { return this.getRuleContext(0, ConditionalExpressionContext); } - constructor(ctx: AssignmentExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPassOnAssignmentExpression) { listener.enterPassOnAssignmentExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitPassOnAssignmentExpression) { listener.exitPassOnAssignmentExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitPassOnAssignmentExpression) { @@ -9449,39 +8996,32 @@ export class PassOnAssignmentExpressionContext extends AssignmentExpressionConte } } } - export class ActualAssignmentExpressionContext extends AssignmentExpressionContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext { return this.getRuleContext(0, ComputedPrimaryExpressionContext); } - public assignmentOperator(): AssignmentOperatorContext { return this.getRuleContext(0, AssignmentOperatorContext); } - public assignmentExpression(): AssignmentExpressionContext { return this.getRuleContext(0, AssignmentExpressionContext); } - constructor(ctx: AssignmentExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterActualAssignmentExpression) { listener.enterActualAssignmentExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitActualAssignmentExpression) { listener.exitActualAssignmentExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitActualAssignmentExpression) { @@ -9496,50 +9036,40 @@ export class AssignmentOperatorContext extends KipperParserRuleContext { public Assign(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Assign, 0); } - public StarAssign(): TerminalNode | undefined { return this.tryGetToken(KipperParser.StarAssign, 0); } - public DivAssign(): TerminalNode | undefined { return this.tryGetToken(KipperParser.DivAssign, 0); } - public ModAssign(): TerminalNode | undefined { return this.tryGetToken(KipperParser.ModAssign, 0); } - public PlusAssign(): TerminalNode | undefined { return this.tryGetToken(KipperParser.PlusAssign, 0); } - public MinusAssign(): TerminalNode | undefined { return this.tryGetToken(KipperParser.MinusAssign, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_assignmentOperator; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterAssignmentOperator) { listener.enterAssignmentOperator(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitAssignmentOperator) { listener.exitAssignmentOperator(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitAssignmentOperator) { @@ -9560,7 +9090,6 @@ export class ExpressionContext extends KipperParserRuleContext { return this.getRuleContext(i, AssignmentExpressionContext); } } - public Comma(): TerminalNode[]; public Comma(i: number): TerminalNode; public Comma(i?: number): TerminalNode | TerminalNode[] { @@ -9570,30 +9099,25 @@ export class ExpressionContext extends KipperParserRuleContext { return this.getToken(KipperParser.Comma, i); } } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_expression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterExpression) { listener.enterExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitExpression) { listener.exitExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitExpression) { @@ -9608,38 +9132,31 @@ export class TypeSpecifierExpressionContext extends KipperParserRuleContext { public identifierTypeSpecifierExpression(): IdentifierTypeSpecifierExpressionContext | undefined { return this.tryGetRuleContext(0, IdentifierTypeSpecifierExpressionContext); } - public genericTypeSpecifierExpression(): GenericTypeSpecifierExpressionContext | undefined { return this.tryGetRuleContext(0, GenericTypeSpecifierExpressionContext); } - public typeofTypeSpecifierExpression(): TypeofTypeSpecifierExpressionContext | undefined { return this.tryGetRuleContext(0, TypeofTypeSpecifierExpressionContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_typeSpecifierExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeSpecifierExpression) { listener.enterTypeSpecifierExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitTypeSpecifierExpression) { listener.exitTypeSpecifierExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitTypeSpecifierExpression) { @@ -9654,30 +9171,25 @@ export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleCo public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext { return this.getRuleContext(0, TypeSpecifierIdentifierContext); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_identifierTypeSpecifierExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierTypeSpecifierExpression) { listener.enterIdentifierTypeSpecifierExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitIdentifierTypeSpecifierExpression) { listener.exitIdentifierTypeSpecifierExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitIdentifierTypeSpecifierExpression) { @@ -9698,38 +9210,31 @@ export class GenericTypeSpecifierExpressionContext extends KipperParserRuleConte return this.getRuleContext(i, TypeSpecifierIdentifierContext); } } - public Less(): TerminalNode { return this.getToken(KipperParser.Less, 0); } - public Greater(): TerminalNode { return this.getToken(KipperParser.Greater, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_genericTypeSpecifierExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterGenericTypeSpecifierExpression) { listener.enterGenericTypeSpecifierExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitGenericTypeSpecifierExpression) { listener.exitGenericTypeSpecifierExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitGenericTypeSpecifierExpression) { @@ -9744,42 +9249,34 @@ export class TypeofTypeSpecifierExpressionContext extends KipperParserRuleContex public Typeof(): TerminalNode { return this.getToken(KipperParser.Typeof, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } - public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext { return this.getRuleContext(0, TypeSpecifierIdentifierContext); } - public RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_typeofTypeSpecifierExpression; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeofTypeSpecifierExpression) { listener.enterTypeofTypeSpecifierExpression(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitTypeofTypeSpecifierExpression) { listener.exitTypeofTypeSpecifierExpression(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitTypeofTypeSpecifierExpression) { @@ -9794,42 +9291,34 @@ export class TypeSpecifierIdentifierContext extends KipperParserRuleContext { public Identifier(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Identifier, 0); } - public Null(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Null, 0); } - public Undefined(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Undefined, 0); } - public Void(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Void, 0); } - constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } - // @Override public get ruleIndex(): number { return KipperParser.RULE_typeSpecifierIdentifier; } - // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeSpecifierIdentifier) { listener.enterTypeSpecifierIdentifier(this); } } - // @Override public exitRule(listener: KipperParserListener): void { if (listener.exitTypeSpecifierIdentifier) { listener.exitTypeSpecifierIdentifier(this); } } - // @Override public accept(visitor: KipperParserVisitor): Result { if (visitor.visitTypeSpecifierIdentifier) { diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParserListener.ts b/kipper/core/src/compiler/lexer-parser/antlr/KipperParserListener.ts index 0f9e0739b..5f63de83b 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParserListener.ts +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParserListener.ts @@ -56,6 +56,9 @@ import { FunctionDeclarationContext } from "./KipperParser"; import { ParameterListContext } from "./KipperParser"; import { ParameterDeclarationContext } from "./KipperParser"; import { InterfaceDeclarationContext } from "./KipperParser"; +import { InterfaceMemberDeclarationContext } from "./KipperParser"; +import { InterfacePropertyDeclarationContext } from "./KipperParser"; +import { InterfaceMethodDeclarationContext } from "./KipperParser"; import { ClassDeclarationContext } from "./KipperParser"; import { StatementContext } from "./KipperParser"; import { CompoundStatementContext } from "./KipperParser"; @@ -71,7 +74,7 @@ import { DoWhileLoopIterationStatementContext } from "./KipperParser"; import { JumpStatementContext } from "./KipperParser"; import { ReturnStatementContext } from "./KipperParser"; import { PrimaryExpressionContext } from "./KipperParser"; -import { LambdaExpressionContext } from "./KipperParser"; +import { LambdaPrimaryExpressionContext } from "./KipperParser"; import { TangledPrimaryExpressionContext } from "./KipperParser"; import { BoolPrimaryExpressionContext } from "./KipperParser"; import { IdentifierPrimaryExpressionContext } from "./KipperParser"; @@ -730,6 +733,39 @@ export interface KipperParserListener extends ParseTreeListener { */ exitInterfaceDeclaration?: (ctx: InterfaceDeclarationContext) => void; + /** + * Enter a parse tree produced by `KipperParser.interfaceMemberDeclaration`. + * @param ctx the parse tree + */ + enterInterfaceMemberDeclaration?: (ctx: InterfaceMemberDeclarationContext) => void; + /** + * Exit a parse tree produced by `KipperParser.interfaceMemberDeclaration`. + * @param ctx the parse tree + */ + exitInterfaceMemberDeclaration?: (ctx: InterfaceMemberDeclarationContext) => void; + + /** + * Enter a parse tree produced by `KipperParser.interfacePropertyDeclaration`. + * @param ctx the parse tree + */ + enterInterfacePropertyDeclaration?: (ctx: InterfacePropertyDeclarationContext) => void; + /** + * Exit a parse tree produced by `KipperParser.interfacePropertyDeclaration`. + * @param ctx the parse tree + */ + exitInterfacePropertyDeclaration?: (ctx: InterfacePropertyDeclarationContext) => void; + + /** + * Enter a parse tree produced by `KipperParser.interfaceMethodDeclaration`. + * @param ctx the parse tree + */ + enterInterfaceMethodDeclaration?: (ctx: InterfaceMethodDeclarationContext) => void; + /** + * Exit a parse tree produced by `KipperParser.interfaceMethodDeclaration`. + * @param ctx the parse tree + */ + exitInterfaceMethodDeclaration?: (ctx: InterfaceMethodDeclarationContext) => void; + /** * Enter a parse tree produced by `KipperParser.classDeclaration`. * @param ctx the parse tree @@ -896,15 +932,15 @@ export interface KipperParserListener extends ParseTreeListener { exitPrimaryExpression?: (ctx: PrimaryExpressionContext) => void; /** - * Enter a parse tree produced by `KipperParser.lambdaExpression`. + * Enter a parse tree produced by `KipperParser.lambdaPrimaryExpression`. * @param ctx the parse tree */ - enterLambdaExpression?: (ctx: LambdaExpressionContext) => void; + enterLambdaPrimaryExpression?: (ctx: LambdaPrimaryExpressionContext) => void; /** - * Exit a parse tree produced by `KipperParser.lambdaExpression`. + * Exit a parse tree produced by `KipperParser.lambdaPrimaryExpression`. * @param ctx the parse tree */ - exitLambdaExpression?: (ctx: LambdaExpressionContext) => void; + exitLambdaPrimaryExpression?: (ctx: LambdaPrimaryExpressionContext) => void; /** * Enter a parse tree produced by `KipperParser.tangledPrimaryExpression`. diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParserVisitor.ts b/kipper/core/src/compiler/lexer-parser/antlr/KipperParserVisitor.ts index 3e8d7b3ef..b29174fb7 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParserVisitor.ts +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParserVisitor.ts @@ -56,6 +56,9 @@ import { FunctionDeclarationContext } from "./KipperParser"; import { ParameterListContext } from "./KipperParser"; import { ParameterDeclarationContext } from "./KipperParser"; import { InterfaceDeclarationContext } from "./KipperParser"; +import { InterfaceMemberDeclarationContext } from "./KipperParser"; +import { InterfacePropertyDeclarationContext } from "./KipperParser"; +import { InterfaceMethodDeclarationContext } from "./KipperParser"; import { ClassDeclarationContext } from "./KipperParser"; import { StatementContext } from "./KipperParser"; import { CompoundStatementContext } from "./KipperParser"; @@ -71,7 +74,7 @@ import { DoWhileLoopIterationStatementContext } from "./KipperParser"; import { JumpStatementContext } from "./KipperParser"; import { ReturnStatementContext } from "./KipperParser"; import { PrimaryExpressionContext } from "./KipperParser"; -import { LambdaExpressionContext } from "./KipperParser"; +import { LambdaPrimaryExpressionContext } from "./KipperParser"; import { TangledPrimaryExpressionContext } from "./KipperParser"; import { BoolPrimaryExpressionContext } from "./KipperParser"; import { IdentifierPrimaryExpressionContext } from "./KipperParser"; @@ -504,6 +507,27 @@ export interface KipperParserVisitor extends ParseTreeVisitor { */ visitInterfaceDeclaration?: (ctx: InterfaceDeclarationContext) => Result; + /** + * Visit a parse tree produced by `KipperParser.interfaceMemberDeclaration`. + * @param ctx the parse tree + * @return the visitor result + */ + visitInterfaceMemberDeclaration?: (ctx: InterfaceMemberDeclarationContext) => Result; + + /** + * Visit a parse tree produced by `KipperParser.interfacePropertyDeclaration`. + * @param ctx the parse tree + * @return the visitor result + */ + visitInterfacePropertyDeclaration?: (ctx: InterfacePropertyDeclarationContext) => Result; + + /** + * Visit a parse tree produced by `KipperParser.interfaceMethodDeclaration`. + * @param ctx the parse tree + * @return the visitor result + */ + visitInterfaceMethodDeclaration?: (ctx: InterfaceMethodDeclarationContext) => Result; + /** * Visit a parse tree produced by `KipperParser.classDeclaration`. * @param ctx the parse tree @@ -610,11 +634,11 @@ export interface KipperParserVisitor extends ParseTreeVisitor { visitPrimaryExpression?: (ctx: PrimaryExpressionContext) => Result; /** - * Visit a parse tree produced by `KipperParser.lambdaExpression`. + * Visit a parse tree produced by `KipperParser.lambdaPrimaryExpression`. * @param ctx the parse tree * @return the visitor result */ - visitLambdaExpression?: (ctx: LambdaExpressionContext) => Result; + visitLambdaPrimaryExpression?: (ctx: LambdaPrimaryExpressionContext) => Result; /** * Visit a parse tree produced by `KipperParser.tangledPrimaryExpression`. diff --git a/kipper/core/src/compiler/lexer-parser/parse-rule-kind-mapping.ts b/kipper/core/src/compiler/lexer-parser/parse-rule-kind-mapping.ts index adbf6c939..2f8c82cbe 100644 --- a/kipper/core/src/compiler/lexer-parser/parse-rule-kind-mapping.ts +++ b/kipper/core/src/compiler/lexer-parser/parse-rule-kind-mapping.ts @@ -35,6 +35,8 @@ export const ParseRuleKindMapping = { RULE_parameterList: KipperParser.RULE_parameterList, RULE_parameterDeclaration: KipperParser.RULE_parameterDeclaration, RULE_interfaceDeclaration: KipperParser.RULE_interfaceDeclaration, + RULE_interfacePropertyDeclaration: KipperParser.RULE_interfacePropertyDeclaration, + RULE_interfaceMethodDeclaration: KipperParser.RULE_interfaceMethodDeclaration, RULE_classDeclaration: KipperParser.RULE_classDeclaration, RULE_statement: KipperParser.RULE_statement, RULE_compoundStatement: KipperParser.RULE_compoundStatement, @@ -50,7 +52,7 @@ export const ParseRuleKindMapping = { RULE_jumpStatement: KipperParser.RULE_jumpStatement, RULE_returnStatement: KipperParser.RULE_returnStatement, RULE_primaryExpression: KipperParser.RULE_primaryExpression, - RULE_lambdaExpression: KipperParser.RULE_lambdaExpression, + RULE_lambdaPrimaryExpression: KipperParser.RULE_lambdaPrimaryExpression, RULE_tangledPrimaryExpression: KipperParser.RULE_tangledPrimaryExpression, RULE_boolPrimaryExpression: KipperParser.RULE_boolPrimaryExpression, RULE_identifierPrimaryExpression: KipperParser.RULE_identifierPrimaryExpression, diff --git a/kipper/core/src/compiler/target-presets/semantic-analyser.ts b/kipper/core/src/compiler/target-presets/semantic-analyser.ts index 58aefd256..de09c618f 100644 --- a/kipper/core/src/compiler/target-presets/semantic-analyser.ts +++ b/kipper/core/src/compiler/target-presets/semantic-analyser.ts @@ -51,9 +51,11 @@ import type { VariableDeclaration, VoidOrNullOrUndefinedPrimaryExpression, WhileLoopIterationStatement, + InterfacePropertyDeclaration, + InterfaceMethodDeclaration, + ObjectProperty, } from "../ast"; import { KipperSemanticErrorHandler } from "../semantics"; -import type { ObjectProperty } from "../ast/nodes/expressions/primary-expression/object-primary-expression/object-property/object-property"; /** * Represents a function that checks the semantics for a {@link AnalysableASTNode}. @@ -146,6 +148,16 @@ export abstract class KipperTargetSemanticAnalyser extends KipperSemanticErrorHa */ public abstract interfaceDeclaration?: TargetASTNodeSemanticAnalyser; + /** + * Performs translation-specific semantic analysis for {@link InterfacePropertyDeclaration} instances. + */ + public abstract interfacePropertyDeclaration?: TargetASTNodeSemanticAnalyser; + + /** + * Performs translation-specific semantic analysis for {@link InterfaceMethodDeclaration} instances. + */ + public abstract interfaceMethodDeclaration?: TargetASTNodeSemanticAnalyser; + /** * Performs translation-specific semantic analysis for {@link NumberPrimaryExpression} instances. */ @@ -305,5 +317,5 @@ export abstract class KipperTargetSemanticAnalyser extends KipperSemanticErrorHa /** * Performs translation-specific semantic analysis for {@link LambdaExpression} instances. */ - public abstract lambdaExpression?: TargetASTNodeSemanticAnalyser; + public abstract lambdaPrimaryExpression?: TargetASTNodeSemanticAnalyser; } diff --git a/kipper/core/src/compiler/target-presets/translation/code-generator.ts b/kipper/core/src/compiler/target-presets/translation/code-generator.ts index 69dd397cf..e24369b25 100644 --- a/kipper/core/src/compiler/target-presets/translation/code-generator.ts +++ b/kipper/core/src/compiler/target-presets/translation/code-generator.ts @@ -53,6 +53,9 @@ import type { import type { TranslatedCodeLine, TranslatedExpression } from "../../const"; import type { KipperProgramContext } from "../../program-ctx"; import type { ObjectProperty } from "../../ast/nodes/expressions/primary-expression/object-primary-expression/object-property/object-property"; +import type { InterfacePropertyDeclaration } from "../../ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-property-declaration"; +import { InterfaceMemberDeclaration } from "../../ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-member-declaration"; +import type { InterfaceMethodDeclaration } from "../../ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration"; /** * Represents a function that translates a Kipper {@link CompilableASTNode token} code into a @@ -193,6 +196,22 @@ export abstract class KipperTargetCodeGenerator { */ public abstract interfaceDeclaration: TargetASTNodeCodeGenerator>; + /** + * Translates a {@link InterfacePropertyDeclaration} into a specific language. + */ + public abstract interfacePropertyDeclaration: TargetASTNodeCodeGenerator< + InterfacePropertyDeclaration, + TranslatedCodeLine[] + >; + + /** + * Translates a {@link InterfaceMethodDeclaration} into a specific language. + */ + public abstract interfaceMethodDeclaration: TargetASTNodeCodeGenerator< + InterfaceMethodDeclaration, + TranslatedCodeLine[] + >; + /** * Translates a {@link NumberPrimaryExpression} into a specific language. */ @@ -377,5 +396,5 @@ export abstract class KipperTargetCodeGenerator { /** * Translates a {@link LambdaExpression} into a specific language. */ - public abstract lambdaExpression: TargetASTNodeCodeGenerator; + public abstract lambdaPrimaryExpression: TargetASTNodeCodeGenerator; } diff --git a/kipper/target-js/src/code-generator.ts b/kipper/target-js/src/code-generator.ts index 1ec5cf1a5..7fa44fbd4 100644 --- a/kipper/target-js/src/code-generator.ts +++ b/kipper/target-js/src/code-generator.ts @@ -53,17 +53,17 @@ import type { TranslatedExpression, TypeofTypeSpecifierExpression, VoidOrNullOrUndefinedPrimaryExpression, + InterfacePropertyDeclaration, WhileLoopIterationStatement, InterfaceDeclaration, ClassDeclaration, + InterfaceMethodDeclaration, } from "@kipper/core"; import { CompoundStatement, getConversionFunctionIdentifier, IfStatement, KipperTargetCodeGenerator, - ScopeDeclaration, - ScopeFunctionDeclaration, VariableDeclaration, Expression, BuiltInTypes, @@ -358,7 +358,8 @@ export class JavaScriptTargetCodeGenerator extends KipperTargetCodeGenerator { * Translates a {@link ParameterDeclaration} into the JavaScript language. */ parameterDeclaration = async (node: ParameterDeclaration): Promise> => { - return []; + const semanticData = node.getSemanticData(); + return [[`${semanticData.identifier}`]]; }; /** @@ -394,6 +395,21 @@ export class JavaScriptTargetCodeGenerator extends KipperTargetCodeGenerator { return []; }; + /** + * Translates a {@link InterfacePropertyDeclaration} into the JavaScript language. + */ + interfacePropertyDeclaration = async (node: InterfacePropertyDeclaration): Promise> => { + return []; + }; + + /** + * Translates a {@link InterfaceMethodDeclaration} into the JavaScript language. + * @param node + */ + interfaceMethodDeclaration = async (node: InterfaceMethodDeclaration): Promise> => { + return []; + }; + /** * Translates a {@link ClassDeclaration} into the JavaScript language. */ @@ -432,7 +448,10 @@ export class JavaScriptTargetCodeGenerator extends KipperTargetCodeGenerator { * @since 0.11.0 */ objectProperty = async (node: ObjectProperty): Promise => { - return []; + const expression = node.getSemanticData().expressoDepresso; + const identifier = node.getSemanticData().identifier; + + return [identifier, ":", ...(await expression.translateCtxAndChildren())]; }; /** @@ -785,7 +804,7 @@ export class JavaScriptTargetCodeGenerator extends KipperTargetCodeGenerator { /** * Translates a {@link LambdaExpression} into the JavaScript language. */ - lambdaExpression = async (node: LambdaExpression): Promise => { + lambdaPrimaryExpression = async (node: LambdaExpression): Promise => { // Step 1: Extract Semantic Data const semanticData = node.getSemanticData(); const params = semanticData.params; diff --git a/kipper/target-js/src/semantic-analyser.ts b/kipper/target-js/src/semantic-analyser.ts index a7d6279f5..39a866f87 100644 --- a/kipper/target-js/src/semantic-analyser.ts +++ b/kipper/target-js/src/semantic-analyser.ts @@ -9,9 +9,12 @@ import type { InterfaceDeclaration, ParameterDeclaration, VariableDeclaration, + InterfacePropertyDeclaration, + TargetASTNodeSemanticAnalyser, } from "@kipper/core"; import { KipperTargetSemanticAnalyser, ReservedIdentifierOverwriteError } from "@kipper/core"; import { TargetJS } from "./target"; +import type { InterfaceMethodDeclaration } from "@kipper/core/lib/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration"; /** * The TypeScript target-specific semantic analyser. @@ -108,10 +111,30 @@ export class JavaScriptTargetSemanticAnalyser extends KipperTargetSemanticAnalys this.checkViabilityOfIdentifier(node); }; + /** + * Performs typescript-specific semantic analysis for {@link VariableDeclaration} instances. + */ interfaceDeclaration = async (node: InterfaceDeclaration) => { this.checkViabilityOfIdentifier(node); }; + /** + * Performs typescript-specific semantic analysis for {@link InterfacePropertyDeclaration} instances. + */ + interfacePropertyDeclaration = async (node: InterfacePropertyDeclaration) => { + this.checkViabilityOfIdentifier(node); + }; + + /** + * Performs typescript-specific semantic analysis for {@link InterfaceMethodDeclaration} instances. + */ + interfaceMethodDeclaration = async (node: InterfaceMethodDeclaration) => { + this.checkViabilityOfIdentifier(node); + }; + + /** + * Performs typescript-specific semantic analysis for {@link VariableDeclaration} instances. + */ classDeclaration = async (node: ClassDeclaration) => { this.checkViabilityOfIdentifier(node); }; @@ -277,5 +300,5 @@ export class JavaScriptTargetSemanticAnalyser extends KipperTargetSemanticAnalys /** * Performs typescript-specific semantic analysis for {@link LambdaExpression} instances. */ - lambdaExpression = undefined; + lambdaPrimaryExpression = undefined; } diff --git a/kipper/target-ts/src/code-generator.ts b/kipper/target-ts/src/code-generator.ts index 57bc71f8c..d2066b7a0 100644 --- a/kipper/target-ts/src/code-generator.ts +++ b/kipper/target-ts/src/code-generator.ts @@ -2,11 +2,18 @@ * The TypeScript target-specific code generator for translating Kipper code into TypeScript. * @since 0.8.0 */ -import type { TranslatedCodeLine, VariableDeclaration } from "@kipper/core"; -import type { FunctionDeclaration } from "@kipper/core"; +import type { + FunctionDeclaration, + InterfaceDeclaration, + InterfacePropertyDeclaration, + ParameterDeclaration, + TranslatedCodeLine, + VariableDeclaration, +} from "@kipper/core"; import { createTSFunctionSignature, getTSFunctionSignature } from "./tools"; import { JavaScriptTargetCodeGenerator } from "@kipper/target-js"; import { TargetTS } from "./target"; +import type { InterfaceMethodDeclaration } from "@kipper/core/lib/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration"; /** * The TypeScript target-specific code generator for translating Kipper code into TypeScript. @@ -52,4 +59,72 @@ export class TypeScriptTargetCodeGenerator extends JavaScriptTargetCodeGenerator ], ]; }; + + override interfaceDeclaration = async (node: InterfaceDeclaration): Promise> => { + const semanticData = node.getSemanticData(); + const interfaceName = semanticData.identifier; + const interfaceMembers = semanticData.members; + + const memberDeclarations = await Promise.all( + interfaceMembers.map(async (member) => { + return member.translateCtxAndChildren(); + }), + ); + + return [ + ["interface", " ", interfaceName, " ", "{"], + ...memberDeclarations.flat().map((line) => [" ", ...line]), + ["}"], + ]; + }; + + override interfaceMethodDeclaration = async ( + node: InterfaceMethodDeclaration, + ): Promise> => { + const semanticData = node.getSemanticData(); + const params = semanticData.parameters; + const returnTypeIdentifier = TargetTS.getTypeScriptType( + semanticData.returnType.getSemanticData().typeIdentifier.identifier, + ); + + const paramsCode: TranslatedCodeLine[] = await Promise.all( + params.map(async (param) => { + return param.translateCtxAndChildren(); + }), + ).then((results) => results.flat()); + + // Return the method declaration + return [ + [ + semanticData.identifier, + "(", + paramsCode.map((param) => param.join("")).join(", "), + ")", + ":", + " ", + returnTypeIdentifier, + ";", + ], + ]; + }; + + override interfacePropertyDeclaration = async ( + node: InterfacePropertyDeclaration, + ): Promise> => { + const semanticData = node.getSemanticData(); + const identifier = semanticData.identifier; + const valueType = TargetTS.getTypeScriptType(semanticData.type.identifier); + + // Return the property declaration + return [[identifier, ":", " ", valueType, ";"]]; + }; + + override parameterDeclaration = async (node: ParameterDeclaration): Promise> => { + const semanticData = node.getSemanticData(); + const identifier = semanticData.identifier; + const valueType = TargetTS.getTypeScriptType(semanticData.valueType.identifier); + + // Return the parameter declaration + return [[identifier, ":", " ", valueType]]; + }; } diff --git a/test.kip b/test.kip deleted file mode 100644 index 1c404c9c8..000000000 --- a/test.kip +++ /dev/null @@ -1,4 +0,0 @@ -#pragma no-optimise -// Test -print(2 as str); -print(true as str); diff --git a/test/kipper-files/empty-interface.kip b/test/kipper-files/empty-interface.kip new file mode 100644 index 000000000..e69de29bb diff --git a/test/kipper-files/populated-interface.kip b/test/kipper-files/populated-interface.kip new file mode 100644 index 000000000..e69de29bb diff --git a/test/module/core/core-functionality.test.ts b/test/module/core/core-functionality.test.ts index a9d6868ff..e342dad3c 100644 --- a/test/module/core/core-functionality.test.ts +++ b/test/module/core/core-functionality.test.ts @@ -3,6 +3,7 @@ import { KipperCompiler } from "@kipper/core"; import { assert } from "chai"; import * as ts from "typescript"; import { KipperTypeScriptTarget } from "@kipper/target-ts"; +import { jsConfig } from "./errors"; /** * Tests the 'print' function of Kipper. @@ -1241,6 +1242,70 @@ describe("Core functionality", () => { }); }); + describe("Lambdas", () => { + const compiler = new KipperCompiler(); + + it("parses simple lambda expression without syntax errors", async () => { + const code = `var add: func = (x: num, y: num): num -> x + y;`; + try { + const result = await compiler.compile(code, jsConfig); + + // Evaluate the compiled code + let stringResult = result.result!.map((x) => x.join("")).join("\n"); + stringResult = stringResult.concat("\nadd(1, 2);"); + const res = eval(stringResult); + assert.equal(res, 3, "Lambda expression evaluated correctly"); + } catch (e) { + assert.fail("Failed to analyze lambda expression semantically"); + } + }); + + it("correctly identifies semantic data for a lambda with compound statement", async () => { + const code = `var greet: func = (name: str): str -> { return "Hello, " + name; };`; + try { + const result = await compiler.compile(code, jsConfig); + + // Evaluate the compiled code + let stringResult = result.result!.map((x) => x.join("")).join("\n"); + stringResult = stringResult.concat("\ngreet('John');"); + const res = eval(stringResult); + assert.equal(res, "Hello, John", "Lambda expression evaluated correctly"); + } catch (e) { + assert.fail("Failed to analyze lambda expression semantically"); + } + }); + + it("correctly identifies semantic data for a lambda with single statement", async () => { + const code = `var greet: func = (name: str): str -> "Hello, " + name;`; + try { + const result = await compiler.compile(code, jsConfig); + + // Evaluate the compiled code + let stringResult = result.result!.map((x) => x.join("")).join("\n"); + stringResult = stringResult.concat("\ngreet('John');"); + const res = eval(stringResult); + assert.equal(res, "Hello, John", "Lambda expression evaluated correctly"); + } catch (e) { + assert.fail("Failed to analyze lambda expression semantically"); + } + }); + + it("correctly identifies semantic data for a lambda with no parameters", async () => { + const code = `var greet: func = (): str -> "Hello, World!";`; + try { + const result = await compiler.compile(code, jsConfig); + + // Evaluate the compiled code + let stringResult = result.result!.map((x) => x.join("")).join("\n"); + stringResult = stringResult.concat("\ngreet();"); + const res = eval(stringResult); + assert.equal(res, "Hello, World!", "Lambda expression evaluated correctly"); + } catch (e) { + assert.fail("Failed to analyze lambda expression semantically"); + } + }); + }); + describe("Functions", () => { it("Declaration", async () => { const fileContent = "def test() -> void { }"; @@ -1307,4 +1372,44 @@ describe("Core functionality", () => { testPrintOutput((message: any) => assert.equal(message, "6", "Expected different result"), jsCode); }); }); + + describe("Interfaces", async () => { + it("Can initialize empty interface", async () => { + const fileContent = "interface Test { }"; + const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); + + assert.isDefined(instance.programCtx); + assert.equal(instance.programCtx!!.errors.length, 0, "Expected no compilation errors"); + let written = instance.write(); + assert.include(written, "interface Test {\n}", "Invalid TypeScript code (Expected different output)"); + }); + + it("can initialize interface with members", async () => { + const fileContent = "interface Test {\n x: num;\n y: str;\n greet(name: str) : str;}"; + const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); + + assert.isDefined(instance.programCtx); + assert.equal(instance.programCtx!!.errors.length, 0, "Expected no compilation errors"); + let written = instance.write(); + assert.include( + written, + "interface Test {\n x: number;\n y: string;\n greet(name: string): string;\n}", + "Invalid TypeScript code (Expected different output)", + ); + }); + + it("should can initialize with mixed members", async () => { + const fileContent = "interface Test {\n x: num;\n isTrue(f: bool): str;\n y: str;\n greet(name: str) : str;}"; + const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); + + assert.isDefined(instance.programCtx); + assert.equal(instance.programCtx!!.errors.length, 0, "Expected no compilation errors"); + let written = instance.write(); + assert.include( + written, + "interface Test {\n x: number;\n isTrue(f: boolean): string;\n y: string;\n greet(name: string): string;\n}", + "Invalid TypeScript code (Expected different output)", + ); + }); + }); }); diff --git a/test/module/core/errors/type-errors/lambda-expression.ts b/test/module/core/errors/type-errors/lambda-expression.ts deleted file mode 100644 index 1892db9d4..000000000 --- a/test/module/core/errors/type-errors/lambda-expression.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { KipperCompiler } from "@kipper/core"; -import { assert } from "chai"; -import { jsConfig } from "../index"; - -describe("LambdaExpressionTests", () => { - const compiler = new KipperCompiler(); - - it("parses simple lambda expression without syntax errors", async () => { - const code = `var add: func = (x: num, y: num): num -> x + y;`; - try { - const result = await compiler.compile(code, jsConfig); - // Evaluate the compiled code - let stringResult = result.result!.map((x) => x.join("")).join("\n"); - stringResult = stringResult.concat("\nadd(1, 2);"); - const res = eval(stringResult); - assert.equal(res, 3, "Lambda expression evaluated correctly"); - } catch (e) { - assert.fail("Failed to analyze lambda expression semantically"); - } - }); - - it("correctly identifies semantic data for a lambda with compound statement", async () => { - const code = `var greet: func = (name: str): str -> { return "Hello, " + name; };`; - try { - const result = await compiler.compile(code, jsConfig); - // Evaluate the compiled code - let stringResult = result.result!.map((x) => x.join("")).join("\n"); - stringResult = stringResult.concat("\ngreet('John');"); - const res = eval(stringResult); - assert.equal(res, "Hello, John", "Lambda expression evaluated correctly"); - } catch (e) { - assert.fail("Failed to analyze lambda expression semantically"); - } - }); - - it("correctly identifies semantic data for a lambda with single statement", async () => { - const code = `var greet: func = (name: str): str -> "Hello, " + name;`; - try { - const result = await compiler.compile(code, jsConfig); - // Evaluate the compiled code - let stringResult = result.result!.map((x) => x.join("")).join("\n"); - stringResult = stringResult.concat("\ngreet('John');"); - const res = eval(stringResult); - assert.equal(res, "Hello, John", "Lambda expression evaluated correctly"); - } catch (e) { - assert.fail("Failed to analyze lambda expression semantically"); - } - }); - - it("correctly identifies semantic data for a lambda with no parameters", async () => { - const code = `var greet: func = (): str -> "Hello, World!";`; - try { - const result = await compiler.compile(code, jsConfig); - // Evaluate the compiled code - let stringResult = result.result!.map((x) => x.join("")).join("\n"); - stringResult = stringResult.concat("\ngreet();"); - const res = eval(stringResult); - assert.equal(res, "Hello, World!", "Lambda expression evaluated correctly"); - } catch (e) { - assert.fail("Failed to analyze lambda expression semantically"); - } - }); -}); diff --git a/test/module/core/pragma.test.ts b/test/module/core/pragma.test.ts deleted file mode 100644 index 276eba2b9..000000000 --- a/test/module/core/pragma.test.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { KipperCompiler, type KipperCompileResult } from "@kipper/core"; -import { KipperTypeScriptTarget } from "@kipper/target-ts"; -import { promises as fs } from "fs"; -import { assert } from "chai"; -import { getFileName } from "./compiler.test"; - -const notOptimizedKipperFile = getFileName("not-optimised.kip"); -const optimizedKipperFile = getFileName("optimised.kip"); - -describe("no-optimise", () => { - const compiler = new KipperCompiler(); - const defaultTarget = new KipperTypeScriptTarget(); - - it("should be optimised", async () => { - const fileContent = (await fs.readFile(notOptimizedKipperFile, "utf8" as BufferEncoding)).toString(); - const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); - - assert.isDefined(instance.programCtx); - assert.equal(instance.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.include(instance.write(), '__kipper.voidToStr = function voidToStr(): string { return "void"; };'); - }); - - it("should not be optimised", async () => { - const fileContent = (await fs.readFile(optimizedKipperFile, "utf8" as BufferEncoding)).toString(); - const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); - - assert.isDefined(instance.programCtx); - assert.equal(instance.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.notInclude(instance.write(), '__kipper.voidToStr = function voidToStr(): string { return "void"; };'); - }); -});