From db18c5867a7ad6640f48310d42560d4a312b2314 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Tue, 2 Jul 2024 16:54:31 +0200 Subject: [PATCH 01/57] major (#524): Added interface and class grammar rules to KipperLexer.g4 and KipperParser.g4 --- kipper/core/KipperLexer.g4 | 6 +- kipper/core/KipperLexer.tokens | 192 ++++++++++++++++---------------- kipper/core/KipperParser.g4 | 33 ++++-- kipper/core/KipperParser.tokens | 192 ++++++++++++++++---------------- 4 files changed, 222 insertions(+), 201 deletions(-) diff --git a/kipper/core/KipperLexer.g4 b/kipper/core/KipperLexer.g4 index 0c61f0830..51432825b 100644 --- a/kipper/core/KipperLexer.g4 +++ b/kipper/core/KipperLexer.g4 @@ -62,7 +62,7 @@ Else : 'else'; // for - loop For : 'for'; -// Enum Variable +// enums Enum : 'enum'; // function-related @@ -71,6 +71,10 @@ Return : 'return'; CallFunc : 'call'; RetIndicator : '->'; +// class and interface-related +Class : 'class'; +Interface : 'interface'; + // boolean constants True : 'true'; False : 'false'; diff --git a/kipper/core/KipperLexer.tokens b/kipper/core/KipperLexer.tokens index a8e8b39b6..a7b97ced0 100644 --- a/kipper/core/KipperLexer.tokens +++ b/kipper/core/KipperLexer.tokens @@ -20,60 +20,62 @@ DefFunc=19 Return=20 CallFunc=21 RetIndicator=22 -True=23 -False=24 -Typeof=25 -Void=26 -Null=27 -Undefined=28 -Comma=29 -SemiColon=30 -QuestionMark=31 -Colon=32 -LeftParen=33 -RightParen=34 -LeftBracket=35 -RightBracket=36 -FStringExpEnd=37 -LeftBrace=38 -RightBrace=39 -Plus=40 -PlusPlus=41 -Minus=42 -MinusMinus=43 -Star=44 -Div=45 -Mod=46 -PowerTo=47 -AndAnd=48 -OrOr=49 -Not=50 -Assign=51 -PlusAssign=52 -MinusAssign=53 -StarAssign=54 -DivAssign=55 -ModAssign=56 -Equal=57 -NotEqual=58 -Less=59 -LessEqual=60 -Greater=61 -GreaterEqual=62 -Dot=63 -Identifier=64 -IntegerConstant=65 -SingleQuoteStringLiteral=66 -DoubleQuoteStringLiteral=67 -FloatingConstant=68 -Whitespace=69 -Newline=70 -FStringSingleQuoteStart=71 -FStringDoubleQuoteStart=72 -FStringSingleQuoteEnd=73 -FStringSingleQuoteAtom=74 -FStringDoubleQuoteEnd=75 -FStringDoubleQuoteAtom=76 +Class=23 +Interface=24 +True=25 +False=26 +Typeof=27 +Void=28 +Null=29 +Undefined=30 +Comma=31 +SemiColon=32 +QuestionMark=33 +Colon=34 +LeftParen=35 +RightParen=36 +LeftBracket=37 +RightBracket=38 +FStringExpEnd=39 +LeftBrace=40 +RightBrace=41 +Plus=42 +PlusPlus=43 +Minus=44 +MinusMinus=45 +Star=46 +Div=47 +Mod=48 +PowerTo=49 +AndAnd=50 +OrOr=51 +Not=52 +Assign=53 +PlusAssign=54 +MinusAssign=55 +StarAssign=56 +DivAssign=57 +ModAssign=58 +Equal=59 +NotEqual=60 +Less=61 +LessEqual=62 +Greater=63 +GreaterEqual=64 +Dot=65 +Identifier=66 +IntegerConstant=67 +SingleQuoteStringLiteral=68 +DoubleQuoteStringLiteral=69 +FloatingConstant=70 +Whitespace=71 +Newline=72 +FStringSingleQuoteStart=73 +FStringDoubleQuoteStart=74 +FStringSingleQuoteEnd=75 +FStringSingleQuoteAtom=76 +FStringDoubleQuoteEnd=77 +FStringDoubleQuoteAtom=78 'const'=4 'var'=5 'as'=6 @@ -93,43 +95,45 @@ FStringDoubleQuoteAtom=76 'return'=20 'call'=21 '->'=22 -'true'=23 -'false'=24 -'typeof'=25 -'void'=26 -'null'=27 -'undefined'=28 -','=29 -';'=30 -'?'=31 -':'=32 -'('=33 -')'=34 -'['=35 -']'=36 -'{'=38 -'}'=39 -'+'=40 -'++'=41 -'-'=42 -'--'=43 -'*'=44 -'/'=45 -'%'=46 -'**'=47 -'&&'=48 -'||'=49 -'!'=50 -'='=51 -'+='=52 -'-='=53 -'*='=54 -'/='=55 -'%='=56 -'=='=57 -'!='=58 -'<'=59 -'<='=60 -'>'=61 -'>='=62 -'.'=63 +'class'=23 +'interface'=24 +'true'=25 +'false'=26 +'typeof'=27 +'void'=28 +'null'=29 +'undefined'=30 +','=31 +';'=32 +'?'=33 +':'=34 +'('=35 +')'=36 +'['=37 +']'=38 +'{'=40 +'}'=41 +'+'=42 +'++'=43 +'-'=44 +'--'=45 +'*'=46 +'/'=47 +'%'=48 +'**'=49 +'&&'=50 +'||'=51 +'!'=52 +'='=53 +'+='=54 +'-='=55 +'*='=56 +'/='=57 +'%='=58 +'=='=59 +'!='=60 +'<'=61 +'<='=62 +'>'=63 +'>='=64 +'.'=65 diff --git a/kipper/core/KipperParser.g4 b/kipper/core/KipperParser.g4 index 7d0403a87..79d44f13a 100644 --- a/kipper/core/KipperParser.g4 +++ b/kipper/core/KipperParser.g4 @@ -42,13 +42,11 @@ blockItem declaration : variableDeclaration SemiColon - | functionDeclaration SemiColon? + | functionDeclaration + | interfaceDeclaration + | classDeclaration ; -functionDeclaration - : 'def' declarator '(' parameterList? ')' '->' typeSpecifierExpression compoundStatement? - ; - variableDeclaration : storageTypeSpecifier initDeclarator ; @@ -58,6 +56,14 @@ storageTypeSpecifier | 'const' ; +initDeclarator + : declarator ':' typeSpecifierExpression ('=' initializer)? + ; + +initializer + : assignmentExpression + ; + declarator : directDeclarator ; @@ -66,22 +72,25 @@ directDeclarator : Identifier ; -initDeclarator - : declarator ':' typeSpecifierExpression ('=' initializer)? - ; +functionDeclaration + : 'def' declarator '(' parameterList? ')' '->' typeSpecifierExpression compoundStatement? + ; parameterList : parameterDeclaration (',' parameterDeclaration)* - // Note: Args and Kwargs, like in Python will be added later ; parameterDeclaration : declarator ':' typeSpecifierExpression ; -initializer - : assignmentExpression - ; +interfaceDeclaration + : 'interface' Identifier '{' '}' + ; + +classDeclaration + : 'class' Identifier '{' '}' + ; // -- Statements diff --git a/kipper/core/KipperParser.tokens b/kipper/core/KipperParser.tokens index a8e8b39b6..a7b97ced0 100644 --- a/kipper/core/KipperParser.tokens +++ b/kipper/core/KipperParser.tokens @@ -20,60 +20,62 @@ DefFunc=19 Return=20 CallFunc=21 RetIndicator=22 -True=23 -False=24 -Typeof=25 -Void=26 -Null=27 -Undefined=28 -Comma=29 -SemiColon=30 -QuestionMark=31 -Colon=32 -LeftParen=33 -RightParen=34 -LeftBracket=35 -RightBracket=36 -FStringExpEnd=37 -LeftBrace=38 -RightBrace=39 -Plus=40 -PlusPlus=41 -Minus=42 -MinusMinus=43 -Star=44 -Div=45 -Mod=46 -PowerTo=47 -AndAnd=48 -OrOr=49 -Not=50 -Assign=51 -PlusAssign=52 -MinusAssign=53 -StarAssign=54 -DivAssign=55 -ModAssign=56 -Equal=57 -NotEqual=58 -Less=59 -LessEqual=60 -Greater=61 -GreaterEqual=62 -Dot=63 -Identifier=64 -IntegerConstant=65 -SingleQuoteStringLiteral=66 -DoubleQuoteStringLiteral=67 -FloatingConstant=68 -Whitespace=69 -Newline=70 -FStringSingleQuoteStart=71 -FStringDoubleQuoteStart=72 -FStringSingleQuoteEnd=73 -FStringSingleQuoteAtom=74 -FStringDoubleQuoteEnd=75 -FStringDoubleQuoteAtom=76 +Class=23 +Interface=24 +True=25 +False=26 +Typeof=27 +Void=28 +Null=29 +Undefined=30 +Comma=31 +SemiColon=32 +QuestionMark=33 +Colon=34 +LeftParen=35 +RightParen=36 +LeftBracket=37 +RightBracket=38 +FStringExpEnd=39 +LeftBrace=40 +RightBrace=41 +Plus=42 +PlusPlus=43 +Minus=44 +MinusMinus=45 +Star=46 +Div=47 +Mod=48 +PowerTo=49 +AndAnd=50 +OrOr=51 +Not=52 +Assign=53 +PlusAssign=54 +MinusAssign=55 +StarAssign=56 +DivAssign=57 +ModAssign=58 +Equal=59 +NotEqual=60 +Less=61 +LessEqual=62 +Greater=63 +GreaterEqual=64 +Dot=65 +Identifier=66 +IntegerConstant=67 +SingleQuoteStringLiteral=68 +DoubleQuoteStringLiteral=69 +FloatingConstant=70 +Whitespace=71 +Newline=72 +FStringSingleQuoteStart=73 +FStringDoubleQuoteStart=74 +FStringSingleQuoteEnd=75 +FStringSingleQuoteAtom=76 +FStringDoubleQuoteEnd=77 +FStringDoubleQuoteAtom=78 'const'=4 'var'=5 'as'=6 @@ -93,43 +95,45 @@ FStringDoubleQuoteAtom=76 'return'=20 'call'=21 '->'=22 -'true'=23 -'false'=24 -'typeof'=25 -'void'=26 -'null'=27 -'undefined'=28 -','=29 -';'=30 -'?'=31 -':'=32 -'('=33 -')'=34 -'['=35 -']'=36 -'{'=38 -'}'=39 -'+'=40 -'++'=41 -'-'=42 -'--'=43 -'*'=44 -'/'=45 -'%'=46 -'**'=47 -'&&'=48 -'||'=49 -'!'=50 -'='=51 -'+='=52 -'-='=53 -'*='=54 -'/='=55 -'%='=56 -'=='=57 -'!='=58 -'<'=59 -'<='=60 -'>'=61 -'>='=62 -'.'=63 +'class'=23 +'interface'=24 +'true'=25 +'false'=26 +'typeof'=27 +'void'=28 +'null'=29 +'undefined'=30 +','=31 +';'=32 +'?'=33 +':'=34 +'('=35 +')'=36 +'['=37 +']'=38 +'{'=40 +'}'=41 +'+'=42 +'++'=43 +'-'=44 +'--'=45 +'*'=46 +'/'=47 +'%'=48 +'**'=49 +'&&'=50 +'||'=51 +'!'=52 +'='=53 +'+='=54 +'-='=55 +'*='=56 +'/='=57 +'%='=58 +'=='=59 +'!='=60 +'<'=61 +'<='=62 +'>'=63 +'>='=64 +'.'=65 From e9238b026becd7f776236585ab0a2ac58be276bf Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Tue, 2 Jul 2024 16:54:46 +0200 Subject: [PATCH 02/57] major (#524): Added new AST nodes for interface and class declarations --- .../analysis/symbol-table/class-scope.ts | 17 + .../analysis/symbol-table/entry/index.ts | 1 + .../entry/scope-type-declaration.ts | 86 + .../core/src/compiler/ast/common/ast-types.ts | 18 +- .../compiler/ast/mapping/ast-node-mapper.ts | 22 +- .../class-declaration-semantics.ts | 17 + .../class-declaration-type-semantics.ts | 11 + .../class-declaration/class-declaration.ts | 160 + .../declarations/class-declaration/index.ts | 8 + .../compiler/ast/nodes/declarations/index.ts | 2 + .../interface-declaration/index.ts | 8 + .../interface-declaration-semantics.ts | 17 + .../interface-declaration-type-semantics.ts | 11 + .../interface-declaration.ts | 142 + .../compiler/parser/antlr/KipperLexer.interp | 8 +- .../compiler/parser/antlr/KipperLexer.tokens | 192 +- .../src/compiler/parser/antlr/KipperLexer.ts | 1101 ++- .../compiler/parser/antlr/KipperParser.interp | 14 +- .../compiler/parser/antlr/KipperParser.tokens | 192 +- .../src/compiler/parser/antlr/KipperParser.ts | 6247 ++++++++--------- .../parser/antlr/KipperParserListener.ts | 80 +- .../parser/antlr/KipperParserVisitor.ts | 54 +- .../parser/parse-rule-kind-mapping.ts | 8 +- .../target-presets/semantic-analyser.ts | 16 +- .../translation/code-generator.ts | 16 +- 25 files changed, 4117 insertions(+), 4331 deletions(-) create mode 100644 kipper/core/src/compiler/analysis/symbol-table/class-scope.ts create mode 100644 kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration-semantics.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration-type-semantics.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/class-declaration/index.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/index.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration-semantics.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration-type-semantics.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration.ts diff --git a/kipper/core/src/compiler/analysis/symbol-table/class-scope.ts b/kipper/core/src/compiler/analysis/symbol-table/class-scope.ts new file mode 100644 index 000000000..1013d9abb --- /dev/null +++ b/kipper/core/src/compiler/analysis/symbol-table/class-scope.ts @@ -0,0 +1,17 @@ +/** + * File containing the definition for a class-specific scope that is bound to a {@link InterfaceDeclaration} and not + * the global namespace. + * @since 0.11.0 + */ +import {InterfaceDeclaration, FunctionDeclaration, ClassDeclaration} from "../../ast"; +import { LocalScope } from "./local-scope"; + +/** + * A function-specific scope that is bound to a {@link FunctionDeclaration} and not the global namespace. + * @since 0.11.0 + */ +export class ClassScope extends LocalScope { + constructor(public ctx: ClassDeclaration) { + super(ctx); + } +} diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/index.ts b/kipper/core/src/compiler/analysis/symbol-table/entry/index.ts index b4864c2d1..fb71b9033 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/entry/index.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/entry/index.ts @@ -6,3 +6,4 @@ export * from "./scope-declaration"; export * from "./scope-variable-declaration"; export * from "./scope-parameter-declaration"; export * from "./scope-function-declaration"; +export * from "./scope-type-declaration"; diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts new file mode 100644 index 000000000..ada4d3315 --- /dev/null +++ b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts @@ -0,0 +1,86 @@ +/** + * A symbol table entry for a type declaration such as a class or interface. + * @since 0.11.0 + */ +import {ScopeDeclaration} from "./scope-declaration"; +import { + ClassDeclaration, + FunctionDeclarationSemantics, + InterfaceDeclaration, + InterfaceDeclarationSemantics, +} from "../../../ast"; +import {CheckedType} from "../../type"; + +/** + * Represents the definition of a type such as a class or interface in a scope. + * @since 0.11.0 + */ +export class ScopeTypeDeclaration extends ScopeDeclaration { + private readonly _node: InterfaceDeclaration | ClassDeclaration; + + public constructor(node: InterfaceDeclaration | ClassDeclaration) { + super(); + this._node = node; + } + + /** + * The semantic data of this declaration. + * @throws UndefinedSemanticsError If this is accessed, before semantic analysis was performed. + * @private + */ + private get semanticData(): InterfaceDeclarationSemantics | FunctionDeclarationSemantics { + return this._node.getSemanticData(); + } + + /** + * Returns the {@link InterfaceDeclaration} or {@link ClassDeclaration AST node} this scope type declaration bases on. + */ + public get node(): InterfaceDeclaration | ClassDeclaration { + return this._node; + } + + /** + * The identifier of this type. + */ + public get identifier(): string { + return this.semanticData.identifier; + } + + /** + * The type of this type. This is always "type". + * @since 0.11.0 + */ + public get type(): CheckedType { + return CheckedType.fromCompilableType("type"); + } + + /** + * Returns whether the declaration has a value. + * + * As this is a type, it will always be false. + * @since 0.11.0 + */ + public get isDefined(): false { + return false; + } + + /** + * Returns whether the declaration has a value. + * + * As this is a type, it will always be false. + * @since 0.11.0 + */ + public get hasValue(): false { + return false; + } + + /** + * Returns whether the declaration has a callable value (function). + * + * As this is a type, it will always be false. + * @since 0.11.0 + */ + public get isCallable(): false { + return false; + } +} diff --git a/kipper/core/src/compiler/ast/common/ast-types.ts b/kipper/core/src/compiler/ast/common/ast-types.ts index 244260446..1c0cb724f 100644 --- a/kipper/core/src/compiler/ast/common/ast-types.ts +++ b/kipper/core/src/compiler/ast/common/ast-types.ts @@ -2,13 +2,13 @@ * AST pre-set types that are used throughout the compiler. * @since 0.10.0 */ -import type { +import { AdditiveExpressionContext, ArrayPrimaryExpressionContext, AssignmentExpressionContext, BoolPrimaryExpressionContext, BracketNotationMemberAccessExpressionContext, - CastOrConvertExpressionContext, + CastOrConvertExpressionContext, ClassDeclarationContext, CompoundStatementContext, ConditionalExpressionContext, DotNotationMemberAccessExpressionContext, @@ -24,7 +24,7 @@ import type { IdentifierTypeSpecifierExpressionContext, IfStatementContext, IncrementOrDecrementPostfixExpressionContext, - IncrementOrDecrementUnaryExpressionContext, + IncrementOrDecrementUnaryExpressionContext, InterfaceDeclarationContext, JumpStatementContext, LogicalAndExpressionContext, LogicalOrExpressionContext, @@ -99,7 +99,9 @@ export type ParserStatementContext = export type ParserDeclarationContext = | FunctionDeclarationContext | ParameterDeclarationContext - | VariableDeclarationContext; + | VariableDeclarationContext + | InterfaceDeclarationContext + | ClassDeclarationContext; /** * Union type of all rule context classes implemented by the {@link ParseRuleKindMapping} that have a corresponding AST node class. @@ -118,7 +120,9 @@ export type ASTNodeParserContext = ParserExpressionContext | ParserStatementCont export type ASTDeclarationKind = | typeof ParseRuleKindMapping.RULE_functionDeclaration | typeof ParseRuleKindMapping.RULE_parameterDeclaration - | typeof ParseRuleKindMapping.RULE_variableDeclaration; + | typeof ParseRuleKindMapping.RULE_variableDeclaration + | typeof ParseRuleKindMapping.RULE_interfaceDeclaration + | typeof ParseRuleKindMapping.RULE_classDeclaration; /** * Union type of all possible {@link ParserASTNode.kind} values for a {@link Statement} AST node. @@ -189,7 +193,9 @@ export type ConstructableASTKind = ASTDeclarationKind | ASTStatementKind | ASTEx export type ASTDeclarationRuleName = | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_functionDeclaration] | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_parameterDeclaration] - | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_variableDeclaration]; + | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_variableDeclaration] + | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_interfaceDeclaration] + | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_classDeclaration]; /** * Union type of all possible {@link ParserASTNode.ruleName} values that have a constructable {@link Statement} AST 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 018478717..f0ee4b3e2 100644 --- a/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts +++ b/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts @@ -5,13 +5,13 @@ * @since 0.11.0 */ import { - ParseRuleKindMapping, AdditiveExpressionContext, ArrayPrimaryExpressionContext, AssignmentExpressionContext, BoolPrimaryExpressionContext, BracketNotationMemberAccessExpressionContext, CastOrConvertExpressionContext, + ClassDeclarationContext, CompoundStatementContext, ConditionalExpressionContext, DotNotationMemberAccessExpressionContext, @@ -28,14 +28,17 @@ import { IfStatementContext, IncrementOrDecrementPostfixExpressionContext, IncrementOrDecrementUnaryExpressionContext, + InterfaceDeclarationContext, JumpStatementContext, LogicalAndExpressionContext, LogicalOrExpressionContext, MultiplicativeExpressionContext, NumberPrimaryExpressionContext, ObjectPrimaryExpressionContext, + ObjectPropertyContext, OperatorModifiedUnaryExpressionContext, ParameterDeclarationContext, + ParseRuleKindMapping, RelationalExpressionContext, ReturnStatementContext, SliceNotationMemberAccessExpressionContext, @@ -46,7 +49,6 @@ import { VariableDeclarationContext, VoidOrNullOrUndefinedPrimaryExpressionContext, WhileLoopIterationStatementContext, - ObjectPropertyContext, } from "../../parser"; import type { ASTDeclarationKind, @@ -56,18 +58,19 @@ import type { ASTStatementKind, ASTStatementRuleName, } from "../common"; -import type { Declaration, Expression, Statement } from "../nodes"; -import { ObjectProperty } from "../nodes"; import { AdditiveExpression, ArrayPrimaryExpression, AssignmentExpression, BoolPrimaryExpression, CastOrConvertExpression, + ClassDeclaration, CompoundStatement, ConditionalExpression, + Declaration, DoWhileLoopIterationStatement, EqualityExpression, + Expression, ExpressionStatement, ForLoopIterationStatement, FStringPrimaryExpression, @@ -79,6 +82,7 @@ import { IfStatement, IncrementOrDecrementPostfixExpression, IncrementOrDecrementUnaryExpression, + InterfaceDeclaration, JumpStatement, LogicalAndExpression, LogicalOrExpression, @@ -86,17 +90,19 @@ import { MultiplicativeExpression, NumberPrimaryExpression, ObjectPrimaryExpression, + ObjectProperty, OperatorModifiedUnaryExpression, ParameterDeclaration, RelationalExpression, ReturnStatement, + Statement, StringPrimaryExpression, SwitchStatement, TangledPrimaryExpression, TypeofTypeSpecifierExpression, VariableDeclaration, VoidOrNullOrUndefinedPrimaryExpression, - WhileLoopIterationStatement, + WhileLoopIterationStatement } from "../nodes"; /** @@ -115,6 +121,8 @@ export class ASTNodeMapper { [ParseRuleKindMapping.RULE_functionDeclaration]: FunctionDeclaration, [ParseRuleKindMapping.RULE_variableDeclaration]: VariableDeclaration, [ParseRuleKindMapping.RULE_parameterDeclaration]: ParameterDeclaration, + [ParseRuleKindMapping.RULE_interfaceDeclaration]: InterfaceDeclaration, + [ParseRuleKindMapping.RULE_classDeclaration]: ClassDeclaration, } satisfies Record>; /** @@ -178,6 +186,8 @@ export class ASTNodeMapper { [ParseRuleKindMapping.RULE_functionDeclaration]: FunctionDeclarationContext, [ParseRuleKindMapping.RULE_variableDeclaration]: VariableDeclarationContext, [ParseRuleKindMapping.RULE_parameterDeclaration]: ParameterDeclarationContext, + [ParseRuleKindMapping.RULE_interfaceDeclaration]: InterfaceDeclarationContext, + [ParseRuleKindMapping.RULE_classDeclaration]: ClassDeclarationContext, } satisfies Record; /** @@ -246,6 +256,8 @@ export class ASTNodeMapper { RULE_functionDeclaration: FunctionDeclaration, RULE_variableDeclaration: VariableDeclaration, RULE_parameterDeclaration: ParameterDeclaration, + RULE_interfaceDeclaration: InterfaceDeclaration, + RULE_classDeclaration: ClassDeclaration, } satisfies Record>; /** diff --git a/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration-semantics.ts new file mode 100644 index 000000000..87997d4f2 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration-semantics.ts @@ -0,0 +1,17 @@ +/** + * Semantics for AST Node {@link ClassDeclaration}. + * @since 0.11.0 + */ +import type { DeclarationSemantics } from "../declaration-semantics"; + +/** + * Semantics for AST Node {@link ClassDeclaration}. + * @since 0.11.0 + */ +export interface ClassDeclarationSemantics extends DeclarationSemantics { + /** + * The identifier of this class. + * @since 0.11.0 + */ + identifier: string; +} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration-type-semantics.ts new file mode 100644 index 000000000..331b357da --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration-type-semantics.ts @@ -0,0 +1,11 @@ +/** + * Type semantics for AST Node {@link ClassDeclaration}. + * @since 0.11.0 + */ +import type { DeclarationTypeSemantics } from "../declaration-type-semantics"; + +/** + * Type semantics for AST Node {@link ClassDeclaration}. + * @since 0.11.0 + */ +export interface ClassDeclarationTypeSemantics extends DeclarationTypeSemantics {} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration.ts new file mode 100644 index 000000000..eb167f8f9 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration.ts @@ -0,0 +1,160 @@ +/** + * Represents a class declaration in the Kipper language, which may contain methods and fields. + * @since 0.11.0 + */ +import type {ScopeNode} from "../../../scope-node"; +import type {ClassDeclarationSemantics} from "./class-declaration-semantics"; +import type {ClassDeclarationTypeSemantics} from "./class-declaration-type-semantics"; +import type {CompilableNodeParent} from "../../../compilable-ast-node"; +import {ScopeTypeDeclaration} from "../../../../analysis"; +import {ClassDeclarationContext, KindParseRuleMapping, ParseRuleKindMapping} from "../../../../parser"; +import {Declaration} from "../declaration"; +import {KipperNotImplementedError} from "../../../../../errors"; +import {ClassScope} from "../../../../analysis/symbol-table/class-scope"; + +/** + * Represents a class declaration in the Kipper language, which may contain methods and fields. + * @since 0.11.0 + */ +export class ClassDeclaration + extends Declaration + implements ScopeNode +{ + /** + * The private field '_innerScope' that actually stores the variable data, + * which is returned inside the {@link this.innerScope}. + * @private + */ + private readonly _innerScope: ClassScope; + + /** + * The private field '_antlrRuleCtx' that actually stores the variable data, + * which is returned inside the {@link this.antlrRuleCtx}. + * @private + */ + protected override readonly _antlrRuleCtx: ClassDeclarationContext; + + /** + * 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.11.0 + */ + public static readonly kind = ParseRuleKindMapping.RULE_classDeclaration; + + /** + * 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.11.0 + */ + public override get kind() { + return ClassDeclaration.kind; + } + + /** + * The static rule name for this AST Node. + * @since 0.11.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.11.0 + */ + public override get ruleName() { + return ClassDeclaration.ruleName; + } + + constructor(antlrRuleCtx: ClassDeclarationContext, parent: CompilableNodeParent) { + super(antlrRuleCtx, parent); + this._antlrRuleCtx = antlrRuleCtx; + this._innerScope = new ClassScope(this); + } + + /** + * The antlr context containing the antlr4 metadata for this expression. + */ + public override get antlrRuleCtx(): ClassDeclarationContext { + return this._antlrRuleCtx; + } + + /** + * Gets the inner scope of this class. + * @since 0.11.0 + */ + public get innerScope(): ClassScope { + return this._innerScope; + } + + /** + * The {@link ScopeDeclaration} context instance for this declaration, which is used to register the declaration + * in the {@link scope parent scope}. + * @since 0.11.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 { + this + .programCtx + .semanticCheck(this) + .notImplementedError(new KipperNotImplementedError("Class declarations are not yet implemented.")); + } + + /** + * 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 { + this + .programCtx + .semanticCheck(this) + .notImplementedError(new KipperNotImplementedError("Class 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.classDeclaration; + readonly targetCodeGenerator = this.codeGenerator.classDeclaration; +} + diff --git a/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/index.ts b/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/index.ts new file mode 100644 index 000000000..93aafc51e --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/index.ts @@ -0,0 +1,8 @@ +/** + * AST Node {@link ClassDeclaration} and the related {@link ClassDeclarationSemantics semantics} and + * {@link ClassDeclarationTypeSemantics type semantics}. + * @since 0.11.0 + */ +export * from "./class-declaration"; +export * from "./class-declaration-semantics"; +export * from "./class-declaration-type-semantics"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/index.ts b/kipper/core/src/compiler/ast/nodes/declarations/index.ts index e782ff02e..6fe8a6754 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/index.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/index.ts @@ -9,3 +9,5 @@ export * from "./declaration-type-semantics"; export * from "./parameter-declaration/"; export * from "./function-declaration/"; export * from "./variable-declaration/"; +export * from "./class-declaration/"; +export * from "./interface-declaration/"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/index.ts b/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/index.ts new file mode 100644 index 000000000..3bba5b835 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/index.ts @@ -0,0 +1,8 @@ +/** + * AST Node {@link InterfaceDeclaration} and the related {@link InterfaceDeclarationSemantics semantics} and + * {@link InterfaceDeclarationTypeSemantics type semantics}. + * @since 0.11.0 + */ +export * from "./interface-declaration"; +export * from "./interface-declaration-semantics"; +export * from "./interface-declaration-type-semantics"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration-semantics.ts new file mode 100644 index 000000000..0f8c729fe --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration-semantics.ts @@ -0,0 +1,17 @@ +/** + * Semantics for AST Node {@link ClassDeclaration}. + * @since 0.11.0 + */ +import type { DeclarationSemantics } from "../declaration-semantics"; + +/** + * Semantics for AST Node {@link ClassDeclaration}. + * @since 0.11.0 + */ +export interface InterfaceDeclarationSemantics extends DeclarationSemantics { + /** + * The identifier of this interface. + * @since 0.11.0 + */ + identifier: string; +} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration-type-semantics.ts new file mode 100644 index 000000000..664d7fec4 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration-type-semantics.ts @@ -0,0 +1,11 @@ +/** + * Type semantics for AST Node {@link ClassDeclaration}. + * @since 0.11.0 + */ +import type { DeclarationTypeSemantics } from "../declaration-type-semantics"; + +/** + * Type semantics for AST Node {@link ClassDeclaration}. + * @since 0.11.0 + */ +export interface InterfaceDeclarationTypeSemantics extends DeclarationTypeSemantics {} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration.ts new file mode 100644 index 000000000..5c513eb56 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration.ts @@ -0,0 +1,142 @@ +/** + * Represents an interface declaration in the Kipper language, which may contain methods and fields declarations. + * @since 0.11.0 + */ +import type {InterfaceDeclarationSemantics} from "./interface-declaration-semantics"; +import type {InterfaceDeclarationTypeSemantics} from "./interface-declaration-type-semantics"; +import type {CompilableNodeParent} from "../../../compilable-ast-node"; +import {ScopeTypeDeclaration} from "../../../../analysis"; +import { + InterfaceDeclarationContext, + KindParseRuleMapping, + ParseRuleKindMapping +} from "../../../../parser"; +import {Declaration} from "../declaration"; +import {KipperNotImplementedError} from "../../../../../errors"; + +/** + * Represents an interface declaration in the Kipper language, which may contain methods and fields declarations. + * @since 0.11.0 + */ +export class InterfaceDeclaration extends Declaration { + /** + * The private field '_antlrRuleCtx' that actually stores the variable data, + * which is returned inside the {@link this.antlrRuleCtx}. + * @private + */ + protected override readonly _antlrRuleCtx: InterfaceDeclarationContext; + + /** + * 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.11.0 + */ + public static readonly kind = ParseRuleKindMapping.RULE_interfaceDeclaration; + + /** + * 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.11.0 + */ + public override get kind() { + return InterfaceDeclaration.kind; + } + + /** + * The static rule name for this AST Node. + * @since 0.11.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.11.0 + */ + public override get ruleName() { + return InterfaceDeclaration.ruleName; + } + + constructor(antlrRuleCtx: InterfaceDeclarationContext, parent: CompilableNodeParent) { + super(antlrRuleCtx, parent); + this._antlrRuleCtx = antlrRuleCtx; + } + + /** + * The antlr context containing the antlr4 metadata for this expression. + */ + public override get antlrRuleCtx(): InterfaceDeclarationContext { + 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.11.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 { + this + .programCtx + .semanticCheck(this) + .notImplementedError(new KipperNotImplementedError("Interface declarations are not yet implemented.")); + } + + /** + * 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 { + this + .programCtx + .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/parser/antlr/KipperLexer.interp b/kipper/core/src/compiler/parser/antlr/KipperLexer.interp index c67e06923..60edf6927 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperLexer.interp +++ b/kipper/core/src/compiler/parser/antlr/KipperLexer.interp @@ -22,6 +22,8 @@ null 'return' 'call' '->' +'class' +'interface' 'true' 'false' 'typeof' @@ -101,6 +103,8 @@ DefFunc Return CallFunc RetIndicator +Class +Interface True False Typeof @@ -178,6 +182,8 @@ DefFunc Return CallFunc RetIndicator +Class +Interface True False Typeof @@ -278,4 +284,4 @@ SINGLE_QUOTE_FSTRING DOUBLE_QUOTE_FSTRING atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 78, 686, 8, 1, 8, 1, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, 9, 101, 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 4, 105, 9, 105, 4, 106, 9, 106, 4, 107, 9, 107, 4, 108, 9, 108, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 224, 10, 2, 12, 2, 14, 2, 227, 11, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 238, 10, 3, 12, 3, 14, 3, 241, 11, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 45, 3, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 62, 3, 62, 3, 62, 3, 63, 3, 63, 3, 64, 3, 64, 3, 64, 7, 64, 470, 10, 64, 12, 64, 14, 64, 473, 11, 64, 3, 65, 3, 65, 3, 65, 3, 65, 5, 65, 479, 10, 65, 3, 66, 3, 66, 5, 66, 483, 10, 66, 3, 66, 3, 66, 3, 67, 3, 67, 5, 67, 489, 10, 67, 3, 67, 3, 67, 3, 68, 3, 68, 3, 69, 6, 69, 496, 10, 69, 13, 69, 14, 69, 497, 3, 69, 3, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 75, 3, 75, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 78, 3, 78, 3, 79, 3, 79, 3, 80, 3, 80, 3, 81, 3, 81, 3, 82, 6, 82, 553, 10, 82, 13, 82, 14, 82, 554, 3, 83, 3, 83, 3, 83, 6, 83, 560, 10, 83, 13, 83, 14, 83, 561, 3, 84, 3, 84, 3, 84, 6, 84, 567, 10, 84, 13, 84, 14, 84, 568, 3, 85, 3, 85, 3, 85, 6, 85, 574, 10, 85, 13, 85, 14, 85, 575, 3, 86, 3, 86, 3, 87, 3, 87, 3, 88, 3, 88, 3, 89, 3, 89, 3, 90, 3, 90, 5, 90, 588, 10, 90, 3, 90, 3, 90, 3, 90, 5, 90, 593, 10, 90, 3, 91, 5, 91, 596, 10, 91, 3, 91, 3, 91, 3, 91, 3, 91, 3, 91, 5, 91, 603, 10, 91, 3, 92, 3, 92, 5, 92, 607, 10, 92, 3, 92, 3, 92, 3, 93, 6, 93, 612, 10, 93, 13, 93, 14, 93, 613, 3, 94, 3, 94, 3, 95, 6, 95, 619, 10, 95, 13, 95, 14, 95, 620, 3, 96, 3, 96, 5, 96, 625, 10, 96, 3, 97, 3, 97, 3, 97, 5, 97, 630, 10, 97, 3, 98, 3, 98, 3, 98, 3, 99, 3, 99, 3, 99, 5, 99, 638, 10, 99, 3, 99, 5, 99, 641, 10, 99, 3, 100, 3, 100, 3, 100, 3, 100, 6, 100, 647, 10, 100, 13, 100, 14, 100, 648, 3, 101, 6, 101, 652, 10, 101, 13, 101, 14, 101, 653, 3, 102, 3, 102, 5, 102, 658, 10, 102, 3, 103, 6, 103, 661, 10, 103, 13, 103, 14, 103, 662, 3, 104, 3, 104, 5, 104, 667, 10, 104, 3, 105, 6, 105, 670, 10, 105, 13, 105, 14, 105, 671, 3, 106, 3, 106, 5, 106, 676, 10, 106, 3, 107, 6, 107, 679, 10, 107, 13, 107, 14, 107, 680, 3, 108, 3, 108, 5, 108, 685, 10, 108, 3, 225, 2, 2, 109, 5, 2, 4, 7, 2, 5, 9, 2, 6, 11, 2, 7, 13, 2, 8, 15, 2, 9, 17, 2, 10, 19, 2, 11, 21, 2, 12, 23, 2, 13, 25, 2, 14, 27, 2, 15, 29, 2, 16, 31, 2, 17, 33, 2, 18, 35, 2, 19, 37, 2, 20, 39, 2, 21, 41, 2, 22, 43, 2, 23, 45, 2, 24, 47, 2, 25, 49, 2, 26, 51, 2, 27, 53, 2, 28, 55, 2, 29, 57, 2, 30, 59, 2, 31, 61, 2, 32, 63, 2, 33, 65, 2, 34, 67, 2, 35, 69, 2, 36, 71, 2, 37, 73, 2, 38, 75, 2, 39, 77, 2, 40, 79, 2, 41, 81, 2, 42, 83, 2, 43, 85, 2, 44, 87, 2, 45, 89, 2, 46, 91, 2, 47, 93, 2, 48, 95, 2, 49, 97, 2, 50, 99, 2, 51, 101, 2, 52, 103, 2, 53, 105, 2, 54, 107, 2, 55, 109, 2, 56, 111, 2, 57, 113, 2, 58, 115, 2, 59, 117, 2, 60, 119, 2, 61, 121, 2, 62, 123, 2, 63, 125, 2, 64, 127, 2, 65, 129, 2, 66, 131, 2, 67, 133, 2, 68, 135, 2, 69, 137, 2, 70, 139, 2, 71, 141, 2, 72, 143, 2, 73, 145, 2, 74, 147, 2, 2, 149, 2, 75, 151, 2, 76, 153, 2, 2, 155, 2, 77, 157, 2, 78, 159, 2, 2, 161, 2, 2, 163, 2, 2, 165, 2, 2, 167, 2, 2, 169, 2, 2, 171, 2, 2, 173, 2, 2, 175, 2, 2, 177, 2, 2, 179, 2, 2, 181, 2, 2, 183, 2, 2, 185, 2, 2, 187, 2, 2, 189, 2, 2, 191, 2, 2, 193, 2, 2, 195, 2, 2, 197, 2, 2, 199, 2, 2, 201, 2, 2, 203, 2, 2, 205, 2, 2, 207, 2, 2, 209, 2, 2, 211, 2, 2, 213, 2, 2, 215, 2, 2, 217, 2, 2, 5, 2, 3, 4, 20, 5, 2, 12, 12, 15, 15, 8234, 8235, 6, 2, 11, 11, 13, 14, 34, 34, 162, 162, 5, 2, 67, 92, 97, 97, 99, 124, 3, 2, 50, 59, 4, 2, 68, 68, 100, 100, 4, 2, 81, 81, 113, 113, 4, 2, 90, 90, 122, 122, 3, 2, 51, 59, 3, 2, 50, 51, 3, 2, 50, 57, 5, 2, 50, 59, 67, 72, 99, 104, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, 6, 2, 12, 12, 15, 15, 41, 41, 94, 94, 14, 2, 36, 36, 41, 41, 65, 65, 94, 94, 99, 100, 104, 104, 112, 112, 116, 116, 118, 118, 120, 120, 125, 125, 127, 127, 8, 2, 12, 12, 15, 15, 41, 41, 94, 94, 125, 125, 127, 127, 8, 2, 12, 12, 15, 15, 36, 36, 94, 94, 125, 125, 127, 127, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94, 2, 688, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, 2, 109, 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, 2, 2, 2, 2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 2, 123, 3, 2, 2, 2, 2, 125, 3, 2, 2, 2, 2, 127, 3, 2, 2, 2, 2, 129, 3, 2, 2, 2, 2, 131, 3, 2, 2, 2, 2, 133, 3, 2, 2, 2, 2, 135, 3, 2, 2, 2, 2, 137, 3, 2, 2, 2, 2, 139, 3, 2, 2, 2, 2, 141, 3, 2, 2, 2, 2, 143, 3, 2, 2, 2, 2, 145, 3, 2, 2, 2, 3, 147, 3, 2, 2, 2, 3, 149, 3, 2, 2, 2, 3, 151, 3, 2, 2, 2, 4, 153, 3, 2, 2, 2, 4, 155, 3, 2, 2, 2, 4, 157, 3, 2, 2, 2, 5, 219, 3, 2, 2, 2, 7, 233, 3, 2, 2, 2, 9, 244, 3, 2, 2, 2, 11, 250, 3, 2, 2, 2, 13, 254, 3, 2, 2, 2, 15, 257, 3, 2, 2, 2, 17, 261, 3, 2, 2, 2, 19, 268, 3, 2, 2, 2, 21, 273, 3, 2, 2, 2, 23, 281, 3, 2, 2, 2, 25, 287, 3, 2, 2, 2, 27, 296, 3, 2, 2, 2, 29, 299, 3, 2, 2, 2, 31, 305, 3, 2, 2, 2, 33, 308, 3, 2, 2, 2, 35, 313, 3, 2, 2, 2, 37, 317, 3, 2, 2, 2, 39, 322, 3, 2, 2, 2, 41, 326, 3, 2, 2, 2, 43, 333, 3, 2, 2, 2, 45, 338, 3, 2, 2, 2, 47, 341, 3, 2, 2, 2, 49, 346, 3, 2, 2, 2, 51, 352, 3, 2, 2, 2, 53, 359, 3, 2, 2, 2, 55, 364, 3, 2, 2, 2, 57, 369, 3, 2, 2, 2, 59, 379, 3, 2, 2, 2, 61, 381, 3, 2, 2, 2, 63, 383, 3, 2, 2, 2, 65, 385, 3, 2, 2, 2, 67, 387, 3, 2, 2, 2, 69, 389, 3, 2, 2, 2, 71, 391, 3, 2, 2, 2, 73, 393, 3, 2, 2, 2, 75, 395, 3, 2, 2, 2, 77, 400, 3, 2, 2, 2, 79, 402, 3, 2, 2, 2, 81, 404, 3, 2, 2, 2, 83, 406, 3, 2, 2, 2, 85, 409, 3, 2, 2, 2, 87, 411, 3, 2, 2, 2, 89, 414, 3, 2, 2, 2, 91, 416, 3, 2, 2, 2, 93, 418, 3, 2, 2, 2, 95, 420, 3, 2, 2, 2, 97, 423, 3, 2, 2, 2, 99, 426, 3, 2, 2, 2, 101, 429, 3, 2, 2, 2, 103, 431, 3, 2, 2, 2, 105, 433, 3, 2, 2, 2, 107, 436, 3, 2, 2, 2, 109, 439, 3, 2, 2, 2, 111, 442, 3, 2, 2, 2, 113, 445, 3, 2, 2, 2, 115, 448, 3, 2, 2, 2, 117, 451, 3, 2, 2, 2, 119, 454, 3, 2, 2, 2, 121, 456, 3, 2, 2, 2, 123, 459, 3, 2, 2, 2, 125, 461, 3, 2, 2, 2, 127, 464, 3, 2, 2, 2, 129, 466, 3, 2, 2, 2, 131, 478, 3, 2, 2, 2, 133, 480, 3, 2, 2, 2, 135, 486, 3, 2, 2, 2, 137, 492, 3, 2, 2, 2, 139, 495, 3, 2, 2, 2, 141, 501, 3, 2, 2, 2, 143, 505, 3, 2, 2, 2, 145, 512, 3, 2, 2, 2, 147, 519, 3, 2, 2, 2, 149, 525, 3, 2, 2, 2, 151, 530, 3, 2, 2, 2, 153, 532, 3, 2, 2, 2, 155, 538, 3, 2, 2, 2, 157, 543, 3, 2, 2, 2, 159, 545, 3, 2, 2, 2, 161, 547, 3, 2, 2, 2, 163, 549, 3, 2, 2, 2, 165, 552, 3, 2, 2, 2, 167, 556, 3, 2, 2, 2, 169, 563, 3, 2, 2, 2, 171, 570, 3, 2, 2, 2, 173, 577, 3, 2, 2, 2, 175, 579, 3, 2, 2, 2, 177, 581, 3, 2, 2, 2, 179, 583, 3, 2, 2, 2, 181, 592, 3, 2, 2, 2, 183, 602, 3, 2, 2, 2, 185, 604, 3, 2, 2, 2, 187, 611, 3, 2, 2, 2, 189, 615, 3, 2, 2, 2, 191, 618, 3, 2, 2, 2, 193, 624, 3, 2, 2, 2, 195, 629, 3, 2, 2, 2, 197, 631, 3, 2, 2, 2, 199, 634, 3, 2, 2, 2, 201, 642, 3, 2, 2, 2, 203, 651, 3, 2, 2, 2, 205, 657, 3, 2, 2, 2, 207, 660, 3, 2, 2, 2, 209, 666, 3, 2, 2, 2, 211, 669, 3, 2, 2, 2, 213, 675, 3, 2, 2, 2, 215, 678, 3, 2, 2, 2, 217, 684, 3, 2, 2, 2, 219, 220, 7, 49, 2, 2, 220, 221, 7, 44, 2, 2, 221, 225, 3, 2, 2, 2, 222, 224, 11, 2, 2, 2, 223, 222, 3, 2, 2, 2, 224, 227, 3, 2, 2, 2, 225, 226, 3, 2, 2, 2, 225, 223, 3, 2, 2, 2, 226, 228, 3, 2, 2, 2, 227, 225, 3, 2, 2, 2, 228, 229, 7, 44, 2, 2, 229, 230, 7, 49, 2, 2, 230, 231, 3, 2, 2, 2, 231, 232, 8, 2, 2, 2, 232, 6, 3, 2, 2, 2, 233, 234, 7, 49, 2, 2, 234, 235, 7, 49, 2, 2, 235, 239, 3, 2, 2, 2, 236, 238, 10, 2, 2, 2, 237, 236, 3, 2, 2, 2, 238, 241, 3, 2, 2, 2, 239, 237, 3, 2, 2, 2, 239, 240, 3, 2, 2, 2, 240, 242, 3, 2, 2, 2, 241, 239, 3, 2, 2, 2, 242, 243, 8, 3, 2, 2, 243, 8, 3, 2, 2, 2, 244, 245, 7, 101, 2, 2, 245, 246, 7, 113, 2, 2, 246, 247, 7, 112, 2, 2, 247, 248, 7, 117, 2, 2, 248, 249, 7, 118, 2, 2, 249, 10, 3, 2, 2, 2, 250, 251, 7, 120, 2, 2, 251, 252, 7, 99, 2, 2, 252, 253, 7, 116, 2, 2, 253, 12, 3, 2, 2, 2, 254, 255, 7, 99, 2, 2, 255, 256, 7, 117, 2, 2, 256, 14, 3, 2, 2, 2, 257, 258, 7, 48, 2, 2, 258, 259, 7, 48, 2, 2, 259, 260, 7, 48, 2, 2, 260, 16, 3, 2, 2, 2, 261, 262, 7, 117, 2, 2, 262, 263, 7, 121, 2, 2, 263, 264, 7, 107, 2, 2, 264, 265, 7, 118, 2, 2, 265, 266, 7, 101, 2, 2, 266, 267, 7, 106, 2, 2, 267, 18, 3, 2, 2, 2, 268, 269, 7, 101, 2, 2, 269, 270, 7, 99, 2, 2, 270, 271, 7, 117, 2, 2, 271, 272, 7, 103, 2, 2, 272, 20, 3, 2, 2, 2, 273, 274, 7, 102, 2, 2, 274, 275, 7, 103, 2, 2, 275, 276, 7, 104, 2, 2, 276, 277, 7, 99, 2, 2, 277, 278, 7, 119, 2, 2, 278, 279, 7, 110, 2, 2, 279, 280, 7, 118, 2, 2, 280, 22, 3, 2, 2, 2, 281, 282, 7, 100, 2, 2, 282, 283, 7, 116, 2, 2, 283, 284, 7, 103, 2, 2, 284, 285, 7, 99, 2, 2, 285, 286, 7, 109, 2, 2, 286, 24, 3, 2, 2, 2, 287, 288, 7, 101, 2, 2, 288, 289, 7, 113, 2, 2, 289, 290, 7, 112, 2, 2, 290, 291, 7, 118, 2, 2, 291, 292, 7, 107, 2, 2, 292, 293, 7, 112, 2, 2, 293, 294, 7, 119, 2, 2, 294, 295, 7, 103, 2, 2, 295, 26, 3, 2, 2, 2, 296, 297, 7, 102, 2, 2, 297, 298, 7, 113, 2, 2, 298, 28, 3, 2, 2, 2, 299, 300, 7, 121, 2, 2, 300, 301, 7, 106, 2, 2, 301, 302, 7, 107, 2, 2, 302, 303, 7, 110, 2, 2, 303, 304, 7, 103, 2, 2, 304, 30, 3, 2, 2, 2, 305, 306, 7, 107, 2, 2, 306, 307, 7, 104, 2, 2, 307, 32, 3, 2, 2, 2, 308, 309, 7, 103, 2, 2, 309, 310, 7, 110, 2, 2, 310, 311, 7, 117, 2, 2, 311, 312, 7, 103, 2, 2, 312, 34, 3, 2, 2, 2, 313, 314, 7, 104, 2, 2, 314, 315, 7, 113, 2, 2, 315, 316, 7, 116, 2, 2, 316, 36, 3, 2, 2, 2, 317, 318, 7, 103, 2, 2, 318, 319, 7, 112, 2, 2, 319, 320, 7, 119, 2, 2, 320, 321, 7, 111, 2, 2, 321, 38, 3, 2, 2, 2, 322, 323, 7, 102, 2, 2, 323, 324, 7, 103, 2, 2, 324, 325, 7, 104, 2, 2, 325, 40, 3, 2, 2, 2, 326, 327, 7, 116, 2, 2, 327, 328, 7, 103, 2, 2, 328, 329, 7, 118, 2, 2, 329, 330, 7, 119, 2, 2, 330, 331, 7, 116, 2, 2, 331, 332, 7, 112, 2, 2, 332, 42, 3, 2, 2, 2, 333, 334, 7, 101, 2, 2, 334, 335, 7, 99, 2, 2, 335, 336, 7, 110, 2, 2, 336, 337, 7, 110, 2, 2, 337, 44, 3, 2, 2, 2, 338, 339, 7, 47, 2, 2, 339, 340, 7, 64, 2, 2, 340, 46, 3, 2, 2, 2, 341, 342, 7, 118, 2, 2, 342, 343, 7, 116, 2, 2, 343, 344, 7, 119, 2, 2, 344, 345, 7, 103, 2, 2, 345, 48, 3, 2, 2, 2, 346, 347, 7, 104, 2, 2, 347, 348, 7, 99, 2, 2, 348, 349, 7, 110, 2, 2, 349, 350, 7, 117, 2, 2, 350, 351, 7, 103, 2, 2, 351, 50, 3, 2, 2, 2, 352, 353, 7, 118, 2, 2, 353, 354, 7, 123, 2, 2, 354, 355, 7, 114, 2, 2, 355, 356, 7, 103, 2, 2, 356, 357, 7, 113, 2, 2, 357, 358, 7, 104, 2, 2, 358, 52, 3, 2, 2, 2, 359, 360, 7, 120, 2, 2, 360, 361, 7, 113, 2, 2, 361, 362, 7, 107, 2, 2, 362, 363, 7, 102, 2, 2, 363, 54, 3, 2, 2, 2, 364, 365, 7, 112, 2, 2, 365, 366, 7, 119, 2, 2, 366, 367, 7, 110, 2, 2, 367, 368, 7, 110, 2, 2, 368, 56, 3, 2, 2, 2, 369, 370, 7, 119, 2, 2, 370, 371, 7, 112, 2, 2, 371, 372, 7, 102, 2, 2, 372, 373, 7, 103, 2, 2, 373, 374, 7, 104, 2, 2, 374, 375, 7, 107, 2, 2, 375, 376, 7, 112, 2, 2, 376, 377, 7, 103, 2, 2, 377, 378, 7, 102, 2, 2, 378, 58, 3, 2, 2, 2, 379, 380, 7, 46, 2, 2, 380, 60, 3, 2, 2, 2, 381, 382, 7, 61, 2, 2, 382, 62, 3, 2, 2, 2, 383, 384, 7, 65, 2, 2, 384, 64, 3, 2, 2, 2, 385, 386, 7, 60, 2, 2, 386, 66, 3, 2, 2, 2, 387, 388, 7, 42, 2, 2, 388, 68, 3, 2, 2, 2, 389, 390, 7, 43, 2, 2, 390, 70, 3, 2, 2, 2, 391, 392, 7, 93, 2, 2, 392, 72, 3, 2, 2, 2, 393, 394, 7, 95, 2, 2, 394, 74, 3, 2, 2, 2, 395, 396, 6, 37, 2, 2, 396, 397, 7, 127, 2, 2, 397, 398, 3, 2, 2, 2, 398, 399, 8, 37, 3, 2, 399, 76, 3, 2, 2, 2, 400, 401, 7, 125, 2, 2, 401, 78, 3, 2, 2, 2, 402, 403, 7, 127, 2, 2, 403, 80, 3, 2, 2, 2, 404, 405, 7, 45, 2, 2, 405, 82, 3, 2, 2, 2, 406, 407, 7, 45, 2, 2, 407, 408, 7, 45, 2, 2, 408, 84, 3, 2, 2, 2, 409, 410, 7, 47, 2, 2, 410, 86, 3, 2, 2, 2, 411, 412, 7, 47, 2, 2, 412, 413, 7, 47, 2, 2, 413, 88, 3, 2, 2, 2, 414, 415, 7, 44, 2, 2, 415, 90, 3, 2, 2, 2, 416, 417, 7, 49, 2, 2, 417, 92, 3, 2, 2, 2, 418, 419, 7, 39, 2, 2, 419, 94, 3, 2, 2, 2, 420, 421, 7, 44, 2, 2, 421, 422, 7, 44, 2, 2, 422, 96, 3, 2, 2, 2, 423, 424, 7, 40, 2, 2, 424, 425, 7, 40, 2, 2, 425, 98, 3, 2, 2, 2, 426, 427, 7, 126, 2, 2, 427, 428, 7, 126, 2, 2, 428, 100, 3, 2, 2, 2, 429, 430, 7, 35, 2, 2, 430, 102, 3, 2, 2, 2, 431, 432, 7, 63, 2, 2, 432, 104, 3, 2, 2, 2, 433, 434, 7, 45, 2, 2, 434, 435, 7, 63, 2, 2, 435, 106, 3, 2, 2, 2, 436, 437, 7, 47, 2, 2, 437, 438, 7, 63, 2, 2, 438, 108, 3, 2, 2, 2, 439, 440, 7, 44, 2, 2, 440, 441, 7, 63, 2, 2, 441, 110, 3, 2, 2, 2, 442, 443, 7, 49, 2, 2, 443, 444, 7, 63, 2, 2, 444, 112, 3, 2, 2, 2, 445, 446, 7, 39, 2, 2, 446, 447, 7, 63, 2, 2, 447, 114, 3, 2, 2, 2, 448, 449, 7, 63, 2, 2, 449, 450, 7, 63, 2, 2, 450, 116, 3, 2, 2, 2, 451, 452, 7, 35, 2, 2, 452, 453, 7, 63, 2, 2, 453, 118, 3, 2, 2, 2, 454, 455, 7, 62, 2, 2, 455, 120, 3, 2, 2, 2, 456, 457, 7, 62, 2, 2, 457, 458, 7, 63, 2, 2, 458, 122, 3, 2, 2, 2, 459, 460, 7, 64, 2, 2, 460, 124, 3, 2, 2, 2, 461, 462, 7, 64, 2, 2, 462, 463, 7, 63, 2, 2, 463, 126, 3, 2, 2, 2, 464, 465, 7, 48, 2, 2, 465, 128, 3, 2, 2, 2, 466, 471, 5, 159, 79, 2, 467, 470, 5, 159, 79, 2, 468, 470, 5, 163, 81, 2, 469, 467, 3, 2, 2, 2, 469, 468, 3, 2, 2, 2, 470, 473, 3, 2, 2, 2, 471, 469, 3, 2, 2, 2, 471, 472, 3, 2, 2, 2, 472, 130, 3, 2, 2, 2, 473, 471, 3, 2, 2, 2, 474, 479, 5, 165, 82, 2, 475, 479, 5, 169, 84, 2, 476, 479, 5, 171, 85, 2, 477, 479, 5, 167, 83, 2, 478, 474, 3, 2, 2, 2, 478, 475, 3, 2, 2, 2, 478, 476, 3, 2, 2, 2, 478, 477, 3, 2, 2, 2, 479, 132, 3, 2, 2, 2, 480, 482, 7, 41, 2, 2, 481, 483, 5, 211, 105, 2, 482, 481, 3, 2, 2, 2, 482, 483, 3, 2, 2, 2, 483, 484, 3, 2, 2, 2, 484, 485, 7, 41, 2, 2, 485, 134, 3, 2, 2, 2, 486, 488, 7, 36, 2, 2, 487, 489, 5, 215, 107, 2, 488, 487, 3, 2, 2, 2, 488, 489, 3, 2, 2, 2, 489, 490, 3, 2, 2, 2, 490, 491, 7, 36, 2, 2, 491, 136, 3, 2, 2, 2, 492, 493, 5, 181, 90, 2, 493, 138, 3, 2, 2, 2, 494, 496, 9, 3, 2, 2, 495, 494, 3, 2, 2, 2, 496, 497, 3, 2, 2, 2, 497, 495, 3, 2, 2, 2, 497, 498, 3, 2, 2, 2, 498, 499, 3, 2, 2, 2, 499, 500, 8, 69, 4, 2, 500, 140, 3, 2, 2, 2, 501, 502, 9, 2, 2, 2, 502, 503, 3, 2, 2, 2, 503, 504, 8, 70, 4, 2, 504, 142, 3, 2, 2, 2, 505, 506, 7, 104, 2, 2, 506, 507, 7, 41, 2, 2, 507, 508, 3, 2, 2, 2, 508, 509, 8, 71, 5, 2, 509, 510, 3, 2, 2, 2, 510, 511, 8, 71, 6, 2, 511, 144, 3, 2, 2, 2, 512, 513, 7, 104, 2, 2, 513, 514, 7, 36, 2, 2, 514, 515, 3, 2, 2, 2, 515, 516, 8, 72, 7, 2, 516, 517, 3, 2, 2, 2, 517, 518, 8, 72, 8, 2, 518, 146, 3, 2, 2, 2, 519, 520, 6, 73, 3, 2, 520, 521, 7, 125, 2, 2, 521, 522, 3, 2, 2, 2, 522, 523, 8, 73, 9, 2, 523, 524, 8, 73, 10, 2, 524, 148, 3, 2, 2, 2, 525, 526, 7, 41, 2, 2, 526, 527, 8, 74, 11, 2, 527, 528, 3, 2, 2, 2, 528, 529, 8, 74, 3, 2, 529, 150, 3, 2, 2, 2, 530, 531, 5, 203, 101, 2, 531, 152, 3, 2, 2, 2, 532, 533, 6, 76, 4, 2, 533, 534, 7, 125, 2, 2, 534, 535, 3, 2, 2, 2, 535, 536, 8, 76, 9, 2, 536, 537, 8, 76, 10, 2, 537, 154, 3, 2, 2, 2, 538, 539, 7, 36, 2, 2, 539, 540, 8, 77, 12, 2, 540, 541, 3, 2, 2, 2, 541, 542, 8, 77, 3, 2, 542, 156, 3, 2, 2, 2, 543, 544, 5, 207, 103, 2, 544, 158, 3, 2, 2, 2, 545, 546, 5, 161, 80, 2, 546, 160, 3, 2, 2, 2, 547, 548, 9, 4, 2, 2, 548, 162, 3, 2, 2, 2, 549, 550, 9, 5, 2, 2, 550, 164, 3, 2, 2, 2, 551, 553, 5, 163, 81, 2, 552, 551, 3, 2, 2, 2, 553, 554, 3, 2, 2, 2, 554, 552, 3, 2, 2, 2, 554, 555, 3, 2, 2, 2, 555, 166, 3, 2, 2, 2, 556, 557, 7, 50, 2, 2, 557, 559, 9, 6, 2, 2, 558, 560, 5, 175, 87, 2, 559, 558, 3, 2, 2, 2, 560, 561, 3, 2, 2, 2, 561, 559, 3, 2, 2, 2, 561, 562, 3, 2, 2, 2, 562, 168, 3, 2, 2, 2, 563, 564, 7, 50, 2, 2, 564, 566, 9, 7, 2, 2, 565, 567, 5, 177, 88, 2, 566, 565, 3, 2, 2, 2, 567, 568, 3, 2, 2, 2, 568, 566, 3, 2, 2, 2, 568, 569, 3, 2, 2, 2, 569, 170, 3, 2, 2, 2, 570, 571, 7, 50, 2, 2, 571, 573, 9, 8, 2, 2, 572, 574, 5, 179, 89, 2, 573, 572, 3, 2, 2, 2, 574, 575, 3, 2, 2, 2, 575, 573, 3, 2, 2, 2, 575, 576, 3, 2, 2, 2, 576, 172, 3, 2, 2, 2, 577, 578, 9, 9, 2, 2, 578, 174, 3, 2, 2, 2, 579, 580, 9, 10, 2, 2, 580, 176, 3, 2, 2, 2, 581, 582, 9, 11, 2, 2, 582, 178, 3, 2, 2, 2, 583, 584, 9, 12, 2, 2, 584, 180, 3, 2, 2, 2, 585, 587, 5, 183, 91, 2, 586, 588, 5, 185, 92, 2, 587, 586, 3, 2, 2, 2, 587, 588, 3, 2, 2, 2, 588, 593, 3, 2, 2, 2, 589, 590, 5, 187, 93, 2, 590, 591, 5, 185, 92, 2, 591, 593, 3, 2, 2, 2, 592, 585, 3, 2, 2, 2, 592, 589, 3, 2, 2, 2, 593, 182, 3, 2, 2, 2, 594, 596, 5, 187, 93, 2, 595, 594, 3, 2, 2, 2, 595, 596, 3, 2, 2, 2, 596, 597, 3, 2, 2, 2, 597, 598, 7, 48, 2, 2, 598, 603, 5, 187, 93, 2, 599, 600, 5, 187, 93, 2, 600, 601, 7, 48, 2, 2, 601, 603, 3, 2, 2, 2, 602, 595, 3, 2, 2, 2, 602, 599, 3, 2, 2, 2, 603, 184, 3, 2, 2, 2, 604, 606, 9, 13, 2, 2, 605, 607, 5, 189, 94, 2, 606, 605, 3, 2, 2, 2, 606, 607, 3, 2, 2, 2, 607, 608, 3, 2, 2, 2, 608, 609, 5, 187, 93, 2, 609, 186, 3, 2, 2, 2, 610, 612, 5, 163, 81, 2, 611, 610, 3, 2, 2, 2, 612, 613, 3, 2, 2, 2, 613, 611, 3, 2, 2, 2, 613, 614, 3, 2, 2, 2, 614, 188, 3, 2, 2, 2, 615, 616, 9, 14, 2, 2, 616, 190, 3, 2, 2, 2, 617, 619, 5, 193, 96, 2, 618, 617, 3, 2, 2, 2, 619, 620, 3, 2, 2, 2, 620, 618, 3, 2, 2, 2, 620, 621, 3, 2, 2, 2, 621, 192, 3, 2, 2, 2, 622, 625, 10, 15, 2, 2, 623, 625, 5, 195, 97, 2, 624, 622, 3, 2, 2, 2, 624, 623, 3, 2, 2, 2, 625, 194, 3, 2, 2, 2, 626, 630, 5, 197, 98, 2, 627, 630, 5, 199, 99, 2, 628, 630, 5, 201, 100, 2, 629, 626, 3, 2, 2, 2, 629, 627, 3, 2, 2, 2, 629, 628, 3, 2, 2, 2, 630, 196, 3, 2, 2, 2, 631, 632, 7, 94, 2, 2, 632, 633, 9, 16, 2, 2, 633, 198, 3, 2, 2, 2, 634, 635, 7, 94, 2, 2, 635, 637, 5, 177, 88, 2, 636, 638, 5, 177, 88, 2, 637, 636, 3, 2, 2, 2, 637, 638, 3, 2, 2, 2, 638, 640, 3, 2, 2, 2, 639, 641, 5, 177, 88, 2, 640, 639, 3, 2, 2, 2, 640, 641, 3, 2, 2, 2, 641, 200, 3, 2, 2, 2, 642, 643, 7, 94, 2, 2, 643, 644, 7, 122, 2, 2, 644, 646, 3, 2, 2, 2, 645, 647, 5, 179, 89, 2, 646, 645, 3, 2, 2, 2, 647, 648, 3, 2, 2, 2, 648, 646, 3, 2, 2, 2, 648, 649, 3, 2, 2, 2, 649, 202, 3, 2, 2, 2, 650, 652, 5, 205, 102, 2, 651, 650, 3, 2, 2, 2, 652, 653, 3, 2, 2, 2, 653, 651, 3, 2, 2, 2, 653, 654, 3, 2, 2, 2, 654, 204, 3, 2, 2, 2, 655, 658, 10, 17, 2, 2, 656, 658, 5, 195, 97, 2, 657, 655, 3, 2, 2, 2, 657, 656, 3, 2, 2, 2, 658, 206, 3, 2, 2, 2, 659, 661, 5, 209, 104, 2, 660, 659, 3, 2, 2, 2, 661, 662, 3, 2, 2, 2, 662, 660, 3, 2, 2, 2, 662, 663, 3, 2, 2, 2, 663, 208, 3, 2, 2, 2, 664, 667, 10, 18, 2, 2, 665, 667, 5, 195, 97, 2, 666, 664, 3, 2, 2, 2, 666, 665, 3, 2, 2, 2, 667, 210, 3, 2, 2, 2, 668, 670, 5, 213, 106, 2, 669, 668, 3, 2, 2, 2, 670, 671, 3, 2, 2, 2, 671, 669, 3, 2, 2, 2, 671, 672, 3, 2, 2, 2, 672, 212, 3, 2, 2, 2, 673, 676, 10, 15, 2, 2, 674, 676, 5, 195, 97, 2, 675, 673, 3, 2, 2, 2, 675, 674, 3, 2, 2, 2, 676, 214, 3, 2, 2, 2, 677, 679, 5, 217, 108, 2, 678, 677, 3, 2, 2, 2, 679, 680, 3, 2, 2, 2, 680, 678, 3, 2, 2, 2, 680, 681, 3, 2, 2, 2, 681, 216, 3, 2, 2, 2, 682, 685, 10, 19, 2, 2, 683, 685, 5, 195, 97, 2, 684, 682, 3, 2, 2, 2, 684, 683, 3, 2, 2, 2, 685, 218, 3, 2, 2, 2, 37, 2, 3, 4, 225, 239, 469, 471, 478, 482, 488, 497, 554, 561, 568, 575, 587, 592, 595, 602, 606, 613, 620, 624, 629, 637, 640, 648, 653, 657, 662, 666, 671, 675, 680, 684, 13, 2, 4, 2, 6, 2, 2, 2, 3, 2, 3, 71, 2, 7, 3, 2, 3, 72, 3, 7, 4, 2, 9, 3, 2, 7, 2, 2, 3, 74, 4, 3, 77, 5] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 80, 706, 8, 1, 8, 1, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, 9, 101, 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 4, 105, 9, 105, 4, 106, 9, 106, 4, 107, 9, 107, 4, 108, 9, 108, 4, 109, 9, 109, 4, 110, 9, 110, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 228, 10, 2, 12, 2, 14, 2, 231, 11, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 242, 10, 3, 12, 3, 14, 3, 245, 11, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 62, 3, 62, 3, 62, 3, 63, 3, 63, 3, 64, 3, 64, 3, 64, 3, 65, 3, 65, 3, 66, 3, 66, 3, 66, 7, 66, 490, 10, 66, 12, 66, 14, 66, 493, 11, 66, 3, 67, 3, 67, 3, 67, 3, 67, 5, 67, 499, 10, 67, 3, 68, 3, 68, 5, 68, 503, 10, 68, 3, 68, 3, 68, 3, 69, 3, 69, 5, 69, 509, 10, 69, 3, 69, 3, 69, 3, 70, 3, 70, 3, 71, 6, 71, 516, 10, 71, 13, 71, 14, 71, 517, 3, 71, 3, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 80, 3, 80, 3, 81, 3, 81, 3, 82, 3, 82, 3, 83, 3, 83, 3, 84, 6, 84, 573, 10, 84, 13, 84, 14, 84, 574, 3, 85, 3, 85, 3, 85, 6, 85, 580, 10, 85, 13, 85, 14, 85, 581, 3, 86, 3, 86, 3, 86, 6, 86, 587, 10, 86, 13, 86, 14, 86, 588, 3, 87, 3, 87, 3, 87, 6, 87, 594, 10, 87, 13, 87, 14, 87, 595, 3, 88, 3, 88, 3, 89, 3, 89, 3, 90, 3, 90, 3, 91, 3, 91, 3, 92, 3, 92, 5, 92, 608, 10, 92, 3, 92, 3, 92, 3, 92, 5, 92, 613, 10, 92, 3, 93, 5, 93, 616, 10, 93, 3, 93, 3, 93, 3, 93, 3, 93, 3, 93, 5, 93, 623, 10, 93, 3, 94, 3, 94, 5, 94, 627, 10, 94, 3, 94, 3, 94, 3, 95, 6, 95, 632, 10, 95, 13, 95, 14, 95, 633, 3, 96, 3, 96, 3, 97, 6, 97, 639, 10, 97, 13, 97, 14, 97, 640, 3, 98, 3, 98, 5, 98, 645, 10, 98, 3, 99, 3, 99, 3, 99, 5, 99, 650, 10, 99, 3, 100, 3, 100, 3, 100, 3, 101, 3, 101, 3, 101, 5, 101, 658, 10, 101, 3, 101, 5, 101, 661, 10, 101, 3, 102, 3, 102, 3, 102, 3, 102, 6, 102, 667, 10, 102, 13, 102, 14, 102, 668, 3, 103, 6, 103, 672, 10, 103, 13, 103, 14, 103, 673, 3, 104, 3, 104, 5, 104, 678, 10, 104, 3, 105, 6, 105, 681, 10, 105, 13, 105, 14, 105, 682, 3, 106, 3, 106, 5, 106, 687, 10, 106, 3, 107, 6, 107, 690, 10, 107, 13, 107, 14, 107, 691, 3, 108, 3, 108, 5, 108, 696, 10, 108, 3, 109, 6, 109, 699, 10, 109, 13, 109, 14, 109, 700, 3, 110, 3, 110, 5, 110, 705, 10, 110, 3, 229, 2, 2, 111, 5, 2, 4, 7, 2, 5, 9, 2, 6, 11, 2, 7, 13, 2, 8, 15, 2, 9, 17, 2, 10, 19, 2, 11, 21, 2, 12, 23, 2, 13, 25, 2, 14, 27, 2, 15, 29, 2, 16, 31, 2, 17, 33, 2, 18, 35, 2, 19, 37, 2, 20, 39, 2, 21, 41, 2, 22, 43, 2, 23, 45, 2, 24, 47, 2, 25, 49, 2, 26, 51, 2, 27, 53, 2, 28, 55, 2, 29, 57, 2, 30, 59, 2, 31, 61, 2, 32, 63, 2, 33, 65, 2, 34, 67, 2, 35, 69, 2, 36, 71, 2, 37, 73, 2, 38, 75, 2, 39, 77, 2, 40, 79, 2, 41, 81, 2, 42, 83, 2, 43, 85, 2, 44, 87, 2, 45, 89, 2, 46, 91, 2, 47, 93, 2, 48, 95, 2, 49, 97, 2, 50, 99, 2, 51, 101, 2, 52, 103, 2, 53, 105, 2, 54, 107, 2, 55, 109, 2, 56, 111, 2, 57, 113, 2, 58, 115, 2, 59, 117, 2, 60, 119, 2, 61, 121, 2, 62, 123, 2, 63, 125, 2, 64, 127, 2, 65, 129, 2, 66, 131, 2, 67, 133, 2, 68, 135, 2, 69, 137, 2, 70, 139, 2, 71, 141, 2, 72, 143, 2, 73, 145, 2, 74, 147, 2, 75, 149, 2, 76, 151, 2, 2, 153, 2, 77, 155, 2, 78, 157, 2, 2, 159, 2, 79, 161, 2, 80, 163, 2, 2, 165, 2, 2, 167, 2, 2, 169, 2, 2, 171, 2, 2, 173, 2, 2, 175, 2, 2, 177, 2, 2, 179, 2, 2, 181, 2, 2, 183, 2, 2, 185, 2, 2, 187, 2, 2, 189, 2, 2, 191, 2, 2, 193, 2, 2, 195, 2, 2, 197, 2, 2, 199, 2, 2, 201, 2, 2, 203, 2, 2, 205, 2, 2, 207, 2, 2, 209, 2, 2, 211, 2, 2, 213, 2, 2, 215, 2, 2, 217, 2, 2, 219, 2, 2, 221, 2, 2, 5, 2, 3, 4, 20, 5, 2, 12, 12, 15, 15, 8234, 8235, 6, 2, 11, 11, 13, 14, 34, 34, 162, 162, 5, 2, 67, 92, 97, 97, 99, 124, 3, 2, 50, 59, 4, 2, 68, 68, 100, 100, 4, 2, 81, 81, 113, 113, 4, 2, 90, 90, 122, 122, 3, 2, 51, 59, 3, 2, 50, 51, 3, 2, 50, 57, 5, 2, 50, 59, 67, 72, 99, 104, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, 6, 2, 12, 12, 15, 15, 41, 41, 94, 94, 14, 2, 36, 36, 41, 41, 65, 65, 94, 94, 99, 100, 104, 104, 112, 112, 116, 116, 118, 118, 120, 120, 125, 125, 127, 127, 8, 2, 12, 12, 15, 15, 41, 41, 94, 94, 125, 125, 127, 127, 8, 2, 12, 12, 15, 15, 36, 36, 94, 94, 125, 125, 127, 127, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94, 2, 708, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, 2, 109, 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, 2, 2, 2, 2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 2, 123, 3, 2, 2, 2, 2, 125, 3, 2, 2, 2, 2, 127, 3, 2, 2, 2, 2, 129, 3, 2, 2, 2, 2, 131, 3, 2, 2, 2, 2, 133, 3, 2, 2, 2, 2, 135, 3, 2, 2, 2, 2, 137, 3, 2, 2, 2, 2, 139, 3, 2, 2, 2, 2, 141, 3, 2, 2, 2, 2, 143, 3, 2, 2, 2, 2, 145, 3, 2, 2, 2, 2, 147, 3, 2, 2, 2, 2, 149, 3, 2, 2, 2, 3, 151, 3, 2, 2, 2, 3, 153, 3, 2, 2, 2, 3, 155, 3, 2, 2, 2, 4, 157, 3, 2, 2, 2, 4, 159, 3, 2, 2, 2, 4, 161, 3, 2, 2, 2, 5, 223, 3, 2, 2, 2, 7, 237, 3, 2, 2, 2, 9, 248, 3, 2, 2, 2, 11, 254, 3, 2, 2, 2, 13, 258, 3, 2, 2, 2, 15, 261, 3, 2, 2, 2, 17, 265, 3, 2, 2, 2, 19, 272, 3, 2, 2, 2, 21, 277, 3, 2, 2, 2, 23, 285, 3, 2, 2, 2, 25, 291, 3, 2, 2, 2, 27, 300, 3, 2, 2, 2, 29, 303, 3, 2, 2, 2, 31, 309, 3, 2, 2, 2, 33, 312, 3, 2, 2, 2, 35, 317, 3, 2, 2, 2, 37, 321, 3, 2, 2, 2, 39, 326, 3, 2, 2, 2, 41, 330, 3, 2, 2, 2, 43, 337, 3, 2, 2, 2, 45, 342, 3, 2, 2, 2, 47, 345, 3, 2, 2, 2, 49, 351, 3, 2, 2, 2, 51, 361, 3, 2, 2, 2, 53, 366, 3, 2, 2, 2, 55, 372, 3, 2, 2, 2, 57, 379, 3, 2, 2, 2, 59, 384, 3, 2, 2, 2, 61, 389, 3, 2, 2, 2, 63, 399, 3, 2, 2, 2, 65, 401, 3, 2, 2, 2, 67, 403, 3, 2, 2, 2, 69, 405, 3, 2, 2, 2, 71, 407, 3, 2, 2, 2, 73, 409, 3, 2, 2, 2, 75, 411, 3, 2, 2, 2, 77, 413, 3, 2, 2, 2, 79, 415, 3, 2, 2, 2, 81, 420, 3, 2, 2, 2, 83, 422, 3, 2, 2, 2, 85, 424, 3, 2, 2, 2, 87, 426, 3, 2, 2, 2, 89, 429, 3, 2, 2, 2, 91, 431, 3, 2, 2, 2, 93, 434, 3, 2, 2, 2, 95, 436, 3, 2, 2, 2, 97, 438, 3, 2, 2, 2, 99, 440, 3, 2, 2, 2, 101, 443, 3, 2, 2, 2, 103, 446, 3, 2, 2, 2, 105, 449, 3, 2, 2, 2, 107, 451, 3, 2, 2, 2, 109, 453, 3, 2, 2, 2, 111, 456, 3, 2, 2, 2, 113, 459, 3, 2, 2, 2, 115, 462, 3, 2, 2, 2, 117, 465, 3, 2, 2, 2, 119, 468, 3, 2, 2, 2, 121, 471, 3, 2, 2, 2, 123, 474, 3, 2, 2, 2, 125, 476, 3, 2, 2, 2, 127, 479, 3, 2, 2, 2, 129, 481, 3, 2, 2, 2, 131, 484, 3, 2, 2, 2, 133, 486, 3, 2, 2, 2, 135, 498, 3, 2, 2, 2, 137, 500, 3, 2, 2, 2, 139, 506, 3, 2, 2, 2, 141, 512, 3, 2, 2, 2, 143, 515, 3, 2, 2, 2, 145, 521, 3, 2, 2, 2, 147, 525, 3, 2, 2, 2, 149, 532, 3, 2, 2, 2, 151, 539, 3, 2, 2, 2, 153, 545, 3, 2, 2, 2, 155, 550, 3, 2, 2, 2, 157, 552, 3, 2, 2, 2, 159, 558, 3, 2, 2, 2, 161, 563, 3, 2, 2, 2, 163, 565, 3, 2, 2, 2, 165, 567, 3, 2, 2, 2, 167, 569, 3, 2, 2, 2, 169, 572, 3, 2, 2, 2, 171, 576, 3, 2, 2, 2, 173, 583, 3, 2, 2, 2, 175, 590, 3, 2, 2, 2, 177, 597, 3, 2, 2, 2, 179, 599, 3, 2, 2, 2, 181, 601, 3, 2, 2, 2, 183, 603, 3, 2, 2, 2, 185, 612, 3, 2, 2, 2, 187, 622, 3, 2, 2, 2, 189, 624, 3, 2, 2, 2, 191, 631, 3, 2, 2, 2, 193, 635, 3, 2, 2, 2, 195, 638, 3, 2, 2, 2, 197, 644, 3, 2, 2, 2, 199, 649, 3, 2, 2, 2, 201, 651, 3, 2, 2, 2, 203, 654, 3, 2, 2, 2, 205, 662, 3, 2, 2, 2, 207, 671, 3, 2, 2, 2, 209, 677, 3, 2, 2, 2, 211, 680, 3, 2, 2, 2, 213, 686, 3, 2, 2, 2, 215, 689, 3, 2, 2, 2, 217, 695, 3, 2, 2, 2, 219, 698, 3, 2, 2, 2, 221, 704, 3, 2, 2, 2, 223, 224, 7, 49, 2, 2, 224, 225, 7, 44, 2, 2, 225, 229, 3, 2, 2, 2, 226, 228, 11, 2, 2, 2, 227, 226, 3, 2, 2, 2, 228, 231, 3, 2, 2, 2, 229, 230, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 230, 232, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 232, 233, 7, 44, 2, 2, 233, 234, 7, 49, 2, 2, 234, 235, 3, 2, 2, 2, 235, 236, 8, 2, 2, 2, 236, 6, 3, 2, 2, 2, 237, 238, 7, 49, 2, 2, 238, 239, 7, 49, 2, 2, 239, 243, 3, 2, 2, 2, 240, 242, 10, 2, 2, 2, 241, 240, 3, 2, 2, 2, 242, 245, 3, 2, 2, 2, 243, 241, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 246, 3, 2, 2, 2, 245, 243, 3, 2, 2, 2, 246, 247, 8, 3, 2, 2, 247, 8, 3, 2, 2, 2, 248, 249, 7, 101, 2, 2, 249, 250, 7, 113, 2, 2, 250, 251, 7, 112, 2, 2, 251, 252, 7, 117, 2, 2, 252, 253, 7, 118, 2, 2, 253, 10, 3, 2, 2, 2, 254, 255, 7, 120, 2, 2, 255, 256, 7, 99, 2, 2, 256, 257, 7, 116, 2, 2, 257, 12, 3, 2, 2, 2, 258, 259, 7, 99, 2, 2, 259, 260, 7, 117, 2, 2, 260, 14, 3, 2, 2, 2, 261, 262, 7, 48, 2, 2, 262, 263, 7, 48, 2, 2, 263, 264, 7, 48, 2, 2, 264, 16, 3, 2, 2, 2, 265, 266, 7, 117, 2, 2, 266, 267, 7, 121, 2, 2, 267, 268, 7, 107, 2, 2, 268, 269, 7, 118, 2, 2, 269, 270, 7, 101, 2, 2, 270, 271, 7, 106, 2, 2, 271, 18, 3, 2, 2, 2, 272, 273, 7, 101, 2, 2, 273, 274, 7, 99, 2, 2, 274, 275, 7, 117, 2, 2, 275, 276, 7, 103, 2, 2, 276, 20, 3, 2, 2, 2, 277, 278, 7, 102, 2, 2, 278, 279, 7, 103, 2, 2, 279, 280, 7, 104, 2, 2, 280, 281, 7, 99, 2, 2, 281, 282, 7, 119, 2, 2, 282, 283, 7, 110, 2, 2, 283, 284, 7, 118, 2, 2, 284, 22, 3, 2, 2, 2, 285, 286, 7, 100, 2, 2, 286, 287, 7, 116, 2, 2, 287, 288, 7, 103, 2, 2, 288, 289, 7, 99, 2, 2, 289, 290, 7, 109, 2, 2, 290, 24, 3, 2, 2, 2, 291, 292, 7, 101, 2, 2, 292, 293, 7, 113, 2, 2, 293, 294, 7, 112, 2, 2, 294, 295, 7, 118, 2, 2, 295, 296, 7, 107, 2, 2, 296, 297, 7, 112, 2, 2, 297, 298, 7, 119, 2, 2, 298, 299, 7, 103, 2, 2, 299, 26, 3, 2, 2, 2, 300, 301, 7, 102, 2, 2, 301, 302, 7, 113, 2, 2, 302, 28, 3, 2, 2, 2, 303, 304, 7, 121, 2, 2, 304, 305, 7, 106, 2, 2, 305, 306, 7, 107, 2, 2, 306, 307, 7, 110, 2, 2, 307, 308, 7, 103, 2, 2, 308, 30, 3, 2, 2, 2, 309, 310, 7, 107, 2, 2, 310, 311, 7, 104, 2, 2, 311, 32, 3, 2, 2, 2, 312, 313, 7, 103, 2, 2, 313, 314, 7, 110, 2, 2, 314, 315, 7, 117, 2, 2, 315, 316, 7, 103, 2, 2, 316, 34, 3, 2, 2, 2, 317, 318, 7, 104, 2, 2, 318, 319, 7, 113, 2, 2, 319, 320, 7, 116, 2, 2, 320, 36, 3, 2, 2, 2, 321, 322, 7, 103, 2, 2, 322, 323, 7, 112, 2, 2, 323, 324, 7, 119, 2, 2, 324, 325, 7, 111, 2, 2, 325, 38, 3, 2, 2, 2, 326, 327, 7, 102, 2, 2, 327, 328, 7, 103, 2, 2, 328, 329, 7, 104, 2, 2, 329, 40, 3, 2, 2, 2, 330, 331, 7, 116, 2, 2, 331, 332, 7, 103, 2, 2, 332, 333, 7, 118, 2, 2, 333, 334, 7, 119, 2, 2, 334, 335, 7, 116, 2, 2, 335, 336, 7, 112, 2, 2, 336, 42, 3, 2, 2, 2, 337, 338, 7, 101, 2, 2, 338, 339, 7, 99, 2, 2, 339, 340, 7, 110, 2, 2, 340, 341, 7, 110, 2, 2, 341, 44, 3, 2, 2, 2, 342, 343, 7, 47, 2, 2, 343, 344, 7, 64, 2, 2, 344, 46, 3, 2, 2, 2, 345, 346, 7, 101, 2, 2, 346, 347, 7, 110, 2, 2, 347, 348, 7, 99, 2, 2, 348, 349, 7, 117, 2, 2, 349, 350, 7, 117, 2, 2, 350, 48, 3, 2, 2, 2, 351, 352, 7, 107, 2, 2, 352, 353, 7, 112, 2, 2, 353, 354, 7, 118, 2, 2, 354, 355, 7, 103, 2, 2, 355, 356, 7, 116, 2, 2, 356, 357, 7, 104, 2, 2, 357, 358, 7, 99, 2, 2, 358, 359, 7, 101, 2, 2, 359, 360, 7, 103, 2, 2, 360, 50, 3, 2, 2, 2, 361, 362, 7, 118, 2, 2, 362, 363, 7, 116, 2, 2, 363, 364, 7, 119, 2, 2, 364, 365, 7, 103, 2, 2, 365, 52, 3, 2, 2, 2, 366, 367, 7, 104, 2, 2, 367, 368, 7, 99, 2, 2, 368, 369, 7, 110, 2, 2, 369, 370, 7, 117, 2, 2, 370, 371, 7, 103, 2, 2, 371, 54, 3, 2, 2, 2, 372, 373, 7, 118, 2, 2, 373, 374, 7, 123, 2, 2, 374, 375, 7, 114, 2, 2, 375, 376, 7, 103, 2, 2, 376, 377, 7, 113, 2, 2, 377, 378, 7, 104, 2, 2, 378, 56, 3, 2, 2, 2, 379, 380, 7, 120, 2, 2, 380, 381, 7, 113, 2, 2, 381, 382, 7, 107, 2, 2, 382, 383, 7, 102, 2, 2, 383, 58, 3, 2, 2, 2, 384, 385, 7, 112, 2, 2, 385, 386, 7, 119, 2, 2, 386, 387, 7, 110, 2, 2, 387, 388, 7, 110, 2, 2, 388, 60, 3, 2, 2, 2, 389, 390, 7, 119, 2, 2, 390, 391, 7, 112, 2, 2, 391, 392, 7, 102, 2, 2, 392, 393, 7, 103, 2, 2, 393, 394, 7, 104, 2, 2, 394, 395, 7, 107, 2, 2, 395, 396, 7, 112, 2, 2, 396, 397, 7, 103, 2, 2, 397, 398, 7, 102, 2, 2, 398, 62, 3, 2, 2, 2, 399, 400, 7, 46, 2, 2, 400, 64, 3, 2, 2, 2, 401, 402, 7, 61, 2, 2, 402, 66, 3, 2, 2, 2, 403, 404, 7, 65, 2, 2, 404, 68, 3, 2, 2, 2, 405, 406, 7, 60, 2, 2, 406, 70, 3, 2, 2, 2, 407, 408, 7, 42, 2, 2, 408, 72, 3, 2, 2, 2, 409, 410, 7, 43, 2, 2, 410, 74, 3, 2, 2, 2, 411, 412, 7, 93, 2, 2, 412, 76, 3, 2, 2, 2, 413, 414, 7, 95, 2, 2, 414, 78, 3, 2, 2, 2, 415, 416, 6, 39, 2, 2, 416, 417, 7, 127, 2, 2, 417, 418, 3, 2, 2, 2, 418, 419, 8, 39, 3, 2, 419, 80, 3, 2, 2, 2, 420, 421, 7, 125, 2, 2, 421, 82, 3, 2, 2, 2, 422, 423, 7, 127, 2, 2, 423, 84, 3, 2, 2, 2, 424, 425, 7, 45, 2, 2, 425, 86, 3, 2, 2, 2, 426, 427, 7, 45, 2, 2, 427, 428, 7, 45, 2, 2, 428, 88, 3, 2, 2, 2, 429, 430, 7, 47, 2, 2, 430, 90, 3, 2, 2, 2, 431, 432, 7, 47, 2, 2, 432, 433, 7, 47, 2, 2, 433, 92, 3, 2, 2, 2, 434, 435, 7, 44, 2, 2, 435, 94, 3, 2, 2, 2, 436, 437, 7, 49, 2, 2, 437, 96, 3, 2, 2, 2, 438, 439, 7, 39, 2, 2, 439, 98, 3, 2, 2, 2, 440, 441, 7, 44, 2, 2, 441, 442, 7, 44, 2, 2, 442, 100, 3, 2, 2, 2, 443, 444, 7, 40, 2, 2, 444, 445, 7, 40, 2, 2, 445, 102, 3, 2, 2, 2, 446, 447, 7, 126, 2, 2, 447, 448, 7, 126, 2, 2, 448, 104, 3, 2, 2, 2, 449, 450, 7, 35, 2, 2, 450, 106, 3, 2, 2, 2, 451, 452, 7, 63, 2, 2, 452, 108, 3, 2, 2, 2, 453, 454, 7, 45, 2, 2, 454, 455, 7, 63, 2, 2, 455, 110, 3, 2, 2, 2, 456, 457, 7, 47, 2, 2, 457, 458, 7, 63, 2, 2, 458, 112, 3, 2, 2, 2, 459, 460, 7, 44, 2, 2, 460, 461, 7, 63, 2, 2, 461, 114, 3, 2, 2, 2, 462, 463, 7, 49, 2, 2, 463, 464, 7, 63, 2, 2, 464, 116, 3, 2, 2, 2, 465, 466, 7, 39, 2, 2, 466, 467, 7, 63, 2, 2, 467, 118, 3, 2, 2, 2, 468, 469, 7, 63, 2, 2, 469, 470, 7, 63, 2, 2, 470, 120, 3, 2, 2, 2, 471, 472, 7, 35, 2, 2, 472, 473, 7, 63, 2, 2, 473, 122, 3, 2, 2, 2, 474, 475, 7, 62, 2, 2, 475, 124, 3, 2, 2, 2, 476, 477, 7, 62, 2, 2, 477, 478, 7, 63, 2, 2, 478, 126, 3, 2, 2, 2, 479, 480, 7, 64, 2, 2, 480, 128, 3, 2, 2, 2, 481, 482, 7, 64, 2, 2, 482, 483, 7, 63, 2, 2, 483, 130, 3, 2, 2, 2, 484, 485, 7, 48, 2, 2, 485, 132, 3, 2, 2, 2, 486, 491, 5, 163, 81, 2, 487, 490, 5, 163, 81, 2, 488, 490, 5, 167, 83, 2, 489, 487, 3, 2, 2, 2, 489, 488, 3, 2, 2, 2, 490, 493, 3, 2, 2, 2, 491, 489, 3, 2, 2, 2, 491, 492, 3, 2, 2, 2, 492, 134, 3, 2, 2, 2, 493, 491, 3, 2, 2, 2, 494, 499, 5, 169, 84, 2, 495, 499, 5, 173, 86, 2, 496, 499, 5, 175, 87, 2, 497, 499, 5, 171, 85, 2, 498, 494, 3, 2, 2, 2, 498, 495, 3, 2, 2, 2, 498, 496, 3, 2, 2, 2, 498, 497, 3, 2, 2, 2, 499, 136, 3, 2, 2, 2, 500, 502, 7, 41, 2, 2, 501, 503, 5, 215, 107, 2, 502, 501, 3, 2, 2, 2, 502, 503, 3, 2, 2, 2, 503, 504, 3, 2, 2, 2, 504, 505, 7, 41, 2, 2, 505, 138, 3, 2, 2, 2, 506, 508, 7, 36, 2, 2, 507, 509, 5, 219, 109, 2, 508, 507, 3, 2, 2, 2, 508, 509, 3, 2, 2, 2, 509, 510, 3, 2, 2, 2, 510, 511, 7, 36, 2, 2, 511, 140, 3, 2, 2, 2, 512, 513, 5, 185, 92, 2, 513, 142, 3, 2, 2, 2, 514, 516, 9, 3, 2, 2, 515, 514, 3, 2, 2, 2, 516, 517, 3, 2, 2, 2, 517, 515, 3, 2, 2, 2, 517, 518, 3, 2, 2, 2, 518, 519, 3, 2, 2, 2, 519, 520, 8, 71, 4, 2, 520, 144, 3, 2, 2, 2, 521, 522, 9, 2, 2, 2, 522, 523, 3, 2, 2, 2, 523, 524, 8, 72, 4, 2, 524, 146, 3, 2, 2, 2, 525, 526, 7, 104, 2, 2, 526, 527, 7, 41, 2, 2, 527, 528, 3, 2, 2, 2, 528, 529, 8, 73, 5, 2, 529, 530, 3, 2, 2, 2, 530, 531, 8, 73, 6, 2, 531, 148, 3, 2, 2, 2, 532, 533, 7, 104, 2, 2, 533, 534, 7, 36, 2, 2, 534, 535, 3, 2, 2, 2, 535, 536, 8, 74, 7, 2, 536, 537, 3, 2, 2, 2, 537, 538, 8, 74, 8, 2, 538, 150, 3, 2, 2, 2, 539, 540, 6, 75, 3, 2, 540, 541, 7, 125, 2, 2, 541, 542, 3, 2, 2, 2, 542, 543, 8, 75, 9, 2, 543, 544, 8, 75, 10, 2, 544, 152, 3, 2, 2, 2, 545, 546, 7, 41, 2, 2, 546, 547, 8, 76, 11, 2, 547, 548, 3, 2, 2, 2, 548, 549, 8, 76, 3, 2, 549, 154, 3, 2, 2, 2, 550, 551, 5, 207, 103, 2, 551, 156, 3, 2, 2, 2, 552, 553, 6, 78, 4, 2, 553, 554, 7, 125, 2, 2, 554, 555, 3, 2, 2, 2, 555, 556, 8, 78, 9, 2, 556, 557, 8, 78, 10, 2, 557, 158, 3, 2, 2, 2, 558, 559, 7, 36, 2, 2, 559, 560, 8, 79, 12, 2, 560, 561, 3, 2, 2, 2, 561, 562, 8, 79, 3, 2, 562, 160, 3, 2, 2, 2, 563, 564, 5, 211, 105, 2, 564, 162, 3, 2, 2, 2, 565, 566, 5, 165, 82, 2, 566, 164, 3, 2, 2, 2, 567, 568, 9, 4, 2, 2, 568, 166, 3, 2, 2, 2, 569, 570, 9, 5, 2, 2, 570, 168, 3, 2, 2, 2, 571, 573, 5, 167, 83, 2, 572, 571, 3, 2, 2, 2, 573, 574, 3, 2, 2, 2, 574, 572, 3, 2, 2, 2, 574, 575, 3, 2, 2, 2, 575, 170, 3, 2, 2, 2, 576, 577, 7, 50, 2, 2, 577, 579, 9, 6, 2, 2, 578, 580, 5, 179, 89, 2, 579, 578, 3, 2, 2, 2, 580, 581, 3, 2, 2, 2, 581, 579, 3, 2, 2, 2, 581, 582, 3, 2, 2, 2, 582, 172, 3, 2, 2, 2, 583, 584, 7, 50, 2, 2, 584, 586, 9, 7, 2, 2, 585, 587, 5, 181, 90, 2, 586, 585, 3, 2, 2, 2, 587, 588, 3, 2, 2, 2, 588, 586, 3, 2, 2, 2, 588, 589, 3, 2, 2, 2, 589, 174, 3, 2, 2, 2, 590, 591, 7, 50, 2, 2, 591, 593, 9, 8, 2, 2, 592, 594, 5, 183, 91, 2, 593, 592, 3, 2, 2, 2, 594, 595, 3, 2, 2, 2, 595, 593, 3, 2, 2, 2, 595, 596, 3, 2, 2, 2, 596, 176, 3, 2, 2, 2, 597, 598, 9, 9, 2, 2, 598, 178, 3, 2, 2, 2, 599, 600, 9, 10, 2, 2, 600, 180, 3, 2, 2, 2, 601, 602, 9, 11, 2, 2, 602, 182, 3, 2, 2, 2, 603, 604, 9, 12, 2, 2, 604, 184, 3, 2, 2, 2, 605, 607, 5, 187, 93, 2, 606, 608, 5, 189, 94, 2, 607, 606, 3, 2, 2, 2, 607, 608, 3, 2, 2, 2, 608, 613, 3, 2, 2, 2, 609, 610, 5, 191, 95, 2, 610, 611, 5, 189, 94, 2, 611, 613, 3, 2, 2, 2, 612, 605, 3, 2, 2, 2, 612, 609, 3, 2, 2, 2, 613, 186, 3, 2, 2, 2, 614, 616, 5, 191, 95, 2, 615, 614, 3, 2, 2, 2, 615, 616, 3, 2, 2, 2, 616, 617, 3, 2, 2, 2, 617, 618, 7, 48, 2, 2, 618, 623, 5, 191, 95, 2, 619, 620, 5, 191, 95, 2, 620, 621, 7, 48, 2, 2, 621, 623, 3, 2, 2, 2, 622, 615, 3, 2, 2, 2, 622, 619, 3, 2, 2, 2, 623, 188, 3, 2, 2, 2, 624, 626, 9, 13, 2, 2, 625, 627, 5, 193, 96, 2, 626, 625, 3, 2, 2, 2, 626, 627, 3, 2, 2, 2, 627, 628, 3, 2, 2, 2, 628, 629, 5, 191, 95, 2, 629, 190, 3, 2, 2, 2, 630, 632, 5, 167, 83, 2, 631, 630, 3, 2, 2, 2, 632, 633, 3, 2, 2, 2, 633, 631, 3, 2, 2, 2, 633, 634, 3, 2, 2, 2, 634, 192, 3, 2, 2, 2, 635, 636, 9, 14, 2, 2, 636, 194, 3, 2, 2, 2, 637, 639, 5, 197, 98, 2, 638, 637, 3, 2, 2, 2, 639, 640, 3, 2, 2, 2, 640, 638, 3, 2, 2, 2, 640, 641, 3, 2, 2, 2, 641, 196, 3, 2, 2, 2, 642, 645, 10, 15, 2, 2, 643, 645, 5, 199, 99, 2, 644, 642, 3, 2, 2, 2, 644, 643, 3, 2, 2, 2, 645, 198, 3, 2, 2, 2, 646, 650, 5, 201, 100, 2, 647, 650, 5, 203, 101, 2, 648, 650, 5, 205, 102, 2, 649, 646, 3, 2, 2, 2, 649, 647, 3, 2, 2, 2, 649, 648, 3, 2, 2, 2, 650, 200, 3, 2, 2, 2, 651, 652, 7, 94, 2, 2, 652, 653, 9, 16, 2, 2, 653, 202, 3, 2, 2, 2, 654, 655, 7, 94, 2, 2, 655, 657, 5, 181, 90, 2, 656, 658, 5, 181, 90, 2, 657, 656, 3, 2, 2, 2, 657, 658, 3, 2, 2, 2, 658, 660, 3, 2, 2, 2, 659, 661, 5, 181, 90, 2, 660, 659, 3, 2, 2, 2, 660, 661, 3, 2, 2, 2, 661, 204, 3, 2, 2, 2, 662, 663, 7, 94, 2, 2, 663, 664, 7, 122, 2, 2, 664, 666, 3, 2, 2, 2, 665, 667, 5, 183, 91, 2, 666, 665, 3, 2, 2, 2, 667, 668, 3, 2, 2, 2, 668, 666, 3, 2, 2, 2, 668, 669, 3, 2, 2, 2, 669, 206, 3, 2, 2, 2, 670, 672, 5, 209, 104, 2, 671, 670, 3, 2, 2, 2, 672, 673, 3, 2, 2, 2, 673, 671, 3, 2, 2, 2, 673, 674, 3, 2, 2, 2, 674, 208, 3, 2, 2, 2, 675, 678, 10, 17, 2, 2, 676, 678, 5, 199, 99, 2, 677, 675, 3, 2, 2, 2, 677, 676, 3, 2, 2, 2, 678, 210, 3, 2, 2, 2, 679, 681, 5, 213, 106, 2, 680, 679, 3, 2, 2, 2, 681, 682, 3, 2, 2, 2, 682, 680, 3, 2, 2, 2, 682, 683, 3, 2, 2, 2, 683, 212, 3, 2, 2, 2, 684, 687, 10, 18, 2, 2, 685, 687, 5, 199, 99, 2, 686, 684, 3, 2, 2, 2, 686, 685, 3, 2, 2, 2, 687, 214, 3, 2, 2, 2, 688, 690, 5, 217, 108, 2, 689, 688, 3, 2, 2, 2, 690, 691, 3, 2, 2, 2, 691, 689, 3, 2, 2, 2, 691, 692, 3, 2, 2, 2, 692, 216, 3, 2, 2, 2, 693, 696, 10, 15, 2, 2, 694, 696, 5, 199, 99, 2, 695, 693, 3, 2, 2, 2, 695, 694, 3, 2, 2, 2, 696, 218, 3, 2, 2, 2, 697, 699, 5, 221, 110, 2, 698, 697, 3, 2, 2, 2, 699, 700, 3, 2, 2, 2, 700, 698, 3, 2, 2, 2, 700, 701, 3, 2, 2, 2, 701, 220, 3, 2, 2, 2, 702, 705, 10, 19, 2, 2, 703, 705, 5, 199, 99, 2, 704, 702, 3, 2, 2, 2, 704, 703, 3, 2, 2, 2, 705, 222, 3, 2, 2, 2, 37, 2, 3, 4, 229, 243, 489, 491, 498, 502, 508, 517, 574, 581, 588, 595, 607, 612, 615, 622, 626, 633, 640, 644, 649, 657, 660, 668, 673, 677, 682, 686, 691, 695, 700, 704, 13, 2, 4, 2, 6, 2, 2, 2, 3, 2, 3, 73, 2, 7, 3, 2, 3, 74, 3, 7, 4, 2, 9, 3, 2, 7, 2, 2, 3, 76, 4, 3, 79, 5] \ No newline at end of file diff --git a/kipper/core/src/compiler/parser/antlr/KipperLexer.tokens b/kipper/core/src/compiler/parser/antlr/KipperLexer.tokens index a8e8b39b6..a7b97ced0 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperLexer.tokens +++ b/kipper/core/src/compiler/parser/antlr/KipperLexer.tokens @@ -20,60 +20,62 @@ DefFunc=19 Return=20 CallFunc=21 RetIndicator=22 -True=23 -False=24 -Typeof=25 -Void=26 -Null=27 -Undefined=28 -Comma=29 -SemiColon=30 -QuestionMark=31 -Colon=32 -LeftParen=33 -RightParen=34 -LeftBracket=35 -RightBracket=36 -FStringExpEnd=37 -LeftBrace=38 -RightBrace=39 -Plus=40 -PlusPlus=41 -Minus=42 -MinusMinus=43 -Star=44 -Div=45 -Mod=46 -PowerTo=47 -AndAnd=48 -OrOr=49 -Not=50 -Assign=51 -PlusAssign=52 -MinusAssign=53 -StarAssign=54 -DivAssign=55 -ModAssign=56 -Equal=57 -NotEqual=58 -Less=59 -LessEqual=60 -Greater=61 -GreaterEqual=62 -Dot=63 -Identifier=64 -IntegerConstant=65 -SingleQuoteStringLiteral=66 -DoubleQuoteStringLiteral=67 -FloatingConstant=68 -Whitespace=69 -Newline=70 -FStringSingleQuoteStart=71 -FStringDoubleQuoteStart=72 -FStringSingleQuoteEnd=73 -FStringSingleQuoteAtom=74 -FStringDoubleQuoteEnd=75 -FStringDoubleQuoteAtom=76 +Class=23 +Interface=24 +True=25 +False=26 +Typeof=27 +Void=28 +Null=29 +Undefined=30 +Comma=31 +SemiColon=32 +QuestionMark=33 +Colon=34 +LeftParen=35 +RightParen=36 +LeftBracket=37 +RightBracket=38 +FStringExpEnd=39 +LeftBrace=40 +RightBrace=41 +Plus=42 +PlusPlus=43 +Minus=44 +MinusMinus=45 +Star=46 +Div=47 +Mod=48 +PowerTo=49 +AndAnd=50 +OrOr=51 +Not=52 +Assign=53 +PlusAssign=54 +MinusAssign=55 +StarAssign=56 +DivAssign=57 +ModAssign=58 +Equal=59 +NotEqual=60 +Less=61 +LessEqual=62 +Greater=63 +GreaterEqual=64 +Dot=65 +Identifier=66 +IntegerConstant=67 +SingleQuoteStringLiteral=68 +DoubleQuoteStringLiteral=69 +FloatingConstant=70 +Whitespace=71 +Newline=72 +FStringSingleQuoteStart=73 +FStringDoubleQuoteStart=74 +FStringSingleQuoteEnd=75 +FStringSingleQuoteAtom=76 +FStringDoubleQuoteEnd=77 +FStringDoubleQuoteAtom=78 'const'=4 'var'=5 'as'=6 @@ -93,43 +95,45 @@ FStringDoubleQuoteAtom=76 'return'=20 'call'=21 '->'=22 -'true'=23 -'false'=24 -'typeof'=25 -'void'=26 -'null'=27 -'undefined'=28 -','=29 -';'=30 -'?'=31 -':'=32 -'('=33 -')'=34 -'['=35 -']'=36 -'{'=38 -'}'=39 -'+'=40 -'++'=41 -'-'=42 -'--'=43 -'*'=44 -'/'=45 -'%'=46 -'**'=47 -'&&'=48 -'||'=49 -'!'=50 -'='=51 -'+='=52 -'-='=53 -'*='=54 -'/='=55 -'%='=56 -'=='=57 -'!='=58 -'<'=59 -'<='=60 -'>'=61 -'>='=62 -'.'=63 +'class'=23 +'interface'=24 +'true'=25 +'false'=26 +'typeof'=27 +'void'=28 +'null'=29 +'undefined'=30 +','=31 +';'=32 +'?'=33 +':'=34 +'('=35 +')'=36 +'['=37 +']'=38 +'{'=40 +'}'=41 +'+'=42 +'++'=43 +'-'=44 +'--'=45 +'*'=46 +'/'=47 +'%'=48 +'**'=49 +'&&'=50 +'||'=51 +'!'=52 +'='=53 +'+='=54 +'-='=55 +'*='=56 +'/='=57 +'%='=58 +'=='=59 +'!='=60 +'<'=61 +'<='=62 +'>'=63 +'>='=64 +'.'=65 diff --git a/kipper/core/src/compiler/parser/antlr/KipperLexer.ts b/kipper/core/src/compiler/parser/antlr/KipperLexer.ts index 9c366d450..39047553f 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperLexer.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperLexer.ts @@ -1,6 +1,8 @@ // Generated from ./KipperLexer.g4 by ANTLR 4.9.0-SNAPSHOT -import KipperLexerBase from "./base/KipperLexerBase"; + + import KipperLexerBase from "./base/KipperLexerBase"; + import { ATN } from "antlr4ts/atn/ATN"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; @@ -15,6 +17,7 @@ import { VocabularyImpl } from "antlr4ts/VocabularyImpl"; import * as Utils from "antlr4ts/misc/Utils"; + export class KipperLexer extends KipperLexerBase { public static readonly FStringExpStart = 1; public static readonly BlockComment = 2; @@ -38,330 +41,126 @@ export class KipperLexer extends KipperLexerBase { public static readonly Return = 20; public static readonly CallFunc = 21; public static readonly RetIndicator = 22; - public static readonly True = 23; - public static readonly False = 24; - public static readonly Typeof = 25; - public static readonly Void = 26; - public static readonly Null = 27; - public static readonly Undefined = 28; - public static readonly Comma = 29; - public static readonly SemiColon = 30; - public static readonly QuestionMark = 31; - public static readonly Colon = 32; - public static readonly LeftParen = 33; - public static readonly RightParen = 34; - public static readonly LeftBracket = 35; - public static readonly RightBracket = 36; - public static readonly FStringExpEnd = 37; - public static readonly LeftBrace = 38; - public static readonly RightBrace = 39; - public static readonly Plus = 40; - public static readonly PlusPlus = 41; - public static readonly Minus = 42; - public static readonly MinusMinus = 43; - public static readonly Star = 44; - public static readonly Div = 45; - public static readonly Mod = 46; - public static readonly PowerTo = 47; - public static readonly AndAnd = 48; - public static readonly OrOr = 49; - public static readonly Not = 50; - public static readonly Assign = 51; - public static readonly PlusAssign = 52; - public static readonly MinusAssign = 53; - public static readonly StarAssign = 54; - public static readonly DivAssign = 55; - public static readonly ModAssign = 56; - public static readonly Equal = 57; - public static readonly NotEqual = 58; - public static readonly Less = 59; - public static readonly LessEqual = 60; - public static readonly Greater = 61; - public static readonly GreaterEqual = 62; - public static readonly Dot = 63; - public static readonly Identifier = 64; - public static readonly IntegerConstant = 65; - public static readonly SingleQuoteStringLiteral = 66; - public static readonly DoubleQuoteStringLiteral = 67; - public static readonly FloatingConstant = 68; - public static readonly Whitespace = 69; - public static readonly Newline = 70; - public static readonly FStringSingleQuoteStart = 71; - public static readonly FStringDoubleQuoteStart = 72; - public static readonly FStringSingleQuoteEnd = 73; - public static readonly FStringSingleQuoteAtom = 74; - public static readonly FStringDoubleQuoteEnd = 75; - public static readonly FStringDoubleQuoteAtom = 76; + public static readonly Class = 23; + public static readonly Interface = 24; + public static readonly True = 25; + public static readonly False = 26; + public static readonly Typeof = 27; + public static readonly Void = 28; + public static readonly Null = 29; + public static readonly Undefined = 30; + public static readonly Comma = 31; + public static readonly SemiColon = 32; + public static readonly QuestionMark = 33; + public static readonly Colon = 34; + public static readonly LeftParen = 35; + public static readonly RightParen = 36; + public static readonly LeftBracket = 37; + public static readonly RightBracket = 38; + public static readonly FStringExpEnd = 39; + public static readonly LeftBrace = 40; + public static readonly RightBrace = 41; + public static readonly Plus = 42; + public static readonly PlusPlus = 43; + public static readonly Minus = 44; + public static readonly MinusMinus = 45; + public static readonly Star = 46; + public static readonly Div = 47; + public static readonly Mod = 48; + public static readonly PowerTo = 49; + public static readonly AndAnd = 50; + public static readonly OrOr = 51; + public static readonly Not = 52; + public static readonly Assign = 53; + public static readonly PlusAssign = 54; + public static readonly MinusAssign = 55; + public static readonly StarAssign = 56; + public static readonly DivAssign = 57; + public static readonly ModAssign = 58; + public static readonly Equal = 59; + public static readonly NotEqual = 60; + public static readonly Less = 61; + public static readonly LessEqual = 62; + public static readonly Greater = 63; + public static readonly GreaterEqual = 64; + public static readonly Dot = 65; + public static readonly Identifier = 66; + public static readonly IntegerConstant = 67; + public static readonly SingleQuoteStringLiteral = 68; + public static readonly DoubleQuoteStringLiteral = 69; + public static readonly FloatingConstant = 70; + public static readonly Whitespace = 71; + public static readonly Newline = 72; + public static readonly FStringSingleQuoteStart = 73; + public static readonly FStringDoubleQuoteStart = 74; + public static readonly FStringSingleQuoteEnd = 75; + public static readonly FStringSingleQuoteAtom = 76; + public static readonly FStringDoubleQuoteEnd = 77; + public static readonly FStringDoubleQuoteAtom = 78; public static readonly COMMENT = 2; public static readonly SINGLE_QUOTE_FSTRING = 1; public static readonly DOUBLE_QUOTE_FSTRING = 2; // tslint:disable:no-trailing-whitespace - public static readonly channelNames: string[] = ["DEFAULT_TOKEN_CHANNEL", "HIDDEN", "COMMENT"]; + public static readonly channelNames: string[] = [ + "DEFAULT_TOKEN_CHANNEL", "HIDDEN", "COMMENT", + ]; // tslint:disable:no-trailing-whitespace - public static readonly modeNames: string[] = ["DEFAULT_MODE", "SINGLE_QUOTE_FSTRING", "DOUBLE_QUOTE_FSTRING"]; + public static readonly modeNames: string[] = [ + "DEFAULT_MODE", "SINGLE_QUOTE_FSTRING", "DOUBLE_QUOTE_FSTRING", + ]; public static readonly ruleNames: string[] = [ - "BlockComment", - "LineComment", - "Const", - "Var", - "As", - "Spread", - "Switch", - "Case", - "Default", - "Break", - "Continue", - "Do", - "While", - "If", - "Else", - "For", - "Enum", - "DefFunc", - "Return", - "CallFunc", - "RetIndicator", - "True", - "False", - "Typeof", - "Void", - "Null", - "Undefined", - "Comma", - "SemiColon", - "QuestionMark", - "Colon", - "LeftParen", - "RightParen", - "LeftBracket", - "RightBracket", - "FStringExpEnd", - "LeftBrace", - "RightBrace", - "Plus", - "PlusPlus", - "Minus", - "MinusMinus", - "Star", - "Div", - "Mod", - "PowerTo", - "AndAnd", - "OrOr", - "Not", - "Assign", - "PlusAssign", - "MinusAssign", - "StarAssign", - "DivAssign", - "ModAssign", - "Equal", - "NotEqual", - "Less", - "LessEqual", - "Greater", - "GreaterEqual", - "Dot", - "Identifier", - "IntegerConstant", - "SingleQuoteStringLiteral", - "DoubleQuoteStringLiteral", - "FloatingConstant", - "Whitespace", - "Newline", - "FStringSingleQuoteStart", - "FStringDoubleQuoteStart", - "FStringSingleQuoteExpStart", - "FStringSingleQuoteEnd", - "FStringSingleQuoteAtom", - "FStringDoubleQuoteExpStart", - "FStringDoubleQuoteEnd", - "FStringDoubleQuoteAtom", - "IdentifierNondigit", - "Nondigit", - "Digit", - "DecimalConstant", - "BinaryConstant", - "OctalConstant", - "HexadecimalConstant", - "NonzeroDigit", - "BinaryDigit", - "OctalDigit", - "HexadecimalDigit", - "DecimalFloatingConstant", - "FractionalConstant", - "ExponentPart", - "DigitSequence", - "Sign", - "CCharSequence", - "CChar", - "EscapeSequence", - "SimpleEscapeSequence", - "OctalEscapeSequence", - "HexadecimalEscapeSequence", - "SingleQuoteFStringSCharSequence", - "SingleQuoteFStringSChar", - "DoubleQuoteFStringSCharSequence", - "DoubleQuoteFStringSChar", - "SingleQuoteSCharSequence", - "SingleQuoteSChar", - "DoubleQuoteSCharSequence", - "DoubleQuoteSChar", + "BlockComment", "LineComment", "Const", "Var", "As", "Spread", "Switch", + "Case", "Default", "Break", "Continue", "Do", "While", "If", "Else", "For", + "Enum", "DefFunc", "Return", "CallFunc", "RetIndicator", "Class", "Interface", + "True", "False", "Typeof", "Void", "Null", "Undefined", "Comma", "SemiColon", + "QuestionMark", "Colon", "LeftParen", "RightParen", "LeftBracket", "RightBracket", + "FStringExpEnd", "LeftBrace", "RightBrace", "Plus", "PlusPlus", "Minus", + "MinusMinus", "Star", "Div", "Mod", "PowerTo", "AndAnd", "OrOr", "Not", + "Assign", "PlusAssign", "MinusAssign", "StarAssign", "DivAssign", "ModAssign", + "Equal", "NotEqual", "Less", "LessEqual", "Greater", "GreaterEqual", "Dot", + "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", "DoubleQuoteStringLiteral", + "FloatingConstant", "Whitespace", "Newline", "FStringSingleQuoteStart", + "FStringDoubleQuoteStart", "FStringSingleQuoteExpStart", "FStringSingleQuoteEnd", + "FStringSingleQuoteAtom", "FStringDoubleQuoteExpStart", "FStringDoubleQuoteEnd", + "FStringDoubleQuoteAtom", "IdentifierNondigit", "Nondigit", "Digit", "DecimalConstant", + "BinaryConstant", "OctalConstant", "HexadecimalConstant", "NonzeroDigit", + "BinaryDigit", "OctalDigit", "HexadecimalDigit", "DecimalFloatingConstant", + "FractionalConstant", "ExponentPart", "DigitSequence", "Sign", "CCharSequence", + "CChar", "EscapeSequence", "SimpleEscapeSequence", "OctalEscapeSequence", + "HexadecimalEscapeSequence", "SingleQuoteFStringSCharSequence", "SingleQuoteFStringSChar", + "DoubleQuoteFStringSCharSequence", "DoubleQuoteFStringSChar", "SingleQuoteSCharSequence", + "SingleQuoteSChar", "DoubleQuoteSCharSequence", "DoubleQuoteSChar", ]; private static readonly _LITERAL_NAMES: Array = [ - undefined, - undefined, - undefined, - undefined, - "'const'", - "'var'", - "'as'", - "'...'", - "'switch'", - "'case'", - "'default'", - "'break'", - "'continue'", - "'do'", - "'while'", - "'if'", - "'else'", - "'for'", - "'enum'", - "'def'", - "'return'", - "'call'", - "'->'", - "'true'", - "'false'", - "'typeof'", - "'void'", - "'null'", - "'undefined'", - "','", - "';'", - "'?'", - "':'", - "'('", - "')'", - "'['", - "']'", - undefined, - "'{'", - "'}'", - "'+'", - "'++'", - "'-'", - "'--'", - "'*'", - "'/'", - "'%'", - "'**'", - "'&&'", - "'||'", - "'!'", - "'='", - "'+='", - "'-='", - "'*='", - "'/='", - "'%='", - "'=='", - "'!='", - "'<'", - "'<='", - "'>'", - "'>='", - "'.'", + undefined, undefined, undefined, undefined, "'const'", "'var'", "'as'", + "'...'", "'switch'", "'case'", "'default'", "'break'", "'continue'", "'do'", + "'while'", "'if'", "'else'", "'for'", "'enum'", "'def'", "'return'", "'call'", + "'->'", "'class'", "'interface'", "'true'", "'false'", "'typeof'", "'void'", + "'null'", "'undefined'", "','", "';'", "'?'", "':'", "'('", "')'", "'['", + "']'", undefined, "'{'", "'}'", "'+'", "'++'", "'-'", "'--'", "'*'", "'/'", + "'%'", "'**'", "'&&'", "'||'", "'!'", "'='", "'+='", "'-='", "'*='", "'/='", + "'%='", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'.'", ]; private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, - "FStringExpStart", - "BlockComment", - "LineComment", - "Const", - "Var", - "As", - "Spread", - "Switch", - "Case", - "Default", - "Break", - "Continue", - "Do", - "While", - "If", - "Else", - "For", - "Enum", - "DefFunc", - "Return", - "CallFunc", - "RetIndicator", - "True", - "False", - "Typeof", - "Void", - "Null", - "Undefined", - "Comma", - "SemiColon", - "QuestionMark", - "Colon", - "LeftParen", - "RightParen", - "LeftBracket", - "RightBracket", - "FStringExpEnd", - "LeftBrace", - "RightBrace", - "Plus", - "PlusPlus", - "Minus", - "MinusMinus", - "Star", - "Div", - "Mod", - "PowerTo", - "AndAnd", - "OrOr", - "Not", - "Assign", - "PlusAssign", - "MinusAssign", - "StarAssign", - "DivAssign", - "ModAssign", - "Equal", - "NotEqual", - "Less", - "LessEqual", - "Greater", - "GreaterEqual", - "Dot", - "Identifier", - "IntegerConstant", - "SingleQuoteStringLiteral", - "DoubleQuoteStringLiteral", - "FloatingConstant", - "Whitespace", - "Newline", - "FStringSingleQuoteStart", - "FStringDoubleQuoteStart", - "FStringSingleQuoteEnd", - "FStringSingleQuoteAtom", - "FStringDoubleQuoteEnd", - "FStringDoubleQuoteAtom", + undefined, "FStringExpStart", "BlockComment", "LineComment", "Const", + "Var", "As", "Spread", "Switch", "Case", "Default", "Break", "Continue", + "Do", "While", "If", "Else", "For", "Enum", "DefFunc", "Return", "CallFunc", + "RetIndicator", "Class", "Interface", "True", "False", "Typeof", "Void", + "Null", "Undefined", "Comma", "SemiColon", "QuestionMark", "Colon", "LeftParen", + "RightParen", "LeftBracket", "RightBracket", "FStringExpEnd", "LeftBrace", + "RightBrace", "Plus", "PlusPlus", "Minus", "MinusMinus", "Star", "Div", + "Mod", "PowerTo", "AndAnd", "OrOr", "Not", "Assign", "PlusAssign", "MinusAssign", + "StarAssign", "DivAssign", "ModAssign", "Equal", "NotEqual", "Less", "LessEqual", + "Greater", "GreaterEqual", "Dot", "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", + "DoubleQuoteStringLiteral", "FloatingConstant", "Whitespace", "Newline", + "FStringSingleQuoteStart", "FStringDoubleQuoteStart", "FStringSingleQuoteEnd", + "FStringSingleQuoteAtom", "FStringDoubleQuoteEnd", "FStringDoubleQuoteAtom", ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( - KipperLexer._LITERAL_NAMES, - KipperLexer._SYMBOLIC_NAMES, - [], - ); + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(KipperLexer._LITERAL_NAMES, KipperLexer._SYMBOLIC_NAMES, []); // @Override // @NotNull @@ -370,130 +169,121 @@ export class KipperLexer extends KipperLexerBase { } // tslint:enable:no-trailing-whitespace + constructor(input: CharStream) { super(input); this._interp = new LexerATNSimulator(KipperLexer._ATN, this); } // @Override - public get grammarFileName(): string { - return "KipperLexer.g4"; - } + public get grammarFileName(): string { return "KipperLexer.g4"; } // @Override - public get ruleNames(): string[] { - return KipperLexer.ruleNames; - } + public get ruleNames(): string[] { return KipperLexer.ruleNames; } // @Override - public get serializedATN(): string { - return KipperLexer._serializedATN; - } + public get serializedATN(): string { return KipperLexer._serializedATN; } // @Override - public get channelNames(): string[] { - return KipperLexer.channelNames; - } + public get channelNames(): string[] { return KipperLexer.channelNames; } // @Override - public get modeNames(): string[] { - return KipperLexer.modeNames; - } + public get modeNames(): string[] { return KipperLexer.modeNames; } // @Override public action(_localctx: RuleContext, ruleIndex: number, actionIndex: number): void { switch (ruleIndex) { - case 69: - this.FStringSingleQuoteStart_action(_localctx, actionIndex); - break; + case 71: + this.FStringSingleQuoteStart_action(_localctx, actionIndex); + break; - case 70: - this.FStringDoubleQuoteStart_action(_localctx, actionIndex); - break; + case 72: + this.FStringDoubleQuoteStart_action(_localctx, actionIndex); + break; - case 72: - this.FStringSingleQuoteEnd_action(_localctx, actionIndex); - break; + case 74: + this.FStringSingleQuoteEnd_action(_localctx, actionIndex); + break; - case 75: - this.FStringDoubleQuoteEnd_action(_localctx, actionIndex); - break; + case 77: + this.FStringDoubleQuoteEnd_action(_localctx, actionIndex); + break; } } private FStringSingleQuoteStart_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 0: - this.incrementFStringDepth(); - break; + case 0: + this.incrementFStringDepth() + break; } } private FStringDoubleQuoteStart_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 1: - this.incrementFStringDepth(); - break; + case 1: + this.incrementFStringDepth() + break; } } private FStringSingleQuoteEnd_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 2: - this.decrementFStringDepth(); - break; + case 2: + this.decrementFStringDepth() + break; } } private FStringDoubleQuoteEnd_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 3: - this.decrementFStringDepth(); - break; + case 3: + this.decrementFStringDepth() + break; } } // @Override public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { switch (ruleIndex) { - case 35: - return this.FStringExpEnd_sempred(_localctx, predIndex); + case 37: + return this.FStringExpEnd_sempred(_localctx, predIndex); - case 71: - return this.FStringSingleQuoteExpStart_sempred(_localctx, predIndex); + case 73: + return this.FStringSingleQuoteExpStart_sempred(_localctx, predIndex); - case 74: - return this.FStringDoubleQuoteExpStart_sempred(_localctx, predIndex); + case 76: + return this.FStringDoubleQuoteExpStart_sempred(_localctx, predIndex); } return true; } private FStringExpEnd_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 0: - return this.insideFString(); + case 0: + return this.insideFString(); } return true; } private FStringSingleQuoteExpStart_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 1: - return this.insideFString(); + case 1: + return this.insideFString(); } return true; } private FStringDoubleQuoteExpStart_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 2: - return this.insideFString(); + case 2: + return this.insideFString(); } return true; } private static readonly _serializedATNSegments: number = 2; private static readonly _serializedATNSegment0: string = - "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x02N\u02AE\b\x01" + + "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x02P\u02C2\b\x01" + "\b\x01\b\x01\x04\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04" + "\x06\t\x06\x04\x07\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f" + "\t\f\x04\r\t\r\x04\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11" + "\x04\x12\t\x12\x04\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16" + "\x04\x17\t\x17\x04\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B" + "\x04\x1C\t\x1C\x04\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!" + - "\t!\x04\"\t\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04'\t'\x04(\t(\x04)\t" + + "\t!\x04\"\t\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(\x04)\t" + ")\x04*\t*\x04+\t+\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x040\t0\x041\t1\x04" + "2\t2\x043\t3\x044\t4\x045\t5\x046\t6\x047\t7\x048\t8\x049\t9\x04:\t:\x04" + ";\t;\x04<\t<\x04=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x04B\tB\x04C\tC\x04" + @@ -501,74 +291,76 @@ export class KipperLexer extends KipperLexerBase { "M\tM\x04N\tN\x04O\tO\x04P\tP\x04Q\tQ\x04R\tR\x04S\tS\x04T\tT\x04U\tU\x04" + "V\tV\x04W\tW\x04X\tX\x04Y\tY\x04Z\tZ\x04[\t[\x04\\\t\\\x04]\t]\x04^\t" + "^\x04_\t_\x04`\t`\x04a\ta\x04b\tb\x04c\tc\x04d\td\x04e\te\x04f\tf\x04" + - "g\tg\x04h\th\x04i\ti\x04j\tj\x04k\tk\x04l\tl\x03\x02\x03\x02\x03\x02\x03" + - "\x02\x07\x02\xE0\n\x02\f\x02\x0E\x02\xE3\v\x02\x03\x02\x03\x02\x03\x02" + - "\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x03\x03\x07\x03\xEE\n\x03\f\x03" + - "\x0E\x03\xF1\v\x03\x03\x03\x03\x03\x03\x04\x03\x04\x03\x04\x03\x04\x03" + - "\x04\x03\x04\x03\x05\x03\x05\x03\x05\x03\x05\x03\x06\x03\x06\x03\x06\x03" + - "\x07\x03\x07\x03\x07\x03\x07\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b" + - "\x03\t\x03\t\x03\t\x03\t\x03\t\x03\n\x03\n\x03\n\x03\n\x03\n\x03\n\x03" + - "\n\x03\n\x03\v\x03\v\x03\v\x03\v\x03\v\x03\v\x03\f\x03\f\x03\f\x03\f\x03" + - "\f\x03\f\x03\f\x03\f\x03\f\x03\r\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0E\x03" + - "\x0E\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x03\x0F\x03\x10\x03\x10\x03\x10\x03" + - "\x10\x03\x10\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\x14\x03\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\x17\x03\x17\x03\x17\x03\x17\x03\x17\x03\x18\x03" + - "\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x19\x03\x19\x03\x19\x03\x19\x03" + - "\x19\x03\x19\x03\x19\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1B\x03" + - "\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03" + - "\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1D\x03\x1D\x03\x1E\x03\x1E\x03" + - '\x1F\x03\x1F\x03 \x03 \x03!\x03!\x03"\x03"\x03#\x03#\x03$\x03$\x03%' + - "\x03%\x03%\x03%\x03%\x03&\x03&\x03'\x03'\x03(\x03(\x03)\x03)\x03)\x03" + - "*\x03*\x03+\x03+\x03+\x03,\x03,\x03-\x03-\x03.\x03.\x03/\x03/\x03/\x03" + - "0\x030\x030\x031\x031\x031\x032\x032\x033\x033\x034\x034\x034\x035\x03" + - "5\x035\x036\x036\x036\x037\x037\x037\x038\x038\x038\x039\x039\x039\x03" + - ":\x03:\x03:\x03;\x03;\x03<\x03<\x03<\x03=\x03=\x03>\x03>\x03>\x03?\x03" + - "?\x03@\x03@\x03@\x07@\u01D6\n@\f@\x0E@\u01D9\v@\x03A\x03A\x03A\x03A\x05" + - "A\u01DF\nA\x03B\x03B\x05B\u01E3\nB\x03B\x03B\x03C\x03C\x05C\u01E9\nC\x03" + - "C\x03C\x03D\x03D\x03E\x06E\u01F0\nE\rE\x0EE\u01F1\x03E\x03E\x03F\x03F" + - "\x03F\x03F\x03G\x03G\x03G\x03G\x03G\x03G\x03G\x03H\x03H\x03H\x03H\x03" + - "H\x03H\x03H\x03I\x03I\x03I\x03I\x03I\x03I\x03J\x03J\x03J\x03J\x03J\x03" + - "K\x03K\x03L\x03L\x03L\x03L\x03L\x03L\x03M\x03M\x03M\x03M\x03M\x03N\x03" + - "N\x03O\x03O\x03P\x03P\x03Q\x03Q\x03R\x06R\u0229\nR\rR\x0ER\u022A\x03S" + - "\x03S\x03S\x06S\u0230\nS\rS\x0ES\u0231\x03T\x03T\x03T\x06T\u0237\nT\r" + - "T\x0ET\u0238\x03U\x03U\x03U\x06U\u023E\nU\rU\x0EU\u023F\x03V\x03V\x03" + - "W\x03W\x03X\x03X\x03Y\x03Y\x03Z\x03Z\x05Z\u024C\nZ\x03Z\x03Z\x03Z\x05" + - "Z\u0251\nZ\x03[\x05[\u0254\n[\x03[\x03[\x03[\x03[\x03[\x05[\u025B\n[\x03" + - "\\\x03\\\x05\\\u025F\n\\\x03\\\x03\\\x03]\x06]\u0264\n]\r]\x0E]\u0265" + - "\x03^\x03^\x03_\x06_\u026B\n_\r_\x0E_\u026C\x03`\x03`\x05`\u0271\n`\x03" + - "a\x03a\x03a\x05a\u0276\na\x03b\x03b\x03b\x03c\x03c\x03c\x05c\u027E\nc" + - "\x03c\x05c\u0281\nc\x03d\x03d\x03d\x03d\x06d\u0287\nd\rd\x0Ed\u0288\x03" + - "e\x06e\u028C\ne\re\x0Ee\u028D\x03f\x03f\x05f\u0292\nf\x03g\x06g\u0295" + - "\ng\rg\x0Eg\u0296\x03h\x03h\x05h\u029B\nh\x03i\x06i\u029E\ni\ri\x0Ei\u029F" + - "\x03j\x03j\x05j\u02A4\nj\x03k\x06k\u02A7\nk\rk\x0Ek\u02A8\x03l\x03l\x05" + - "l\u02AD\nl\x03\xE1\x02\x02m\x05\x02\x04\x07\x02\x05\t\x02\x06\v\x02\x07" + - "\r\x02\b\x0F\x02\t\x11\x02\n\x13\x02\v\x15\x02\f\x17\x02\r\x19\x02\x0E" + - "\x1B\x02\x0F\x1D\x02\x10\x1F\x02\x11!\x02\x12#\x02\x13%\x02\x14'\x02" + - "\x15)\x02\x16+\x02\x17-\x02\x18/\x02\x191\x02\x1A3\x02\x1B5\x02\x1C7\x02" + - '\x1D9\x02\x1E;\x02\x1F=\x02 ?\x02!A\x02"C\x02#E\x02$G\x02%I\x02&K\x02' + - "'M\x02(O\x02)Q\x02*S\x02+U\x02,W\x02-Y\x02.[\x02/]\x020_\x021a\x022c" + - "\x023e\x024g\x025i\x026k\x027m\x028o\x029q\x02:s\x02;u\x02{\x02?}\x02@\x7F\x02A\x81\x02B\x83\x02C\x85\x02D\x87\x02E\x89\x02F\x8B" + - "\x02G\x8D\x02H\x8F\x02I\x91\x02J\x93\x02\x02\x95\x02K\x97\x02L\x99\x02" + - "\x02\x9B\x02M\x9D\x02N\x9F\x02\x02\xA1\x02\x02\xA3\x02\x02\xA5\x02\x02" + - "\xA7\x02\x02\xA9\x02\x02\xAB\x02\x02\xAD\x02\x02\xAF\x02\x02\xB1\x02\x02" + - "\xB3\x02\x02\xB5\x02\x02\xB7\x02\x02\xB9\x02\x02\xBB\x02\x02\xBD\x02\x02" + - "\xBF\x02\x02\xC1\x02\x02\xC3\x02\x02\xC5\x02\x02\xC7\x02\x02\xC9\x02\x02" + - "\xCB\x02\x02\xCD\x02\x02\xCF\x02\x02\xD1\x02\x02\xD3\x02\x02\xD5\x02\x02" + - "\xD7\x02\x02\xD9\x02\x02\x05\x02\x03\x04\x14\x05\x02\f\f\x0F\x0F\u202A" + - '\u202B\x06\x02\v\v\r\x0E""\xA2\xA2\x05\x02C\\aac|\x03\x022;\x04\x02' + + "g\tg\x04h\th\x04i\ti\x04j\tj\x04k\tk\x04l\tl\x04m\tm\x04n\tn\x03\x02\x03" + + "\x02\x03\x02\x03\x02\x07\x02\xE4\n\x02\f\x02\x0E\x02\xE7\v\x02\x03\x02" + + "\x03\x02\x03\x02\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x03\x03\x07\x03" + + "\xF2\n\x03\f\x03\x0E\x03\xF5\v\x03\x03\x03\x03\x03\x03\x04\x03\x04\x03" + + "\x04\x03\x04\x03\x04\x03\x04\x03\x05\x03\x05\x03\x05\x03\x05\x03\x06\x03" + + "\x06\x03\x06\x03\x07\x03\x07\x03\x07\x03\x07\x03\b\x03\b\x03\b\x03\b\x03" + + "\b\x03\b\x03\b\x03\t\x03\t\x03\t\x03\t\x03\t\x03\n\x03\n\x03\n\x03\n\x03" + + "\n\x03\n\x03\n\x03\n\x03\v\x03\v\x03\v\x03\v\x03\v\x03\v\x03\f\x03\f\x03" + + "\f\x03\f\x03\f\x03\f\x03\f\x03\f\x03\f\x03\r\x03\r\x03\r\x03\x0E\x03\x0E" + + "\x03\x0E\x03\x0E\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x03\x0F\x03\x10\x03\x10" + + "\x03\x10\x03\x10\x03\x10\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\x14\x03\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\x17\x03\x17\x03\x17\x03\x17\x03\x17" + + "\x03\x17\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18" + + "\x03\x18\x03\x18\x03\x19\x03\x19\x03\x19\x03\x19\x03\x19\x03\x1A\x03\x1A" + + "\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B" + + "\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1D\x03\x1D" + + "\x03\x1D\x03\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E" + + "\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x03 \x03 \x03!\x03!\x03" + + "\"\x03\"\x03#\x03#\x03$\x03$\x03%\x03%\x03&\x03&\x03\'\x03\'\x03\'\x03" + + "\'\x03\'\x03(\x03(\x03)\x03)\x03*\x03*\x03+\x03+\x03+\x03,\x03,\x03-\x03" + + "-\x03-\x03.\x03.\x03/\x03/\x030\x030\x031\x031\x031\x032\x032\x032\x03" + + "3\x033\x033\x034\x034\x035\x035\x036\x036\x036\x037\x037\x037\x038\x03" + + "8\x038\x039\x039\x039\x03:\x03:\x03:\x03;\x03;\x03;\x03<\x03<\x03<\x03" + + "=\x03=\x03>\x03>\x03>\x03?\x03?\x03@\x03@\x03@\x03A\x03A\x03B\x03B\x03" + + "B\x07B\u01EA\nB\fB\x0EB\u01ED\vB\x03C\x03C\x03C\x03C\x05C\u01F3\nC\x03" + + "D\x03D\x05D\u01F7\nD\x03D\x03D\x03E\x03E\x05E\u01FD\nE\x03E\x03E\x03F" + + "\x03F\x03G\x06G\u0204\nG\rG\x0EG\u0205\x03G\x03G\x03H\x03H\x03H\x03H\x03" + + "I\x03I\x03I\x03I\x03I\x03I\x03I\x03J\x03J\x03J\x03J\x03J\x03J\x03J\x03" + + "K\x03K\x03K\x03K\x03K\x03K\x03L\x03L\x03L\x03L\x03L\x03M\x03M\x03N\x03" + + "N\x03N\x03N\x03N\x03N\x03O\x03O\x03O\x03O\x03O\x03P\x03P\x03Q\x03Q\x03" + + "R\x03R\x03S\x03S\x03T\x06T\u023D\nT\rT\x0ET\u023E\x03U\x03U\x03U\x06U" + + "\u0244\nU\rU\x0EU\u0245\x03V\x03V\x03V\x06V\u024B\nV\rV\x0EV\u024C\x03" + + "W\x03W\x03W\x06W\u0252\nW\rW\x0EW\u0253\x03X\x03X\x03Y\x03Y\x03Z\x03Z" + + "\x03[\x03[\x03\\\x03\\\x05\\\u0260\n\\\x03\\\x03\\\x03\\\x05\\\u0265\n" + + "\\\x03]\x05]\u0268\n]\x03]\x03]\x03]\x03]\x03]\x05]\u026F\n]\x03^\x03" + + "^\x05^\u0273\n^\x03^\x03^\x03_\x06_\u0278\n_\r_\x0E_\u0279\x03`\x03`\x03" + + "a\x06a\u027F\na\ra\x0Ea\u0280\x03b\x03b\x05b\u0285\nb\x03c\x03c\x03c\x05" + + "c\u028A\nc\x03d\x03d\x03d\x03e\x03e\x03e\x05e\u0292\ne\x03e\x05e\u0295" + + "\ne\x03f\x03f\x03f\x03f\x06f\u029B\nf\rf\x0Ef\u029C\x03g\x06g\u02A0\n" + + "g\rg\x0Eg\u02A1\x03h\x03h\x05h\u02A6\nh\x03i\x06i\u02A9\ni\ri\x0Ei\u02AA" + + "\x03j\x03j\x05j\u02AF\nj\x03k\x06k\u02B2\nk\rk\x0Ek\u02B3\x03l\x03l\x05" + + "l\u02B8\nl\x03m\x06m\u02BB\nm\rm\x0Em\u02BC\x03n\x03n\x05n\u02C1\nn\x03" + + "\xE5\x02\x02o\x05\x02\x04\x07\x02\x05\t\x02\x06\v\x02\x07\r\x02\b\x0F" + + "\x02\t\x11\x02\n\x13\x02\v\x15\x02\f\x17\x02\r\x19\x02\x0E\x1B\x02\x0F" + + "\x1D\x02\x10\x1F\x02\x11!\x02\x12#\x02\x13%\x02\x14\'\x02\x15)\x02\x16" + + "+\x02\x17-\x02\x18/\x02\x191\x02\x1A3\x02\x1B5\x02\x1C7\x02\x1D9\x02\x1E" + + ";\x02\x1F=\x02 ?\x02!A\x02\"C\x02#E\x02$G\x02%I\x02&K\x02\'M\x02(O\x02" + + ")Q\x02*S\x02+U\x02,W\x02-Y\x02.[\x02/]\x020_\x021a\x022c\x023e\x024g\x02" + + "5i\x026k\x027m\x028o\x029q\x02:s\x02;u\x02{\x02?}\x02@\x7F" + + "\x02A\x81\x02B\x83\x02C\x85\x02D\x87\x02E\x89\x02F\x8B\x02G\x8D\x02H\x8F" + + "\x02I\x91\x02J\x93\x02K\x95\x02L\x97\x02\x02\x99\x02M\x9B\x02N\x9D\x02" + + "\x02\x9F\x02O\xA1\x02P\xA3\x02\x02\xA5\x02\x02\xA7\x02\x02\xA9\x02\x02" + + "\xAB\x02\x02\xAD\x02\x02\xAF\x02\x02\xB1\x02\x02\xB3\x02\x02\xB5\x02\x02" + + "\xB7\x02\x02\xB9\x02\x02\xBB\x02\x02\xBD\x02\x02\xBF\x02\x02\xC1\x02\x02" + + "\xC3\x02\x02\xC5\x02\x02\xC7\x02\x02\xC9\x02\x02\xCB\x02\x02\xCD\x02\x02" + + "\xCF\x02\x02\xD1\x02\x02\xD3\x02\x02\xD5\x02\x02\xD7\x02\x02\xD9\x02\x02" + + "\xDB\x02\x02\xDD\x02\x02\x05\x02\x03\x04\x14\x05\x02\f\f\x0F\x0F\u202A" + + "\u202B\x06\x02\v\v\r\x0E\"\"\xA2\xA2\x05\x02C\\aac|\x03\x022;\x04\x02" + "DDdd\x04\x02QQqq\x04\x02ZZzz\x03\x023;\x03\x0223\x03\x0229\x05\x022;C" + "Hch\x04\x02GGgg\x04\x02--//\x06\x02\f\f\x0F\x0F))^^\x0E\x02$$))AA^^cd" + "hhppttvvxx}}\x7F\x7F\b\x02\f\f\x0F\x0F))^^}}\x7F\x7F\b\x02\f\f\x0F\x0F" + - "$$^^}}\x7F\x7F\x06\x02\f\f\x0F\x0F$$^^\x02\u02B0\x02\x05\x03\x02\x02\x02" + + "$$^^}}\x7F\x7F\x06\x02\f\f\x0F\x0F$$^^\x02\u02C4\x02\x05\x03\x02\x02\x02" + "\x02\x07\x03\x02\x02\x02\x02\t\x03\x02\x02\x02\x02\v\x03\x02\x02\x02\x02" + "\r\x03\x02\x02\x02\x02\x0F\x03\x02\x02\x02\x02\x11\x03\x02\x02\x02\x02" + "\x13\x03\x02\x02\x02\x02\x15\x03\x02\x02\x02\x02\x17\x03\x02\x02\x02\x02" + "\x19\x03\x02\x02\x02\x02\x1B\x03\x02\x02\x02\x02\x1D\x03\x02\x02\x02\x02" + "\x1F\x03\x02\x02\x02\x02!\x03\x02\x02\x02\x02#\x03\x02\x02\x02\x02%\x03" + - "\x02\x02\x02\x02'\x03\x02\x02\x02\x02)\x03\x02\x02\x02\x02+\x03\x02\x02" + + "\x02\x02\x02\x02\'\x03\x02\x02\x02\x02)\x03\x02\x02\x02\x02+\x03\x02\x02" + "\x02\x02-\x03\x02\x02\x02\x02/\x03\x02\x02\x02\x021\x03\x02\x02\x02\x02" + "3\x03\x02\x02\x02\x025\x03\x02\x02\x02\x027\x03\x02\x02\x02\x029\x03\x02" + "\x02\x02\x02;\x03\x02\x02\x02\x02=\x03\x02\x02\x02\x02?\x03\x02\x02\x02" + @@ -584,233 +376,244 @@ export class KipperLexer extends KipperLexerBase { "\x02\x02\x02\x7F\x03\x02\x02\x02\x02\x81\x03\x02\x02\x02\x02\x83\x03\x02" + "\x02\x02\x02\x85\x03\x02\x02\x02\x02\x87\x03\x02\x02\x02\x02\x89\x03\x02" + "\x02\x02\x02\x8B\x03\x02\x02\x02\x02\x8D\x03\x02\x02\x02\x02\x8F\x03\x02" + - "\x02\x02\x02\x91\x03\x02\x02\x02\x03\x93\x03\x02\x02\x02\x03\x95\x03\x02" + - "\x02\x02\x03\x97\x03\x02\x02\x02\x04\x99\x03\x02\x02\x02\x04\x9B\x03\x02" + - "\x02\x02\x04\x9D\x03\x02\x02\x02\x05\xDB\x03\x02\x02\x02\x07\xE9\x03\x02" + - "\x02\x02\t\xF4\x03\x02\x02\x02\v\xFA\x03\x02\x02\x02\r\xFE\x03\x02\x02" + - "\x02\x0F\u0101\x03\x02\x02\x02\x11\u0105\x03\x02\x02\x02\x13\u010C\x03" + - "\x02\x02\x02\x15\u0111\x03\x02\x02\x02\x17\u0119\x03\x02\x02\x02\x19\u011F" + - "\x03\x02\x02\x02\x1B\u0128\x03\x02\x02\x02\x1D\u012B\x03\x02\x02\x02\x1F" + - "\u0131\x03\x02\x02\x02!\u0134\x03\x02\x02\x02#\u0139\x03\x02\x02\x02%" + - "\u013D\x03\x02\x02\x02'\u0142\x03\x02\x02\x02)\u0146\x03\x02\x02\x02" + - "+\u014D\x03\x02\x02\x02-\u0152\x03\x02\x02\x02/\u0155\x03\x02\x02\x02" + - "1\u015A\x03\x02\x02\x023\u0160\x03\x02\x02\x025\u0167\x03\x02\x02\x02" + - "7\u016C\x03\x02\x02\x029\u0171\x03\x02\x02\x02;\u017B\x03\x02\x02\x02" + - "=\u017D\x03\x02\x02\x02?\u017F\x03\x02\x02\x02A\u0181\x03\x02\x02\x02" + - "C\u0183\x03\x02\x02\x02E\u0185\x03\x02\x02\x02G\u0187\x03\x02\x02\x02" + - "I\u0189\x03\x02\x02\x02K\u018B\x03\x02\x02\x02M\u0190\x03\x02\x02\x02" + - "O\u0192\x03\x02\x02\x02Q\u0194\x03\x02\x02\x02S\u0196\x03\x02\x02\x02" + - "U\u0199\x03\x02\x02\x02W\u019B\x03\x02\x02\x02Y\u019E\x03\x02\x02\x02" + - "[\u01A0\x03\x02\x02\x02]\u01A2\x03\x02\x02\x02_\u01A4\x03\x02\x02\x02" + - "a\u01A7\x03\x02\x02\x02c\u01AA\x03\x02\x02\x02e\u01AD\x03\x02\x02\x02" + - "g\u01AF\x03\x02\x02\x02i\u01B1\x03\x02\x02\x02k\u01B4\x03\x02\x02\x02" + - "m\u01B7\x03\x02\x02\x02o\u01BA\x03\x02\x02\x02q\u01BD\x03\x02\x02\x02" + - "s\u01C0\x03\x02\x02\x02u\u01C3\x03\x02\x02\x02w\u01C6\x03\x02\x02\x02" + - "y\u01C8\x03\x02\x02\x02{\u01CB\x03\x02\x02\x02}\u01CD\x03\x02\x02\x02" + - "\x7F\u01D0\x03\x02\x02\x02\x81\u01D2\x03\x02\x02\x02\x83\u01DE\x03\x02" + - "\x02\x02\x85\u01E0\x03\x02\x02\x02\x87\u01E6\x03\x02\x02\x02\x89\u01EC" + - "\x03\x02\x02\x02\x8B\u01EF\x03\x02\x02\x02\x8D\u01F5\x03\x02\x02\x02\x8F" + - "\u01F9\x03\x02\x02\x02\x91\u0200\x03\x02\x02\x02\x93\u0207\x03\x02\x02" + - "\x02\x95\u020D\x03\x02\x02\x02\x97\u0212\x03\x02\x02\x02\x99\u0214\x03" + - "\x02\x02\x02\x9B\u021A\x03\x02\x02\x02\x9D\u021F\x03\x02\x02\x02\x9F\u0221" + - "\x03\x02\x02\x02\xA1\u0223\x03\x02\x02\x02\xA3\u0225\x03\x02\x02\x02\xA5" + - "\u0228\x03\x02\x02\x02\xA7\u022C\x03\x02\x02\x02\xA9\u0233\x03\x02\x02" + - "\x02\xAB\u023A\x03\x02\x02\x02\xAD\u0241\x03\x02\x02\x02\xAF\u0243\x03" + - "\x02\x02\x02\xB1\u0245\x03\x02\x02\x02\xB3\u0247\x03\x02\x02\x02\xB5\u0250" + - "\x03\x02\x02\x02\xB7\u025A\x03\x02\x02\x02\xB9\u025C\x03\x02\x02\x02\xBB" + - "\u0263\x03\x02\x02\x02\xBD\u0267\x03\x02\x02\x02\xBF\u026A\x03\x02\x02" + - "\x02\xC1\u0270\x03\x02\x02\x02\xC3\u0275\x03\x02\x02\x02\xC5\u0277\x03" + - "\x02\x02\x02\xC7\u027A\x03\x02\x02\x02\xC9\u0282\x03\x02\x02\x02\xCB\u028B" + - "\x03\x02\x02\x02\xCD\u0291\x03\x02\x02\x02\xCF\u0294\x03\x02\x02\x02\xD1" + - "\u029A\x03\x02\x02\x02\xD3\u029D\x03\x02\x02\x02\xD5\u02A3\x03\x02\x02" + - "\x02\xD7\u02A6\x03\x02\x02\x02\xD9\u02AC\x03\x02\x02\x02\xDB\xDC\x071" + - "\x02\x02\xDC\xDD\x07,\x02\x02\xDD\xE1\x03\x02\x02\x02\xDE\xE0\v\x02\x02" + - "\x02\xDF\xDE\x03\x02\x02\x02\xE0\xE3\x03\x02\x02\x02\xE1\xE2\x03\x02\x02" + - "\x02\xE1\xDF\x03\x02\x02\x02\xE2\xE4\x03\x02\x02\x02\xE3\xE1\x03\x02\x02" + - "\x02\xE4\xE5\x07,\x02\x02\xE5\xE6\x071\x02\x02\xE6\xE7\x03\x02\x02\x02" + - "\xE7\xE8\b\x02\x02\x02\xE8\x06\x03\x02\x02\x02\xE9\xEA\x071\x02\x02\xEA" + - "\xEB\x071\x02\x02\xEB\xEF\x03\x02\x02\x02\xEC\xEE\n\x02\x02\x02\xED\xEC" + - "\x03\x02\x02\x02\xEE\xF1\x03\x02\x02\x02\xEF\xED\x03\x02\x02\x02\xEF\xF0" + - "\x03\x02\x02\x02\xF0\xF2\x03\x02\x02\x02\xF1\xEF\x03\x02\x02\x02\xF2\xF3" + - "\b\x03\x02\x02\xF3\b\x03\x02\x02\x02\xF4\xF5\x07e\x02\x02\xF5\xF6\x07" + - "q\x02\x02\xF6\xF7\x07p\x02\x02\xF7\xF8\x07u\x02\x02\xF8\xF9\x07v\x02\x02" + - "\xF9\n\x03\x02\x02\x02\xFA\xFB\x07x\x02\x02\xFB\xFC\x07c\x02\x02\xFC\xFD" + - "\x07t\x02\x02\xFD\f\x03\x02\x02\x02\xFE\xFF\x07c\x02\x02\xFF\u0100\x07" + - "u\x02\x02\u0100\x0E\x03\x02\x02\x02\u0101\u0102\x070\x02\x02\u0102\u0103" + - "\x070\x02\x02\u0103\u0104\x070\x02\x02\u0104\x10\x03\x02\x02\x02\u0105" + - "\u0106\x07u\x02\x02\u0106\u0107\x07y\x02\x02\u0107\u0108\x07k\x02\x02" + - "\u0108\u0109\x07v\x02\x02\u0109\u010A\x07e\x02\x02\u010A\u010B\x07j\x02" + - "\x02\u010B\x12\x03\x02\x02\x02\u010C\u010D\x07e\x02\x02\u010D\u010E\x07" + - "c\x02\x02\u010E\u010F\x07u\x02\x02\u010F\u0110\x07g\x02\x02\u0110\x14" + - "\x03\x02\x02\x02\u0111\u0112\x07f\x02\x02\u0112\u0113\x07g\x02\x02\u0113" + - "\u0114\x07h\x02\x02\u0114\u0115\x07c\x02\x02\u0115\u0116\x07w\x02\x02" + - "\u0116\u0117\x07n\x02\x02\u0117\u0118\x07v\x02\x02\u0118\x16\x03\x02\x02" + - "\x02\u0119\u011A\x07d\x02\x02\u011A\u011B\x07t\x02\x02\u011B\u011C\x07" + - "g\x02\x02\u011C\u011D\x07c\x02\x02\u011D\u011E\x07m\x02\x02\u011E\x18" + - "\x03\x02\x02\x02\u011F\u0120\x07e\x02\x02\u0120\u0121\x07q\x02\x02\u0121" + - "\u0122\x07p\x02\x02\u0122\u0123\x07v\x02\x02\u0123\u0124\x07k\x02\x02" + - "\u0124\u0125\x07p\x02\x02\u0125\u0126\x07w\x02\x02\u0126\u0127\x07g\x02" + - "\x02\u0127\x1A\x03\x02\x02\x02\u0128\u0129\x07f\x02\x02\u0129\u012A\x07" + - "q\x02\x02\u012A\x1C\x03\x02\x02\x02\u012B\u012C\x07y\x02\x02\u012C\u012D" + - "\x07j\x02\x02\u012D\u012E\x07k\x02\x02\u012E\u012F\x07n\x02\x02\u012F" + - "\u0130\x07g\x02\x02\u0130\x1E\x03\x02\x02\x02\u0131\u0132\x07k\x02\x02" + - "\u0132\u0133\x07h\x02\x02\u0133 \x03\x02\x02\x02\u0134\u0135\x07g\x02" + - "\x02\u0135\u0136\x07n\x02\x02\u0136\u0137\x07u\x02\x02\u0137\u0138\x07" + - 'g\x02\x02\u0138"\x03\x02\x02\x02\u0139\u013A\x07h\x02\x02\u013A\u013B' + - "\x07q\x02\x02\u013B\u013C\x07t\x02\x02\u013C$\x03\x02\x02\x02\u013D\u013E" + - "\x07g\x02\x02\u013E\u013F\x07p\x02\x02\u013F\u0140\x07w\x02\x02\u0140" + - "\u0141\x07o\x02\x02\u0141&\x03\x02\x02\x02\u0142\u0143\x07f\x02\x02\u0143" + - "\u0144\x07g\x02\x02\u0144\u0145\x07h\x02\x02\u0145(\x03\x02\x02\x02\u0146" + - "\u0147\x07t\x02\x02\u0147\u0148\x07g\x02\x02\u0148\u0149\x07v\x02\x02" + - "\u0149\u014A\x07w\x02\x02\u014A\u014B\x07t\x02\x02\u014B\u014C\x07p\x02" + - "\x02\u014C*\x03\x02\x02\x02\u014D\u014E\x07e\x02\x02\u014E\u014F\x07c" + - "\x02\x02\u014F\u0150\x07n\x02\x02\u0150\u0151\x07n\x02\x02\u0151,\x03" + - "\x02\x02\x02\u0152\u0153\x07/\x02\x02\u0153\u0154\x07@\x02\x02\u0154." + - "\x03\x02\x02\x02\u0155\u0156\x07v\x02\x02\u0156\u0157\x07t\x02\x02\u0157" + - "\u0158\x07w\x02\x02\u0158\u0159\x07g\x02\x02\u01590\x03\x02\x02\x02\u015A" + - "\u015B\x07h\x02\x02\u015B\u015C\x07c\x02\x02\u015C\u015D\x07n\x02\x02" + - "\u015D\u015E\x07u\x02\x02\u015E\u015F\x07g\x02\x02\u015F2\x03\x02\x02" + - "\x02\u0160\u0161\x07v\x02\x02\u0161\u0162\x07{\x02\x02\u0162\u0163\x07" + - "r\x02\x02\u0163\u0164\x07g\x02\x02\u0164\u0165\x07q\x02\x02\u0165\u0166" + - "\x07h\x02\x02\u01664\x03\x02\x02\x02\u0167\u0168\x07x\x02\x02\u0168\u0169" + - "\x07q\x02\x02\u0169\u016A\x07k\x02\x02\u016A\u016B\x07f\x02\x02\u016B" + - "6\x03\x02\x02\x02\u016C\u016D\x07p\x02\x02\u016D\u016E\x07w\x02\x02\u016E" + - "\u016F\x07n\x02\x02\u016F\u0170\x07n\x02\x02\u01708\x03\x02\x02\x02\u0171" + - "\u0172\x07w\x02\x02\u0172\u0173\x07p\x02\x02\u0173\u0174\x07f\x02\x02" + - "\u0174\u0175\x07g\x02\x02\u0175\u0176\x07h\x02\x02\u0176\u0177\x07k\x02" + - "\x02\u0177\u0178\x07p\x02\x02\u0178\u0179\x07g\x02\x02\u0179\u017A\x07" + - "f\x02\x02\u017A:\x03\x02\x02\x02\u017B\u017C\x07.\x02\x02\u017C<\x03\x02" + - "\x02\x02\u017D\u017E\x07=\x02\x02\u017E>\x03\x02\x02\x02\u017F\u0180\x07" + - "A\x02\x02\u0180@\x03\x02\x02\x02\u0181\u0182\x07<\x02\x02\u0182B\x03\x02" + - "\x02\x02\u0183\u0184\x07*\x02\x02\u0184D\x03\x02\x02\x02\u0185\u0186\x07" + - "+\x02\x02\u0186F\x03\x02\x02\x02\u0187\u0188\x07]\x02\x02\u0188H\x03\x02" + - "\x02\x02\u0189\u018A\x07_\x02\x02\u018AJ\x03\x02\x02\x02\u018B\u018C\x06" + - "%\x02\x02\u018C\u018D\x07\x7F\x02\x02\u018D\u018E\x03\x02\x02\x02\u018E" + - "\u018F\b%\x03\x02\u018FL\x03\x02\x02\x02\u0190\u0191\x07}\x02\x02\u0191" + - "N\x03\x02\x02\x02\u0192\u0193\x07\x7F\x02\x02\u0193P\x03\x02\x02\x02\u0194" + - "\u0195\x07-\x02\x02\u0195R\x03\x02\x02\x02\u0196\u0197\x07-\x02\x02\u0197" + - "\u0198\x07-\x02\x02\u0198T\x03\x02\x02\x02\u0199\u019A\x07/\x02\x02\u019A" + - "V\x03\x02\x02\x02\u019B\u019C\x07/\x02\x02\u019C\u019D\x07/\x02\x02\u019D" + - "X\x03\x02\x02\x02\u019E\u019F\x07,\x02\x02\u019FZ\x03\x02\x02\x02\u01A0" + - "\u01A1\x071\x02\x02\u01A1\\\x03\x02\x02\x02\u01A2\u01A3\x07'\x02\x02" + - "\u01A3^\x03\x02\x02\x02\u01A4\u01A5\x07,\x02\x02\u01A5\u01A6\x07,\x02" + - "\x02\u01A6`\x03\x02\x02\x02\u01A7\u01A8\x07(\x02\x02\u01A8\u01A9\x07(" + - "\x02\x02\u01A9b\x03\x02\x02\x02\u01AA\u01AB\x07~\x02\x02\u01AB\u01AC\x07" + - "~\x02\x02\u01ACd\x03\x02\x02\x02\u01AD\u01AE\x07#\x02\x02\u01AEf\x03\x02" + - "\x02\x02\u01AF\u01B0\x07?\x02\x02\u01B0h\x03\x02\x02\x02\u01B1\u01B2\x07" + - "-\x02\x02\u01B2\u01B3\x07?\x02\x02\u01B3j\x03\x02\x02\x02\u01B4\u01B5" + - "\x07/\x02\x02\u01B5\u01B6\x07?\x02\x02\u01B6l\x03\x02\x02\x02\u01B7\u01B8" + - "\x07,\x02\x02\u01B8\u01B9\x07?\x02\x02\u01B9n\x03\x02\x02\x02\u01BA\u01BB" + - "\x071\x02\x02\u01BB\u01BC\x07?\x02\x02\u01BCp\x03\x02\x02\x02\u01BD\u01BE" + - "\x07'\x02\x02\u01BE\u01BF\x07?\x02\x02\u01BFr\x03\x02\x02\x02\u01C0\u01C1" + - "\x07?\x02\x02\u01C1\u01C2\x07?\x02\x02\u01C2t\x03\x02\x02\x02\u01C3\u01C4" + - "\x07#\x02\x02\u01C4\u01C5\x07?\x02\x02\u01C5v\x03\x02\x02\x02\u01C6\u01C7" + - "\x07>\x02\x02\u01C7x\x03\x02\x02\x02\u01C8\u01C9\x07>\x02\x02\u01C9\u01CA" + - "\x07?\x02\x02\u01CAz\x03\x02\x02\x02\u01CB\u01CC\x07@\x02\x02\u01CC|\x03" + - "\x02\x02\x02\u01CD\u01CE\x07@\x02\x02\u01CE\u01CF\x07?\x02\x02\u01CF~" + - "\x03\x02\x02\x02\u01D0\u01D1\x070\x02\x02\u01D1\x80\x03\x02\x02\x02\u01D2" + - "\u01D7\x05\x9FO\x02\u01D3\u01D6\x05\x9FO\x02\u01D4\u01D6\x05\xA3Q\x02" + - "\u01D5\u01D3\x03\x02\x02\x02\u01D5\u01D4\x03\x02\x02\x02\u01D6\u01D9\x03" + - "\x02\x02\x02\u01D7\u01D5\x03\x02\x02\x02\u01D7\u01D8\x03\x02\x02\x02\u01D8" + - "\x82\x03\x02\x02\x02\u01D9\u01D7\x03\x02\x02\x02\u01DA\u01DF\x05\xA5R" + - "\x02\u01DB\u01DF\x05\xA9T\x02\u01DC\u01DF\x05\xABU\x02\u01DD\u01DF\x05" + - "\xA7S\x02\u01DE\u01DA\x03\x02\x02\x02\u01DE\u01DB\x03\x02\x02\x02\u01DE" + - "\u01DC\x03\x02\x02\x02\u01DE\u01DD\x03\x02\x02\x02\u01DF\x84\x03\x02\x02" + - "\x02\u01E0\u01E2\x07)\x02\x02\u01E1\u01E3\x05\xD3i\x02\u01E2\u01E1\x03" + - "\x02\x02\x02\u01E2\u01E3\x03\x02\x02\x02\u01E3\u01E4\x03\x02\x02\x02\u01E4" + - "\u01E5\x07)\x02\x02\u01E5\x86\x03\x02\x02\x02\u01E6\u01E8\x07$\x02\x02" + - "\u01E7\u01E9\x05\xD7k\x02\u01E8\u01E7\x03\x02\x02\x02\u01E8\u01E9\x03" + - "\x02\x02\x02\u01E9\u01EA\x03\x02\x02\x02\u01EA\u01EB\x07$\x02\x02\u01EB" + - "\x88\x03\x02\x02\x02\u01EC\u01ED\x05\xB5Z\x02\u01ED\x8A\x03\x02\x02\x02" + - "\u01EE\u01F0\t\x03\x02\x02\u01EF\u01EE\x03\x02\x02\x02\u01F0\u01F1\x03" + - "\x02\x02\x02\u01F1\u01EF\x03\x02\x02\x02\u01F1\u01F2\x03\x02\x02\x02\u01F2" + - "\u01F3\x03\x02\x02\x02\u01F3\u01F4\bE\x04\x02\u01F4\x8C\x03\x02\x02\x02" + - "\u01F5\u01F6\t\x02\x02\x02\u01F6\u01F7\x03\x02\x02\x02\u01F7\u01F8\bF" + - "\x04\x02\u01F8\x8E\x03\x02\x02\x02\u01F9\u01FA\x07h\x02\x02\u01FA\u01FB" + - "\x07)\x02\x02\u01FB\u01FC\x03\x02\x02\x02\u01FC\u01FD\bG\x05\x02\u01FD" + - "\u01FE\x03\x02\x02\x02\u01FE\u01FF\bG\x06\x02\u01FF\x90\x03\x02\x02\x02" + - "\u0200\u0201\x07h\x02\x02\u0201\u0202\x07$\x02\x02\u0202\u0203\x03\x02" + - "\x02\x02\u0203\u0204\bH\x07\x02\u0204\u0205\x03\x02\x02\x02\u0205\u0206" + - "\bH\b\x02\u0206\x92\x03\x02\x02\x02\u0207\u0208\x06I\x03\x02\u0208\u0209" + - "\x07}\x02\x02\u0209\u020A\x03\x02\x02\x02\u020A\u020B\bI\t\x02\u020B\u020C" + - "\bI\n\x02\u020C\x94\x03\x02\x02\x02\u020D\u020E\x07)\x02\x02\u020E\u020F" + - "\bJ\v\x02\u020F\u0210\x03\x02\x02\x02\u0210\u0211\bJ\x03\x02\u0211\x96" + - "\x03\x02\x02\x02\u0212\u0213\x05\xCBe\x02\u0213\x98\x03\x02\x02\x02\u0214" + - "\u0215\x06L\x04\x02\u0215\u0216\x07}\x02\x02\u0216\u0217\x03\x02\x02\x02" + - "\u0217\u0218\bL\t\x02\u0218\u0219\bL\n\x02\u0219\x9A\x03\x02\x02\x02\u021A" + - "\u021B\x07$\x02\x02\u021B\u021C\b"; + "\x02\x02\x02\x91\x03\x02\x02\x02\x02\x93\x03\x02\x02\x02\x02\x95\x03\x02" + + "\x02\x02\x03\x97\x03\x02\x02\x02\x03\x99\x03\x02\x02\x02\x03\x9B\x03\x02" + + "\x02\x02\x04\x9D\x03\x02\x02\x02\x04\x9F\x03\x02\x02\x02\x04\xA1\x03\x02" + + "\x02\x02\x05\xDF\x03\x02\x02\x02\x07\xED\x03\x02\x02\x02\t\xF8\x03\x02" + + "\x02\x02\v\xFE\x03\x02\x02\x02\r\u0102\x03\x02\x02\x02\x0F\u0105\x03\x02" + + "\x02\x02\x11\u0109\x03\x02\x02\x02\x13\u0110\x03\x02\x02\x02\x15\u0115" + + "\x03\x02\x02\x02\x17\u011D\x03\x02\x02\x02\x19\u0123\x03\x02\x02\x02\x1B" + + "\u012C\x03\x02\x02\x02\x1D\u012F\x03\x02\x02\x02\x1F\u0135\x03\x02\x02" + + "\x02!\u0138\x03\x02\x02\x02#\u013D\x03\x02\x02\x02%\u0141\x03\x02\x02" + + "\x02\'\u0146\x03\x02\x02\x02)\u014A\x03\x02\x02\x02+\u0151\x03\x02\x02" + + "\x02-\u0156\x03\x02\x02\x02/\u0159\x03\x02\x02\x021\u015F\x03\x02\x02" + + "\x023\u0169\x03\x02\x02\x025\u016E\x03\x02\x02\x027\u0174\x03\x02\x02" + + "\x029\u017B\x03\x02\x02\x02;\u0180\x03\x02\x02\x02=\u0185\x03\x02\x02" + + "\x02?\u018F\x03\x02\x02\x02A\u0191\x03\x02\x02\x02C\u0193\x03\x02\x02" + + "\x02E\u0195\x03\x02\x02\x02G\u0197\x03\x02\x02\x02I\u0199\x03\x02\x02" + + "\x02K\u019B\x03\x02\x02\x02M\u019D\x03\x02\x02\x02O\u019F\x03\x02\x02" + + "\x02Q\u01A4\x03\x02\x02\x02S\u01A6\x03\x02\x02\x02U\u01A8\x03\x02\x02" + + "\x02W\u01AA\x03\x02\x02\x02Y\u01AD\x03\x02\x02\x02[\u01AF\x03\x02\x02" + + "\x02]\u01B2\x03\x02\x02\x02_\u01B4\x03\x02\x02\x02a\u01B6\x03\x02\x02" + + "\x02c\u01B8\x03\x02\x02\x02e\u01BB\x03\x02\x02\x02g\u01BE\x03\x02\x02" + + "\x02i\u01C1\x03\x02\x02\x02k\u01C3\x03\x02\x02\x02m\u01C5\x03\x02\x02" + + "\x02o\u01C8\x03\x02\x02\x02q\u01CB\x03\x02\x02\x02s\u01CE\x03\x02\x02" + + "\x02u\u01D1\x03\x02\x02\x02w\u01D4\x03\x02\x02\x02y\u01D7\x03\x02\x02" + + "\x02{\u01DA\x03\x02\x02\x02}\u01DC\x03\x02\x02\x02\x7F\u01DF\x03\x02\x02" + + "\x02\x81\u01E1\x03\x02\x02\x02\x83\u01E4\x03\x02\x02\x02\x85\u01E6\x03" + + "\x02\x02\x02\x87\u01F2\x03\x02\x02\x02\x89\u01F4\x03\x02\x02\x02\x8B\u01FA" + + "\x03\x02\x02\x02\x8D\u0200\x03\x02\x02\x02\x8F\u0203\x03\x02\x02\x02\x91" + + "\u0209\x03\x02\x02\x02\x93\u020D\x03\x02\x02\x02\x95\u0214\x03\x02\x02" + + "\x02\x97\u021B\x03\x02\x02\x02\x99\u0221\x03\x02\x02\x02\x9B\u0226\x03" + + "\x02\x02\x02\x9D\u0228\x03\x02\x02\x02\x9F\u022E\x03\x02\x02\x02\xA1\u0233" + + "\x03\x02\x02\x02\xA3\u0235\x03\x02\x02\x02\xA5\u0237\x03\x02\x02\x02\xA7" + + "\u0239\x03\x02\x02\x02\xA9\u023C\x03\x02\x02\x02\xAB\u0240\x03\x02\x02" + + "\x02\xAD\u0247\x03\x02\x02\x02\xAF\u024E\x03\x02\x02\x02\xB1\u0255\x03" + + "\x02\x02\x02\xB3\u0257\x03\x02\x02\x02\xB5\u0259\x03\x02\x02\x02\xB7\u025B" + + "\x03\x02\x02\x02\xB9\u0264\x03\x02\x02\x02\xBB\u026E\x03\x02\x02\x02\xBD" + + "\u0270\x03\x02\x02\x02\xBF\u0277\x03\x02\x02\x02\xC1\u027B\x03\x02\x02" + + "\x02\xC3\u027E\x03\x02\x02\x02\xC5\u0284\x03\x02\x02\x02\xC7\u0289\x03" + + "\x02\x02\x02\xC9\u028B\x03\x02\x02\x02\xCB\u028E\x03\x02\x02\x02\xCD\u0296" + + "\x03\x02\x02\x02\xCF\u029F\x03\x02\x02\x02\xD1\u02A5\x03\x02\x02\x02\xD3" + + "\u02A8\x03\x02\x02\x02\xD5\u02AE\x03\x02\x02\x02\xD7\u02B1\x03\x02\x02" + + "\x02\xD9\u02B7\x03\x02\x02\x02\xDB\u02BA\x03\x02\x02\x02\xDD\u02C0\x03" + + "\x02\x02\x02\xDF\xE0\x071\x02\x02\xE0\xE1\x07,\x02\x02\xE1\xE5\x03\x02" + + "\x02\x02\xE2\xE4\v\x02\x02\x02\xE3\xE2\x03\x02\x02\x02\xE4\xE7\x03\x02" + + "\x02\x02\xE5\xE6\x03\x02\x02\x02\xE5\xE3\x03\x02\x02\x02\xE6\xE8\x03\x02" + + "\x02\x02\xE7\xE5\x03\x02\x02\x02\xE8\xE9\x07,\x02\x02\xE9\xEA\x071\x02" + + "\x02\xEA\xEB\x03\x02\x02\x02\xEB\xEC\b\x02\x02\x02\xEC\x06\x03\x02\x02" + + "\x02\xED\xEE\x071\x02\x02\xEE\xEF\x071\x02\x02\xEF\xF3\x03\x02\x02\x02" + + "\xF0\xF2\n\x02\x02\x02\xF1\xF0\x03\x02\x02\x02\xF2\xF5\x03\x02\x02\x02" + + "\xF3\xF1\x03\x02\x02\x02\xF3\xF4\x03\x02\x02\x02\xF4\xF6\x03\x02\x02\x02" + + "\xF5\xF3\x03\x02\x02\x02\xF6\xF7\b\x03\x02\x02\xF7\b\x03\x02\x02\x02\xF8" + + "\xF9\x07e\x02\x02\xF9\xFA\x07q\x02\x02\xFA\xFB\x07p\x02\x02\xFB\xFC\x07" + + "u\x02\x02\xFC\xFD\x07v\x02\x02\xFD\n\x03\x02\x02\x02\xFE\xFF\x07x\x02" + + "\x02\xFF\u0100\x07c\x02\x02\u0100\u0101\x07t\x02\x02\u0101\f\x03\x02\x02" + + "\x02\u0102\u0103\x07c\x02\x02\u0103\u0104\x07u\x02\x02\u0104\x0E\x03\x02" + + "\x02\x02\u0105\u0106\x070\x02\x02\u0106\u0107\x070\x02\x02\u0107\u0108" + + "\x070\x02\x02\u0108\x10\x03\x02\x02\x02\u0109\u010A\x07u\x02\x02\u010A" + + "\u010B\x07y\x02\x02\u010B\u010C\x07k\x02\x02\u010C\u010D\x07v\x02\x02" + + "\u010D\u010E\x07e\x02\x02\u010E\u010F\x07j\x02\x02\u010F\x12\x03\x02\x02" + + "\x02\u0110\u0111\x07e\x02\x02\u0111\u0112\x07c\x02\x02\u0112\u0113\x07" + + "u\x02\x02\u0113\u0114\x07g\x02\x02\u0114\x14\x03\x02\x02\x02\u0115\u0116" + + "\x07f\x02\x02\u0116\u0117\x07g\x02\x02\u0117\u0118\x07h\x02\x02\u0118" + + "\u0119\x07c\x02\x02\u0119\u011A\x07w\x02\x02\u011A\u011B\x07n\x02\x02" + + "\u011B\u011C\x07v\x02\x02\u011C\x16\x03\x02\x02\x02\u011D\u011E\x07d\x02" + + "\x02\u011E\u011F\x07t\x02\x02\u011F\u0120\x07g\x02\x02\u0120\u0121\x07" + + "c\x02\x02\u0121\u0122\x07m\x02\x02\u0122\x18\x03\x02\x02\x02\u0123\u0124" + + "\x07e\x02\x02\u0124\u0125\x07q\x02\x02\u0125\u0126\x07p\x02\x02\u0126" + + "\u0127\x07v\x02\x02\u0127\u0128\x07k\x02\x02\u0128\u0129\x07p\x02\x02" + + "\u0129\u012A\x07w\x02\x02\u012A\u012B\x07g\x02\x02\u012B\x1A\x03\x02\x02" + + "\x02\u012C\u012D\x07f\x02\x02\u012D\u012E\x07q\x02\x02\u012E\x1C\x03\x02" + + "\x02\x02\u012F\u0130\x07y\x02\x02\u0130\u0131\x07j\x02\x02\u0131\u0132" + + "\x07k\x02\x02\u0132\u0133\x07n\x02\x02\u0133\u0134\x07g\x02\x02\u0134" + + "\x1E\x03\x02\x02\x02\u0135\u0136\x07k\x02\x02\u0136\u0137\x07h\x02\x02" + + "\u0137 \x03\x02\x02\x02\u0138\u0139\x07g\x02\x02\u0139\u013A\x07n\x02" + + "\x02\u013A\u013B\x07u\x02\x02\u013B\u013C\x07g\x02\x02\u013C\"\x03\x02" + + "\x02\x02\u013D\u013E\x07h\x02\x02\u013E\u013F\x07q\x02\x02\u013F\u0140" + + "\x07t\x02\x02\u0140$\x03\x02\x02\x02\u0141\u0142\x07g\x02\x02\u0142\u0143" + + "\x07p\x02\x02\u0143\u0144\x07w\x02\x02\u0144\u0145\x07o\x02\x02\u0145" + + "&\x03\x02\x02\x02\u0146\u0147\x07f\x02\x02\u0147\u0148\x07g\x02\x02\u0148" + + "\u0149\x07h\x02\x02\u0149(\x03\x02\x02\x02\u014A\u014B\x07t\x02\x02\u014B" + + "\u014C\x07g\x02\x02\u014C\u014D\x07v\x02\x02\u014D\u014E\x07w\x02\x02" + + "\u014E\u014F\x07t\x02\x02\u014F\u0150\x07p\x02\x02\u0150*\x03\x02\x02" + + "\x02\u0151\u0152\x07e\x02\x02\u0152\u0153\x07c\x02\x02\u0153\u0154\x07" + + "n\x02\x02\u0154\u0155\x07n\x02\x02\u0155,\x03\x02\x02\x02\u0156\u0157" + + "\x07/\x02\x02\u0157\u0158\x07@\x02\x02\u0158.\x03\x02\x02\x02\u0159\u015A" + + "\x07e\x02\x02\u015A\u015B\x07n\x02\x02\u015B\u015C\x07c\x02\x02\u015C" + + "\u015D\x07u\x02\x02\u015D\u015E\x07u\x02\x02\u015E0\x03\x02\x02\x02\u015F" + + "\u0160\x07k\x02\x02\u0160\u0161\x07p\x02\x02\u0161\u0162\x07v\x02\x02" + + "\u0162\u0163\x07g\x02\x02\u0163\u0164\x07t\x02\x02\u0164\u0165\x07h\x02" + + "\x02\u0165\u0166\x07c\x02\x02\u0166\u0167\x07e\x02\x02\u0167\u0168\x07" + + "g\x02\x02\u01682\x03\x02\x02\x02\u0169\u016A\x07v\x02\x02\u016A\u016B" + + "\x07t\x02\x02\u016B\u016C\x07w\x02\x02\u016C\u016D\x07g\x02\x02\u016D" + + "4\x03\x02\x02\x02\u016E\u016F\x07h\x02\x02\u016F\u0170\x07c\x02\x02\u0170" + + "\u0171\x07n\x02\x02\u0171\u0172\x07u\x02\x02\u0172\u0173\x07g\x02\x02" + + "\u01736\x03\x02\x02\x02\u0174\u0175\x07v\x02\x02\u0175\u0176\x07{\x02" + + "\x02\u0176\u0177\x07r\x02\x02\u0177\u0178\x07g\x02\x02\u0178\u0179\x07" + + "q\x02\x02\u0179\u017A\x07h\x02\x02\u017A8\x03\x02\x02\x02\u017B\u017C" + + "\x07x\x02\x02\u017C\u017D\x07q\x02\x02\u017D\u017E\x07k\x02\x02\u017E" + + "\u017F\x07f\x02\x02\u017F:\x03\x02\x02\x02\u0180\u0181\x07p\x02\x02\u0181" + + "\u0182\x07w\x02\x02\u0182\u0183\x07n\x02\x02\u0183\u0184\x07n\x02\x02" + + "\u0184<\x03\x02\x02\x02\u0185\u0186\x07w\x02\x02\u0186\u0187\x07p\x02" + + "\x02\u0187\u0188\x07f\x02\x02\u0188\u0189\x07g\x02\x02\u0189\u018A\x07" + + "h\x02\x02\u018A\u018B\x07k\x02\x02\u018B\u018C\x07p\x02\x02\u018C\u018D" + + "\x07g\x02\x02\u018D\u018E\x07f\x02\x02\u018E>\x03\x02\x02\x02\u018F\u0190" + + "\x07.\x02\x02\u0190@\x03\x02\x02\x02\u0191\u0192\x07=\x02\x02\u0192B\x03" + + "\x02\x02\x02\u0193\u0194\x07A\x02\x02\u0194D\x03\x02\x02\x02\u0195\u0196" + + "\x07<\x02\x02\u0196F\x03\x02\x02\x02\u0197\u0198\x07*\x02\x02\u0198H\x03" + + "\x02\x02\x02\u0199\u019A\x07+\x02\x02\u019AJ\x03\x02\x02\x02\u019B\u019C" + + "\x07]\x02\x02\u019CL\x03\x02\x02\x02\u019D\u019E\x07_\x02\x02\u019EN\x03" + + "\x02\x02\x02\u019F\u01A0\x06\'\x02\x02\u01A0\u01A1\x07\x7F\x02\x02\u01A1" + + "\u01A2\x03\x02\x02\x02\u01A2\u01A3\b\'\x03\x02\u01A3P\x03\x02\x02\x02" + + "\u01A4\u01A5\x07}\x02\x02\u01A5R\x03\x02\x02\x02\u01A6\u01A7\x07\x7F\x02" + + "\x02\u01A7T\x03\x02\x02\x02\u01A8\u01A9\x07-\x02\x02\u01A9V\x03\x02\x02" + + "\x02\u01AA\u01AB\x07-\x02\x02\u01AB\u01AC\x07-\x02\x02\u01ACX\x03\x02" + + "\x02\x02\u01AD\u01AE\x07/\x02\x02\u01AEZ\x03\x02\x02\x02\u01AF\u01B0\x07" + + "/\x02\x02\u01B0\u01B1\x07/\x02\x02\u01B1\\\x03\x02\x02\x02\u01B2\u01B3" + + "\x07,\x02\x02\u01B3^\x03\x02\x02\x02\u01B4\u01B5\x071\x02\x02\u01B5`\x03" + + "\x02\x02\x02\u01B6\u01B7\x07\'\x02\x02\u01B7b\x03\x02\x02\x02\u01B8\u01B9" + + "\x07,\x02\x02\u01B9\u01BA\x07,\x02\x02\u01BAd\x03\x02\x02\x02\u01BB\u01BC" + + "\x07(\x02\x02\u01BC\u01BD\x07(\x02\x02\u01BDf\x03\x02\x02\x02\u01BE\u01BF" + + "\x07~\x02\x02\u01BF\u01C0\x07~\x02\x02\u01C0h\x03\x02\x02\x02\u01C1\u01C2" + + "\x07#\x02\x02\u01C2j\x03\x02\x02\x02\u01C3\u01C4\x07?\x02\x02\u01C4l\x03" + + "\x02\x02\x02\u01C5\u01C6\x07-\x02\x02\u01C6\u01C7\x07?\x02\x02\u01C7n" + + "\x03\x02\x02\x02\u01C8\u01C9\x07/\x02\x02\u01C9\u01CA\x07?\x02\x02\u01CA" + + "p\x03\x02\x02\x02\u01CB\u01CC\x07,\x02\x02\u01CC\u01CD\x07?\x02\x02\u01CD" + + "r\x03\x02\x02\x02\u01CE\u01CF\x071\x02\x02\u01CF\u01D0\x07?\x02\x02\u01D0" + + "t\x03\x02\x02\x02\u01D1\u01D2\x07\'\x02\x02\u01D2\u01D3\x07?\x02\x02\u01D3" + + "v\x03\x02\x02\x02\u01D4\u01D5\x07?\x02\x02\u01D5\u01D6\x07?\x02\x02\u01D6" + + "x\x03\x02\x02\x02\u01D7\u01D8\x07#\x02\x02\u01D8\u01D9\x07?\x02\x02\u01D9" + + "z\x03\x02\x02\x02\u01DA\u01DB\x07>\x02\x02\u01DB|\x03\x02\x02\x02\u01DC" + + "\u01DD\x07>\x02\x02\u01DD\u01DE\x07?\x02\x02\u01DE~\x03\x02\x02\x02\u01DF" + + "\u01E0\x07@\x02\x02\u01E0\x80\x03\x02\x02\x02\u01E1\u01E2\x07@\x02\x02" + + "\u01E2\u01E3\x07?\x02\x02\u01E3\x82\x03\x02\x02\x02\u01E4\u01E5\x070\x02" + + "\x02\u01E5\x84\x03\x02\x02\x02\u01E6\u01EB\x05\xA3Q\x02\u01E7\u01EA\x05" + + "\xA3Q\x02\u01E8\u01EA\x05\xA7S\x02\u01E9\u01E7\x03\x02\x02\x02\u01E9\u01E8" + + "\x03\x02\x02\x02\u01EA\u01ED\x03\x02\x02\x02\u01EB\u01E9\x03\x02\x02\x02" + + "\u01EB\u01EC\x03\x02\x02\x02\u01EC\x86\x03\x02\x02\x02\u01ED\u01EB\x03" + + "\x02\x02\x02\u01EE\u01F3\x05\xA9T\x02\u01EF\u01F3\x05\xADV\x02\u01F0\u01F3" + + "\x05\xAFW\x02\u01F1\u01F3\x05\xABU\x02\u01F2\u01EE\x03\x02\x02\x02\u01F2" + + "\u01EF\x03\x02\x02\x02\u01F2\u01F0\x03\x02\x02\x02\u01F2\u01F1\x03\x02" + + "\x02\x02\u01F3\x88\x03\x02\x02\x02\u01F4\u01F6\x07)\x02\x02\u01F5\u01F7" + + "\x05\xD7k\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\x8A\x03\x02" + + "\x02\x02\u01FA\u01FC\x07$\x02\x02\u01FB\u01FD\x05\xDBm\x02\u01FC\u01FB" + + "\x03\x02\x02\x02\u01FC\u01FD\x03\x02\x02\x02\u01FD\u01FE\x03\x02\x02\x02" + + "\u01FE\u01FF\x07$\x02\x02\u01FF\x8C\x03\x02\x02\x02\u0200\u0201\x05\xB9" + + "\\\x02\u0201\x8E\x03\x02\x02\x02\u0202\u0204\t\x03\x02\x02\u0203\u0202" + + "\x03\x02\x02\x02\u0204\u0205\x03\x02\x02\x02\u0205\u0203\x03\x02\x02\x02" + + "\u0205\u0206\x03\x02\x02\x02\u0206\u0207\x03\x02\x02\x02\u0207\u0208\b" + + "G\x04\x02\u0208\x90\x03\x02\x02\x02\u0209\u020A\t\x02\x02\x02\u020A\u020B" + + "\x03\x02\x02\x02\u020B\u020C\bH\x04\x02\u020C\x92\x03\x02\x02\x02\u020D" + + "\u020E\x07h\x02\x02\u020E\u020F\x07)\x02\x02\u020F\u0210\x03\x02\x02\x02" + + "\u0210\u0211\bI\x05\x02\u0211\u0212\x03\x02\x02\x02\u0212\u0213\bI\x06" + + "\x02\u0213\x94\x03\x02\x02"; private static readonly _serializedATNSegment1: string = - "M\f\x02\u021C\u021D\x03\x02\x02\x02\u021D\u021E\bM\x03\x02\u021E\x9C\x03" + - "\x02\x02\x02\u021F\u0220\x05\xCFg\x02\u0220\x9E\x03\x02\x02\x02\u0221" + - "\u0222\x05\xA1P\x02\u0222\xA0\x03\x02\x02\x02\u0223\u0224\t\x04\x02\x02" + - "\u0224\xA2\x03\x02\x02\x02\u0225\u0226\t\x05\x02\x02\u0226\xA4\x03\x02" + - "\x02\x02\u0227\u0229\x05\xA3Q\x02\u0228\u0227\x03\x02\x02\x02\u0229\u022A" + - "\x03\x02\x02\x02\u022A\u0228\x03\x02\x02\x02\u022A\u022B\x03\x02\x02\x02" + - "\u022B\xA6\x03\x02\x02\x02\u022C\u022D\x072\x02\x02\u022D\u022F\t\x06" + - "\x02\x02\u022E\u0230\x05\xAFW\x02\u022F\u022E\x03\x02\x02\x02\u0230\u0231" + - "\x03\x02\x02\x02\u0231\u022F\x03\x02\x02\x02\u0231\u0232\x03\x02\x02\x02" + - "\u0232\xA8\x03\x02\x02\x02\u0233\u0234\x072\x02\x02\u0234\u0236\t\x07" + - "\x02\x02\u0235\u0237\x05\xB1X\x02\u0236\u0235\x03\x02\x02\x02\u0237\u0238" + - "\x03\x02\x02\x02\u0238\u0236\x03\x02\x02\x02\u0238\u0239\x03\x02\x02\x02" + - "\u0239\xAA\x03\x02\x02\x02\u023A\u023B\x072\x02\x02\u023B\u023D\t\b\x02" + - "\x02\u023C\u023E\x05\xB3Y\x02\u023D\u023C\x03\x02\x02\x02\u023E\u023F" + - "\x03\x02\x02\x02\u023F\u023D\x03\x02\x02\x02\u023F\u0240\x03\x02\x02\x02" + - "\u0240\xAC\x03\x02\x02\x02\u0241\u0242\t\t\x02\x02\u0242\xAE\x03\x02\x02" + - "\x02\u0243\u0244\t\n\x02\x02\u0244\xB0\x03\x02\x02\x02\u0245\u0246\t\v" + - "\x02\x02\u0246\xB2\x03\x02\x02\x02\u0247\u0248\t\f\x02\x02\u0248\xB4\x03" + - "\x02\x02\x02\u0249\u024B\x05\xB7[\x02\u024A\u024C\x05\xB9\\\x02\u024B" + - "\u024A\x03\x02\x02\x02\u024B\u024C\x03\x02\x02\x02\u024C\u0251\x03\x02" + - "\x02\x02\u024D\u024E\x05\xBB]\x02\u024E\u024F\x05\xB9\\\x02\u024F\u0251" + - "\x03\x02\x02\x02\u0250\u0249\x03\x02\x02\x02\u0250\u024D\x03\x02\x02\x02" + - "\u0251\xB6\x03\x02\x02\x02\u0252\u0254\x05\xBB]\x02\u0253\u0252\x03\x02" + - "\x02\x02\u0253\u0254\x03\x02\x02\x02\u0254\u0255\x03\x02\x02\x02\u0255" + - "\u0256\x070\x02\x02\u0256\u025B\x05\xBB]\x02\u0257\u0258\x05\xBB]\x02" + - "\u0258\u0259\x070\x02\x02\u0259\u025B\x03\x02\x02\x02\u025A\u0253\x03" + - "\x02\x02\x02\u025A\u0257\x03\x02\x02\x02\u025B\xB8\x03\x02\x02\x02\u025C" + - "\u025E\t\r\x02\x02\u025D\u025F\x05\xBD^\x02\u025E\u025D\x03\x02\x02\x02" + - "\u025E\u025F\x03\x02\x02\x02\u025F\u0260\x03\x02\x02\x02\u0260\u0261\x05" + - "\xBB]\x02\u0261\xBA\x03\x02\x02\x02\u0262\u0264\x05\xA3Q\x02\u0263\u0262" + - "\x03\x02\x02\x02\u0264\u0265\x03\x02\x02\x02\u0265\u0263\x03\x02\x02\x02" + - "\u0265\u0266\x03\x02\x02\x02\u0266\xBC\x03\x02\x02\x02\u0267\u0268\t\x0E" + - "\x02\x02\u0268\xBE\x03\x02\x02\x02\u0269\u026B\x05\xC1`\x02\u026A\u0269" + - "\x03\x02\x02\x02\u026B\u026C\x03\x02\x02\x02\u026C\u026A\x03\x02\x02\x02" + - "\u026C\u026D\x03\x02\x02\x02\u026D\xC0\x03\x02\x02\x02\u026E\u0271\n\x0F" + - "\x02\x02\u026F\u0271\x05\xC3a\x02\u0270\u026E\x03\x02\x02\x02\u0270\u026F" + - "\x03\x02\x02\x02\u0271\xC2\x03\x02\x02\x02\u0272\u0276\x05\xC5b\x02\u0273" + - "\u0276\x05\xC7c\x02\u0274\u0276\x05\xC9d\x02\u0275\u0272\x03\x02\x02\x02" + - "\u0275\u0273\x03\x02\x02\x02\u0275\u0274\x03\x02\x02\x02\u0276\xC4\x03" + - "\x02\x02\x02\u0277\u0278\x07^\x02\x02\u0278\u0279\t\x10\x02\x02\u0279" + - "\xC6\x03\x02\x02\x02\u027A\u027B\x07^\x02\x02\u027B\u027D\x05\xB1X\x02" + - "\u027C\u027E\x05\xB1X\x02\u027D\u027C\x03\x02\x02\x02\u027D\u027E\x03" + - "\x02\x02\x02\u027E\u0280\x03\x02\x02\x02\u027F\u0281\x05\xB1X\x02\u0280" + - "\u027F\x03\x02\x02\x02\u0280\u0281\x03\x02\x02\x02\u0281\xC8\x03\x02\x02" + - "\x02\u0282\u0283\x07^\x02\x02\u0283\u0284\x07z\x02\x02\u0284\u0286\x03" + - "\x02\x02\x02\u0285\u0287\x05\xB3Y\x02\u0286\u0285\x03\x02\x02\x02\u0287" + - "\u0288\x03\x02\x02\x02\u0288\u0286\x03\x02\x02\x02\u0288\u0289\x03\x02" + - "\x02\x02\u0289\xCA\x03\x02\x02\x02\u028A\u028C\x05\xCDf\x02\u028B\u028A" + - "\x03\x02\x02\x02\u028C\u028D\x03\x02\x02\x02\u028D\u028B\x03\x02\x02\x02" + - "\u028D\u028E\x03\x02\x02\x02\u028E\xCC\x03\x02\x02\x02\u028F\u0292\n\x11" + - "\x02\x02\u0290\u0292\x05\xC3a\x02\u0291\u028F\x03\x02\x02\x02\u0291\u0290" + - "\x03\x02\x02\x02\u0292\xCE\x03\x02\x02\x02\u0293\u0295\x05\xD1h\x02\u0294" + - "\u0293\x03\x02\x02\x02\u0295\u0296\x03\x02\x02\x02\u0296\u0294\x03\x02" + - "\x02\x02\u0296\u0297\x03\x02\x02\x02\u0297\xD0\x03\x02\x02\x02\u0298\u029B" + - "\n\x12\x02\x02\u0299\u029B\x05\xC3a\x02\u029A\u0298\x03\x02\x02\x02\u029A" + - "\u0299\x03\x02\x02\x02\u029B\xD2\x03\x02\x02\x02\u029C\u029E\x05\xD5j" + - "\x02\u029D\u029C\x03\x02\x02\x02\u029E\u029F\x03\x02\x02\x02\u029F\u029D" + - "\x03\x02\x02\x02\u029F\u02A0\x03\x02\x02\x02\u02A0\xD4\x03\x02\x02\x02" + - "\u02A1\u02A4\n\x0F\x02\x02\u02A2\u02A4\x05\xC3a\x02\u02A3\u02A1\x03\x02" + - "\x02\x02\u02A3\u02A2\x03\x02\x02\x02\u02A4\xD6\x03\x02\x02\x02\u02A5\u02A7" + - "\x05\xD9l\x02\u02A6\u02A5\x03\x02\x02\x02\u02A7\u02A8\x03\x02\x02\x02" + - "\u02A8\u02A6\x03\x02\x02\x02\u02A8\u02A9\x03\x02\x02\x02\u02A9\xD8\x03" + - "\x02\x02\x02\u02AA\u02AD\n\x13\x02\x02\u02AB\u02AD\x05\xC3a\x02\u02AC" + - "\u02AA\x03\x02\x02\x02\u02AC\u02AB\x03\x02\x02\x02\u02AD\xDA\x03\x02\x02" + - "\x02%\x02\x03\x04\xE1\xEF\u01D5\u01D7\u01DE\u01E2\u01E8\u01F1\u022A\u0231" + - "\u0238\u023F\u024B\u0250\u0253\u025A\u025E\u0265\u026C\u0270\u0275\u027D" + - "\u0280\u0288\u028D\u0291\u0296\u029A\u029F\u02A3\u02A8\u02AC\r\x02\x04" + - "\x02\x06\x02\x02\x02\x03\x02\x03G\x02\x07\x03\x02\x03H\x03\x07\x04\x02" + - "\t\x03\x02\x07\x02\x02\x03J\x04\x03M\x05"; + "\x02\u0214\u0215\x07h\x02\x02\u0215\u0216\x07$\x02\x02\u0216\u0217\x03" + + "\x02\x02\x02\u0217\u0218\bJ\x07\x02\u0218\u0219\x03\x02\x02\x02\u0219" + + "\u021A\bJ\b\x02\u021A\x96\x03\x02\x02\x02\u021B\u021C\x06K\x03\x02\u021C" + + "\u021D\x07}\x02\x02\u021D\u021E\x03\x02\x02\x02\u021E\u021F\bK\t\x02\u021F" + + "\u0220\bK\n\x02\u0220\x98\x03\x02\x02\x02\u0221\u0222\x07)\x02\x02\u0222" + + "\u0223\bL\v\x02\u0223\u0224\x03\x02\x02\x02\u0224\u0225\bL\x03\x02\u0225" + + "\x9A\x03\x02\x02\x02\u0226\u0227\x05\xCFg\x02\u0227\x9C\x03\x02\x02\x02" + + "\u0228\u0229\x06N\x04\x02\u0229\u022A\x07}\x02\x02\u022A\u022B\x03\x02" + + "\x02\x02\u022B\u022C\bN\t\x02\u022C\u022D\bN\n\x02\u022D\x9E\x03\x02\x02" + + "\x02\u022E\u022F\x07$\x02\x02\u022F\u0230\bO\f\x02\u0230\u0231\x03\x02" + + "\x02\x02\u0231\u0232\bO\x03\x02\u0232\xA0\x03\x02\x02\x02\u0233\u0234" + + "\x05\xD3i\x02\u0234\xA2\x03\x02\x02\x02\u0235\u0236\x05\xA5R\x02\u0236" + + "\xA4\x03\x02\x02\x02\u0237\u0238\t\x04\x02\x02\u0238\xA6\x03\x02\x02\x02" + + "\u0239\u023A\t\x05\x02\x02\u023A\xA8\x03\x02\x02\x02\u023B\u023D\x05\xA7" + + "S\x02\u023C\u023B\x03\x02\x02\x02\u023D\u023E\x03\x02\x02\x02\u023E\u023C" + + "\x03\x02\x02\x02\u023E\u023F\x03\x02\x02\x02\u023F\xAA\x03\x02\x02\x02" + + "\u0240\u0241\x072\x02\x02\u0241\u0243\t\x06\x02\x02\u0242\u0244\x05\xB3" + + "Y\x02\u0243\u0242\x03\x02\x02\x02\u0244\u0245\x03\x02\x02\x02\u0245\u0243" + + "\x03\x02\x02\x02\u0245\u0246\x03\x02\x02\x02\u0246\xAC\x03\x02\x02\x02" + + "\u0247\u0248\x072\x02\x02\u0248\u024A\t\x07\x02\x02\u0249\u024B\x05\xB5" + + "Z\x02\u024A\u0249\x03\x02\x02\x02\u024B\u024C\x03\x02\x02\x02\u024C\u024A" + + "\x03\x02\x02\x02\u024C\u024D\x03\x02\x02\x02\u024D\xAE\x03\x02\x02\x02" + + "\u024E\u024F\x072\x02\x02\u024F\u0251\t\b\x02\x02\u0250\u0252\x05\xB7" + + "[\x02\u0251\u0250\x03\x02\x02\x02\u0252\u0253\x03\x02\x02\x02\u0253\u0251" + + "\x03\x02\x02\x02\u0253\u0254\x03\x02\x02\x02\u0254\xB0\x03\x02\x02\x02" + + "\u0255\u0256\t\t\x02\x02\u0256\xB2\x03\x02\x02\x02\u0257\u0258\t\n\x02" + + "\x02\u0258\xB4\x03\x02\x02\x02\u0259\u025A\t\v\x02\x02\u025A\xB6\x03\x02" + + "\x02\x02\u025B\u025C\t\f\x02\x02\u025C\xB8\x03\x02\x02\x02\u025D\u025F" + + "\x05\xBB]\x02\u025E\u0260\x05\xBD^\x02\u025F\u025E\x03\x02\x02\x02\u025F" + + "\u0260\x03\x02\x02\x02\u0260\u0265\x03\x02\x02\x02\u0261\u0262\x05\xBF" + + "_\x02\u0262\u0263\x05\xBD^\x02\u0263\u0265\x03\x02\x02\x02\u0264\u025D" + + "\x03\x02\x02\x02\u0264\u0261\x03\x02\x02\x02\u0265\xBA\x03\x02\x02\x02" + + "\u0266\u0268\x05\xBF_\x02\u0267\u0266\x03\x02\x02\x02\u0267\u0268\x03" + + "\x02\x02\x02\u0268\u0269\x03\x02\x02\x02\u0269\u026A\x070\x02\x02\u026A" + + "\u026F\x05\xBF_\x02\u026B\u026C\x05\xBF_\x02\u026C\u026D\x070\x02\x02" + + "\u026D\u026F\x03\x02\x02\x02\u026E\u0267\x03\x02\x02\x02\u026E\u026B\x03" + + "\x02\x02\x02\u026F\xBC\x03\x02\x02\x02\u0270\u0272\t\r\x02\x02\u0271\u0273" + + "\x05\xC1`\x02\u0272\u0271\x03\x02\x02\x02\u0272\u0273\x03\x02\x02\x02" + + "\u0273\u0274\x03\x02\x02\x02\u0274\u0275\x05\xBF_\x02\u0275\xBE\x03\x02" + + "\x02\x02\u0276\u0278\x05\xA7S\x02\u0277\u0276\x03\x02\x02\x02\u0278\u0279" + + "\x03\x02\x02\x02\u0279\u0277\x03\x02\x02\x02\u0279\u027A\x03\x02\x02\x02" + + "\u027A\xC0\x03\x02\x02\x02\u027B\u027C\t\x0E\x02\x02\u027C\xC2\x03\x02" + + "\x02\x02\u027D\u027F\x05\xC5b\x02\u027E\u027D\x03\x02\x02\x02\u027F\u0280" + + "\x03\x02\x02\x02\u0280\u027E\x03\x02\x02\x02\u0280\u0281\x03\x02\x02\x02" + + "\u0281\xC4\x03\x02\x02\x02\u0282\u0285\n\x0F\x02\x02\u0283\u0285\x05\xC7" + + "c\x02\u0284\u0282\x03\x02\x02\x02\u0284\u0283\x03\x02\x02\x02\u0285\xC6" + + "\x03\x02\x02\x02\u0286\u028A\x05\xC9d\x02\u0287\u028A\x05\xCBe\x02\u0288" + + "\u028A\x05\xCDf\x02\u0289\u0286\x03\x02\x02\x02\u0289\u0287\x03\x02\x02" + + "\x02\u0289\u0288\x03\x02\x02\x02\u028A\xC8\x03\x02\x02\x02\u028B\u028C" + + "\x07^\x02\x02\u028C\u028D\t\x10\x02\x02\u028D\xCA\x03\x02\x02\x02\u028E" + + "\u028F\x07^\x02\x02\u028F\u0291\x05\xB5Z\x02\u0290\u0292\x05\xB5Z\x02" + + "\u0291\u0290\x03\x02\x02\x02\u0291\u0292\x03\x02\x02\x02\u0292\u0294\x03" + + "\x02\x02\x02\u0293\u0295\x05\xB5Z\x02\u0294\u0293\x03\x02\x02\x02\u0294" + + "\u0295\x03\x02\x02\x02\u0295\xCC\x03\x02\x02\x02\u0296\u0297\x07^\x02" + + "\x02\u0297\u0298\x07z\x02\x02\u0298\u029A\x03\x02\x02\x02\u0299\u029B" + + "\x05\xB7[\x02\u029A\u0299\x03\x02\x02\x02\u029B\u029C\x03\x02\x02\x02" + + "\u029C\u029A\x03\x02\x02\x02\u029C\u029D\x03\x02\x02\x02\u029D\xCE\x03" + + "\x02\x02\x02\u029E\u02A0\x05\xD1h\x02\u029F\u029E\x03\x02\x02\x02\u02A0" + + "\u02A1\x03\x02\x02\x02\u02A1\u029F\x03\x02\x02\x02\u02A1\u02A2\x03\x02" + + "\x02\x02\u02A2\xD0\x03\x02\x02\x02\u02A3\u02A6\n\x11\x02\x02\u02A4\u02A6" + + "\x05\xC7c\x02\u02A5\u02A3\x03\x02\x02\x02\u02A5\u02A4\x03\x02\x02\x02" + + "\u02A6\xD2\x03\x02\x02\x02\u02A7\u02A9\x05\xD5j\x02\u02A8\u02A7\x03\x02" + + "\x02\x02\u02A9\u02AA\x03\x02\x02\x02\u02AA\u02A8\x03\x02\x02\x02\u02AA" + + "\u02AB\x03\x02\x02\x02\u02AB\xD4\x03\x02\x02\x02\u02AC\u02AF\n\x12\x02" + + "\x02\u02AD\u02AF\x05\xC7c\x02\u02AE\u02AC\x03\x02\x02\x02\u02AE\u02AD" + + "\x03\x02\x02\x02\u02AF\xD6\x03\x02\x02\x02\u02B0\u02B2\x05\xD9l\x02\u02B1" + + "\u02B0\x03\x02\x02\x02\u02B2\u02B3\x03\x02\x02\x02\u02B3\u02B1\x03\x02" + + "\x02\x02\u02B3\u02B4\x03\x02\x02\x02\u02B4\xD8\x03\x02\x02\x02\u02B5\u02B8" + + "\n\x0F\x02\x02\u02B6\u02B8\x05\xC7c\x02\u02B7\u02B5\x03\x02\x02\x02\u02B7" + + "\u02B6\x03\x02\x02\x02\u02B8\xDA\x03\x02\x02\x02\u02B9\u02BB\x05\xDDn" + + "\x02\u02BA\u02B9\x03\x02\x02\x02\u02BB\u02BC\x03\x02\x02\x02\u02BC\u02BA" + + "\x03\x02\x02\x02\u02BC\u02BD\x03\x02\x02\x02\u02BD\xDC\x03\x02\x02\x02" + + "\u02BE\u02C1\n\x13\x02\x02\u02BF\u02C1\x05\xC7c\x02\u02C0\u02BE\x03\x02" + + "\x02\x02\u02C0\u02BF\x03\x02\x02\x02\u02C1\xDE\x03\x02\x02\x02%\x02\x03" + + "\x04\xE5\xF3\u01E9\u01EB\u01F2\u01F6\u01FC\u0205\u023E\u0245\u024C\u0253" + + "\u025F\u0264\u0267\u026E\u0272\u0279\u0280\u0284\u0289\u0291\u0294\u029C" + + "\u02A1\u02A5\u02AA\u02AE\u02B3\u02B7\u02BC\u02C0\r\x02\x04\x02\x06\x02" + + "\x02\x02\x03\x02\x03I\x02\x07\x03\x02\x03J\x03\x07\x04\x02\t\x03\x02\x07" + + "\x02\x02\x03L\x04\x03O\x05"; public static readonly _serializedATN: string = Utils.join( - [KipperLexer._serializedATNSegment0, KipperLexer._serializedATNSegment1], + [ + KipperLexer._serializedATNSegment0, + KipperLexer._serializedATNSegment1, + ], "", ); public static __ATN: ATN; @@ -821,4 +624,6 @@ export class KipperLexer extends KipperLexerBase { return KipperLexer.__ATN; } + } + diff --git a/kipper/core/src/compiler/parser/antlr/KipperParser.interp b/kipper/core/src/compiler/parser/antlr/KipperParser.interp index 799bc6ad9..f6dd18f2e 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParser.interp +++ b/kipper/core/src/compiler/parser/antlr/KipperParser.interp @@ -22,6 +22,8 @@ null 'return' 'call' '->' +'class' +'interface' 'true' 'false' 'typeof' @@ -101,6 +103,8 @@ DefFunc Return CallFunc RetIndicator +Class +Interface True False Typeof @@ -163,15 +167,17 @@ externalItem blockItemList blockItem declaration -functionDeclaration variableDeclaration storageTypeSpecifier +initDeclarator +initializer declarator directDeclarator -initDeclarator +functionDeclaration parameterList parameterDeclaration -initializer +interfaceDeclaration +classDeclaration statement compoundStatement expressionStatement @@ -231,4 +237,4 @@ typeSpecifierIdentifier atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 78, 634, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 3, 2, 5, 2, 146, 10, 2, 3, 2, 3, 2, 3, 3, 6, 3, 151, 10, 3, 13, 3, 14, 3, 152, 3, 4, 3, 4, 3, 5, 6, 5, 158, 10, 5, 13, 5, 14, 5, 159, 3, 6, 3, 6, 3, 6, 5, 6, 165, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 172, 10, 7, 5, 7, 174, 10, 7, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 180, 10, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 186, 10, 8, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 5, 13, 202, 10, 13, 3, 14, 3, 14, 3, 14, 7, 14, 207, 10, 14, 12, 14, 14, 14, 210, 11, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 5, 17, 224, 10, 17, 3, 18, 3, 18, 3, 18, 5, 18, 229, 10, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 5, 20, 240, 10, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 5, 21, 249, 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 7, 22, 257, 10, 22, 12, 22, 14, 22, 260, 11, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 272, 10, 23, 3, 24, 3, 24, 3, 24, 5, 24, 277, 10, 24, 3, 25, 3, 25, 3, 25, 3, 25, 5, 25, 283, 10, 25, 3, 25, 3, 25, 5, 25, 287, 10, 25, 3, 25, 3, 25, 3, 25, 3, 25, 5, 25, 293, 10, 25, 3, 25, 3, 25, 3, 25, 3, 25, 5, 25, 299, 10, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 5, 29, 323, 10, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 336, 10, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 5, 35, 350, 10, 35, 3, 36, 3, 36, 3, 37, 3, 37, 7, 37, 356, 10, 37, 12, 37, 14, 37, 359, 11, 37, 3, 37, 3, 37, 3, 37, 7, 37, 364, 10, 37, 12, 37, 14, 37, 367, 11, 37, 3, 37, 5, 37, 370, 10, 37, 3, 38, 3, 38, 3, 38, 5, 38, 375, 10, 38, 3, 38, 5, 38, 378, 10, 38, 3, 39, 3, 39, 3, 39, 5, 39, 383, 10, 39, 3, 39, 5, 39, 386, 10, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 7, 41, 394, 10, 41, 12, 41, 14, 41, 397, 11, 41, 5, 41, 399, 10, 41, 3, 41, 5, 41, 402, 10, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 42, 7, 42, 410, 10, 42, 12, 42, 14, 42, 413, 11, 42, 5, 42, 415, 10, 42, 3, 42, 5, 42, 418, 10, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 5, 45, 434, 10, 45, 3, 45, 3, 45, 3, 45, 5, 45, 439, 10, 45, 3, 45, 3, 45, 3, 45, 5, 45, 444, 10, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 7, 45, 460, 10, 45, 12, 45, 14, 45, 463, 11, 45, 3, 46, 3, 46, 3, 46, 7, 46, 468, 10, 46, 12, 46, 14, 46, 471, 11, 46, 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 5, 49, 484, 10, 49, 3, 49, 3, 49, 3, 49, 3, 49, 5, 49, 490, 10, 49, 3, 49, 3, 49, 3, 50, 3, 50, 5, 50, 496, 10, 50, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 5, 52, 504, 10, 52, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 57, 3, 57, 5, 57, 521, 10, 57, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 3, 58, 7, 58, 529, 10, 58, 12, 58, 14, 58, 532, 11, 58, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 7, 59, 540, 10, 59, 12, 59, 14, 59, 543, 11, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 7, 60, 551, 10, 60, 12, 60, 14, 60, 554, 11, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 7, 61, 562, 10, 61, 12, 61, 14, 61, 565, 11, 61, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 7, 62, 573, 10, 62, 12, 62, 14, 62, 576, 11, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 7, 63, 584, 10, 63, 12, 63, 14, 63, 587, 11, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 5, 64, 596, 10, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 5, 65, 603, 10, 65, 3, 66, 3, 66, 3, 67, 3, 67, 3, 67, 7, 67, 610, 10, 67, 12, 67, 14, 67, 613, 11, 67, 3, 68, 3, 68, 3, 68, 5, 68, 618, 10, 68, 3, 69, 3, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 72, 3, 72, 3, 72, 2, 2, 9, 88, 114, 116, 118, 120, 122, 124, 73, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 70, 2, 72, 2, 74, 2, 76, 2, 78, 2, 80, 2, 82, 2, 84, 2, 86, 2, 88, 2, 90, 2, 92, 2, 94, 2, 96, 2, 98, 2, 100, 2, 102, 2, 104, 2, 106, 2, 108, 2, 110, 2, 112, 2, 114, 2, 116, 2, 118, 2, 120, 2, 122, 2, 124, 2, 126, 2, 128, 2, 130, 2, 132, 2, 134, 2, 136, 2, 138, 2, 140, 2, 142, 2, 2, 16, 3, 2, 6, 7, 3, 2, 13, 14, 3, 2, 25, 26, 3, 2, 68, 69, 4, 2, 67, 67, 70, 70, 3, 2, 28, 30, 4, 2, 43, 43, 45, 45, 5, 2, 42, 42, 44, 44, 52, 52, 3, 2, 46, 49, 4, 2, 42, 42, 44, 44, 3, 2, 61, 64, 3, 2, 59, 60, 3, 2, 53, 58, 4, 2, 28, 30, 66, 66, 2, 637, 2, 145, 3, 2, 2, 2, 4, 150, 3, 2, 2, 2, 6, 154, 3, 2, 2, 2, 8, 157, 3, 2, 2, 2, 10, 164, 3, 2, 2, 2, 12, 173, 3, 2, 2, 2, 14, 175, 3, 2, 2, 2, 16, 187, 3, 2, 2, 2, 18, 190, 3, 2, 2, 2, 20, 192, 3, 2, 2, 2, 22, 194, 3, 2, 2, 2, 24, 196, 3, 2, 2, 2, 26, 203, 3, 2, 2, 2, 28, 211, 3, 2, 2, 2, 30, 215, 3, 2, 2, 2, 32, 223, 3, 2, 2, 2, 34, 225, 3, 2, 2, 2, 36, 232, 3, 2, 2, 2, 38, 239, 3, 2, 2, 2, 40, 241, 3, 2, 2, 2, 42, 250, 3, 2, 2, 2, 44, 271, 3, 2, 2, 2, 46, 276, 3, 2, 2, 2, 48, 278, 3, 2, 2, 2, 50, 303, 3, 2, 2, 2, 52, 309, 3, 2, 2, 2, 54, 317, 3, 2, 2, 2, 56, 320, 3, 2, 2, 2, 58, 335, 3, 2, 2, 2, 60, 337, 3, 2, 2, 2, 62, 341, 3, 2, 2, 2, 64, 343, 3, 2, 2, 2, 66, 345, 3, 2, 2, 2, 68, 349, 3, 2, 2, 2, 70, 351, 3, 2, 2, 2, 72, 369, 3, 2, 2, 2, 74, 377, 3, 2, 2, 2, 76, 385, 3, 2, 2, 2, 78, 387, 3, 2, 2, 2, 80, 389, 3, 2, 2, 2, 82, 405, 3, 2, 2, 2, 84, 421, 3, 2, 2, 2, 86, 425, 3, 2, 2, 2, 88, 438, 3, 2, 2, 2, 90, 464, 3, 2, 2, 2, 92, 472, 3, 2, 2, 2, 94, 475, 3, 2, 2, 2, 96, 479, 3, 2, 2, 2, 98, 495, 3, 2, 2, 2, 100, 497, 3, 2, 2, 2, 102, 503, 3, 2, 2, 2, 104, 505, 3, 2, 2, 2, 106, 508, 3, 2, 2, 2, 108, 511, 3, 2, 2, 2, 110, 513, 3, 2, 2, 2, 112, 520, 3, 2, 2, 2, 114, 522, 3, 2, 2, 2, 116, 533, 3, 2, 2, 2, 118, 544, 3, 2, 2, 2, 120, 555, 3, 2, 2, 2, 122, 566, 3, 2, 2, 2, 124, 577, 3, 2, 2, 2, 126, 595, 3, 2, 2, 2, 128, 602, 3, 2, 2, 2, 130, 604, 3, 2, 2, 2, 132, 606, 3, 2, 2, 2, 134, 617, 3, 2, 2, 2, 136, 619, 3, 2, 2, 2, 138, 621, 3, 2, 2, 2, 140, 626, 3, 2, 2, 2, 142, 631, 3, 2, 2, 2, 144, 146, 5, 4, 3, 2, 145, 144, 3, 2, 2, 2, 145, 146, 3, 2, 2, 2, 146, 147, 3, 2, 2, 2, 147, 148, 7, 2, 2, 3, 148, 3, 3, 2, 2, 2, 149, 151, 5, 6, 4, 2, 150, 149, 3, 2, 2, 2, 151, 152, 3, 2, 2, 2, 152, 150, 3, 2, 2, 2, 152, 153, 3, 2, 2, 2, 153, 5, 3, 2, 2, 2, 154, 155, 5, 8, 5, 2, 155, 7, 3, 2, 2, 2, 156, 158, 5, 10, 6, 2, 157, 156, 3, 2, 2, 2, 158, 159, 3, 2, 2, 2, 159, 157, 3, 2, 2, 2, 159, 160, 3, 2, 2, 2, 160, 9, 3, 2, 2, 2, 161, 165, 5, 32, 17, 2, 162, 165, 5, 12, 7, 2, 163, 165, 7, 32, 2, 2, 164, 161, 3, 2, 2, 2, 164, 162, 3, 2, 2, 2, 164, 163, 3, 2, 2, 2, 165, 11, 3, 2, 2, 2, 166, 167, 5, 16, 9, 2, 167, 168, 7, 32, 2, 2, 168, 174, 3, 2, 2, 2, 169, 171, 5, 14, 8, 2, 170, 172, 7, 32, 2, 2, 171, 170, 3, 2, 2, 2, 171, 172, 3, 2, 2, 2, 172, 174, 3, 2, 2, 2, 173, 166, 3, 2, 2, 2, 173, 169, 3, 2, 2, 2, 174, 13, 3, 2, 2, 2, 175, 176, 7, 21, 2, 2, 176, 177, 5, 20, 11, 2, 177, 179, 7, 35, 2, 2, 178, 180, 5, 26, 14, 2, 179, 178, 3, 2, 2, 2, 179, 180, 3, 2, 2, 2, 180, 181, 3, 2, 2, 2, 181, 182, 7, 36, 2, 2, 182, 183, 7, 24, 2, 2, 183, 185, 5, 134, 68, 2, 184, 186, 5, 34, 18, 2, 185, 184, 3, 2, 2, 2, 185, 186, 3, 2, 2, 2, 186, 15, 3, 2, 2, 2, 187, 188, 5, 18, 10, 2, 188, 189, 5, 24, 13, 2, 189, 17, 3, 2, 2, 2, 190, 191, 9, 2, 2, 2, 191, 19, 3, 2, 2, 2, 192, 193, 5, 22, 12, 2, 193, 21, 3, 2, 2, 2, 194, 195, 7, 66, 2, 2, 195, 23, 3, 2, 2, 2, 196, 197, 5, 20, 11, 2, 197, 198, 7, 34, 2, 2, 198, 201, 5, 134, 68, 2, 199, 200, 7, 53, 2, 2, 200, 202, 5, 30, 16, 2, 201, 199, 3, 2, 2, 2, 201, 202, 3, 2, 2, 2, 202, 25, 3, 2, 2, 2, 203, 208, 5, 28, 15, 2, 204, 205, 7, 31, 2, 2, 205, 207, 5, 28, 15, 2, 206, 204, 3, 2, 2, 2, 207, 210, 3, 2, 2, 2, 208, 206, 3, 2, 2, 2, 208, 209, 3, 2, 2, 2, 209, 27, 3, 2, 2, 2, 210, 208, 3, 2, 2, 2, 211, 212, 5, 20, 11, 2, 212, 213, 7, 34, 2, 2, 213, 214, 5, 134, 68, 2, 214, 29, 3, 2, 2, 2, 215, 216, 5, 128, 65, 2, 216, 31, 3, 2, 2, 2, 217, 224, 5, 36, 19, 2, 218, 224, 5, 38, 20, 2, 219, 224, 5, 46, 24, 2, 220, 224, 5, 54, 28, 2, 221, 224, 5, 56, 29, 2, 222, 224, 5, 34, 18, 2, 223, 217, 3, 2, 2, 2, 223, 218, 3, 2, 2, 2, 223, 219, 3, 2, 2, 2, 223, 220, 3, 2, 2, 2, 223, 221, 3, 2, 2, 2, 223, 222, 3, 2, 2, 2, 224, 33, 3, 2, 2, 2, 225, 226, 6, 18, 2, 2, 226, 228, 7, 40, 2, 2, 227, 229, 5, 8, 5, 2, 228, 227, 3, 2, 2, 2, 228, 229, 3, 2, 2, 2, 229, 230, 3, 2, 2, 2, 230, 231, 7, 41, 2, 2, 231, 35, 3, 2, 2, 2, 232, 233, 8, 19, 1, 2, 233, 234, 5, 132, 67, 2, 234, 235, 7, 32, 2, 2, 235, 236, 8, 19, 1, 2, 236, 37, 3, 2, 2, 2, 237, 240, 5, 40, 21, 2, 238, 240, 5, 42, 22, 2, 239, 237, 3, 2, 2, 2, 239, 238, 3, 2, 2, 2, 240, 39, 3, 2, 2, 2, 241, 242, 7, 17, 2, 2, 242, 243, 7, 35, 2, 2, 243, 244, 5, 132, 67, 2, 244, 245, 7, 36, 2, 2, 245, 248, 5, 32, 17, 2, 246, 247, 7, 18, 2, 2, 247, 249, 5, 32, 17, 2, 248, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 41, 3, 2, 2, 2, 250, 251, 7, 10, 2, 2, 251, 252, 7, 35, 2, 2, 252, 253, 5, 132, 67, 2, 253, 254, 7, 36, 2, 2, 254, 258, 7, 40, 2, 2, 255, 257, 5, 44, 23, 2, 256, 255, 3, 2, 2, 2, 257, 260, 3, 2, 2, 2, 258, 256, 3, 2, 2, 2, 258, 259, 3, 2, 2, 2, 259, 261, 3, 2, 2, 2, 260, 258, 3, 2, 2, 2, 261, 262, 7, 41, 2, 2, 262, 43, 3, 2, 2, 2, 263, 264, 7, 11, 2, 2, 264, 265, 5, 132, 67, 2, 265, 266, 7, 34, 2, 2, 266, 267, 5, 32, 17, 2, 267, 272, 3, 2, 2, 2, 268, 269, 7, 12, 2, 2, 269, 270, 7, 34, 2, 2, 270, 272, 5, 32, 17, 2, 271, 263, 3, 2, 2, 2, 271, 268, 3, 2, 2, 2, 272, 45, 3, 2, 2, 2, 273, 277, 5, 48, 25, 2, 274, 277, 5, 50, 26, 2, 275, 277, 5, 52, 27, 2, 276, 273, 3, 2, 2, 2, 276, 274, 3, 2, 2, 2, 276, 275, 3, 2, 2, 2, 277, 47, 3, 2, 2, 2, 278, 279, 7, 19, 2, 2, 279, 286, 7, 35, 2, 2, 280, 283, 5, 16, 9, 2, 281, 283, 5, 132, 67, 2, 282, 280, 3, 2, 2, 2, 282, 281, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 285, 8, 25, 1, 2, 285, 287, 3, 2, 2, 2, 286, 282, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 288, 3, 2, 2, 2, 288, 292, 7, 32, 2, 2, 289, 290, 5, 132, 67, 2, 290, 291, 8, 25, 1, 2, 291, 293, 3, 2, 2, 2, 292, 289, 3, 2, 2, 2, 292, 293, 3, 2, 2, 2, 293, 294, 3, 2, 2, 2, 294, 298, 7, 32, 2, 2, 295, 296, 5, 132, 67, 2, 296, 297, 8, 25, 1, 2, 297, 299, 3, 2, 2, 2, 298, 295, 3, 2, 2, 2, 298, 299, 3, 2, 2, 2, 299, 300, 3, 2, 2, 2, 300, 301, 7, 36, 2, 2, 301, 302, 5, 32, 17, 2, 302, 49, 3, 2, 2, 2, 303, 304, 7, 16, 2, 2, 304, 305, 7, 35, 2, 2, 305, 306, 5, 132, 67, 2, 306, 307, 7, 36, 2, 2, 307, 308, 5, 32, 17, 2, 308, 51, 3, 2, 2, 2, 309, 310, 7, 15, 2, 2, 310, 311, 5, 32, 17, 2, 311, 312, 7, 16, 2, 2, 312, 313, 7, 35, 2, 2, 313, 314, 5, 132, 67, 2, 314, 315, 7, 36, 2, 2, 315, 316, 7, 32, 2, 2, 316, 53, 3, 2, 2, 2, 317, 318, 9, 3, 2, 2, 318, 319, 7, 32, 2, 2, 319, 55, 3, 2, 2, 2, 320, 322, 7, 22, 2, 2, 321, 323, 5, 132, 67, 2, 322, 321, 3, 2, 2, 2, 322, 323, 3, 2, 2, 2, 323, 324, 3, 2, 2, 2, 324, 325, 7, 32, 2, 2, 325, 57, 3, 2, 2, 2, 326, 336, 5, 60, 31, 2, 327, 336, 5, 80, 41, 2, 328, 336, 5, 82, 42, 2, 329, 336, 5, 62, 32, 2, 330, 336, 5, 64, 33, 2, 331, 336, 5, 70, 36, 2, 332, 336, 5, 72, 37, 2, 333, 336, 5, 78, 40, 2, 334, 336, 5, 86, 44, 2, 335, 326, 3, 2, 2, 2, 335, 327, 3, 2, 2, 2, 335, 328, 3, 2, 2, 2, 335, 329, 3, 2, 2, 2, 335, 330, 3, 2, 2, 2, 335, 331, 3, 2, 2, 2, 335, 332, 3, 2, 2, 2, 335, 333, 3, 2, 2, 2, 335, 334, 3, 2, 2, 2, 336, 59, 3, 2, 2, 2, 337, 338, 7, 35, 2, 2, 338, 339, 5, 132, 67, 2, 339, 340, 7, 36, 2, 2, 340, 61, 3, 2, 2, 2, 341, 342, 9, 4, 2, 2, 342, 63, 3, 2, 2, 2, 343, 344, 5, 66, 34, 2, 344, 65, 3, 2, 2, 2, 345, 346, 7, 66, 2, 2, 346, 67, 3, 2, 2, 2, 347, 350, 5, 66, 34, 2, 348, 350, 5, 70, 36, 2, 349, 347, 3, 2, 2, 2, 349, 348, 3, 2, 2, 2, 350, 69, 3, 2, 2, 2, 351, 352, 9, 5, 2, 2, 352, 71, 3, 2, 2, 2, 353, 357, 7, 73, 2, 2, 354, 356, 5, 74, 38, 2, 355, 354, 3, 2, 2, 2, 356, 359, 3, 2, 2, 2, 357, 355, 3, 2, 2, 2, 357, 358, 3, 2, 2, 2, 358, 360, 3, 2, 2, 2, 359, 357, 3, 2, 2, 2, 360, 370, 7, 75, 2, 2, 361, 365, 7, 74, 2, 2, 362, 364, 5, 76, 39, 2, 363, 362, 3, 2, 2, 2, 364, 367, 3, 2, 2, 2, 365, 363, 3, 2, 2, 2, 365, 366, 3, 2, 2, 2, 366, 368, 3, 2, 2, 2, 367, 365, 3, 2, 2, 2, 368, 370, 7, 77, 2, 2, 369, 353, 3, 2, 2, 2, 369, 361, 3, 2, 2, 2, 370, 73, 3, 2, 2, 2, 371, 378, 7, 76, 2, 2, 372, 374, 7, 3, 2, 2, 373, 375, 5, 132, 67, 2, 374, 373, 3, 2, 2, 2, 374, 375, 3, 2, 2, 2, 375, 376, 3, 2, 2, 2, 376, 378, 7, 39, 2, 2, 377, 371, 3, 2, 2, 2, 377, 372, 3, 2, 2, 2, 378, 75, 3, 2, 2, 2, 379, 386, 7, 78, 2, 2, 380, 382, 7, 3, 2, 2, 381, 383, 5, 132, 67, 2, 382, 381, 3, 2, 2, 2, 382, 383, 3, 2, 2, 2, 383, 384, 3, 2, 2, 2, 384, 386, 7, 39, 2, 2, 385, 379, 3, 2, 2, 2, 385, 380, 3, 2, 2, 2, 386, 77, 3, 2, 2, 2, 387, 388, 9, 6, 2, 2, 388, 79, 3, 2, 2, 2, 389, 398, 7, 37, 2, 2, 390, 395, 5, 132, 67, 2, 391, 392, 7, 31, 2, 2, 392, 394, 5, 132, 67, 2, 393, 391, 3, 2, 2, 2, 394, 397, 3, 2, 2, 2, 395, 393, 3, 2, 2, 2, 395, 396, 3, 2, 2, 2, 396, 399, 3, 2, 2, 2, 397, 395, 3, 2, 2, 2, 398, 390, 3, 2, 2, 2, 398, 399, 3, 2, 2, 2, 399, 401, 3, 2, 2, 2, 400, 402, 7, 31, 2, 2, 401, 400, 3, 2, 2, 2, 401, 402, 3, 2, 2, 2, 402, 403, 3, 2, 2, 2, 403, 404, 7, 38, 2, 2, 404, 81, 3, 2, 2, 2, 405, 414, 7, 40, 2, 2, 406, 411, 5, 84, 43, 2, 407, 408, 7, 31, 2, 2, 408, 410, 5, 84, 43, 2, 409, 407, 3, 2, 2, 2, 410, 413, 3, 2, 2, 2, 411, 409, 3, 2, 2, 2, 411, 412, 3, 2, 2, 2, 412, 415, 3, 2, 2, 2, 413, 411, 3, 2, 2, 2, 414, 406, 3, 2, 2, 2, 414, 415, 3, 2, 2, 2, 415, 417, 3, 2, 2, 2, 416, 418, 7, 31, 2, 2, 417, 416, 3, 2, 2, 2, 417, 418, 3, 2, 2, 2, 418, 419, 3, 2, 2, 2, 419, 420, 7, 41, 2, 2, 420, 83, 3, 2, 2, 2, 421, 422, 5, 68, 35, 2, 422, 423, 7, 34, 2, 2, 423, 424, 5, 132, 67, 2, 424, 85, 3, 2, 2, 2, 425, 426, 9, 7, 2, 2, 426, 87, 3, 2, 2, 2, 427, 428, 8, 45, 1, 2, 428, 439, 5, 58, 30, 2, 429, 430, 7, 23, 2, 2, 430, 431, 5, 88, 45, 2, 431, 433, 7, 35, 2, 2, 432, 434, 5, 90, 46, 2, 433, 432, 3, 2, 2, 2, 433, 434, 3, 2, 2, 2, 434, 435, 3, 2, 2, 2, 435, 436, 7, 36, 2, 2, 436, 437, 8, 45, 1, 2, 437, 439, 3, 2, 2, 2, 438, 427, 3, 2, 2, 2, 438, 429, 3, 2, 2, 2, 439, 461, 3, 2, 2, 2, 440, 441, 12, 7, 2, 2, 441, 443, 7, 35, 2, 2, 442, 444, 5, 90, 46, 2, 443, 442, 3, 2, 2, 2, 443, 444, 3, 2, 2, 2, 444, 445, 3, 2, 2, 2, 445, 446, 7, 36, 2, 2, 446, 460, 8, 45, 1, 2, 447, 448, 12, 5, 2, 2, 448, 449, 5, 92, 47, 2, 449, 450, 8, 45, 1, 2, 450, 460, 3, 2, 2, 2, 451, 452, 12, 4, 2, 2, 452, 453, 5, 94, 48, 2, 453, 454, 8, 45, 1, 2, 454, 460, 3, 2, 2, 2, 455, 456, 12, 3, 2, 2, 456, 457, 5, 96, 49, 2, 457, 458, 8, 45, 1, 2, 458, 460, 3, 2, 2, 2, 459, 440, 3, 2, 2, 2, 459, 447, 3, 2, 2, 2, 459, 451, 3, 2, 2, 2, 459, 455, 3, 2, 2, 2, 460, 463, 3, 2, 2, 2, 461, 459, 3, 2, 2, 2, 461, 462, 3, 2, 2, 2, 462, 89, 3, 2, 2, 2, 463, 461, 3, 2, 2, 2, 464, 469, 5, 128, 65, 2, 465, 466, 7, 31, 2, 2, 466, 468, 5, 128, 65, 2, 467, 465, 3, 2, 2, 2, 468, 471, 3, 2, 2, 2, 469, 467, 3, 2, 2, 2, 469, 470, 3, 2, 2, 2, 470, 91, 3, 2, 2, 2, 471, 469, 3, 2, 2, 2, 472, 473, 7, 65, 2, 2, 473, 474, 5, 66, 34, 2, 474, 93, 3, 2, 2, 2, 475, 476, 7, 37, 2, 2, 476, 477, 5, 132, 67, 2, 477, 478, 7, 38, 2, 2, 478, 95, 3, 2, 2, 2, 479, 483, 7, 37, 2, 2, 480, 481, 5, 132, 67, 2, 481, 482, 8, 49, 1, 2, 482, 484, 3, 2, 2, 2, 483, 480, 3, 2, 2, 2, 483, 484, 3, 2, 2, 2, 484, 485, 3, 2, 2, 2, 485, 489, 7, 34, 2, 2, 486, 487, 5, 132, 67, 2, 487, 488, 8, 49, 1, 2, 488, 490, 3, 2, 2, 2, 489, 486, 3, 2, 2, 2, 489, 490, 3, 2, 2, 2, 490, 491, 3, 2, 2, 2, 491, 492, 7, 38, 2, 2, 492, 97, 3, 2, 2, 2, 493, 496, 5, 88, 45, 2, 494, 496, 5, 100, 51, 2, 495, 493, 3, 2, 2, 2, 495, 494, 3, 2, 2, 2, 496, 99, 3, 2, 2, 2, 497, 498, 5, 88, 45, 2, 498, 499, 5, 108, 55, 2, 499, 101, 3, 2, 2, 2, 500, 504, 5, 98, 50, 2, 501, 504, 5, 104, 53, 2, 502, 504, 5, 106, 54, 2, 503, 500, 3, 2, 2, 2, 503, 501, 3, 2, 2, 2, 503, 502, 3, 2, 2, 2, 504, 103, 3, 2, 2, 2, 505, 506, 5, 108, 55, 2, 506, 507, 5, 98, 50, 2, 507, 105, 3, 2, 2, 2, 508, 509, 5, 110, 56, 2, 509, 510, 5, 98, 50, 2, 510, 107, 3, 2, 2, 2, 511, 512, 9, 8, 2, 2, 512, 109, 3, 2, 2, 2, 513, 514, 9, 9, 2, 2, 514, 111, 3, 2, 2, 2, 515, 521, 5, 102, 52, 2, 516, 517, 5, 102, 52, 2, 517, 518, 7, 8, 2, 2, 518, 519, 5, 134, 68, 2, 519, 521, 3, 2, 2, 2, 520, 515, 3, 2, 2, 2, 520, 516, 3, 2, 2, 2, 521, 113, 3, 2, 2, 2, 522, 523, 8, 58, 1, 2, 523, 524, 5, 112, 57, 2, 524, 530, 3, 2, 2, 2, 525, 526, 12, 3, 2, 2, 526, 527, 9, 10, 2, 2, 527, 529, 5, 112, 57, 2, 528, 525, 3, 2, 2, 2, 529, 532, 3, 2, 2, 2, 530, 528, 3, 2, 2, 2, 530, 531, 3, 2, 2, 2, 531, 115, 3, 2, 2, 2, 532, 530, 3, 2, 2, 2, 533, 534, 8, 59, 1, 2, 534, 535, 5, 114, 58, 2, 535, 541, 3, 2, 2, 2, 536, 537, 12, 3, 2, 2, 537, 538, 9, 11, 2, 2, 538, 540, 5, 114, 58, 2, 539, 536, 3, 2, 2, 2, 540, 543, 3, 2, 2, 2, 541, 539, 3, 2, 2, 2, 541, 542, 3, 2, 2, 2, 542, 117, 3, 2, 2, 2, 543, 541, 3, 2, 2, 2, 544, 545, 8, 60, 1, 2, 545, 546, 5, 116, 59, 2, 546, 552, 3, 2, 2, 2, 547, 548, 12, 3, 2, 2, 548, 549, 9, 12, 2, 2, 549, 551, 5, 116, 59, 2, 550, 547, 3, 2, 2, 2, 551, 554, 3, 2, 2, 2, 552, 550, 3, 2, 2, 2, 552, 553, 3, 2, 2, 2, 553, 119, 3, 2, 2, 2, 554, 552, 3, 2, 2, 2, 555, 556, 8, 61, 1, 2, 556, 557, 5, 118, 60, 2, 557, 563, 3, 2, 2, 2, 558, 559, 12, 3, 2, 2, 559, 560, 9, 13, 2, 2, 560, 562, 5, 118, 60, 2, 561, 558, 3, 2, 2, 2, 562, 565, 3, 2, 2, 2, 563, 561, 3, 2, 2, 2, 563, 564, 3, 2, 2, 2, 564, 121, 3, 2, 2, 2, 565, 563, 3, 2, 2, 2, 566, 567, 8, 62, 1, 2, 567, 568, 5, 120, 61, 2, 568, 574, 3, 2, 2, 2, 569, 570, 12, 3, 2, 2, 570, 571, 7, 50, 2, 2, 571, 573, 5, 120, 61, 2, 572, 569, 3, 2, 2, 2, 573, 576, 3, 2, 2, 2, 574, 572, 3, 2, 2, 2, 574, 575, 3, 2, 2, 2, 575, 123, 3, 2, 2, 2, 576, 574, 3, 2, 2, 2, 577, 578, 8, 63, 1, 2, 578, 579, 5, 122, 62, 2, 579, 585, 3, 2, 2, 2, 580, 581, 12, 3, 2, 2, 581, 582, 7, 51, 2, 2, 582, 584, 5, 122, 62, 2, 583, 580, 3, 2, 2, 2, 584, 587, 3, 2, 2, 2, 585, 583, 3, 2, 2, 2, 585, 586, 3, 2, 2, 2, 586, 125, 3, 2, 2, 2, 587, 585, 3, 2, 2, 2, 588, 596, 5, 124, 63, 2, 589, 590, 5, 124, 63, 2, 590, 591, 7, 33, 2, 2, 591, 592, 5, 126, 64, 2, 592, 593, 7, 34, 2, 2, 593, 594, 5, 126, 64, 2, 594, 596, 3, 2, 2, 2, 595, 588, 3, 2, 2, 2, 595, 589, 3, 2, 2, 2, 596, 127, 3, 2, 2, 2, 597, 603, 5, 126, 64, 2, 598, 599, 5, 88, 45, 2, 599, 600, 5, 130, 66, 2, 600, 601, 5, 128, 65, 2, 601, 603, 3, 2, 2, 2, 602, 597, 3, 2, 2, 2, 602, 598, 3, 2, 2, 2, 603, 129, 3, 2, 2, 2, 604, 605, 9, 14, 2, 2, 605, 131, 3, 2, 2, 2, 606, 611, 5, 128, 65, 2, 607, 608, 7, 31, 2, 2, 608, 610, 5, 128, 65, 2, 609, 607, 3, 2, 2, 2, 610, 613, 3, 2, 2, 2, 611, 609, 3, 2, 2, 2, 611, 612, 3, 2, 2, 2, 612, 133, 3, 2, 2, 2, 613, 611, 3, 2, 2, 2, 614, 618, 5, 136, 69, 2, 615, 618, 5, 138, 70, 2, 616, 618, 5, 140, 71, 2, 617, 614, 3, 2, 2, 2, 617, 615, 3, 2, 2, 2, 617, 616, 3, 2, 2, 2, 618, 135, 3, 2, 2, 2, 619, 620, 5, 142, 72, 2, 620, 137, 3, 2, 2, 2, 621, 622, 5, 142, 72, 2, 622, 623, 7, 61, 2, 2, 623, 624, 5, 142, 72, 2, 624, 625, 7, 63, 2, 2, 625, 139, 3, 2, 2, 2, 626, 627, 7, 27, 2, 2, 627, 628, 7, 35, 2, 2, 628, 629, 5, 142, 72, 2, 629, 630, 7, 36, 2, 2, 630, 141, 3, 2, 2, 2, 631, 632, 9, 15, 2, 2, 632, 143, 3, 2, 2, 2, 60, 145, 152, 159, 164, 171, 173, 179, 185, 201, 208, 223, 228, 239, 248, 258, 271, 276, 282, 286, 292, 298, 322, 335, 349, 357, 365, 369, 374, 377, 382, 385, 395, 398, 401, 411, 414, 417, 433, 438, 443, 459, 461, 469, 483, 489, 495, 503, 520, 530, 541, 552, 563, 574, 585, 595, 602, 611, 617] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 80, 647, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 3, 2, 5, 2, 150, 10, 2, 3, 2, 3, 2, 3, 3, 6, 3, 155, 10, 3, 13, 3, 14, 3, 156, 3, 4, 3, 4, 3, 5, 6, 5, 162, 10, 5, 13, 5, 14, 5, 163, 3, 6, 3, 6, 3, 6, 5, 6, 169, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 177, 10, 7, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 189, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 201, 10, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 207, 10, 14, 3, 15, 3, 15, 3, 15, 7, 15, 212, 10, 15, 12, 15, 14, 15, 215, 11, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 237, 10, 19, 3, 20, 3, 20, 3, 20, 5, 20, 242, 10, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 5, 22, 253, 10, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 262, 10, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 270, 10, 24, 12, 24, 14, 24, 273, 11, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 5, 25, 285, 10, 25, 3, 26, 3, 26, 3, 26, 5, 26, 290, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 296, 10, 27, 3, 27, 3, 27, 5, 27, 300, 10, 27, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 306, 10, 27, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 312, 10, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 5, 31, 336, 10, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 5, 32, 349, 10, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 5, 37, 363, 10, 37, 3, 38, 3, 38, 3, 39, 3, 39, 7, 39, 369, 10, 39, 12, 39, 14, 39, 372, 11, 39, 3, 39, 3, 39, 3, 39, 7, 39, 377, 10, 39, 12, 39, 14, 39, 380, 11, 39, 3, 39, 5, 39, 383, 10, 39, 3, 40, 3, 40, 3, 40, 5, 40, 388, 10, 40, 3, 40, 5, 40, 391, 10, 40, 3, 41, 3, 41, 3, 41, 5, 41, 396, 10, 41, 3, 41, 5, 41, 399, 10, 41, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 7, 43, 407, 10, 43, 12, 43, 14, 43, 410, 11, 43, 5, 43, 412, 10, 43, 3, 43, 5, 43, 415, 10, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 7, 44, 423, 10, 44, 12, 44, 14, 44, 426, 11, 44, 5, 44, 428, 10, 44, 3, 44, 5, 44, 431, 10, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 5, 47, 447, 10, 47, 3, 47, 3, 47, 3, 47, 5, 47, 452, 10, 47, 3, 47, 3, 47, 3, 47, 5, 47, 457, 10, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 7, 47, 473, 10, 47, 12, 47, 14, 47, 476, 11, 47, 3, 48, 3, 48, 3, 48, 7, 48, 481, 10, 48, 12, 48, 14, 48, 484, 11, 48, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 497, 10, 51, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 503, 10, 51, 3, 51, 3, 51, 3, 52, 3, 52, 5, 52, 509, 10, 52, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 5, 54, 517, 10, 54, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 5, 59, 534, 10, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 7, 60, 542, 10, 60, 12, 60, 14, 60, 545, 11, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 7, 61, 553, 10, 61, 12, 61, 14, 61, 556, 11, 61, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 7, 62, 564, 10, 62, 12, 62, 14, 62, 567, 11, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 7, 63, 575, 10, 63, 12, 63, 14, 63, 578, 11, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 7, 64, 586, 10, 64, 12, 64, 14, 64, 589, 11, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 7, 65, 597, 10, 65, 12, 65, 14, 65, 600, 11, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 5, 66, 609, 10, 66, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 5, 67, 616, 10, 67, 3, 68, 3, 68, 3, 69, 3, 69, 3, 69, 7, 69, 623, 10, 69, 12, 69, 14, 69, 626, 11, 69, 3, 70, 3, 70, 3, 70, 5, 70, 631, 10, 70, 3, 71, 3, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 74, 3, 74, 3, 74, 2, 2, 9, 92, 118, 120, 122, 124, 126, 128, 75, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 70, 2, 72, 2, 74, 2, 76, 2, 78, 2, 80, 2, 82, 2, 84, 2, 86, 2, 88, 2, 90, 2, 92, 2, 94, 2, 96, 2, 98, 2, 100, 2, 102, 2, 104, 2, 106, 2, 108, 2, 110, 2, 112, 2, 114, 2, 116, 2, 118, 2, 120, 2, 122, 2, 124, 2, 126, 2, 128, 2, 130, 2, 132, 2, 134, 2, 136, 2, 138, 2, 140, 2, 142, 2, 144, 2, 146, 2, 2, 16, 3, 2, 6, 7, 3, 2, 13, 14, 3, 2, 27, 28, 3, 2, 70, 71, 4, 2, 69, 69, 72, 72, 3, 2, 30, 32, 4, 2, 45, 45, 47, 47, 5, 2, 44, 44, 46, 46, 54, 54, 3, 2, 48, 51, 4, 2, 44, 44, 46, 46, 3, 2, 63, 66, 3, 2, 61, 62, 3, 2, 55, 60, 4, 2, 30, 32, 68, 68, 2, 649, 2, 149, 3, 2, 2, 2, 4, 154, 3, 2, 2, 2, 6, 158, 3, 2, 2, 2, 8, 161, 3, 2, 2, 2, 10, 168, 3, 2, 2, 2, 12, 176, 3, 2, 2, 2, 14, 178, 3, 2, 2, 2, 16, 181, 3, 2, 2, 2, 18, 183, 3, 2, 2, 2, 20, 190, 3, 2, 2, 2, 22, 192, 3, 2, 2, 2, 24, 194, 3, 2, 2, 2, 26, 196, 3, 2, 2, 2, 28, 208, 3, 2, 2, 2, 30, 216, 3, 2, 2, 2, 32, 220, 3, 2, 2, 2, 34, 225, 3, 2, 2, 2, 36, 236, 3, 2, 2, 2, 38, 238, 3, 2, 2, 2, 40, 245, 3, 2, 2, 2, 42, 252, 3, 2, 2, 2, 44, 254, 3, 2, 2, 2, 46, 263, 3, 2, 2, 2, 48, 284, 3, 2, 2, 2, 50, 289, 3, 2, 2, 2, 52, 291, 3, 2, 2, 2, 54, 316, 3, 2, 2, 2, 56, 322, 3, 2, 2, 2, 58, 330, 3, 2, 2, 2, 60, 333, 3, 2, 2, 2, 62, 348, 3, 2, 2, 2, 64, 350, 3, 2, 2, 2, 66, 354, 3, 2, 2, 2, 68, 356, 3, 2, 2, 2, 70, 358, 3, 2, 2, 2, 72, 362, 3, 2, 2, 2, 74, 364, 3, 2, 2, 2, 76, 382, 3, 2, 2, 2, 78, 390, 3, 2, 2, 2, 80, 398, 3, 2, 2, 2, 82, 400, 3, 2, 2, 2, 84, 402, 3, 2, 2, 2, 86, 418, 3, 2, 2, 2, 88, 434, 3, 2, 2, 2, 90, 438, 3, 2, 2, 2, 92, 451, 3, 2, 2, 2, 94, 477, 3, 2, 2, 2, 96, 485, 3, 2, 2, 2, 98, 488, 3, 2, 2, 2, 100, 492, 3, 2, 2, 2, 102, 508, 3, 2, 2, 2, 104, 510, 3, 2, 2, 2, 106, 516, 3, 2, 2, 2, 108, 518, 3, 2, 2, 2, 110, 521, 3, 2, 2, 2, 112, 524, 3, 2, 2, 2, 114, 526, 3, 2, 2, 2, 116, 533, 3, 2, 2, 2, 118, 535, 3, 2, 2, 2, 120, 546, 3, 2, 2, 2, 122, 557, 3, 2, 2, 2, 124, 568, 3, 2, 2, 2, 126, 579, 3, 2, 2, 2, 128, 590, 3, 2, 2, 2, 130, 608, 3, 2, 2, 2, 132, 615, 3, 2, 2, 2, 134, 617, 3, 2, 2, 2, 136, 619, 3, 2, 2, 2, 138, 630, 3, 2, 2, 2, 140, 632, 3, 2, 2, 2, 142, 634, 3, 2, 2, 2, 144, 639, 3, 2, 2, 2, 146, 644, 3, 2, 2, 2, 148, 150, 5, 4, 3, 2, 149, 148, 3, 2, 2, 2, 149, 150, 3, 2, 2, 2, 150, 151, 3, 2, 2, 2, 151, 152, 7, 2, 2, 3, 152, 3, 3, 2, 2, 2, 153, 155, 5, 6, 4, 2, 154, 153, 3, 2, 2, 2, 155, 156, 3, 2, 2, 2, 156, 154, 3, 2, 2, 2, 156, 157, 3, 2, 2, 2, 157, 5, 3, 2, 2, 2, 158, 159, 5, 8, 5, 2, 159, 7, 3, 2, 2, 2, 160, 162, 5, 10, 6, 2, 161, 160, 3, 2, 2, 2, 162, 163, 3, 2, 2, 2, 163, 161, 3, 2, 2, 2, 163, 164, 3, 2, 2, 2, 164, 9, 3, 2, 2, 2, 165, 169, 5, 36, 19, 2, 166, 169, 5, 12, 7, 2, 167, 169, 7, 34, 2, 2, 168, 165, 3, 2, 2, 2, 168, 166, 3, 2, 2, 2, 168, 167, 3, 2, 2, 2, 169, 11, 3, 2, 2, 2, 170, 171, 5, 14, 8, 2, 171, 172, 7, 34, 2, 2, 172, 177, 3, 2, 2, 2, 173, 177, 5, 26, 14, 2, 174, 177, 5, 32, 17, 2, 175, 177, 5, 34, 18, 2, 176, 170, 3, 2, 2, 2, 176, 173, 3, 2, 2, 2, 176, 174, 3, 2, 2, 2, 176, 175, 3, 2, 2, 2, 177, 13, 3, 2, 2, 2, 178, 179, 5, 16, 9, 2, 179, 180, 5, 18, 10, 2, 180, 15, 3, 2, 2, 2, 181, 182, 9, 2, 2, 2, 182, 17, 3, 2, 2, 2, 183, 184, 5, 22, 12, 2, 184, 185, 7, 36, 2, 2, 185, 188, 5, 138, 70, 2, 186, 187, 7, 55, 2, 2, 187, 189, 5, 20, 11, 2, 188, 186, 3, 2, 2, 2, 188, 189, 3, 2, 2, 2, 189, 19, 3, 2, 2, 2, 190, 191, 5, 132, 67, 2, 191, 21, 3, 2, 2, 2, 192, 193, 5, 24, 13, 2, 193, 23, 3, 2, 2, 2, 194, 195, 7, 68, 2, 2, 195, 25, 3, 2, 2, 2, 196, 197, 7, 21, 2, 2, 197, 198, 5, 22, 12, 2, 198, 200, 7, 37, 2, 2, 199, 201, 5, 28, 15, 2, 200, 199, 3, 2, 2, 2, 200, 201, 3, 2, 2, 2, 201, 202, 3, 2, 2, 2, 202, 203, 7, 38, 2, 2, 203, 204, 7, 24, 2, 2, 204, 206, 5, 138, 70, 2, 205, 207, 5, 38, 20, 2, 206, 205, 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 27, 3, 2, 2, 2, 208, 213, 5, 30, 16, 2, 209, 210, 7, 33, 2, 2, 210, 212, 5, 30, 16, 2, 211, 209, 3, 2, 2, 2, 212, 215, 3, 2, 2, 2, 213, 211, 3, 2, 2, 2, 213, 214, 3, 2, 2, 2, 214, 29, 3, 2, 2, 2, 215, 213, 3, 2, 2, 2, 216, 217, 5, 22, 12, 2, 217, 218, 7, 36, 2, 2, 218, 219, 5, 138, 70, 2, 219, 31, 3, 2, 2, 2, 220, 221, 7, 26, 2, 2, 221, 222, 7, 68, 2, 2, 222, 223, 7, 42, 2, 2, 223, 224, 7, 43, 2, 2, 224, 33, 3, 2, 2, 2, 225, 226, 7, 25, 2, 2, 226, 227, 7, 68, 2, 2, 227, 228, 7, 42, 2, 2, 228, 229, 7, 43, 2, 2, 229, 35, 3, 2, 2, 2, 230, 237, 5, 40, 21, 2, 231, 237, 5, 42, 22, 2, 232, 237, 5, 50, 26, 2, 233, 237, 5, 58, 30, 2, 234, 237, 5, 60, 31, 2, 235, 237, 5, 38, 20, 2, 236, 230, 3, 2, 2, 2, 236, 231, 3, 2, 2, 2, 236, 232, 3, 2, 2, 2, 236, 233, 3, 2, 2, 2, 236, 234, 3, 2, 2, 2, 236, 235, 3, 2, 2, 2, 237, 37, 3, 2, 2, 2, 238, 239, 6, 20, 2, 2, 239, 241, 7, 42, 2, 2, 240, 242, 5, 8, 5, 2, 241, 240, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242, 243, 3, 2, 2, 2, 243, 244, 7, 43, 2, 2, 244, 39, 3, 2, 2, 2, 245, 246, 8, 21, 1, 2, 246, 247, 5, 136, 69, 2, 247, 248, 7, 34, 2, 2, 248, 249, 8, 21, 1, 2, 249, 41, 3, 2, 2, 2, 250, 253, 5, 44, 23, 2, 251, 253, 5, 46, 24, 2, 252, 250, 3, 2, 2, 2, 252, 251, 3, 2, 2, 2, 253, 43, 3, 2, 2, 2, 254, 255, 7, 17, 2, 2, 255, 256, 7, 37, 2, 2, 256, 257, 5, 136, 69, 2, 257, 258, 7, 38, 2, 2, 258, 261, 5, 36, 19, 2, 259, 260, 7, 18, 2, 2, 260, 262, 5, 36, 19, 2, 261, 259, 3, 2, 2, 2, 261, 262, 3, 2, 2, 2, 262, 45, 3, 2, 2, 2, 263, 264, 7, 10, 2, 2, 264, 265, 7, 37, 2, 2, 265, 266, 5, 136, 69, 2, 266, 267, 7, 38, 2, 2, 267, 271, 7, 42, 2, 2, 268, 270, 5, 48, 25, 2, 269, 268, 3, 2, 2, 2, 270, 273, 3, 2, 2, 2, 271, 269, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 274, 3, 2, 2, 2, 273, 271, 3, 2, 2, 2, 274, 275, 7, 43, 2, 2, 275, 47, 3, 2, 2, 2, 276, 277, 7, 11, 2, 2, 277, 278, 5, 136, 69, 2, 278, 279, 7, 36, 2, 2, 279, 280, 5, 36, 19, 2, 280, 285, 3, 2, 2, 2, 281, 282, 7, 12, 2, 2, 282, 283, 7, 36, 2, 2, 283, 285, 5, 36, 19, 2, 284, 276, 3, 2, 2, 2, 284, 281, 3, 2, 2, 2, 285, 49, 3, 2, 2, 2, 286, 290, 5, 52, 27, 2, 287, 290, 5, 54, 28, 2, 288, 290, 5, 56, 29, 2, 289, 286, 3, 2, 2, 2, 289, 287, 3, 2, 2, 2, 289, 288, 3, 2, 2, 2, 290, 51, 3, 2, 2, 2, 291, 292, 7, 19, 2, 2, 292, 299, 7, 37, 2, 2, 293, 296, 5, 14, 8, 2, 294, 296, 5, 136, 69, 2, 295, 293, 3, 2, 2, 2, 295, 294, 3, 2, 2, 2, 296, 297, 3, 2, 2, 2, 297, 298, 8, 27, 1, 2, 298, 300, 3, 2, 2, 2, 299, 295, 3, 2, 2, 2, 299, 300, 3, 2, 2, 2, 300, 301, 3, 2, 2, 2, 301, 305, 7, 34, 2, 2, 302, 303, 5, 136, 69, 2, 303, 304, 8, 27, 1, 2, 304, 306, 3, 2, 2, 2, 305, 302, 3, 2, 2, 2, 305, 306, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 311, 7, 34, 2, 2, 308, 309, 5, 136, 69, 2, 309, 310, 8, 27, 1, 2, 310, 312, 3, 2, 2, 2, 311, 308, 3, 2, 2, 2, 311, 312, 3, 2, 2, 2, 312, 313, 3, 2, 2, 2, 313, 314, 7, 38, 2, 2, 314, 315, 5, 36, 19, 2, 315, 53, 3, 2, 2, 2, 316, 317, 7, 16, 2, 2, 317, 318, 7, 37, 2, 2, 318, 319, 5, 136, 69, 2, 319, 320, 7, 38, 2, 2, 320, 321, 5, 36, 19, 2, 321, 55, 3, 2, 2, 2, 322, 323, 7, 15, 2, 2, 323, 324, 5, 36, 19, 2, 324, 325, 7, 16, 2, 2, 325, 326, 7, 37, 2, 2, 326, 327, 5, 136, 69, 2, 327, 328, 7, 38, 2, 2, 328, 329, 7, 34, 2, 2, 329, 57, 3, 2, 2, 2, 330, 331, 9, 3, 2, 2, 331, 332, 7, 34, 2, 2, 332, 59, 3, 2, 2, 2, 333, 335, 7, 22, 2, 2, 334, 336, 5, 136, 69, 2, 335, 334, 3, 2, 2, 2, 335, 336, 3, 2, 2, 2, 336, 337, 3, 2, 2, 2, 337, 338, 7, 34, 2, 2, 338, 61, 3, 2, 2, 2, 339, 349, 5, 64, 33, 2, 340, 349, 5, 84, 43, 2, 341, 349, 5, 86, 44, 2, 342, 349, 5, 66, 34, 2, 343, 349, 5, 68, 35, 2, 344, 349, 5, 74, 38, 2, 345, 349, 5, 76, 39, 2, 346, 349, 5, 82, 42, 2, 347, 349, 5, 90, 46, 2, 348, 339, 3, 2, 2, 2, 348, 340, 3, 2, 2, 2, 348, 341, 3, 2, 2, 2, 348, 342, 3, 2, 2, 2, 348, 343, 3, 2, 2, 2, 348, 344, 3, 2, 2, 2, 348, 345, 3, 2, 2, 2, 348, 346, 3, 2, 2, 2, 348, 347, 3, 2, 2, 2, 349, 63, 3, 2, 2, 2, 350, 351, 7, 37, 2, 2, 351, 352, 5, 136, 69, 2, 352, 353, 7, 38, 2, 2, 353, 65, 3, 2, 2, 2, 354, 355, 9, 4, 2, 2, 355, 67, 3, 2, 2, 2, 356, 357, 5, 70, 36, 2, 357, 69, 3, 2, 2, 2, 358, 359, 7, 68, 2, 2, 359, 71, 3, 2, 2, 2, 360, 363, 5, 70, 36, 2, 361, 363, 5, 74, 38, 2, 362, 360, 3, 2, 2, 2, 362, 361, 3, 2, 2, 2, 363, 73, 3, 2, 2, 2, 364, 365, 9, 5, 2, 2, 365, 75, 3, 2, 2, 2, 366, 370, 7, 75, 2, 2, 367, 369, 5, 78, 40, 2, 368, 367, 3, 2, 2, 2, 369, 372, 3, 2, 2, 2, 370, 368, 3, 2, 2, 2, 370, 371, 3, 2, 2, 2, 371, 373, 3, 2, 2, 2, 372, 370, 3, 2, 2, 2, 373, 383, 7, 77, 2, 2, 374, 378, 7, 76, 2, 2, 375, 377, 5, 80, 41, 2, 376, 375, 3, 2, 2, 2, 377, 380, 3, 2, 2, 2, 378, 376, 3, 2, 2, 2, 378, 379, 3, 2, 2, 2, 379, 381, 3, 2, 2, 2, 380, 378, 3, 2, 2, 2, 381, 383, 7, 79, 2, 2, 382, 366, 3, 2, 2, 2, 382, 374, 3, 2, 2, 2, 383, 77, 3, 2, 2, 2, 384, 391, 7, 78, 2, 2, 385, 387, 7, 3, 2, 2, 386, 388, 5, 136, 69, 2, 387, 386, 3, 2, 2, 2, 387, 388, 3, 2, 2, 2, 388, 389, 3, 2, 2, 2, 389, 391, 7, 41, 2, 2, 390, 384, 3, 2, 2, 2, 390, 385, 3, 2, 2, 2, 391, 79, 3, 2, 2, 2, 392, 399, 7, 80, 2, 2, 393, 395, 7, 3, 2, 2, 394, 396, 5, 136, 69, 2, 395, 394, 3, 2, 2, 2, 395, 396, 3, 2, 2, 2, 396, 397, 3, 2, 2, 2, 397, 399, 7, 41, 2, 2, 398, 392, 3, 2, 2, 2, 398, 393, 3, 2, 2, 2, 399, 81, 3, 2, 2, 2, 400, 401, 9, 6, 2, 2, 401, 83, 3, 2, 2, 2, 402, 411, 7, 39, 2, 2, 403, 408, 5, 136, 69, 2, 404, 405, 7, 33, 2, 2, 405, 407, 5, 136, 69, 2, 406, 404, 3, 2, 2, 2, 407, 410, 3, 2, 2, 2, 408, 406, 3, 2, 2, 2, 408, 409, 3, 2, 2, 2, 409, 412, 3, 2, 2, 2, 410, 408, 3, 2, 2, 2, 411, 403, 3, 2, 2, 2, 411, 412, 3, 2, 2, 2, 412, 414, 3, 2, 2, 2, 413, 415, 7, 33, 2, 2, 414, 413, 3, 2, 2, 2, 414, 415, 3, 2, 2, 2, 415, 416, 3, 2, 2, 2, 416, 417, 7, 40, 2, 2, 417, 85, 3, 2, 2, 2, 418, 427, 7, 42, 2, 2, 419, 424, 5, 88, 45, 2, 420, 421, 7, 33, 2, 2, 421, 423, 5, 88, 45, 2, 422, 420, 3, 2, 2, 2, 423, 426, 3, 2, 2, 2, 424, 422, 3, 2, 2, 2, 424, 425, 3, 2, 2, 2, 425, 428, 3, 2, 2, 2, 426, 424, 3, 2, 2, 2, 427, 419, 3, 2, 2, 2, 427, 428, 3, 2, 2, 2, 428, 430, 3, 2, 2, 2, 429, 431, 7, 33, 2, 2, 430, 429, 3, 2, 2, 2, 430, 431, 3, 2, 2, 2, 431, 432, 3, 2, 2, 2, 432, 433, 7, 43, 2, 2, 433, 87, 3, 2, 2, 2, 434, 435, 5, 72, 37, 2, 435, 436, 7, 36, 2, 2, 436, 437, 5, 136, 69, 2, 437, 89, 3, 2, 2, 2, 438, 439, 9, 7, 2, 2, 439, 91, 3, 2, 2, 2, 440, 441, 8, 47, 1, 2, 441, 452, 5, 62, 32, 2, 442, 443, 7, 23, 2, 2, 443, 444, 5, 92, 47, 2, 444, 446, 7, 37, 2, 2, 445, 447, 5, 94, 48, 2, 446, 445, 3, 2, 2, 2, 446, 447, 3, 2, 2, 2, 447, 448, 3, 2, 2, 2, 448, 449, 7, 38, 2, 2, 449, 450, 8, 47, 1, 2, 450, 452, 3, 2, 2, 2, 451, 440, 3, 2, 2, 2, 451, 442, 3, 2, 2, 2, 452, 474, 3, 2, 2, 2, 453, 454, 12, 7, 2, 2, 454, 456, 7, 37, 2, 2, 455, 457, 5, 94, 48, 2, 456, 455, 3, 2, 2, 2, 456, 457, 3, 2, 2, 2, 457, 458, 3, 2, 2, 2, 458, 459, 7, 38, 2, 2, 459, 473, 8, 47, 1, 2, 460, 461, 12, 5, 2, 2, 461, 462, 5, 96, 49, 2, 462, 463, 8, 47, 1, 2, 463, 473, 3, 2, 2, 2, 464, 465, 12, 4, 2, 2, 465, 466, 5, 98, 50, 2, 466, 467, 8, 47, 1, 2, 467, 473, 3, 2, 2, 2, 468, 469, 12, 3, 2, 2, 469, 470, 5, 100, 51, 2, 470, 471, 8, 47, 1, 2, 471, 473, 3, 2, 2, 2, 472, 453, 3, 2, 2, 2, 472, 460, 3, 2, 2, 2, 472, 464, 3, 2, 2, 2, 472, 468, 3, 2, 2, 2, 473, 476, 3, 2, 2, 2, 474, 472, 3, 2, 2, 2, 474, 475, 3, 2, 2, 2, 475, 93, 3, 2, 2, 2, 476, 474, 3, 2, 2, 2, 477, 482, 5, 132, 67, 2, 478, 479, 7, 33, 2, 2, 479, 481, 5, 132, 67, 2, 480, 478, 3, 2, 2, 2, 481, 484, 3, 2, 2, 2, 482, 480, 3, 2, 2, 2, 482, 483, 3, 2, 2, 2, 483, 95, 3, 2, 2, 2, 484, 482, 3, 2, 2, 2, 485, 486, 7, 67, 2, 2, 486, 487, 5, 70, 36, 2, 487, 97, 3, 2, 2, 2, 488, 489, 7, 39, 2, 2, 489, 490, 5, 136, 69, 2, 490, 491, 7, 40, 2, 2, 491, 99, 3, 2, 2, 2, 492, 496, 7, 39, 2, 2, 493, 494, 5, 136, 69, 2, 494, 495, 8, 51, 1, 2, 495, 497, 3, 2, 2, 2, 496, 493, 3, 2, 2, 2, 496, 497, 3, 2, 2, 2, 497, 498, 3, 2, 2, 2, 498, 502, 7, 36, 2, 2, 499, 500, 5, 136, 69, 2, 500, 501, 8, 51, 1, 2, 501, 503, 3, 2, 2, 2, 502, 499, 3, 2, 2, 2, 502, 503, 3, 2, 2, 2, 503, 504, 3, 2, 2, 2, 504, 505, 7, 40, 2, 2, 505, 101, 3, 2, 2, 2, 506, 509, 5, 92, 47, 2, 507, 509, 5, 104, 53, 2, 508, 506, 3, 2, 2, 2, 508, 507, 3, 2, 2, 2, 509, 103, 3, 2, 2, 2, 510, 511, 5, 92, 47, 2, 511, 512, 5, 112, 57, 2, 512, 105, 3, 2, 2, 2, 513, 517, 5, 102, 52, 2, 514, 517, 5, 108, 55, 2, 515, 517, 5, 110, 56, 2, 516, 513, 3, 2, 2, 2, 516, 514, 3, 2, 2, 2, 516, 515, 3, 2, 2, 2, 517, 107, 3, 2, 2, 2, 518, 519, 5, 112, 57, 2, 519, 520, 5, 102, 52, 2, 520, 109, 3, 2, 2, 2, 521, 522, 5, 114, 58, 2, 522, 523, 5, 102, 52, 2, 523, 111, 3, 2, 2, 2, 524, 525, 9, 8, 2, 2, 525, 113, 3, 2, 2, 2, 526, 527, 9, 9, 2, 2, 527, 115, 3, 2, 2, 2, 528, 534, 5, 106, 54, 2, 529, 530, 5, 106, 54, 2, 530, 531, 7, 8, 2, 2, 531, 532, 5, 138, 70, 2, 532, 534, 3, 2, 2, 2, 533, 528, 3, 2, 2, 2, 533, 529, 3, 2, 2, 2, 534, 117, 3, 2, 2, 2, 535, 536, 8, 60, 1, 2, 536, 537, 5, 116, 59, 2, 537, 543, 3, 2, 2, 2, 538, 539, 12, 3, 2, 2, 539, 540, 9, 10, 2, 2, 540, 542, 5, 116, 59, 2, 541, 538, 3, 2, 2, 2, 542, 545, 3, 2, 2, 2, 543, 541, 3, 2, 2, 2, 543, 544, 3, 2, 2, 2, 544, 119, 3, 2, 2, 2, 545, 543, 3, 2, 2, 2, 546, 547, 8, 61, 1, 2, 547, 548, 5, 118, 60, 2, 548, 554, 3, 2, 2, 2, 549, 550, 12, 3, 2, 2, 550, 551, 9, 11, 2, 2, 551, 553, 5, 118, 60, 2, 552, 549, 3, 2, 2, 2, 553, 556, 3, 2, 2, 2, 554, 552, 3, 2, 2, 2, 554, 555, 3, 2, 2, 2, 555, 121, 3, 2, 2, 2, 556, 554, 3, 2, 2, 2, 557, 558, 8, 62, 1, 2, 558, 559, 5, 120, 61, 2, 559, 565, 3, 2, 2, 2, 560, 561, 12, 3, 2, 2, 561, 562, 9, 12, 2, 2, 562, 564, 5, 120, 61, 2, 563, 560, 3, 2, 2, 2, 564, 567, 3, 2, 2, 2, 565, 563, 3, 2, 2, 2, 565, 566, 3, 2, 2, 2, 566, 123, 3, 2, 2, 2, 567, 565, 3, 2, 2, 2, 568, 569, 8, 63, 1, 2, 569, 570, 5, 122, 62, 2, 570, 576, 3, 2, 2, 2, 571, 572, 12, 3, 2, 2, 572, 573, 9, 13, 2, 2, 573, 575, 5, 122, 62, 2, 574, 571, 3, 2, 2, 2, 575, 578, 3, 2, 2, 2, 576, 574, 3, 2, 2, 2, 576, 577, 3, 2, 2, 2, 577, 125, 3, 2, 2, 2, 578, 576, 3, 2, 2, 2, 579, 580, 8, 64, 1, 2, 580, 581, 5, 124, 63, 2, 581, 587, 3, 2, 2, 2, 582, 583, 12, 3, 2, 2, 583, 584, 7, 52, 2, 2, 584, 586, 5, 124, 63, 2, 585, 582, 3, 2, 2, 2, 586, 589, 3, 2, 2, 2, 587, 585, 3, 2, 2, 2, 587, 588, 3, 2, 2, 2, 588, 127, 3, 2, 2, 2, 589, 587, 3, 2, 2, 2, 590, 591, 8, 65, 1, 2, 591, 592, 5, 126, 64, 2, 592, 598, 3, 2, 2, 2, 593, 594, 12, 3, 2, 2, 594, 595, 7, 53, 2, 2, 595, 597, 5, 126, 64, 2, 596, 593, 3, 2, 2, 2, 597, 600, 3, 2, 2, 2, 598, 596, 3, 2, 2, 2, 598, 599, 3, 2, 2, 2, 599, 129, 3, 2, 2, 2, 600, 598, 3, 2, 2, 2, 601, 609, 5, 128, 65, 2, 602, 603, 5, 128, 65, 2, 603, 604, 7, 35, 2, 2, 604, 605, 5, 130, 66, 2, 605, 606, 7, 36, 2, 2, 606, 607, 5, 130, 66, 2, 607, 609, 3, 2, 2, 2, 608, 601, 3, 2, 2, 2, 608, 602, 3, 2, 2, 2, 609, 131, 3, 2, 2, 2, 610, 616, 5, 130, 66, 2, 611, 612, 5, 92, 47, 2, 612, 613, 5, 134, 68, 2, 613, 614, 5, 132, 67, 2, 614, 616, 3, 2, 2, 2, 615, 610, 3, 2, 2, 2, 615, 611, 3, 2, 2, 2, 616, 133, 3, 2, 2, 2, 617, 618, 9, 14, 2, 2, 618, 135, 3, 2, 2, 2, 619, 624, 5, 132, 67, 2, 620, 621, 7, 33, 2, 2, 621, 623, 5, 132, 67, 2, 622, 620, 3, 2, 2, 2, 623, 626, 3, 2, 2, 2, 624, 622, 3, 2, 2, 2, 624, 625, 3, 2, 2, 2, 625, 137, 3, 2, 2, 2, 626, 624, 3, 2, 2, 2, 627, 631, 5, 140, 71, 2, 628, 631, 5, 142, 72, 2, 629, 631, 5, 144, 73, 2, 630, 627, 3, 2, 2, 2, 630, 628, 3, 2, 2, 2, 630, 629, 3, 2, 2, 2, 631, 139, 3, 2, 2, 2, 632, 633, 5, 146, 74, 2, 633, 141, 3, 2, 2, 2, 634, 635, 5, 146, 74, 2, 635, 636, 7, 63, 2, 2, 636, 637, 5, 146, 74, 2, 637, 638, 7, 65, 2, 2, 638, 143, 3, 2, 2, 2, 639, 640, 7, 29, 2, 2, 640, 641, 7, 37, 2, 2, 641, 642, 5, 146, 74, 2, 642, 643, 7, 38, 2, 2, 643, 145, 3, 2, 2, 2, 644, 645, 9, 15, 2, 2, 645, 147, 3, 2, 2, 2, 59, 149, 156, 163, 168, 176, 188, 200, 206, 213, 236, 241, 252, 261, 271, 284, 289, 295, 299, 305, 311, 335, 348, 362, 370, 378, 382, 387, 390, 395, 398, 408, 411, 414, 424, 427, 430, 446, 451, 456, 472, 474, 482, 496, 502, 508, 516, 533, 543, 554, 565, 576, 587, 598, 608, 615, 624, 630] \ No newline at end of file diff --git a/kipper/core/src/compiler/parser/antlr/KipperParser.tokens b/kipper/core/src/compiler/parser/antlr/KipperParser.tokens index a8e8b39b6..a7b97ced0 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParser.tokens +++ b/kipper/core/src/compiler/parser/antlr/KipperParser.tokens @@ -20,60 +20,62 @@ DefFunc=19 Return=20 CallFunc=21 RetIndicator=22 -True=23 -False=24 -Typeof=25 -Void=26 -Null=27 -Undefined=28 -Comma=29 -SemiColon=30 -QuestionMark=31 -Colon=32 -LeftParen=33 -RightParen=34 -LeftBracket=35 -RightBracket=36 -FStringExpEnd=37 -LeftBrace=38 -RightBrace=39 -Plus=40 -PlusPlus=41 -Minus=42 -MinusMinus=43 -Star=44 -Div=45 -Mod=46 -PowerTo=47 -AndAnd=48 -OrOr=49 -Not=50 -Assign=51 -PlusAssign=52 -MinusAssign=53 -StarAssign=54 -DivAssign=55 -ModAssign=56 -Equal=57 -NotEqual=58 -Less=59 -LessEqual=60 -Greater=61 -GreaterEqual=62 -Dot=63 -Identifier=64 -IntegerConstant=65 -SingleQuoteStringLiteral=66 -DoubleQuoteStringLiteral=67 -FloatingConstant=68 -Whitespace=69 -Newline=70 -FStringSingleQuoteStart=71 -FStringDoubleQuoteStart=72 -FStringSingleQuoteEnd=73 -FStringSingleQuoteAtom=74 -FStringDoubleQuoteEnd=75 -FStringDoubleQuoteAtom=76 +Class=23 +Interface=24 +True=25 +False=26 +Typeof=27 +Void=28 +Null=29 +Undefined=30 +Comma=31 +SemiColon=32 +QuestionMark=33 +Colon=34 +LeftParen=35 +RightParen=36 +LeftBracket=37 +RightBracket=38 +FStringExpEnd=39 +LeftBrace=40 +RightBrace=41 +Plus=42 +PlusPlus=43 +Minus=44 +MinusMinus=45 +Star=46 +Div=47 +Mod=48 +PowerTo=49 +AndAnd=50 +OrOr=51 +Not=52 +Assign=53 +PlusAssign=54 +MinusAssign=55 +StarAssign=56 +DivAssign=57 +ModAssign=58 +Equal=59 +NotEqual=60 +Less=61 +LessEqual=62 +Greater=63 +GreaterEqual=64 +Dot=65 +Identifier=66 +IntegerConstant=67 +SingleQuoteStringLiteral=68 +DoubleQuoteStringLiteral=69 +FloatingConstant=70 +Whitespace=71 +Newline=72 +FStringSingleQuoteStart=73 +FStringDoubleQuoteStart=74 +FStringSingleQuoteEnd=75 +FStringSingleQuoteAtom=76 +FStringDoubleQuoteEnd=77 +FStringDoubleQuoteAtom=78 'const'=4 'var'=5 'as'=6 @@ -93,43 +95,45 @@ FStringDoubleQuoteAtom=76 'return'=20 'call'=21 '->'=22 -'true'=23 -'false'=24 -'typeof'=25 -'void'=26 -'null'=27 -'undefined'=28 -','=29 -';'=30 -'?'=31 -':'=32 -'('=33 -')'=34 -'['=35 -']'=36 -'{'=38 -'}'=39 -'+'=40 -'++'=41 -'-'=42 -'--'=43 -'*'=44 -'/'=45 -'%'=46 -'**'=47 -'&&'=48 -'||'=49 -'!'=50 -'='=51 -'+='=52 -'-='=53 -'*='=54 -'/='=55 -'%='=56 -'=='=57 -'!='=58 -'<'=59 -'<='=60 -'>'=61 -'>='=62 -'.'=63 +'class'=23 +'interface'=24 +'true'=25 +'false'=26 +'typeof'=27 +'void'=28 +'null'=29 +'undefined'=30 +','=31 +';'=32 +'?'=33 +':'=34 +'('=35 +')'=36 +'['=37 +']'=38 +'{'=40 +'}'=41 +'+'=42 +'++'=43 +'-'=44 +'--'=45 +'*'=46 +'/'=47 +'%'=48 +'**'=49 +'&&'=50 +'||'=51 +'!'=52 +'='=53 +'+='=54 +'-='=55 +'*='=56 +'/='=57 +'%='=58 +'=='=59 +'!='=60 +'<'=61 +'<='=62 +'>'=63 +'>='=64 +'.'=65 diff --git a/kipper/core/src/compiler/parser/antlr/KipperParser.ts b/kipper/core/src/compiler/parser/antlr/KipperParser.ts index 050b76865..0ff166753 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParser.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperParser.ts @@ -1,9 +1,11 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT -// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax -// kind values. -import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; -import KipperParserBase from "./base/KipperParserBase"; + + // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax + // kind values. + import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; + import KipperParserBase from "./base/KipperParserBase"; + import { ATN } from "antlr4ts/atn/ATN"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; @@ -30,6 +32,7 @@ import * as Utils from "antlr4ts/misc/Utils"; import { KipperParserListener } from "./KipperParserListener"; import { KipperParserVisitor } from "./KipperParserVisitor"; + export class KipperParser extends KipperParserBase { public static readonly FStringExpStart = 1; public static readonly BlockComment = 2; @@ -53,356 +56,187 @@ export class KipperParser extends KipperParserBase { public static readonly Return = 20; public static readonly CallFunc = 21; public static readonly RetIndicator = 22; - public static readonly True = 23; - public static readonly False = 24; - public static readonly Typeof = 25; - public static readonly Void = 26; - public static readonly Null = 27; - public static readonly Undefined = 28; - public static readonly Comma = 29; - public static readonly SemiColon = 30; - public static readonly QuestionMark = 31; - public static readonly Colon = 32; - public static readonly LeftParen = 33; - public static readonly RightParen = 34; - public static readonly LeftBracket = 35; - public static readonly RightBracket = 36; - public static readonly FStringExpEnd = 37; - public static readonly LeftBrace = 38; - public static readonly RightBrace = 39; - public static readonly Plus = 40; - public static readonly PlusPlus = 41; - public static readonly Minus = 42; - public static readonly MinusMinus = 43; - public static readonly Star = 44; - public static readonly Div = 45; - public static readonly Mod = 46; - public static readonly PowerTo = 47; - public static readonly AndAnd = 48; - public static readonly OrOr = 49; - public static readonly Not = 50; - public static readonly Assign = 51; - public static readonly PlusAssign = 52; - public static readonly MinusAssign = 53; - public static readonly StarAssign = 54; - public static readonly DivAssign = 55; - public static readonly ModAssign = 56; - public static readonly Equal = 57; - public static readonly NotEqual = 58; - public static readonly Less = 59; - public static readonly LessEqual = 60; - public static readonly Greater = 61; - public static readonly GreaterEqual = 62; - public static readonly Dot = 63; - public static readonly Identifier = 64; - public static readonly IntegerConstant = 65; - public static readonly SingleQuoteStringLiteral = 66; - public static readonly DoubleQuoteStringLiteral = 67; - public static readonly FloatingConstant = 68; - public static readonly Whitespace = 69; - public static readonly Newline = 70; - public static readonly FStringSingleQuoteStart = 71; - public static readonly FStringDoubleQuoteStart = 72; - public static readonly FStringSingleQuoteEnd = 73; - public static readonly FStringSingleQuoteAtom = 74; - public static readonly FStringDoubleQuoteEnd = 75; - public static readonly FStringDoubleQuoteAtom = 76; + public static readonly Class = 23; + public static readonly Interface = 24; + public static readonly True = 25; + public static readonly False = 26; + public static readonly Typeof = 27; + public static readonly Void = 28; + public static readonly Null = 29; + public static readonly Undefined = 30; + public static readonly Comma = 31; + public static readonly SemiColon = 32; + public static readonly QuestionMark = 33; + public static readonly Colon = 34; + public static readonly LeftParen = 35; + public static readonly RightParen = 36; + public static readonly LeftBracket = 37; + public static readonly RightBracket = 38; + public static readonly FStringExpEnd = 39; + public static readonly LeftBrace = 40; + public static readonly RightBrace = 41; + public static readonly Plus = 42; + public static readonly PlusPlus = 43; + public static readonly Minus = 44; + public static readonly MinusMinus = 45; + public static readonly Star = 46; + public static readonly Div = 47; + public static readonly Mod = 48; + public static readonly PowerTo = 49; + public static readonly AndAnd = 50; + public static readonly OrOr = 51; + public static readonly Not = 52; + public static readonly Assign = 53; + public static readonly PlusAssign = 54; + public static readonly MinusAssign = 55; + public static readonly StarAssign = 56; + public static readonly DivAssign = 57; + public static readonly ModAssign = 58; + public static readonly Equal = 59; + public static readonly NotEqual = 60; + public static readonly Less = 61; + public static readonly LessEqual = 62; + public static readonly Greater = 63; + public static readonly GreaterEqual = 64; + public static readonly Dot = 65; + public static readonly Identifier = 66; + public static readonly IntegerConstant = 67; + public static readonly SingleQuoteStringLiteral = 68; + public static readonly DoubleQuoteStringLiteral = 69; + public static readonly FloatingConstant = 70; + public static readonly Whitespace = 71; + public static readonly Newline = 72; + public static readonly FStringSingleQuoteStart = 73; + public static readonly FStringDoubleQuoteStart = 74; + public static readonly FStringSingleQuoteEnd = 75; + public static readonly FStringSingleQuoteAtom = 76; + public static readonly FStringDoubleQuoteEnd = 77; + public static readonly FStringDoubleQuoteAtom = 78; public static readonly RULE_compilationUnit = 0; public static readonly RULE_translationUnit = 1; public static readonly RULE_externalItem = 2; public static readonly RULE_blockItemList = 3; public static readonly RULE_blockItem = 4; public static readonly RULE_declaration = 5; - public static readonly RULE_functionDeclaration = 6; - public static readonly RULE_variableDeclaration = 7; - public static readonly RULE_storageTypeSpecifier = 8; - public static readonly RULE_declarator = 9; - public static readonly RULE_directDeclarator = 10; - public static readonly RULE_initDeclarator = 11; - public static readonly RULE_parameterList = 12; - public static readonly RULE_parameterDeclaration = 13; - public static readonly RULE_initializer = 14; - public static readonly RULE_statement = 15; - public static readonly RULE_compoundStatement = 16; - public static readonly RULE_expressionStatement = 17; - public static readonly RULE_selectionStatement = 18; - public static readonly RULE_ifStatement = 19; - public static readonly RULE_switchStatement = 20; - public static readonly RULE_switchLabeledStatement = 21; - public static readonly RULE_iterationStatement = 22; - public static readonly RULE_forLoopIterationStatement = 23; - public static readonly RULE_whileLoopIterationStatement = 24; - public static readonly RULE_doWhileLoopIterationStatement = 25; - public static readonly RULE_jumpStatement = 26; - public static readonly RULE_returnStatement = 27; - public static readonly RULE_primaryExpression = 28; - public static readonly RULE_tangledPrimaryExpression = 29; - public static readonly RULE_boolPrimaryExpression = 30; - public static readonly RULE_identifierPrimaryExpression = 31; - public static readonly RULE_identifier = 32; - public static readonly RULE_identifierOrStringPrimaryExpression = 33; - public static readonly RULE_stringPrimaryExpression = 34; - public static readonly RULE_fStringPrimaryExpression = 35; - public static readonly RULE_fStringSingleQuoteAtom = 36; - public static readonly RULE_fStringDoubleQuoteAtom = 37; - public static readonly RULE_numberPrimaryExpression = 38; - public static readonly RULE_arrayPrimaryExpression = 39; - public static readonly RULE_objectPrimaryExpression = 40; - public static readonly RULE_objectProperty = 41; - public static readonly RULE_voidOrNullOrUndefinedPrimaryExpression = 42; - public static readonly RULE_computedPrimaryExpression = 43; - public static readonly RULE_argumentExpressionList = 44; - public static readonly RULE_dotNotation = 45; - public static readonly RULE_bracketNotation = 46; - public static readonly RULE_sliceNotation = 47; - public static readonly RULE_postfixExpression = 48; - public static readonly RULE_incrementOrDecrementPostfixExpression = 49; - public static readonly RULE_unaryExpression = 50; - public static readonly RULE_incrementOrDecrementUnaryExpression = 51; - public static readonly RULE_operatorModifiedUnaryExpression = 52; - public static readonly RULE_incrementOrDecrementOperator = 53; - public static readonly RULE_unaryOperator = 54; - public static readonly RULE_castOrConvertExpression = 55; - public static readonly RULE_multiplicativeExpression = 56; - public static readonly RULE_additiveExpression = 57; - public static readonly RULE_relationalExpression = 58; - public static readonly RULE_equalityExpression = 59; - public static readonly RULE_logicalAndExpression = 60; - public static readonly RULE_logicalOrExpression = 61; - public static readonly RULE_conditionalExpression = 62; - public static readonly RULE_assignmentExpression = 63; - public static readonly RULE_assignmentOperator = 64; - public static readonly RULE_expression = 65; - public static readonly RULE_typeSpecifierExpression = 66; - public static readonly RULE_identifierTypeSpecifierExpression = 67; - public static readonly RULE_genericTypeSpecifierExpression = 68; - public static readonly RULE_typeofTypeSpecifierExpression = 69; - public static readonly RULE_typeSpecifierIdentifier = 70; + public static readonly RULE_variableDeclaration = 6; + public static readonly RULE_storageTypeSpecifier = 7; + public static readonly RULE_initDeclarator = 8; + public static readonly RULE_initializer = 9; + public static readonly RULE_declarator = 10; + public static readonly RULE_directDeclarator = 11; + public static readonly RULE_functionDeclaration = 12; + public static readonly RULE_parameterList = 13; + public static readonly RULE_parameterDeclaration = 14; + public static readonly RULE_interfaceDeclaration = 15; + public static readonly RULE_classDeclaration = 16; + public static readonly RULE_statement = 17; + public static readonly RULE_compoundStatement = 18; + public static readonly RULE_expressionStatement = 19; + public static readonly RULE_selectionStatement = 20; + public static readonly RULE_ifStatement = 21; + public static readonly RULE_switchStatement = 22; + public static readonly RULE_switchLabeledStatement = 23; + public static readonly RULE_iterationStatement = 24; + public static readonly RULE_forLoopIterationStatement = 25; + public static readonly RULE_whileLoopIterationStatement = 26; + public static readonly RULE_doWhileLoopIterationStatement = 27; + public static readonly RULE_jumpStatement = 28; + public static readonly RULE_returnStatement = 29; + public static readonly RULE_primaryExpression = 30; + public static readonly RULE_tangledPrimaryExpression = 31; + public static readonly RULE_boolPrimaryExpression = 32; + public static readonly RULE_identifierPrimaryExpression = 33; + public static readonly RULE_identifier = 34; + public static readonly RULE_identifierOrStringPrimaryExpression = 35; + public static readonly RULE_stringPrimaryExpression = 36; + public static readonly RULE_fStringPrimaryExpression = 37; + public static readonly RULE_fStringSingleQuoteAtom = 38; + public static readonly RULE_fStringDoubleQuoteAtom = 39; + public static readonly RULE_numberPrimaryExpression = 40; + public static readonly RULE_arrayPrimaryExpression = 41; + public static readonly RULE_objectPrimaryExpression = 42; + public static readonly RULE_objectProperty = 43; + public static readonly RULE_voidOrNullOrUndefinedPrimaryExpression = 44; + public static readonly RULE_computedPrimaryExpression = 45; + public static readonly RULE_argumentExpressionList = 46; + public static readonly RULE_dotNotation = 47; + public static readonly RULE_bracketNotation = 48; + public static readonly RULE_sliceNotation = 49; + public static readonly RULE_postfixExpression = 50; + public static readonly RULE_incrementOrDecrementPostfixExpression = 51; + public static readonly RULE_unaryExpression = 52; + public static readonly RULE_incrementOrDecrementUnaryExpression = 53; + public static readonly RULE_operatorModifiedUnaryExpression = 54; + public static readonly RULE_incrementOrDecrementOperator = 55; + public static readonly RULE_unaryOperator = 56; + public static readonly RULE_castOrConvertExpression = 57; + public static readonly RULE_multiplicativeExpression = 58; + public static readonly RULE_additiveExpression = 59; + public static readonly RULE_relationalExpression = 60; + public static readonly RULE_equalityExpression = 61; + public static readonly RULE_logicalAndExpression = 62; + public static readonly RULE_logicalOrExpression = 63; + public static readonly RULE_conditionalExpression = 64; + public static readonly RULE_assignmentExpression = 65; + public static readonly RULE_assignmentOperator = 66; + public static readonly RULE_expression = 67; + public static readonly RULE_typeSpecifierExpression = 68; + public static readonly RULE_identifierTypeSpecifierExpression = 69; + public static readonly RULE_genericTypeSpecifierExpression = 70; + public static readonly RULE_typeofTypeSpecifierExpression = 71; + public static readonly RULE_typeSpecifierIdentifier = 72; // tslint:disable:no-trailing-whitespace public static readonly ruleNames: string[] = [ - "compilationUnit", - "translationUnit", - "externalItem", - "blockItemList", - "blockItem", - "declaration", - "functionDeclaration", - "variableDeclaration", - "storageTypeSpecifier", - "declarator", - "directDeclarator", - "initDeclarator", - "parameterList", - "parameterDeclaration", - "initializer", - "statement", - "compoundStatement", - "expressionStatement", - "selectionStatement", - "ifStatement", - "switchStatement", - "switchLabeledStatement", - "iterationStatement", - "forLoopIterationStatement", - "whileLoopIterationStatement", - "doWhileLoopIterationStatement", - "jumpStatement", - "returnStatement", - "primaryExpression", - "tangledPrimaryExpression", - "boolPrimaryExpression", - "identifierPrimaryExpression", - "identifier", - "identifierOrStringPrimaryExpression", - "stringPrimaryExpression", - "fStringPrimaryExpression", - "fStringSingleQuoteAtom", - "fStringDoubleQuoteAtom", - "numberPrimaryExpression", - "arrayPrimaryExpression", - "objectPrimaryExpression", - "objectProperty", - "voidOrNullOrUndefinedPrimaryExpression", - "computedPrimaryExpression", - "argumentExpressionList", - "dotNotation", - "bracketNotation", - "sliceNotation", - "postfixExpression", - "incrementOrDecrementPostfixExpression", - "unaryExpression", - "incrementOrDecrementUnaryExpression", - "operatorModifiedUnaryExpression", - "incrementOrDecrementOperator", - "unaryOperator", - "castOrConvertExpression", - "multiplicativeExpression", - "additiveExpression", - "relationalExpression", - "equalityExpression", - "logicalAndExpression", - "logicalOrExpression", - "conditionalExpression", - "assignmentExpression", - "assignmentOperator", - "expression", - "typeSpecifierExpression", - "identifierTypeSpecifierExpression", - "genericTypeSpecifierExpression", - "typeofTypeSpecifierExpression", - "typeSpecifierIdentifier", + "compilationUnit", "translationUnit", "externalItem", "blockItemList", + "blockItem", "declaration", "variableDeclaration", "storageTypeSpecifier", + "initDeclarator", "initializer", "declarator", "directDeclarator", "functionDeclaration", + "parameterList", "parameterDeclaration", "interfaceDeclaration", "classDeclaration", + "statement", "compoundStatement", "expressionStatement", "selectionStatement", + "ifStatement", "switchStatement", "switchLabeledStatement", "iterationStatement", + "forLoopIterationStatement", "whileLoopIterationStatement", "doWhileLoopIterationStatement", + "jumpStatement", "returnStatement", "primaryExpression", "tangledPrimaryExpression", + "boolPrimaryExpression", "identifierPrimaryExpression", "identifier", + "identifierOrStringPrimaryExpression", "stringPrimaryExpression", "fStringPrimaryExpression", + "fStringSingleQuoteAtom", "fStringDoubleQuoteAtom", "numberPrimaryExpression", + "arrayPrimaryExpression", "objectPrimaryExpression", "objectProperty", + "voidOrNullOrUndefinedPrimaryExpression", "computedPrimaryExpression", + "argumentExpressionList", "dotNotation", "bracketNotation", "sliceNotation", + "postfixExpression", "incrementOrDecrementPostfixExpression", "unaryExpression", + "incrementOrDecrementUnaryExpression", "operatorModifiedUnaryExpression", + "incrementOrDecrementOperator", "unaryOperator", "castOrConvertExpression", + "multiplicativeExpression", "additiveExpression", "relationalExpression", + "equalityExpression", "logicalAndExpression", "logicalOrExpression", "conditionalExpression", + "assignmentExpression", "assignmentOperator", "expression", "typeSpecifierExpression", + "identifierTypeSpecifierExpression", "genericTypeSpecifierExpression", + "typeofTypeSpecifierExpression", "typeSpecifierIdentifier", ]; private static readonly _LITERAL_NAMES: Array = [ - undefined, - undefined, - undefined, - undefined, - "'const'", - "'var'", - "'as'", - "'...'", - "'switch'", - "'case'", - "'default'", - "'break'", - "'continue'", - "'do'", - "'while'", - "'if'", - "'else'", - "'for'", - "'enum'", - "'def'", - "'return'", - "'call'", - "'->'", - "'true'", - "'false'", - "'typeof'", - "'void'", - "'null'", - "'undefined'", - "','", - "';'", - "'?'", - "':'", - "'('", - "')'", - "'['", - "']'", - undefined, - "'{'", - "'}'", - "'+'", - "'++'", - "'-'", - "'--'", - "'*'", - "'/'", - "'%'", - "'**'", - "'&&'", - "'||'", - "'!'", - "'='", - "'+='", - "'-='", - "'*='", - "'/='", - "'%='", - "'=='", - "'!='", - "'<'", - "'<='", - "'>'", - "'>='", - "'.'", + undefined, undefined, undefined, undefined, "'const'", "'var'", "'as'", + "'...'", "'switch'", "'case'", "'default'", "'break'", "'continue'", "'do'", + "'while'", "'if'", "'else'", "'for'", "'enum'", "'def'", "'return'", "'call'", + "'->'", "'class'", "'interface'", "'true'", "'false'", "'typeof'", "'void'", + "'null'", "'undefined'", "','", "';'", "'?'", "':'", "'('", "')'", "'['", + "']'", undefined, "'{'", "'}'", "'+'", "'++'", "'-'", "'--'", "'*'", "'/'", + "'%'", "'**'", "'&&'", "'||'", "'!'", "'='", "'+='", "'-='", "'*='", "'/='", + "'%='", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'.'", ]; private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, - "FStringExpStart", - "BlockComment", - "LineComment", - "Const", - "Var", - "As", - "Spread", - "Switch", - "Case", - "Default", - "Break", - "Continue", - "Do", - "While", - "If", - "Else", - "For", - "Enum", - "DefFunc", - "Return", - "CallFunc", - "RetIndicator", - "True", - "False", - "Typeof", - "Void", - "Null", - "Undefined", - "Comma", - "SemiColon", - "QuestionMark", - "Colon", - "LeftParen", - "RightParen", - "LeftBracket", - "RightBracket", - "FStringExpEnd", - "LeftBrace", - "RightBrace", - "Plus", - "PlusPlus", - "Minus", - "MinusMinus", - "Star", - "Div", - "Mod", - "PowerTo", - "AndAnd", - "OrOr", - "Not", - "Assign", - "PlusAssign", - "MinusAssign", - "StarAssign", - "DivAssign", - "ModAssign", - "Equal", - "NotEqual", - "Less", - "LessEqual", - "Greater", - "GreaterEqual", - "Dot", - "Identifier", - "IntegerConstant", - "SingleQuoteStringLiteral", - "DoubleQuoteStringLiteral", - "FloatingConstant", - "Whitespace", - "Newline", - "FStringSingleQuoteStart", - "FStringDoubleQuoteStart", - "FStringSingleQuoteEnd", - "FStringSingleQuoteAtom", - "FStringDoubleQuoteEnd", - "FStringDoubleQuoteAtom", + undefined, "FStringExpStart", "BlockComment", "LineComment", "Const", + "Var", "As", "Spread", "Switch", "Case", "Default", "Break", "Continue", + "Do", "While", "If", "Else", "For", "Enum", "DefFunc", "Return", "CallFunc", + "RetIndicator", "Class", "Interface", "True", "False", "Typeof", "Void", + "Null", "Undefined", "Comma", "SemiColon", "QuestionMark", "Colon", "LeftParen", + "RightParen", "LeftBracket", "RightBracket", "FStringExpEnd", "LeftBrace", + "RightBrace", "Plus", "PlusPlus", "Minus", "MinusMinus", "Star", "Div", + "Mod", "PowerTo", "AndAnd", "OrOr", "Not", "Assign", "PlusAssign", "MinusAssign", + "StarAssign", "DivAssign", "ModAssign", "Equal", "NotEqual", "Less", "LessEqual", + "Greater", "GreaterEqual", "Dot", "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", + "DoubleQuoteStringLiteral", "FloatingConstant", "Whitespace", "Newline", + "FStringSingleQuoteStart", "FStringDoubleQuoteStart", "FStringSingleQuoteEnd", + "FStringSingleQuoteAtom", "FStringDoubleQuoteEnd", "FStringDoubleQuoteAtom", ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( - KipperParser._LITERAL_NAMES, - KipperParser._SYMBOLIC_NAMES, - [], - ); + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(KipperParser._LITERAL_NAMES, KipperParser._SYMBOLIC_NAMES, []); // @Override // @NotNull @@ -412,19 +246,13 @@ export class KipperParser extends KipperParserBase { // tslint:enable:no-trailing-whitespace // @Override - public get grammarFileName(): string { - return "KipperParser.g4"; - } + public get grammarFileName(): string { return "KipperParser.g4"; } // @Override - public get ruleNames(): string[] { - return KipperParser.ruleNames; - } + public get ruleNames(): string[] { return KipperParser.ruleNames; } // @Override - public get serializedATN(): string { - return KipperParser._serializedATN; - } + public get serializedATN(): string { return KipperParser._serializedATN; } protected createFailedPredicateException(predicate?: string, message?: string): FailedPredicateException { return new FailedPredicateException(this, predicate, message); @@ -441,20 +269,21 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 143; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 0, this._ctx)) { - case 1: - { - this.state = 142; - this.translationUnit(); - } - break; + this.state = 147; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 0, this._ctx) ) { + case 1: + { + this.state = 146; + this.translationUnit(); } - this.state = 145; - this.match(KipperParser.EOF); + break; + } + this.state = 149; + this.match(KipperParser.EOF); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -462,7 +291,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -475,28 +305,29 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 148; - this._errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - this.state = 147; - this.externalItem(); - } - } - break; - default: - throw new NoViableAltException(this); + this.state = 152; + this._errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 151; + this.externalItem(); } - this.state = 150; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx); - } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 154; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -504,7 +335,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -517,10 +349,11 @@ export class KipperParser extends KipperParserBase { _localctx = new ExternalBlockItemContext(_localctx); this.enterOuterAlt(_localctx, 1); { - this.state = 152; - this.blockItemList(); + this.state = 156; + this.blockItemList(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -528,7 +361,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -541,28 +375,29 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 155; - this._errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - this.state = 154; - this.blockItem(); - } - } - break; - default: - throw new NoViableAltException(this); + this.state = 159; + this._errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 158; + this.blockItem(); } - this.state = 157; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); - } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 161; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -570,7 +405,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -582,32 +418,33 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 162; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 3, this._ctx)) { - case 1: - { - this.state = 159; - this.statement(); - } - break; + this.state = 166; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 3, this._ctx) ) { + case 1: + { + this.state = 163; + this.statement(); + } + break; - case 2: - { - this.state = 160; - this.declaration(); - } - break; + case 2: + { + this.state = 164; + this.declaration(); + } + break; - case 3: - { - this.state = 161; - this.match(KipperParser.SemiColon); - } - break; + case 3: + { + this.state = 165; + this.match(KipperParser.SemiColon); } + break; + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -615,7 +452,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -625,40 +463,45 @@ export class KipperParser extends KipperParserBase { let _localctx: DeclarationContext = new DeclarationContext(this._ctx, this.state); this.enterRule(_localctx, 10, KipperParser.RULE_declaration); try { - this.state = 171; + this.state = 174; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Const: - case KipperParser.Var: - this.enterOuterAlt(_localctx, 1); - { - this.state = 164; - this.variableDeclaration(); - this.state = 165; - this.match(KipperParser.SemiColon); - } - break; - case KipperParser.DefFunc: - this.enterOuterAlt(_localctx, 2); - { - this.state = 167; - this.functionDeclaration(); - this.state = 169; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 4, this._ctx)) { - case 1: - { - this.state = 168; - this.match(KipperParser.SemiColon); - } - break; - } - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Const: + case KipperParser.Var: + this.enterOuterAlt(_localctx, 1); + { + this.state = 168; + this.variableDeclaration(); + this.state = 169; + this.match(KipperParser.SemiColon); + } + break; + case KipperParser.DefFunc: + this.enterOuterAlt(_localctx, 2); + { + this.state = 171; + this.functionDeclaration(); + } + break; + case KipperParser.Interface: + this.enterOuterAlt(_localctx, 3); + { + this.state = 172; + this.interfaceDeclaration(); + } + break; + case KipperParser.Class: + this.enterOuterAlt(_localctx, 4); + { + this.state = 173; + this.classDeclaration(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -666,53 +509,62 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) - public functionDeclaration(): FunctionDeclarationContext { - let _localctx: FunctionDeclarationContext = new FunctionDeclarationContext(this._ctx, this.state); - this.enterRule(_localctx, 12, KipperParser.RULE_functionDeclaration); + public variableDeclaration(): VariableDeclarationContext { + let _localctx: VariableDeclarationContext = new VariableDeclarationContext(this._ctx, this.state); + this.enterRule(_localctx, 12, KipperParser.RULE_variableDeclaration); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 176; + this.storageTypeSpecifier(); + this.state = 177; + this.initDeclarator(); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public storageTypeSpecifier(): StorageTypeSpecifierContext { + let _localctx: StorageTypeSpecifierContext = new StorageTypeSpecifierContext(this._ctx, this.state); + this.enterRule(_localctx, 14, KipperParser.RULE_storageTypeSpecifier); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 173; - this.match(KipperParser.DefFunc); - this.state = 174; - this.declarator(); - this.state = 175; - this.match(KipperParser.LeftParen); - this.state = 177; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Identifier) { - { - this.state = 176; - this.parameterList(); - } + this.state = 179; + _la = this._input.LA(1); + if (!(_la === KipperParser.Const || _la === KipperParser.Var)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } - this.state = 179; - this.match(KipperParser.RightParen); - this.state = 180; - this.match(KipperParser.RetIndicator); - this.state = 181; - this.typeSpecifierExpression(); - this.state = 183; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 7, this._ctx)) { - case 1: - { - this.state = 182; - this.compoundStatement(); - } - break; - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -720,24 +572,41 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) - public variableDeclaration(): VariableDeclarationContext { - let _localctx: VariableDeclarationContext = new VariableDeclarationContext(this._ctx, this.state); - this.enterRule(_localctx, 14, KipperParser.RULE_variableDeclaration); + public initDeclarator(): InitDeclaratorContext { + let _localctx: InitDeclaratorContext = new InitDeclaratorContext(this._ctx, this.state); + this.enterRule(_localctx, 16, KipperParser.RULE_initDeclarator); + let _la: number; try { this.enterOuterAlt(_localctx, 1); { + this.state = 181; + this.declarator(); + this.state = 182; + this.match(KipperParser.Colon); + this.state = 183; + this.typeSpecifierExpression(); + this.state = 186; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Assign) { + { + this.state = 184; + this.match(KipperParser.Assign); this.state = 185; - this.storageTypeSpecifier(); - this.state = 186; - this.initDeclarator(); + this.initializer(); + } + } + } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -745,33 +614,24 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) - public storageTypeSpecifier(): StorageTypeSpecifierContext { - let _localctx: StorageTypeSpecifierContext = new StorageTypeSpecifierContext(this._ctx, this.state); - this.enterRule(_localctx, 16, KipperParser.RULE_storageTypeSpecifier); - let _la: number; + public initializer(): InitializerContext { + let _localctx: InitializerContext = new InitializerContext(this._ctx, this.state); + this.enterRule(_localctx, 18, KipperParser.RULE_initializer); try { this.enterOuterAlt(_localctx, 1); { - this.state = 188; - _la = this._input.LA(1); - if (!(_la === KipperParser.Const || _la === KipperParser.Var)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } + this.state = 188; + this.assignmentExpression(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -779,7 +639,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -787,14 +648,15 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public declarator(): DeclaratorContext { let _localctx: DeclaratorContext = new DeclaratorContext(this._ctx, this.state); - this.enterRule(_localctx, 18, KipperParser.RULE_declarator); + this.enterRule(_localctx, 20, KipperParser.RULE_declarator); try { this.enterOuterAlt(_localctx, 1); { - this.state = 190; - this.directDeclarator(); + this.state = 190; + this.directDeclarator(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -802,7 +664,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -810,14 +673,15 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public directDeclarator(): DirectDeclaratorContext { let _localctx: DirectDeclaratorContext = new DirectDeclaratorContext(this._ctx, this.state); - this.enterRule(_localctx, 20, KipperParser.RULE_directDeclarator); + this.enterRule(_localctx, 22, KipperParser.RULE_directDeclarator); try { this.enterOuterAlt(_localctx, 1); { - this.state = 192; - this.match(KipperParser.Identifier); + this.state = 192; + this.match(KipperParser.Identifier); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -825,38 +689,55 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) - public initDeclarator(): InitDeclaratorContext { - let _localctx: InitDeclaratorContext = new InitDeclaratorContext(this._ctx, this.state); - this.enterRule(_localctx, 22, KipperParser.RULE_initDeclarator); + public functionDeclaration(): FunctionDeclarationContext { + let _localctx: FunctionDeclarationContext = new FunctionDeclarationContext(this._ctx, this.state); + this.enterRule(_localctx, 24, KipperParser.RULE_functionDeclaration); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 194; - this.declarator(); - this.state = 195; - this.match(KipperParser.Colon); - this.state = 196; - this.typeSpecifierExpression(); - this.state = 199; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Assign) { - { - this.state = 197; - this.match(KipperParser.Assign); - this.state = 198; - this.initializer(); - } + this.state = 194; + this.match(KipperParser.DefFunc); + this.state = 195; + this.declarator(); + this.state = 196; + this.match(KipperParser.LeftParen); + this.state = 198; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Identifier) { + { + this.state = 197; + this.parameterList(); + } + } + + this.state = 200; + this.match(KipperParser.RightParen); + this.state = 201; + this.match(KipperParser.RetIndicator); + this.state = 202; + this.typeSpecifierExpression(); + this.state = 204; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 7, this._ctx) ) { + case 1: + { + this.state = 203; + this.compoundStatement(); } + break; } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -864,7 +745,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -872,31 +754,32 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public parameterList(): ParameterListContext { let _localctx: ParameterListContext = new ParameterListContext(this._ctx, this.state); - this.enterRule(_localctx, 24, KipperParser.RULE_parameterList); + this.enterRule(_localctx, 26, KipperParser.RULE_parameterList); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 201; + this.state = 206; + this.parameterDeclaration(); + this.state = 211; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.Comma) { + { + { + this.state = 207; + this.match(KipperParser.Comma); + this.state = 208; this.parameterDeclaration(); - this.state = 206; + } + } + this.state = 213; this._errHandler.sync(this); _la = this._input.LA(1); - while (_la === KipperParser.Comma) { - { - { - this.state = 202; - this.match(KipperParser.Comma); - this.state = 203; - this.parameterDeclaration(); - } - } - this.state = 208; - this._errHandler.sync(this); - _la = this._input.LA(1); - } } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -904,7 +787,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -912,18 +796,19 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public parameterDeclaration(): ParameterDeclarationContext { let _localctx: ParameterDeclarationContext = new ParameterDeclarationContext(this._ctx, this.state); - this.enterRule(_localctx, 26, KipperParser.RULE_parameterDeclaration); + this.enterRule(_localctx, 28, KipperParser.RULE_parameterDeclaration); try { this.enterOuterAlt(_localctx, 1); { - this.state = 209; - this.declarator(); - this.state = 210; - this.match(KipperParser.Colon); - this.state = 211; - this.typeSpecifierExpression(); + this.state = 214; + this.declarator(); + this.state = 215; + this.match(KipperParser.Colon); + this.state = 216; + this.typeSpecifierExpression(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -931,22 +816,30 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) - public initializer(): InitializerContext { - let _localctx: InitializerContext = new InitializerContext(this._ctx, this.state); - this.enterRule(_localctx, 28, KipperParser.RULE_initializer); + public interfaceDeclaration(): InterfaceDeclarationContext { + let _localctx: InterfaceDeclarationContext = new InterfaceDeclarationContext(this._ctx, this.state); + this.enterRule(_localctx, 30, KipperParser.RULE_interfaceDeclaration); try { this.enterOuterAlt(_localctx, 1); { - this.state = 213; - this.assignmentExpression(); + this.state = 218; + this.match(KipperParser.Interface); + this.state = 219; + this.match(KipperParser.Identifier); + this.state = 220; + this.match(KipperParser.LeftBrace); + this.state = 221; + this.match(KipperParser.RightBrace); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -954,68 +847,30 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) - public statement(): StatementContext { - let _localctx: StatementContext = new StatementContext(this._ctx, this.state); - this.enterRule(_localctx, 30, KipperParser.RULE_statement); + public classDeclaration(): ClassDeclarationContext { + let _localctx: ClassDeclarationContext = new ClassDeclarationContext(this._ctx, this.state); + this.enterRule(_localctx, 32, KipperParser.RULE_classDeclaration); try { - this.state = 221; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 10, this._ctx)) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 215; - this.expressionStatement(); - } - break; - - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 216; - this.selectionStatement(); - } - break; - - case 3: - this.enterOuterAlt(_localctx, 3); - { - this.state = 217; - this.iterationStatement(); - } - break; - - case 4: - this.enterOuterAlt(_localctx, 4); - { - this.state = 218; - this.jumpStatement(); - } - break; - - case 5: - this.enterOuterAlt(_localctx, 5); - { - this.state = 219; - this.returnStatement(); - } - break; - - case 6: - this.enterOuterAlt(_localctx, 6); - { - this.state = 220; - this.compoundStatement(); - } - break; + this.enterOuterAlt(_localctx, 1); + { + this.state = 223; + this.match(KipperParser.Class); + this.state = 224; + this.match(KipperParser.Identifier); + this.state = 225; + this.match(KipperParser.LeftBrace); + this.state = 226; + this.match(KipperParser.RightBrace); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1023,38 +878,111 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) - public compoundStatement(): CompoundStatementContext { - let _localctx: CompoundStatementContext = new CompoundStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 32, KipperParser.RULE_compoundStatement); + public statement(): StatementContext { + let _localctx: StatementContext = new StatementContext(this._ctx, this.state); + this.enterRule(_localctx, 34, KipperParser.RULE_statement); + try { + this.state = 234; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 9, this._ctx) ) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 228; + this.expressionStatement(); + } + break; + + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 229; + this.selectionStatement(); + } + break; + + case 3: + this.enterOuterAlt(_localctx, 3); + { + this.state = 230; + this.iterationStatement(); + } + break; + + case 4: + this.enterOuterAlt(_localctx, 4); + { + this.state = 231; + this.jumpStatement(); + } + break; + + case 5: + this.enterOuterAlt(_localctx, 5); + { + this.state = 232; + this.returnStatement(); + } + break; + + case 6: + this.enterOuterAlt(_localctx, 6); + { + this.state = 233; + this.compoundStatement(); + } + break; + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public compoundStatement(): CompoundStatementContext { + let _localctx: CompoundStatementContext = new CompoundStatementContext(this._ctx, this.state); + this.enterRule(_localctx, 36, KipperParser.RULE_compoundStatement); try { this.enterOuterAlt(_localctx, 1); { - this.state = 223; - if (!this.notInsideExpressionStatement()) { - throw this.createFailedPredicateException("this.notInsideExpressionStatement()"); - } - this.state = 224; - this.match(KipperParser.LeftBrace); - this.state = 226; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 11, this._ctx)) { - case 1: - { - this.state = 225; - this.blockItemList(); - } - break; + this.state = 236; + if (!(this.notInsideExpressionStatement())) { + throw this.createFailedPredicateException("this.notInsideExpressionStatement()"); + } + this.state = 237; + this.match(KipperParser.LeftBrace); + this.state = 239; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 10, this._ctx) ) { + case 1: + { + this.state = 238; + this.blockItemList(); } - this.state = 228; - this.match(KipperParser.RightBrace); + break; } - } catch (re) { + this.state = 241; + this.match(KipperParser.RightBrace); + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1062,7 +990,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1070,18 +999,19 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public expressionStatement(): ExpressionStatementContext { let _localctx: ExpressionStatementContext = new ExpressionStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 34, KipperParser.RULE_expressionStatement); + this.enterRule(_localctx, 38, KipperParser.RULE_expressionStatement); try { this.enterOuterAlt(_localctx, 1); { - this.enterExpressionStatement(); - this.state = 231; - this.expression(); - this.state = 232; - this.match(KipperParser.SemiColon); - this.exitExpressionStatement(); + this.enterExpressionStatement() + this.state = 244; + this.expression(); + this.state = 245; + this.match(KipperParser.SemiColon); + this.exitExpressionStatement() } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1089,7 +1019,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1097,29 +1028,30 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public selectionStatement(): SelectionStatementContext { let _localctx: SelectionStatementContext = new SelectionStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 36, KipperParser.RULE_selectionStatement); + this.enterRule(_localctx, 40, KipperParser.RULE_selectionStatement); try { - this.state = 237; + this.state = 250; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.If: - this.enterOuterAlt(_localctx, 1); - { - this.state = 235; - this.ifStatement(); - } - break; - case KipperParser.Switch: - this.enterOuterAlt(_localctx, 2); - { - this.state = 236; - this.switchStatement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.If: + this.enterOuterAlt(_localctx, 1); + { + this.state = 248; + this.ifStatement(); + } + break; + case KipperParser.Switch: + this.enterOuterAlt(_localctx, 2); + { + this.state = 249; + this.switchStatement(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1127,7 +1059,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1135,34 +1068,35 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public ifStatement(): IfStatementContext { let _localctx: IfStatementContext = new IfStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 38, KipperParser.RULE_ifStatement); + this.enterRule(_localctx, 42, KipperParser.RULE_ifStatement); try { this.enterOuterAlt(_localctx, 1); { - this.state = 239; - this.match(KipperParser.If); - this.state = 240; - this.match(KipperParser.LeftParen); - this.state = 241; - this.expression(); - this.state = 242; - this.match(KipperParser.RightParen); - this.state = 243; + this.state = 252; + this.match(KipperParser.If); + this.state = 253; + this.match(KipperParser.LeftParen); + this.state = 254; + this.expression(); + this.state = 255; + this.match(KipperParser.RightParen); + this.state = 256; + this.statement(); + this.state = 259; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 12, this._ctx) ) { + case 1: + { + this.state = 257; + this.match(KipperParser.Else); + this.state = 258; this.statement(); - this.state = 246; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 13, this._ctx)) { - case 1: - { - this.state = 244; - this.match(KipperParser.Else); - this.state = 245; - this.statement(); - } - break; } + break; + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1170,7 +1104,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1178,39 +1113,40 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public switchStatement(): SwitchStatementContext { let _localctx: SwitchStatementContext = new SwitchStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 40, KipperParser.RULE_switchStatement); + this.enterRule(_localctx, 44, KipperParser.RULE_switchStatement); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 248; - this.match(KipperParser.Switch); - this.state = 249; - this.match(KipperParser.LeftParen); - this.state = 250; - this.expression(); - this.state = 251; - this.match(KipperParser.RightParen); - this.state = 252; - this.match(KipperParser.LeftBrace); - this.state = 256; + this.state = 261; + this.match(KipperParser.Switch); + this.state = 262; + this.match(KipperParser.LeftParen); + this.state = 263; + this.expression(); + this.state = 264; + this.match(KipperParser.RightParen); + this.state = 265; + this.match(KipperParser.LeftBrace); + this.state = 269; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.Case || _la === KipperParser.Default) { + { + { + this.state = 266; + this.switchLabeledStatement(); + } + } + this.state = 271; this._errHandler.sync(this); _la = this._input.LA(1); - while (_la === KipperParser.Case || _la === KipperParser.Default) { - { - { - this.state = 253; - this.switchLabeledStatement(); - } - } - this.state = 258; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 259; - this.match(KipperParser.RightBrace); } - } catch (re) { + this.state = 272; + this.match(KipperParser.RightBrace); + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1218,7 +1154,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1226,39 +1163,40 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public switchLabeledStatement(): SwitchLabeledStatementContext { let _localctx: SwitchLabeledStatementContext = new SwitchLabeledStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 42, KipperParser.RULE_switchLabeledStatement); + this.enterRule(_localctx, 46, KipperParser.RULE_switchLabeledStatement); try { - this.state = 269; + this.state = 282; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Case: - this.enterOuterAlt(_localctx, 1); - { - this.state = 261; - this.match(KipperParser.Case); - this.state = 262; - this.expression(); - this.state = 263; - this.match(KipperParser.Colon); - this.state = 264; - this.statement(); - } - break; - case KipperParser.Default: - this.enterOuterAlt(_localctx, 2); - { - this.state = 266; - this.match(KipperParser.Default); - this.state = 267; - this.match(KipperParser.Colon); - this.state = 268; - this.statement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Case: + this.enterOuterAlt(_localctx, 1); + { + this.state = 274; + this.match(KipperParser.Case); + this.state = 275; + this.expression(); + this.state = 276; + this.match(KipperParser.Colon); + this.state = 277; + this.statement(); + } + break; + case KipperParser.Default: + this.enterOuterAlt(_localctx, 2); + { + this.state = 279; + this.match(KipperParser.Default); + this.state = 280; + this.match(KipperParser.Colon); + this.state = 281; + this.statement(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1266,7 +1204,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1274,36 +1213,37 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public iterationStatement(): IterationStatementContext { let _localctx: IterationStatementContext = new IterationStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 44, KipperParser.RULE_iterationStatement); + this.enterRule(_localctx, 48, KipperParser.RULE_iterationStatement); try { - this.state = 274; + this.state = 287; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.For: - this.enterOuterAlt(_localctx, 1); - { - this.state = 271; - this.forLoopIterationStatement(); - } - break; - case KipperParser.While: - this.enterOuterAlt(_localctx, 2); - { - this.state = 272; - this.whileLoopIterationStatement(); - } - break; - case KipperParser.Do: - this.enterOuterAlt(_localctx, 3); - { - this.state = 273; - this.doWhileLoopIterationStatement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.For: + this.enterOuterAlt(_localctx, 1); + { + this.state = 284; + this.forLoopIterationStatement(); + } + break; + case KipperParser.While: + this.enterOuterAlt(_localctx, 2); + { + this.state = 285; + this.whileLoopIterationStatement(); + } + break; + case KipperParser.Do: + this.enterOuterAlt(_localctx, 3); + { + this.state = 286; + this.doWhileLoopIterationStatement(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1311,7 +1251,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1319,184 +1260,96 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public forLoopIterationStatement(): ForLoopIterationStatementContext { let _localctx: ForLoopIterationStatementContext = new ForLoopIterationStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 46, KipperParser.RULE_forLoopIterationStatement); + this.enterRule(_localctx, 50, KipperParser.RULE_forLoopIterationStatement); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 276; - this.match(KipperParser.For); - this.state = 277; - this.match(KipperParser.LeftParen); - this.state = 284; + this.state = 289; + this.match(KipperParser.For); + this.state = 290; + this.match(KipperParser.LeftParen); + this.state = 297; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Const) | (1 << KipperParser.Var) | (1 << KipperParser.CallFunc) | (1 << KipperParser.True) | (1 << KipperParser.False) | (1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0) || ((((_la - 35)) & ~0x1F) === 0 && ((1 << (_la - 35)) & ((1 << (KipperParser.LeftParen - 35)) | (1 << (KipperParser.LeftBracket - 35)) | (1 << (KipperParser.LeftBrace - 35)) | (1 << (KipperParser.Plus - 35)) | (1 << (KipperParser.PlusPlus - 35)) | (1 << (KipperParser.Minus - 35)) | (1 << (KipperParser.MinusMinus - 35)) | (1 << (KipperParser.Not - 35)) | (1 << (KipperParser.Identifier - 35)))) !== 0) || ((((_la - 67)) & ~0x1F) === 0 && ((1 << (_la - 67)) & ((1 << (KipperParser.IntegerConstant - 67)) | (1 << (KipperParser.SingleQuoteStringLiteral - 67)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 67)) | (1 << (KipperParser.FloatingConstant - 67)) | (1 << (KipperParser.FStringSingleQuoteStart - 67)) | (1 << (KipperParser.FStringDoubleQuoteStart - 67)))) !== 0)) { + { + this.state = 293; this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - ((_la & ~0x1f) === 0 && - ((1 << _la) & - ((1 << KipperParser.Const) | - (1 << KipperParser.Var) | - (1 << KipperParser.CallFunc) | - (1 << KipperParser.True) | - (1 << KipperParser.False) | - (1 << KipperParser.Void) | - (1 << KipperParser.Null) | - (1 << KipperParser.Undefined))) !== - 0) || - (((_la - 33) & ~0x1f) === 0 && - ((1 << (_la - 33)) & - ((1 << (KipperParser.LeftParen - 33)) | - (1 << (KipperParser.LeftBracket - 33)) | - (1 << (KipperParser.LeftBrace - 33)) | - (1 << (KipperParser.Plus - 33)) | - (1 << (KipperParser.PlusPlus - 33)) | - (1 << (KipperParser.Minus - 33)) | - (1 << (KipperParser.MinusMinus - 33)) | - (1 << (KipperParser.Not - 33)) | - (1 << (KipperParser.Identifier - 33)))) !== - 0) || - (((_la - 65) & ~0x1f) === 0 && - ((1 << (_la - 65)) & - ((1 << (KipperParser.IntegerConstant - 65)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 65)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 65)) | - (1 << (KipperParser.FloatingConstant - 65)) | - (1 << (KipperParser.FStringSingleQuoteStart - 65)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 65)))) !== - 0) - ) { + switch (this._input.LA(1)) { + case KipperParser.Const: + case KipperParser.Var: { - this.state = 280; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case KipperParser.Const: - case KipperParser.Var: - { - this.state = 278; - this.variableDeclaration(); - } - break; - case KipperParser.CallFunc: - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Plus: - case KipperParser.PlusPlus: - case KipperParser.Minus: - case KipperParser.MinusMinus: - case KipperParser.Not: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - { - this.state = 279; - this.expression(); - } - break; - default: - throw new NoViableAltException(this); - } - _localctx._forDeclaration = true; + this.state = 291; + this.variableDeclaration(); } - } - - this.state = 286; - this.match(KipperParser.SemiColon); - this.state = 290; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 64) & ~0x1f) === 0 && - ((1 << (_la - 64)) & - ((1 << (KipperParser.Identifier - 64)) | - (1 << (KipperParser.IntegerConstant - 64)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 64)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 64)) | - (1 << (KipperParser.FloatingConstant - 64)) | - (1 << (KipperParser.FStringSingleQuoteStart - 64)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 64)))) !== - 0) - ) { + break; + case KipperParser.CallFunc: + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Plus: + case KipperParser.PlusPlus: + case KipperParser.Minus: + case KipperParser.MinusMinus: + case KipperParser.Not: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: { - this.state = 287; - this.expression(); - _localctx._forCondition = true; + this.state = 292; + this.expression(); } + break; + default: + throw new NoViableAltException(this); + } + _localctx._forDeclaration = true } + } - this.state = 292; - this.match(KipperParser.SemiColon); - this.state = 296; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 64) & ~0x1f) === 0 && - ((1 << (_la - 64)) & - ((1 << (KipperParser.Identifier - 64)) | - (1 << (KipperParser.IntegerConstant - 64)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 64)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 64)) | - (1 << (KipperParser.FloatingConstant - 64)) | - (1 << (KipperParser.FStringSingleQuoteStart - 64)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 64)))) !== - 0) - ) { - { - this.state = 293; - this.expression(); - _localctx._forIterationExp = true; - } + this.state = 299; + this.match(KipperParser.SemiColon); + this.state = 303; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { + { + this.state = 300; + this.expression(); + _localctx._forCondition = true } + } - this.state = 298; - this.match(KipperParser.RightParen); - this.state = 299; - this.statement(); + this.state = 305; + this.match(KipperParser.SemiColon); + this.state = 309; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { + { + this.state = 306; + this.expression(); + _localctx._forIterationExp = true + } } - } catch (re) { + + this.state = 311; + this.match(KipperParser.RightParen); + this.state = 312; + this.statement(); + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1504,7 +1357,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1512,22 +1366,23 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public whileLoopIterationStatement(): WhileLoopIterationStatementContext { let _localctx: WhileLoopIterationStatementContext = new WhileLoopIterationStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 48, KipperParser.RULE_whileLoopIterationStatement); + this.enterRule(_localctx, 52, KipperParser.RULE_whileLoopIterationStatement); try { this.enterOuterAlt(_localctx, 1); { - this.state = 301; - this.match(KipperParser.While); - this.state = 302; - this.match(KipperParser.LeftParen); - this.state = 303; - this.expression(); - this.state = 304; - this.match(KipperParser.RightParen); - this.state = 305; - this.statement(); - } - } catch (re) { + this.state = 314; + this.match(KipperParser.While); + this.state = 315; + this.match(KipperParser.LeftParen); + this.state = 316; + this.expression(); + this.state = 317; + this.match(KipperParser.RightParen); + this.state = 318; + this.statement(); + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1535,37 +1390,36 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public doWhileLoopIterationStatement(): DoWhileLoopIterationStatementContext { - let _localctx: DoWhileLoopIterationStatementContext = new DoWhileLoopIterationStatementContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 50, KipperParser.RULE_doWhileLoopIterationStatement); + let _localctx: DoWhileLoopIterationStatementContext = new DoWhileLoopIterationStatementContext(this._ctx, this.state); + this.enterRule(_localctx, 54, KipperParser.RULE_doWhileLoopIterationStatement); try { this.enterOuterAlt(_localctx, 1); { - this.state = 307; - this.match(KipperParser.Do); - this.state = 308; - this.statement(); - this.state = 309; - this.match(KipperParser.While); - this.state = 310; - this.match(KipperParser.LeftParen); - this.state = 311; - this.expression(); - this.state = 312; - this.match(KipperParser.RightParen); - this.state = 313; - this.match(KipperParser.SemiColon); - } - } catch (re) { + this.state = 320; + this.match(KipperParser.Do); + this.state = 321; + this.statement(); + this.state = 322; + this.match(KipperParser.While); + this.state = 323; + this.match(KipperParser.LeftParen); + this.state = 324; + this.expression(); + this.state = 325; + this.match(KipperParser.RightParen); + this.state = 326; + this.match(KipperParser.SemiColon); + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1573,7 +1427,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1581,27 +1436,28 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public jumpStatement(): JumpStatementContext { let _localctx: JumpStatementContext = new JumpStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 52, KipperParser.RULE_jumpStatement); + this.enterRule(_localctx, 56, KipperParser.RULE_jumpStatement); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 315; - _la = this._input.LA(1); - if (!(_la === KipperParser.Break || _la === KipperParser.Continue)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 328; + _la = this._input.LA(1); + if (!(_la === KipperParser.Break || _la === KipperParser.Continue)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } - this.state = 316; - this.match(KipperParser.SemiColon); + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 329; + this.match(KipperParser.SemiColon); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1609,7 +1465,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1617,55 +1474,28 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public returnStatement(): ReturnStatementContext { let _localctx: ReturnStatementContext = new ReturnStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 54, KipperParser.RULE_returnStatement); + this.enterRule(_localctx, 58, KipperParser.RULE_returnStatement); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 318; - this.match(KipperParser.Return); - this.state = 320; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 64) & ~0x1f) === 0 && - ((1 << (_la - 64)) & - ((1 << (KipperParser.Identifier - 64)) | - (1 << (KipperParser.IntegerConstant - 64)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 64)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 64)) | - (1 << (KipperParser.FloatingConstant - 64)) | - (1 << (KipperParser.FStringSingleQuoteStart - 64)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 64)))) !== - 0) - ) { - { - this.state = 319; - this.expression(); - } + this.state = 331; + this.match(KipperParser.Return); + this.state = 333; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { + { + this.state = 332; + this.expression(); } + } - this.state = 322; - this.match(KipperParser.SemiColon); + this.state = 335; + this.match(KipperParser.SemiColon); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1673,7 +1503,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1681,84 +1512,85 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public primaryExpression(): PrimaryExpressionContext { let _localctx: PrimaryExpressionContext = new PrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 56, KipperParser.RULE_primaryExpression); + this.enterRule(_localctx, 60, KipperParser.RULE_primaryExpression); try { - this.state = 333; + this.state = 346; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.LeftParen: - this.enterOuterAlt(_localctx, 1); - { - this.state = 324; - this.tangledPrimaryExpression(); - } - break; - case KipperParser.LeftBracket: - this.enterOuterAlt(_localctx, 2); - { - this.state = 325; - this.arrayPrimaryExpression(); - } - break; - case KipperParser.LeftBrace: - this.enterOuterAlt(_localctx, 3); - { - this.state = 326; - this.objectPrimaryExpression(); - } - break; - case KipperParser.True: - case KipperParser.False: - this.enterOuterAlt(_localctx, 4); - { - this.state = 327; - this.boolPrimaryExpression(); - } - break; - case KipperParser.Identifier: - this.enterOuterAlt(_localctx, 5); - { - this.state = 328; - this.identifierPrimaryExpression(); - } - break; - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - this.enterOuterAlt(_localctx, 6); - { - this.state = 329; - this.stringPrimaryExpression(); - } - break; - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 7); - { - this.state = 330; - this.fStringPrimaryExpression(); - } - break; - case KipperParser.IntegerConstant: - case KipperParser.FloatingConstant: - this.enterOuterAlt(_localctx, 8); - { - this.state = 331; - this.numberPrimaryExpression(); - } - break; - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - this.enterOuterAlt(_localctx, 9); - { - this.state = 332; - this.voidOrNullOrUndefinedPrimaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.LeftParen: + this.enterOuterAlt(_localctx, 1); + { + this.state = 337; + this.tangledPrimaryExpression(); + } + break; + case KipperParser.LeftBracket: + this.enterOuterAlt(_localctx, 2); + { + this.state = 338; + this.arrayPrimaryExpression(); + } + break; + case KipperParser.LeftBrace: + this.enterOuterAlt(_localctx, 3); + { + this.state = 339; + this.objectPrimaryExpression(); + } + break; + case KipperParser.True: + case KipperParser.False: + this.enterOuterAlt(_localctx, 4); + { + this.state = 340; + this.boolPrimaryExpression(); + } + break; + case KipperParser.Identifier: + this.enterOuterAlt(_localctx, 5); + { + this.state = 341; + this.identifierPrimaryExpression(); + } + break; + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + this.enterOuterAlt(_localctx, 6); + { + this.state = 342; + this.stringPrimaryExpression(); + } + break; + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 7); + { + this.state = 343; + this.fStringPrimaryExpression(); + } + break; + case KipperParser.IntegerConstant: + case KipperParser.FloatingConstant: + this.enterOuterAlt(_localctx, 8); + { + this.state = 344; + this.numberPrimaryExpression(); + } + break; + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + this.enterOuterAlt(_localctx, 9); + { + this.state = 345; + this.voidOrNullOrUndefinedPrimaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1766,7 +1598,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1774,18 +1607,19 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public tangledPrimaryExpression(): TangledPrimaryExpressionContext { let _localctx: TangledPrimaryExpressionContext = new TangledPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 58, KipperParser.RULE_tangledPrimaryExpression); + this.enterRule(_localctx, 62, KipperParser.RULE_tangledPrimaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 335; - this.match(KipperParser.LeftParen); - this.state = 336; - this.expression(); - this.state = 337; - this.match(KipperParser.RightParen); + this.state = 348; + this.match(KipperParser.LeftParen); + this.state = 349; + this.expression(); + this.state = 350; + this.match(KipperParser.RightParen); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1793,7 +1627,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1801,25 +1636,26 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public boolPrimaryExpression(): BoolPrimaryExpressionContext { let _localctx: BoolPrimaryExpressionContext = new BoolPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 60, KipperParser.RULE_boolPrimaryExpression); + this.enterRule(_localctx, 64, KipperParser.RULE_boolPrimaryExpression); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 339; - _la = this._input.LA(1); - if (!(_la === KipperParser.True || _la === KipperParser.False)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 352; + _la = this._input.LA(1); + if (!(_la === KipperParser.True || _la === KipperParser.False)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1827,7 +1663,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1835,14 +1672,15 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public identifierPrimaryExpression(): IdentifierPrimaryExpressionContext { let _localctx: IdentifierPrimaryExpressionContext = new IdentifierPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 62, KipperParser.RULE_identifierPrimaryExpression); + this.enterRule(_localctx, 66, KipperParser.RULE_identifierPrimaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 341; - this.identifier(); + this.state = 354; + this.identifier(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1850,7 +1688,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1858,14 +1697,15 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public identifier(): IdentifierContext { let _localctx: IdentifierContext = new IdentifierContext(this._ctx, this.state); - this.enterRule(_localctx, 64, KipperParser.RULE_identifier); + this.enterRule(_localctx, 68, KipperParser.RULE_identifier); try { this.enterOuterAlt(_localctx, 1); { - this.state = 343; - this.match(KipperParser.Identifier); + this.state = 356; + this.match(KipperParser.Identifier); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1873,41 +1713,40 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public identifierOrStringPrimaryExpression(): IdentifierOrStringPrimaryExpressionContext { - let _localctx: IdentifierOrStringPrimaryExpressionContext = new IdentifierOrStringPrimaryExpressionContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 66, KipperParser.RULE_identifierOrStringPrimaryExpression); + let _localctx: IdentifierOrStringPrimaryExpressionContext = new IdentifierOrStringPrimaryExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 70, KipperParser.RULE_identifierOrStringPrimaryExpression); try { - this.state = 347; + this.state = 360; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Identifier: - this.enterOuterAlt(_localctx, 1); - { - this.state = 345; - this.identifier(); - } - break; - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - this.enterOuterAlt(_localctx, 2); - { - this.state = 346; - this.stringPrimaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Identifier: + this.enterOuterAlt(_localctx, 1); + { + this.state = 358; + this.identifier(); + } + break; + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + this.enterOuterAlt(_localctx, 2); + { + this.state = 359; + this.stringPrimaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1915,7 +1754,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1923,25 +1763,26 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public stringPrimaryExpression(): StringPrimaryExpressionContext { let _localctx: StringPrimaryExpressionContext = new StringPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 68, KipperParser.RULE_stringPrimaryExpression); + this.enterRule(_localctx, 72, KipperParser.RULE_stringPrimaryExpression); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 349; - _la = this._input.LA(1); - if (!(_la === KipperParser.SingleQuoteStringLiteral || _la === KipperParser.DoubleQuoteStringLiteral)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 362; + _la = this._input.LA(1); + if (!(_la === KipperParser.SingleQuoteStringLiteral || _la === KipperParser.DoubleQuoteStringLiteral)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1949,7 +1790,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1957,62 +1799,63 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public fStringPrimaryExpression(): FStringPrimaryExpressionContext { let _localctx: FStringPrimaryExpressionContext = new FStringPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 70, KipperParser.RULE_fStringPrimaryExpression); + this.enterRule(_localctx, 74, KipperParser.RULE_fStringPrimaryExpression); let _la: number; try { - this.state = 367; + this.state = 380; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringSingleQuoteStart: - this.enterOuterAlt(_localctx, 1); + case KipperParser.FStringSingleQuoteStart: + this.enterOuterAlt(_localctx, 1); + { + this.state = 364; + this.match(KipperParser.FStringSingleQuoteStart); + this.state = 368; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringSingleQuoteAtom) { { - this.state = 351; - this.match(KipperParser.FStringSingleQuoteStart); - this.state = 355; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringSingleQuoteAtom) { - { - { - this.state = 352; - this.fStringSingleQuoteAtom(); - } - } - this.state = 357; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 358; - this.match(KipperParser.FStringSingleQuoteEnd); + { + this.state = 365; + this.fStringSingleQuoteAtom(); } - break; - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 2); + } + this.state = 370; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 371; + this.match(KipperParser.FStringSingleQuoteEnd); + } + break; + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 2); + { + this.state = 372; + this.match(KipperParser.FStringDoubleQuoteStart); + this.state = 376; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringDoubleQuoteAtom) { { - this.state = 359; - this.match(KipperParser.FStringDoubleQuoteStart); - this.state = 363; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringDoubleQuoteAtom) { - { - { - this.state = 360; - this.fStringDoubleQuoteAtom(); - } - } - this.state = 365; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 366; - this.match(KipperParser.FStringDoubleQuoteEnd); + { + this.state = 373; + this.fStringDoubleQuoteAtom(); } - break; - default: - throw new NoViableAltException(this); + } + this.state = 378; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 379; + this.match(KipperParser.FStringDoubleQuoteEnd); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2020,7 +1863,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2028,70 +1872,43 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public fStringSingleQuoteAtom(): FStringSingleQuoteAtomContext { let _localctx: FStringSingleQuoteAtomContext = new FStringSingleQuoteAtomContext(this._ctx, this.state); - this.enterRule(_localctx, 72, KipperParser.RULE_fStringSingleQuoteAtom); + this.enterRule(_localctx, 76, KipperParser.RULE_fStringSingleQuoteAtom); let _la: number; try { - this.state = 375; + this.state = 388; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringSingleQuoteAtom: - this.enterOuterAlt(_localctx, 1); + case KipperParser.FStringSingleQuoteAtom: + this.enterOuterAlt(_localctx, 1); + { + this.state = 382; + this.match(KipperParser.FStringSingleQuoteAtom); + } + break; + case KipperParser.FStringExpStart: + this.enterOuterAlt(_localctx, 2); + { + this.state = 383; + this.match(KipperParser.FStringExpStart); + this.state = 385; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { { - this.state = 369; - this.match(KipperParser.FStringSingleQuoteAtom); + this.state = 384; + this.expression(); } - break; - case KipperParser.FStringExpStart: - this.enterOuterAlt(_localctx, 2); - { - this.state = 370; - this.match(KipperParser.FStringExpStart); - this.state = 372; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 64) & ~0x1f) === 0 && - ((1 << (_la - 64)) & - ((1 << (KipperParser.Identifier - 64)) | - (1 << (KipperParser.IntegerConstant - 64)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 64)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 64)) | - (1 << (KipperParser.FloatingConstant - 64)) | - (1 << (KipperParser.FStringSingleQuoteStart - 64)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 64)))) !== - 0) - ) { - { - this.state = 371; - this.expression(); - } - } + } - this.state = 374; - this.match(KipperParser.FStringExpEnd); - } - break; - default: - throw new NoViableAltException(this); + this.state = 387; + this.match(KipperParser.FStringExpEnd); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2099,7 +1916,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2107,70 +1925,43 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public fStringDoubleQuoteAtom(): FStringDoubleQuoteAtomContext { let _localctx: FStringDoubleQuoteAtomContext = new FStringDoubleQuoteAtomContext(this._ctx, this.state); - this.enterRule(_localctx, 74, KipperParser.RULE_fStringDoubleQuoteAtom); + this.enterRule(_localctx, 78, KipperParser.RULE_fStringDoubleQuoteAtom); let _la: number; try { - this.state = 383; + this.state = 396; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringDoubleQuoteAtom: - this.enterOuterAlt(_localctx, 1); + case KipperParser.FStringDoubleQuoteAtom: + this.enterOuterAlt(_localctx, 1); + { + this.state = 390; + this.match(KipperParser.FStringDoubleQuoteAtom); + } + break; + case KipperParser.FStringExpStart: + this.enterOuterAlt(_localctx, 2); + { + this.state = 391; + this.match(KipperParser.FStringExpStart); + this.state = 393; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { { - this.state = 377; - this.match(KipperParser.FStringDoubleQuoteAtom); + this.state = 392; + this.expression(); } - break; - case KipperParser.FStringExpStart: - this.enterOuterAlt(_localctx, 2); - { - this.state = 378; - this.match(KipperParser.FStringExpStart); - this.state = 380; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 64) & ~0x1f) === 0 && - ((1 << (_la - 64)) & - ((1 << (KipperParser.Identifier - 64)) | - (1 << (KipperParser.IntegerConstant - 64)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 64)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 64)) | - (1 << (KipperParser.FloatingConstant - 64)) | - (1 << (KipperParser.FStringSingleQuoteStart - 64)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 64)))) !== - 0) - ) { - { - this.state = 379; - this.expression(); - } - } + } - this.state = 382; - this.match(KipperParser.FStringExpEnd); - } - break; - default: - throw new NoViableAltException(this); + this.state = 395; + this.match(KipperParser.FStringExpEnd); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2178,7 +1969,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2186,25 +1978,26 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public numberPrimaryExpression(): NumberPrimaryExpressionContext { let _localctx: NumberPrimaryExpressionContext = new NumberPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 76, KipperParser.RULE_numberPrimaryExpression); + this.enterRule(_localctx, 80, KipperParser.RULE_numberPrimaryExpression); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 385; - _la = this._input.LA(1); - if (!(_la === KipperParser.IntegerConstant || _la === KipperParser.FloatingConstant)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 398; + _la = this._input.LA(1); + if (!(_la === KipperParser.IntegerConstant || _la === KipperParser.FloatingConstant)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2212,7 +2005,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2220,84 +2014,57 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public arrayPrimaryExpression(): ArrayPrimaryExpressionContext { let _localctx: ArrayPrimaryExpressionContext = new ArrayPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 78, KipperParser.RULE_arrayPrimaryExpression); + this.enterRule(_localctx, 82, KipperParser.RULE_arrayPrimaryExpression); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 387; - this.match(KipperParser.LeftBracket); - this.state = 396; + this.state = 400; + this.match(KipperParser.LeftBracket); + this.state = 409; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { + { + this.state = 401; + this.expression(); + this.state = 406; this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 64) & ~0x1f) === 0 && - ((1 << (_la - 64)) & - ((1 << (KipperParser.Identifier - 64)) | - (1 << (KipperParser.IntegerConstant - 64)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 64)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 64)) | - (1 << (KipperParser.FloatingConstant - 64)) | - (1 << (KipperParser.FStringSingleQuoteStart - 64)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 64)))) !== - 0) - ) { - { - this.state = 388; + _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 402; + this.match(KipperParser.Comma); + this.state = 403; this.expression(); - this.state = 393; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 31, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 389; - this.match(KipperParser.Comma); - this.state = 390; - this.expression(); - } - } - } - this.state = 395; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 31, this._ctx); + } } } + this.state = 408; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); + } } + } - this.state = 399; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Comma) { - { - this.state = 398; - this.match(KipperParser.Comma); - } + this.state = 412; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Comma) { + { + this.state = 411; + this.match(KipperParser.Comma); } + } - this.state = 401; - this.match(KipperParser.RightBracket); + this.state = 414; + this.match(KipperParser.RightBracket); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2305,7 +2072,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2313,63 +2081,57 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public objectPrimaryExpression(): ObjectPrimaryExpressionContext { let _localctx: ObjectPrimaryExpressionContext = new ObjectPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 80, KipperParser.RULE_objectPrimaryExpression); + this.enterRule(_localctx, 84, KipperParser.RULE_objectPrimaryExpression); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 403; - this.match(KipperParser.LeftBrace); - this.state = 412; + this.state = 416; + this.match(KipperParser.LeftBrace); + this.state = 425; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)))) !== 0)) { + { + this.state = 417; + this.objectProperty(); + this.state = 422; this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - ((_la - 64) & ~0x1f) === 0 && - ((1 << (_la - 64)) & - ((1 << (KipperParser.Identifier - 64)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 64)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 64)))) !== - 0 - ) { - { - this.state = 404; + _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 418; + this.match(KipperParser.Comma); + this.state = 419; this.objectProperty(); - this.state = 409; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 34, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 405; - this.match(KipperParser.Comma); - this.state = 406; - this.objectProperty(); - } - } - } - this.state = 411; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 34, this._ctx); + } } } + this.state = 424; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); } + } + } - this.state = 415; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Comma) { - { - this.state = 414; - this.match(KipperParser.Comma); - } + this.state = 428; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Comma) { + { + this.state = 427; + this.match(KipperParser.Comma); } + } - this.state = 417; - this.match(KipperParser.RightBrace); + this.state = 430; + this.match(KipperParser.RightBrace); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2377,7 +2139,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2385,18 +2148,19 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public objectProperty(): ObjectPropertyContext { let _localctx: ObjectPropertyContext = new ObjectPropertyContext(this._ctx, this.state); - this.enterRule(_localctx, 82, KipperParser.RULE_objectProperty); + this.enterRule(_localctx, 86, KipperParser.RULE_objectProperty); try { this.enterOuterAlt(_localctx, 1); { - this.state = 419; - this.identifierOrStringPrimaryExpression(); - this.state = 420; - this.match(KipperParser.Colon); - this.state = 421; - this.expression(); + this.state = 432; + this.identifierOrStringPrimaryExpression(); + this.state = 433; + this.match(KipperParser.Colon); + this.state = 434; + this.expression(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2404,41 +2168,35 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public voidOrNullOrUndefinedPrimaryExpression(): VoidOrNullOrUndefinedPrimaryExpressionContext { - let _localctx: VoidOrNullOrUndefinedPrimaryExpressionContext = new VoidOrNullOrUndefinedPrimaryExpressionContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 84, KipperParser.RULE_voidOrNullOrUndefinedPrimaryExpression); + let _localctx: VoidOrNullOrUndefinedPrimaryExpressionContext = new VoidOrNullOrUndefinedPrimaryExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 88, KipperParser.RULE_voidOrNullOrUndefinedPrimaryExpression); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 423; - _la = this._input.LA(1); - if ( - !( - (_la & ~0x1f) === 0 && - ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 436; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2446,7 +2204,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2464,223 +2223,160 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: ComputedPrimaryExpressionContext = new ComputedPrimaryExpressionContext(this._ctx, _parentState); let _prevctx: ComputedPrimaryExpressionContext = _localctx; - let _startState: number = 86; - this.enterRecursionRule(_localctx, 86, KipperParser.RULE_computedPrimaryExpression, _p); + let _startState: number = 90; + this.enterRecursionRule(_localctx, 90, KipperParser.RULE_computedPrimaryExpression, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 436; + this.state = 449; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + { + _localctx = new PassOncomputedPrimaryExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 439; + this.primaryExpression(); + } + break; + case KipperParser.CallFunc: + { + _localctx = new ExplicitCallFunctionCallExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 440; + this.match(KipperParser.CallFunc); + this.state = 441; + this.computedPrimaryExpression(0); + this.state = 442; + this.match(KipperParser.LeftParen); + this.state = 444; this._errHandler.sync(this); - switch (this._input.LA(1)) { - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { + { + this.state = 443; + this.argumentExpressionList(); + } + } + + this.state = 446; + this.match(KipperParser.RightParen); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression + } + break; + default: + throw new NoViableAltException(this); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 472; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + this.state = 470; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 39, this._ctx) ) { + case 1: { - _localctx = new PassOncomputedPrimaryExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + _localctx = new FunctionCallExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 451; + if (!(this.precpred(this._ctx, 5))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 5)"); + } + this.state = 452; + this.match(KipperParser.LeftParen); + this.state = 454; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { + { + this.state = 453; + this.argumentExpressionList(); + } + } - this.state = 426; - this.primaryExpression(); + this.state = 456; + this.match(KipperParser.RightParen); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression } break; - case KipperParser.CallFunc: - { - _localctx = new ExplicitCallFunctionCallExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 427; - this.match(KipperParser.CallFunc); - this.state = 428; - this.computedPrimaryExpression(0); - this.state = 429; - this.match(KipperParser.LeftParen); - this.state = 431; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 64) & ~0x1f) === 0 && - ((1 << (_la - 64)) & - ((1 << (KipperParser.Identifier - 64)) | - (1 << (KipperParser.IntegerConstant - 64)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 64)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 64)) | - (1 << (KipperParser.FloatingConstant - 64)) | - (1 << (KipperParser.FStringSingleQuoteStart - 64)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 64)))) !== - 0) - ) { - { - this.state = 430; - this.argumentExpressionList(); - } - } - this.state = 433; - this.match(KipperParser.RightParen); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression; + case 2: + { + _localctx = new DotNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 458; + if (!(this.precpred(this._ctx, 3))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 3)"); + } + this.state = 459; + this.dotNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression } break; - default: - throw new NoViableAltException(this); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 459; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 41, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); + + case 3: + { + _localctx = new BracketNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 462; + if (!(this.precpred(this._ctx, 2))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 2)"); + } + this.state = 463; + this.bracketNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression } - _prevctx = _localctx; + break; + + case 4: { - this.state = 457; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 40, this._ctx)) { - case 1: - { - _localctx = new FunctionCallExpressionContext( - new ComputedPrimaryExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 438; - if (!this.precpred(this._ctx, 5)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 5)"); - } - this.state = 439; - this.match(KipperParser.LeftParen); - this.state = 441; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 64) & ~0x1f) === 0 && - ((1 << (_la - 64)) & - ((1 << (KipperParser.Identifier - 64)) | - (1 << (KipperParser.IntegerConstant - 64)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 64)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 64)) | - (1 << (KipperParser.FloatingConstant - 64)) | - (1 << (KipperParser.FStringSingleQuoteStart - 64)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 64)))) !== - 0) - ) { - { - this.state = 440; - this.argumentExpressionList(); - } - } - - this.state = 443; - this.match(KipperParser.RightParen); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression; - } - break; - - case 2: - { - _localctx = new DotNotationMemberAccessExpressionContext( - new ComputedPrimaryExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 445; - if (!this.precpred(this._ctx, 3)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 3)"); - } - this.state = 446; - this.dotNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; - } - break; - - case 3: - { - _localctx = new BracketNotationMemberAccessExpressionContext( - new ComputedPrimaryExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 449; - if (!this.precpred(this._ctx, 2)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 2)"); - } - this.state = 450; - this.bracketNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; - } - break; - - case 4: - { - _localctx = new SliceNotationMemberAccessExpressionContext( - new ComputedPrimaryExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 453; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 454; - this.sliceNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; - } - break; - } + _localctx = new SliceNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 466; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 467; + this.sliceNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression } + break; + } } - this.state = 461; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 41, this._ctx); } + this.state = 474; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2688,7 +2384,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -2696,31 +2393,32 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public argumentExpressionList(): ArgumentExpressionListContext { let _localctx: ArgumentExpressionListContext = new ArgumentExpressionListContext(this._ctx, this.state); - this.enterRule(_localctx, 88, KipperParser.RULE_argumentExpressionList); + this.enterRule(_localctx, 92, KipperParser.RULE_argumentExpressionList); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 462; + this.state = 475; + this.assignmentExpression(); + this.state = 480; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.Comma) { + { + { + this.state = 476; + this.match(KipperParser.Comma); + this.state = 477; this.assignmentExpression(); - this.state = 467; + } + } + this.state = 482; this._errHandler.sync(this); _la = this._input.LA(1); - while (_la === KipperParser.Comma) { - { - { - this.state = 463; - this.match(KipperParser.Comma); - this.state = 464; - this.assignmentExpression(); - } - } - this.state = 469; - this._errHandler.sync(this); - _la = this._input.LA(1); - } } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2728,7 +2426,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2736,16 +2435,17 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public dotNotation(): DotNotationContext { let _localctx: DotNotationContext = new DotNotationContext(this._ctx, this.state); - this.enterRule(_localctx, 90, KipperParser.RULE_dotNotation); + this.enterRule(_localctx, 94, KipperParser.RULE_dotNotation); try { this.enterOuterAlt(_localctx, 1); { - this.state = 470; - this.match(KipperParser.Dot); - this.state = 471; - this.identifier(); + this.state = 483; + this.match(KipperParser.Dot); + this.state = 484; + this.identifier(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2753,7 +2453,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2761,18 +2462,19 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public bracketNotation(): BracketNotationContext { let _localctx: BracketNotationContext = new BracketNotationContext(this._ctx, this.state); - this.enterRule(_localctx, 92, KipperParser.RULE_bracketNotation); + this.enterRule(_localctx, 96, KipperParser.RULE_bracketNotation); try { this.enterOuterAlt(_localctx, 1); { - this.state = 473; - this.match(KipperParser.LeftBracket); - this.state = 474; - this.expression(); - this.state = 475; - this.match(KipperParser.RightBracket); + this.state = 486; + this.match(KipperParser.LeftBracket); + this.state = 487; + this.expression(); + this.state = 488; + this.match(KipperParser.RightBracket); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2780,7 +2482,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2788,97 +2491,42 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public sliceNotation(): SliceNotationContext { let _localctx: SliceNotationContext = new SliceNotationContext(this._ctx, this.state); - this.enterRule(_localctx, 94, KipperParser.RULE_sliceNotation); + this.enterRule(_localctx, 98, KipperParser.RULE_sliceNotation); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 477; - this.match(KipperParser.LeftBracket); - this.state = 481; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 64) & ~0x1f) === 0 && - ((1 << (_la - 64)) & - ((1 << (KipperParser.Identifier - 64)) | - (1 << (KipperParser.IntegerConstant - 64)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 64)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 64)) | - (1 << (KipperParser.FloatingConstant - 64)) | - (1 << (KipperParser.FStringSingleQuoteStart - 64)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 64)))) !== - 0) - ) { - { - this.state = 478; - this.expression(); - _localctx.sliceStart = true; - } + this.state = 490; + this.match(KipperParser.LeftBracket); + this.state = 494; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { + { + this.state = 491; + this.expression(); + _localctx.sliceStart = true } + } - this.state = 483; - this.match(KipperParser.Colon); - this.state = 487; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 64) & ~0x1f) === 0 && - ((1 << (_la - 64)) & - ((1 << (KipperParser.Identifier - 64)) | - (1 << (KipperParser.IntegerConstant - 64)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 64)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 64)) | - (1 << (KipperParser.FloatingConstant - 64)) | - (1 << (KipperParser.FStringSingleQuoteStart - 64)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 64)))) !== - 0) - ) { - { - this.state = 484; - this.expression(); - _localctx.sliceEnd = true; - } + this.state = 496; + this.match(KipperParser.Colon); + this.state = 500; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { + { + this.state = 497; + this.expression(); + _localctx.sliceEnd = true } + } - this.state = 489; - this.match(KipperParser.RightBracket); + this.state = 502; + this.match(KipperParser.RightBracket); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2886,7 +2534,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2894,28 +2543,29 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public postfixExpression(): PostfixExpressionContext { let _localctx: PostfixExpressionContext = new PostfixExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 96, KipperParser.RULE_postfixExpression); + this.enterRule(_localctx, 100, KipperParser.RULE_postfixExpression); try { - this.state = 493; + this.state = 506; this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 45, this._ctx)) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 491; - this.computedPrimaryExpression(0); - } - break; + switch ( this.interpreter.adaptivePredict(this._input, 44, this._ctx) ) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 504; + this.computedPrimaryExpression(0); + } + break; - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 492; - this.incrementOrDecrementPostfixExpression(); - } - break; + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 505; + this.incrementOrDecrementPostfixExpression(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2923,27 +2573,26 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public incrementOrDecrementPostfixExpression(): IncrementOrDecrementPostfixExpressionContext { - let _localctx: IncrementOrDecrementPostfixExpressionContext = new IncrementOrDecrementPostfixExpressionContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 98, KipperParser.RULE_incrementOrDecrementPostfixExpression); + let _localctx: IncrementOrDecrementPostfixExpressionContext = new IncrementOrDecrementPostfixExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 102, KipperParser.RULE_incrementOrDecrementPostfixExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 495; - this.computedPrimaryExpression(0); - this.state = 496; - this.incrementOrDecrementOperator(); + this.state = 508; + this.computedPrimaryExpression(0); + this.state = 509; + this.incrementOrDecrementOperator(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2951,62 +2600,64 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { - this.exitRule(); - } - return _localctx; - } - // @RuleVersion(0) - public unaryExpression(): UnaryExpressionContext { - let _localctx: UnaryExpressionContext = new UnaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 100, KipperParser.RULE_unaryExpression); - try { - this.state = 501; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case KipperParser.CallFunc: - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 1); - { - this.state = 498; - this.postfixExpression(); - } - break; - case KipperParser.PlusPlus: - case KipperParser.MinusMinus: - this.enterOuterAlt(_localctx, 2); - { - this.state = 499; - this.incrementOrDecrementUnaryExpression(); - } - break; - case KipperParser.Plus: - case KipperParser.Minus: - case KipperParser.Not: - this.enterOuterAlt(_localctx, 3); - { - this.state = 500; - this.operatorModifiedUnaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public unaryExpression(): UnaryExpressionContext { + let _localctx: UnaryExpressionContext = new UnaryExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 104, KipperParser.RULE_unaryExpression); + try { + this.state = 514; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case KipperParser.CallFunc: + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 1); + { + this.state = 511; + this.postfixExpression(); + } + break; + case KipperParser.PlusPlus: + case KipperParser.MinusMinus: + this.enterOuterAlt(_localctx, 2); + { + this.state = 512; + this.incrementOrDecrementUnaryExpression(); + } + break; + case KipperParser.Plus: + case KipperParser.Minus: + case KipperParser.Not: + this.enterOuterAlt(_localctx, 3); + { + this.state = 513; + this.operatorModifiedUnaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3014,27 +2665,26 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public incrementOrDecrementUnaryExpression(): IncrementOrDecrementUnaryExpressionContext { - let _localctx: IncrementOrDecrementUnaryExpressionContext = new IncrementOrDecrementUnaryExpressionContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 102, KipperParser.RULE_incrementOrDecrementUnaryExpression); + let _localctx: IncrementOrDecrementUnaryExpressionContext = new IncrementOrDecrementUnaryExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 106, KipperParser.RULE_incrementOrDecrementUnaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 503; - this.incrementOrDecrementOperator(); - this.state = 504; - this.postfixExpression(); + this.state = 516; + this.incrementOrDecrementOperator(); + this.state = 517; + this.postfixExpression(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3042,27 +2692,26 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public operatorModifiedUnaryExpression(): OperatorModifiedUnaryExpressionContext { - let _localctx: OperatorModifiedUnaryExpressionContext = new OperatorModifiedUnaryExpressionContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 104, KipperParser.RULE_operatorModifiedUnaryExpression); + let _localctx: OperatorModifiedUnaryExpressionContext = new OperatorModifiedUnaryExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 108, KipperParser.RULE_operatorModifiedUnaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 506; - this.unaryOperator(); - this.state = 507; - this.postfixExpression(); + this.state = 519; + this.unaryOperator(); + this.state = 520; + this.postfixExpression(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3070,7 +2719,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3078,25 +2728,26 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public incrementOrDecrementOperator(): IncrementOrDecrementOperatorContext { let _localctx: IncrementOrDecrementOperatorContext = new IncrementOrDecrementOperatorContext(this._ctx, this.state); - this.enterRule(_localctx, 106, KipperParser.RULE_incrementOrDecrementOperator); + this.enterRule(_localctx, 110, KipperParser.RULE_incrementOrDecrementOperator); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 509; - _la = this._input.LA(1); - if (!(_la === KipperParser.PlusPlus || _la === KipperParser.MinusMinus)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 522; + _la = this._input.LA(1); + if (!(_la === KipperParser.PlusPlus || _la === KipperParser.MinusMinus)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3104,7 +2755,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3112,32 +2764,26 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public unaryOperator(): UnaryOperatorContext { let _localctx: UnaryOperatorContext = new UnaryOperatorContext(this._ctx, this.state); - this.enterRule(_localctx, 108, KipperParser.RULE_unaryOperator); + this.enterRule(_localctx, 112, KipperParser.RULE_unaryOperator); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 511; - _la = this._input.LA(1); - if ( - !( - ((_la - 40) & ~0x1f) === 0 && - ((1 << (_la - 40)) & - ((1 << (KipperParser.Plus - 40)) | (1 << (KipperParser.Minus - 40)) | (1 << (KipperParser.Not - 40)))) !== - 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 524; + _la = this._input.LA(1); + if (!(((((_la - 42)) & ~0x1F) === 0 && ((1 << (_la - 42)) & ((1 << (KipperParser.Plus - 42)) | (1 << (KipperParser.Minus - 42)) | (1 << (KipperParser.Not - 42)))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3145,7 +2791,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3153,34 +2800,35 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public castOrConvertExpression(): CastOrConvertExpressionContext { let _localctx: CastOrConvertExpressionContext = new CastOrConvertExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 110, KipperParser.RULE_castOrConvertExpression); + this.enterRule(_localctx, 114, KipperParser.RULE_castOrConvertExpression); try { - this.state = 518; + this.state = 531; this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 47, this._ctx)) { - case 1: - _localctx = new PassOnCastOrConvertExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 513; - this.unaryExpression(); - } - break; + switch ( this.interpreter.adaptivePredict(this._input, 46, this._ctx) ) { + case 1: + _localctx = new PassOnCastOrConvertExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 526; + this.unaryExpression(); + } + break; - case 2: - _localctx = new ActualCastOrConvertExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 514; - this.unaryExpression(); - this.state = 515; - this.match(KipperParser.As); - this.state = 516; - this.typeSpecifierExpression(); - } - break; + case 2: + _localctx = new ActualCastOrConvertExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 527; + this.unaryExpression(); + this.state = 528; + this.match(KipperParser.As); + this.state = 529; + this.typeSpecifierExpression(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3188,7 +2836,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3206,74 +2855,63 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: MultiplicativeExpressionContext = new MultiplicativeExpressionContext(this._ctx, _parentState); let _prevctx: MultiplicativeExpressionContext = _localctx; - let _startState: number = 112; - this.enterRecursionRule(_localctx, 112, KipperParser.RULE_multiplicativeExpression, _p); + let _startState: number = 116; + this.enterRecursionRule(_localctx, 116, KipperParser.RULE_multiplicativeExpression, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnMultiplicativeExpressionContext(_localctx); - this._ctx = _localctx; + { + _localctx = new PassOnMultiplicativeExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 534; + this.castOrConvertExpression(); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 541; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 47, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } _prevctx = _localctx; + { + { + _localctx = new ActualMultiplicativeExpressionContext(new MultiplicativeExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_multiplicativeExpression); + this.state = 536; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 537; + _la = this._input.LA(1); + if (!(((((_la - 46)) & ~0x1F) === 0 && ((1 << (_la - 46)) & ((1 << (KipperParser.Star - 46)) | (1 << (KipperParser.Div - 46)) | (1 << (KipperParser.Mod - 46)) | (1 << (KipperParser.PowerTo - 46)))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this.state = 521; + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 538; this.castOrConvertExpression(); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 528; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 48, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualMultiplicativeExpressionContext( - new MultiplicativeExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_multiplicativeExpression); - this.state = 523; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 524; - _la = this._input.LA(1); - if ( - !( - ((_la - 44) & ~0x1f) === 0 && - ((1 << (_la - 44)) & - ((1 << (KipperParser.Star - 44)) | - (1 << (KipperParser.Div - 44)) | - (1 << (KipperParser.Mod - 44)) | - (1 << (KipperParser.PowerTo - 44)))) !== - 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 525; - this.castOrConvertExpression(); - } - } } - this.state = 530; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 48, this._ctx); + } } + this.state = 543; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 47, this._ctx); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3281,7 +2919,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3299,64 +2938,63 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: AdditiveExpressionContext = new AdditiveExpressionContext(this._ctx, _parentState); let _prevctx: AdditiveExpressionContext = _localctx; - let _startState: number = 114; - this.enterRecursionRule(_localctx, 114, KipperParser.RULE_additiveExpression, _p); + let _startState: number = 118; + this.enterRecursionRule(_localctx, 118, KipperParser.RULE_additiveExpression, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnAdditiveExpressionContext(_localctx); - this._ctx = _localctx; + { + _localctx = new PassOnAdditiveExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 545; + this.multiplicativeExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 552; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 48, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } _prevctx = _localctx; + { + { + _localctx = new ActualAdditiveExpressionContext(new AdditiveExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_additiveExpression); + this.state = 547; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 548; + _la = this._input.LA(1); + if (!(_la === KipperParser.Plus || _la === KipperParser.Minus)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this.state = 532; + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 549; this.multiplicativeExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 539; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 49, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualAdditiveExpressionContext( - new AdditiveExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_additiveExpression); - this.state = 534; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 535; - _la = this._input.LA(1); - if (!(_la === KipperParser.Plus || _la === KipperParser.Minus)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 536; - this.multiplicativeExpression(0); - } - } } - this.state = 541; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 49, this._ctx); + } } + this.state = 554; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 48, this._ctx); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3364,7 +3002,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3382,74 +3021,63 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: RelationalExpressionContext = new RelationalExpressionContext(this._ctx, _parentState); let _prevctx: RelationalExpressionContext = _localctx; - let _startState: number = 116; - this.enterRecursionRule(_localctx, 116, KipperParser.RULE_relationalExpression, _p); + let _startState: number = 120; + this.enterRecursionRule(_localctx, 120, KipperParser.RULE_relationalExpression, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnRelationalExpressionContext(_localctx); - this._ctx = _localctx; + { + _localctx = new PassOnRelationalExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 556; + this.additiveExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 563; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 49, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } _prevctx = _localctx; + { + { + _localctx = new ActualRelationalExpressionContext(new RelationalExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_relationalExpression); + this.state = 558; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 559; + _la = this._input.LA(1); + if (!(((((_la - 61)) & ~0x1F) === 0 && ((1 << (_la - 61)) & ((1 << (KipperParser.Less - 61)) | (1 << (KipperParser.LessEqual - 61)) | (1 << (KipperParser.Greater - 61)) | (1 << (KipperParser.GreaterEqual - 61)))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this.state = 543; + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 560; this.additiveExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 550; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 50, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualRelationalExpressionContext( - new RelationalExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_relationalExpression); - this.state = 545; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 546; - _la = this._input.LA(1); - if ( - !( - ((_la - 59) & ~0x1f) === 0 && - ((1 << (_la - 59)) & - ((1 << (KipperParser.Less - 59)) | - (1 << (KipperParser.LessEqual - 59)) | - (1 << (KipperParser.Greater - 59)) | - (1 << (KipperParser.GreaterEqual - 59)))) !== - 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 547; - this.additiveExpression(0); - } - } } - this.state = 552; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 50, this._ctx); + } } + this.state = 565; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 49, this._ctx); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3457,7 +3085,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3475,64 +3104,63 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: EqualityExpressionContext = new EqualityExpressionContext(this._ctx, _parentState); let _prevctx: EqualityExpressionContext = _localctx; - let _startState: number = 118; - this.enterRecursionRule(_localctx, 118, KipperParser.RULE_equalityExpression, _p); + let _startState: number = 122; + this.enterRecursionRule(_localctx, 122, KipperParser.RULE_equalityExpression, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnEqualityExpressionContext(_localctx); - this._ctx = _localctx; + { + _localctx = new PassOnEqualityExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 567; + this.relationalExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 574; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 50, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } _prevctx = _localctx; + { + { + _localctx = new ActualEqualityExpressionContext(new EqualityExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_equalityExpression); + this.state = 569; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 570; + _la = this._input.LA(1); + if (!(_la === KipperParser.Equal || _la === KipperParser.NotEqual)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this.state = 554; + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 571; this.relationalExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 561; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualEqualityExpressionContext( - new EqualityExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_equalityExpression); - this.state = 556; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 557; - _la = this._input.LA(1); - if (!(_la === KipperParser.Equal || _la === KipperParser.NotEqual)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 558; - this.relationalExpression(0); - } - } } - this.state = 563; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); + } } + this.state = 576; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 50, this._ctx); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3540,7 +3168,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3558,53 +3187,52 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: LogicalAndExpressionContext = new LogicalAndExpressionContext(this._ctx, _parentState); let _prevctx: LogicalAndExpressionContext = _localctx; - let _startState: number = 120; - this.enterRecursionRule(_localctx, 120, KipperParser.RULE_logicalAndExpression, _p); + let _startState: number = 124; + this.enterRecursionRule(_localctx, 124, KipperParser.RULE_logicalAndExpression, _p); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnLogicalAndExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + { + _localctx = new PassOnLogicalAndExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 565; + this.state = 578; + this.equalityExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 585; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualLogicalAndExpressionContext(new LogicalAndExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalAndExpression); + this.state = 580; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 581; + this.match(KipperParser.AndAnd); + this.state = 582; this.equalityExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 572; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualLogicalAndExpressionContext( - new LogicalAndExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalAndExpression); - this.state = 567; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 568; - this.match(KipperParser.AndAnd); - this.state = 569; - this.equalityExpression(0); - } - } } - this.state = 574; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); + } } + this.state = 587; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3612,7 +3240,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3630,53 +3259,52 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: LogicalOrExpressionContext = new LogicalOrExpressionContext(this._ctx, _parentState); let _prevctx: LogicalOrExpressionContext = _localctx; - let _startState: number = 122; - this.enterRecursionRule(_localctx, 122, KipperParser.RULE_logicalOrExpression, _p); + let _startState: number = 126; + this.enterRecursionRule(_localctx, 126, KipperParser.RULE_logicalOrExpression, _p); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnLogicalOrExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + { + _localctx = new PassOnLogicalOrExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 576; + this.state = 589; + this.logicalAndExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 596; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualLogicalOrExpressionContext(new LogicalOrExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalOrExpression); + this.state = 591; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 592; + this.match(KipperParser.OrOr); + this.state = 593; this.logicalAndExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 583; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 53, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualLogicalOrExpressionContext( - new LogicalOrExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalOrExpression); - this.state = 578; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 579; - this.match(KipperParser.OrOr); - this.state = 580; - this.logicalAndExpression(0); - } - } } - this.state = 585; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 53, this._ctx); + } } + this.state = 598; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3684,7 +3312,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3692,38 +3321,39 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public conditionalExpression(): ConditionalExpressionContext { let _localctx: ConditionalExpressionContext = new ConditionalExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 124, KipperParser.RULE_conditionalExpression); + this.enterRule(_localctx, 128, KipperParser.RULE_conditionalExpression); try { - this.state = 593; + this.state = 606; this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 54, this._ctx)) { - case 1: - _localctx = new PassOnConditionalExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 586; - this.logicalOrExpression(0); - } - break; - - case 2: - _localctx = new ActualConditionalExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 587; - this.logicalOrExpression(0); - this.state = 588; - this.match(KipperParser.QuestionMark); - this.state = 589; - this.conditionalExpression(); - this.state = 590; - this.match(KipperParser.Colon); - this.state = 591; - this.conditionalExpression(); - } - break; + switch ( this.interpreter.adaptivePredict(this._input, 53, this._ctx) ) { + case 1: + _localctx = new PassOnConditionalExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 599; + this.logicalOrExpression(0); + } + break; + + case 2: + _localctx = new ActualConditionalExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 600; + this.logicalOrExpression(0); + this.state = 601; + this.match(KipperParser.QuestionMark); + this.state = 602; + this.conditionalExpression(); + this.state = 603; + this.match(KipperParser.Colon); + this.state = 604; + this.conditionalExpression(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3731,7 +3361,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3739,34 +3370,35 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public assignmentExpression(): AssignmentExpressionContext { let _localctx: AssignmentExpressionContext = new AssignmentExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 126, KipperParser.RULE_assignmentExpression); + this.enterRule(_localctx, 130, KipperParser.RULE_assignmentExpression); try { - this.state = 600; + this.state = 613; this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 55, this._ctx)) { - case 1: - _localctx = new PassOnAssignmentExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 595; - this.conditionalExpression(); - } - break; + switch ( this.interpreter.adaptivePredict(this._input, 54, this._ctx) ) { + case 1: + _localctx = new PassOnAssignmentExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 608; + this.conditionalExpression(); + } + break; - case 2: - _localctx = new ActualAssignmentExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 596; - this.computedPrimaryExpression(0); - this.state = 597; - this.assignmentOperator(); - this.state = 598; - this.assignmentExpression(); - } - break; + case 2: + _localctx = new ActualAssignmentExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 609; + this.computedPrimaryExpression(0); + this.state = 610; + this.assignmentOperator(); + this.state = 611; + this.assignmentExpression(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3774,7 +3406,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3782,37 +3415,26 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public assignmentOperator(): AssignmentOperatorContext { let _localctx: AssignmentOperatorContext = new AssignmentOperatorContext(this._ctx, this.state); - this.enterRule(_localctx, 128, KipperParser.RULE_assignmentOperator); + this.enterRule(_localctx, 132, KipperParser.RULE_assignmentOperator); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 602; - _la = this._input.LA(1); - if ( - !( - ((_la - 51) & ~0x1f) === 0 && - ((1 << (_la - 51)) & - ((1 << (KipperParser.Assign - 51)) | - (1 << (KipperParser.PlusAssign - 51)) | - (1 << (KipperParser.MinusAssign - 51)) | - (1 << (KipperParser.StarAssign - 51)) | - (1 << (KipperParser.DivAssign - 51)) | - (1 << (KipperParser.ModAssign - 51)))) !== - 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 615; + _la = this._input.LA(1); + if (!(((((_la - 53)) & ~0x1F) === 0 && ((1 << (_la - 53)) & ((1 << (KipperParser.Assign - 53)) | (1 << (KipperParser.PlusAssign - 53)) | (1 << (KipperParser.MinusAssign - 53)) | (1 << (KipperParser.StarAssign - 53)) | (1 << (KipperParser.DivAssign - 53)) | (1 << (KipperParser.ModAssign - 53)))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3820,7 +3442,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3828,33 +3451,34 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public expression(): ExpressionContext { let _localctx: ExpressionContext = new ExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 130, KipperParser.RULE_expression); + this.enterRule(_localctx, 134, KipperParser.RULE_expression); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 604; - this.assignmentExpression(); - this.state = 609; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 56, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 605; - this.match(KipperParser.Comma); - this.state = 606; - this.assignmentExpression(); - } - } + this.state = 617; + this.assignmentExpression(); + this.state = 622; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 618; + this.match(KipperParser.Comma); + this.state = 619; + this.assignmentExpression(); + } } - this.state = 611; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 56, this._ctx); } + this.state = 624; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3862,7 +3486,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3870,36 +3495,37 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public typeSpecifierExpression(): TypeSpecifierExpressionContext { let _localctx: TypeSpecifierExpressionContext = new TypeSpecifierExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 132, KipperParser.RULE_typeSpecifierExpression); + this.enterRule(_localctx, 136, KipperParser.RULE_typeSpecifierExpression); try { - this.state = 615; + this.state = 628; this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 57, this._ctx)) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 612; - this.identifierTypeSpecifierExpression(); - } - break; + switch ( this.interpreter.adaptivePredict(this._input, 56, this._ctx) ) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 625; + this.identifierTypeSpecifierExpression(); + } + break; - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 613; - this.genericTypeSpecifierExpression(); - } - break; + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 626; + this.genericTypeSpecifierExpression(); + } + break; - case 3: - this.enterOuterAlt(_localctx, 3); - { - this.state = 614; - this.typeofTypeSpecifierExpression(); - } - break; + case 3: + this.enterOuterAlt(_localctx, 3); + { + this.state = 627; + this.typeofTypeSpecifierExpression(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3907,25 +3533,24 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public identifierTypeSpecifierExpression(): IdentifierTypeSpecifierExpressionContext { - let _localctx: IdentifierTypeSpecifierExpressionContext = new IdentifierTypeSpecifierExpressionContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 134, KipperParser.RULE_identifierTypeSpecifierExpression); + let _localctx: IdentifierTypeSpecifierExpressionContext = new IdentifierTypeSpecifierExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 138, KipperParser.RULE_identifierTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 617; - this.typeSpecifierIdentifier(); + this.state = 630; + this.typeSpecifierIdentifier(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3933,31 +3558,30 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public genericTypeSpecifierExpression(): GenericTypeSpecifierExpressionContext { - let _localctx: GenericTypeSpecifierExpressionContext = new GenericTypeSpecifierExpressionContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 136, KipperParser.RULE_genericTypeSpecifierExpression); + let _localctx: GenericTypeSpecifierExpressionContext = new GenericTypeSpecifierExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 140, KipperParser.RULE_genericTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 619; - this.typeSpecifierIdentifier(); - this.state = 620; - this.match(KipperParser.Less); - this.state = 621; - this.typeSpecifierIdentifier(); - this.state = 622; - this.match(KipperParser.Greater); - } - } catch (re) { + this.state = 632; + this.typeSpecifierIdentifier(); + this.state = 633; + this.match(KipperParser.Less); + this.state = 634; + this.typeSpecifierIdentifier(); + this.state = 635; + this.match(KipperParser.Greater); + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3965,31 +3589,30 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public typeofTypeSpecifierExpression(): TypeofTypeSpecifierExpressionContext { - let _localctx: TypeofTypeSpecifierExpressionContext = new TypeofTypeSpecifierExpressionContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 138, KipperParser.RULE_typeofTypeSpecifierExpression); + let _localctx: TypeofTypeSpecifierExpressionContext = new TypeofTypeSpecifierExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 142, KipperParser.RULE_typeofTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 624; - this.match(KipperParser.Typeof); - this.state = 625; - this.match(KipperParser.LeftParen); - this.state = 626; - this.typeSpecifierIdentifier(); - this.state = 627; - this.match(KipperParser.RightParen); + this.state = 637; + this.match(KipperParser.Typeof); + this.state = 638; + this.match(KipperParser.LeftParen); + this.state = 639; + this.typeSpecifierIdentifier(); + this.state = 640; + this.match(KipperParser.RightParen); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3997,7 +3620,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -4005,32 +3629,26 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext { let _localctx: TypeSpecifierIdentifierContext = new TypeSpecifierIdentifierContext(this._ctx, this.state); - this.enterRule(_localctx, 140, KipperParser.RULE_typeSpecifierIdentifier); + this.enterRule(_localctx, 144, KipperParser.RULE_typeSpecifierIdentifier); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 629; - _la = this._input.LA(1); - if ( - !( - ((_la & ~0x1f) === 0 && - ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== - 0) || - _la === KipperParser.Identifier - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 642; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0) || _la === KipperParser.Identifier)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4038,7 +3656,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -4046,397 +3665,406 @@ export class KipperParser extends KipperParserBase { public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { switch (ruleIndex) { - case 16: - return this.compoundStatement_sempred(_localctx as CompoundStatementContext, predIndex); + case 18: + return this.compoundStatement_sempred(_localctx as CompoundStatementContext, predIndex); - case 43: - return this.computedPrimaryExpression_sempred(_localctx as ComputedPrimaryExpressionContext, predIndex); + case 45: + return this.computedPrimaryExpression_sempred(_localctx as ComputedPrimaryExpressionContext, predIndex); - case 56: - return this.multiplicativeExpression_sempred(_localctx as MultiplicativeExpressionContext, predIndex); + case 58: + return this.multiplicativeExpression_sempred(_localctx as MultiplicativeExpressionContext, predIndex); - case 57: - return this.additiveExpression_sempred(_localctx as AdditiveExpressionContext, predIndex); + case 59: + return this.additiveExpression_sempred(_localctx as AdditiveExpressionContext, predIndex); - case 58: - return this.relationalExpression_sempred(_localctx as RelationalExpressionContext, predIndex); + case 60: + return this.relationalExpression_sempred(_localctx as RelationalExpressionContext, predIndex); - case 59: - return this.equalityExpression_sempred(_localctx as EqualityExpressionContext, predIndex); + case 61: + return this.equalityExpression_sempred(_localctx as EqualityExpressionContext, predIndex); - case 60: - return this.logicalAndExpression_sempred(_localctx as LogicalAndExpressionContext, predIndex); + case 62: + return this.logicalAndExpression_sempred(_localctx as LogicalAndExpressionContext, predIndex); - case 61: - return this.logicalOrExpression_sempred(_localctx as LogicalOrExpressionContext, predIndex); + case 63: + return this.logicalOrExpression_sempred(_localctx as LogicalOrExpressionContext, predIndex); } return true; } private compoundStatement_sempred(_localctx: CompoundStatementContext, predIndex: number): boolean { switch (predIndex) { - case 0: - return this.notInsideExpressionStatement(); + case 0: + return this.notInsideExpressionStatement(); } return true; } private computedPrimaryExpression_sempred(_localctx: ComputedPrimaryExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 1: - return this.precpred(this._ctx, 5); + case 1: + return this.precpred(this._ctx, 5); - case 2: - return this.precpred(this._ctx, 3); + case 2: + return this.precpred(this._ctx, 3); - case 3: - return this.precpred(this._ctx, 2); + case 3: + return this.precpred(this._ctx, 2); - case 4: - return this.precpred(this._ctx, 1); + case 4: + return this.precpred(this._ctx, 1); } return true; } private multiplicativeExpression_sempred(_localctx: MultiplicativeExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 5: - return this.precpred(this._ctx, 1); + case 5: + return this.precpred(this._ctx, 1); } return true; } private additiveExpression_sempred(_localctx: AdditiveExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 6: - return this.precpred(this._ctx, 1); + case 6: + return this.precpred(this._ctx, 1); } return true; } private relationalExpression_sempred(_localctx: RelationalExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 7: - return this.precpred(this._ctx, 1); + case 7: + return this.precpred(this._ctx, 1); } return true; } private equalityExpression_sempred(_localctx: EqualityExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 8: - return this.precpred(this._ctx, 1); + case 8: + return this.precpred(this._ctx, 1); } return true; } private logicalAndExpression_sempred(_localctx: LogicalAndExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 9: - return this.precpred(this._ctx, 1); + case 9: + return this.precpred(this._ctx, 1); } return true; } private logicalOrExpression_sempred(_localctx: LogicalOrExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 10: - return this.precpred(this._ctx, 1); + case 10: + return this.precpred(this._ctx, 1); } return true; } private static readonly _serializedATNSegments: number = 2; private static readonly _serializedATNSegment0: string = - "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03N\u027A\x04\x02" + + "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03P\u0287\x04\x02" + "\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07" + "\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r\t\r\x04" + "\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t\x12\x04" + "\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17\t\x17\x04" + "\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B\x04\x1C\t\x1C\x04" + - '\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04"\t"\x04#' + - "\t#\x04$\t$\x04%\t%\x04&\t&\x04'\t'\x04(\t(\x04)\t)\x04*\t*\x04+\t+" + + "\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04\"\t\"\x04#" + + "\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(\x04)\t)\x04*\t*\x04+\t+" + "\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x040\t0\x041\t1\x042\t2\x043\t3\x044" + "\t4\x045\t5\x046\t6\x047\t7\x048\t8\x049\t9\x04:\t:\x04;\t;\x04<\t<\x04" + "=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x04B\tB\x04C\tC\x04D\tD\x04E\tE\x04" + - "F\tF\x04G\tG\x04H\tH\x03\x02\x05\x02\x92\n\x02\x03\x02\x03\x02\x03\x03" + - "\x06\x03\x97\n\x03\r\x03\x0E\x03\x98\x03\x04\x03\x04\x03\x05\x06\x05\x9E" + - "\n\x05\r\x05\x0E\x05\x9F\x03\x06\x03\x06\x03\x06\x05\x06\xA5\n\x06\x03" + - "\x07\x03\x07\x03\x07\x03\x07\x03\x07\x05\x07\xAC\n\x07\x05\x07\xAE\n\x07" + - "\x03\b\x03\b\x03\b\x03\b\x05\b\xB4\n\b\x03\b\x03\b\x03\b\x03\b\x05\b\xBA" + - "\n\b\x03\t\x03\t\x03\t\x03\n\x03\n\x03\v\x03\v\x03\f\x03\f\x03\r\x03\r" + - "\x03\r\x03\r\x03\r\x05\r\xCA\n\r\x03\x0E\x03\x0E\x03\x0E\x07\x0E\xCF\n" + - "\x0E\f\x0E\x0E\x0E\xD2\v\x0E\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x03\x10\x03" + - "\x10\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x03\x11\x05\x11\xE0\n\x11" + - "\x03\x12\x03\x12\x03\x12\x05\x12\xE5\n\x12\x03\x12\x03\x12\x03\x13\x03" + - "\x13\x03\x13\x03\x13\x03\x13\x03\x14\x03\x14\x05\x14\xF0\n\x14\x03\x15" + - "\x03\x15\x03\x15\x03\x15\x03\x15\x03\x15\x03\x15\x05\x15\xF9\n\x15\x03" + - "\x16\x03\x16\x03\x16\x03\x16\x03\x16\x03\x16\x07\x16\u0101\n\x16\f\x16" + - "\x0E\x16\u0104\v\x16\x03\x16\x03\x16\x03\x17\x03\x17\x03\x17\x03\x17\x03" + - "\x17\x03\x17\x03\x17\x03\x17\x05\x17\u0110\n\x17\x03\x18\x03\x18\x03\x18" + - "\x05\x18\u0115\n\x18\x03\x19\x03\x19\x03\x19\x03\x19\x05\x19\u011B\n\x19" + - "\x03\x19\x03\x19\x05\x19\u011F\n\x19\x03\x19\x03\x19\x03\x19\x03\x19\x05" + - "\x19\u0125\n\x19\x03\x19\x03\x19\x03\x19\x03\x19\x05\x19\u012B\n\x19\x03" + - "\x19\x03\x19\x03\x19\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03" + - "\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1C\x03" + - "\x1C\x03\x1C\x03\x1D\x03\x1D\x05\x1D\u0143\n\x1D\x03\x1D\x03\x1D\x03\x1E" + - "\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x05\x1E" + - '\u0150\n\x1E\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x03 \x03 \x03!\x03!\x03"' + - '\x03"\x03#\x03#\x05#\u015E\n#\x03$\x03$\x03%\x03%\x07%\u0164\n%\f%\x0E' + - "%\u0167\v%\x03%\x03%\x03%\x07%\u016C\n%\f%\x0E%\u016F\v%\x03%\x05%\u0172" + - "\n%\x03&\x03&\x03&\x05&\u0177\n&\x03&\x05&\u017A\n&\x03'\x03'\x03'" + - "\x05'\u017F\n'\x03'\x05'\u0182\n'\x03(\x03(\x03)\x03)\x03)\x03)\x07" + - ")\u018A\n)\f)\x0E)\u018D\v)\x05)\u018F\n)\x03)\x05)\u0192\n)\x03)\x03" + - ")\x03*\x03*\x03*\x03*\x07*\u019A\n*\f*\x0E*\u019D\v*\x05*\u019F\n*\x03" + - "*\x05*\u01A2\n*\x03*\x03*\x03+\x03+\x03+\x03+\x03,\x03,\x03-\x03-\x03" + - "-\x03-\x03-\x03-\x05-\u01B2\n-\x03-\x03-\x03-\x05-\u01B7\n-\x03-\x03-" + - "\x03-\x05-\u01BC\n-\x03-\x03-\x03-\x03-\x03-\x03-\x03-\x03-\x03-\x03-" + - "\x03-\x03-\x03-\x03-\x07-\u01CC\n-\f-\x0E-\u01CF\v-\x03.\x03.\x03.\x07" + - ".\u01D4\n.\f.\x0E.\u01D7\v.\x03/\x03/\x03/\x030\x030\x030\x030\x031\x03" + - "1\x031\x031\x051\u01E4\n1\x031\x031\x031\x031\x051\u01EA\n1\x031\x031" + - "\x032\x032\x052\u01F0\n2\x033\x033\x033\x034\x034\x034\x054\u01F8\n4\x03" + - "5\x035\x035\x036\x036\x036\x037\x037\x038\x038\x039\x039\x039\x039\x03" + - "9\x059\u0209\n9\x03:\x03:\x03:\x03:\x03:\x03:\x07:\u0211\n:\f:\x0E:\u0214" + - "\v:\x03;\x03;\x03;\x03;\x03;\x03;\x07;\u021C\n;\f;\x0E;\u021F\v;\x03<" + - "\x03<\x03<\x03<\x03<\x03<\x07<\u0227\n<\f<\x0E<\u022A\v<\x03=\x03=\x03" + - "=\x03=\x03=\x03=\x07=\u0232\n=\f=\x0E=\u0235\v=\x03>\x03>\x03>\x03>\x03" + - ">\x03>\x07>\u023D\n>\f>\x0E>\u0240\v>\x03?\x03?\x03?\x03?\x03?\x03?\x07" + - "?\u0248\n?\f?\x0E?\u024B\v?\x03@\x03@\x03@\x03@\x03@\x03@\x03@\x05@\u0254" + - "\n@\x03A\x03A\x03A\x03A\x03A\x05A\u025B\nA\x03B\x03B\x03C\x03C\x03C\x07" + - "C\u0262\nC\fC\x0EC\u0265\vC\x03D\x03D\x03D\x05D\u026A\nD\x03E\x03E\x03" + - "F\x03F\x03F\x03F\x03F\x03G\x03G\x03G\x03G\x03G\x03H\x03H\x03H\x02\x02" + - "\tXrtvxz|I\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\x028\x02:\x02<\x02>\x02@\x02" + + "F\tF\x04G\tG\x04H\tH\x04I\tI\x04J\tJ\x03\x02\x05\x02\x96\n\x02\x03\x02" + + "\x03\x02\x03\x03\x06\x03\x9B\n\x03\r\x03\x0E\x03\x9C\x03\x04\x03\x04\x03" + + "\x05\x06\x05\xA2\n\x05\r\x05\x0E\x05\xA3\x03\x06\x03\x06\x03\x06\x05\x06" + + "\xA9\n\x06\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x05\x07\xB1" + + "\n\x07\x03\b\x03\b\x03\b\x03\t\x03\t\x03\n\x03\n\x03\n\x03\n\x03\n\x05" + + "\n\xBD\n\n\x03\v\x03\v\x03\f\x03\f\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0E" + + "\x03\x0E\x05\x0E\xC9\n\x0E\x03\x0E\x03\x0E\x03\x0E\x03\x0E\x05\x0E\xCF" + + "\n\x0E\x03\x0F\x03\x0F\x03\x0F\x07\x0F\xD4\n\x0F\f\x0F\x0E\x0F\xD7\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\xED\n\x13\x03\x14\x03\x14\x03\x14\x05\x14\xF2" + + "\n\x14\x03\x14\x03\x14\x03\x15\x03\x15\x03\x15\x03\x15\x03\x15\x03\x16" + + "\x03\x16\x05\x16\xFD\n\x16\x03\x17\x03\x17\x03\x17\x03\x17\x03\x17\x03" + + "\x17\x03\x17\x05\x17\u0106\n\x17\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18" + + "\x03\x18\x07\x18\u010E\n\x18\f\x18\x0E\x18\u0111\v\x18\x03\x18\x03\x18" + + "\x03\x19\x03\x19\x03\x19\x03\x19\x03\x19\x03\x19\x03\x19\x03\x19\x05\x19" + + "\u011D\n\x19\x03\x1A\x03\x1A\x03\x1A\x05\x1A\u0122\n\x1A\x03\x1B\x03\x1B" + + "\x03\x1B\x03\x1B\x05\x1B\u0128\n\x1B\x03\x1B\x03\x1B\x05\x1B\u012C\n\x1B" + + "\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x05\x1B\u0132\n\x1B\x03\x1B\x03\x1B\x03" + + "\x1B\x03\x1B\x05\x1B\u0138\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" + + "\u0150\n\x1F\x03\x1F\x03\x1F\x03 \x03 \x03 \x03 \x03 \x03 \x03 \x03 \x03" + + " \x05 \u015D\n \x03!\x03!\x03!\x03!\x03\"\x03\"\x03#\x03#\x03$\x03$\x03" + + "%\x03%\x05%\u016B\n%\x03&\x03&\x03\'\x03\'\x07\'\u0171\n\'\f\'\x0E\'\u0174" + + "\v\'\x03\'\x03\'\x03\'\x07\'\u0179\n\'\f\'\x0E\'\u017C\v\'\x03\'\x05\'" + + "\u017F\n\'\x03(\x03(\x03(\x05(\u0184\n(\x03(\x05(\u0187\n(\x03)\x03)\x03" + + ")\x05)\u018C\n)\x03)\x05)\u018F\n)\x03*\x03*\x03+\x03+\x03+\x03+\x07+" + + "\u0197\n+\f+\x0E+\u019A\v+\x05+\u019C\n+\x03+\x05+\u019F\n+\x03+\x03+" + + "\x03,\x03,\x03,\x03,\x07,\u01A7\n,\f,\x0E,\u01AA\v,\x05,\u01AC\n,\x03" + + ",\x05,\u01AF\n,\x03,\x03,\x03-\x03-\x03-\x03-\x03.\x03.\x03/\x03/\x03" + + "/\x03/\x03/\x03/\x05/\u01BF\n/\x03/\x03/\x03/\x05/\u01C4\n/\x03/\x03/" + + "\x03/\x05/\u01C9\n/\x03/\x03/\x03/\x03/\x03/\x03/\x03/\x03/\x03/\x03/" + + "\x03/\x03/\x03/\x03/\x07/\u01D9\n/\f/\x0E/\u01DC\v/\x030\x030\x030\x07" + + "0\u01E1\n0\f0\x0E0\u01E4\v0\x031\x031\x031\x032\x032\x032\x032\x033\x03" + + "3\x033\x033\x053\u01F1\n3\x033\x033\x033\x033\x053\u01F7\n3\x033\x033" + + "\x034\x034\x054\u01FD\n4\x035\x035\x035\x036\x036\x036\x056\u0205\n6\x03" + + "7\x037\x037\x038\x038\x038\x039\x039\x03:\x03:\x03;\x03;\x03;\x03;\x03" + + ";\x05;\u0216\n;\x03<\x03<\x03<\x03<\x03<\x03<\x07<\u021E\n<\f<\x0E<\u0221" + + "\v<\x03=\x03=\x03=\x03=\x03=\x03=\x07=\u0229\n=\f=\x0E=\u022C\v=\x03>" + + "\x03>\x03>\x03>\x03>\x03>\x07>\u0234\n>\f>\x0E>\u0237\v>\x03?\x03?\x03" + + "?\x03?\x03?\x03?\x07?\u023F\n?\f?\x0E?\u0242\v?\x03@\x03@\x03@\x03@\x03" + + "@\x03@\x07@\u024A\n@\f@\x0E@\u024D\v@\x03A\x03A\x03A\x03A\x03A\x03A\x07" + + "A\u0255\nA\fA\x0EA\u0258\vA\x03B\x03B\x03B\x03B\x03B\x03B\x03B\x05B\u0261" + + "\nB\x03C\x03C\x03C\x03C\x03C\x05C\u0268\nC\x03D\x03D\x03E\x03E\x03E\x07" + + "E\u026F\nE\fE\x0EE\u0272\vE\x03F\x03F\x03F\x05F\u0277\nF\x03G\x03G\x03" + + "H\x03H\x03H\x03H\x03H\x03I\x03I\x03I\x03I\x03I\x03J\x03J\x03J\x02\x02" + + "\t\\vxz|~\x80K\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\x028\x02:\x02<\x02>\x02@\x02" + "B\x02D\x02F\x02H\x02J\x02L\x02N\x02P\x02R\x02T\x02V\x02X\x02Z\x02\\\x02" + "^\x02`\x02b\x02d\x02f\x02h\x02j\x02l\x02n\x02p\x02r\x02t\x02v\x02x\x02" + "z\x02|\x02~\x02\x80\x02\x82\x02\x84\x02\x86\x02\x88\x02\x8A\x02\x8C\x02" + - "\x8E\x02\x02\x10\x03\x02\x06\x07\x03\x02\r\x0E\x03\x02\x19\x1A\x03\x02" + - "DE\x04\x02CCFF\x03\x02\x1C\x1E\x04\x02++--\x05\x02**,,44\x03\x02.1\x04" + - "\x02**,,\x03\x02=@\x03\x02;<\x03\x025:\x04\x02\x1C\x1EBB\x02\u027D\x02" + - "\x91\x03\x02\x02\x02\x04\x96\x03\x02\x02\x02\x06\x9A\x03\x02\x02\x02\b" + - "\x9D\x03\x02\x02\x02\n\xA4\x03\x02\x02\x02\f\xAD\x03\x02\x02\x02\x0E\xAF" + - "\x03\x02\x02\x02\x10\xBB\x03\x02\x02\x02\x12\xBE\x03\x02\x02\x02\x14\xC0" + - "\x03\x02\x02\x02\x16\xC2\x03\x02\x02\x02\x18\xC4\x03\x02\x02\x02\x1A\xCB" + - "\x03\x02\x02\x02\x1C\xD3\x03\x02\x02\x02\x1E\xD7\x03\x02\x02\x02 \xDF" + - '\x03\x02\x02\x02"\xE1\x03\x02\x02\x02$\xE8\x03\x02\x02\x02&\xEF\x03\x02' + - "\x02\x02(\xF1\x03\x02\x02\x02*\xFA\x03\x02\x02\x02,\u010F\x03\x02\x02" + - "\x02.\u0114\x03\x02\x02\x020\u0116\x03\x02\x02\x022\u012F\x03\x02\x02" + - "\x024\u0135\x03\x02\x02\x026\u013D\x03\x02\x02\x028\u0140\x03\x02\x02" + - "\x02:\u014F\x03\x02\x02\x02<\u0151\x03\x02\x02\x02>\u0155\x03\x02\x02" + - "\x02@\u0157\x03\x02\x02\x02B\u0159\x03\x02\x02\x02D\u015D\x03\x02\x02" + - "\x02F\u015F\x03\x02\x02\x02H\u0171\x03\x02\x02\x02J\u0179\x03\x02\x02" + - "\x02L\u0181\x03\x02\x02\x02N\u0183\x03\x02\x02\x02P\u0185\x03\x02\x02" + - "\x02R\u0195\x03\x02\x02\x02T\u01A5\x03\x02\x02\x02V\u01A9\x03\x02\x02" + - "\x02X\u01B6\x03\x02\x02\x02Z\u01D0\x03\x02\x02\x02\\\u01D8\x03\x02\x02" + - "\x02^\u01DB\x03\x02\x02\x02`\u01DF\x03\x02\x02\x02b\u01EF\x03\x02\x02" + - "\x02d\u01F1\x03\x02\x02\x02f\u01F7\x03\x02\x02\x02h\u01F9\x03\x02\x02" + - "\x02j\u01FC\x03\x02\x02\x02l\u01FF\x03\x02\x02\x02n\u0201\x03\x02\x02" + - "\x02p\u0208\x03\x02\x02\x02r\u020A\x03\x02\x02\x02t\u0215\x03\x02\x02" + - "\x02v\u0220\x03\x02\x02\x02x\u022B\x03\x02\x02\x02z\u0236\x03\x02\x02" + - "\x02|\u0241\x03\x02\x02\x02~\u0253\x03\x02\x02\x02\x80\u025A\x03\x02\x02" + - "\x02\x82\u025C\x03\x02\x02\x02\x84\u025E\x03\x02\x02\x02\x86\u0269\x03" + - "\x02\x02\x02\x88\u026B\x03\x02\x02\x02\x8A\u026D\x03\x02\x02\x02\x8C\u0272" + - "\x03\x02\x02\x02\x8E\u0277\x03\x02\x02\x02\x90\x92\x05\x04\x03\x02\x91" + - "\x90\x03\x02\x02\x02\x91\x92\x03\x02\x02\x02\x92\x93\x03\x02\x02\x02\x93" + - "\x94\x07\x02\x02\x03\x94\x03\x03\x02\x02\x02\x95\x97\x05\x06\x04\x02\x96" + - "\x95\x03\x02\x02\x02\x97\x98\x03\x02\x02\x02\x98\x96\x03\x02\x02\x02\x98" + - "\x99\x03\x02\x02\x02\x99\x05\x03\x02\x02\x02\x9A\x9B\x05\b\x05\x02\x9B" + - "\x07\x03\x02\x02\x02\x9C\x9E\x05\n\x06\x02\x9D\x9C\x03\x02\x02\x02\x9E" + - "\x9F\x03\x02\x02\x02\x9F\x9D\x03\x02\x02\x02\x9F\xA0\x03\x02\x02\x02\xA0" + - "\t\x03\x02\x02\x02\xA1\xA5\x05 \x11\x02\xA2\xA5\x05\f\x07\x02\xA3\xA5" + - "\x07 \x02\x02\xA4\xA1\x03\x02\x02\x02\xA4\xA2\x03\x02\x02\x02\xA4\xA3" + - "\x03\x02\x02\x02\xA5\v\x03\x02\x02\x02\xA6\xA7\x05\x10\t\x02\xA7\xA8\x07" + - " \x02\x02\xA8\xAE\x03\x02\x02\x02\xA9\xAB\x05\x0E\b\x02\xAA\xAC\x07 \x02" + - "\x02\xAB\xAA\x03\x02\x02\x02\xAB\xAC\x03\x02\x02\x02\xAC\xAE\x03\x02\x02" + - "\x02\xAD\xA6\x03\x02\x02\x02\xAD\xA9\x03\x02\x02\x02\xAE\r\x03\x02\x02" + - "\x02\xAF\xB0\x07\x15\x02\x02\xB0\xB1\x05\x14\v\x02\xB1\xB3\x07#\x02\x02" + - "\xB2\xB4\x05\x1A\x0E\x02\xB3\xB2\x03\x02\x02\x02\xB3\xB4\x03\x02\x02\x02" + - "\xB4\xB5\x03\x02\x02\x02\xB5\xB6\x07$\x02\x02\xB6\xB7\x07\x18\x02\x02" + - '\xB7\xB9\x05\x86D\x02\xB8\xBA\x05"\x12\x02\xB9\xB8\x03\x02\x02\x02\xB9' + - "\xBA\x03\x02\x02\x02\xBA\x0F\x03\x02\x02\x02\xBB\xBC\x05\x12\n\x02\xBC" + - "\xBD\x05\x18\r\x02\xBD\x11\x03\x02\x02\x02\xBE\xBF\t\x02\x02\x02\xBF\x13" + - "\x03\x02\x02\x02\xC0\xC1\x05\x16\f\x02\xC1\x15\x03\x02\x02\x02\xC2\xC3" + - "\x07B\x02\x02\xC3\x17\x03\x02\x02\x02\xC4\xC5\x05\x14\v\x02\xC5\xC6\x07" + - '"\x02\x02\xC6\xC9\x05\x86D\x02\xC7\xC8\x075\x02\x02\xC8\xCA\x05\x1E\x10' + - "\x02\xC9\xC7\x03\x02\x02\x02\xC9\xCA\x03\x02\x02\x02\xCA\x19\x03\x02\x02" + - "\x02\xCB\xD0\x05\x1C\x0F\x02\xCC\xCD\x07\x1F\x02\x02\xCD\xCF\x05\x1C\x0F" + - "\x02\xCE\xCC\x03\x02\x02\x02\xCF\xD2\x03\x02\x02\x02\xD0\xCE\x03\x02\x02" + - "\x02\xD0\xD1\x03\x02\x02\x02\xD1\x1B\x03\x02\x02\x02\xD2\xD0\x03\x02\x02" + - '\x02\xD3\xD4\x05\x14\v\x02\xD4\xD5\x07"\x02\x02\xD5\xD6\x05\x86D\x02' + - "\xD6\x1D\x03\x02\x02\x02\xD7\xD8\x05\x80A\x02\xD8\x1F\x03\x02\x02\x02" + - "\xD9\xE0\x05$\x13\x02\xDA\xE0\x05&\x14\x02\xDB\xE0\x05.\x18\x02\xDC\xE0" + - '\x056\x1C\x02\xDD\xE0\x058\x1D\x02\xDE\xE0\x05"\x12\x02\xDF\xD9\x03\x02' + - "\x02\x02\xDF\xDA\x03\x02\x02\x02\xDF\xDB\x03\x02\x02\x02\xDF\xDC\x03\x02" + - "\x02\x02\xDF\xDD\x03\x02\x02\x02\xDF\xDE\x03\x02\x02\x02\xE0!\x03\x02" + - "\x02\x02\xE1\xE2\x06\x12\x02\x02\xE2\xE4\x07(\x02\x02\xE3\xE5\x05\b\x05" + - "\x02\xE4\xE3\x03\x02\x02\x02\xE4\xE5\x03\x02\x02\x02\xE5\xE6\x03\x02\x02" + - "\x02\xE6\xE7\x07)\x02\x02\xE7#\x03\x02\x02\x02\xE8\xE9\b\x13\x01\x02\xE9" + - "\xEA\x05\x84C\x02\xEA\xEB\x07 \x02\x02\xEB\xEC\b\x13\x01\x02\xEC%\x03" + - "\x02\x02\x02\xED\xF0\x05(\x15\x02\xEE\xF0\x05*\x16\x02\xEF\xED\x03\x02" + - "\x02\x02\xEF\xEE\x03\x02\x02\x02\xF0'\x03\x02\x02\x02\xF1\xF2\x07\x11" + - "\x02\x02\xF2\xF3\x07#\x02\x02\xF3\xF4\x05\x84C\x02\xF4\xF5\x07$\x02\x02" + - "\xF5\xF8\x05 \x11\x02\xF6\xF7\x07\x12\x02\x02\xF7\xF9\x05 \x11\x02\xF8" + - "\xF6\x03\x02\x02\x02\xF8\xF9\x03\x02\x02\x02\xF9)\x03\x02\x02\x02\xFA" + - "\xFB\x07\n\x02\x02\xFB\xFC\x07#\x02\x02\xFC\xFD\x05\x84C\x02\xFD\xFE\x07" + - "$\x02\x02\xFE\u0102\x07(\x02\x02\xFF\u0101\x05,\x17\x02\u0100\xFF\x03" + - "\x02\x02\x02\u0101\u0104\x03\x02\x02\x02\u0102\u0100\x03\x02\x02\x02\u0102" + - "\u0103\x03\x02\x02\x02\u0103\u0105\x03\x02\x02\x02\u0104\u0102\x03\x02" + - "\x02\x02\u0105\u0106\x07)\x02\x02\u0106+\x03\x02\x02\x02\u0107\u0108\x07" + - '\v\x02\x02\u0108\u0109\x05\x84C\x02\u0109\u010A\x07"\x02\x02\u010A\u010B' + - "\x05 \x11\x02\u010B\u0110\x03\x02\x02\x02\u010C\u010D\x07\f\x02\x02\u010D" + - '\u010E\x07"\x02\x02\u010E\u0110\x05 \x11\x02\u010F\u0107\x03\x02\x02' + - "\x02\u010F\u010C\x03\x02\x02\x02\u0110-\x03\x02\x02\x02\u0111\u0115\x05" + - "0\x19\x02\u0112\u0115\x052\x1A\x02\u0113\u0115\x054\x1B\x02\u0114\u0111" + - "\x03\x02\x02\x02\u0114\u0112\x03\x02\x02\x02\u0114\u0113\x03\x02\x02\x02" + - "\u0115/\x03\x02\x02\x02\u0116\u0117\x07\x13\x02\x02\u0117\u011E\x07#\x02" + - "\x02\u0118\u011B\x05\x10\t\x02\u0119\u011B\x05\x84C\x02\u011A\u0118\x03" + - "\x02\x02\x02\u011A\u0119\x03\x02\x02\x02\u011B\u011C\x03\x02\x02\x02\u011C" + - "\u011D\b\x19\x01\x02\u011D\u011F\x03\x02\x02\x02\u011E\u011A\x03\x02\x02" + - "\x02\u011E\u011F\x03\x02\x02\x02\u011F\u0120\x03\x02\x02\x02\u0120\u0124" + - "\x07 \x02\x02\u0121\u0122\x05\x84C\x02\u0122\u0123\b\x19\x01\x02\u0123" + - "\u0125\x03\x02\x02\x02\u0124\u0121\x03\x02\x02\x02\u0124\u0125\x03\x02" + - "\x02\x02\u0125\u0126\x03\x02\x02\x02\u0126\u012A\x07 \x02\x02\u0127\u0128" + - "\x05\x84C\x02\u0128\u0129\b\x19\x01\x02\u0129\u012B\x03\x02\x02\x02\u012A" + - "\u0127\x03\x02\x02\x02\u012A\u012B\x03\x02\x02\x02\u012B\u012C\x03\x02" + - "\x02\x02\u012C\u012D\x07$\x02\x02\u012D\u012E\x05 \x11\x02\u012E1\x03" + - "\x02\x02\x02\u012F\u0130\x07\x10\x02\x02\u0130\u0131\x07#\x02\x02\u0131" + - "\u0132\x05\x84C\x02\u0132\u0133\x07$\x02\x02\u0133\u0134\x05 \x11\x02" + - "\u01343\x03\x02\x02\x02\u0135\u0136\x07\x0F\x02\x02\u0136\u0137\x05 \x11" + - "\x02\u0137\u0138\x07\x10\x02\x02\u0138\u0139\x07#\x02\x02\u0139\u013A" + - "\x05\x84C\x02\u013A\u013B\x07$\x02\x02\u013B\u013C\x07 \x02\x02\u013C" + - "5\x03\x02\x02\x02\u013D\u013E\t\x03\x02\x02\u013E\u013F\x07 \x02\x02\u013F" + - "7\x03\x02\x02\x02\u0140\u0142\x07\x16\x02\x02\u0141\u0143\x05\x84C\x02" + - "\u0142\u0141\x03\x02\x02\x02\u0142\u0143\x03\x02\x02\x02\u0143\u0144\x03" + - "\x02\x02\x02\u0144\u0145\x07 \x02\x02\u01459\x03\x02\x02\x02\u0146\u0150" + - "\x05<\x1F\x02\u0147\u0150\x05P)\x02\u0148\u0150\x05R*\x02\u0149\u0150" + - "\x05> \x02\u014A\u0150\x05@!\x02\u014B\u0150\x05F$\x02\u014C\u0150\x05" + - "H%\x02\u014D\u0150\x05N(\x02\u014E\u0150\x05V,\x02\u014F\u0146\x03\x02" + - "\x02\x02\u014F\u0147\x03\x02\x02\x02\u014F\u0148\x03\x02\x02\x02\u014F" + - "\u0149\x03\x02\x02\x02\u014F\u014A\x03\x02\x02\x02\u014F\u014B\x03\x02" + - "\x02\x02\u014F\u014C\x03\x02\x02\x02\u014F\u014D\x03\x02\x02\x02\u014F" + - "\u014E\x03\x02\x02\x02\u0150;\x03\x02\x02\x02\u0151\u0152\x07#\x02\x02" + - "\u0152\u0153\x05\x84C\x02\u0153\u0154\x07$\x02\x02\u0154=\x03\x02\x02" + - "\x02\u0155\u0156\t\x04\x02\x02\u0156?\x03\x02\x02\x02\u0157\u0158\x05" + - 'B"\x02\u0158A\x03\x02\x02\x02\u0159\u015A\x07B\x02\x02\u015AC\x03\x02' + - '\x02\x02\u015B\u015E\x05B"\x02\u015C\u015E\x05F$\x02\u015D\u015B\x03' + - "\x02\x02\x02\u015D\u015C\x03\x02\x02\x02\u015EE\x03\x02\x02\x02\u015F" + - "\u0160\t\x05\x02\x02\u0160G\x03\x02\x02\x02\u0161\u0165\x07I\x02\x02\u0162" + - "\u0164\x05J&\x02\u0163\u0162\x03\x02\x02\x02\u0164\u0167\x03\x02\x02\x02" + - "\u0165\u0163\x03\x02\x02\x02\u0165\u0166\x03\x02\x02\x02\u0166\u0168\x03" + - "\x02\x02\x02\u0167\u0165\x03\x02\x02\x02\u0168\u0172\x07K\x02\x02\u0169" + - "\u016D\x07J\x02\x02\u016A\u016C\x05L'\x02\u016B\u016A\x03\x02\x02\x02" + - "\u016C\u016F\x03\x02\x02\x02\u016D\u016B\x03\x02\x02\x02\u016D\u016E\x03" + - "\x02\x02\x02\u016E\u0170\x03\x02\x02\x02\u016F\u016D\x03\x02\x02\x02\u0170" + - "\u0172\x07M\x02\x02\u0171\u0161\x03\x02\x02\x02\u0171\u0169\x03\x02\x02" + - "\x02\u0172I\x03\x02\x02\x02\u0173\u017A\x07L\x02\x02\u0174\u0176\x07\x03" + - "\x02\x02\u0175\u0177\x05\x84C\x02\u0176\u0175\x03\x02\x02\x02\u0176\u0177" + - "\x03\x02\x02\x02\u0177\u0178\x03\x02\x02\x02\u0178\u017A\x07'\x02\x02" + - "\u0179\u0173\x03\x02\x02\x02\u0179\u0174\x03\x02\x02\x02\u017AK\x03\x02" + - "\x02\x02\u017B\u0182\x07N\x02\x02\u017C\u017E\x07\x03\x02\x02\u017D\u017F" + - "\x05\x84C\x02\u017E\u017D\x03\x02\x02\x02\u017E\u017F\x03\x02\x02\x02" + - "\u017F\u0180\x03\x02\x02\x02\u0180\u0182\x07'\x02\x02\u0181\u017B\x03" + - "\x02\x02\x02\u0181\u017C\x03\x02\x02\x02\u0182M\x03\x02\x02\x02\u0183" + - "\u0184\t\x06\x02\x02\u0184O\x03\x02\x02\x02\u0185\u018E\x07%\x02\x02\u0186" + - "\u018B\x05\x84C\x02\u0187\u0188\x07\x1F\x02\x02\u0188\u018A\x05\x84C\x02" + - "\u0189\u0187\x03\x02\x02\x02\u018A\u018D\x03\x02\x02\x02\u018B\u0189\x03" + - "\x02\x02\x02\u018B\u018C\x03\x02\x02\x02\u018C\u018F\x03\x02\x02\x02\u018D" + - "\u018B\x03\x02\x02\x02\u018E\u0186\x03\x02\x02\x02\u018E\u018F\x03\x02" + - "\x02\x02\u018F\u0191\x03\x02\x02\x02\u0190\u0192\x07\x1F\x02\x02\u0191" + - "\u0190\x03\x02\x02\x02\u0191\u0192\x03\x02\x02\x02\u0192\u0193\x03\x02" + - "\x02\x02\u0193\u0194\x07&\x02\x02\u0194Q\x03\x02\x02\x02\u0195\u019E\x07" + - "(\x02\x02\u0196\u019B\x05T+\x02\u0197\u0198\x07\x1F\x02\x02\u0198\u019A" + - "\x05T+\x02\u0199\u0197\x03\x02\x02\x02\u019A\u019D\x03\x02\x02\x02\u019B" + - "\u0199\x03\x02\x02\x02\u019B\u019C\x03\x02\x02\x02\u019C\u019F\x03\x02" + - "\x02\x02\u019D\u019B\x03\x02\x02\x02\u019E\u0196\x03\x02\x02\x02\u019E" + - "\u019F\x03\x02\x02\x02\u019F\u01A1\x03\x02\x02\x02\u01A0\u01A2\x07\x1F" + - "\x02\x02\u01A1\u01A0\x03\x02\x02\x02\u01A1\u01A2\x03\x02\x02\x02\u01A2" + - "\u01A3\x03\x02\x02\x02\u01A3\u01A4\x07)\x02\x02\u01A4S\x03\x02\x02\x02" + - '\u01A5\u01A6\x05D#\x02\u01A6\u01A7\x07"\x02\x02\u01A7\u01A8\x05\x84C' + - "\x02\u01A8U\x03\x02\x02\x02\u01A9\u01AA\t\x07\x02\x02\u01AAW\x03\x02\x02" + - "\x02\u01AB\u01AC\b-\x01\x02\u01AC\u01B7\x05:\x1E\x02\u01AD\u01AE\x07\x17" + - "\x02\x02\u01AE\u01AF\x05X-\x02\u01AF\u01B1\x07#\x02\x02\u01B0\u01B2\x05" + - "Z.\x02\u01B1\u01B0\x03\x02\x02\x02\u01B1\u01B2\x03\x02\x02\x02\u01B2\u01B3" + - "\x03\x02\x02\x02\u01B3\u01B4\x07$\x02\x02\u01B4\u01B5\b-\x01\x02\u01B5" + - "\u01B7\x03\x02\x02\x02\u01B6\u01AB\x03\x02\x02\x02\u01B6\u01AD\x03\x02" + - "\x02\x02\u01B7\u01CD\x03\x02\x02\x02\u01B8\u01B9\f\x07\x02\x02\u01B9\u01BB" + - "\x07#\x02\x02\u01BA\u01BC\x05Z.\x02\u01BB\u01BA\x03\x02\x02\x02\u01BB" + - "\u01BC\x03\x02\x02\x02\u01BC\u01BD\x03\x02\x02\x02\u01BD\u01BE\x07$\x02" + - "\x02\u01BE\u01CC\b-\x01\x02\u01BF\u01C0\f\x05\x02\x02\u01C0\u01C1\x05" + - "\\/\x02\u01C1\u01C2\b-\x01\x02\u01C2\u01CC\x03\x02\x02\x02\u01C3\u01C4" + - "\f\x04\x02\x02\u01C4\u01C5\x05^0\x02\u01C5\u01C6\b-\x01\x02\u01C6\u01CC" + - "\x03\x02\x02\x02\u01C7\u01C8\f\x03\x02\x02\u01C8\u01C9\x05`1\x02\u01C9" + - "\u01CA\b-\x01\x02\u01CA\u01CC\x03\x02\x02\x02\u01CB\u01B8\x03\x02\x02" + - "\x02\u01CB\u01BF\x03\x02\x02\x02\u01CB\u01C3\x03\x02\x02\x02\u01CB\u01C7" + - "\x03\x02\x02\x02\u01CC\u01CF\x03\x02\x02\x02\u01CD\u01CB\x03\x02\x02\x02" + - "\u01CD\u01CE\x03\x02\x02\x02\u01CEY\x03\x02\x02\x02\u01CF\u01CD\x03\x02" + - "\x02\x02\u01D0\u01D5\x05\x80A\x02\u01D1\u01D2\x07\x1F\x02\x02\u01D2\u01D4" + - "\x05\x80A\x02\u01D3\u01D1\x03\x02\x02\x02\u01D4\u01D7\x03\x02\x02\x02" + - "\u01D5\u01D3\x03\x02\x02\x02\u01D5\u01D6\x03\x02\x02\x02\u01D6[\x03\x02" + - "\x02\x02\u01D7\u01D5\x03\x02\x02\x02\u01D8\u01D9\x07A\x02\x02\u01D9\u01DA" + - '\x05B"\x02\u01DA]\x03\x02\x02\x02\u01DB\u01DC\x07%\x02\x02\u01DC\u01DD' + - "\x05\x84C\x02\u01DD\u01DE\x07&\x02\x02\u01DE_\x03\x02\x02\x02\u01DF\u01E3" + - "\x07%\x02\x02\u01E0\u01E1\x05\x84C\x02\u01E1\u01E2\b1\x01\x02\u01E2\u01E4" + - "\x03\x02\x02\x02\u01E3\u01E0\x03\x02\x02\x02\u01E3\u01E4\x03\x02\x02\x02" + - '\u01E4\u01E5\x03\x02\x02\x02\u01E5\u01E9\x07"\x02\x02\u01E6\u01E7\x05' + - "\x84C\x02\u01E7\u01E8\b1\x01\x02\u01E8\u01EA\x03\x02\x02\x02\u01E9\u01E6" + - "\x03\x02\x02\x02\u01E9\u01EA\x03\x02\x02\x02\u01EA\u01EB\x03\x02\x02\x02" + - "\u01EB\u01EC\x07&\x02\x02\u01ECa\x03\x02\x02\x02\u01ED\u01F0\x05X-\x02" + - "\u01EE\u01F0\x05d3\x02\u01EF\u01ED\x03\x02\x02\x02\u01EF\u01EE\x03\x02" + - "\x02\x02\u01F0c\x03\x02\x02\x02\u01F1\u01F2\x05X-\x02\u01F2\u01F3\x05" + - "l7\x02\u01F3e\x03\x02\x02\x02\u01F4\u01F8\x05b2\x02\u01F5\u01F8\x05h5" + - "\x02\u01F6\u01F8\x05j6\x02\u01F7\u01F4\x03\x02\x02\x02\u01F7\u01F5\x03" + - "\x02\x02\x02\u01F7\u01F6\x03\x02\x02\x02\u01F8g\x03\x02\x02\x02\u01F9" + - "\u01FA\x05l7\x02\u01FA\u01FB\x05b2\x02\u01FBi\x03\x02\x02\x02\u01FC\u01FD" + - "\x05n8\x02\u01FD\u01FE\x05b2\x02\u01FEk\x03\x02\x02\x02\u01FF\u0200\t" + - "\b\x02\x02\u0200m\x03\x02\x02\x02\u0201\u0202\t\t\x02\x02\u0202o\x03\x02" + - "\x02\x02\u0203\u0209\x05f4\x02\u0204\u0205\x05f4\x02\u0205\u0206\x07\b" + - "\x02\x02\u0206\u0207\x05\x86D\x02\u0207\u0209\x03\x02\x02\x02\u0208\u0203" + - "\x03\x02\x02\x02\u0208\u0204\x03\x02\x02\x02\u0209q\x03\x02\x02\x02\u020A" + - "\u020B\b:\x01\x02\u020B\u020C\x05p9\x02\u020C\u0212\x03\x02\x02\x02\u020D" + - "\u020E\f\x03\x02\x02\u020E\u020F\t\n\x02\x02\u020F\u0211\x05p9\x02\u0210" + - "\u020D\x03\x02\x02\x02\u0211\u0214\x03\x02\x02\x02\u0212\u0210\x03\x02" + - "\x02\x02\u0212\u0213\x03\x02\x02\x02\u0213s\x03\x02\x02\x02\u0214\u0212" + - "\x03\x02\x02\x02\u0215\u0216\b;\x01\x02\u0216\u0217\x05r:\x02\u0217\u021D" + - "\x03\x02\x02\x02\u0218\u0219\f\x03\x02\x02\u0219\u021A\t\v\x02\x02\u021A" + - "\u021C\x05r:\x02\u021B\u0218\x03\x02\x02\x02\u021C\u021F\x03\x02\x02\x02" + - "\u021D\u021B\x03\x02\x02\x02\u021D\u021E\x03\x02\x02\x02\u021Eu\x03\x02" + - "\x02\x02\u021F\u021D\x03\x02\x02\x02\u0220\u0221\b<\x01\x02\u0221\u0222" + - "\x05t;\x02\u0222\u0228\x03\x02\x02\x02\u0223\u0224\f\x03\x02\x02\u0224" + - "\u0225\t\f\x02\x02\u0225\u0227\x05t;\x02\u0226\u0223\x03\x02\x02\x02\u0227" + - "\u022A\x03\x02\x02\x02\u0228\u0226\x03\x02\x02\x02\u0228\u0229\x03\x02" + - "\x02\x02\u0229w\x03\x02\x02\x02\u022A\u0228\x03\x02\x02\x02\u022B\u022C" + - "\b=\x01\x02\u022C\u022D\x05v<\x02\u022D\u0233\x03\x02\x02\x02\u022E\u022F" + - "\f\x03\x02\x02\u022F\u0230\t\r\x02\x02\u0230\u0232\x05v<\x02\u0231\u022E" + - "\x03\x02\x02\x02\u0232\u0235\x03\x02\x02\x02\u0233\u0231\x03\x02\x02\x02" + - "\u0233\u0234\x03\x02\x02\x02\u0234y\x03\x02\x02\x02\u0235\u0233\x03\x02" + - "\x02\x02\u0236\u0237\b>\x01\x02\u0237\u0238\x05x=\x02\u0238\u023E\x03" + - "\x02\x02\x02\u0239\u023A\f\x03\x02\x02\u023A\u023B\x072\x02\x02\u023B" + - "\u023D\x05x=\x02\u023C\u0239\x03\x02\x02\x02\u023D\u0240\x03\x02\x02\x02" + - "\u023E\u023C\x03\x02\x02\x02\u023E\u023F\x03\x02\x02"; + "\x8E\x02\x90\x02\x92\x02\x02\x10\x03\x02\x06\x07\x03\x02\r\x0E\x03\x02" + + "\x1B\x1C\x03\x02FG\x04\x02EEHH\x03\x02\x1E \x04\x02--//\x05\x02,,..66" + + "\x03\x0203\x04\x02,,..\x03\x02?B\x03\x02=>\x03\x027<\x04\x02\x1E DD\x02" + + "\u0289\x02\x95\x03\x02\x02\x02\x04\x9A\x03\x02\x02\x02\x06\x9E\x03\x02" + + "\x02\x02\b\xA1\x03\x02\x02\x02\n\xA8\x03\x02\x02\x02\f\xB0\x03\x02\x02" + + "\x02\x0E\xB2\x03\x02\x02\x02\x10\xB5\x03\x02\x02\x02\x12\xB7\x03\x02\x02" + + "\x02\x14\xBE\x03\x02\x02\x02\x16\xC0\x03\x02\x02\x02\x18\xC2\x03\x02\x02" + + "\x02\x1A\xC4\x03\x02\x02\x02\x1C\xD0\x03\x02\x02\x02\x1E\xD8\x03\x02\x02" + + "\x02 \xDC\x03\x02\x02\x02\"\xE1\x03\x02\x02\x02$\xEC\x03\x02\x02\x02&" + + "\xEE\x03\x02\x02\x02(\xF5\x03\x02\x02\x02*\xFC\x03\x02\x02\x02,\xFE\x03" + + "\x02\x02\x02.\u0107\x03\x02\x02\x020\u011C\x03\x02\x02\x022\u0121\x03" + + "\x02\x02\x024\u0123\x03\x02\x02\x026\u013C\x03\x02\x02\x028\u0142\x03" + + "\x02\x02\x02:\u014A\x03\x02\x02\x02<\u014D\x03\x02\x02\x02>\u015C\x03" + + "\x02\x02\x02@\u015E\x03\x02\x02\x02B\u0162\x03\x02\x02\x02D\u0164\x03" + + "\x02\x02\x02F\u0166\x03\x02\x02\x02H\u016A\x03\x02\x02\x02J\u016C\x03" + + "\x02\x02\x02L\u017E\x03\x02\x02\x02N\u0186\x03\x02\x02\x02P\u018E\x03" + + "\x02\x02\x02R\u0190\x03\x02\x02\x02T\u0192\x03\x02\x02\x02V\u01A2\x03" + + "\x02\x02\x02X\u01B2\x03\x02\x02\x02Z\u01B6\x03\x02\x02\x02\\\u01C3\x03" + + "\x02\x02\x02^\u01DD\x03\x02\x02\x02`\u01E5\x03\x02\x02\x02b\u01E8\x03" + + "\x02\x02\x02d\u01EC\x03\x02\x02\x02f\u01FC\x03\x02\x02\x02h\u01FE\x03" + + "\x02\x02\x02j\u0204\x03\x02\x02\x02l\u0206\x03\x02\x02\x02n\u0209\x03" + + "\x02\x02\x02p\u020C\x03\x02\x02\x02r\u020E\x03\x02\x02\x02t\u0215\x03" + + "\x02\x02\x02v\u0217\x03\x02\x02\x02x\u0222\x03\x02\x02\x02z\u022D\x03" + + "\x02\x02\x02|\u0238\x03\x02\x02\x02~\u0243\x03\x02\x02\x02\x80\u024E\x03" + + "\x02\x02\x02\x82\u0260\x03\x02\x02\x02\x84\u0267\x03\x02\x02\x02\x86\u0269" + + "\x03\x02\x02\x02\x88\u026B\x03\x02\x02\x02\x8A\u0276\x03\x02\x02\x02\x8C" + + "\u0278\x03\x02\x02\x02\x8E\u027A\x03\x02\x02\x02\x90\u027F\x03\x02\x02" + + "\x02\x92\u0284\x03\x02\x02\x02\x94\x96\x05\x04\x03\x02\x95\x94\x03\x02" + + "\x02\x02\x95\x96\x03\x02\x02\x02\x96\x97\x03\x02\x02\x02\x97\x98\x07\x02" + + "\x02\x03\x98\x03\x03\x02\x02\x02\x99\x9B\x05\x06\x04\x02\x9A\x99\x03\x02" + + "\x02\x02\x9B\x9C\x03\x02\x02\x02\x9C\x9A\x03\x02\x02\x02\x9C\x9D\x03\x02" + + "\x02\x02\x9D\x05\x03\x02\x02\x02\x9E\x9F\x05\b\x05\x02\x9F\x07\x03\x02" + + "\x02\x02\xA0\xA2\x05\n\x06\x02\xA1\xA0\x03\x02\x02\x02\xA2\xA3\x03\x02" + + "\x02\x02\xA3\xA1\x03\x02\x02\x02\xA3\xA4\x03\x02\x02\x02\xA4\t\x03\x02" + + "\x02\x02\xA5\xA9\x05$\x13\x02\xA6\xA9\x05\f\x07\x02\xA7\xA9\x07\"\x02" + + "\x02\xA8\xA5\x03\x02\x02\x02\xA8\xA6\x03\x02\x02\x02\xA8\xA7\x03\x02\x02" + + "\x02\xA9\v\x03\x02\x02\x02\xAA\xAB\x05\x0E\b\x02\xAB\xAC\x07\"\x02\x02" + + "\xAC\xB1\x03\x02\x02\x02\xAD\xB1\x05\x1A\x0E\x02\xAE\xB1\x05 \x11\x02" + + "\xAF\xB1\x05\"\x12\x02\xB0\xAA\x03\x02\x02\x02\xB0\xAD\x03\x02\x02\x02" + + "\xB0\xAE\x03\x02\x02\x02\xB0\xAF\x03\x02\x02\x02\xB1\r\x03\x02\x02\x02" + + "\xB2\xB3\x05\x10\t\x02\xB3\xB4\x05\x12\n\x02\xB4\x0F\x03\x02\x02\x02\xB5" + + "\xB6\t\x02\x02\x02\xB6\x11\x03\x02\x02\x02\xB7\xB8\x05\x16\f\x02\xB8\xB9" + + "\x07$\x02\x02\xB9\xBC\x05\x8AF\x02\xBA\xBB\x077\x02\x02\xBB\xBD\x05\x14" + + "\v\x02\xBC\xBA\x03\x02\x02\x02\xBC\xBD\x03\x02\x02\x02\xBD\x13\x03\x02" + + "\x02\x02\xBE\xBF\x05\x84C\x02\xBF\x15\x03\x02\x02\x02\xC0\xC1\x05\x18" + + "\r\x02\xC1\x17\x03\x02\x02\x02\xC2\xC3\x07D\x02\x02\xC3\x19\x03\x02\x02" + + "\x02\xC4\xC5\x07\x15\x02\x02\xC5\xC6\x05\x16\f\x02\xC6\xC8\x07%\x02\x02" + + "\xC7\xC9\x05\x1C\x0F\x02\xC8\xC7\x03\x02\x02\x02\xC8\xC9\x03\x02\x02\x02" + + "\xC9\xCA\x03\x02\x02\x02\xCA\xCB\x07&\x02\x02\xCB\xCC\x07\x18\x02\x02" + + "\xCC\xCE\x05\x8AF\x02\xCD\xCF\x05&\x14\x02\xCE\xCD\x03\x02\x02\x02\xCE" + + "\xCF\x03\x02\x02\x02\xCF\x1B\x03\x02\x02\x02\xD0\xD5\x05\x1E\x10\x02\xD1" + + "\xD2\x07!\x02\x02\xD2\xD4\x05\x1E\x10\x02\xD3\xD1\x03\x02\x02\x02\xD4" + + "\xD7\x03\x02\x02\x02\xD5\xD3\x03\x02\x02\x02\xD5\xD6\x03\x02\x02\x02\xD6" + + "\x1D\x03\x02\x02\x02\xD7\xD5\x03\x02\x02\x02\xD8\xD9\x05\x16\f\x02\xD9" + + "\xDA\x07$\x02\x02\xDA\xDB\x05\x8AF\x02\xDB\x1F\x03\x02\x02\x02\xDC\xDD" + + "\x07\x1A\x02\x02\xDD\xDE\x07D\x02\x02\xDE\xDF\x07*\x02\x02\xDF\xE0\x07" + + "+\x02\x02\xE0!\x03\x02\x02\x02\xE1\xE2\x07\x19\x02\x02\xE2\xE3\x07D\x02" + + "\x02\xE3\xE4\x07*\x02\x02\xE4\xE5\x07+\x02\x02\xE5#\x03\x02\x02\x02\xE6" + + "\xED\x05(\x15\x02\xE7\xED\x05*\x16\x02\xE8\xED\x052\x1A\x02\xE9\xED\x05" + + ":\x1E\x02\xEA\xED\x05<\x1F\x02\xEB\xED\x05&\x14\x02\xEC\xE6\x03\x02\x02" + + "\x02\xEC\xE7\x03\x02\x02\x02\xEC\xE8\x03\x02\x02\x02\xEC\xE9\x03\x02\x02" + + "\x02\xEC\xEA\x03\x02\x02\x02\xEC\xEB\x03\x02\x02\x02\xED%\x03\x02\x02" + + "\x02\xEE\xEF\x06\x14\x02\x02\xEF\xF1\x07*\x02\x02\xF0\xF2\x05\b\x05\x02" + + "\xF1\xF0\x03\x02\x02\x02\xF1\xF2\x03\x02\x02\x02\xF2\xF3\x03\x02\x02\x02" + + "\xF3\xF4\x07+\x02\x02\xF4\'\x03\x02\x02\x02\xF5\xF6\b\x15\x01\x02\xF6" + + "\xF7\x05\x88E\x02\xF7\xF8\x07\"\x02\x02\xF8\xF9\b\x15\x01\x02\xF9)\x03" + + "\x02\x02\x02\xFA\xFD\x05,\x17\x02\xFB\xFD\x05.\x18\x02\xFC\xFA\x03\x02" + + "\x02\x02\xFC\xFB\x03\x02\x02\x02\xFD+\x03\x02\x02\x02\xFE\xFF\x07\x11" + + "\x02\x02\xFF\u0100\x07%\x02\x02\u0100\u0101\x05\x88E\x02\u0101\u0102\x07" + + "&\x02\x02\u0102\u0105\x05$\x13\x02\u0103\u0104\x07\x12\x02\x02\u0104\u0106" + + "\x05$\x13\x02\u0105\u0103\x03\x02\x02\x02\u0105\u0106\x03\x02\x02\x02" + + "\u0106-\x03\x02\x02\x02\u0107\u0108\x07\n\x02\x02\u0108\u0109\x07%\x02" + + "\x02\u0109\u010A\x05\x88E\x02\u010A\u010B\x07&\x02\x02\u010B\u010F\x07" + + "*\x02\x02\u010C\u010E\x050\x19\x02\u010D\u010C\x03\x02\x02\x02\u010E\u0111" + + "\x03\x02\x02\x02\u010F\u010D\x03\x02\x02\x02\u010F\u0110\x03\x02\x02\x02" + + "\u0110\u0112\x03\x02\x02\x02\u0111\u010F\x03\x02\x02\x02\u0112\u0113\x07" + + "+\x02\x02\u0113/\x03\x02\x02\x02\u0114\u0115\x07\v\x02\x02\u0115\u0116" + + "\x05\x88E\x02\u0116\u0117\x07$\x02\x02\u0117\u0118\x05$\x13\x02\u0118" + + "\u011D\x03\x02\x02\x02\u0119\u011A\x07\f\x02\x02\u011A\u011B\x07$\x02" + + "\x02\u011B\u011D\x05$\x13\x02\u011C\u0114\x03\x02\x02\x02\u011C\u0119" + + "\x03\x02\x02\x02\u011D1\x03\x02\x02\x02\u011E\u0122\x054\x1B\x02\u011F" + + "\u0122\x056\x1C\x02\u0120\u0122\x058\x1D\x02\u0121\u011E\x03\x02\x02\x02" + + "\u0121\u011F\x03\x02\x02\x02\u0121\u0120\x03\x02\x02\x02\u01223\x03\x02" + + "\x02\x02\u0123\u0124\x07\x13\x02\x02\u0124\u012B\x07%\x02\x02\u0125\u0128" + + "\x05\x0E\b\x02\u0126\u0128\x05\x88E\x02\u0127\u0125\x03\x02\x02\x02\u0127" + + "\u0126\x03\x02\x02\x02\u0128\u0129\x03\x02\x02\x02\u0129\u012A\b\x1B\x01" + + "\x02\u012A\u012C\x03\x02\x02\x02\u012B\u0127\x03\x02\x02\x02\u012B\u012C" + + "\x03\x02\x02\x02\u012C\u012D\x03\x02\x02\x02\u012D\u0131\x07\"\x02\x02" + + "\u012E\u012F\x05\x88E\x02\u012F\u0130\b\x1B\x01\x02\u0130\u0132\x03\x02" + + "\x02\x02\u0131\u012E\x03\x02\x02\x02\u0131\u0132\x03\x02\x02\x02\u0132" + + "\u0133\x03\x02\x02\x02\u0133\u0137\x07\"\x02\x02\u0134\u0135\x05\x88E" + + "\x02\u0135\u0136\b\x1B\x01\x02\u0136\u0138\x03\x02\x02\x02\u0137\u0134" + + "\x03\x02\x02\x02\u0137\u0138\x03\x02\x02\x02\u0138\u0139\x03\x02\x02\x02" + + "\u0139\u013A\x07&\x02\x02\u013A\u013B\x05$\x13\x02\u013B5\x03\x02\x02" + + "\x02\u013C\u013D\x07\x10\x02\x02\u013D\u013E\x07%\x02\x02\u013E\u013F" + + "\x05\x88E\x02\u013F\u0140\x07&\x02\x02\u0140\u0141\x05$\x13\x02\u0141" + + "7\x03\x02\x02\x02\u0142\u0143\x07\x0F\x02\x02\u0143\u0144\x05$\x13\x02" + + "\u0144\u0145\x07\x10\x02\x02\u0145\u0146\x07%\x02\x02\u0146\u0147\x05" + + "\x88E\x02\u0147\u0148\x07&\x02\x02\u0148\u0149\x07\"\x02\x02\u01499\x03" + + "\x02\x02\x02\u014A\u014B\t\x03\x02\x02\u014B\u014C\x07\"\x02\x02\u014C" + + ";\x03\x02\x02\x02\u014D\u014F\x07\x16\x02\x02\u014E\u0150\x05\x88E\x02" + + "\u014F\u014E\x03\x02\x02\x02\u014F\u0150\x03\x02\x02\x02\u0150\u0151\x03" + + "\x02\x02\x02\u0151\u0152\x07\"\x02\x02\u0152=\x03\x02\x02\x02\u0153\u015D" + + "\x05@!\x02\u0154\u015D\x05T+\x02\u0155\u015D\x05V,\x02\u0156\u015D\x05" + + "B\"\x02\u0157\u015D\x05D#\x02\u0158\u015D\x05J&\x02\u0159\u015D\x05L\'" + + "\x02\u015A\u015D\x05R*\x02\u015B\u015D\x05Z.\x02\u015C\u0153\x03\x02\x02" + + "\x02\u015C\u0154\x03\x02\x02\x02\u015C\u0155\x03\x02\x02\x02\u015C\u0156" + + "\x03\x02\x02\x02\u015C\u0157\x03\x02\x02\x02\u015C\u0158\x03\x02\x02\x02" + + "\u015C\u0159\x03\x02\x02\x02\u015C\u015A\x03\x02\x02\x02\u015C\u015B\x03" + + "\x02\x02\x02\u015D?\x03\x02\x02\x02\u015E\u015F\x07%\x02\x02\u015F\u0160" + + "\x05\x88E\x02\u0160\u0161\x07&\x02\x02\u0161A\x03\x02\x02\x02\u0162\u0163" + + "\t\x04\x02\x02\u0163C\x03\x02\x02\x02\u0164\u0165\x05F$\x02\u0165E\x03" + + "\x02\x02\x02\u0166\u0167\x07D\x02\x02\u0167G\x03\x02\x02\x02\u0168\u016B" + + "\x05F$\x02\u0169\u016B\x05J&\x02\u016A\u0168\x03\x02\x02\x02\u016A\u0169" + + "\x03\x02\x02\x02\u016BI\x03\x02\x02\x02\u016C\u016D\t\x05\x02\x02\u016D" + + "K\x03\x02\x02\x02\u016E\u0172\x07K\x02\x02\u016F\u0171\x05N(\x02\u0170" + + "\u016F\x03\x02\x02\x02\u0171\u0174\x03\x02\x02\x02\u0172\u0170\x03\x02" + + "\x02\x02\u0172\u0173\x03\x02\x02\x02\u0173\u0175\x03\x02\x02\x02\u0174" + + "\u0172\x03\x02\x02\x02\u0175\u017F\x07M\x02\x02\u0176\u017A\x07L\x02\x02" + + "\u0177\u0179\x05P)\x02\u0178\u0177\x03\x02\x02\x02\u0179\u017C\x03\x02" + + "\x02\x02\u017A\u0178\x03\x02\x02\x02\u017A\u017B\x03\x02\x02\x02\u017B" + + "\u017D\x03\x02\x02\x02\u017C\u017A\x03\x02\x02\x02\u017D\u017F\x07O\x02" + + "\x02\u017E\u016E\x03\x02\x02\x02\u017E\u0176\x03\x02\x02\x02\u017FM\x03" + + "\x02\x02\x02\u0180\u0187\x07N\x02\x02\u0181\u0183\x07\x03\x02\x02\u0182" + + "\u0184\x05\x88E\x02\u0183\u0182\x03\x02\x02\x02\u0183\u0184\x03\x02\x02" + + "\x02\u0184\u0185\x03\x02\x02\x02\u0185\u0187\x07)\x02\x02\u0186\u0180" + + "\x03\x02\x02\x02\u0186\u0181\x03\x02\x02\x02\u0187O\x03\x02\x02\x02\u0188" + + "\u018F\x07P\x02\x02\u0189\u018B\x07\x03\x02\x02\u018A\u018C\x05\x88E\x02" + + "\u018B\u018A\x03\x02\x02\x02\u018B\u018C\x03\x02\x02\x02\u018C\u018D\x03" + + "\x02\x02\x02\u018D\u018F\x07)\x02\x02\u018E\u0188\x03\x02\x02\x02\u018E" + + "\u0189\x03\x02\x02\x02\u018FQ\x03\x02\x02\x02\u0190\u0191\t\x06\x02\x02" + + "\u0191S\x03\x02\x02\x02\u0192\u019B\x07\'\x02\x02\u0193\u0198\x05\x88" + + "E\x02\u0194\u0195\x07!\x02\x02\u0195\u0197\x05\x88E\x02\u0196\u0194\x03" + + "\x02\x02\x02\u0197\u019A\x03\x02\x02\x02\u0198\u0196\x03\x02\x02\x02\u0198" + + "\u0199\x03\x02\x02\x02\u0199\u019C\x03\x02\x02\x02\u019A\u0198\x03\x02" + + "\x02\x02\u019B\u0193\x03\x02\x02\x02\u019B\u019C\x03\x02\x02\x02\u019C" + + "\u019E\x03\x02\x02\x02\u019D\u019F\x07!\x02\x02\u019E\u019D\x03\x02\x02" + + "\x02\u019E\u019F\x03\x02\x02\x02\u019F\u01A0\x03\x02\x02\x02\u01A0\u01A1" + + "\x07(\x02\x02\u01A1U\x03\x02\x02\x02\u01A2\u01AB\x07*\x02\x02\u01A3\u01A8" + + "\x05X-\x02\u01A4\u01A5\x07!\x02\x02\u01A5\u01A7\x05X-\x02\u01A6\u01A4" + + "\x03\x02\x02\x02\u01A7\u01AA\x03\x02\x02\x02\u01A8\u01A6\x03\x02\x02\x02" + + "\u01A8\u01A9\x03\x02\x02\x02\u01A9\u01AC\x03\x02\x02\x02\u01AA\u01A8\x03" + + "\x02\x02\x02\u01AB\u01A3\x03\x02\x02\x02\u01AB\u01AC\x03\x02\x02\x02\u01AC" + + "\u01AE\x03\x02\x02\x02\u01AD\u01AF\x07!\x02\x02\u01AE\u01AD\x03\x02\x02" + + "\x02\u01AE\u01AF\x03\x02\x02\x02\u01AF\u01B0\x03\x02\x02\x02\u01B0\u01B1" + + "\x07+\x02\x02\u01B1W\x03\x02\x02\x02\u01B2\u01B3\x05H%\x02\u01B3\u01B4" + + "\x07$\x02\x02\u01B4\u01B5\x05\x88E\x02\u01B5Y\x03\x02\x02\x02\u01B6\u01B7" + + "\t\x07\x02\x02\u01B7[\x03\x02\x02\x02\u01B8\u01B9\b/\x01\x02\u01B9\u01C4" + + "\x05> \x02\u01BA\u01BB\x07\x17\x02\x02\u01BB\u01BC\x05\\/\x02\u01BC\u01BE" + + "\x07%\x02\x02\u01BD\u01BF\x05^0\x02\u01BE\u01BD\x03\x02\x02\x02\u01BE" + + "\u01BF\x03\x02\x02\x02\u01BF\u01C0\x03\x02\x02\x02\u01C0\u01C1\x07&\x02" + + "\x02\u01C1\u01C2\b/\x01\x02\u01C2\u01C4\x03\x02\x02\x02\u01C3\u01B8\x03" + + "\x02\x02\x02\u01C3\u01BA\x03\x02\x02\x02\u01C4\u01DA\x03\x02\x02\x02\u01C5" + + "\u01C6\f\x07\x02\x02\u01C6\u01C8\x07%\x02\x02\u01C7\u01C9\x05^0\x02\u01C8" + + "\u01C7\x03\x02\x02\x02\u01C8\u01C9\x03\x02\x02\x02\u01C9\u01CA\x03\x02" + + "\x02\x02\u01CA\u01CB\x07&\x02\x02\u01CB\u01D9\b/\x01\x02\u01CC\u01CD\f" + + "\x05\x02\x02\u01CD\u01CE\x05`1\x02\u01CE\u01CF\b/\x01\x02\u01CF\u01D9" + + "\x03\x02\x02\x02\u01D0\u01D1\f\x04\x02\x02\u01D1\u01D2\x05b2\x02\u01D2" + + "\u01D3\b/\x01\x02\u01D3\u01D9\x03\x02\x02\x02\u01D4\u01D5\f\x03\x02\x02" + + "\u01D5\u01D6\x05d3\x02\u01D6\u01D7\b/\x01\x02\u01D7\u01D9\x03\x02\x02" + + "\x02\u01D8\u01C5\x03\x02\x02\x02\u01D8\u01CC\x03\x02\x02\x02\u01D8\u01D0" + + "\x03\x02\x02\x02\u01D8\u01D4\x03\x02\x02\x02\u01D9\u01DC\x03\x02\x02\x02" + + "\u01DA\u01D8\x03\x02\x02\x02\u01DA\u01DB\x03\x02\x02\x02\u01DB]\x03\x02" + + "\x02\x02\u01DC\u01DA\x03\x02\x02\x02\u01DD\u01E2\x05\x84C\x02\u01DE\u01DF" + + "\x07!\x02\x02\u01DF\u01E1\x05\x84C\x02\u01E0\u01DE\x03\x02\x02\x02\u01E1" + + "\u01E4\x03\x02\x02\x02\u01E2\u01E0\x03\x02\x02\x02\u01E2\u01E3\x03\x02" + + "\x02\x02\u01E3_\x03\x02\x02\x02\u01E4\u01E2\x03\x02\x02\x02\u01E5\u01E6" + + "\x07C\x02\x02\u01E6\u01E7\x05F$\x02\u01E7a\x03\x02\x02\x02\u01E8\u01E9" + + "\x07\'\x02\x02\u01E9\u01EA\x05\x88E\x02\u01EA\u01EB\x07(\x02\x02\u01EB" + + "c\x03\x02\x02\x02\u01EC\u01F0\x07\'\x02\x02\u01ED\u01EE\x05\x88E\x02\u01EE" + + "\u01EF\b3\x01\x02\u01EF\u01F1\x03\x02\x02\x02\u01F0\u01ED\x03\x02\x02" + + "\x02\u01F0\u01F1\x03\x02\x02\x02\u01F1\u01F2\x03\x02\x02\x02\u01F2\u01F6" + + "\x07$\x02\x02\u01F3\u01F4\x05\x88E\x02\u01F4\u01F5\b3\x01\x02\u01F5\u01F7" + + "\x03\x02\x02\x02\u01F6\u01F3\x03\x02\x02\x02\u01F6\u01F7\x03\x02\x02\x02" + + "\u01F7\u01F8\x03\x02\x02\x02\u01F8\u01F9\x07(\x02\x02\u01F9e\x03\x02\x02" + + "\x02\u01FA\u01FD\x05\\/\x02\u01FB\u01FD\x05h5\x02\u01FC\u01FA\x03\x02" + + "\x02\x02\u01FC\u01FB\x03\x02\x02\x02\u01FDg\x03\x02\x02\x02\u01FE\u01FF" + + "\x05\\/\x02\u01FF\u0200\x05p9\x02\u0200i\x03\x02\x02\x02\u0201\u0205\x05" + + "f4\x02\u0202\u0205\x05l7\x02\u0203\u0205\x05n8\x02\u0204\u0201\x03\x02" + + "\x02\x02\u0204\u0202\x03\x02\x02\x02\u0204\u0203\x03\x02\x02\x02\u0205" + + "k\x03\x02\x02\x02\u0206\u0207\x05p9\x02\u0207\u0208\x05f4\x02\u0208m\x03" + + "\x02\x02\x02\u0209\u020A\x05r:\x02\u020A\u020B\x05f4\x02\u020Bo\x03\x02" + + "\x02\x02\u020C\u020D\t\b\x02\x02\u020Dq\x03\x02\x02\x02\u020E\u020F\t" + + "\t\x02\x02\u020Fs\x03\x02\x02\x02\u0210\u0216\x05j6\x02\u0211\u0212\x05" + + "j6\x02\u0212\u0213\x07\b\x02\x02\u0213\u0214\x05\x8AF\x02\u0214\u0216" + + "\x03\x02\x02\x02\u0215\u0210\x03\x02\x02\x02\u0215\u0211\x03\x02\x02\x02" + + "\u0216u\x03\x02\x02\x02\u0217\u0218\b<\x01\x02\u0218\u0219\x05t;\x02\u0219" + + "\u021F\x03\x02\x02\x02\u021A\u021B\f\x03\x02\x02\u021B\u021C\t\n\x02\x02" + + "\u021C\u021E\x05t;\x02\u021D\u021A\x03\x02\x02\x02\u021E\u0221\x03\x02" + + "\x02\x02\u021F\u021D\x03\x02\x02\x02\u021F\u0220\x03\x02\x02\x02\u0220" + + "w\x03\x02\x02\x02\u0221\u021F\x03\x02\x02\x02\u0222\u0223\b=\x01\x02\u0223" + + "\u0224\x05v<\x02\u0224\u022A\x03\x02\x02\x02\u0225\u0226\f\x03\x02\x02" + + "\u0226\u0227\t\v\x02\x02\u0227\u0229\x05v<\x02\u0228\u0225\x03\x02\x02" + + "\x02\u0229\u022C\x03\x02\x02\x02\u022A\u0228\x03\x02\x02\x02\u022A\u022B" + + "\x03\x02\x02\x02\u022By\x03\x02\x02\x02\u022C\u022A\x03\x02\x02\x02\u022D" + + "\u022E\b>\x01\x02\u022E\u022F\x05x=\x02\u022F\u0235\x03\x02\x02\x02\u0230" + + "\u0231\f\x03\x02\x02\u0231\u0232\t\f\x02\x02\u0232\u0234\x05x=\x02\u0233" + + "\u0230\x03\x02\x02\x02\u0234\u0237\x03\x02\x02\x02\u0235\u0233\x03\x02" + + "\x02\x02\u0235\u0236\x03\x02\x02\x02\u0236{\x03\x02\x02\x02\u0237\u0235" + + "\x03\x02\x02\x02\u0238\u0239\b?\x01\x02\u0239\u023A\x05z>\x02\u023A\u0240" + + "\x03\x02\x02\x02\u023B\u023C\f\x03\x02\x02\u023C\u023D\t\r\x02\x02"; private static readonly _serializedATNSegment1: string = - "\x02\u023F{\x03\x02\x02\x02\u0240\u023E\x03\x02\x02\x02\u0241\u0242\b" + - "?\x01\x02\u0242\u0243\x05z>\x02\u0243\u0249\x03\x02\x02\x02\u0244\u0245" + - "\f\x03\x02\x02\u0245\u0246\x073\x02\x02\u0246\u0248\x05z>\x02\u0247\u0244" + - "\x03\x02\x02\x02\u0248\u024B\x03\x02\x02\x02\u0249\u0247\x03\x02\x02\x02" + - "\u0249\u024A\x03\x02\x02\x02\u024A}\x03\x02\x02\x02\u024B\u0249\x03\x02" + - "\x02\x02\u024C\u0254\x05|?\x02\u024D\u024E\x05|?\x02\u024E\u024F\x07!" + - '\x02\x02\u024F\u0250\x05~@\x02\u0250\u0251\x07"\x02\x02\u0251\u0252\x05' + - "~@\x02\u0252\u0254\x03\x02\x02\x02\u0253\u024C\x03\x02\x02\x02\u0253\u024D" + - "\x03\x02\x02\x02\u0254\x7F\x03\x02\x02\x02\u0255\u025B\x05~@\x02\u0256" + - "\u0257\x05X-\x02\u0257\u0258\x05\x82B\x02\u0258\u0259\x05\x80A\x02\u0259" + - "\u025B\x03\x02\x02\x02\u025A\u0255\x03\x02\x02\x02\u025A\u0256\x03\x02" + - "\x02\x02\u025B\x81\x03\x02\x02\x02\u025C\u025D\t\x0E\x02\x02\u025D\x83" + - "\x03\x02\x02\x02\u025E\u0263\x05\x80A\x02\u025F\u0260\x07\x1F\x02\x02" + - "\u0260\u0262\x05\x80A\x02\u0261\u025F\x03\x02\x02\x02\u0262\u0265\x03" + - "\x02\x02\x02\u0263\u0261\x03\x02\x02\x02\u0263\u0264\x03\x02\x02\x02\u0264" + - "\x85\x03\x02\x02\x02\u0265\u0263\x03\x02\x02\x02\u0266\u026A\x05\x88E" + - "\x02\u0267\u026A\x05\x8AF\x02\u0268\u026A\x05\x8CG\x02\u0269\u0266\x03" + - "\x02\x02\x02\u0269\u0267\x03\x02\x02\x02\u0269\u0268\x03\x02\x02\x02\u026A" + - "\x87\x03\x02\x02\x02\u026B\u026C\x05\x8EH\x02\u026C\x89\x03\x02\x02\x02" + - "\u026D\u026E\x05\x8EH\x02\u026E\u026F\x07=\x02\x02\u026F\u0270\x05\x8E" + - "H\x02\u0270\u0271\x07?\x02\x02\u0271\x8B\x03\x02\x02\x02\u0272\u0273\x07" + - "\x1B\x02\x02\u0273\u0274\x07#\x02\x02\u0274\u0275\x05\x8EH\x02\u0275\u0276" + - "\x07$\x02\x02\u0276\x8D\x03\x02\x02\x02\u0277\u0278\t\x0F\x02\x02\u0278" + - "\x8F\x03\x02\x02\x02<\x91\x98\x9F\xA4\xAB\xAD\xB3\xB9\xC9\xD0\xDF\xE4" + - "\xEF\xF8\u0102\u010F\u0114\u011A\u011E\u0124\u012A\u0142\u014F\u015D\u0165" + - "\u016D\u0171\u0176\u0179\u017E\u0181\u018B\u018E\u0191\u019B\u019E\u01A1" + - "\u01B1\u01B6\u01BB\u01CB\u01CD\u01D5\u01E3\u01E9\u01EF\u01F7\u0208\u0212" + - "\u021D\u0228\u0233\u023E\u0249\u0253\u025A\u0263\u0269"; + "\u023D\u023F\x05z>\x02\u023E\u023B\x03\x02\x02\x02\u023F\u0242\x03\x02" + + "\x02\x02\u0240\u023E\x03\x02\x02\x02\u0240\u0241\x03\x02\x02\x02\u0241" + + "}\x03\x02\x02\x02\u0242\u0240\x03\x02\x02\x02\u0243\u0244\b@\x01\x02\u0244" + + "\u0245\x05|?\x02\u0245\u024B\x03\x02\x02\x02\u0246\u0247\f\x03\x02\x02" + + "\u0247\u0248\x074\x02\x02\u0248\u024A\x05|?\x02\u0249\u0246\x03\x02\x02" + + "\x02\u024A\u024D\x03\x02\x02\x02\u024B\u0249\x03\x02\x02\x02\u024B\u024C" + + "\x03\x02\x02\x02\u024C\x7F\x03\x02\x02\x02\u024D\u024B\x03\x02\x02\x02" + + "\u024E\u024F\bA\x01\x02\u024F\u0250\x05~@\x02\u0250\u0256\x03\x02\x02" + + "\x02\u0251\u0252\f\x03\x02\x02\u0252\u0253\x075\x02\x02\u0253\u0255\x05" + + "~@\x02\u0254\u0251\x03\x02\x02\x02\u0255\u0258\x03\x02\x02\x02\u0256\u0254" + + "\x03\x02\x02\x02\u0256\u0257\x03\x02\x02\x02\u0257\x81\x03\x02\x02\x02" + + "\u0258\u0256\x03\x02\x02\x02\u0259\u0261\x05\x80A\x02\u025A\u025B\x05" + + "\x80A\x02\u025B\u025C\x07#\x02\x02\u025C\u025D\x05\x82B\x02\u025D\u025E" + + "\x07$\x02\x02\u025E\u025F\x05\x82B\x02\u025F\u0261\x03\x02\x02\x02\u0260" + + "\u0259\x03\x02\x02\x02\u0260\u025A\x03\x02\x02\x02\u0261\x83\x03\x02\x02" + + "\x02\u0262\u0268\x05\x82B\x02\u0263\u0264\x05\\/\x02\u0264\u0265\x05\x86" + + "D\x02\u0265\u0266\x05\x84C\x02\u0266\u0268\x03\x02\x02\x02\u0267\u0262" + + "\x03\x02\x02\x02\u0267\u0263\x03\x02\x02\x02\u0268\x85\x03\x02\x02\x02" + + "\u0269\u026A\t\x0E\x02\x02\u026A\x87\x03\x02\x02\x02\u026B\u0270\x05\x84" + + "C\x02\u026C\u026D\x07!\x02\x02\u026D\u026F\x05\x84C\x02\u026E\u026C\x03" + + "\x02\x02\x02\u026F\u0272\x03\x02\x02\x02\u0270\u026E\x03\x02\x02\x02\u0270" + + "\u0271\x03\x02\x02\x02\u0271\x89\x03\x02\x02\x02\u0272\u0270\x03\x02\x02" + + "\x02\u0273\u0277\x05\x8CG\x02\u0274\u0277\x05\x8EH\x02\u0275\u0277\x05" + + "\x90I\x02\u0276\u0273\x03\x02\x02\x02\u0276\u0274\x03\x02\x02\x02\u0276" + + "\u0275\x03\x02\x02\x02\u0277\x8B\x03\x02\x02\x02\u0278\u0279\x05\x92J" + + "\x02\u0279\x8D\x03\x02\x02\x02\u027A\u027B\x05\x92J\x02\u027B\u027C\x07" + + "?\x02\x02\u027C\u027D\x05\x92J\x02\u027D\u027E\x07A\x02\x02\u027E\x8F" + + "\x03\x02\x02\x02\u027F\u0280\x07\x1D\x02\x02\u0280\u0281\x07%\x02\x02" + + "\u0281\u0282\x05\x92J\x02\u0282\u0283\x07&\x02\x02\u0283\x91\x03\x02\x02" + + "\x02\u0284\u0285\t\x0F\x02\x02\u0285\x93\x03\x02\x02\x02;\x95\x9C\xA3" + + "\xA8\xB0\xBC\xC8\xCE\xD5\xEC\xF1\xFC\u0105\u010F\u011C\u0121\u0127\u012B" + + "\u0131\u0137\u014F\u015C\u016A\u0172\u017A\u017E\u0183\u0186\u018B\u018E" + + "\u0198\u019B\u019E\u01A8\u01AB\u01AE\u01BE\u01C3\u01C8\u01D8\u01DA\u01E2" + + "\u01F0\u01F6\u01FC\u0204\u0215\u021F\u022A\u0235\u0240\u024B\u0256\u0260" + + "\u0267\u0270\u0276"; public static readonly _serializedATN: string = Utils.join( - [KipperParser._serializedATNSegment0, KipperParser._serializedATNSegment1], + [ + KipperParser._serializedATNSegment0, + KipperParser._serializedATNSegment1, + ], "", ); public static __ATN: ATN; @@ -4447,12 +4075,11 @@ export class KipperParser extends KipperParserBase { return KipperParser.__ATN; } + } export class CompilationUnitContext extends KipperParserRuleContext { - public EOF(): TerminalNode { - return this.getToken(KipperParser.EOF, 0); - } + public EOF(): TerminalNode { return this.getToken(KipperParser.EOF, 0); } public translationUnit(): TranslationUnitContext | undefined { return this.tryGetRuleContext(0, TranslationUnitContext); } @@ -4460,9 +4087,7 @@ export class CompilationUnitContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_compilationUnit; - } + public get ruleIndex(): number { return KipperParser.RULE_compilationUnit; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterCompilationUnit) { @@ -4485,6 +4110,7 @@ export class CompilationUnitContext extends KipperParserRuleContext { } } + export class TranslationUnitContext extends KipperParserRuleContext { public externalItem(): ExternalItemContext[]; public externalItem(i: number): ExternalItemContext; @@ -4499,9 +4125,7 @@ export class TranslationUnitContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_translationUnit; - } + public get ruleIndex(): number { return KipperParser.RULE_translationUnit; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTranslationUnit) { @@ -4524,14 +4148,13 @@ export class TranslationUnitContext extends KipperParserRuleContext { } } + export class ExternalItemContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_externalItem; - } + public get ruleIndex(): number { return KipperParser.RULE_externalItem; } public copyFrom(ctx: ExternalItemContext): void { super.copyFrom(ctx); } @@ -4566,6 +4189,7 @@ export class ExternalBlockItemContext extends ExternalItemContext { } } + export class BlockItemListContext extends KipperParserRuleContext { public blockItem(): BlockItemContext[]; public blockItem(i: number): BlockItemContext; @@ -4580,9 +4204,7 @@ export class BlockItemListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_blockItemList; - } + public get ruleIndex(): number { return KipperParser.RULE_blockItemList; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBlockItemList) { @@ -4605,6 +4227,7 @@ export class BlockItemListContext extends KipperParserRuleContext { } } + export class BlockItemContext extends KipperParserRuleContext { public statement(): StatementContext | undefined { return this.tryGetRuleContext(0, StatementContext); @@ -4612,16 +4235,12 @@ export class BlockItemContext extends KipperParserRuleContext { public declaration(): DeclarationContext | undefined { return this.tryGetRuleContext(0, DeclarationContext); } - public SemiColon(): TerminalNode | undefined { - return this.tryGetToken(KipperParser.SemiColon, 0); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_blockItem; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBlockItem) { @@ -4644,23 +4263,26 @@ export class BlockItemContext extends KipperParserRuleContext { } } + 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 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; - } + public get ruleIndex(): number { return KipperParser.RULE_declaration; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDeclaration) { @@ -4683,132 +4305,145 @@ export class DeclarationContext extends KipperParserRuleContext { } } -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); + +export class VariableDeclarationContext extends KipperParserRuleContext { + public storageTypeSpecifier(): StorageTypeSpecifierContext { + return this.getRuleContext(0, StorageTypeSpecifierContext); } - public RightParen(): TerminalNode { - return this.getToken(KipperParser.RightParen, 0); + public initDeclarator(): InitDeclaratorContext { + return this.getRuleContext(0, InitDeclaratorContext); } - public RetIndicator(): TerminalNode { - return this.getToken(KipperParser.RetIndicator, 0); + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); } - public typeSpecifierExpression(): TypeSpecifierExpressionContext { - return this.getRuleContext(0, TypeSpecifierExpressionContext); + // @Override + public get ruleIndex(): number { return KipperParser.RULE_variableDeclaration; } + // @Override + public enterRule(listener: KipperParserListener): void { + if (listener.enterVariableDeclaration) { + listener.enterVariableDeclaration(this); + } } - public parameterList(): ParameterListContext | undefined { - return this.tryGetRuleContext(0, ParameterListContext); + // @Override + public exitRule(listener: KipperParserListener): void { + if (listener.exitVariableDeclaration) { + listener.exitVariableDeclaration(this); + } } - public compoundStatement(): CompoundStatementContext | undefined { - return this.tryGetRuleContext(0, CompoundStatementContext); + // @Override + public accept(visitor: KipperParserVisitor): Result { + if (visitor.visitVariableDeclaration) { + return visitor.visitVariableDeclaration(this); + } else { + return visitor.visitChildren(this); + } } +} + + +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_functionDeclaration; - } + public get ruleIndex(): number { return KipperParser.RULE_storageTypeSpecifier; } // @Override public enterRule(listener: KipperParserListener): void { - if (listener.enterFunctionDeclaration) { - listener.enterFunctionDeclaration(this); + if (listener.enterStorageTypeSpecifier) { + listener.enterStorageTypeSpecifier(this); } } // @Override public exitRule(listener: KipperParserListener): void { - if (listener.exitFunctionDeclaration) { - listener.exitFunctionDeclaration(this); + if (listener.exitStorageTypeSpecifier) { + listener.exitStorageTypeSpecifier(this); } } // @Override public accept(visitor: KipperParserVisitor): Result { - if (visitor.visitFunctionDeclaration) { - return visitor.visitFunctionDeclaration(this); + if (visitor.visitStorageTypeSpecifier) { + return visitor.visitStorageTypeSpecifier(this); } else { return visitor.visitChildren(this); } } } -export class VariableDeclarationContext extends KipperParserRuleContext { - public storageTypeSpecifier(): StorageTypeSpecifierContext { - return this.getRuleContext(0, StorageTypeSpecifierContext); + +export class InitDeclaratorContext extends KipperParserRuleContext { + public declarator(): DeclaratorContext { + return this.getRuleContext(0, DeclaratorContext); } - public initDeclarator(): InitDeclaratorContext { - return this.getRuleContext(0, InitDeclaratorContext); + 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_variableDeclaration; - } + public get ruleIndex(): number { return KipperParser.RULE_initDeclarator; } // @Override public enterRule(listener: KipperParserListener): void { - if (listener.enterVariableDeclaration) { - listener.enterVariableDeclaration(this); + if (listener.enterInitDeclarator) { + listener.enterInitDeclarator(this); } } // @Override public exitRule(listener: KipperParserListener): void { - if (listener.exitVariableDeclaration) { - listener.exitVariableDeclaration(this); + if (listener.exitInitDeclarator) { + listener.exitInitDeclarator(this); } } // @Override public accept(visitor: KipperParserVisitor): Result { - if (visitor.visitVariableDeclaration) { - return visitor.visitVariableDeclaration(this); + if (visitor.visitInitDeclarator) { + return visitor.visitInitDeclarator(this); } else { return visitor.visitChildren(this); } } } -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); + +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_storageTypeSpecifier; - } + public get ruleIndex(): number { return KipperParser.RULE_initializer; } // @Override public enterRule(listener: KipperParserListener): void { - if (listener.enterStorageTypeSpecifier) { - listener.enterStorageTypeSpecifier(this); + if (listener.enterInitializer) { + listener.enterInitializer(this); } } // @Override public exitRule(listener: KipperParserListener): void { - if (listener.exitStorageTypeSpecifier) { - listener.exitStorageTypeSpecifier(this); + if (listener.exitInitializer) { + listener.exitInitializer(this); } } // @Override public accept(visitor: KipperParserVisitor): Result { - if (visitor.visitStorageTypeSpecifier) { - return visitor.visitStorageTypeSpecifier(this); + if (visitor.visitInitializer) { + return visitor.visitInitializer(this); } else { return visitor.visitChildren(this); } } } + export class DeclaratorContext extends KipperParserRuleContext { public directDeclarator(): DirectDeclaratorContext { return this.getRuleContext(0, DirectDeclaratorContext); @@ -4817,9 +4452,7 @@ export class DeclaratorContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_declarator; - } + public get ruleIndex(): number { return KipperParser.RULE_declarator; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDeclarator) { @@ -4842,17 +4475,14 @@ export class DeclaratorContext extends KipperParserRuleContext { } } + export class DirectDeclaratorContext extends KipperParserRuleContext { - public Identifier(): TerminalNode { - return this.getToken(KipperParser.Identifier, 0); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_directDeclarator; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDirectDeclarator) { @@ -4875,51 +4505,52 @@ export class DirectDeclaratorContext extends KipperParserRuleContext { } } -export class InitDeclaratorContext extends KipperParserRuleContext { + +export class FunctionDeclarationContext extends KipperParserRuleContext { + public DefFunc(): TerminalNode { return this.getToken(KipperParser.DefFunc, 0); } public declarator(): DeclaratorContext { return this.getRuleContext(0, DeclaratorContext); } - public Colon(): TerminalNode { - return this.getToken(KipperParser.Colon, 0); - } + 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 Assign(): TerminalNode | undefined { - return this.tryGetToken(KipperParser.Assign, 0); + public parameterList(): ParameterListContext | undefined { + return this.tryGetRuleContext(0, ParameterListContext); } - public initializer(): InitializerContext | undefined { - return this.tryGetRuleContext(0, InitializerContext); + 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_initDeclarator; - } + public get ruleIndex(): number { return KipperParser.RULE_functionDeclaration; } // @Override public enterRule(listener: KipperParserListener): void { - if (listener.enterInitDeclarator) { - listener.enterInitDeclarator(this); + if (listener.enterFunctionDeclaration) { + listener.enterFunctionDeclaration(this); } } // @Override public exitRule(listener: KipperParserListener): void { - if (listener.exitInitDeclarator) { - listener.exitInitDeclarator(this); + if (listener.exitFunctionDeclaration) { + listener.exitFunctionDeclaration(this); } } // @Override public accept(visitor: KipperParserVisitor): Result { - if (visitor.visitInitDeclarator) { - return visitor.visitInitDeclarator(this); + if (visitor.visitFunctionDeclaration) { + return visitor.visitFunctionDeclaration(this); } else { return visitor.visitChildren(this); } } } + export class ParameterListContext extends KipperParserRuleContext { public parameterDeclaration(): ParameterDeclarationContext[]; public parameterDeclaration(i: number): ParameterDeclarationContext; @@ -4943,9 +4574,7 @@ export class ParameterListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_parameterList; - } + public get ruleIndex(): number { return KipperParser.RULE_parameterList; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterParameterList) { @@ -4968,13 +4597,12 @@ export class ParameterListContext extends KipperParserRuleContext { } } + export class ParameterDeclarationContext extends KipperParserRuleContext { public declarator(): DeclaratorContext { return this.getRuleContext(0, DeclaratorContext); } - public Colon(): TerminalNode { - return this.getToken(KipperParser.Colon, 0); - } + public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } public typeSpecifierExpression(): TypeSpecifierExpressionContext { return this.getRuleContext(0, TypeSpecifierExpressionContext); } @@ -4982,9 +4610,7 @@ export class ParameterDeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_parameterDeclaration; - } + public get ruleIndex(): number { return KipperParser.RULE_parameterDeclaration; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterParameterDeclaration) { @@ -5007,39 +4633,73 @@ export class ParameterDeclarationContext extends KipperParserRuleContext { } } -export class InitializerContext extends KipperParserRuleContext { - public assignmentExpression(): AssignmentExpressionContext { - return this.getRuleContext(0, AssignmentExpressionContext); - } + +export class InterfaceDeclarationContext extends KipperParserRuleContext { + public Interface(): TerminalNode { return this.getToken(KipperParser.Interface, 0); } + public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } + 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_initializer; + 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) { + return visitor.visitInterfaceDeclaration(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class ClassDeclarationContext extends KipperParserRuleContext { + public Class(): TerminalNode { return this.getToken(KipperParser.Class, 0); } + public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } + 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.enterInitializer) { - listener.enterInitializer(this); + if (listener.enterClassDeclaration) { + listener.enterClassDeclaration(this); } } // @Override public exitRule(listener: KipperParserListener): void { - if (listener.exitInitializer) { - listener.exitInitializer(this); + if (listener.exitClassDeclaration) { + listener.exitClassDeclaration(this); } } // @Override public accept(visitor: KipperParserVisitor): Result { - if (visitor.visitInitializer) { - return visitor.visitInitializer(this); + if (visitor.visitClassDeclaration) { + return visitor.visitClassDeclaration(this); } else { return visitor.visitChildren(this); } } } + export class StatementContext extends KipperParserRuleContext { public expressionStatement(): ExpressionStatementContext | undefined { return this.tryGetRuleContext(0, ExpressionStatementContext); @@ -5063,9 +4723,7 @@ export class StatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_statement; - } + public get ruleIndex(): number { return KipperParser.RULE_statement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStatement) { @@ -5088,13 +4746,10 @@ export class StatementContext extends KipperParserRuleContext { } } + export class CompoundStatementContext extends KipperParserRuleContext { - public LeftBrace(): TerminalNode { - return this.getToken(KipperParser.LeftBrace, 0); - } - public RightBrace(): TerminalNode { - return this.getToken(KipperParser.RightBrace, 0); - } + 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); } @@ -5102,9 +4757,7 @@ export class CompoundStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_compoundStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_compoundStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterCompoundStatement) { @@ -5127,20 +4780,17 @@ export class CompoundStatementContext extends KipperParserRuleContext { } } + export class ExpressionStatementContext extends KipperParserRuleContext { public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } - public SemiColon(): TerminalNode { - return this.getToken(KipperParser.SemiColon, 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_expressionStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_expressionStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterExpressionStatement) { @@ -5163,6 +4813,7 @@ export class ExpressionStatementContext extends KipperParserRuleContext { } } + export class SelectionStatementContext extends KipperParserRuleContext { public ifStatement(): IfStatementContext | undefined { return this.tryGetRuleContext(0, IfStatementContext); @@ -5174,9 +4825,7 @@ export class SelectionStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_selectionStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_selectionStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSelectionStatement) { @@ -5199,19 +4848,14 @@ export class SelectionStatementContext extends KipperParserRuleContext { } } + export class IfStatementContext extends KipperParserRuleContext { - public If(): TerminalNode { - return this.getToken(KipperParser.If, 0); - } - public LeftParen(): TerminalNode { - return this.getToken(KipperParser.LeftParen, 0); - } + 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 RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } public statement(): StatementContext[]; public statement(i: number): StatementContext; public statement(i?: number): StatementContext | StatementContext[] { @@ -5221,16 +4865,12 @@ export class IfStatementContext extends KipperParserRuleContext { return this.getRuleContext(i, StatementContext); } } - public Else(): TerminalNode | undefined { - return this.tryGetToken(KipperParser.Else, 0); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_ifStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIfStatement) { @@ -5253,25 +4893,16 @@ export class IfStatementContext extends KipperParserRuleContext { } } + export class SwitchStatementContext extends KipperParserRuleContext { - public Switch(): TerminalNode { - return this.getToken(KipperParser.Switch, 0); - } - public LeftParen(): TerminalNode { - return this.getToken(KipperParser.LeftParen, 0); - } + 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 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[] { @@ -5285,9 +4916,7 @@ export class SwitchStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_switchStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_switchStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSwitchStatement) { @@ -5310,29 +4939,22 @@ export class SwitchStatementContext extends KipperParserRuleContext { } } + export class SwitchLabeledStatementContext extends KipperParserRuleContext { - public Case(): TerminalNode | undefined { - return this.tryGetToken(KipperParser.Case, 0); - } + 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 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_switchLabeledStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSwitchLabeledStatement) { @@ -5355,6 +4977,7 @@ export class SwitchLabeledStatementContext extends KipperParserRuleContext { } } + export class IterationStatementContext extends KipperParserRuleContext { public forLoopIterationStatement(): ForLoopIterationStatementContext | undefined { return this.tryGetRuleContext(0, ForLoopIterationStatementContext); @@ -5369,9 +4992,7 @@ export class IterationStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_iterationStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_iterationStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIterationStatement) { @@ -5394,16 +5015,13 @@ export class IterationStatementContext extends KipperParserRuleContext { } } + 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 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[] { @@ -5413,9 +5031,7 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { return this.getToken(KipperParser.SemiColon, i); } } - public RightParen(): TerminalNode { - return this.getToken(KipperParser.RightParen, 0); - } + public RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } public statement(): StatementContext { return this.getRuleContext(0, StatementContext); } @@ -5435,9 +5051,7 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_forLoopIterationStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_forLoopIterationStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterForLoopIterationStatement) { @@ -5460,19 +5074,14 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { } } + export class WhileLoopIterationStatementContext extends KipperParserRuleContext { - public While(): TerminalNode { - return this.getToken(KipperParser.While, 0); - } - public LeftParen(): TerminalNode { - return this.getToken(KipperParser.LeftParen, 0); - } + 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 RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } public statement(): StatementContext { return this.getRuleContext(0, StatementContext); } @@ -5480,9 +5089,7 @@ export class WhileLoopIterationStatementContext extends KipperParserRuleContext super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_whileLoopIterationStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_whileLoopIterationStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterWhileLoopIterationStatement) { @@ -5505,35 +5112,24 @@ export class WhileLoopIterationStatementContext extends KipperParserRuleContext } } + export class DoWhileLoopIterationStatementContext extends KipperParserRuleContext { - public Do(): TerminalNode { - return this.getToken(KipperParser.Do, 0); - } + 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 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_doWhileLoopIterationStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDoWhileLoopIterationStatement) { @@ -5556,23 +5152,16 @@ export class DoWhileLoopIterationStatementContext extends KipperParserRuleContex } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_jumpStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterJumpStatement) { @@ -5595,13 +5184,10 @@ export class JumpStatementContext extends KipperParserRuleContext { } } + export class ReturnStatementContext extends KipperParserRuleContext { - public Return(): TerminalNode { - return this.getToken(KipperParser.Return, 0); - } - public SemiColon(): TerminalNode { - return this.getToken(KipperParser.SemiColon, 0); - } + 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); } @@ -5609,9 +5195,7 @@ export class ReturnStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_returnStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_returnStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterReturnStatement) { @@ -5634,6 +5218,7 @@ export class ReturnStatementContext extends KipperParserRuleContext { } } + export class PrimaryExpressionContext extends KipperParserRuleContext { public tangledPrimaryExpression(): TangledPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, TangledPrimaryExpressionContext); @@ -5666,9 +5251,7 @@ export class PrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_primaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_primaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPrimaryExpression) { @@ -5691,23 +5274,18 @@ export class PrimaryExpressionContext extends KipperParserRuleContext { } } + export class TangledPrimaryExpressionContext extends KipperParserRuleContext { - public LeftParen(): TerminalNode { - return this.getToken(KipperParser.LeftParen, 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 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; - } + public get ruleIndex(): number { return KipperParser.RULE_tangledPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTangledPrimaryExpression) { @@ -5730,20 +5308,15 @@ export class TangledPrimaryExpressionContext extends KipperParserRuleContext { } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_boolPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBoolPrimaryExpression) { @@ -5766,6 +5339,7 @@ export class BoolPrimaryExpressionContext extends KipperParserRuleContext { } } + export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext { public identifier(): IdentifierContext { return this.getRuleContext(0, IdentifierContext); @@ -5774,9 +5348,7 @@ export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_identifierPrimaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_identifierPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierPrimaryExpression) { @@ -5799,17 +5371,14 @@ export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext } } + export class IdentifierContext extends KipperParserRuleContext { - public Identifier(): TerminalNode { - return this.getToken(KipperParser.Identifier, 0); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_identifier; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifier) { @@ -5832,6 +5401,7 @@ export class IdentifierContext extends KipperParserRuleContext { } } + export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRuleContext { public identifier(): IdentifierContext | undefined { return this.tryGetRuleContext(0, IdentifierContext); @@ -5843,9 +5413,7 @@ export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRule super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_identifierOrStringPrimaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_identifierOrStringPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierOrStringPrimaryExpression) { @@ -5868,20 +5436,15 @@ export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRule } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_stringPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStringPrimaryExpression) { @@ -5904,13 +5467,10 @@ export class StringPrimaryExpressionContext extends KipperParserRuleContext { } } + 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 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[] { @@ -5920,12 +5480,8 @@ 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 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[] { @@ -5939,9 +5495,7 @@ export class FStringPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_fStringPrimaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_fStringPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringPrimaryExpression) { @@ -5964,16 +5518,11 @@ export class FStringPrimaryExpressionContext extends KipperParserRuleContext { } } + 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 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); } @@ -5981,9 +5530,7 @@ export class FStringSingleQuoteAtomContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_fStringSingleQuoteAtom; - } + public get ruleIndex(): number { return KipperParser.RULE_fStringSingleQuoteAtom; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringSingleQuoteAtom) { @@ -6006,16 +5553,11 @@ export class FStringSingleQuoteAtomContext extends KipperParserRuleContext { } } + 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 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); } @@ -6023,9 +5565,7 @@ export class FStringDoubleQuoteAtomContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_fStringDoubleQuoteAtom; - } + public get ruleIndex(): number { return KipperParser.RULE_fStringDoubleQuoteAtom; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringDoubleQuoteAtom) { @@ -6048,20 +5588,15 @@ export class FStringDoubleQuoteAtomContext extends KipperParserRuleContext { } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_numberPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterNumberPrimaryExpression) { @@ -6084,13 +5619,10 @@ export class NumberPrimaryExpressionContext extends KipperParserRuleContext { } } + export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { - public LeftBracket(): TerminalNode { - return this.getToken(KipperParser.LeftBracket, 0); - } - public RightBracket(): TerminalNode { - return this.getToken(KipperParser.RightBracket, 0); - } + 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[] { @@ -6113,9 +5645,7 @@ export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_arrayPrimaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_arrayPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterArrayPrimaryExpression) { @@ -6138,13 +5668,10 @@ export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { } } + export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { - public LeftBrace(): TerminalNode { - return this.getToken(KipperParser.LeftBrace, 0); - } - public RightBrace(): TerminalNode { - return this.getToken(KipperParser.RightBrace, 0); - } + 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[] { @@ -6167,9 +5694,7 @@ export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_objectPrimaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_objectPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterObjectPrimaryExpression) { @@ -6192,13 +5717,12 @@ export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { } } + export class ObjectPropertyContext extends KipperParserRuleContext { public identifierOrStringPrimaryExpression(): IdentifierOrStringPrimaryExpressionContext { return this.getRuleContext(0, IdentifierOrStringPrimaryExpressionContext); } - public Colon(): TerminalNode { - return this.getToken(KipperParser.Colon, 0); - } + public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } @@ -6206,9 +5730,7 @@ export class ObjectPropertyContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_objectProperty; - } + public get ruleIndex(): number { return KipperParser.RULE_objectProperty; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterObjectProperty) { @@ -6231,23 +5753,16 @@ export class ObjectPropertyContext extends KipperParserRuleContext { } } + export class VoidOrNullOrUndefinedPrimaryExpressionContext extends KipperParserRuleContext { - 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_voidOrNullOrUndefinedPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterVoidOrNullOrUndefinedPrimaryExpression) { @@ -6270,15 +5785,14 @@ 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 get ruleIndex(): number { return KipperParser.RULE_computedPrimaryExpression; } public copyFrom(ctx: ComputedPrimaryExpressionContext): void { super.copyFrom(ctx); this._labelASTKind = ctx._labelASTKind; @@ -6317,12 +5831,8 @@ export class FunctionCallExpressionContext extends ComputedPrimaryExpressionCont 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 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); } @@ -6352,18 +5862,12 @@ export class FunctionCallExpressionContext extends ComputedPrimaryExpressionCont } } export class ExplicitCallFunctionCallExpressionContext extends ComputedPrimaryExpressionContext { - public CallFunc(): TerminalNode { - return this.getToken(KipperParser.CallFunc, 0); - } + 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 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); } @@ -6489,6 +5993,7 @@ export class SliceNotationMemberAccessExpressionContext extends ComputedPrimaryE } } + export class ArgumentExpressionListContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext[]; public assignmentExpression(i: number): AssignmentExpressionContext; @@ -6512,9 +6017,7 @@ export class ArgumentExpressionListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_argumentExpressionList; - } + public get ruleIndex(): number { return KipperParser.RULE_argumentExpressionList; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterArgumentExpressionList) { @@ -6537,10 +6040,9 @@ export class ArgumentExpressionListContext extends KipperParserRuleContext { } } + export class DotNotationContext extends KipperParserRuleContext { - public Dot(): TerminalNode { - return this.getToken(KipperParser.Dot, 0); - } + public Dot(): TerminalNode { return this.getToken(KipperParser.Dot, 0); } public identifier(): IdentifierContext { return this.getRuleContext(0, IdentifierContext); } @@ -6548,9 +6050,7 @@ export class DotNotationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_dotNotation; - } + public get ruleIndex(): number { return KipperParser.RULE_dotNotation; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDotNotation) { @@ -6573,23 +6073,18 @@ export class DotNotationContext extends KipperParserRuleContext { } } + export class BracketNotationContext extends KipperParserRuleContext { - public LeftBracket(): TerminalNode { - return this.getToken(KipperParser.LeftBracket, 0); - } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_bracketNotation; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBracketNotation) { @@ -6612,18 +6107,13 @@ 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 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[] { @@ -6637,9 +6127,7 @@ export class SliceNotationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_sliceNotation; - } + public get ruleIndex(): number { return KipperParser.RULE_sliceNotation; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSliceNotation) { @@ -6662,6 +6150,7 @@ export class SliceNotationContext extends KipperParserRuleContext { } } + export class PostfixExpressionContext extends KipperParserRuleContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, ComputedPrimaryExpressionContext); @@ -6673,9 +6162,7 @@ export class PostfixExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_postfixExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_postfixExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPostfixExpression) { @@ -6698,6 +6185,7 @@ export class PostfixExpressionContext extends KipperParserRuleContext { } } + export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRuleContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext { return this.getRuleContext(0, ComputedPrimaryExpressionContext); @@ -6709,9 +6197,7 @@ export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRu super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_incrementOrDecrementPostfixExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementPostfixExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementPostfixExpression) { @@ -6734,6 +6220,7 @@ export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRu } } + export class UnaryExpressionContext extends KipperParserRuleContext { public postfixExpression(): PostfixExpressionContext | undefined { return this.tryGetRuleContext(0, PostfixExpressionContext); @@ -6748,9 +6235,7 @@ export class UnaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_unaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_unaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterUnaryExpression) { @@ -6773,6 +6258,7 @@ export class UnaryExpressionContext extends KipperParserRuleContext { } } + export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRuleContext { public incrementOrDecrementOperator(): IncrementOrDecrementOperatorContext { return this.getRuleContext(0, IncrementOrDecrementOperatorContext); @@ -6784,9 +6270,7 @@ export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRule super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_incrementOrDecrementUnaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementUnaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementUnaryExpression) { @@ -6809,6 +6293,7 @@ export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRule } } + export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleContext { public unaryOperator(): UnaryOperatorContext { return this.getRuleContext(0, UnaryOperatorContext); @@ -6820,9 +6305,7 @@ export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleCont super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_operatorModifiedUnaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_operatorModifiedUnaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterOperatorModifiedUnaryExpression) { @@ -6845,20 +6328,15 @@ export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleCont } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementOperator; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementOperator) { @@ -6881,23 +6359,16 @@ export class IncrementOrDecrementOperatorContext extends KipperParserRuleContext } } + 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 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); } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_unaryOperator; - } + public get ruleIndex(): number { return KipperParser.RULE_unaryOperator; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterUnaryOperator) { @@ -6920,14 +6391,13 @@ export class UnaryOperatorContext extends KipperParserRuleContext { } } + export class CastOrConvertExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_castOrConvertExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_castOrConvertExpression; } public copyFrom(ctx: CastOrConvertExpressionContext): void { super.copyFrom(ctx); } @@ -6965,9 +6435,7 @@ export class ActualCastOrConvertExpressionContext extends CastOrConvertExpressio public unaryExpression(): UnaryExpressionContext { return this.getRuleContext(0, UnaryExpressionContext); } - public As(): TerminalNode { - return this.getToken(KipperParser.As, 0); - } + public As(): TerminalNode { return this.getToken(KipperParser.As, 0); } public typeSpecifierExpression(): TypeSpecifierExpressionContext { return this.getRuleContext(0, TypeSpecifierExpressionContext); } @@ -6997,14 +6465,13 @@ export class ActualCastOrConvertExpressionContext extends CastOrConvertExpressio } } + export class MultiplicativeExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_multiplicativeExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_multiplicativeExpression; } public copyFrom(ctx: MultiplicativeExpressionContext): void { super.copyFrom(ctx); } @@ -7045,18 +6512,10 @@ export class ActualMultiplicativeExpressionContext extends MultiplicativeExpress 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); - } + 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); @@ -7083,14 +6542,13 @@ export class ActualMultiplicativeExpressionContext extends MultiplicativeExpress } } + export class AdditiveExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_additiveExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_additiveExpression; } public copyFrom(ctx: AdditiveExpressionContext): void { super.copyFrom(ctx); } @@ -7131,12 +6589,8 @@ export class ActualAdditiveExpressionContext extends 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); - } + 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); @@ -7163,14 +6617,13 @@ export class ActualAdditiveExpressionContext extends AdditiveExpressionContext { } } + export class RelationalExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_relationalExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_relationalExpression; } public copyFrom(ctx: RelationalExpressionContext): void { super.copyFrom(ctx); } @@ -7211,18 +6664,10 @@ export class ActualRelationalExpressionContext extends RelationalExpressionConte public additiveExpression(): AdditiveExpressionContext { return this.getRuleContext(0, AdditiveExpressionContext); } - 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); - } + 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); @@ -7249,14 +6694,13 @@ export class ActualRelationalExpressionContext extends RelationalExpressionConte } } + export class EqualityExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_equalityExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_equalityExpression; } public copyFrom(ctx: EqualityExpressionContext): void { super.copyFrom(ctx); } @@ -7297,12 +6741,8 @@ export class ActualEqualityExpressionContext extends 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); - } + 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); @@ -7329,14 +6769,13 @@ export class ActualEqualityExpressionContext extends EqualityExpressionContext { } } + export class LogicalAndExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_logicalAndExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_logicalAndExpression; } public copyFrom(ctx: LogicalAndExpressionContext): void { super.copyFrom(ctx); } @@ -7374,9 +6813,7 @@ export class ActualLogicalAndExpressionContext extends LogicalAndExpressionConte public logicalAndExpression(): LogicalAndExpressionContext { return this.getRuleContext(0, LogicalAndExpressionContext); } - public AndAnd(): TerminalNode { - return this.getToken(KipperParser.AndAnd, 0); - } + public AndAnd(): TerminalNode { return this.getToken(KipperParser.AndAnd, 0); } public equalityExpression(): EqualityExpressionContext { return this.getRuleContext(0, EqualityExpressionContext); } @@ -7406,14 +6843,13 @@ export class ActualLogicalAndExpressionContext extends LogicalAndExpressionConte } } + export class LogicalOrExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_logicalOrExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_logicalOrExpression; } public copyFrom(ctx: LogicalOrExpressionContext): void { super.copyFrom(ctx); } @@ -7451,9 +6887,7 @@ export class ActualLogicalOrExpressionContext extends LogicalOrExpressionContext public logicalOrExpression(): LogicalOrExpressionContext { return this.getRuleContext(0, LogicalOrExpressionContext); } - public OrOr(): TerminalNode { - return this.getToken(KipperParser.OrOr, 0); - } + public OrOr(): TerminalNode { return this.getToken(KipperParser.OrOr, 0); } public logicalAndExpression(): LogicalAndExpressionContext { return this.getRuleContext(0, LogicalAndExpressionContext); } @@ -7483,14 +6917,13 @@ export class ActualLogicalOrExpressionContext extends LogicalOrExpressionContext } } + export class ConditionalExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_conditionalExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_conditionalExpression; } public copyFrom(ctx: ConditionalExpressionContext): void { super.copyFrom(ctx); } @@ -7528,9 +6961,7 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon public logicalOrExpression(): LogicalOrExpressionContext { return this.getRuleContext(0, LogicalOrExpressionContext); } - public QuestionMark(): TerminalNode { - return this.getToken(KipperParser.QuestionMark, 0); - } + public QuestionMark(): TerminalNode { return this.getToken(KipperParser.QuestionMark, 0); } public conditionalExpression(): ConditionalExpressionContext[]; public conditionalExpression(i: number): ConditionalExpressionContext; public conditionalExpression(i?: number): ConditionalExpressionContext | ConditionalExpressionContext[] { @@ -7540,9 +6971,7 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon return this.getRuleContext(i, ConditionalExpressionContext); } } - public Colon(): TerminalNode { - return this.getToken(KipperParser.Colon, 0); - } + public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } constructor(ctx: ConditionalExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); @@ -7569,14 +6998,13 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon } } + export class AssignmentExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_assignmentExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_assignmentExpression; } public copyFrom(ctx: AssignmentExpressionContext): void { super.copyFrom(ctx); } @@ -7646,32 +7074,19 @@ export class ActualAssignmentExpressionContext extends AssignmentExpressionConte } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_assignmentOperator; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterAssignmentOperator) { @@ -7694,6 +7109,7 @@ export class AssignmentOperatorContext extends KipperParserRuleContext { } } + export class ExpressionContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext[]; public assignmentExpression(i: number): AssignmentExpressionContext; @@ -7717,9 +7133,7 @@ export class ExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_expression; - } + public get ruleIndex(): number { return KipperParser.RULE_expression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterExpression) { @@ -7742,6 +7156,7 @@ export class ExpressionContext extends KipperParserRuleContext { } } + export class TypeSpecifierExpressionContext extends KipperParserRuleContext { public identifierTypeSpecifierExpression(): IdentifierTypeSpecifierExpressionContext | undefined { return this.tryGetRuleContext(0, IdentifierTypeSpecifierExpressionContext); @@ -7756,9 +7171,7 @@ export class TypeSpecifierExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_typeSpecifierExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_typeSpecifierExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeSpecifierExpression) { @@ -7781,6 +7194,7 @@ export class TypeSpecifierExpressionContext extends KipperParserRuleContext { } } + export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleContext { public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext { return this.getRuleContext(0, TypeSpecifierIdentifierContext); @@ -7789,9 +7203,7 @@ export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleCo super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_identifierTypeSpecifierExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_identifierTypeSpecifierExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierTypeSpecifierExpression) { @@ -7814,6 +7226,7 @@ export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleCo } } + export class GenericTypeSpecifierExpressionContext extends KipperParserRuleContext { public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext[]; public typeSpecifierIdentifier(i: number): TypeSpecifierIdentifierContext; @@ -7824,19 +7237,13 @@ 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_genericTypeSpecifierExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterGenericTypeSpecifierExpression) { @@ -7859,26 +7266,19 @@ export class GenericTypeSpecifierExpressionContext extends KipperParserRuleConte } } + export class TypeofTypeSpecifierExpressionContext extends KipperParserRuleContext { - public Typeof(): TerminalNode { - return this.getToken(KipperParser.Typeof, 0); - } - public LeftParen(): TerminalNode { - return this.getToken(KipperParser.LeftParen, 0); - } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_typeofTypeSpecifierExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeofTypeSpecifierExpression) { @@ -7901,26 +7301,17 @@ export class TypeofTypeSpecifierExpressionContext extends KipperParserRuleContex } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_typeSpecifierIdentifier; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeSpecifierIdentifier) { @@ -7942,3 +7333,5 @@ export class TypeSpecifierIdentifierContext extends KipperParserRuleContext { } } } + + diff --git a/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts b/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts index 9969d10fc..8a8d69101 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts @@ -1,9 +1,11 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT -// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax -// kind values. -import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; -import KipperParserBase from "./base/KipperParserBase"; + + // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax + // kind values. + import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; + import KipperParserBase from "./base/KipperParserBase"; + import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; @@ -38,15 +40,17 @@ import { ExternalItemContext } from "./KipperParser"; import { BlockItemListContext } from "./KipperParser"; import { BlockItemContext } from "./KipperParser"; import { DeclarationContext } from "./KipperParser"; -import { FunctionDeclarationContext } from "./KipperParser"; import { VariableDeclarationContext } from "./KipperParser"; import { StorageTypeSpecifierContext } from "./KipperParser"; +import { InitDeclaratorContext } from "./KipperParser"; +import { InitializerContext } from "./KipperParser"; import { DeclaratorContext } from "./KipperParser"; import { DirectDeclaratorContext } from "./KipperParser"; -import { InitDeclaratorContext } from "./KipperParser"; +import { FunctionDeclarationContext } from "./KipperParser"; import { ParameterListContext } from "./KipperParser"; import { ParameterDeclarationContext } from "./KipperParser"; -import { InitializerContext } from "./KipperParser"; +import { InterfaceDeclarationContext } from "./KipperParser"; +import { ClassDeclarationContext } from "./KipperParser"; import { StatementContext } from "./KipperParser"; import { CompoundStatementContext } from "./KipperParser"; import { ExpressionStatementContext } from "./KipperParser"; @@ -104,6 +108,7 @@ import { GenericTypeSpecifierExpressionContext } from "./KipperParser"; import { TypeofTypeSpecifierExpressionContext } from "./KipperParser"; import { TypeSpecifierIdentifierContext } from "./KipperParser"; + /** * This interface defines a complete listener for a parse tree produced by * `KipperParser`. @@ -500,17 +505,6 @@ export interface KipperParserListener extends ParseTreeListener { */ exitDeclaration?: (ctx: DeclarationContext) => void; - /** - * Enter a parse tree produced by `KipperParser.functionDeclaration`. - * @param ctx the parse tree - */ - enterFunctionDeclaration?: (ctx: FunctionDeclarationContext) => void; - /** - * Exit a parse tree produced by `KipperParser.functionDeclaration`. - * @param ctx the parse tree - */ - exitFunctionDeclaration?: (ctx: FunctionDeclarationContext) => void; - /** * Enter a parse tree produced by `KipperParser.variableDeclaration`. * @param ctx the parse tree @@ -533,6 +527,28 @@ export interface KipperParserListener extends ParseTreeListener { */ exitStorageTypeSpecifier?: (ctx: StorageTypeSpecifierContext) => void; + /** + * Enter a parse tree produced by `KipperParser.initDeclarator`. + * @param ctx the parse tree + */ + enterInitDeclarator?: (ctx: InitDeclaratorContext) => void; + /** + * Exit a parse tree produced by `KipperParser.initDeclarator`. + * @param ctx the parse tree + */ + exitInitDeclarator?: (ctx: InitDeclaratorContext) => void; + + /** + * Enter a parse tree produced by `KipperParser.initializer`. + * @param ctx the parse tree + */ + enterInitializer?: (ctx: InitializerContext) => void; + /** + * Exit a parse tree produced by `KipperParser.initializer`. + * @param ctx the parse tree + */ + exitInitializer?: (ctx: InitializerContext) => void; + /** * Enter a parse tree produced by `KipperParser.declarator`. * @param ctx the parse tree @@ -556,15 +572,15 @@ export interface KipperParserListener extends ParseTreeListener { exitDirectDeclarator?: (ctx: DirectDeclaratorContext) => void; /** - * Enter a parse tree produced by `KipperParser.initDeclarator`. + * Enter a parse tree produced by `KipperParser.functionDeclaration`. * @param ctx the parse tree */ - enterInitDeclarator?: (ctx: InitDeclaratorContext) => void; + enterFunctionDeclaration?: (ctx: FunctionDeclarationContext) => void; /** - * Exit a parse tree produced by `KipperParser.initDeclarator`. + * Exit a parse tree produced by `KipperParser.functionDeclaration`. * @param ctx the parse tree */ - exitInitDeclarator?: (ctx: InitDeclaratorContext) => void; + exitFunctionDeclaration?: (ctx: FunctionDeclarationContext) => void; /** * Enter a parse tree produced by `KipperParser.parameterList`. @@ -589,15 +605,26 @@ export interface KipperParserListener extends ParseTreeListener { exitParameterDeclaration?: (ctx: ParameterDeclarationContext) => void; /** - * Enter a parse tree produced by `KipperParser.initializer`. + * Enter a parse tree produced by `KipperParser.interfaceDeclaration`. * @param ctx the parse tree */ - enterInitializer?: (ctx: InitializerContext) => void; + enterInterfaceDeclaration?: (ctx: InterfaceDeclarationContext) => void; /** - * Exit a parse tree produced by `KipperParser.initializer`. + * Exit a parse tree produced by `KipperParser.interfaceDeclaration`. * @param ctx the parse tree */ - exitInitializer?: (ctx: InitializerContext) => void; + exitInterfaceDeclaration?: (ctx: InterfaceDeclarationContext) => void; + + /** + * Enter a parse tree produced by `KipperParser.classDeclaration`. + * @param ctx the parse tree + */ + enterClassDeclaration?: (ctx: ClassDeclarationContext) => void; + /** + * Exit a parse tree produced by `KipperParser.classDeclaration`. + * @param ctx the parse tree + */ + exitClassDeclaration?: (ctx: ClassDeclarationContext) => void; /** * Enter a parse tree produced by `KipperParser.statement`. @@ -1215,3 +1242,4 @@ export interface KipperParserListener extends ParseTreeListener { */ exitTypeSpecifierIdentifier?: (ctx: TypeSpecifierIdentifierContext) => void; } + diff --git a/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts b/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts index 1881f733d..e26103bdd 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts @@ -1,9 +1,11 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT -// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax -// kind values. -import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; -import KipperParserBase from "./base/KipperParserBase"; + + // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax + // kind values. + import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; + import KipperParserBase from "./base/KipperParserBase"; + import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; @@ -38,15 +40,17 @@ import { ExternalItemContext } from "./KipperParser"; import { BlockItemListContext } from "./KipperParser"; import { BlockItemContext } from "./KipperParser"; import { DeclarationContext } from "./KipperParser"; -import { FunctionDeclarationContext } from "./KipperParser"; import { VariableDeclarationContext } from "./KipperParser"; import { StorageTypeSpecifierContext } from "./KipperParser"; +import { InitDeclaratorContext } from "./KipperParser"; +import { InitializerContext } from "./KipperParser"; import { DeclaratorContext } from "./KipperParser"; import { DirectDeclaratorContext } from "./KipperParser"; -import { InitDeclaratorContext } from "./KipperParser"; +import { FunctionDeclarationContext } from "./KipperParser"; import { ParameterListContext } from "./KipperParser"; import { ParameterDeclarationContext } from "./KipperParser"; -import { InitializerContext } from "./KipperParser"; +import { InterfaceDeclarationContext } from "./KipperParser"; +import { ClassDeclarationContext } from "./KipperParser"; import { StatementContext } from "./KipperParser"; import { CompoundStatementContext } from "./KipperParser"; import { ExpressionStatementContext } from "./KipperParser"; @@ -104,6 +108,7 @@ import { GenericTypeSpecifierExpressionContext } from "./KipperParser"; import { TypeofTypeSpecifierExpressionContext } from "./KipperParser"; import { TypeSpecifierIdentifierContext } from "./KipperParser"; + /** * This interface defines a complete generic visitor for a parse tree produced * by `KipperParser`. @@ -355,25 +360,32 @@ export interface KipperParserVisitor extends ParseTreeVisitor { visitDeclaration?: (ctx: DeclarationContext) => Result; /** - * Visit a parse tree produced by `KipperParser.functionDeclaration`. + * Visit a parse tree produced by `KipperParser.variableDeclaration`. * @param ctx the parse tree * @return the visitor result */ - visitFunctionDeclaration?: (ctx: FunctionDeclarationContext) => Result; + visitVariableDeclaration?: (ctx: VariableDeclarationContext) => Result; /** - * Visit a parse tree produced by `KipperParser.variableDeclaration`. + * Visit a parse tree produced by `KipperParser.storageTypeSpecifier`. * @param ctx the parse tree * @return the visitor result */ - visitVariableDeclaration?: (ctx: VariableDeclarationContext) => Result; + visitStorageTypeSpecifier?: (ctx: StorageTypeSpecifierContext) => Result; /** - * Visit a parse tree produced by `KipperParser.storageTypeSpecifier`. + * Visit a parse tree produced by `KipperParser.initDeclarator`. * @param ctx the parse tree * @return the visitor result */ - visitStorageTypeSpecifier?: (ctx: StorageTypeSpecifierContext) => Result; + visitInitDeclarator?: (ctx: InitDeclaratorContext) => Result; + + /** + * Visit a parse tree produced by `KipperParser.initializer`. + * @param ctx the parse tree + * @return the visitor result + */ + visitInitializer?: (ctx: InitializerContext) => Result; /** * Visit a parse tree produced by `KipperParser.declarator`. @@ -390,11 +402,11 @@ export interface KipperParserVisitor extends ParseTreeVisitor { visitDirectDeclarator?: (ctx: DirectDeclaratorContext) => Result; /** - * Visit a parse tree produced by `KipperParser.initDeclarator`. + * Visit a parse tree produced by `KipperParser.functionDeclaration`. * @param ctx the parse tree * @return the visitor result */ - visitInitDeclarator?: (ctx: InitDeclaratorContext) => Result; + visitFunctionDeclaration?: (ctx: FunctionDeclarationContext) => Result; /** * Visit a parse tree produced by `KipperParser.parameterList`. @@ -411,11 +423,18 @@ export interface KipperParserVisitor extends ParseTreeVisitor { visitParameterDeclaration?: (ctx: ParameterDeclarationContext) => Result; /** - * Visit a parse tree produced by `KipperParser.initializer`. + * Visit a parse tree produced by `KipperParser.interfaceDeclaration`. * @param ctx the parse tree * @return the visitor result */ - visitInitializer?: (ctx: InitializerContext) => Result; + visitInterfaceDeclaration?: (ctx: InterfaceDeclarationContext) => Result; + + /** + * Visit a parse tree produced by `KipperParser.classDeclaration`. + * @param ctx the parse tree + * @return the visitor result + */ + visitClassDeclaration?: (ctx: ClassDeclarationContext) => Result; /** * Visit a parse tree produced by `KipperParser.statement`. @@ -809,3 +828,4 @@ export interface KipperParserVisitor extends ParseTreeVisitor { */ visitTypeSpecifierIdentifier?: (ctx: TypeSpecifierIdentifierContext) => Result; } + diff --git a/kipper/core/src/compiler/parser/parse-rule-kind-mapping.ts b/kipper/core/src/compiler/parser/parse-rule-kind-mapping.ts index c52c28af1..e8308d854 100644 --- a/kipper/core/src/compiler/parser/parse-rule-kind-mapping.ts +++ b/kipper/core/src/compiler/parser/parse-rule-kind-mapping.ts @@ -25,15 +25,17 @@ export const ParseRuleKindMapping = { RULE_blockItemList: KipperParser.RULE_blockItemList, RULE_blockItem: KipperParser.RULE_blockItem, RULE_declaration: KipperParser.RULE_declaration, - RULE_functionDeclaration: KipperParser.RULE_functionDeclaration, RULE_variableDeclaration: KipperParser.RULE_variableDeclaration, RULE_storageTypeSpecifier: KipperParser.RULE_storageTypeSpecifier, + RULE_initDeclarator: KipperParser.RULE_initDeclarator, + RULE_initializer: KipperParser.RULE_initializer, RULE_declarator: KipperParser.RULE_declarator, RULE_directDeclarator: KipperParser.RULE_directDeclarator, - RULE_initDeclarator: KipperParser.RULE_initDeclarator, + RULE_functionDeclaration: KipperParser.RULE_functionDeclaration, RULE_parameterList: KipperParser.RULE_parameterList, RULE_parameterDeclaration: KipperParser.RULE_parameterDeclaration, - RULE_initializer: KipperParser.RULE_initializer, + RULE_interfaceDeclaration: KipperParser.RULE_interfaceDeclaration, + RULE_classDeclaration: KipperParser.RULE_classDeclaration, RULE_statement: KipperParser.RULE_statement, RULE_compoundStatement: KipperParser.RULE_compoundStatement, RULE_expressionStatement: KipperParser.RULE_expressionStatement, diff --git a/kipper/core/src/compiler/target-presets/semantic-analyser.ts b/kipper/core/src/compiler/target-presets/semantic-analyser.ts index 093931fe8..56c0cdacb 100644 --- a/kipper/core/src/compiler/target-presets/semantic-analyser.ts +++ b/kipper/core/src/compiler/target-presets/semantic-analyser.ts @@ -3,13 +3,13 @@ * @since 0.10.0 */ -import type { +import { AdditiveExpression, AnalysableASTNode, ArrayPrimaryExpression, AssignmentExpression, BoolPrimaryExpression, - CastOrConvertExpression, + CastOrConvertExpression, ClassDeclaration, CompoundStatement, ConditionalExpression, DoWhileLoopIterationStatement, @@ -24,7 +24,7 @@ import type { IdentifierTypeSpecifierExpression, IfStatement, IncrementOrDecrementPostfixExpression, - IncrementOrDecrementUnaryExpression, + IncrementOrDecrementUnaryExpression, InterfaceDeclaration, JumpStatement, LogicalAndExpression, LogicalOrExpression, @@ -130,6 +130,16 @@ export abstract class KipperTargetSemanticAnalyser extends KipperSemanticErrorHa */ public abstract variableDeclaration?: TargetASTNodeSemanticAnalyser; + /** + * Performs translation-specific semantic analysis for {@link ClassDeclaration} instances. + */ + public abstract classDeclaration?: TargetASTNodeSemanticAnalyser; + + /** + * Performs translation-specific semantic analysis for {@link InterfaceDeclaration} instances. + */ + public abstract interfaceDeclaration?: TargetASTNodeSemanticAnalyser; + /** * Performs translation-specific semantic analysis for {@link NumberPrimaryExpression} instances. */ 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 beb648b47..fe1522763 100644 --- a/kipper/core/src/compiler/target-presets/translation/code-generator.ts +++ b/kipper/core/src/compiler/target-presets/translation/code-generator.ts @@ -2,12 +2,12 @@ * Code generator specifying how a Kipper parse tree should be translated into a specific language. * @since 0.10.0 */ -import type { +import { AdditiveExpression, ArrayPrimaryExpression, AssignmentExpression, BoolPrimaryExpression, - CastOrConvertExpression, + CastOrConvertExpression, ClassDeclaration, CompilableASTNode, CompoundStatement, ConditionalExpression, @@ -23,7 +23,7 @@ import type { IdentifierTypeSpecifierExpression, IfStatement, IncrementOrDecrementPostfixExpression, - IncrementOrDecrementUnaryExpression, + IncrementOrDecrementUnaryExpression, InterfaceDeclaration, JumpStatement, LogicalAndExpression, LogicalOrExpression, @@ -176,6 +176,16 @@ export abstract class KipperTargetCodeGenerator { */ public abstract variableDeclaration: TargetASTNodeCodeGenerator>; + /** + * Translates a {@link VariableDeclaration} into a specific language. + */ + public abstract classDeclaration: TargetASTNodeCodeGenerator>; + + /** + * Translates a {@link VariableDeclaration} into a specific language. + */ + public abstract interfaceDeclaration: TargetASTNodeCodeGenerator>; + /** * Translates a {@link NumberPrimaryExpression} into a specific language. */ From 733fb174fe473da3c4e966f233307dbcefad33c9 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Tue, 2 Jul 2024 16:58:34 +0200 Subject: [PATCH 03/57] other: Prettified code --- kipper/cli/README.md | 23 +- .../err-handler/semantics-asserter.ts | 3 +- .../analysis/analyser/semantic-checker.ts | 2 +- .../analysis/analyser/type-checker.ts | 6 +- .../analysis/symbol-table/class-scope.ts | 2 +- .../entry/scope-type-declaration.ts | 6 +- .../core/src/compiler/ast/common/ast-types.ts | 8 +- .../compiler/ast/mapping/ast-node-mapper.ts | 6 +- .../class-declaration/class-declaration.ts | 26 +- .../interface-declaration.ts | 30 +- .../arithmetic/arithmetic-expression.ts | 3 +- .../conditional-expression.ts | 2 - .../unary-expression/unary-expression.ts | 3 +- kipper/core/src/compiler/const.ts | 3 +- .../src/compiler/parser/antlr/KipperLexer.ts | 441 +- .../src/compiler/parser/antlr/KipperParser.ts | 5099 ++++++++++------- .../parser/antlr/KipperParserListener.ts | 12 +- .../parser/antlr/KipperParserVisitor.ts | 12 +- .../target-presets/semantic-analyser.ts | 8 +- .../translation/built-ins-generator.ts | 3 +- .../translation/code-generator.ts | 8 +- kipper/core/src/errors.ts | 3 +- 22 files changed, 3343 insertions(+), 2366 deletions(-) diff --git a/kipper/cli/README.md b/kipper/cli/README.md index b54145554..4cd20571f 100644 --- a/kipper/cli/README.md +++ b/kipper/cli/README.md @@ -22,9 +22,10 @@ and the [Kipper website](https://kipper-lang.org)._ [![DOI](https://zenodo.org/badge/411260595.svg)](https://zenodo.org/badge/latestdoi/411260595) -* [Kipper CLI - `@kipper/cli` 🦊✨](#kipper-cli---kippercli-) -* [Usage](#usage) -* [Commands](#commands) + +- [Kipper CLI - `@kipper/cli` 🦊✨](#kipper-cli---kippercli-) +- [Usage](#usage) +- [Commands](#commands) ## General Information @@ -39,6 +40,7 @@ and the [Kipper website](https://kipper-lang.org)._ # Usage + ```sh-session $ npm install -g @kipper/cli $ kipper COMMAND @@ -50,17 +52,19 @@ USAGE $ kipper COMMAND ... ``` + # Commands -* [`kipper analyse [FILE]`](#kipper-analyse-file) -* [`kipper compile [FILE]`](#kipper-compile-file) -* [`kipper help [COMMAND]`](#kipper-help-command) -* [`kipper new [LOCATION]`](#kipper-new-location) -* [`kipper run [FILE]`](#kipper-run-file) -* [`kipper version`](#kipper-version) + +- [`kipper analyse [FILE]`](#kipper-analyse-file) +- [`kipper compile [FILE]`](#kipper-compile-file) +- [`kipper help [COMMAND]`](#kipper-help-command) +- [`kipper new [LOCATION]`](#kipper-new-location) +- [`kipper run [FILE]`](#kipper-run-file) +- [`kipper version`](#kipper-version) ## `kipper analyse [FILE]` @@ -209,6 +213,7 @@ USAGE ``` _See code: [src/commands/version.ts](https://github.com/Kipper-Lang/Kipper/blob/v0.11.0-alpha.6/kipper/cli/src/commands/version.ts)_ + ## Contributing to Kipper diff --git a/kipper/core/src/compiler/analysis/analyser/err-handler/semantics-asserter.ts b/kipper/core/src/compiler/analysis/analyser/err-handler/semantics-asserter.ts index 739fb7d19..c26120f31 100644 --- a/kipper/core/src/compiler/analysis/analyser/err-handler/semantics-asserter.ts +++ b/kipper/core/src/compiler/analysis/analyser/err-handler/semantics-asserter.ts @@ -4,8 +4,7 @@ * @since 0.7.0 */ import type { KipperProgramContext } from "../../../program-ctx"; -import type { KipperError } from "../../../../errors"; -import type { KipperNotImplementedError } from "../../../../errors"; +import type { KipperError, KipperNotImplementedError } from "../../../../errors"; import type { CompilableASTNode } from "../../../ast"; import { KipperSemanticErrorHandler } from "./semantics-error-handler"; import { getParseRuleSource } from "../../../../tools"; diff --git a/kipper/core/src/compiler/analysis/analyser/semantic-checker.ts b/kipper/core/src/compiler/analysis/analyser/semantic-checker.ts index 9d0612233..788c0c1fb 100644 --- a/kipper/core/src/compiler/analysis/analyser/semantic-checker.ts +++ b/kipper/core/src/compiler/analysis/analyser/semantic-checker.ts @@ -8,10 +8,10 @@ import type { KipperProgramContext } from "../../program-ctx"; import type { CompilableNodeChild, CompilableNodeParent, - ScopeNode, Expression, JumpStatement, ReturnStatement, + ScopeNode, VariableDeclaration, } from "../../ast"; import { CompoundStatement, FunctionDeclaration, IdentifierPrimaryExpression, IterationStatement } from "../../ast"; diff --git a/kipper/core/src/compiler/analysis/analyser/type-checker.ts b/kipper/core/src/compiler/analysis/analyser/type-checker.ts index a5aa5d33e..562db1843 100644 --- a/kipper/core/src/compiler/analysis/analyser/type-checker.ts +++ b/kipper/core/src/compiler/analysis/analyser/type-checker.ts @@ -6,17 +6,17 @@ import type { BuiltInFunctionArgument } from "../../runtime-built-ins"; import type { KipperProgramContext } from "../../program-ctx"; import type { - IncrementOrDecrementPostfixExpressionSemantics, - ParameterDeclarationSemantics, - UnaryExpressionSemantics, AssignmentExpression, Expression, FunctionDeclaration, IncrementOrDecrementPostfixExpression, + IncrementOrDecrementPostfixExpressionSemantics, MemberAccessExpression, + ParameterDeclarationSemantics, RelationalExpression, Statement, UnaryExpression, + UnaryExpressionSemantics, } from "../../ast"; import { CompoundStatement, diff --git a/kipper/core/src/compiler/analysis/symbol-table/class-scope.ts b/kipper/core/src/compiler/analysis/symbol-table/class-scope.ts index 1013d9abb..6efc40e4b 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/class-scope.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/class-scope.ts @@ -3,7 +3,7 @@ * the global namespace. * @since 0.11.0 */ -import {InterfaceDeclaration, FunctionDeclaration, ClassDeclaration} from "../../ast"; +import type { ClassDeclaration } from "../../ast"; import { LocalScope } from "./local-scope"; /** diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts index ada4d3315..7ec4adc7d 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts @@ -2,14 +2,14 @@ * A symbol table entry for a type declaration such as a class or interface. * @since 0.11.0 */ -import {ScopeDeclaration} from "./scope-declaration"; -import { +import { ScopeDeclaration } from "./scope-declaration"; +import type { ClassDeclaration, FunctionDeclarationSemantics, InterfaceDeclaration, InterfaceDeclarationSemantics, } from "../../../ast"; -import {CheckedType} from "../../type"; +import { CheckedType } from "../../type"; /** * Represents the definition of a type such as a class or interface in a scope. diff --git a/kipper/core/src/compiler/ast/common/ast-types.ts b/kipper/core/src/compiler/ast/common/ast-types.ts index 1c0cb724f..b49de0d6e 100644 --- a/kipper/core/src/compiler/ast/common/ast-types.ts +++ b/kipper/core/src/compiler/ast/common/ast-types.ts @@ -2,13 +2,14 @@ * AST pre-set types that are used throughout the compiler. * @since 0.10.0 */ -import { +import type { AdditiveExpressionContext, ArrayPrimaryExpressionContext, AssignmentExpressionContext, BoolPrimaryExpressionContext, BracketNotationMemberAccessExpressionContext, - CastOrConvertExpressionContext, ClassDeclarationContext, + CastOrConvertExpressionContext, + ClassDeclarationContext, CompoundStatementContext, ConditionalExpressionContext, DotNotationMemberAccessExpressionContext, @@ -24,7 +25,8 @@ import { IdentifierTypeSpecifierExpressionContext, IfStatementContext, IncrementOrDecrementPostfixExpressionContext, - IncrementOrDecrementUnaryExpressionContext, InterfaceDeclarationContext, + IncrementOrDecrementUnaryExpressionContext, + InterfaceDeclarationContext, JumpStatementContext, LogicalAndExpressionContext, LogicalOrExpressionContext, 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 f0ee4b3e2..d8bcce748 100644 --- a/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts +++ b/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts @@ -58,6 +58,7 @@ import type { ASTStatementKind, ASTStatementRuleName, } from "../common"; +import type { Declaration, Expression, Statement } from "../nodes"; import { AdditiveExpression, ArrayPrimaryExpression, @@ -67,10 +68,8 @@ import { ClassDeclaration, CompoundStatement, ConditionalExpression, - Declaration, DoWhileLoopIterationStatement, EqualityExpression, - Expression, ExpressionStatement, ForLoopIterationStatement, FStringPrimaryExpression, @@ -95,14 +94,13 @@ import { ParameterDeclaration, RelationalExpression, ReturnStatement, - Statement, StringPrimaryExpression, SwitchStatement, TangledPrimaryExpression, TypeofTypeSpecifierExpression, VariableDeclaration, VoidOrNullOrUndefinedPrimaryExpression, - WhileLoopIterationStatement + WhileLoopIterationStatement, } from "../nodes"; /** diff --git a/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration.ts index eb167f8f9..f6a84ce3a 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration.ts @@ -2,15 +2,16 @@ * Represents a class declaration in the Kipper language, which may contain methods and fields. * @since 0.11.0 */ -import type {ScopeNode} from "../../../scope-node"; -import type {ClassDeclarationSemantics} from "./class-declaration-semantics"; -import type {ClassDeclarationTypeSemantics} from "./class-declaration-type-semantics"; -import type {CompilableNodeParent} from "../../../compilable-ast-node"; -import {ScopeTypeDeclaration} from "../../../../analysis"; -import {ClassDeclarationContext, KindParseRuleMapping, ParseRuleKindMapping} from "../../../../parser"; -import {Declaration} from "../declaration"; -import {KipperNotImplementedError} from "../../../../../errors"; -import {ClassScope} from "../../../../analysis/symbol-table/class-scope"; +import type { ScopeNode } from "../../../scope-node"; +import type { ClassDeclarationSemantics } from "./class-declaration-semantics"; +import type { ClassDeclarationTypeSemantics } from "./class-declaration-type-semantics"; +import type { CompilableNodeParent } from "../../../compilable-ast-node"; +import type { ScopeTypeDeclaration } from "../../../../analysis"; +import type { ClassDeclarationContext } from "../../../../parser"; +import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../parser"; +import { Declaration } from "../declaration"; +import { KipperNotImplementedError } from "../../../../../errors"; +import { ClassScope } from "../../../../analysis/symbol-table/class-scope"; /** * Represents a class declaration in the Kipper language, which may contain methods and fields. @@ -125,8 +126,7 @@ export class ClassDeclaration * the children has already failed and as such no parent node should run type checking. */ public async primarySemanticAnalysis(): Promise { - this - .programCtx + this.programCtx .semanticCheck(this) .notImplementedError(new KipperNotImplementedError("Class declarations are not yet implemented.")); } @@ -140,8 +140,7 @@ export class ClassDeclaration * @since 0.11.0 */ public async primarySemanticTypeChecking(): Promise { - this - .programCtx + this.programCtx .semanticCheck(this) .notImplementedError(new KipperNotImplementedError("Class declarations are not yet implemented.")); } @@ -157,4 +156,3 @@ export class ClassDeclaration readonly targetSemanticAnalysis = this.semanticAnalyser.classDeclaration; readonly targetCodeGenerator = this.codeGenerator.classDeclaration; } - diff --git a/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration.ts index 5c513eb56..eeafa2a35 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration.ts @@ -2,23 +2,23 @@ * Represents an interface declaration in the Kipper language, which may contain methods and fields declarations. * @since 0.11.0 */ -import type {InterfaceDeclarationSemantics} from "./interface-declaration-semantics"; -import type {InterfaceDeclarationTypeSemantics} from "./interface-declaration-type-semantics"; -import type {CompilableNodeParent} from "../../../compilable-ast-node"; -import {ScopeTypeDeclaration} from "../../../../analysis"; -import { - InterfaceDeclarationContext, - KindParseRuleMapping, - ParseRuleKindMapping -} from "../../../../parser"; -import {Declaration} from "../declaration"; -import {KipperNotImplementedError} from "../../../../../errors"; +import type { InterfaceDeclarationSemantics } from "./interface-declaration-semantics"; +import type { InterfaceDeclarationTypeSemantics } from "./interface-declaration-type-semantics"; +import type { CompilableNodeParent } from "../../../compilable-ast-node"; +import type { ScopeTypeDeclaration } from "../../../../analysis"; +import type { InterfaceDeclarationContext } from "../../../../parser"; +import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../parser"; +import { Declaration } from "../declaration"; +import { KipperNotImplementedError } from "../../../../../errors"; /** * Represents an interface declaration in the Kipper language, which may contain methods and fields declarations. * @since 0.11.0 */ -export class InterfaceDeclaration extends Declaration { +export class InterfaceDeclaration extends Declaration< + InterfaceDeclarationSemantics, + InterfaceDeclarationTypeSemantics +> { /** * The private field '_antlrRuleCtx' that actually stores the variable data, * which is returned inside the {@link this.antlrRuleCtx}. @@ -108,8 +108,7 @@ export class InterfaceDeclaration extends Declaration { - this - .programCtx + this.programCtx .semanticCheck(this) .notImplementedError(new KipperNotImplementedError("Interface declarations are not yet implemented.")); } @@ -123,8 +122,7 @@ export class InterfaceDeclaration extends Declaration { - this - .programCtx + this.programCtx .semanticCheck(this) .notImplementedError(new KipperNotImplementedError("Interface declarations are not yet implemented.")); } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/arithmetic/arithmetic-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/arithmetic/arithmetic-expression.ts index 733c207b4..a8dd23340 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/arithmetic/arithmetic-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/arithmetic/arithmetic-expression.ts @@ -6,8 +6,7 @@ */ import type { ArithmeticExpressionSemantics } from "./arithmetic-expression-semantics"; import type { ArithmeticExpressionTypeSemantics } from "./arithmetic-expression-type-semantics"; -import type { ParseRuleKindMapping } from "../../../../parser"; -import type { KindParseRuleMapping } from "../../../../parser"; +import type { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../parser"; import { Expression } from "../expression"; import type { ASTNodeMapper } from "../../../mapping"; diff --git a/kipper/core/src/compiler/ast/nodes/expressions/conditional-expression/conditional-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/conditional-expression/conditional-expression.ts index f5124dd18..e558ff964 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/conditional-expression/conditional-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/conditional-expression/conditional-expression.ts @@ -12,8 +12,6 @@ import type { CompilableASTNode } from "../../../compilable-ast-node"; import { Expression } from "../expression"; import type { ConditionalExpressionContext } from "../../../../parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../parser"; -import { KipperNotImplementedError } from "../../../../../errors"; -import * as console from "node:console"; /** * Conditional expression, which evaluates a condition and evaluates the left expression if it is true, or the right diff --git a/kipper/core/src/compiler/ast/nodes/expressions/unary-expression/unary-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/unary-expression/unary-expression.ts index 93b9105a2..17da8afa8 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/unary-expression/unary-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/unary-expression/unary-expression.ts @@ -6,8 +6,7 @@ */ import type { UnaryExpressionSemantics } from "./unary-expression-semantics"; import type { UnaryExpressionTypeSemantics } from "./unary-expression-type-semantics"; -import type { ParseRuleKindMapping } from "../../../../parser"; -import type { KindParseRuleMapping } from "../../../../parser"; +import type { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../parser"; import { Expression } from "../expression"; import type { ASTNodeMapper } from "../../../mapping"; diff --git a/kipper/core/src/compiler/const.ts b/kipper/core/src/compiler/const.ts index 1118e1553..71065c5d1 100644 --- a/kipper/core/src/compiler/const.ts +++ b/kipper/core/src/compiler/const.ts @@ -9,8 +9,7 @@ import type { ScopeVariableDeclaration, UndefinedCustomType, } from "./analysis"; -import type { BuiltInFunction, BuiltInVariable } from "./runtime-built-ins"; -import type { InternalFunction } from "./runtime-built-ins"; +import type { BuiltInFunction, BuiltInVariable, InternalFunction } from "./runtime-built-ins"; /** * If this variable is true, then this environment is assumed to be inside a browser and special browser support should diff --git a/kipper/core/src/compiler/parser/antlr/KipperLexer.ts b/kipper/core/src/compiler/parser/antlr/KipperLexer.ts index 39047553f..917293d3c 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperLexer.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperLexer.ts @@ -1,8 +1,6 @@ // Generated from ./KipperLexer.g4 by ANTLR 4.9.0-SNAPSHOT - - import KipperLexerBase from "./base/KipperLexerBase"; - +import KipperLexerBase from "./base/KipperLexerBase"; import { ATN } from "antlr4ts/atn/ATN"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; @@ -17,7 +15,6 @@ import { VocabularyImpl } from "antlr4ts/VocabularyImpl"; import * as Utils from "antlr4ts/misc/Utils"; - export class KipperLexer extends KipperLexerBase { public static readonly FStringExpStart = 1; public static readonly BlockComment = 2; @@ -102,65 +99,277 @@ export class KipperLexer extends KipperLexerBase { public static readonly DOUBLE_QUOTE_FSTRING = 2; // tslint:disable:no-trailing-whitespace - public static readonly channelNames: string[] = [ - "DEFAULT_TOKEN_CHANNEL", "HIDDEN", "COMMENT", - ]; + public static readonly channelNames: string[] = ["DEFAULT_TOKEN_CHANNEL", "HIDDEN", "COMMENT"]; // tslint:disable:no-trailing-whitespace - public static readonly modeNames: string[] = [ - "DEFAULT_MODE", "SINGLE_QUOTE_FSTRING", "DOUBLE_QUOTE_FSTRING", - ]; + public static readonly modeNames: string[] = ["DEFAULT_MODE", "SINGLE_QUOTE_FSTRING", "DOUBLE_QUOTE_FSTRING"]; public static readonly ruleNames: string[] = [ - "BlockComment", "LineComment", "Const", "Var", "As", "Spread", "Switch", - "Case", "Default", "Break", "Continue", "Do", "While", "If", "Else", "For", - "Enum", "DefFunc", "Return", "CallFunc", "RetIndicator", "Class", "Interface", - "True", "False", "Typeof", "Void", "Null", "Undefined", "Comma", "SemiColon", - "QuestionMark", "Colon", "LeftParen", "RightParen", "LeftBracket", "RightBracket", - "FStringExpEnd", "LeftBrace", "RightBrace", "Plus", "PlusPlus", "Minus", - "MinusMinus", "Star", "Div", "Mod", "PowerTo", "AndAnd", "OrOr", "Not", - "Assign", "PlusAssign", "MinusAssign", "StarAssign", "DivAssign", "ModAssign", - "Equal", "NotEqual", "Less", "LessEqual", "Greater", "GreaterEqual", "Dot", - "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", "DoubleQuoteStringLiteral", - "FloatingConstant", "Whitespace", "Newline", "FStringSingleQuoteStart", - "FStringDoubleQuoteStart", "FStringSingleQuoteExpStart", "FStringSingleQuoteEnd", - "FStringSingleQuoteAtom", "FStringDoubleQuoteExpStart", "FStringDoubleQuoteEnd", - "FStringDoubleQuoteAtom", "IdentifierNondigit", "Nondigit", "Digit", "DecimalConstant", - "BinaryConstant", "OctalConstant", "HexadecimalConstant", "NonzeroDigit", - "BinaryDigit", "OctalDigit", "HexadecimalDigit", "DecimalFloatingConstant", - "FractionalConstant", "ExponentPart", "DigitSequence", "Sign", "CCharSequence", - "CChar", "EscapeSequence", "SimpleEscapeSequence", "OctalEscapeSequence", - "HexadecimalEscapeSequence", "SingleQuoteFStringSCharSequence", "SingleQuoteFStringSChar", - "DoubleQuoteFStringSCharSequence", "DoubleQuoteFStringSChar", "SingleQuoteSCharSequence", - "SingleQuoteSChar", "DoubleQuoteSCharSequence", "DoubleQuoteSChar", + "BlockComment", + "LineComment", + "Const", + "Var", + "As", + "Spread", + "Switch", + "Case", + "Default", + "Break", + "Continue", + "Do", + "While", + "If", + "Else", + "For", + "Enum", + "DefFunc", + "Return", + "CallFunc", + "RetIndicator", + "Class", + "Interface", + "True", + "False", + "Typeof", + "Void", + "Null", + "Undefined", + "Comma", + "SemiColon", + "QuestionMark", + "Colon", + "LeftParen", + "RightParen", + "LeftBracket", + "RightBracket", + "FStringExpEnd", + "LeftBrace", + "RightBrace", + "Plus", + "PlusPlus", + "Minus", + "MinusMinus", + "Star", + "Div", + "Mod", + "PowerTo", + "AndAnd", + "OrOr", + "Not", + "Assign", + "PlusAssign", + "MinusAssign", + "StarAssign", + "DivAssign", + "ModAssign", + "Equal", + "NotEqual", + "Less", + "LessEqual", + "Greater", + "GreaterEqual", + "Dot", + "Identifier", + "IntegerConstant", + "SingleQuoteStringLiteral", + "DoubleQuoteStringLiteral", + "FloatingConstant", + "Whitespace", + "Newline", + "FStringSingleQuoteStart", + "FStringDoubleQuoteStart", + "FStringSingleQuoteExpStart", + "FStringSingleQuoteEnd", + "FStringSingleQuoteAtom", + "FStringDoubleQuoteExpStart", + "FStringDoubleQuoteEnd", + "FStringDoubleQuoteAtom", + "IdentifierNondigit", + "Nondigit", + "Digit", + "DecimalConstant", + "BinaryConstant", + "OctalConstant", + "HexadecimalConstant", + "NonzeroDigit", + "BinaryDigit", + "OctalDigit", + "HexadecimalDigit", + "DecimalFloatingConstant", + "FractionalConstant", + "ExponentPart", + "DigitSequence", + "Sign", + "CCharSequence", + "CChar", + "EscapeSequence", + "SimpleEscapeSequence", + "OctalEscapeSequence", + "HexadecimalEscapeSequence", + "SingleQuoteFStringSCharSequence", + "SingleQuoteFStringSChar", + "DoubleQuoteFStringSCharSequence", + "DoubleQuoteFStringSChar", + "SingleQuoteSCharSequence", + "SingleQuoteSChar", + "DoubleQuoteSCharSequence", + "DoubleQuoteSChar", ]; private static readonly _LITERAL_NAMES: Array = [ - undefined, undefined, undefined, undefined, "'const'", "'var'", "'as'", - "'...'", "'switch'", "'case'", "'default'", "'break'", "'continue'", "'do'", - "'while'", "'if'", "'else'", "'for'", "'enum'", "'def'", "'return'", "'call'", - "'->'", "'class'", "'interface'", "'true'", "'false'", "'typeof'", "'void'", - "'null'", "'undefined'", "','", "';'", "'?'", "':'", "'('", "')'", "'['", - "']'", undefined, "'{'", "'}'", "'+'", "'++'", "'-'", "'--'", "'*'", "'/'", - "'%'", "'**'", "'&&'", "'||'", "'!'", "'='", "'+='", "'-='", "'*='", "'/='", - "'%='", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'.'", + undefined, + undefined, + undefined, + undefined, + "'const'", + "'var'", + "'as'", + "'...'", + "'switch'", + "'case'", + "'default'", + "'break'", + "'continue'", + "'do'", + "'while'", + "'if'", + "'else'", + "'for'", + "'enum'", + "'def'", + "'return'", + "'call'", + "'->'", + "'class'", + "'interface'", + "'true'", + "'false'", + "'typeof'", + "'void'", + "'null'", + "'undefined'", + "','", + "';'", + "'?'", + "':'", + "'('", + "')'", + "'['", + "']'", + undefined, + "'{'", + "'}'", + "'+'", + "'++'", + "'-'", + "'--'", + "'*'", + "'/'", + "'%'", + "'**'", + "'&&'", + "'||'", + "'!'", + "'='", + "'+='", + "'-='", + "'*='", + "'/='", + "'%='", + "'=='", + "'!='", + "'<'", + "'<='", + "'>'", + "'>='", + "'.'", ]; private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, "FStringExpStart", "BlockComment", "LineComment", "Const", - "Var", "As", "Spread", "Switch", "Case", "Default", "Break", "Continue", - "Do", "While", "If", "Else", "For", "Enum", "DefFunc", "Return", "CallFunc", - "RetIndicator", "Class", "Interface", "True", "False", "Typeof", "Void", - "Null", "Undefined", "Comma", "SemiColon", "QuestionMark", "Colon", "LeftParen", - "RightParen", "LeftBracket", "RightBracket", "FStringExpEnd", "LeftBrace", - "RightBrace", "Plus", "PlusPlus", "Minus", "MinusMinus", "Star", "Div", - "Mod", "PowerTo", "AndAnd", "OrOr", "Not", "Assign", "PlusAssign", "MinusAssign", - "StarAssign", "DivAssign", "ModAssign", "Equal", "NotEqual", "Less", "LessEqual", - "Greater", "GreaterEqual", "Dot", "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", - "DoubleQuoteStringLiteral", "FloatingConstant", "Whitespace", "Newline", - "FStringSingleQuoteStart", "FStringDoubleQuoteStart", "FStringSingleQuoteEnd", - "FStringSingleQuoteAtom", "FStringDoubleQuoteEnd", "FStringDoubleQuoteAtom", + undefined, + "FStringExpStart", + "BlockComment", + "LineComment", + "Const", + "Var", + "As", + "Spread", + "Switch", + "Case", + "Default", + "Break", + "Continue", + "Do", + "While", + "If", + "Else", + "For", + "Enum", + "DefFunc", + "Return", + "CallFunc", + "RetIndicator", + "Class", + "Interface", + "True", + "False", + "Typeof", + "Void", + "Null", + "Undefined", + "Comma", + "SemiColon", + "QuestionMark", + "Colon", + "LeftParen", + "RightParen", + "LeftBracket", + "RightBracket", + "FStringExpEnd", + "LeftBrace", + "RightBrace", + "Plus", + "PlusPlus", + "Minus", + "MinusMinus", + "Star", + "Div", + "Mod", + "PowerTo", + "AndAnd", + "OrOr", + "Not", + "Assign", + "PlusAssign", + "MinusAssign", + "StarAssign", + "DivAssign", + "ModAssign", + "Equal", + "NotEqual", + "Less", + "LessEqual", + "Greater", + "GreaterEqual", + "Dot", + "Identifier", + "IntegerConstant", + "SingleQuoteStringLiteral", + "DoubleQuoteStringLiteral", + "FloatingConstant", + "Whitespace", + "Newline", + "FStringSingleQuoteStart", + "FStringDoubleQuoteStart", + "FStringSingleQuoteEnd", + "FStringSingleQuoteAtom", + "FStringDoubleQuoteEnd", + "FStringDoubleQuoteAtom", ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(KipperLexer._LITERAL_NAMES, KipperLexer._SYMBOLIC_NAMES, []); + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( + KipperLexer._LITERAL_NAMES, + KipperLexer._SYMBOLIC_NAMES, + [], + ); // @Override // @NotNull @@ -169,107 +378,116 @@ export class KipperLexer extends KipperLexerBase { } // tslint:enable:no-trailing-whitespace - constructor(input: CharStream) { super(input); this._interp = new LexerATNSimulator(KipperLexer._ATN, this); } // @Override - public get grammarFileName(): string { return "KipperLexer.g4"; } + public get grammarFileName(): string { + return "KipperLexer.g4"; + } // @Override - public get ruleNames(): string[] { return KipperLexer.ruleNames; } + public get ruleNames(): string[] { + return KipperLexer.ruleNames; + } // @Override - public get serializedATN(): string { return KipperLexer._serializedATN; } + public get serializedATN(): string { + return KipperLexer._serializedATN; + } // @Override - public get channelNames(): string[] { return KipperLexer.channelNames; } + public get channelNames(): string[] { + return KipperLexer.channelNames; + } // @Override - public get modeNames(): string[] { return KipperLexer.modeNames; } + public get modeNames(): string[] { + return KipperLexer.modeNames; + } // @Override public action(_localctx: RuleContext, ruleIndex: number, actionIndex: number): void { switch (ruleIndex) { - case 71: - this.FStringSingleQuoteStart_action(_localctx, actionIndex); - break; + case 71: + this.FStringSingleQuoteStart_action(_localctx, actionIndex); + break; - case 72: - this.FStringDoubleQuoteStart_action(_localctx, actionIndex); - break; + case 72: + this.FStringDoubleQuoteStart_action(_localctx, actionIndex); + break; - case 74: - this.FStringSingleQuoteEnd_action(_localctx, actionIndex); - break; + case 74: + this.FStringSingleQuoteEnd_action(_localctx, actionIndex); + break; - case 77: - this.FStringDoubleQuoteEnd_action(_localctx, actionIndex); - break; + case 77: + this.FStringDoubleQuoteEnd_action(_localctx, actionIndex); + break; } } private FStringSingleQuoteStart_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 0: - this.incrementFStringDepth() - break; + case 0: + this.incrementFStringDepth(); + break; } } private FStringDoubleQuoteStart_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 1: - this.incrementFStringDepth() - break; + case 1: + this.incrementFStringDepth(); + break; } } private FStringSingleQuoteEnd_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 2: - this.decrementFStringDepth() - break; + case 2: + this.decrementFStringDepth(); + break; } } private FStringDoubleQuoteEnd_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 3: - this.decrementFStringDepth() - break; + case 3: + this.decrementFStringDepth(); + break; } } // @Override public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { switch (ruleIndex) { - case 37: - return this.FStringExpEnd_sempred(_localctx, predIndex); + case 37: + return this.FStringExpEnd_sempred(_localctx, predIndex); - case 73: - return this.FStringSingleQuoteExpStart_sempred(_localctx, predIndex); + case 73: + return this.FStringSingleQuoteExpStart_sempred(_localctx, predIndex); - case 76: - return this.FStringDoubleQuoteExpStart_sempred(_localctx, predIndex); + case 76: + return this.FStringDoubleQuoteExpStart_sempred(_localctx, predIndex); } return true; } private FStringExpEnd_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 0: - return this.insideFString(); + case 0: + return this.insideFString(); } return true; } private FStringSingleQuoteExpStart_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 1: - return this.insideFString(); + case 1: + return this.insideFString(); } return true; } private FStringDoubleQuoteExpStart_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 2: - return this.insideFString(); + case 2: + return this.insideFString(); } return true; } @@ -283,7 +501,7 @@ export class KipperLexer extends KipperLexerBase { "\x04\x12\t\x12\x04\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16" + "\x04\x17\t\x17\x04\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B" + "\x04\x1C\t\x1C\x04\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!" + - "\t!\x04\"\t\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(\x04)\t" + + "\t!\x04\"\t\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04'\t'\x04(\t(\x04)\t" + ")\x04*\t*\x04+\t+\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x040\t0\x041\t1\x04" + "2\t2\x043\t3\x044\t4\x045\t5\x046\t6\x047\t7\x048\t8\x049\t9\x04:\t:\x04" + ";\t;\x04<\t<\x04=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x04B\tB\x04C\tC\x04" + @@ -311,8 +529,8 @@ export class KipperLexer extends KipperLexerBase { "\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1D\x03\x1D" + "\x03\x1D\x03\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E" + "\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x03 \x03 \x03!\x03!\x03" + - "\"\x03\"\x03#\x03#\x03$\x03$\x03%\x03%\x03&\x03&\x03\'\x03\'\x03\'\x03" + - "\'\x03\'\x03(\x03(\x03)\x03)\x03*\x03*\x03+\x03+\x03+\x03,\x03,\x03-\x03" + + "\"\x03\"\x03#\x03#\x03$\x03$\x03%\x03%\x03&\x03&\x03'\x03'\x03'\x03" + + "'\x03'\x03(\x03(\x03)\x03)\x03*\x03*\x03+\x03+\x03+\x03,\x03,\x03-\x03" + "-\x03-\x03.\x03.\x03/\x03/\x030\x030\x031\x031\x031\x032\x032\x032\x03" + "3\x033\x033\x034\x034\x035\x035\x036\x036\x036\x037\x037\x037\x038\x03" + "8\x038\x039\x039\x039\x03:\x03:\x03:\x03;\x03;\x03;\x03<\x03<\x03<\x03" + @@ -337,9 +555,9 @@ export class KipperLexer extends KipperLexerBase { "l\u02B8\nl\x03m\x06m\u02BB\nm\rm\x0Em\u02BC\x03n\x03n\x05n\u02C1\nn\x03" + "\xE5\x02\x02o\x05\x02\x04\x07\x02\x05\t\x02\x06\v\x02\x07\r\x02\b\x0F" + "\x02\t\x11\x02\n\x13\x02\v\x15\x02\f\x17\x02\r\x19\x02\x0E\x1B\x02\x0F" + - "\x1D\x02\x10\x1F\x02\x11!\x02\x12#\x02\x13%\x02\x14\'\x02\x15)\x02\x16" + + "\x1D\x02\x10\x1F\x02\x11!\x02\x12#\x02\x13%\x02\x14'\x02\x15)\x02\x16" + "+\x02\x17-\x02\x18/\x02\x191\x02\x1A3\x02\x1B5\x02\x1C7\x02\x1D9\x02\x1E" + - ";\x02\x1F=\x02 ?\x02!A\x02\"C\x02#E\x02$G\x02%I\x02&K\x02\'M\x02(O\x02" + + ";\x02\x1F=\x02 ?\x02!A\x02\"C\x02#E\x02$G\x02%I\x02&K\x02'M\x02(O\x02" + ")Q\x02*S\x02+U\x02,W\x02-Y\x02.[\x02/]\x020_\x021a\x022c\x023e\x024g\x02" + "5i\x026k\x027m\x028o\x029q\x02:s\x02;u\x02{\x02?}\x02@\x7F" + "\x02A\x81\x02B\x83\x02C\x85\x02D\x87\x02E\x89\x02F\x8B\x02G\x8D\x02H\x8F" + @@ -350,7 +568,7 @@ export class KipperLexer extends KipperLexerBase { "\xC3\x02\x02\xC5\x02\x02\xC7\x02\x02\xC9\x02\x02\xCB\x02\x02\xCD\x02\x02" + "\xCF\x02\x02\xD1\x02\x02\xD3\x02\x02\xD5\x02\x02\xD7\x02\x02\xD9\x02\x02" + "\xDB\x02\x02\xDD\x02\x02\x05\x02\x03\x04\x14\x05\x02\f\f\x0F\x0F\u202A" + - "\u202B\x06\x02\v\v\r\x0E\"\"\xA2\xA2\x05\x02C\\aac|\x03\x022;\x04\x02" + + '\u202B\x06\x02\v\v\r\x0E""\xA2\xA2\x05\x02C\\aac|\x03\x022;\x04\x02' + "DDdd\x04\x02QQqq\x04\x02ZZzz\x03\x023;\x03\x0223\x03\x0229\x05\x022;C" + "Hch\x04\x02GGgg\x04\x02--//\x06\x02\f\f\x0F\x0F))^^\x0E\x02$$))AA^^cd" + "hhppttvvxx}}\x7F\x7F\b\x02\f\f\x0F\x0F))^^}}\x7F\x7F\b\x02\f\f\x0F\x0F" + @@ -360,7 +578,7 @@ export class KipperLexer extends KipperLexerBase { "\x13\x03\x02\x02\x02\x02\x15\x03\x02\x02\x02\x02\x17\x03\x02\x02\x02\x02" + "\x19\x03\x02\x02\x02\x02\x1B\x03\x02\x02\x02\x02\x1D\x03\x02\x02\x02\x02" + "\x1F\x03\x02\x02\x02\x02!\x03\x02\x02\x02\x02#\x03\x02\x02\x02\x02%\x03" + - "\x02\x02\x02\x02\'\x03\x02\x02\x02\x02)\x03\x02\x02\x02\x02+\x03\x02\x02" + + "\x02\x02\x02\x02'\x03\x02\x02\x02\x02)\x03\x02\x02\x02\x02+\x03\x02\x02" + "\x02\x02-\x03\x02\x02\x02\x02/\x03\x02\x02\x02\x021\x03\x02\x02\x02\x02" + "3\x03\x02\x02\x02\x025\x03\x02\x02\x02\x027\x03\x02\x02\x02\x029\x03\x02" + "\x02\x02\x02;\x03\x02\x02\x02\x02=\x03\x02\x02\x02\x02?\x03\x02\x02\x02" + @@ -385,7 +603,7 @@ export class KipperLexer extends KipperLexerBase { "\x03\x02\x02\x02\x17\u011D\x03\x02\x02\x02\x19\u0123\x03\x02\x02\x02\x1B" + "\u012C\x03\x02\x02\x02\x1D\u012F\x03\x02\x02\x02\x1F\u0135\x03\x02\x02" + "\x02!\u0138\x03\x02\x02\x02#\u013D\x03\x02\x02\x02%\u0141\x03\x02\x02" + - "\x02\'\u0146\x03\x02\x02\x02)\u014A\x03\x02\x02\x02+\u0151\x03\x02\x02" + + "\x02'\u0146\x03\x02\x02\x02)\u014A\x03\x02\x02\x02+\u0151\x03\x02\x02" + "\x02-\u0156\x03\x02\x02\x02/\u0159\x03\x02\x02\x021\u015F\x03\x02\x02" + "\x023\u0169\x03\x02\x02\x025\u016E\x03\x02\x02\x027\u0174\x03\x02\x02" + "\x029\u017B\x03\x02\x02\x02;\u0180\x03\x02\x02\x02=\u0185\x03\x02\x02" + @@ -449,7 +667,7 @@ export class KipperLexer extends KipperLexerBase { "\x07k\x02\x02\u0132\u0133\x07n\x02\x02\u0133\u0134\x07g\x02\x02\u0134" + "\x1E\x03\x02\x02\x02\u0135\u0136\x07k\x02\x02\u0136\u0137\x07h\x02\x02" + "\u0137 \x03\x02\x02\x02\u0138\u0139\x07g\x02\x02\u0139\u013A\x07n\x02" + - "\x02\u013A\u013B\x07u\x02\x02\u013B\u013C\x07g\x02\x02\u013C\"\x03\x02" + + '\x02\u013A\u013B\x07u\x02\x02\u013B\u013C\x07g\x02\x02\u013C"\x03\x02' + "\x02\x02\u013D\u013E\x07h\x02\x02\u013E\u013F\x07q\x02\x02\u013F\u0140" + "\x07t\x02\x02\u0140$\x03\x02\x02\x02\u0141\u0142\x07g\x02\x02\u0142\u0143" + "\x07p\x02\x02\u0143\u0144\x07w\x02\x02\u0144\u0145\x07o\x02\x02\u0145" + @@ -484,15 +702,15 @@ export class KipperLexer extends KipperLexerBase { "\x07<\x02\x02\u0196F\x03\x02\x02\x02\u0197\u0198\x07*\x02\x02\u0198H\x03" + "\x02\x02\x02\u0199\u019A\x07+\x02\x02\u019AJ\x03\x02\x02\x02\u019B\u019C" + "\x07]\x02\x02\u019CL\x03\x02\x02\x02\u019D\u019E\x07_\x02\x02\u019EN\x03" + - "\x02\x02\x02\u019F\u01A0\x06\'\x02\x02\u01A0\u01A1\x07\x7F\x02\x02\u01A1" + - "\u01A2\x03\x02\x02\x02\u01A2\u01A3\b\'\x03\x02\u01A3P\x03\x02\x02\x02" + + "\x02\x02\x02\u019F\u01A0\x06'\x02\x02\u01A0\u01A1\x07\x7F\x02\x02\u01A1" + + "\u01A2\x03\x02\x02\x02\u01A2\u01A3\b'\x03\x02\u01A3P\x03\x02\x02\x02" + "\u01A4\u01A5\x07}\x02\x02\u01A5R\x03\x02\x02\x02\u01A6\u01A7\x07\x7F\x02" + "\x02\u01A7T\x03\x02\x02\x02\u01A8\u01A9\x07-\x02\x02\u01A9V\x03\x02\x02" + "\x02\u01AA\u01AB\x07-\x02\x02\u01AB\u01AC\x07-\x02\x02\u01ACX\x03\x02" + "\x02\x02\u01AD\u01AE\x07/\x02\x02\u01AEZ\x03\x02\x02\x02\u01AF\u01B0\x07" + "/\x02\x02\u01B0\u01B1\x07/\x02\x02\u01B1\\\x03\x02\x02\x02\u01B2\u01B3" + "\x07,\x02\x02\u01B3^\x03\x02\x02\x02\u01B4\u01B5\x071\x02\x02\u01B5`\x03" + - "\x02\x02\x02\u01B6\u01B7\x07\'\x02\x02\u01B7b\x03\x02\x02\x02\u01B8\u01B9" + + "\x02\x02\x02\u01B6\u01B7\x07'\x02\x02\u01B7b\x03\x02\x02\x02\u01B8\u01B9" + "\x07,\x02\x02\u01B9\u01BA\x07,\x02\x02\u01BAd\x03\x02\x02\x02\u01BB\u01BC" + "\x07(\x02\x02\u01BC\u01BD\x07(\x02\x02\u01BDf\x03\x02\x02\x02\u01BE\u01BF" + "\x07~\x02\x02\u01BF\u01C0\x07~\x02\x02\u01C0h\x03\x02\x02\x02\u01C1\u01C2" + @@ -501,7 +719,7 @@ export class KipperLexer extends KipperLexerBase { "\x03\x02\x02\x02\u01C8\u01C9\x07/\x02\x02\u01C9\u01CA\x07?\x02\x02\u01CA" + "p\x03\x02\x02\x02\u01CB\u01CC\x07,\x02\x02\u01CC\u01CD\x07?\x02\x02\u01CD" + "r\x03\x02\x02\x02\u01CE\u01CF\x071\x02\x02\u01CF\u01D0\x07?\x02\x02\u01D0" + - "t\x03\x02\x02\x02\u01D1\u01D2\x07\'\x02\x02\u01D2\u01D3\x07?\x02\x02\u01D3" + + "t\x03\x02\x02\x02\u01D1\u01D2\x07'\x02\x02\u01D2\u01D3\x07?\x02\x02\u01D3" + "v\x03\x02\x02\x02\u01D4\u01D5\x07?\x02\x02\u01D5\u01D6\x07?\x02\x02\u01D6" + "x\x03\x02\x02\x02\u01D7\u01D8\x07#\x02\x02\u01D8\u01D9\x07?\x02\x02\u01D9" + "z\x03\x02\x02\x02\u01DA\u01DB\x07>\x02\x02\u01DB|\x03\x02\x02\x02\u01DC" + @@ -610,10 +828,7 @@ export class KipperLexer extends KipperLexerBase { "\x02\x02\x03\x02\x03I\x02\x07\x03\x02\x03J\x03\x07\x04\x02\t\x03\x02\x07" + "\x02\x02\x03L\x04\x03O\x05"; public static readonly _serializedATN: string = Utils.join( - [ - KipperLexer._serializedATNSegment0, - KipperLexer._serializedATNSegment1, - ], + [KipperLexer._serializedATNSegment0, KipperLexer._serializedATNSegment1], "", ); public static __ATN: ATN; @@ -624,6 +839,4 @@ export class KipperLexer extends KipperLexerBase { return KipperLexer.__ATN; } - } - diff --git a/kipper/core/src/compiler/parser/antlr/KipperParser.ts b/kipper/core/src/compiler/parser/antlr/KipperParser.ts index 0ff166753..0959edb03 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParser.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperParser.ts @@ -1,11 +1,9 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT - - // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax - // kind values. - import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; - import KipperParserBase from "./base/KipperParserBase"; - +// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax +// kind values. +import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; +import KipperParserBase from "./base/KipperParserBase"; import { ATN } from "antlr4ts/atn/ATN"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; @@ -32,7 +30,6 @@ import * as Utils from "antlr4ts/misc/Utils"; import { KipperParserListener } from "./KipperParserListener"; import { KipperParserVisitor } from "./KipperParserVisitor"; - export class KipperParser extends KipperParserBase { public static readonly FStringExpStart = 1; public static readonly BlockComment = 2; @@ -187,56 +184,235 @@ export class KipperParser extends KipperParserBase { public static readonly RULE_typeSpecifierIdentifier = 72; // tslint:disable:no-trailing-whitespace public static readonly ruleNames: string[] = [ - "compilationUnit", "translationUnit", "externalItem", "blockItemList", - "blockItem", "declaration", "variableDeclaration", "storageTypeSpecifier", - "initDeclarator", "initializer", "declarator", "directDeclarator", "functionDeclaration", - "parameterList", "parameterDeclaration", "interfaceDeclaration", "classDeclaration", - "statement", "compoundStatement", "expressionStatement", "selectionStatement", - "ifStatement", "switchStatement", "switchLabeledStatement", "iterationStatement", - "forLoopIterationStatement", "whileLoopIterationStatement", "doWhileLoopIterationStatement", - "jumpStatement", "returnStatement", "primaryExpression", "tangledPrimaryExpression", - "boolPrimaryExpression", "identifierPrimaryExpression", "identifier", - "identifierOrStringPrimaryExpression", "stringPrimaryExpression", "fStringPrimaryExpression", - "fStringSingleQuoteAtom", "fStringDoubleQuoteAtom", "numberPrimaryExpression", - "arrayPrimaryExpression", "objectPrimaryExpression", "objectProperty", - "voidOrNullOrUndefinedPrimaryExpression", "computedPrimaryExpression", - "argumentExpressionList", "dotNotation", "bracketNotation", "sliceNotation", - "postfixExpression", "incrementOrDecrementPostfixExpression", "unaryExpression", - "incrementOrDecrementUnaryExpression", "operatorModifiedUnaryExpression", - "incrementOrDecrementOperator", "unaryOperator", "castOrConvertExpression", - "multiplicativeExpression", "additiveExpression", "relationalExpression", - "equalityExpression", "logicalAndExpression", "logicalOrExpression", "conditionalExpression", - "assignmentExpression", "assignmentOperator", "expression", "typeSpecifierExpression", - "identifierTypeSpecifierExpression", "genericTypeSpecifierExpression", - "typeofTypeSpecifierExpression", "typeSpecifierIdentifier", + "compilationUnit", + "translationUnit", + "externalItem", + "blockItemList", + "blockItem", + "declaration", + "variableDeclaration", + "storageTypeSpecifier", + "initDeclarator", + "initializer", + "declarator", + "directDeclarator", + "functionDeclaration", + "parameterList", + "parameterDeclaration", + "interfaceDeclaration", + "classDeclaration", + "statement", + "compoundStatement", + "expressionStatement", + "selectionStatement", + "ifStatement", + "switchStatement", + "switchLabeledStatement", + "iterationStatement", + "forLoopIterationStatement", + "whileLoopIterationStatement", + "doWhileLoopIterationStatement", + "jumpStatement", + "returnStatement", + "primaryExpression", + "tangledPrimaryExpression", + "boolPrimaryExpression", + "identifierPrimaryExpression", + "identifier", + "identifierOrStringPrimaryExpression", + "stringPrimaryExpression", + "fStringPrimaryExpression", + "fStringSingleQuoteAtom", + "fStringDoubleQuoteAtom", + "numberPrimaryExpression", + "arrayPrimaryExpression", + "objectPrimaryExpression", + "objectProperty", + "voidOrNullOrUndefinedPrimaryExpression", + "computedPrimaryExpression", + "argumentExpressionList", + "dotNotation", + "bracketNotation", + "sliceNotation", + "postfixExpression", + "incrementOrDecrementPostfixExpression", + "unaryExpression", + "incrementOrDecrementUnaryExpression", + "operatorModifiedUnaryExpression", + "incrementOrDecrementOperator", + "unaryOperator", + "castOrConvertExpression", + "multiplicativeExpression", + "additiveExpression", + "relationalExpression", + "equalityExpression", + "logicalAndExpression", + "logicalOrExpression", + "conditionalExpression", + "assignmentExpression", + "assignmentOperator", + "expression", + "typeSpecifierExpression", + "identifierTypeSpecifierExpression", + "genericTypeSpecifierExpression", + "typeofTypeSpecifierExpression", + "typeSpecifierIdentifier", ]; private static readonly _LITERAL_NAMES: Array = [ - undefined, undefined, undefined, undefined, "'const'", "'var'", "'as'", - "'...'", "'switch'", "'case'", "'default'", "'break'", "'continue'", "'do'", - "'while'", "'if'", "'else'", "'for'", "'enum'", "'def'", "'return'", "'call'", - "'->'", "'class'", "'interface'", "'true'", "'false'", "'typeof'", "'void'", - "'null'", "'undefined'", "','", "';'", "'?'", "':'", "'('", "')'", "'['", - "']'", undefined, "'{'", "'}'", "'+'", "'++'", "'-'", "'--'", "'*'", "'/'", - "'%'", "'**'", "'&&'", "'||'", "'!'", "'='", "'+='", "'-='", "'*='", "'/='", - "'%='", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'.'", + undefined, + undefined, + undefined, + undefined, + "'const'", + "'var'", + "'as'", + "'...'", + "'switch'", + "'case'", + "'default'", + "'break'", + "'continue'", + "'do'", + "'while'", + "'if'", + "'else'", + "'for'", + "'enum'", + "'def'", + "'return'", + "'call'", + "'->'", + "'class'", + "'interface'", + "'true'", + "'false'", + "'typeof'", + "'void'", + "'null'", + "'undefined'", + "','", + "';'", + "'?'", + "':'", + "'('", + "')'", + "'['", + "']'", + undefined, + "'{'", + "'}'", + "'+'", + "'++'", + "'-'", + "'--'", + "'*'", + "'/'", + "'%'", + "'**'", + "'&&'", + "'||'", + "'!'", + "'='", + "'+='", + "'-='", + "'*='", + "'/='", + "'%='", + "'=='", + "'!='", + "'<'", + "'<='", + "'>'", + "'>='", + "'.'", ]; private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, "FStringExpStart", "BlockComment", "LineComment", "Const", - "Var", "As", "Spread", "Switch", "Case", "Default", "Break", "Continue", - "Do", "While", "If", "Else", "For", "Enum", "DefFunc", "Return", "CallFunc", - "RetIndicator", "Class", "Interface", "True", "False", "Typeof", "Void", - "Null", "Undefined", "Comma", "SemiColon", "QuestionMark", "Colon", "LeftParen", - "RightParen", "LeftBracket", "RightBracket", "FStringExpEnd", "LeftBrace", - "RightBrace", "Plus", "PlusPlus", "Minus", "MinusMinus", "Star", "Div", - "Mod", "PowerTo", "AndAnd", "OrOr", "Not", "Assign", "PlusAssign", "MinusAssign", - "StarAssign", "DivAssign", "ModAssign", "Equal", "NotEqual", "Less", "LessEqual", - "Greater", "GreaterEqual", "Dot", "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", - "DoubleQuoteStringLiteral", "FloatingConstant", "Whitespace", "Newline", - "FStringSingleQuoteStart", "FStringDoubleQuoteStart", "FStringSingleQuoteEnd", - "FStringSingleQuoteAtom", "FStringDoubleQuoteEnd", "FStringDoubleQuoteAtom", + undefined, + "FStringExpStart", + "BlockComment", + "LineComment", + "Const", + "Var", + "As", + "Spread", + "Switch", + "Case", + "Default", + "Break", + "Continue", + "Do", + "While", + "If", + "Else", + "For", + "Enum", + "DefFunc", + "Return", + "CallFunc", + "RetIndicator", + "Class", + "Interface", + "True", + "False", + "Typeof", + "Void", + "Null", + "Undefined", + "Comma", + "SemiColon", + "QuestionMark", + "Colon", + "LeftParen", + "RightParen", + "LeftBracket", + "RightBracket", + "FStringExpEnd", + "LeftBrace", + "RightBrace", + "Plus", + "PlusPlus", + "Minus", + "MinusMinus", + "Star", + "Div", + "Mod", + "PowerTo", + "AndAnd", + "OrOr", + "Not", + "Assign", + "PlusAssign", + "MinusAssign", + "StarAssign", + "DivAssign", + "ModAssign", + "Equal", + "NotEqual", + "Less", + "LessEqual", + "Greater", + "GreaterEqual", + "Dot", + "Identifier", + "IntegerConstant", + "SingleQuoteStringLiteral", + "DoubleQuoteStringLiteral", + "FloatingConstant", + "Whitespace", + "Newline", + "FStringSingleQuoteStart", + "FStringDoubleQuoteStart", + "FStringSingleQuoteEnd", + "FStringSingleQuoteAtom", + "FStringDoubleQuoteEnd", + "FStringDoubleQuoteAtom", ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(KipperParser._LITERAL_NAMES, KipperParser._SYMBOLIC_NAMES, []); + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( + KipperParser._LITERAL_NAMES, + KipperParser._SYMBOLIC_NAMES, + [], + ); // @Override // @NotNull @@ -246,13 +422,19 @@ export class KipperParser extends KipperParserBase { // tslint:enable:no-trailing-whitespace // @Override - public get grammarFileName(): string { return "KipperParser.g4"; } + public get grammarFileName(): string { + return "KipperParser.g4"; + } // @Override - public get ruleNames(): string[] { return KipperParser.ruleNames; } + public get ruleNames(): string[] { + return KipperParser.ruleNames; + } // @Override - public get serializedATN(): string { return KipperParser._serializedATN; } + public get serializedATN(): string { + return KipperParser._serializedATN; + } protected createFailedPredicateException(predicate?: string, message?: string): FailedPredicateException { return new FailedPredicateException(this, predicate, message); @@ -269,21 +451,20 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 147; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 0, this._ctx) ) { - case 1: - { - this.state = 146; - this.translationUnit(); + this.state = 147; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 0, this._ctx)) { + case 1: + { + this.state = 146; + this.translationUnit(); + } + break; } - break; - } - this.state = 149; - this.match(KipperParser.EOF); + this.state = 149; + this.match(KipperParser.EOF); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -291,8 +472,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -305,29 +485,28 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 152; - this._errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - this.state = 151; - this.externalItem(); - } - } - break; - default: - throw new NoViableAltException(this); - } - this.state = 154; + this.state = 152; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx); - } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 151; + this.externalItem(); + } + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 154; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -335,8 +514,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -349,11 +527,10 @@ export class KipperParser extends KipperParserBase { _localctx = new ExternalBlockItemContext(_localctx); this.enterOuterAlt(_localctx, 1); { - this.state = 156; - this.blockItemList(); + this.state = 156; + this.blockItemList(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -361,8 +538,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -375,29 +551,28 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 159; - this._errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - this.state = 158; - this.blockItem(); - } - } - break; - default: - throw new NoViableAltException(this); - } - this.state = 161; + this.state = 159; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); - } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 158; + this.blockItem(); + } + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 161; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -405,8 +580,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -418,33 +592,32 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 166; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 3, this._ctx) ) { - case 1: - { - this.state = 163; - this.statement(); - } - break; + this.state = 166; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 3, this._ctx)) { + case 1: + { + this.state = 163; + this.statement(); + } + break; - case 2: - { - this.state = 164; - this.declaration(); - } - break; + case 2: + { + this.state = 164; + this.declaration(); + } + break; - case 3: - { - this.state = 165; - this.match(KipperParser.SemiColon); + case 3: + { + this.state = 165; + this.match(KipperParser.SemiColon); + } + break; } - break; - } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -452,8 +625,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -466,42 +638,41 @@ export class KipperParser extends KipperParserBase { this.state = 174; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Const: - case KipperParser.Var: - this.enterOuterAlt(_localctx, 1); - { - this.state = 168; - this.variableDeclaration(); - this.state = 169; - this.match(KipperParser.SemiColon); - } - break; - case KipperParser.DefFunc: - this.enterOuterAlt(_localctx, 2); - { - this.state = 171; - this.functionDeclaration(); - } - break; - case KipperParser.Interface: - this.enterOuterAlt(_localctx, 3); - { - this.state = 172; - this.interfaceDeclaration(); - } - break; - case KipperParser.Class: - this.enterOuterAlt(_localctx, 4); - { - this.state = 173; - this.classDeclaration(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Const: + case KipperParser.Var: + this.enterOuterAlt(_localctx, 1); + { + this.state = 168; + this.variableDeclaration(); + this.state = 169; + this.match(KipperParser.SemiColon); + } + break; + case KipperParser.DefFunc: + this.enterOuterAlt(_localctx, 2); + { + this.state = 171; + this.functionDeclaration(); + } + break; + case KipperParser.Interface: + this.enterOuterAlt(_localctx, 3); + { + this.state = 172; + this.interfaceDeclaration(); + } + break; + case KipperParser.Class: + this.enterOuterAlt(_localctx, 4); + { + this.state = 173; + this.classDeclaration(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -509,8 +680,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -522,13 +692,12 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 176; - this.storageTypeSpecifier(); - this.state = 177; - this.initDeclarator(); + this.state = 176; + this.storageTypeSpecifier(); + this.state = 177; + this.initDeclarator(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -536,8 +705,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -550,21 +718,20 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 179; - _la = this._input.LA(1); - if (!(_la === KipperParser.Const || _la === KipperParser.Var)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 179; + _la = this._input.LA(1); + if (!(_la === KipperParser.Const || _la === KipperParser.Var)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -572,8 +739,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -586,27 +752,25 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 181; - this.declarator(); - this.state = 182; - this.match(KipperParser.Colon); - this.state = 183; - this.typeSpecifierExpression(); - this.state = 186; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Assign) { - { - this.state = 184; - this.match(KipperParser.Assign); - this.state = 185; - this.initializer(); + this.state = 181; + this.declarator(); + this.state = 182; + this.match(KipperParser.Colon); + this.state = 183; + this.typeSpecifierExpression(); + this.state = 186; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Assign) { + { + this.state = 184; + this.match(KipperParser.Assign); + this.state = 185; + this.initializer(); + } } } - - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -614,8 +778,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -627,11 +790,10 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 188; - this.assignmentExpression(); + this.state = 188; + this.assignmentExpression(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -639,8 +801,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -652,11 +813,10 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 190; - this.directDeclarator(); + this.state = 190; + this.directDeclarator(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -664,8 +824,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -677,11 +836,10 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 192; - this.match(KipperParser.Identifier); + this.state = 192; + this.match(KipperParser.Identifier); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -689,8 +847,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -703,41 +860,40 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 194; - this.match(KipperParser.DefFunc); - this.state = 195; - this.declarator(); - this.state = 196; - this.match(KipperParser.LeftParen); - this.state = 198; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Identifier) { - { - this.state = 197; - this.parameterList(); + this.state = 194; + this.match(KipperParser.DefFunc); + this.state = 195; + this.declarator(); + this.state = 196; + this.match(KipperParser.LeftParen); + this.state = 198; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Identifier) { + { + this.state = 197; + this.parameterList(); + } } - } - this.state = 200; - this.match(KipperParser.RightParen); - this.state = 201; - this.match(KipperParser.RetIndicator); - this.state = 202; - this.typeSpecifierExpression(); - this.state = 204; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 7, this._ctx) ) { - case 1: - { - this.state = 203; - this.compoundStatement(); + this.state = 200; + this.match(KipperParser.RightParen); + this.state = 201; + this.match(KipperParser.RetIndicator); + this.state = 202; + this.typeSpecifierExpression(); + this.state = 204; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 7, this._ctx)) { + case 1: + { + this.state = 203; + this.compoundStatement(); + } + break; } - break; - } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -745,8 +901,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -759,27 +914,26 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 206; - this.parameterDeclaration(); - this.state = 211; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.Comma) { - { - { - this.state = 207; - this.match(KipperParser.Comma); - this.state = 208; + this.state = 206; this.parameterDeclaration(); - } - } - this.state = 213; + this.state = 211; this._errHandler.sync(this); _la = this._input.LA(1); + while (_la === KipperParser.Comma) { + { + { + this.state = 207; + this.match(KipperParser.Comma); + this.state = 208; + this.parameterDeclaration(); + } + } + this.state = 213; + this._errHandler.sync(this); + _la = this._input.LA(1); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -787,8 +941,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -800,15 +953,14 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 214; - this.declarator(); - this.state = 215; - this.match(KipperParser.Colon); - this.state = 216; - this.typeSpecifierExpression(); + this.state = 214; + this.declarator(); + this.state = 215; + this.match(KipperParser.Colon); + this.state = 216; + this.typeSpecifierExpression(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -816,8 +968,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -829,17 +980,16 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 218; - this.match(KipperParser.Interface); - this.state = 219; - this.match(KipperParser.Identifier); - this.state = 220; - this.match(KipperParser.LeftBrace); - this.state = 221; - this.match(KipperParser.RightBrace); - } - } - catch (re) { + this.state = 218; + this.match(KipperParser.Interface); + this.state = 219; + this.match(KipperParser.Identifier); + this.state = 220; + this.match(KipperParser.LeftBrace); + this.state = 221; + this.match(KipperParser.RightBrace); + } + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -847,8 +997,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -860,17 +1009,16 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 223; - this.match(KipperParser.Class); - this.state = 224; - this.match(KipperParser.Identifier); - this.state = 225; - this.match(KipperParser.LeftBrace); - this.state = 226; - this.match(KipperParser.RightBrace); - } - } - catch (re) { + this.state = 223; + this.match(KipperParser.Class); + this.state = 224; + this.match(KipperParser.Identifier); + this.state = 225; + this.match(KipperParser.LeftBrace); + this.state = 226; + this.match(KipperParser.RightBrace); + } + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -878,8 +1026,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -891,57 +1038,56 @@ export class KipperParser extends KipperParserBase { try { this.state = 234; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 9, this._ctx) ) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 228; - this.expressionStatement(); - } - break; + switch (this.interpreter.adaptivePredict(this._input, 9, this._ctx)) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 228; + this.expressionStatement(); + } + break; - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 229; - this.selectionStatement(); - } - break; + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 229; + this.selectionStatement(); + } + break; - case 3: - this.enterOuterAlt(_localctx, 3); - { - this.state = 230; - this.iterationStatement(); - } - break; + case 3: + this.enterOuterAlt(_localctx, 3); + { + this.state = 230; + this.iterationStatement(); + } + break; - case 4: - this.enterOuterAlt(_localctx, 4); - { - this.state = 231; - this.jumpStatement(); - } - break; + case 4: + this.enterOuterAlt(_localctx, 4); + { + this.state = 231; + this.jumpStatement(); + } + break; - case 5: - this.enterOuterAlt(_localctx, 5); - { - this.state = 232; - this.returnStatement(); - } - break; + case 5: + this.enterOuterAlt(_localctx, 5); + { + this.state = 232; + this.returnStatement(); + } + break; - case 6: - this.enterOuterAlt(_localctx, 6); - { - this.state = 233; - this.compoundStatement(); - } - break; + case 6: + this.enterOuterAlt(_localctx, 6); + { + this.state = 233; + this.compoundStatement(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -949,8 +1095,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -962,27 +1107,26 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 236; - if (!(this.notInsideExpressionStatement())) { - throw this.createFailedPredicateException("this.notInsideExpressionStatement()"); - } - this.state = 237; - this.match(KipperParser.LeftBrace); - this.state = 239; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 10, this._ctx) ) { - case 1: - { - this.state = 238; - this.blockItemList(); + this.state = 236; + if (!this.notInsideExpressionStatement()) { + throw this.createFailedPredicateException("this.notInsideExpressionStatement()"); } - break; - } - this.state = 241; - this.match(KipperParser.RightBrace); + this.state = 237; + this.match(KipperParser.LeftBrace); + this.state = 239; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 10, this._ctx)) { + case 1: + { + this.state = 238; + this.blockItemList(); + } + break; + } + this.state = 241; + this.match(KipperParser.RightBrace); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -990,8 +1134,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1003,15 +1146,14 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.enterExpressionStatement() - this.state = 244; - this.expression(); - this.state = 245; - this.match(KipperParser.SemiColon); - this.exitExpressionStatement() + this.enterExpressionStatement(); + this.state = 244; + this.expression(); + this.state = 245; + this.match(KipperParser.SemiColon); + this.exitExpressionStatement(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1019,8 +1161,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1033,25 +1174,24 @@ export class KipperParser extends KipperParserBase { this.state = 250; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.If: - this.enterOuterAlt(_localctx, 1); - { - this.state = 248; - this.ifStatement(); - } - break; - case KipperParser.Switch: - this.enterOuterAlt(_localctx, 2); - { - this.state = 249; - this.switchStatement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.If: + this.enterOuterAlt(_localctx, 1); + { + this.state = 248; + this.ifStatement(); + } + break; + case KipperParser.Switch: + this.enterOuterAlt(_localctx, 2); + { + this.state = 249; + this.switchStatement(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1059,8 +1199,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1072,31 +1211,30 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 252; - this.match(KipperParser.If); - this.state = 253; - this.match(KipperParser.LeftParen); - this.state = 254; - this.expression(); - this.state = 255; - this.match(KipperParser.RightParen); - this.state = 256; - this.statement(); - this.state = 259; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 12, this._ctx) ) { - case 1: - { - this.state = 257; - this.match(KipperParser.Else); - this.state = 258; + this.state = 252; + this.match(KipperParser.If); + this.state = 253; + this.match(KipperParser.LeftParen); + this.state = 254; + this.expression(); + this.state = 255; + this.match(KipperParser.RightParen); + this.state = 256; this.statement(); + this.state = 259; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 12, this._ctx)) { + case 1: + { + this.state = 257; + this.match(KipperParser.Else); + this.state = 258; + this.statement(); + } + break; } - break; - } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1104,8 +1242,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1118,35 +1255,34 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 261; - this.match(KipperParser.Switch); - this.state = 262; - this.match(KipperParser.LeftParen); - this.state = 263; - this.expression(); - this.state = 264; - this.match(KipperParser.RightParen); - this.state = 265; - this.match(KipperParser.LeftBrace); - this.state = 269; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.Case || _la === KipperParser.Default) { - { - { - this.state = 266; - this.switchLabeledStatement(); - } - } - this.state = 271; + this.state = 261; + this.match(KipperParser.Switch); + this.state = 262; + this.match(KipperParser.LeftParen); + this.state = 263; + this.expression(); + this.state = 264; + this.match(KipperParser.RightParen); + this.state = 265; + this.match(KipperParser.LeftBrace); + this.state = 269; this._errHandler.sync(this); _la = this._input.LA(1); + while (_la === KipperParser.Case || _la === KipperParser.Default) { + { + { + this.state = 266; + this.switchLabeledStatement(); + } + } + this.state = 271; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 272; + this.match(KipperParser.RightBrace); } - this.state = 272; - this.match(KipperParser.RightBrace); - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1154,8 +1290,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1168,35 +1303,34 @@ export class KipperParser extends KipperParserBase { this.state = 282; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Case: - this.enterOuterAlt(_localctx, 1); - { - this.state = 274; - this.match(KipperParser.Case); - this.state = 275; - this.expression(); - this.state = 276; - this.match(KipperParser.Colon); - this.state = 277; - this.statement(); - } - break; - case KipperParser.Default: - this.enterOuterAlt(_localctx, 2); - { - this.state = 279; - this.match(KipperParser.Default); - this.state = 280; - this.match(KipperParser.Colon); - this.state = 281; - this.statement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Case: + this.enterOuterAlt(_localctx, 1); + { + this.state = 274; + this.match(KipperParser.Case); + this.state = 275; + this.expression(); + this.state = 276; + this.match(KipperParser.Colon); + this.state = 277; + this.statement(); + } + break; + case KipperParser.Default: + this.enterOuterAlt(_localctx, 2); + { + this.state = 279; + this.match(KipperParser.Default); + this.state = 280; + this.match(KipperParser.Colon); + this.state = 281; + this.statement(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1204,8 +1338,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1218,32 +1351,31 @@ export class KipperParser extends KipperParserBase { this.state = 287; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.For: - this.enterOuterAlt(_localctx, 1); - { - this.state = 284; - this.forLoopIterationStatement(); - } - break; - case KipperParser.While: - this.enterOuterAlt(_localctx, 2); - { - this.state = 285; - this.whileLoopIterationStatement(); - } - break; - case KipperParser.Do: - this.enterOuterAlt(_localctx, 3); - { - this.state = 286; - this.doWhileLoopIterationStatement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.For: + this.enterOuterAlt(_localctx, 1); + { + this.state = 284; + this.forLoopIterationStatement(); + } + break; + case KipperParser.While: + this.enterOuterAlt(_localctx, 2); + { + this.state = 285; + this.whileLoopIterationStatement(); + } + break; + case KipperParser.Do: + this.enterOuterAlt(_localctx, 3); + { + this.state = 286; + this.doWhileLoopIterationStatement(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1251,8 +1383,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1265,91 +1396,179 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 289; - this.match(KipperParser.For); - this.state = 290; - this.match(KipperParser.LeftParen); - this.state = 297; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Const) | (1 << KipperParser.Var) | (1 << KipperParser.CallFunc) | (1 << KipperParser.True) | (1 << KipperParser.False) | (1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0) || ((((_la - 35)) & ~0x1F) === 0 && ((1 << (_la - 35)) & ((1 << (KipperParser.LeftParen - 35)) | (1 << (KipperParser.LeftBracket - 35)) | (1 << (KipperParser.LeftBrace - 35)) | (1 << (KipperParser.Plus - 35)) | (1 << (KipperParser.PlusPlus - 35)) | (1 << (KipperParser.Minus - 35)) | (1 << (KipperParser.MinusMinus - 35)) | (1 << (KipperParser.Not - 35)) | (1 << (KipperParser.Identifier - 35)))) !== 0) || ((((_la - 67)) & ~0x1F) === 0 && ((1 << (_la - 67)) & ((1 << (KipperParser.IntegerConstant - 67)) | (1 << (KipperParser.SingleQuoteStringLiteral - 67)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 67)) | (1 << (KipperParser.FloatingConstant - 67)) | (1 << (KipperParser.FStringSingleQuoteStart - 67)) | (1 << (KipperParser.FStringDoubleQuoteStart - 67)))) !== 0)) { - { - this.state = 293; + this.state = 289; + this.match(KipperParser.For); + this.state = 290; + this.match(KipperParser.LeftParen); + this.state = 297; this._errHandler.sync(this); - switch (this._input.LA(1)) { - case KipperParser.Const: - case KipperParser.Var: - { - this.state = 291; - this.variableDeclaration(); - } - break; - case KipperParser.CallFunc: - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Plus: - case KipperParser.PlusPlus: - case KipperParser.Minus: - case KipperParser.MinusMinus: - case KipperParser.Not: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: + _la = this._input.LA(1); + if ( + ((_la & ~0x1f) === 0 && + ((1 << _la) & + ((1 << KipperParser.Const) | + (1 << KipperParser.Var) | + (1 << KipperParser.CallFunc) | + (1 << KipperParser.True) | + (1 << KipperParser.False) | + (1 << KipperParser.Void) | + (1 << KipperParser.Null) | + (1 << KipperParser.Undefined))) !== + 0) || + (((_la - 35) & ~0x1f) === 0 && + ((1 << (_la - 35)) & + ((1 << (KipperParser.LeftParen - 35)) | + (1 << (KipperParser.LeftBracket - 35)) | + (1 << (KipperParser.LeftBrace - 35)) | + (1 << (KipperParser.Plus - 35)) | + (1 << (KipperParser.PlusPlus - 35)) | + (1 << (KipperParser.Minus - 35)) | + (1 << (KipperParser.MinusMinus - 35)) | + (1 << (KipperParser.Not - 35)) | + (1 << (KipperParser.Identifier - 35)))) !== + 0) || + (((_la - 67) & ~0x1f) === 0 && + ((1 << (_la - 67)) & + ((1 << (KipperParser.IntegerConstant - 67)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 67)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 67)) | + (1 << (KipperParser.FloatingConstant - 67)) | + (1 << (KipperParser.FStringSingleQuoteStart - 67)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 67)))) !== + 0) + ) { { - this.state = 292; - this.expression(); + this.state = 293; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case KipperParser.Const: + case KipperParser.Var: + { + this.state = 291; + this.variableDeclaration(); + } + break; + case KipperParser.CallFunc: + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Plus: + case KipperParser.PlusPlus: + case KipperParser.Minus: + case KipperParser.MinusMinus: + case KipperParser.Not: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + { + this.state = 292; + this.expression(); + } + break; + default: + throw new NoViableAltException(this); + } + _localctx._forDeclaration = true; } - break; - default: - throw new NoViableAltException(this); } - _localctx._forDeclaration = true - } - } - this.state = 299; - this.match(KipperParser.SemiColon); - this.state = 303; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { - { - this.state = 300; - this.expression(); - _localctx._forCondition = true + this.state = 299; + this.match(KipperParser.SemiColon); + this.state = 303; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 66) & ~0x1f) === 0 && + ((1 << (_la - 66)) & + ((1 << (KipperParser.Identifier - 66)) | + (1 << (KipperParser.IntegerConstant - 66)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | + (1 << (KipperParser.FloatingConstant - 66)) | + (1 << (KipperParser.FStringSingleQuoteStart - 66)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== + 0) + ) { + { + this.state = 300; + this.expression(); + _localctx._forCondition = true; + } } - } - this.state = 305; - this.match(KipperParser.SemiColon); - this.state = 309; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { - { - this.state = 306; - this.expression(); - _localctx._forIterationExp = true + this.state = 305; + this.match(KipperParser.SemiColon); + this.state = 309; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 66) & ~0x1f) === 0 && + ((1 << (_la - 66)) & + ((1 << (KipperParser.Identifier - 66)) | + (1 << (KipperParser.IntegerConstant - 66)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | + (1 << (KipperParser.FloatingConstant - 66)) | + (1 << (KipperParser.FStringSingleQuoteStart - 66)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== + 0) + ) { + { + this.state = 306; + this.expression(); + _localctx._forIterationExp = true; + } } - } - this.state = 311; - this.match(KipperParser.RightParen); - this.state = 312; - this.statement(); + this.state = 311; + this.match(KipperParser.RightParen); + this.state = 312; + this.statement(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1357,8 +1576,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1370,19 +1588,18 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 314; - this.match(KipperParser.While); - this.state = 315; - this.match(KipperParser.LeftParen); - this.state = 316; - this.expression(); - this.state = 317; - this.match(KipperParser.RightParen); - this.state = 318; - this.statement(); - } - } - catch (re) { + this.state = 314; + this.match(KipperParser.While); + this.state = 315; + this.match(KipperParser.LeftParen); + this.state = 316; + this.expression(); + this.state = 317; + this.match(KipperParser.RightParen); + this.state = 318; + this.statement(); + } + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1390,36 +1607,37 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public doWhileLoopIterationStatement(): DoWhileLoopIterationStatementContext { - let _localctx: DoWhileLoopIterationStatementContext = new DoWhileLoopIterationStatementContext(this._ctx, this.state); + let _localctx: DoWhileLoopIterationStatementContext = new DoWhileLoopIterationStatementContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 54, KipperParser.RULE_doWhileLoopIterationStatement); try { this.enterOuterAlt(_localctx, 1); { - this.state = 320; - this.match(KipperParser.Do); - this.state = 321; - this.statement(); - this.state = 322; - this.match(KipperParser.While); - this.state = 323; - this.match(KipperParser.LeftParen); - this.state = 324; - this.expression(); - this.state = 325; - this.match(KipperParser.RightParen); - this.state = 326; - this.match(KipperParser.SemiColon); - } - } - catch (re) { + this.state = 320; + this.match(KipperParser.Do); + this.state = 321; + this.statement(); + this.state = 322; + this.match(KipperParser.While); + this.state = 323; + this.match(KipperParser.LeftParen); + this.state = 324; + this.expression(); + this.state = 325; + this.match(KipperParser.RightParen); + this.state = 326; + this.match(KipperParser.SemiColon); + } + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1427,8 +1645,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1441,23 +1658,22 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 328; - _la = this._input.LA(1); - if (!(_la === KipperParser.Break || _la === KipperParser.Continue)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 328; + _la = this._input.LA(1); + if (!(_la === KipperParser.Break || _la === KipperParser.Continue)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 329; - this.match(KipperParser.SemiColon); + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 329; + this.match(KipperParser.SemiColon); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1465,8 +1681,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1479,23 +1694,50 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 331; - this.match(KipperParser.Return); - this.state = 333; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { - { - this.state = 332; - this.expression(); + this.state = 331; + this.match(KipperParser.Return); + this.state = 333; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 66) & ~0x1f) === 0 && + ((1 << (_la - 66)) & + ((1 << (KipperParser.Identifier - 66)) | + (1 << (KipperParser.IntegerConstant - 66)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | + (1 << (KipperParser.FloatingConstant - 66)) | + (1 << (KipperParser.FStringSingleQuoteStart - 66)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== + 0) + ) { + { + this.state = 332; + this.expression(); + } } - } - this.state = 335; - this.match(KipperParser.SemiColon); + this.state = 335; + this.match(KipperParser.SemiColon); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1503,8 +1745,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1517,80 +1758,79 @@ export class KipperParser extends KipperParserBase { this.state = 346; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.LeftParen: - this.enterOuterAlt(_localctx, 1); - { - this.state = 337; - this.tangledPrimaryExpression(); - } - break; - case KipperParser.LeftBracket: - this.enterOuterAlt(_localctx, 2); - { - this.state = 338; - this.arrayPrimaryExpression(); - } - break; - case KipperParser.LeftBrace: - this.enterOuterAlt(_localctx, 3); - { - this.state = 339; - this.objectPrimaryExpression(); - } - break; - case KipperParser.True: - case KipperParser.False: - this.enterOuterAlt(_localctx, 4); - { - this.state = 340; - this.boolPrimaryExpression(); - } - break; - case KipperParser.Identifier: - this.enterOuterAlt(_localctx, 5); - { - this.state = 341; - this.identifierPrimaryExpression(); - } - break; - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - this.enterOuterAlt(_localctx, 6); - { - this.state = 342; - this.stringPrimaryExpression(); - } - break; - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 7); - { - this.state = 343; - this.fStringPrimaryExpression(); - } - break; - case KipperParser.IntegerConstant: - case KipperParser.FloatingConstant: - this.enterOuterAlt(_localctx, 8); - { - this.state = 344; - this.numberPrimaryExpression(); - } - break; - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - this.enterOuterAlt(_localctx, 9); - { - this.state = 345; - this.voidOrNullOrUndefinedPrimaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.LeftParen: + this.enterOuterAlt(_localctx, 1); + { + this.state = 337; + this.tangledPrimaryExpression(); + } + break; + case KipperParser.LeftBracket: + this.enterOuterAlt(_localctx, 2); + { + this.state = 338; + this.arrayPrimaryExpression(); + } + break; + case KipperParser.LeftBrace: + this.enterOuterAlt(_localctx, 3); + { + this.state = 339; + this.objectPrimaryExpression(); + } + break; + case KipperParser.True: + case KipperParser.False: + this.enterOuterAlt(_localctx, 4); + { + this.state = 340; + this.boolPrimaryExpression(); + } + break; + case KipperParser.Identifier: + this.enterOuterAlt(_localctx, 5); + { + this.state = 341; + this.identifierPrimaryExpression(); + } + break; + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + this.enterOuterAlt(_localctx, 6); + { + this.state = 342; + this.stringPrimaryExpression(); + } + break; + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 7); + { + this.state = 343; + this.fStringPrimaryExpression(); + } + break; + case KipperParser.IntegerConstant: + case KipperParser.FloatingConstant: + this.enterOuterAlt(_localctx, 8); + { + this.state = 344; + this.numberPrimaryExpression(); + } + break; + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + this.enterOuterAlt(_localctx, 9); + { + this.state = 345; + this.voidOrNullOrUndefinedPrimaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1598,8 +1838,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1611,15 +1850,14 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 348; - this.match(KipperParser.LeftParen); - this.state = 349; - this.expression(); - this.state = 350; - this.match(KipperParser.RightParen); + this.state = 348; + this.match(KipperParser.LeftParen); + this.state = 349; + this.expression(); + this.state = 350; + this.match(KipperParser.RightParen); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1627,8 +1865,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1641,21 +1878,20 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 352; - _la = this._input.LA(1); - if (!(_la === KipperParser.True || _la === KipperParser.False)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 352; + _la = this._input.LA(1); + if (!(_la === KipperParser.True || _la === KipperParser.False)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1663,8 +1899,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1676,11 +1911,10 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 354; - this.identifier(); + this.state = 354; + this.identifier(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1688,8 +1922,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1701,11 +1934,10 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 356; - this.match(KipperParser.Identifier); + this.state = 356; + this.match(KipperParser.Identifier); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1713,40 +1945,41 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public identifierOrStringPrimaryExpression(): IdentifierOrStringPrimaryExpressionContext { - let _localctx: IdentifierOrStringPrimaryExpressionContext = new IdentifierOrStringPrimaryExpressionContext(this._ctx, this.state); + let _localctx: IdentifierOrStringPrimaryExpressionContext = new IdentifierOrStringPrimaryExpressionContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 70, KipperParser.RULE_identifierOrStringPrimaryExpression); try { this.state = 360; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Identifier: - this.enterOuterAlt(_localctx, 1); - { - this.state = 358; - this.identifier(); - } - break; - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - this.enterOuterAlt(_localctx, 2); - { - this.state = 359; - this.stringPrimaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Identifier: + this.enterOuterAlt(_localctx, 1); + { + this.state = 358; + this.identifier(); + } + break; + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + this.enterOuterAlt(_localctx, 2); + { + this.state = 359; + this.stringPrimaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1754,8 +1987,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1768,21 +2000,20 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 362; - _la = this._input.LA(1); - if (!(_la === KipperParser.SingleQuoteStringLiteral || _la === KipperParser.DoubleQuoteStringLiteral)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 362; + _la = this._input.LA(1); + if (!(_la === KipperParser.SingleQuoteStringLiteral || _la === KipperParser.DoubleQuoteStringLiteral)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1790,8 +2021,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1805,57 +2035,56 @@ export class KipperParser extends KipperParserBase { this.state = 380; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringSingleQuoteStart: - this.enterOuterAlt(_localctx, 1); - { - this.state = 364; - this.match(KipperParser.FStringSingleQuoteStart); - this.state = 368; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringSingleQuoteAtom) { - { + case KipperParser.FStringSingleQuoteStart: + this.enterOuterAlt(_localctx, 1); { - this.state = 365; - this.fStringSingleQuoteAtom(); - } + this.state = 364; + this.match(KipperParser.FStringSingleQuoteStart); + this.state = 368; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringSingleQuoteAtom) { + { + { + this.state = 365; + this.fStringSingleQuoteAtom(); + } + } + this.state = 370; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 371; + this.match(KipperParser.FStringSingleQuoteEnd); } - this.state = 370; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 371; - this.match(KipperParser.FStringSingleQuoteEnd); - } - break; - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 2); - { - this.state = 372; - this.match(KipperParser.FStringDoubleQuoteStart); - this.state = 376; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringDoubleQuoteAtom) { - { + break; + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 2); { - this.state = 373; - this.fStringDoubleQuoteAtom(); - } + this.state = 372; + this.match(KipperParser.FStringDoubleQuoteStart); + this.state = 376; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringDoubleQuoteAtom) { + { + { + this.state = 373; + this.fStringDoubleQuoteAtom(); + } + } + this.state = 378; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 379; + this.match(KipperParser.FStringDoubleQuoteEnd); } - this.state = 378; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 379; - this.match(KipperParser.FStringDoubleQuoteEnd); - } - break; - default: - throw new NoViableAltException(this); + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1863,8 +2092,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1878,37 +2106,64 @@ export class KipperParser extends KipperParserBase { this.state = 388; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringSingleQuoteAtom: - this.enterOuterAlt(_localctx, 1); - { - this.state = 382; - this.match(KipperParser.FStringSingleQuoteAtom); - } - break; - case KipperParser.FStringExpStart: - this.enterOuterAlt(_localctx, 2); - { - this.state = 383; - this.match(KipperParser.FStringExpStart); - this.state = 385; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { + case KipperParser.FStringSingleQuoteAtom: + this.enterOuterAlt(_localctx, 1); { - this.state = 384; - this.expression(); + this.state = 382; + this.match(KipperParser.FStringSingleQuoteAtom); } - } + break; + case KipperParser.FStringExpStart: + this.enterOuterAlt(_localctx, 2); + { + this.state = 383; + this.match(KipperParser.FStringExpStart); + this.state = 385; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 66) & ~0x1f) === 0 && + ((1 << (_la - 66)) & + ((1 << (KipperParser.Identifier - 66)) | + (1 << (KipperParser.IntegerConstant - 66)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | + (1 << (KipperParser.FloatingConstant - 66)) | + (1 << (KipperParser.FStringSingleQuoteStart - 66)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== + 0) + ) { + { + this.state = 384; + this.expression(); + } + } - this.state = 387; - this.match(KipperParser.FStringExpEnd); - } - break; - default: - throw new NoViableAltException(this); + this.state = 387; + this.match(KipperParser.FStringExpEnd); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1916,8 +2171,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1931,37 +2185,64 @@ export class KipperParser extends KipperParserBase { this.state = 396; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringDoubleQuoteAtom: - this.enterOuterAlt(_localctx, 1); - { - this.state = 390; - this.match(KipperParser.FStringDoubleQuoteAtom); - } - break; - case KipperParser.FStringExpStart: - this.enterOuterAlt(_localctx, 2); - { - this.state = 391; - this.match(KipperParser.FStringExpStart); - this.state = 393; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { + case KipperParser.FStringDoubleQuoteAtom: + this.enterOuterAlt(_localctx, 1); { - this.state = 392; - this.expression(); + this.state = 390; + this.match(KipperParser.FStringDoubleQuoteAtom); } - } + break; + case KipperParser.FStringExpStart: + this.enterOuterAlt(_localctx, 2); + { + this.state = 391; + this.match(KipperParser.FStringExpStart); + this.state = 393; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 66) & ~0x1f) === 0 && + ((1 << (_la - 66)) & + ((1 << (KipperParser.Identifier - 66)) | + (1 << (KipperParser.IntegerConstant - 66)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | + (1 << (KipperParser.FloatingConstant - 66)) | + (1 << (KipperParser.FStringSingleQuoteStart - 66)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== + 0) + ) { + { + this.state = 392; + this.expression(); + } + } - this.state = 395; - this.match(KipperParser.FStringExpEnd); - } - break; - default: - throw new NoViableAltException(this); + this.state = 395; + this.match(KipperParser.FStringExpEnd); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1969,8 +2250,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1983,21 +2263,20 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 398; - _la = this._input.LA(1); - if (!(_la === KipperParser.IntegerConstant || _la === KipperParser.FloatingConstant)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 398; + _la = this._input.LA(1); + if (!(_la === KipperParser.IntegerConstant || _la === KipperParser.FloatingConstant)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2005,8 +2284,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2020,51 +2298,78 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 400; - this.match(KipperParser.LeftBracket); - this.state = 409; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { - { - this.state = 401; - this.expression(); - this.state = 406; + this.state = 400; + this.match(KipperParser.LeftBracket); + this.state = 409; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 402; - this.match(KipperParser.Comma); - this.state = 403; + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 66) & ~0x1f) === 0 && + ((1 << (_la - 66)) & + ((1 << (KipperParser.Identifier - 66)) | + (1 << (KipperParser.IntegerConstant - 66)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | + (1 << (KipperParser.FloatingConstant - 66)) | + (1 << (KipperParser.FStringSingleQuoteStart - 66)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== + 0) + ) { + { + this.state = 401; this.expression(); - } + this.state = 406; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 402; + this.match(KipperParser.Comma); + this.state = 403; + this.expression(); + } + } + } + this.state = 408; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); } } - this.state = 408; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); - } } - } - this.state = 412; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Comma) { - { - this.state = 411; - this.match(KipperParser.Comma); + this.state = 412; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Comma) { + { + this.state = 411; + this.match(KipperParser.Comma); + } } - } - this.state = 414; - this.match(KipperParser.RightBracket); + this.state = 414; + this.match(KipperParser.RightBracket); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2072,8 +2377,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2087,51 +2391,57 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 416; - this.match(KipperParser.LeftBrace); - this.state = 425; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)))) !== 0)) { - { - this.state = 417; - this.objectProperty(); - this.state = 422; + this.state = 416; + this.match(KipperParser.LeftBrace); + this.state = 425; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 418; - this.match(KipperParser.Comma); - this.state = 419; + _la = this._input.LA(1); + if ( + ((_la - 66) & ~0x1f) === 0 && + ((1 << (_la - 66)) & + ((1 << (KipperParser.Identifier - 66)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 66)))) !== + 0 + ) { + { + this.state = 417; this.objectProperty(); - } + this.state = 422; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 418; + this.match(KipperParser.Comma); + this.state = 419; + this.objectProperty(); + } + } + } + this.state = 424; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); } } - this.state = 424; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); - } } - } - this.state = 428; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Comma) { - { - this.state = 427; - this.match(KipperParser.Comma); + this.state = 428; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Comma) { + { + this.state = 427; + this.match(KipperParser.Comma); + } } - } - this.state = 430; - this.match(KipperParser.RightBrace); + this.state = 430; + this.match(KipperParser.RightBrace); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2139,8 +2449,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2152,15 +2461,14 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 432; - this.identifierOrStringPrimaryExpression(); - this.state = 433; - this.match(KipperParser.Colon); - this.state = 434; - this.expression(); + this.state = 432; + this.identifierOrStringPrimaryExpression(); + this.state = 433; + this.match(KipperParser.Colon); + this.state = 434; + this.expression(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2168,35 +2476,41 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public voidOrNullOrUndefinedPrimaryExpression(): VoidOrNullOrUndefinedPrimaryExpressionContext { - let _localctx: VoidOrNullOrUndefinedPrimaryExpressionContext = new VoidOrNullOrUndefinedPrimaryExpressionContext(this._ctx, this.state); + let _localctx: VoidOrNullOrUndefinedPrimaryExpressionContext = new VoidOrNullOrUndefinedPrimaryExpressionContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 88, KipperParser.RULE_voidOrNullOrUndefinedPrimaryExpression); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 436; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 436; + _la = this._input.LA(1); + if ( + !( + (_la & ~0x1f) === 0 && + ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0 + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2204,8 +2518,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2230,153 +2543,216 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 449; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - { - _localctx = new PassOncomputedPrimaryExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 439; - this.primaryExpression(); - } - break; - case KipperParser.CallFunc: - { - _localctx = new ExplicitCallFunctionCallExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 440; - this.match(KipperParser.CallFunc); - this.state = 441; - this.computedPrimaryExpression(0); - this.state = 442; - this.match(KipperParser.LeftParen); - this.state = 444; + this.state = 449; this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { - { - this.state = 443; - this.argumentExpressionList(); - } - } - - this.state = 446; - this.match(KipperParser.RightParen); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression - } - break; - default: - throw new NoViableAltException(this); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 472; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - this.state = 470; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 39, this._ctx) ) { - case 1: + switch (this._input.LA(1)) { + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: { - _localctx = new FunctionCallExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 451; - if (!(this.precpred(this._ctx, 5))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 5)"); - } - this.state = 452; - this.match(KipperParser.LeftParen); - this.state = 454; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { - { - this.state = 453; - this.argumentExpressionList(); - } - } + _localctx = new PassOncomputedPrimaryExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 456; - this.match(KipperParser.RightParen); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression + this.state = 439; + this.primaryExpression(); } break; - - case 2: + case KipperParser.CallFunc: { - _localctx = new DotNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 458; - if (!(this.precpred(this._ctx, 3))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 3)"); - } - this.state = 459; - this.dotNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression - } - break; + _localctx = new ExplicitCallFunctionCallExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 440; + this.match(KipperParser.CallFunc); + this.state = 441; + this.computedPrimaryExpression(0); + this.state = 442; + this.match(KipperParser.LeftParen); + this.state = 444; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 66) & ~0x1f) === 0 && + ((1 << (_la - 66)) & + ((1 << (KipperParser.Identifier - 66)) | + (1 << (KipperParser.IntegerConstant - 66)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | + (1 << (KipperParser.FloatingConstant - 66)) | + (1 << (KipperParser.FStringSingleQuoteStart - 66)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== + 0) + ) { + { + this.state = 443; + this.argumentExpressionList(); + } + } - case 3: - { - _localctx = new BracketNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 462; - if (!(this.precpred(this._ctx, 2))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 2)"); - } - this.state = 463; - this.bracketNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression + this.state = 446; + this.match(KipperParser.RightParen); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression; } break; - - case 4: - { - _localctx = new SliceNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 466; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + default: + throw new NoViableAltException(this); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 472; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); } - this.state = 467; - this.sliceNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression + _prevctx = _localctx; + { + this.state = 470; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 39, this._ctx)) { + case 1: + { + _localctx = new FunctionCallExpressionContext( + new ComputedPrimaryExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 451; + if (!this.precpred(this._ctx, 5)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 5)"); + } + this.state = 452; + this.match(KipperParser.LeftParen); + this.state = 454; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 66) & ~0x1f) === 0 && + ((1 << (_la - 66)) & + ((1 << (KipperParser.Identifier - 66)) | + (1 << (KipperParser.IntegerConstant - 66)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | + (1 << (KipperParser.FloatingConstant - 66)) | + (1 << (KipperParser.FStringSingleQuoteStart - 66)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== + 0) + ) { + { + this.state = 453; + this.argumentExpressionList(); + } + } + + this.state = 456; + this.match(KipperParser.RightParen); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression; + } + break; + + case 2: + { + _localctx = new DotNotationMemberAccessExpressionContext( + new ComputedPrimaryExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 458; + if (!this.precpred(this._ctx, 3)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 3)"); + } + this.state = 459; + this.dotNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; + } + break; + + case 3: + { + _localctx = new BracketNotationMemberAccessExpressionContext( + new ComputedPrimaryExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 462; + if (!this.precpred(this._ctx, 2)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 2)"); + } + this.state = 463; + this.bracketNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; + } + break; + + case 4: + { + _localctx = new SliceNotationMemberAccessExpressionContext( + new ComputedPrimaryExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 466; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 467; + this.sliceNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; + } + break; + } } - break; - } } + this.state = 474; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); } - this.state = 474; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2384,8 +2760,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -2398,27 +2773,26 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 475; - this.assignmentExpression(); - this.state = 480; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.Comma) { - { - { - this.state = 476; - this.match(KipperParser.Comma); - this.state = 477; + this.state = 475; this.assignmentExpression(); - } - } - this.state = 482; + this.state = 480; this._errHandler.sync(this); _la = this._input.LA(1); + while (_la === KipperParser.Comma) { + { + { + this.state = 476; + this.match(KipperParser.Comma); + this.state = 477; + this.assignmentExpression(); + } + } + this.state = 482; + this._errHandler.sync(this); + _la = this._input.LA(1); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2426,8 +2800,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2439,13 +2812,12 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 483; - this.match(KipperParser.Dot); - this.state = 484; - this.identifier(); + this.state = 483; + this.match(KipperParser.Dot); + this.state = 484; + this.identifier(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2453,8 +2825,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2466,15 +2837,14 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 486; - this.match(KipperParser.LeftBracket); - this.state = 487; - this.expression(); - this.state = 488; - this.match(KipperParser.RightBracket); + this.state = 486; + this.match(KipperParser.LeftBracket); + this.state = 487; + this.expression(); + this.state = 488; + this.match(KipperParser.RightBracket); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2482,8 +2852,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2496,37 +2865,92 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 490; - this.match(KipperParser.LeftBracket); - this.state = 494; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { - { - this.state = 491; - this.expression(); - _localctx.sliceStart = true + this.state = 490; + this.match(KipperParser.LeftBracket); + this.state = 494; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 66) & ~0x1f) === 0 && + ((1 << (_la - 66)) & + ((1 << (KipperParser.Identifier - 66)) | + (1 << (KipperParser.IntegerConstant - 66)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | + (1 << (KipperParser.FloatingConstant - 66)) | + (1 << (KipperParser.FStringSingleQuoteStart - 66)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== + 0) + ) { + { + this.state = 491; + this.expression(); + _localctx.sliceStart = true; + } } - } - this.state = 496; - this.match(KipperParser.Colon); - this.state = 500; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 66)) & ~0x1F) === 0 && ((1 << (_la - 66)) & ((1 << (KipperParser.Identifier - 66)) | (1 << (KipperParser.IntegerConstant - 66)) | (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | (1 << (KipperParser.FloatingConstant - 66)) | (1 << (KipperParser.FStringSingleQuoteStart - 66)) | (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== 0)) { - { - this.state = 497; - this.expression(); - _localctx.sliceEnd = true + this.state = 496; + this.match(KipperParser.Colon); + this.state = 500; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 66) & ~0x1f) === 0 && + ((1 << (_la - 66)) & + ((1 << (KipperParser.Identifier - 66)) | + (1 << (KipperParser.IntegerConstant - 66)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 66)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 66)) | + (1 << (KipperParser.FloatingConstant - 66)) | + (1 << (KipperParser.FStringSingleQuoteStart - 66)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 66)))) !== + 0) + ) { + { + this.state = 497; + this.expression(); + _localctx.sliceEnd = true; + } } - } - this.state = 502; - this.match(KipperParser.RightBracket); + this.state = 502; + this.match(KipperParser.RightBracket); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2534,8 +2958,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2547,25 +2970,24 @@ export class KipperParser extends KipperParserBase { try { this.state = 506; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 44, this._ctx) ) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 504; - this.computedPrimaryExpression(0); - } - break; + switch (this.interpreter.adaptivePredict(this._input, 44, this._ctx)) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 504; + this.computedPrimaryExpression(0); + } + break; - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 505; - this.incrementOrDecrementPostfixExpression(); - } - break; + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 505; + this.incrementOrDecrementPostfixExpression(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2573,26 +2995,27 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public incrementOrDecrementPostfixExpression(): IncrementOrDecrementPostfixExpressionContext { - let _localctx: IncrementOrDecrementPostfixExpressionContext = new IncrementOrDecrementPostfixExpressionContext(this._ctx, this.state); + let _localctx: IncrementOrDecrementPostfixExpressionContext = new IncrementOrDecrementPostfixExpressionContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 102, KipperParser.RULE_incrementOrDecrementPostfixExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 508; - this.computedPrimaryExpression(0); - this.state = 509; - this.incrementOrDecrementOperator(); + this.state = 508; + this.computedPrimaryExpression(0); + this.state = 509; + this.incrementOrDecrementOperator(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2600,8 +3023,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2614,50 +3036,49 @@ export class KipperParser extends KipperParserBase { this.state = 514; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.CallFunc: - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 1); - { - this.state = 511; - this.postfixExpression(); - } - break; - case KipperParser.PlusPlus: - case KipperParser.MinusMinus: - this.enterOuterAlt(_localctx, 2); - { - this.state = 512; - this.incrementOrDecrementUnaryExpression(); - } - break; - case KipperParser.Plus: - case KipperParser.Minus: - case KipperParser.Not: - this.enterOuterAlt(_localctx, 3); - { - this.state = 513; - this.operatorModifiedUnaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.CallFunc: + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 1); + { + this.state = 511; + this.postfixExpression(); + } + break; + case KipperParser.PlusPlus: + case KipperParser.MinusMinus: + this.enterOuterAlt(_localctx, 2); + { + this.state = 512; + this.incrementOrDecrementUnaryExpression(); + } + break; + case KipperParser.Plus: + case KipperParser.Minus: + case KipperParser.Not: + this.enterOuterAlt(_localctx, 3); + { + this.state = 513; + this.operatorModifiedUnaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2665,26 +3086,27 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public incrementOrDecrementUnaryExpression(): IncrementOrDecrementUnaryExpressionContext { - let _localctx: IncrementOrDecrementUnaryExpressionContext = new IncrementOrDecrementUnaryExpressionContext(this._ctx, this.state); + let _localctx: IncrementOrDecrementUnaryExpressionContext = new IncrementOrDecrementUnaryExpressionContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 106, KipperParser.RULE_incrementOrDecrementUnaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 516; - this.incrementOrDecrementOperator(); - this.state = 517; - this.postfixExpression(); + this.state = 516; + this.incrementOrDecrementOperator(); + this.state = 517; + this.postfixExpression(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2692,26 +3114,27 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public operatorModifiedUnaryExpression(): OperatorModifiedUnaryExpressionContext { - let _localctx: OperatorModifiedUnaryExpressionContext = new OperatorModifiedUnaryExpressionContext(this._ctx, this.state); + let _localctx: OperatorModifiedUnaryExpressionContext = new OperatorModifiedUnaryExpressionContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 108, KipperParser.RULE_operatorModifiedUnaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 519; - this.unaryOperator(); - this.state = 520; - this.postfixExpression(); + this.state = 519; + this.unaryOperator(); + this.state = 520; + this.postfixExpression(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2719,8 +3142,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2733,21 +3155,20 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 522; - _la = this._input.LA(1); - if (!(_la === KipperParser.PlusPlus || _la === KipperParser.MinusMinus)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 522; + _la = this._input.LA(1); + if (!(_la === KipperParser.PlusPlus || _la === KipperParser.MinusMinus)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2755,8 +3176,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2769,21 +3189,27 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 524; - _la = this._input.LA(1); - if (!(((((_la - 42)) & ~0x1F) === 0 && ((1 << (_la - 42)) & ((1 << (KipperParser.Plus - 42)) | (1 << (KipperParser.Minus - 42)) | (1 << (KipperParser.Not - 42)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 524; + _la = this._input.LA(1); + if ( + !( + ((_la - 42) & ~0x1f) === 0 && + ((1 << (_la - 42)) & + ((1 << (KipperParser.Plus - 42)) | (1 << (KipperParser.Minus - 42)) | (1 << (KipperParser.Not - 42)))) !== + 0 + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2791,8 +3217,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2804,31 +3229,30 @@ export class KipperParser extends KipperParserBase { try { this.state = 531; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 46, this._ctx) ) { - case 1: - _localctx = new PassOnCastOrConvertExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 526; - this.unaryExpression(); - } - break; + switch (this.interpreter.adaptivePredict(this._input, 46, this._ctx)) { + case 1: + _localctx = new PassOnCastOrConvertExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 526; + this.unaryExpression(); + } + break; - case 2: - _localctx = new ActualCastOrConvertExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 527; - this.unaryExpression(); - this.state = 528; - this.match(KipperParser.As); - this.state = 529; - this.typeSpecifierExpression(); - } - break; + case 2: + _localctx = new ActualCastOrConvertExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 527; + this.unaryExpression(); + this.state = 528; + this.match(KipperParser.As); + this.state = 529; + this.typeSpecifierExpression(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2836,8 +3260,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2862,56 +3285,67 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnMultiplicativeExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 534; - this.castOrConvertExpression(); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 541; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 47, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnMultiplicativeExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualMultiplicativeExpressionContext(new MultiplicativeExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_multiplicativeExpression); - this.state = 536; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 537; - _la = this._input.LA(1); - if (!(((((_la - 46)) & ~0x1F) === 0 && ((1 << (_la - 46)) & ((1 << (KipperParser.Star - 46)) | (1 << (KipperParser.Div - 46)) | (1 << (KipperParser.Mod - 46)) | (1 << (KipperParser.PowerTo - 46)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 538; + this.state = 534; this.castOrConvertExpression(); - } - } } - this.state = 543; + this._ctx._stop = this._input.tryLT(-1); + this.state = 541; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 47, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualMultiplicativeExpressionContext( + new MultiplicativeExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_multiplicativeExpression); + this.state = 536; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 537; + _la = this._input.LA(1); + if ( + !( + ((_la - 46) & ~0x1f) === 0 && + ((1 << (_la - 46)) & + ((1 << (KipperParser.Star - 46)) | + (1 << (KipperParser.Div - 46)) | + (1 << (KipperParser.Mod - 46)) | + (1 << (KipperParser.PowerTo - 46)))) !== + 0 + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 538; + this.castOrConvertExpression(); + } + } + } + this.state = 543; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 47, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2919,8 +3353,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -2943,58 +3376,59 @@ export class KipperParser extends KipperParserBase { let _la: number; try { let _alt: number; - this.enterOuterAlt(_localctx, 1); - { - { - _localctx = new PassOnAdditiveExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 545; - this.multiplicativeExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 552; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 48, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + this.enterOuterAlt(_localctx, 1); + { + { + _localctx = new PassOnAdditiveExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualAdditiveExpressionContext(new AdditiveExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_additiveExpression); - this.state = 547; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 548; - _la = this._input.LA(1); - if (!(_la === KipperParser.Plus || _la === KipperParser.Minus)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 549; + this.state = 545; this.multiplicativeExpression(0); - } - } } - this.state = 554; + this._ctx._stop = this._input.tryLT(-1); + this.state = 552; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 48, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualAdditiveExpressionContext( + new AdditiveExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_additiveExpression); + this.state = 547; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 548; + _la = this._input.LA(1); + if (!(_la === KipperParser.Plus || _la === KipperParser.Minus)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 549; + this.multiplicativeExpression(0); + } + } + } + this.state = 554; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 48, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3002,8 +3436,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3028,56 +3461,67 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnRelationalExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 556; - this.additiveExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 563; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 49, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnRelationalExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualRelationalExpressionContext(new RelationalExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_relationalExpression); - this.state = 558; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 559; - _la = this._input.LA(1); - if (!(((((_la - 61)) & ~0x1F) === 0 && ((1 << (_la - 61)) & ((1 << (KipperParser.Less - 61)) | (1 << (KipperParser.LessEqual - 61)) | (1 << (KipperParser.Greater - 61)) | (1 << (KipperParser.GreaterEqual - 61)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 560; + this.state = 556; this.additiveExpression(0); - } - } } - this.state = 565; + this._ctx._stop = this._input.tryLT(-1); + this.state = 563; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 49, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualRelationalExpressionContext( + new RelationalExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_relationalExpression); + this.state = 558; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 559; + _la = this._input.LA(1); + if ( + !( + ((_la - 61) & ~0x1f) === 0 && + ((1 << (_la - 61)) & + ((1 << (KipperParser.Less - 61)) | + (1 << (KipperParser.LessEqual - 61)) | + (1 << (KipperParser.Greater - 61)) | + (1 << (KipperParser.GreaterEqual - 61)))) !== + 0 + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 560; + this.additiveExpression(0); + } + } + } + this.state = 565; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 49, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3085,8 +3529,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3111,56 +3554,57 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnEqualityExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 567; - this.relationalExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 574; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 50, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnEqualityExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualEqualityExpressionContext(new EqualityExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_equalityExpression); - this.state = 569; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 570; - _la = this._input.LA(1); - if (!(_la === KipperParser.Equal || _la === KipperParser.NotEqual)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 571; + this.state = 567; this.relationalExpression(0); - } - } } - this.state = 576; + this._ctx._stop = this._input.tryLT(-1); + this.state = 574; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 50, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualEqualityExpressionContext( + new EqualityExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_equalityExpression); + this.state = 569; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 570; + _la = this._input.LA(1); + if (!(_la === KipperParser.Equal || _la === KipperParser.NotEqual)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 571; + this.relationalExpression(0); + } + } + } + this.state = 576; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 50, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3168,8 +3612,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3193,46 +3636,47 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnLogicalAndExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 578; - this.equalityExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 585; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnLogicalAndExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualLogicalAndExpressionContext(new LogicalAndExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalAndExpression); - this.state = 580; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 581; - this.match(KipperParser.AndAnd); - this.state = 582; + + this.state = 578; this.equalityExpression(0); - } - } } - this.state = 587; + this._ctx._stop = this._input.tryLT(-1); + this.state = 585; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualLogicalAndExpressionContext( + new LogicalAndExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalAndExpression); + this.state = 580; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 581; + this.match(KipperParser.AndAnd); + this.state = 582; + this.equalityExpression(0); + } + } + } + this.state = 587; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3240,8 +3684,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3265,46 +3708,47 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnLogicalOrExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 589; - this.logicalAndExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 596; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnLogicalOrExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualLogicalOrExpressionContext(new LogicalOrExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalOrExpression); - this.state = 591; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 592; - this.match(KipperParser.OrOr); - this.state = 593; + + this.state = 589; this.logicalAndExpression(0); - } - } } - this.state = 598; + this._ctx._stop = this._input.tryLT(-1); + this.state = 596; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualLogicalOrExpressionContext( + new LogicalOrExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalOrExpression); + this.state = 591; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 592; + this.match(KipperParser.OrOr); + this.state = 593; + this.logicalAndExpression(0); + } + } + } + this.state = 598; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3312,8 +3756,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3325,35 +3768,34 @@ export class KipperParser extends KipperParserBase { try { this.state = 606; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 53, this._ctx) ) { - case 1: - _localctx = new PassOnConditionalExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 599; - this.logicalOrExpression(0); - } - break; + switch (this.interpreter.adaptivePredict(this._input, 53, this._ctx)) { + case 1: + _localctx = new PassOnConditionalExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 599; + this.logicalOrExpression(0); + } + break; - case 2: - _localctx = new ActualConditionalExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 600; - this.logicalOrExpression(0); - this.state = 601; - this.match(KipperParser.QuestionMark); - this.state = 602; - this.conditionalExpression(); - this.state = 603; - this.match(KipperParser.Colon); - this.state = 604; - this.conditionalExpression(); - } - break; + case 2: + _localctx = new ActualConditionalExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 600; + this.logicalOrExpression(0); + this.state = 601; + this.match(KipperParser.QuestionMark); + this.state = 602; + this.conditionalExpression(); + this.state = 603; + this.match(KipperParser.Colon); + this.state = 604; + this.conditionalExpression(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3361,8 +3803,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -3374,31 +3815,30 @@ export class KipperParser extends KipperParserBase { try { this.state = 613; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 54, this._ctx) ) { - case 1: - _localctx = new PassOnAssignmentExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 608; - this.conditionalExpression(); - } - break; + switch (this.interpreter.adaptivePredict(this._input, 54, this._ctx)) { + case 1: + _localctx = new PassOnAssignmentExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 608; + this.conditionalExpression(); + } + break; - case 2: - _localctx = new ActualAssignmentExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 609; - this.computedPrimaryExpression(0); - this.state = 610; - this.assignmentOperator(); - this.state = 611; - this.assignmentExpression(); - } - break; + case 2: + _localctx = new ActualAssignmentExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 609; + this.computedPrimaryExpression(0); + this.state = 610; + this.assignmentOperator(); + this.state = 611; + this.assignmentExpression(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3406,8 +3846,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -3420,21 +3859,32 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 615; - _la = this._input.LA(1); - if (!(((((_la - 53)) & ~0x1F) === 0 && ((1 << (_la - 53)) & ((1 << (KipperParser.Assign - 53)) | (1 << (KipperParser.PlusAssign - 53)) | (1 << (KipperParser.MinusAssign - 53)) | (1 << (KipperParser.StarAssign - 53)) | (1 << (KipperParser.DivAssign - 53)) | (1 << (KipperParser.ModAssign - 53)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 615; + _la = this._input.LA(1); + if ( + !( + ((_la - 53) & ~0x1f) === 0 && + ((1 << (_la - 53)) & + ((1 << (KipperParser.Assign - 53)) | + (1 << (KipperParser.PlusAssign - 53)) | + (1 << (KipperParser.MinusAssign - 53)) | + (1 << (KipperParser.StarAssign - 53)) | + (1 << (KipperParser.DivAssign - 53)) | + (1 << (KipperParser.ModAssign - 53)))) !== + 0 + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3442,8 +3892,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -3456,29 +3905,28 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 617; - this.assignmentExpression(); - this.state = 622; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 618; - this.match(KipperParser.Comma); - this.state = 619; - this.assignmentExpression(); - } - } - } - this.state = 624; + this.state = 617; + this.assignmentExpression(); + this.state = 622; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 618; + this.match(KipperParser.Comma); + this.state = 619; + this.assignmentExpression(); + } + } + } + this.state = 624; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3486,8 +3934,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -3499,33 +3946,32 @@ export class KipperParser extends KipperParserBase { try { this.state = 628; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 56, this._ctx) ) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 625; - this.identifierTypeSpecifierExpression(); - } - break; + switch (this.interpreter.adaptivePredict(this._input, 56, this._ctx)) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 625; + this.identifierTypeSpecifierExpression(); + } + break; - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 626; - this.genericTypeSpecifierExpression(); - } - break; + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 626; + this.genericTypeSpecifierExpression(); + } + break; - case 3: - this.enterOuterAlt(_localctx, 3); - { - this.state = 627; - this.typeofTypeSpecifierExpression(); - } - break; + case 3: + this.enterOuterAlt(_localctx, 3); + { + this.state = 627; + this.typeofTypeSpecifierExpression(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3533,24 +3979,25 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public identifierTypeSpecifierExpression(): IdentifierTypeSpecifierExpressionContext { - let _localctx: IdentifierTypeSpecifierExpressionContext = new IdentifierTypeSpecifierExpressionContext(this._ctx, this.state); + let _localctx: IdentifierTypeSpecifierExpressionContext = new IdentifierTypeSpecifierExpressionContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 138, KipperParser.RULE_identifierTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 630; - this.typeSpecifierIdentifier(); + this.state = 630; + this.typeSpecifierIdentifier(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3558,30 +4005,31 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public genericTypeSpecifierExpression(): GenericTypeSpecifierExpressionContext { - let _localctx: GenericTypeSpecifierExpressionContext = new GenericTypeSpecifierExpressionContext(this._ctx, this.state); + let _localctx: GenericTypeSpecifierExpressionContext = new GenericTypeSpecifierExpressionContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 140, KipperParser.RULE_genericTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 632; - this.typeSpecifierIdentifier(); - this.state = 633; - this.match(KipperParser.Less); - this.state = 634; - this.typeSpecifierIdentifier(); - this.state = 635; - this.match(KipperParser.Greater); - } - } - catch (re) { + this.state = 632; + this.typeSpecifierIdentifier(); + this.state = 633; + this.match(KipperParser.Less); + this.state = 634; + this.typeSpecifierIdentifier(); + this.state = 635; + this.match(KipperParser.Greater); + } + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3589,30 +4037,31 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public typeofTypeSpecifierExpression(): TypeofTypeSpecifierExpressionContext { - let _localctx: TypeofTypeSpecifierExpressionContext = new TypeofTypeSpecifierExpressionContext(this._ctx, this.state); + let _localctx: TypeofTypeSpecifierExpressionContext = new TypeofTypeSpecifierExpressionContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 142, KipperParser.RULE_typeofTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 637; - this.match(KipperParser.Typeof); - this.state = 638; - this.match(KipperParser.LeftParen); - this.state = 639; - this.typeSpecifierIdentifier(); - this.state = 640; - this.match(KipperParser.RightParen); + this.state = 637; + this.match(KipperParser.Typeof); + this.state = 638; + this.match(KipperParser.LeftParen); + this.state = 639; + this.typeSpecifierIdentifier(); + this.state = 640; + this.match(KipperParser.RightParen); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3620,8 +4069,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -3634,21 +4082,27 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 642; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0) || _la === KipperParser.Identifier)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 642; + _la = this._input.LA(1); + if ( + !( + ((_la & ~0x1f) === 0 && + ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== + 0) || + _la === KipperParser.Identifier + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3656,8 +4110,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -3665,94 +4118,94 @@ export class KipperParser extends KipperParserBase { public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { switch (ruleIndex) { - case 18: - return this.compoundStatement_sempred(_localctx as CompoundStatementContext, predIndex); + case 18: + return this.compoundStatement_sempred(_localctx as CompoundStatementContext, predIndex); - case 45: - return this.computedPrimaryExpression_sempred(_localctx as ComputedPrimaryExpressionContext, predIndex); + case 45: + return this.computedPrimaryExpression_sempred(_localctx as ComputedPrimaryExpressionContext, predIndex); - case 58: - return this.multiplicativeExpression_sempred(_localctx as MultiplicativeExpressionContext, predIndex); + case 58: + return this.multiplicativeExpression_sempred(_localctx as MultiplicativeExpressionContext, predIndex); - case 59: - return this.additiveExpression_sempred(_localctx as AdditiveExpressionContext, predIndex); + case 59: + return this.additiveExpression_sempred(_localctx as AdditiveExpressionContext, predIndex); - case 60: - return this.relationalExpression_sempred(_localctx as RelationalExpressionContext, predIndex); + case 60: + return this.relationalExpression_sempred(_localctx as RelationalExpressionContext, predIndex); - case 61: - return this.equalityExpression_sempred(_localctx as EqualityExpressionContext, predIndex); + case 61: + return this.equalityExpression_sempred(_localctx as EqualityExpressionContext, predIndex); - case 62: - return this.logicalAndExpression_sempred(_localctx as LogicalAndExpressionContext, predIndex); + case 62: + return this.logicalAndExpression_sempred(_localctx as LogicalAndExpressionContext, predIndex); - case 63: - return this.logicalOrExpression_sempred(_localctx as LogicalOrExpressionContext, predIndex); + case 63: + return this.logicalOrExpression_sempred(_localctx as LogicalOrExpressionContext, predIndex); } return true; } private compoundStatement_sempred(_localctx: CompoundStatementContext, predIndex: number): boolean { switch (predIndex) { - case 0: - return this.notInsideExpressionStatement(); + case 0: + return this.notInsideExpressionStatement(); } return true; } private computedPrimaryExpression_sempred(_localctx: ComputedPrimaryExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 1: - return this.precpred(this._ctx, 5); + case 1: + return this.precpred(this._ctx, 5); - case 2: - return this.precpred(this._ctx, 3); + case 2: + return this.precpred(this._ctx, 3); - case 3: - return this.precpred(this._ctx, 2); + case 3: + return this.precpred(this._ctx, 2); - case 4: - return this.precpred(this._ctx, 1); + case 4: + return this.precpred(this._ctx, 1); } return true; } private multiplicativeExpression_sempred(_localctx: MultiplicativeExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 5: - return this.precpred(this._ctx, 1); + case 5: + return this.precpred(this._ctx, 1); } return true; } private additiveExpression_sempred(_localctx: AdditiveExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 6: - return this.precpred(this._ctx, 1); + case 6: + return this.precpred(this._ctx, 1); } return true; } private relationalExpression_sempred(_localctx: RelationalExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 7: - return this.precpred(this._ctx, 1); + case 7: + return this.precpred(this._ctx, 1); } return true; } private equalityExpression_sempred(_localctx: EqualityExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 8: - return this.precpred(this._ctx, 1); + case 8: + return this.precpred(this._ctx, 1); } return true; } private logicalAndExpression_sempred(_localctx: LogicalAndExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 9: - return this.precpred(this._ctx, 1); + case 9: + return this.precpred(this._ctx, 1); } return true; } private logicalOrExpression_sempred(_localctx: LogicalOrExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 10: - return this.precpred(this._ctx, 1); + case 10: + return this.precpred(this._ctx, 1); } return true; } @@ -3765,8 +4218,8 @@ export class KipperParser extends KipperParserBase { "\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t\x12\x04" + "\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17\t\x17\x04" + "\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B\x04\x1C\t\x1C\x04" + - "\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04\"\t\"\x04#" + - "\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(\x04)\t)\x04*\t*\x04+\t+" + + '\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04"\t"\x04#' + + "\t#\x04$\t$\x04%\t%\x04&\t&\x04'\t'\x04(\t(\x04)\t)\x04*\t*\x04+\t+" + "\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x040\t0\x041\t1\x042\t2\x043\t3\x044" + "\t4\x045\t5\x046\t6\x047\t7\x048\t8\x049\t9\x04:\t:\x04;\t;\x04<\t<\x04" + "=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x04B\tB\x04C\tC\x04D\tD\x04E\tE\x04" + @@ -3793,10 +4246,10 @@ export class KipperParser extends KipperParserBase { "\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" + "\u0150\n\x1F\x03\x1F\x03\x1F\x03 \x03 \x03 \x03 \x03 \x03 \x03 \x03 \x03" + - " \x05 \u015D\n \x03!\x03!\x03!\x03!\x03\"\x03\"\x03#\x03#\x03$\x03$\x03" + - "%\x03%\x05%\u016B\n%\x03&\x03&\x03\'\x03\'\x07\'\u0171\n\'\f\'\x0E\'\u0174" + - "\v\'\x03\'\x03\'\x03\'\x07\'\u0179\n\'\f\'\x0E\'\u017C\v\'\x03\'\x05\'" + - "\u017F\n\'\x03(\x03(\x03(\x05(\u0184\n(\x03(\x05(\u0187\n(\x03)\x03)\x03" + + ' \x05 \u015D\n \x03!\x03!\x03!\x03!\x03"\x03"\x03#\x03#\x03$\x03$\x03' + + "%\x03%\x05%\u016B\n%\x03&\x03&\x03'\x03'\x07'\u0171\n'\f'\x0E'\u0174" + + "\v'\x03'\x03'\x03'\x07'\u0179\n'\f'\x0E'\u017C\v'\x03'\x05'" + + "\u017F\n'\x03(\x03(\x03(\x05(\u0184\n(\x03(\x05(\u0187\n(\x03)\x03)\x03" + ")\x05)\u018C\n)\x03)\x05)\u018F\n)\x03*\x03*\x03+\x03+\x03+\x03+\x07+" + "\u0197\n+\f+\x0E+\u019A\v+\x05+\u019C\n+\x03+\x05+\u019F\n+\x03+\x03+" + "\x03,\x03,\x03,\x03,\x07,\u01A7\n,\f,\x0E,\u01AA\v,\x05,\u01AC\n,\x03" + @@ -3818,7 +4271,7 @@ export class KipperParser extends KipperParserBase { "E\u026F\nE\fE\x0EE\u0272\vE\x03F\x03F\x03F\x05F\u0277\nF\x03G\x03G\x03" + "H\x03H\x03H\x03H\x03H\x03I\x03I\x03I\x03I\x03I\x03J\x03J\x03J\x02\x02" + "\t\\vxz|~\x80K\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" + + '\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\x028\x02:\x02<\x02>\x02@\x02" + "B\x02D\x02F\x02H\x02J\x02L\x02N\x02P\x02R\x02T\x02V\x02X\x02Z\x02\\\x02" + "^\x02`\x02b\x02d\x02f\x02h\x02j\x02l\x02n\x02p\x02r\x02t\x02v\x02x\x02" + @@ -3831,7 +4284,7 @@ export class KipperParser extends KipperParserBase { "\x02\x0E\xB2\x03\x02\x02\x02\x10\xB5\x03\x02\x02\x02\x12\xB7\x03\x02\x02" + "\x02\x14\xBE\x03\x02\x02\x02\x16\xC0\x03\x02\x02\x02\x18\xC2\x03\x02\x02" + "\x02\x1A\xC4\x03\x02\x02\x02\x1C\xD0\x03\x02\x02\x02\x1E\xD8\x03\x02\x02" + - "\x02 \xDC\x03\x02\x02\x02\"\xE1\x03\x02\x02\x02$\xEC\x03\x02\x02\x02&" + + '\x02 \xDC\x03\x02\x02\x02"\xE1\x03\x02\x02\x02$\xEC\x03\x02\x02\x02&' + "\xEE\x03\x02\x02\x02(\xF5\x03\x02\x02\x02*\xFC\x03\x02\x02\x02,\xFE\x03" + "\x02\x02\x02.\u0107\x03\x02\x02\x020\u011C\x03\x02\x02\x022\u0121\x03" + "\x02\x02\x024\u0123\x03\x02\x02\x026\u013C\x03\x02\x02\x028\u0142\x03" + @@ -3857,11 +4310,11 @@ export class KipperParser extends KipperParserBase { "\x02\x02\x9D\x05\x03\x02\x02\x02\x9E\x9F\x05\b\x05\x02\x9F\x07\x03\x02" + "\x02\x02\xA0\xA2\x05\n\x06\x02\xA1\xA0\x03\x02\x02\x02\xA2\xA3\x03\x02" + "\x02\x02\xA3\xA1\x03\x02\x02\x02\xA3\xA4\x03\x02\x02\x02\xA4\t\x03\x02" + - "\x02\x02\xA5\xA9\x05$\x13\x02\xA6\xA9\x05\f\x07\x02\xA7\xA9\x07\"\x02" + + '\x02\x02\xA5\xA9\x05$\x13\x02\xA6\xA9\x05\f\x07\x02\xA7\xA9\x07"\x02' + "\x02\xA8\xA5\x03\x02\x02\x02\xA8\xA6\x03\x02\x02\x02\xA8\xA7\x03\x02\x02" + - "\x02\xA9\v\x03\x02\x02\x02\xAA\xAB\x05\x0E\b\x02\xAB\xAC\x07\"\x02\x02" + + '\x02\xA9\v\x03\x02\x02\x02\xAA\xAB\x05\x0E\b\x02\xAB\xAC\x07"\x02\x02' + "\xAC\xB1\x03\x02\x02\x02\xAD\xB1\x05\x1A\x0E\x02\xAE\xB1\x05 \x11\x02" + - "\xAF\xB1\x05\"\x12\x02\xB0\xAA\x03\x02\x02\x02\xB0\xAD\x03\x02\x02\x02" + + '\xAF\xB1\x05"\x12\x02\xB0\xAA\x03\x02\x02\x02\xB0\xAD\x03\x02\x02\x02' + "\xB0\xAE\x03\x02\x02\x02\xB0\xAF\x03\x02\x02\x02\xB1\r\x03\x02\x02\x02" + "\xB2\xB3\x05\x10\t\x02\xB3\xB4\x05\x12\n\x02\xB4\x0F\x03\x02\x02\x02\xB5" + "\xB6\t\x02\x02\x02\xB6\x11\x03\x02\x02\x02\xB7\xB8\x05\x16\f\x02\xB8\xB9" + @@ -3887,8 +4340,8 @@ export class KipperParser extends KipperParserBase { "\x02\xEC\xEA\x03\x02\x02\x02\xEC\xEB\x03\x02\x02\x02\xED%\x03\x02\x02" + "\x02\xEE\xEF\x06\x14\x02\x02\xEF\xF1\x07*\x02\x02\xF0\xF2\x05\b\x05\x02" + "\xF1\xF0\x03\x02\x02\x02\xF1\xF2\x03\x02\x02\x02\xF2\xF3\x03\x02\x02\x02" + - "\xF3\xF4\x07+\x02\x02\xF4\'\x03\x02\x02\x02\xF5\xF6\b\x15\x01\x02\xF6" + - "\xF7\x05\x88E\x02\xF7\xF8\x07\"\x02\x02\xF8\xF9\b\x15\x01\x02\xF9)\x03" + + "\xF3\xF4\x07+\x02\x02\xF4'\x03\x02\x02\x02\xF5\xF6\b\x15\x01\x02\xF6" + + '\xF7\x05\x88E\x02\xF7\xF8\x07"\x02\x02\xF8\xF9\b\x15\x01\x02\xF9)\x03' + "\x02\x02\x02\xFA\xFD\x05,\x17\x02\xFB\xFD\x05.\x18\x02\xFC\xFA\x03\x02" + "\x02\x02\xFC\xFB\x03\x02\x02\x02\xFD+\x03\x02\x02\x02\xFE\xFF\x07\x11" + "\x02\x02\xFF\u0100\x07%\x02\x02\u0100\u0101\x05\x88E\x02\u0101\u0102\x07" + @@ -3910,10 +4363,10 @@ export class KipperParser extends KipperParserBase { "\x05\x0E\b\x02\u0126\u0128\x05\x88E\x02\u0127\u0125\x03\x02\x02\x02\u0127" + "\u0126\x03\x02\x02\x02\u0128\u0129\x03\x02\x02\x02\u0129\u012A\b\x1B\x01" + "\x02\u012A\u012C\x03\x02\x02\x02\u012B\u0127\x03\x02\x02\x02\u012B\u012C" + - "\x03\x02\x02\x02\u012C\u012D\x03\x02\x02\x02\u012D\u0131\x07\"\x02\x02" + + '\x03\x02\x02\x02\u012C\u012D\x03\x02\x02\x02\u012D\u0131\x07"\x02\x02' + "\u012E\u012F\x05\x88E\x02\u012F\u0130\b\x1B\x01\x02\u0130\u0132\x03\x02" + "\x02\x02\u0131\u012E\x03\x02\x02\x02\u0131\u0132\x03\x02\x02\x02\u0132" + - "\u0133\x03\x02\x02\x02\u0133\u0137\x07\"\x02\x02\u0134\u0135\x05\x88E" + + '\u0133\x03\x02\x02\x02\u0133\u0137\x07"\x02\x02\u0134\u0135\x05\x88E' + "\x02\u0135\u0136\b\x1B\x01\x02\u0136\u0138\x03\x02\x02\x02\u0137\u0134" + "\x03\x02\x02\x02\u0137\u0138\x03\x02\x02\x02\u0138\u0139\x03\x02\x02\x02" + "\u0139\u013A\x07&\x02\x02\u013A\u013B\x05$\x13\x02\u013B5\x03\x02\x02" + @@ -3921,13 +4374,13 @@ export class KipperParser extends KipperParserBase { "\x05\x88E\x02\u013F\u0140\x07&\x02\x02\u0140\u0141\x05$\x13\x02\u0141" + "7\x03\x02\x02\x02\u0142\u0143\x07\x0F\x02\x02\u0143\u0144\x05$\x13\x02" + "\u0144\u0145\x07\x10\x02\x02\u0145\u0146\x07%\x02\x02\u0146\u0147\x05" + - "\x88E\x02\u0147\u0148\x07&\x02\x02\u0148\u0149\x07\"\x02\x02\u01499\x03" + - "\x02\x02\x02\u014A\u014B\t\x03\x02\x02\u014B\u014C\x07\"\x02\x02\u014C" + + '\x88E\x02\u0147\u0148\x07&\x02\x02\u0148\u0149\x07"\x02\x02\u01499\x03' + + '\x02\x02\x02\u014A\u014B\t\x03\x02\x02\u014B\u014C\x07"\x02\x02\u014C' + ";\x03\x02\x02\x02\u014D\u014F\x07\x16\x02\x02\u014E\u0150\x05\x88E\x02" + "\u014F\u014E\x03\x02\x02\x02\u014F\u0150\x03\x02\x02\x02\u0150\u0151\x03" + - "\x02\x02\x02\u0151\u0152\x07\"\x02\x02\u0152=\x03\x02\x02\x02\u0153\u015D" + + '\x02\x02\x02\u0151\u0152\x07"\x02\x02\u0152=\x03\x02\x02\x02\u0153\u015D' + "\x05@!\x02\u0154\u015D\x05T+\x02\u0155\u015D\x05V,\x02\u0156\u015D\x05" + - "B\"\x02\u0157\u015D\x05D#\x02\u0158\u015D\x05J&\x02\u0159\u015D\x05L\'" + + "B\"\x02\u0157\u015D\x05D#\x02\u0158\u015D\x05J&\x02\u0159\u015D\x05L'" + "\x02\u015A\u015D\x05R*\x02\u015B\u015D\x05Z.\x02\u015C\u0153\x03\x02\x02" + "\x02\u015C\u0154\x03\x02\x02\x02\u015C\u0155\x03\x02\x02\x02\u015C\u0156" + "\x03\x02\x02\x02\u015C\u0157\x03\x02\x02\x02\u015C\u0158\x03\x02\x02\x02" + @@ -3954,7 +4407,7 @@ export class KipperParser extends KipperParserBase { "\u018B\u018A\x03\x02\x02\x02\u018B\u018C\x03\x02\x02\x02\u018C\u018D\x03" + "\x02\x02\x02\u018D\u018F\x07)\x02\x02\u018E\u0188\x03\x02\x02\x02\u018E" + "\u0189\x03\x02\x02\x02\u018FQ\x03\x02\x02\x02\u0190\u0191\t\x06\x02\x02" + - "\u0191S\x03\x02\x02\x02\u0192\u019B\x07\'\x02\x02\u0193\u0198\x05\x88" + + "\u0191S\x03\x02\x02\x02\u0192\u019B\x07'\x02\x02\u0193\u0198\x05\x88" + "E\x02\u0194\u0195\x07!\x02\x02\u0195\u0197\x05\x88E\x02\u0196\u0194\x03" + "\x02\x02\x02\u0197\u019A\x03\x02\x02\x02\u0198\u0196\x03\x02\x02\x02\u0198" + "\u0199\x03\x02\x02\x02\u0199\u019C\x03\x02\x02\x02\u019A\u0198\x03\x02" + @@ -3991,8 +4444,8 @@ export class KipperParser extends KipperParserBase { "\u01E4\x03\x02\x02\x02\u01E2\u01E0\x03\x02\x02\x02\u01E2\u01E3\x03\x02" + "\x02\x02\u01E3_\x03\x02\x02\x02\u01E4\u01E2\x03\x02\x02\x02\u01E5\u01E6" + "\x07C\x02\x02\u01E6\u01E7\x05F$\x02\u01E7a\x03\x02\x02\x02\u01E8\u01E9" + - "\x07\'\x02\x02\u01E9\u01EA\x05\x88E\x02\u01EA\u01EB\x07(\x02\x02\u01EB" + - "c\x03\x02\x02\x02\u01EC\u01F0\x07\'\x02\x02\u01ED\u01EE\x05\x88E\x02\u01EE" + + "\x07'\x02\x02\u01E9\u01EA\x05\x88E\x02\u01EA\u01EB\x07(\x02\x02\u01EB" + + "c\x03\x02\x02\x02\u01EC\u01F0\x07'\x02\x02\u01ED\u01EE\x05\x88E\x02\u01EE" + "\u01EF\b3\x01\x02\u01EF\u01F1\x03\x02\x02\x02\u01F0\u01ED\x03\x02\x02" + "\x02\u01F0\u01F1\x03\x02\x02\x02\u01F1\u01F2\x03\x02\x02\x02\u01F2\u01F6" + "\x07$\x02\x02\u01F3\u01F4\x05\x88E\x02\u01F4\u01F5\b3\x01\x02\u01F5\u01F7" + @@ -4061,10 +4514,7 @@ export class KipperParser extends KipperParserBase { "\u01F0\u01F6\u01FC\u0204\u0215\u021F\u022A\u0235\u0240\u024B\u0256\u0260" + "\u0267\u0270\u0276"; public static readonly _serializedATN: string = Utils.join( - [ - KipperParser._serializedATNSegment0, - KipperParser._serializedATNSegment1, - ], + [KipperParser._serializedATNSegment0, KipperParser._serializedATNSegment1], "", ); public static __ATN: ATN; @@ -4075,11 +4525,12 @@ export class KipperParser extends KipperParserBase { return KipperParser.__ATN; } - } export class CompilationUnitContext extends KipperParserRuleContext { - public EOF(): TerminalNode { return this.getToken(KipperParser.EOF, 0); } + public EOF(): TerminalNode { + return this.getToken(KipperParser.EOF, 0); + } public translationUnit(): TranslationUnitContext | undefined { return this.tryGetRuleContext(0, TranslationUnitContext); } @@ -4087,7 +4538,9 @@ export class CompilationUnitContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_compilationUnit; } + public get ruleIndex(): number { + return KipperParser.RULE_compilationUnit; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterCompilationUnit) { @@ -4110,7 +4563,6 @@ export class CompilationUnitContext extends KipperParserRuleContext { } } - export class TranslationUnitContext extends KipperParserRuleContext { public externalItem(): ExternalItemContext[]; public externalItem(i: number): ExternalItemContext; @@ -4125,7 +4577,9 @@ export class TranslationUnitContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_translationUnit; } + public get ruleIndex(): number { + return KipperParser.RULE_translationUnit; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTranslationUnit) { @@ -4148,13 +4602,14 @@ export class TranslationUnitContext extends KipperParserRuleContext { } } - export class ExternalItemContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_externalItem; } + public get ruleIndex(): number { + return KipperParser.RULE_externalItem; + } public copyFrom(ctx: ExternalItemContext): void { super.copyFrom(ctx); } @@ -4189,7 +4644,6 @@ export class ExternalBlockItemContext extends ExternalItemContext { } } - export class BlockItemListContext extends KipperParserRuleContext { public blockItem(): BlockItemContext[]; public blockItem(i: number): BlockItemContext; @@ -4204,7 +4658,9 @@ export class BlockItemListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_blockItemList; } + public get ruleIndex(): number { + return KipperParser.RULE_blockItemList; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBlockItemList) { @@ -4227,7 +4683,6 @@ export class BlockItemListContext extends KipperParserRuleContext { } } - export class BlockItemContext extends KipperParserRuleContext { public statement(): StatementContext | undefined { return this.tryGetRuleContext(0, StatementContext); @@ -4235,12 +4690,16 @@ export class BlockItemContext extends KipperParserRuleContext { public declaration(): DeclarationContext | undefined { return this.tryGetRuleContext(0, DeclarationContext); } - public SemiColon(): TerminalNode | undefined { return this.tryGetToken(KipperParser.SemiColon, 0); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_blockItem; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBlockItem) { @@ -4263,12 +4722,13 @@ export class BlockItemContext extends KipperParserRuleContext { } } - 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 SemiColon(): TerminalNode | undefined { + return this.tryGetToken(KipperParser.SemiColon, 0); + } public functionDeclaration(): FunctionDeclarationContext | undefined { return this.tryGetRuleContext(0, FunctionDeclarationContext); } @@ -4282,7 +4742,9 @@ export class DeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_declaration; } + public get ruleIndex(): number { + return KipperParser.RULE_declaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDeclaration) { @@ -4305,7 +4767,6 @@ export class DeclarationContext extends KipperParserRuleContext { } } - export class VariableDeclarationContext extends KipperParserRuleContext { public storageTypeSpecifier(): StorageTypeSpecifierContext { return this.getRuleContext(0, StorageTypeSpecifierContext); @@ -4317,7 +4778,9 @@ export class VariableDeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_variableDeclaration; } + public get ruleIndex(): number { + return KipperParser.RULE_variableDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterVariableDeclaration) { @@ -4340,15 +4803,20 @@ export class VariableDeclarationContext extends KipperParserRuleContext { } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_storageTypeSpecifier; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStorageTypeSpecifier) { @@ -4371,16 +4839,19 @@ export class StorageTypeSpecifierContext extends KipperParserRuleContext { } } - export class InitDeclaratorContext extends KipperParserRuleContext { public declarator(): DeclaratorContext { return this.getRuleContext(0, DeclaratorContext); } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } + 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 Assign(): TerminalNode | undefined { + return this.tryGetToken(KipperParser.Assign, 0); + } public initializer(): InitializerContext | undefined { return this.tryGetRuleContext(0, InitializerContext); } @@ -4388,7 +4859,9 @@ export class InitDeclaratorContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_initDeclarator; } + public get ruleIndex(): number { + return KipperParser.RULE_initDeclarator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterInitDeclarator) { @@ -4411,7 +4884,6 @@ export class InitDeclaratorContext extends KipperParserRuleContext { } } - export class InitializerContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext { return this.getRuleContext(0, AssignmentExpressionContext); @@ -4420,7 +4892,9 @@ export class InitializerContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_initializer; } + public get ruleIndex(): number { + return KipperParser.RULE_initializer; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterInitializer) { @@ -4443,7 +4917,6 @@ export class InitializerContext extends KipperParserRuleContext { } } - export class DeclaratorContext extends KipperParserRuleContext { public directDeclarator(): DirectDeclaratorContext { return this.getRuleContext(0, DirectDeclaratorContext); @@ -4452,7 +4925,9 @@ export class DeclaratorContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_declarator; } + public get ruleIndex(): number { + return KipperParser.RULE_declarator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDeclarator) { @@ -4475,14 +4950,17 @@ export class DeclaratorContext extends KipperParserRuleContext { } } - export class DirectDeclaratorContext extends KipperParserRuleContext { - public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_directDeclarator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDirectDeclarator) { @@ -4505,15 +4983,22 @@ export class DirectDeclaratorContext extends KipperParserRuleContext { } } - export class FunctionDeclarationContext extends KipperParserRuleContext { - public DefFunc(): TerminalNode { return this.getToken(KipperParser.DefFunc, 0); } + 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 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); } @@ -4527,7 +5012,9 @@ export class FunctionDeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_functionDeclaration; } + public get ruleIndex(): number { + return KipperParser.RULE_functionDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFunctionDeclaration) { @@ -4550,7 +5037,6 @@ export class FunctionDeclarationContext extends KipperParserRuleContext { } } - export class ParameterListContext extends KipperParserRuleContext { public parameterDeclaration(): ParameterDeclarationContext[]; public parameterDeclaration(i: number): ParameterDeclarationContext; @@ -4574,7 +5060,9 @@ export class ParameterListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_parameterList; } + public get ruleIndex(): number { + return KipperParser.RULE_parameterList; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterParameterList) { @@ -4597,12 +5085,13 @@ export class ParameterListContext extends KipperParserRuleContext { } } - export class ParameterDeclarationContext extends KipperParserRuleContext { public declarator(): DeclaratorContext { return this.getRuleContext(0, DeclaratorContext); } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } + public Colon(): TerminalNode { + return this.getToken(KipperParser.Colon, 0); + } public typeSpecifierExpression(): TypeSpecifierExpressionContext { return this.getRuleContext(0, TypeSpecifierExpressionContext); } @@ -4610,7 +5099,9 @@ export class ParameterDeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_parameterDeclaration; } + public get ruleIndex(): number { + return KipperParser.RULE_parameterDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterParameterDeclaration) { @@ -4633,17 +5124,26 @@ export class ParameterDeclarationContext extends KipperParserRuleContext { } } - export class InterfaceDeclarationContext extends KipperParserRuleContext { - public Interface(): TerminalNode { return this.getToken(KipperParser.Interface, 0); } - public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } - public LeftBrace(): TerminalNode { return this.getToken(KipperParser.LeftBrace, 0); } - public RightBrace(): TerminalNode { return this.getToken(KipperParser.RightBrace, 0); } + public Interface(): TerminalNode { + return this.getToken(KipperParser.Interface, 0); + } + public Identifier(): TerminalNode { + return this.getToken(KipperParser.Identifier, 0); + } + 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_interfaceDeclaration; } + public get ruleIndex(): number { + return KipperParser.RULE_interfaceDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterInterfaceDeclaration) { @@ -4666,17 +5166,26 @@ 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); } - public LeftBrace(): TerminalNode { return this.getToken(KipperParser.LeftBrace, 0); } - public RightBrace(): TerminalNode { return this.getToken(KipperParser.RightBrace, 0); } + public Class(): TerminalNode { + return this.getToken(KipperParser.Class, 0); + } + public Identifier(): TerminalNode { + return this.getToken(KipperParser.Identifier, 0); + } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_classDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterClassDeclaration) { @@ -4699,7 +5208,6 @@ export class ClassDeclarationContext extends KipperParserRuleContext { } } - export class StatementContext extends KipperParserRuleContext { public expressionStatement(): ExpressionStatementContext | undefined { return this.tryGetRuleContext(0, ExpressionStatementContext); @@ -4723,7 +5231,9 @@ export class StatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_statement; } + public get ruleIndex(): number { + return KipperParser.RULE_statement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStatement) { @@ -4746,10 +5256,13 @@ export class StatementContext extends KipperParserRuleContext { } } - export class CompoundStatementContext extends KipperParserRuleContext { - public LeftBrace(): TerminalNode { return this.getToken(KipperParser.LeftBrace, 0); } - public RightBrace(): TerminalNode { return this.getToken(KipperParser.RightBrace, 0); } + 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); } @@ -4757,7 +5270,9 @@ export class CompoundStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_compoundStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_compoundStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterCompoundStatement) { @@ -4780,17 +5295,20 @@ export class CompoundStatementContext extends KipperParserRuleContext { } } - export class ExpressionStatementContext extends KipperParserRuleContext { public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } - public SemiColon(): TerminalNode { return this.getToken(KipperParser.SemiColon, 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_expressionStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_expressionStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterExpressionStatement) { @@ -4813,7 +5331,6 @@ export class ExpressionStatementContext extends KipperParserRuleContext { } } - export class SelectionStatementContext extends KipperParserRuleContext { public ifStatement(): IfStatementContext | undefined { return this.tryGetRuleContext(0, IfStatementContext); @@ -4825,7 +5342,9 @@ export class SelectionStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_selectionStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_selectionStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSelectionStatement) { @@ -4848,14 +5367,19 @@ export class SelectionStatementContext extends KipperParserRuleContext { } } - export class IfStatementContext extends KipperParserRuleContext { - public If(): TerminalNode { return this.getToken(KipperParser.If, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } + 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 RightParen(): TerminalNode { + return this.getToken(KipperParser.RightParen, 0); + } public statement(): StatementContext[]; public statement(i: number): StatementContext; public statement(i?: number): StatementContext | StatementContext[] { @@ -4865,12 +5389,16 @@ export class IfStatementContext extends KipperParserRuleContext { return this.getRuleContext(i, StatementContext); } } - public Else(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Else, 0); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_ifStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIfStatement) { @@ -4893,16 +5421,25 @@ export class IfStatementContext extends KipperParserRuleContext { } } - export class SwitchStatementContext extends KipperParserRuleContext { - public Switch(): TerminalNode { return this.getToken(KipperParser.Switch, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } + 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 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[] { @@ -4916,7 +5453,9 @@ export class SwitchStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_switchStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_switchStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSwitchStatement) { @@ -4939,22 +5478,29 @@ export class SwitchStatementContext extends KipperParserRuleContext { } } - export class SwitchLabeledStatementContext extends KipperParserRuleContext { - public Case(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Case, 0); } + 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 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_switchLabeledStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSwitchLabeledStatement) { @@ -4977,7 +5523,6 @@ export class SwitchLabeledStatementContext extends KipperParserRuleContext { } } - export class IterationStatementContext extends KipperParserRuleContext { public forLoopIterationStatement(): ForLoopIterationStatementContext | undefined { return this.tryGetRuleContext(0, ForLoopIterationStatementContext); @@ -4992,7 +5537,9 @@ export class IterationStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_iterationStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_iterationStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIterationStatement) { @@ -5015,13 +5562,16 @@ export class IterationStatementContext extends KipperParserRuleContext { } } - 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 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[] { @@ -5031,7 +5581,9 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { return this.getToken(KipperParser.SemiColon, i); } } - public RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } + public RightParen(): TerminalNode { + return this.getToken(KipperParser.RightParen, 0); + } public statement(): StatementContext { return this.getRuleContext(0, StatementContext); } @@ -5051,7 +5603,9 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_forLoopIterationStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_forLoopIterationStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterForLoopIterationStatement) { @@ -5074,14 +5628,19 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { } } - export class WhileLoopIterationStatementContext extends KipperParserRuleContext { - public While(): TerminalNode { return this.getToken(KipperParser.While, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } + 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 RightParen(): TerminalNode { + return this.getToken(KipperParser.RightParen, 0); + } public statement(): StatementContext { return this.getRuleContext(0, StatementContext); } @@ -5089,7 +5648,9 @@ export class WhileLoopIterationStatementContext extends KipperParserRuleContext super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_whileLoopIterationStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_whileLoopIterationStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterWhileLoopIterationStatement) { @@ -5112,24 +5673,35 @@ export class WhileLoopIterationStatementContext extends KipperParserRuleContext } } - export class DoWhileLoopIterationStatementContext extends KipperParserRuleContext { - public Do(): TerminalNode { return this.getToken(KipperParser.Do, 0); } + 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 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_doWhileLoopIterationStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDoWhileLoopIterationStatement) { @@ -5152,16 +5724,23 @@ export class DoWhileLoopIterationStatementContext extends KipperParserRuleContex } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_jumpStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterJumpStatement) { @@ -5184,10 +5763,13 @@ export class JumpStatementContext extends KipperParserRuleContext { } } - export class ReturnStatementContext extends KipperParserRuleContext { - public Return(): TerminalNode { return this.getToken(KipperParser.Return, 0); } - public SemiColon(): TerminalNode { return this.getToken(KipperParser.SemiColon, 0); } + 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); } @@ -5195,7 +5777,9 @@ export class ReturnStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_returnStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_returnStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterReturnStatement) { @@ -5218,7 +5802,6 @@ export class ReturnStatementContext extends KipperParserRuleContext { } } - export class PrimaryExpressionContext extends KipperParserRuleContext { public tangledPrimaryExpression(): TangledPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, TangledPrimaryExpressionContext); @@ -5251,7 +5834,9 @@ export class PrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_primaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_primaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPrimaryExpression) { @@ -5274,18 +5859,23 @@ export class PrimaryExpressionContext extends KipperParserRuleContext { } } - export class TangledPrimaryExpressionContext extends KipperParserRuleContext { - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 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 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; } + public get ruleIndex(): number { + return KipperParser.RULE_tangledPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTangledPrimaryExpression) { @@ -5308,15 +5898,20 @@ export class TangledPrimaryExpressionContext extends KipperParserRuleContext { } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_boolPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBoolPrimaryExpression) { @@ -5339,7 +5934,6 @@ export class BoolPrimaryExpressionContext extends KipperParserRuleContext { } } - export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext { public identifier(): IdentifierContext { return this.getRuleContext(0, IdentifierContext); @@ -5348,7 +5942,9 @@ export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_identifierPrimaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_identifierPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierPrimaryExpression) { @@ -5371,14 +5967,17 @@ export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext } } - export class IdentifierContext extends KipperParserRuleContext { - public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_identifier; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifier) { @@ -5401,7 +6000,6 @@ export class IdentifierContext extends KipperParserRuleContext { } } - export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRuleContext { public identifier(): IdentifierContext | undefined { return this.tryGetRuleContext(0, IdentifierContext); @@ -5413,7 +6011,9 @@ export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRule super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_identifierOrStringPrimaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_identifierOrStringPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierOrStringPrimaryExpression) { @@ -5436,15 +6036,20 @@ export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRule } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_stringPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStringPrimaryExpression) { @@ -5467,10 +6072,13 @@ export class StringPrimaryExpressionContext extends KipperParserRuleContext { } } - 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 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[] { @@ -5480,8 +6088,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 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[] { @@ -5495,7 +6107,9 @@ export class FStringPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_fStringPrimaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_fStringPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringPrimaryExpression) { @@ -5518,11 +6132,16 @@ export class FStringPrimaryExpressionContext extends KipperParserRuleContext { } } - 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 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); } @@ -5530,7 +6149,9 @@ export class FStringSingleQuoteAtomContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_fStringSingleQuoteAtom; } + public get ruleIndex(): number { + return KipperParser.RULE_fStringSingleQuoteAtom; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringSingleQuoteAtom) { @@ -5553,11 +6174,16 @@ export class FStringSingleQuoteAtomContext extends KipperParserRuleContext { } } - 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 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); } @@ -5565,7 +6191,9 @@ export class FStringDoubleQuoteAtomContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_fStringDoubleQuoteAtom; } + public get ruleIndex(): number { + return KipperParser.RULE_fStringDoubleQuoteAtom; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringDoubleQuoteAtom) { @@ -5588,15 +6216,20 @@ export class FStringDoubleQuoteAtomContext extends KipperParserRuleContext { } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_numberPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterNumberPrimaryExpression) { @@ -5619,10 +6252,13 @@ export class NumberPrimaryExpressionContext extends KipperParserRuleContext { } } - export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { - public LeftBracket(): TerminalNode { return this.getToken(KipperParser.LeftBracket, 0); } - public RightBracket(): TerminalNode { return this.getToken(KipperParser.RightBracket, 0); } + 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[] { @@ -5645,7 +6281,9 @@ export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_arrayPrimaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_arrayPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterArrayPrimaryExpression) { @@ -5668,10 +6306,13 @@ export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { } } - export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { - public LeftBrace(): TerminalNode { return this.getToken(KipperParser.LeftBrace, 0); } - public RightBrace(): TerminalNode { return this.getToken(KipperParser.RightBrace, 0); } + 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[] { @@ -5694,7 +6335,9 @@ export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_objectPrimaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_objectPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterObjectPrimaryExpression) { @@ -5717,12 +6360,13 @@ export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { } } - export class ObjectPropertyContext extends KipperParserRuleContext { public identifierOrStringPrimaryExpression(): IdentifierOrStringPrimaryExpressionContext { return this.getRuleContext(0, IdentifierOrStringPrimaryExpressionContext); } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } + public Colon(): TerminalNode { + return this.getToken(KipperParser.Colon, 0); + } public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } @@ -5730,7 +6374,9 @@ export class ObjectPropertyContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_objectProperty; } + public get ruleIndex(): number { + return KipperParser.RULE_objectProperty; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterObjectProperty) { @@ -5753,16 +6399,23 @@ export class ObjectPropertyContext extends KipperParserRuleContext { } } - export class VoidOrNullOrUndefinedPrimaryExpressionContext extends KipperParserRuleContext { - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_voidOrNullOrUndefinedPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterVoidOrNullOrUndefinedPrimaryExpression) { @@ -5785,14 +6438,15 @@ 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 get ruleIndex(): number { + return KipperParser.RULE_computedPrimaryExpression; + } public copyFrom(ctx: ComputedPrimaryExpressionContext): void { super.copyFrom(ctx); this._labelASTKind = ctx._labelASTKind; @@ -5831,8 +6485,12 @@ export class FunctionCallExpressionContext extends ComputedPrimaryExpressionCont 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 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); } @@ -5862,12 +6520,18 @@ export class FunctionCallExpressionContext extends ComputedPrimaryExpressionCont } } export class ExplicitCallFunctionCallExpressionContext extends ComputedPrimaryExpressionContext { - public CallFunc(): TerminalNode { return this.getToken(KipperParser.CallFunc, 0); } + 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 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); } @@ -5993,7 +6657,6 @@ export class SliceNotationMemberAccessExpressionContext extends ComputedPrimaryE } } - export class ArgumentExpressionListContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext[]; public assignmentExpression(i: number): AssignmentExpressionContext; @@ -6017,7 +6680,9 @@ export class ArgumentExpressionListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_argumentExpressionList; } + public get ruleIndex(): number { + return KipperParser.RULE_argumentExpressionList; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterArgumentExpressionList) { @@ -6040,9 +6705,10 @@ export class ArgumentExpressionListContext extends KipperParserRuleContext { } } - export class DotNotationContext extends KipperParserRuleContext { - public Dot(): TerminalNode { return this.getToken(KipperParser.Dot, 0); } + public Dot(): TerminalNode { + return this.getToken(KipperParser.Dot, 0); + } public identifier(): IdentifierContext { return this.getRuleContext(0, IdentifierContext); } @@ -6050,7 +6716,9 @@ export class DotNotationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_dotNotation; } + public get ruleIndex(): number { + return KipperParser.RULE_dotNotation; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDotNotation) { @@ -6073,18 +6741,23 @@ export class DotNotationContext extends KipperParserRuleContext { } } - export class BracketNotationContext extends KipperParserRuleContext { - public LeftBracket(): TerminalNode { return this.getToken(KipperParser.LeftBracket, 0); } + 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_bracketNotation; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBracketNotation) { @@ -6107,13 +6780,18 @@ 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 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[] { @@ -6127,7 +6805,9 @@ export class SliceNotationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_sliceNotation; } + public get ruleIndex(): number { + return KipperParser.RULE_sliceNotation; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSliceNotation) { @@ -6150,7 +6830,6 @@ export class SliceNotationContext extends KipperParserRuleContext { } } - export class PostfixExpressionContext extends KipperParserRuleContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, ComputedPrimaryExpressionContext); @@ -6162,7 +6841,9 @@ export class PostfixExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_postfixExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_postfixExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPostfixExpression) { @@ -6185,7 +6866,6 @@ export class PostfixExpressionContext extends KipperParserRuleContext { } } - export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRuleContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext { return this.getRuleContext(0, ComputedPrimaryExpressionContext); @@ -6197,7 +6877,9 @@ export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRu super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementPostfixExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_incrementOrDecrementPostfixExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementPostfixExpression) { @@ -6220,7 +6902,6 @@ export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRu } } - export class UnaryExpressionContext extends KipperParserRuleContext { public postfixExpression(): PostfixExpressionContext | undefined { return this.tryGetRuleContext(0, PostfixExpressionContext); @@ -6235,7 +6916,9 @@ export class UnaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_unaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_unaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterUnaryExpression) { @@ -6258,7 +6941,6 @@ export class UnaryExpressionContext extends KipperParserRuleContext { } } - export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRuleContext { public incrementOrDecrementOperator(): IncrementOrDecrementOperatorContext { return this.getRuleContext(0, IncrementOrDecrementOperatorContext); @@ -6270,7 +6952,9 @@ export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRule super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementUnaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_incrementOrDecrementUnaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementUnaryExpression) { @@ -6293,7 +6977,6 @@ export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRule } } - export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleContext { public unaryOperator(): UnaryOperatorContext { return this.getRuleContext(0, UnaryOperatorContext); @@ -6305,7 +6988,9 @@ export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleCont super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_operatorModifiedUnaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_operatorModifiedUnaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterOperatorModifiedUnaryExpression) { @@ -6328,15 +7013,20 @@ export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleCont } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_incrementOrDecrementOperator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementOperator) { @@ -6359,16 +7049,23 @@ export class IncrementOrDecrementOperatorContext extends KipperParserRuleContext } } - 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 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); + } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_unaryOperator; } + public get ruleIndex(): number { + return KipperParser.RULE_unaryOperator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterUnaryOperator) { @@ -6391,13 +7088,14 @@ export class UnaryOperatorContext extends KipperParserRuleContext { } } - export class CastOrConvertExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_castOrConvertExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_castOrConvertExpression; + } public copyFrom(ctx: CastOrConvertExpressionContext): void { super.copyFrom(ctx); } @@ -6435,7 +7133,9 @@ export class ActualCastOrConvertExpressionContext extends CastOrConvertExpressio public unaryExpression(): UnaryExpressionContext { return this.getRuleContext(0, UnaryExpressionContext); } - public As(): TerminalNode { return this.getToken(KipperParser.As, 0); } + public As(): TerminalNode { + return this.getToken(KipperParser.As, 0); + } public typeSpecifierExpression(): TypeSpecifierExpressionContext { return this.getRuleContext(0, TypeSpecifierExpressionContext); } @@ -6465,13 +7165,14 @@ export class ActualCastOrConvertExpressionContext extends CastOrConvertExpressio } } - export class MultiplicativeExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_multiplicativeExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_multiplicativeExpression; + } public copyFrom(ctx: MultiplicativeExpressionContext): void { super.copyFrom(ctx); } @@ -6512,10 +7213,18 @@ export class ActualMultiplicativeExpressionContext extends MultiplicativeExpress 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); } + 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); @@ -6542,13 +7251,14 @@ export class ActualMultiplicativeExpressionContext extends MultiplicativeExpress } } - export class AdditiveExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_additiveExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_additiveExpression; + } public copyFrom(ctx: AdditiveExpressionContext): void { super.copyFrom(ctx); } @@ -6589,8 +7299,12 @@ export class ActualAdditiveExpressionContext extends 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); } + 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); @@ -6617,13 +7331,14 @@ export class ActualAdditiveExpressionContext extends AdditiveExpressionContext { } } - export class RelationalExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_relationalExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_relationalExpression; + } public copyFrom(ctx: RelationalExpressionContext): void { super.copyFrom(ctx); } @@ -6664,10 +7379,18 @@ export class ActualRelationalExpressionContext extends RelationalExpressionConte public additiveExpression(): AdditiveExpressionContext { return this.getRuleContext(0, AdditiveExpressionContext); } - 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); } + 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); @@ -6694,13 +7417,14 @@ export class ActualRelationalExpressionContext extends RelationalExpressionConte } } - export class EqualityExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_equalityExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_equalityExpression; + } public copyFrom(ctx: EqualityExpressionContext): void { super.copyFrom(ctx); } @@ -6741,8 +7465,12 @@ export class ActualEqualityExpressionContext extends 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); } + 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); @@ -6769,13 +7497,14 @@ export class ActualEqualityExpressionContext extends EqualityExpressionContext { } } - export class LogicalAndExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_logicalAndExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_logicalAndExpression; + } public copyFrom(ctx: LogicalAndExpressionContext): void { super.copyFrom(ctx); } @@ -6813,7 +7542,9 @@ export class ActualLogicalAndExpressionContext extends LogicalAndExpressionConte public logicalAndExpression(): LogicalAndExpressionContext { return this.getRuleContext(0, LogicalAndExpressionContext); } - public AndAnd(): TerminalNode { return this.getToken(KipperParser.AndAnd, 0); } + public AndAnd(): TerminalNode { + return this.getToken(KipperParser.AndAnd, 0); + } public equalityExpression(): EqualityExpressionContext { return this.getRuleContext(0, EqualityExpressionContext); } @@ -6843,13 +7574,14 @@ export class ActualLogicalAndExpressionContext extends LogicalAndExpressionConte } } - export class LogicalOrExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_logicalOrExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_logicalOrExpression; + } public copyFrom(ctx: LogicalOrExpressionContext): void { super.copyFrom(ctx); } @@ -6887,7 +7619,9 @@ export class ActualLogicalOrExpressionContext extends LogicalOrExpressionContext public logicalOrExpression(): LogicalOrExpressionContext { return this.getRuleContext(0, LogicalOrExpressionContext); } - public OrOr(): TerminalNode { return this.getToken(KipperParser.OrOr, 0); } + public OrOr(): TerminalNode { + return this.getToken(KipperParser.OrOr, 0); + } public logicalAndExpression(): LogicalAndExpressionContext { return this.getRuleContext(0, LogicalAndExpressionContext); } @@ -6917,13 +7651,14 @@ export class ActualLogicalOrExpressionContext extends LogicalOrExpressionContext } } - export class ConditionalExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_conditionalExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_conditionalExpression; + } public copyFrom(ctx: ConditionalExpressionContext): void { super.copyFrom(ctx); } @@ -6961,7 +7696,9 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon public logicalOrExpression(): LogicalOrExpressionContext { return this.getRuleContext(0, LogicalOrExpressionContext); } - public QuestionMark(): TerminalNode { return this.getToken(KipperParser.QuestionMark, 0); } + public QuestionMark(): TerminalNode { + return this.getToken(KipperParser.QuestionMark, 0); + } public conditionalExpression(): ConditionalExpressionContext[]; public conditionalExpression(i: number): ConditionalExpressionContext; public conditionalExpression(i?: number): ConditionalExpressionContext | ConditionalExpressionContext[] { @@ -6971,7 +7708,9 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon return this.getRuleContext(i, ConditionalExpressionContext); } } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } + public Colon(): TerminalNode { + return this.getToken(KipperParser.Colon, 0); + } constructor(ctx: ConditionalExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); @@ -6998,13 +7737,14 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon } } - export class AssignmentExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_assignmentExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_assignmentExpression; + } public copyFrom(ctx: AssignmentExpressionContext): void { super.copyFrom(ctx); } @@ -7074,19 +7814,32 @@ export class ActualAssignmentExpressionContext extends AssignmentExpressionConte } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_assignmentOperator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterAssignmentOperator) { @@ -7109,7 +7862,6 @@ export class AssignmentOperatorContext extends KipperParserRuleContext { } } - export class ExpressionContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext[]; public assignmentExpression(i: number): AssignmentExpressionContext; @@ -7133,7 +7885,9 @@ export class ExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_expression; } + public get ruleIndex(): number { + return KipperParser.RULE_expression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterExpression) { @@ -7156,7 +7910,6 @@ export class ExpressionContext extends KipperParserRuleContext { } } - export class TypeSpecifierExpressionContext extends KipperParserRuleContext { public identifierTypeSpecifierExpression(): IdentifierTypeSpecifierExpressionContext | undefined { return this.tryGetRuleContext(0, IdentifierTypeSpecifierExpressionContext); @@ -7171,7 +7924,9 @@ export class TypeSpecifierExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_typeSpecifierExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_typeSpecifierExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeSpecifierExpression) { @@ -7194,7 +7949,6 @@ export class TypeSpecifierExpressionContext extends KipperParserRuleContext { } } - export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleContext { public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext { return this.getRuleContext(0, TypeSpecifierIdentifierContext); @@ -7203,7 +7957,9 @@ export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleCo super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_identifierTypeSpecifierExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_identifierTypeSpecifierExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierTypeSpecifierExpression) { @@ -7226,7 +7982,6 @@ export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleCo } } - export class GenericTypeSpecifierExpressionContext extends KipperParserRuleContext { public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext[]; public typeSpecifierIdentifier(i: number): TypeSpecifierIdentifierContext; @@ -7237,13 +7992,19 @@ 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_genericTypeSpecifierExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterGenericTypeSpecifierExpression) { @@ -7266,19 +8027,26 @@ export class GenericTypeSpecifierExpressionContext extends KipperParserRuleConte } } - export class TypeofTypeSpecifierExpressionContext extends KipperParserRuleContext { - public Typeof(): TerminalNode { return this.getToken(KipperParser.Typeof, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } + 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_typeofTypeSpecifierExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeofTypeSpecifierExpression) { @@ -7301,17 +8069,26 @@ export class TypeofTypeSpecifierExpressionContext extends KipperParserRuleContex } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_typeSpecifierIdentifier; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeSpecifierIdentifier) { @@ -7333,5 +8110,3 @@ export class TypeSpecifierIdentifierContext extends KipperParserRuleContext { } } } - - diff --git a/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts b/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts index 8a8d69101..d3896411d 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts @@ -1,11 +1,9 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT - - // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax - // kind values. - import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; - import KipperParserBase from "./base/KipperParserBase"; - +// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax +// kind values. +import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; +import KipperParserBase from "./base/KipperParserBase"; import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; @@ -108,7 +106,6 @@ import { GenericTypeSpecifierExpressionContext } from "./KipperParser"; import { TypeofTypeSpecifierExpressionContext } from "./KipperParser"; import { TypeSpecifierIdentifierContext } from "./KipperParser"; - /** * This interface defines a complete listener for a parse tree produced by * `KipperParser`. @@ -1242,4 +1239,3 @@ export interface KipperParserListener extends ParseTreeListener { */ exitTypeSpecifierIdentifier?: (ctx: TypeSpecifierIdentifierContext) => void; } - diff --git a/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts b/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts index e26103bdd..dbc82fda8 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts @@ -1,11 +1,9 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT - - // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax - // kind values. - import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; - import KipperParserBase from "./base/KipperParserBase"; - +// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax +// kind values. +import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; +import KipperParserBase from "./base/KipperParserBase"; import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; @@ -108,7 +106,6 @@ import { GenericTypeSpecifierExpressionContext } from "./KipperParser"; import { TypeofTypeSpecifierExpressionContext } from "./KipperParser"; import { TypeSpecifierIdentifierContext } from "./KipperParser"; - /** * This interface defines a complete generic visitor for a parse tree produced * by `KipperParser`. @@ -828,4 +825,3 @@ export interface KipperParserVisitor extends ParseTreeVisitor { */ visitTypeSpecifierIdentifier?: (ctx: TypeSpecifierIdentifierContext) => Result; } - diff --git a/kipper/core/src/compiler/target-presets/semantic-analyser.ts b/kipper/core/src/compiler/target-presets/semantic-analyser.ts index 56c0cdacb..57f1a741d 100644 --- a/kipper/core/src/compiler/target-presets/semantic-analyser.ts +++ b/kipper/core/src/compiler/target-presets/semantic-analyser.ts @@ -3,13 +3,14 @@ * @since 0.10.0 */ -import { +import type { AdditiveExpression, AnalysableASTNode, ArrayPrimaryExpression, AssignmentExpression, BoolPrimaryExpression, - CastOrConvertExpression, ClassDeclaration, + CastOrConvertExpression, + ClassDeclaration, CompoundStatement, ConditionalExpression, DoWhileLoopIterationStatement, @@ -24,7 +25,8 @@ import { IdentifierTypeSpecifierExpression, IfStatement, IncrementOrDecrementPostfixExpression, - IncrementOrDecrementUnaryExpression, InterfaceDeclaration, + IncrementOrDecrementUnaryExpression, + InterfaceDeclaration, JumpStatement, LogicalAndExpression, LogicalOrExpression, diff --git a/kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts b/kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts index 8e158034a..cc5f13170 100644 --- a/kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts +++ b/kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts @@ -3,8 +3,7 @@ * @since 0.10.0 */ import type { TranslatedCodeLine } from "../../const"; -import type { BuiltInFunction, BuiltInVariable } from "../../runtime-built-ins"; -import type { InternalFunction } from "../../runtime-built-ins"; +import type { BuiltInFunction, BuiltInVariable, InternalFunction } from "../../runtime-built-ins"; import type { KipperProgramContext } from "../../program-ctx"; /** 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 fe1522763..4bfa5f4e7 100644 --- a/kipper/core/src/compiler/target-presets/translation/code-generator.ts +++ b/kipper/core/src/compiler/target-presets/translation/code-generator.ts @@ -2,12 +2,13 @@ * Code generator specifying how a Kipper parse tree should be translated into a specific language. * @since 0.10.0 */ -import { +import type { AdditiveExpression, ArrayPrimaryExpression, AssignmentExpression, BoolPrimaryExpression, - CastOrConvertExpression, ClassDeclaration, + CastOrConvertExpression, + ClassDeclaration, CompilableASTNode, CompoundStatement, ConditionalExpression, @@ -23,7 +24,8 @@ import { IdentifierTypeSpecifierExpression, IfStatement, IncrementOrDecrementPostfixExpression, - IncrementOrDecrementUnaryExpression, InterfaceDeclaration, + IncrementOrDecrementUnaryExpression, + InterfaceDeclaration, JumpStatement, LogicalAndExpression, LogicalOrExpression, diff --git a/kipper/core/src/errors.ts b/kipper/core/src/errors.ts index ddb662fb4..5ecdcee79 100644 --- a/kipper/core/src/errors.ts +++ b/kipper/core/src/errors.ts @@ -7,8 +7,7 @@ import type { InputMismatchException, LexerNoViableAltException, NoViableAltExce import type { FailedPredicateException } from "antlr4ts/FailedPredicateException"; import type { RecognitionException } from "antlr4ts/RecognitionException"; import type { Recognizer } from "antlr4ts/Recognizer"; -import type { KipperParseStream } from "./compiler"; -import type { CompilableASTNode, KipperProgramContext } from "./compiler"; +import type { CompilableASTNode, KipperParseStream, KipperProgramContext } from "./compiler"; import { getParseRuleSource } from "./tools"; /** From 415ae4b01e9050418e9a310672c3c9f267bff7d6 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Tue, 2 Jul 2024 16:58:59 +0200 Subject: [PATCH 04/57] minor (#524): Added empty code generators for interface and class declarations --- kipper/target-js/src/code-generator.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/kipper/target-js/src/code-generator.ts b/kipper/target-js/src/code-generator.ts index 77287fce5..40af601b5 100644 --- a/kipper/target-js/src/code-generator.ts +++ b/kipper/target-js/src/code-generator.ts @@ -48,6 +48,8 @@ import type { WhileLoopIterationStatement, ObjectPrimaryExpression, ObjectProperty, + InterfaceDeclaration, + ClassDeclaration, } from "@kipper/core"; import { VariableDeclaration, @@ -377,6 +379,20 @@ export class JavaScriptTargetCodeGenerator extends KipperTargetCodeGenerator { return [[storage, " ", semanticData.identifier, ...(assign.length > 0 ? [" ", "=", " ", ...assign] : []), ";"]]; }; + /** + * Translates a {@link AssignmentExpression} into the JavaScript language. + */ + interfaceDeclaration = async (node: InterfaceDeclaration): Promise> => { + return []; + }; + + /** + * Translates a {@link ClassDeclaration} into the JavaScript language. + */ + classDeclaration = async (node: ClassDeclaration): Promise> => { + return []; + }; + /** * Translates a {@link NumberPrimaryExpression} into the JavaScript language. */ From 4252b0bebd110eb444f1fb0f9cc289a97cd7f09e Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Wed, 3 Jul 2024 11:11:24 +0200 Subject: [PATCH 05/57] major (#524): Added TypeDeclaration as parent type for interface and class declarations --- .../entry/scope-type-declaration.ts | 6 +-- .../class-declaration-type-semantics.ts | 11 ----- .../compiler/ast/nodes/declarations/index.ts | 4 +- .../class-declaration-semantics.ts | 4 +- .../class-declaration-type-semantics.ts} | 4 +- .../class-declaration/class-declaration.ts | 18 ++++---- .../class-declaration/index.ts | 0 .../declarations/type-declaration/index.ts | 9 ++++ .../interface-declaration/index.ts | 0 .../interface-declaration-semantics.ts | 4 +- .../interface-declaration-type-semantics.ts | 11 +++++ .../interface-declaration.ts | 15 +++---- .../type-declaration-semantics.ts | 13 ++++++ .../type-declaration-type-semantics.ts | 7 ++++ .../type-declaration/type-declaration.ts | 42 +++++++++++++++++++ 15 files changed, 110 insertions(+), 38 deletions(-) delete mode 100644 kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration-type-semantics.ts rename kipper/core/src/compiler/ast/nodes/declarations/{ => type-declaration}/class-declaration/class-declaration-semantics.ts (60%) rename kipper/core/src/compiler/ast/nodes/declarations/{interface-declaration/interface-declaration-type-semantics.ts => type-declaration/class-declaration/class-declaration-type-semantics.ts} (55%) rename kipper/core/src/compiler/ast/nodes/declarations/{ => type-declaration}/class-declaration/class-declaration.ts (89%) rename kipper/core/src/compiler/ast/nodes/declarations/{ => type-declaration}/class-declaration/index.ts (100%) create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/index.ts rename kipper/core/src/compiler/ast/nodes/declarations/{ => type-declaration}/interface-declaration/index.ts (100%) rename kipper/core/src/compiler/ast/nodes/declarations/{ => type-declaration}/interface-declaration/interface-declaration-semantics.ts (60%) create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration-type-semantics.ts rename kipper/core/src/compiler/ast/nodes/declarations/{ => type-declaration}/interface-declaration/interface-declaration.ts (90%) create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-type-semantics.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration.ts diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts index 7ec4adc7d..1082215cd 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts @@ -4,10 +4,10 @@ */ import { ScopeDeclaration } from "./scope-declaration"; import type { - ClassDeclaration, + ClassDeclaration, ClassDeclarationSemantics, FunctionDeclarationSemantics, InterfaceDeclaration, - InterfaceDeclarationSemantics, + InterfaceDeclarationSemantics } from "../../../ast"; import { CheckedType } from "../../type"; @@ -28,7 +28,7 @@ export class ScopeTypeDeclaration extends ScopeDeclaration { * @throws UndefinedSemanticsError If this is accessed, before semantic analysis was performed. * @private */ - private get semanticData(): InterfaceDeclarationSemantics | FunctionDeclarationSemantics { + private get semanticData(): InterfaceDeclarationSemantics | ClassDeclarationSemantics { return this._node.getSemanticData(); } diff --git a/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration-type-semantics.ts deleted file mode 100644 index 331b357da..000000000 --- a/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration-type-semantics.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Type semantics for AST Node {@link ClassDeclaration}. - * @since 0.11.0 - */ -import type { DeclarationTypeSemantics } from "../declaration-type-semantics"; - -/** - * Type semantics for AST Node {@link ClassDeclaration}. - * @since 0.11.0 - */ -export interface ClassDeclarationTypeSemantics extends DeclarationTypeSemantics {} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/index.ts b/kipper/core/src/compiler/ast/nodes/declarations/index.ts index 6fe8a6754..b4c28662f 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/index.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/index.ts @@ -9,5 +9,5 @@ export * from "./declaration-type-semantics"; export * from "./parameter-declaration/"; export * from "./function-declaration/"; export * from "./variable-declaration/"; -export * from "./class-declaration/"; -export * from "./interface-declaration/"; +export * from "./type-declaration/class-declaration/"; +export * from "./type-declaration/interface-declaration/"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/class-declaration/class-declaration-semantics.ts similarity index 60% rename from kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration-semantics.ts rename to kipper/core/src/compiler/ast/nodes/declarations/type-declaration/class-declaration/class-declaration-semantics.ts index 87997d4f2..e146a8edc 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/class-declaration/class-declaration-semantics.ts @@ -2,13 +2,13 @@ * Semantics for AST Node {@link ClassDeclaration}. * @since 0.11.0 */ -import type { DeclarationSemantics } from "../declaration-semantics"; +import type { TypeDeclarationSemantics } from "../type-declaration-semantics"; /** * Semantics for AST Node {@link ClassDeclaration}. * @since 0.11.0 */ -export interface ClassDeclarationSemantics extends DeclarationSemantics { +export interface ClassDeclarationSemantics extends TypeDeclarationSemantics { /** * The identifier of this class. * @since 0.11.0 diff --git a/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/class-declaration/class-declaration-type-semantics.ts similarity index 55% rename from kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration-type-semantics.ts rename to kipper/core/src/compiler/ast/nodes/declarations/type-declaration/class-declaration/class-declaration-type-semantics.ts index 664d7fec4..8963de3b3 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/class-declaration/class-declaration-type-semantics.ts @@ -2,10 +2,10 @@ * Type semantics for AST Node {@link ClassDeclaration}. * @since 0.11.0 */ -import type { DeclarationTypeSemantics } from "../declaration-type-semantics"; +import type { TypeDeclarationTypeSemantics } from "../type-declaration-type-semantics"; /** * Type semantics for AST Node {@link ClassDeclaration}. * @since 0.11.0 */ -export interface InterfaceDeclarationTypeSemantics extends DeclarationTypeSemantics {} +export interface ClassDeclarationTypeSemantics extends TypeDeclarationTypeSemantics {} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/class-declaration/class-declaration.ts similarity index 89% rename from kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration.ts rename to kipper/core/src/compiler/ast/nodes/declarations/type-declaration/class-declaration/class-declaration.ts index f6a84ce3a..6f15b9ed6 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/class-declaration.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/class-declaration/class-declaration.ts @@ -2,23 +2,23 @@ * Represents a class declaration in the Kipper language, which may contain methods and fields. * @since 0.11.0 */ -import type { ScopeNode } from "../../../scope-node"; +import type { ScopeNode } from "../../../../scope-node"; import type { ClassDeclarationSemantics } from "./class-declaration-semantics"; import type { ClassDeclarationTypeSemantics } from "./class-declaration-type-semantics"; -import type { CompilableNodeParent } from "../../../compilable-ast-node"; -import type { ScopeTypeDeclaration } from "../../../../analysis"; -import type { ClassDeclarationContext } from "../../../../parser"; -import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../parser"; -import { Declaration } from "../declaration"; -import { KipperNotImplementedError } from "../../../../../errors"; -import { ClassScope } from "../../../../analysis/symbol-table/class-scope"; +import type { CompilableNodeParent } from "../../../../compilable-ast-node"; +import type { ScopeTypeDeclaration } from "../../../../../analysis"; +import type { ClassDeclarationContext } from "../../../../../parser"; +import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parser"; +import { KipperNotImplementedError } from "../../../../../../errors"; +import { ClassScope } from "../../../../../analysis/symbol-table/class-scope"; +import { TypeDeclaration } from "../type-declaration"; /** * Represents a class declaration in the Kipper language, which may contain methods and fields. * @since 0.11.0 */ export class ClassDeclaration - extends Declaration + extends TypeDeclaration implements ScopeNode { /** diff --git a/kipper/core/src/compiler/ast/nodes/declarations/class-declaration/index.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/class-declaration/index.ts similarity index 100% rename from kipper/core/src/compiler/ast/nodes/declarations/class-declaration/index.ts rename to kipper/core/src/compiler/ast/nodes/declarations/type-declaration/class-declaration/index.ts diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/index.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/index.ts new file mode 100644 index 000000000..dc44df73f --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/index.ts @@ -0,0 +1,9 @@ +/** + * Type declarations such as interface and class declarations in the Kipper language. + * @since 0.11.0 + */ +export * from "./type-declaration"; +export * from "./type-declaration-semantics"; +export * from "./type-declaration-type-semantics"; +export * from "./class-declaration/"; +export * from "./interface-declaration/"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/index.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/index.ts similarity index 100% rename from kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/index.ts rename to kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/index.ts diff --git a/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration-semantics.ts similarity index 60% rename from kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration-semantics.ts rename to kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration-semantics.ts index 0f8c729fe..8448441ea 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration-semantics.ts @@ -2,13 +2,13 @@ * Semantics for AST Node {@link ClassDeclaration}. * @since 0.11.0 */ -import type { DeclarationSemantics } from "../declaration-semantics"; +import type { TypeDeclarationSemantics } from "../type-declaration-semantics"; /** * Semantics for AST Node {@link ClassDeclaration}. * @since 0.11.0 */ -export interface InterfaceDeclarationSemantics extends DeclarationSemantics { +export interface InterfaceDeclarationSemantics extends TypeDeclarationSemantics { /** * The identifier of this interface. * @since 0.11.0 diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration-type-semantics.ts new file mode 100644 index 000000000..161e6498e --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration-type-semantics.ts @@ -0,0 +1,11 @@ +/** + * Type semantics for AST Node {@link ClassDeclaration}. + * @since 0.11.0 + */ +import type { TypeDeclarationTypeSemantics } from "../type-declaration-type-semantics"; + +/** + * Type semantics for AST Node {@link ClassDeclaration}. + * @since 0.11.0 + */ +export interface InterfaceDeclarationTypeSemantics extends TypeDeclarationTypeSemantics {} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration.ts similarity index 90% rename from kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration.ts rename to kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration.ts index eeafa2a35..0527e8cd9 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/interface-declaration/interface-declaration.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-declaration.ts @@ -4,18 +4,19 @@ */ import type { InterfaceDeclarationSemantics } from "./interface-declaration-semantics"; import type { InterfaceDeclarationTypeSemantics } from "./interface-declaration-type-semantics"; -import type { CompilableNodeParent } from "../../../compilable-ast-node"; -import type { ScopeTypeDeclaration } from "../../../../analysis"; -import type { InterfaceDeclarationContext } from "../../../../parser"; -import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../parser"; -import { Declaration } from "../declaration"; -import { KipperNotImplementedError } from "../../../../../errors"; +import type { CompilableNodeParent } from "../../../../compilable-ast-node"; +import type { ScopeTypeDeclaration } from "../../../../../analysis"; +import type { InterfaceDeclarationContext } from "../../../../../parser"; +import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parser"; +import { Declaration } from "../../declaration"; +import { KipperNotImplementedError } from "../../../../../../errors"; +import { TypeDeclaration } from "../type-declaration"; /** * Represents an interface declaration in the Kipper language, which may contain methods and fields declarations. * @since 0.11.0 */ -export class InterfaceDeclaration extends Declaration< +export class InterfaceDeclaration extends TypeDeclaration< InterfaceDeclarationSemantics, InterfaceDeclarationTypeSemantics > { diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts new file mode 100644 index 000000000..6f1e836a1 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts @@ -0,0 +1,13 @@ +import type { SemanticData } from "../../../ast-node"; + +/** + * Semantics for a {@link TypeDeclaration}. + * @since 0.11.0 + */ +export interface TypeDeclarationSemantics extends SemanticData { + /** + * The identifier of the type declaration. + * @since 0.11.0 + */ + identifier: string; +} 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 new file mode 100644 index 000000000..530149ac1 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-type-semantics.ts @@ -0,0 +1,7 @@ +import type { TypeData } from "../../../ast-node"; + +/** + * Type semantics for a {@link TypeDeclaration}. + * @since 0.11.0 + */ +export interface TypeDeclarationTypeSemantics extends TypeData {} 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 new file mode 100644 index 000000000..63863fe46 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration.ts @@ -0,0 +1,42 @@ +import type { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../parser"; +import type { ASTNodeMapper } from "../../../mapping"; +import type { TypeDeclarationSemantics } from "./type-declaration-semantics"; +import type { TypeDeclarationTypeSemantics } from "./type-declaration-type-semantics"; +import { Declaration } from "../declaration"; + +/** + * Union type of all possible {@link ParserASTNode.kind} values for a constructable {@link TypeDeclaration} AST node. + * @since 0.10.0 + */ +export type ASTTypeDeclarationKind = + | 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 + */ +export type ParserTypeDeclarationContext = InstanceType< + (typeof ASTNodeMapper.declarationKindToRuleContextMap)[ASTTypeDeclarationKind] +>; + +/** + * Union type of all possible {@link ParserASTNode.ruleName} values for a constructable {@link TypeDeclaration} + * AST node. + * @since 0.11.0 + */ +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 + */ +export abstract class TypeDeclaration< + Semantics extends TypeDeclarationSemantics = TypeDeclarationSemantics, + TypeSemantics extends TypeDeclarationTypeSemantics = TypeDeclarationTypeSemantics, +> extends Declaration { + protected abstract readonly _antlrRuleCtx: ParserTypeDeclarationContext; + public abstract get kind(): ASTTypeDeclarationKind; + public abstract get ruleName(): ParserTypeDeclarationRuleName; +} From 2f337aa78e08b41ecd60bd2b4c2bfa99770033a0 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Wed, 3 Jul 2024 12:07:59 +0200 Subject: [PATCH 06/57] other: Fixed outdated comment in program-ctx.ts --- kipper/core/src/compiler/program-ctx.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kipper/core/src/compiler/program-ctx.ts b/kipper/core/src/compiler/program-ctx.ts index 6412dc225..103852dfa 100644 --- a/kipper/core/src/compiler/program-ctx.ts +++ b/kipper/core/src/compiler/program-ctx.ts @@ -564,7 +564,7 @@ export class KipperProgramContext { this.logger.info(`Analysing semantics.`); await this.semanticAnalysis(); - // If the semantic analysis failed, return an empty array + // If the semantic analysis failed, return nothing if (this.hasFailed) { return undefined; } From 58ed8bd3abe783dd7f0242a768f0330e319cc8db Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Wed, 3 Jul 2024 16:23:46 +0200 Subject: [PATCH 07/57] major (#524): Restructured type system and prepared for implementation of the new type system --- .../analysis/analyser/type-checker.ts | 115 ++++++-------- kipper/core/src/compiler/analysis/index.ts | 2 +- .../symbol-table/entry/scope-declaration.ts | 4 +- .../entry/scope-function-declaration.ts | 8 +- .../entry/scope-parameter-declaration.ts | 6 +- .../entry/scope-type-declaration.ts | 31 ++-- .../entry/scope-variable-declaration.ts | 6 +- .../analysis/symbol-table/global-scope.ts | 13 ++ .../analysis/symbol-table/local-scope.ts | 10 +- .../compiler/analysis/symbol-table/scope.ts | 17 +- kipper/core/src/compiler/analysis/type.ts | 148 ------------------ .../compiler/analysis/types/built-in-type.ts | 14 ++ .../compiler/analysis/types/custom-type.ts | 21 +++ .../core/src/compiler/analysis/types/index.ts | 10 ++ .../compiler/analysis/types/processed-type.ts | 101 ++++++++++++ .../src/compiler/analysis/types/raw-type.ts | 21 +++ .../core/src/compiler/analysis/types/type.ts | 22 +++ .../compiler/analysis/types/undefined-type.ts | 10 ++ .../function-declaration-semantics.ts | 4 +- .../function-declaration-type-semantics.ts | 4 +- .../function-declaration.ts | 4 +- .../compiler/ast/nodes/declarations/index.ts | 3 +- .../parameter-declaration-semantics.ts | 4 +- .../parameter-declaration-type-semantics.ts | 4 +- .../variable-declaration-semantics.ts | 4 +- .../variable-declaration-type-semantics.ts | 4 +- .../variable-declaration.ts | 4 +- .../bitwise-and-expression.ts | 4 +- .../bitwise-or-expression.ts | 4 +- .../bitwise-shift-expression.ts | 4 +- .../bitwise-xor-expression.ts | 4 +- .../cast-or-convert-expression-semantics.ts | 4 +- ...st-or-convert-expression-type-semantics.ts | 4 +- .../cast-or-convert-expression.ts | 4 +- .../equality-expression.ts | 4 +- .../relational-expression.ts | 4 +- .../expressions/expression-type-semantics.ts | 4 +- .../function-call-expression.ts | 8 +- .../logical-and-expression.ts | 4 +- .../logical-or-expression.ts | 4 +- ...crement-or-decrement-postfix-expression.ts | 4 +- .../array-primary-expression.ts | 4 +- .../bool-primary-expression.ts | 4 +- .../fstring-primary-expression.ts | 4 +- ...ifier-primary-expression-type-semantics.ts | 4 +- .../identifier-primary-expression.ts | 6 +- .../number-primary-expression.ts | 4 +- .../string-primary-expression.ts | 4 +- ...or-null-or-undefined-primary-expression.ts | 4 +- ...ier-type-specifier-expression-semantics.ts | 4 +- .../identifier-type-specifier-expression.ts | 6 +- ...ype-specifier-expression-type-semantics.ts | 4 +- ...increment-or-decrement-unary-expression.ts | 4 +- .../operator-modified-unary-expression.ts | 4 +- .../return-statement-type-semantics.ts | 4 +- .../return-statement/return-statement.ts | 4 +- kipper/core/src/compiler/const.ts | 4 +- kipper/core/src/errors.ts | 2 +- 58 files changed, 393 insertions(+), 331 deletions(-) delete mode 100644 kipper/core/src/compiler/analysis/type.ts create mode 100644 kipper/core/src/compiler/analysis/types/built-in-type.ts create mode 100644 kipper/core/src/compiler/analysis/types/custom-type.ts create mode 100644 kipper/core/src/compiler/analysis/types/index.ts create mode 100644 kipper/core/src/compiler/analysis/types/processed-type.ts create mode 100644 kipper/core/src/compiler/analysis/types/raw-type.ts create mode 100644 kipper/core/src/compiler/analysis/types/type.ts create mode 100644 kipper/core/src/compiler/analysis/types/undefined-type.ts diff --git a/kipper/core/src/compiler/analysis/analyser/type-checker.ts b/kipper/core/src/compiler/analysis/analyser/type-checker.ts index dc34acb2a..131e2590a 100644 --- a/kipper/core/src/compiler/analysis/analyser/type-checker.ts +++ b/kipper/core/src/compiler/analysis/analyser/type-checker.ts @@ -62,8 +62,8 @@ import { UnknownTypeError, ValueNotIndexableTypeError, } from "../../../errors"; -import type { UncheckedType } from "../type"; -import { CheckedType, UndefinedCustomType } from "../type"; +import type { RawType } from "../types"; +import { ProcessedType, UndefinedType } from "../types"; /** * Kipper Type Checker, which asserts that type logic and cohesion is valid and throws errors in case that an @@ -75,22 +75,6 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { super(programCtx); } - /** - * Gets the type that should be used for the type checking from the provided {@link CheckedType}. - * - * This function is intended to check for {@link UndefinedCustomType}, which is a special type that is created - * during error recovery to indicate a type is invalid/undefined. This type should be always ignored and as such - * this function will return undefined, so that they type checking is skipped. (This is fine, since the compiler - * should have already thrown an error at the creation of the {@link UndefinedCustomType}.) - * @param type The {@link CheckedType} instance. - */ - public static getTypeForAnalysis(type: CheckedType): KipperCompilableType | undefined { - if (type.isCompilable) { - return type.kipperType; - } - return undefined; - } - /** * Asserts that the passed type identifier exists. * @param type The type to check. @@ -103,18 +87,18 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { } /** - * Creates a new {@link CheckedType} instance based on the passed {@link KipperType}. + * Creates a new {@link ProcessedType} instance based on the passed {@link KipperType}. * - * If the type is invalid, the function will still return a {@link CheckedType}, but the field - * {@link CheckedType.isCompilable} will be false and the instance WILL NOT be usable for a compilation. + * If the type is invalid, the function will still return a {@link ProcessedType}, but the field + * {@link ProcessedType.isCompilable} will be false and the instance WILL NOT be usable for a compilation. * @param type The unchecked type to analyse. */ - public getCheckedType(type: UncheckedType): CheckedType { + public getCheckedType(type: RawType): ProcessedType { try { // Ensure the type exists this.typeExists(type.identifier); - return CheckedType.fromCompilableType(type.identifier); + return ProcessedType.fromCompilableType(type.identifier); } catch (e) { // If the error is not a KipperError, rethrow it (since it is not a type error, and we don't know what happened) if (!(e instanceof KipperError)) { @@ -127,7 +111,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { this.programCtx.reportError(e); // Recover from the error by wrapping the undefined type - return CheckedType.fromKipperType(new UndefinedCustomType(type.identifier)); + return ProcessedType.fromKipperType(new UndefinedType(type.identifier)); } // If error recovery is not enabled, we shouldn't bother trying to handle invalid types @@ -162,7 +146,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { */ public refTargetCallable(ref: KipperReferenceable): void { if (ref instanceof ScopeDeclaration) { - const refType = KipperTypeChecker.getTypeForAnalysis(ref.type); + const refType = ref.type.get(); if (refType === undefined) { return; // Ignore undefined types - Skip type checking (the type is invalid anyway) } @@ -200,8 +184,8 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { } // Get the compile-types for the left and right hand side - const varType = KipperTypeChecker.getTypeForAnalysis(leftExpTypeData.evaluatedType); - const valueType = KipperTypeChecker.getTypeForAnalysis(rightExpTypeData.evaluatedType); + const varType = leftExpTypeData.evaluatedType.get(); + const valueType = rightExpTypeData.evaluatedType.get(); // If either one of the types is undefined, skip type checking (the types are invalid anyway) if (varType === undefined || valueType === undefined) { @@ -231,8 +215,8 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { */ public validVariableDefinition(scopeEntry: ScopeVariableDeclaration, value: Expression): void { // Get the compile-types for the left and right hand side - const leftExpType = KipperTypeChecker.getTypeForAnalysis(scopeEntry.type); - const rightExpType = KipperTypeChecker.getTypeForAnalysis(value.getTypeSemanticData().evaluatedType); + const leftExpType = scopeEntry.type.get(); + const rightExpType = value.getTypeSemanticData().evaluatedType.get(); // If either one of the types is undefined, skip type checking (the types are invalid anyway) if (leftExpType === undefined || rightExpType === undefined) { @@ -254,9 +238,9 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @throws {ArgumentTypeError} If the given argument type does not match the parameter type. * @since 0.7.0 */ - public validArgumentValue(arg: ParameterDeclaration | BuiltInFunctionArgument, receivedType: CheckedType): void { + public validArgumentValue(arg: ParameterDeclaration | BuiltInFunctionArgument, receivedType: ProcessedType): void { let semanticData: ParameterDeclarationSemantics | BuiltInFunctionArgument; - let argType: CheckedType; + let argType: ProcessedType; // Get the proper semantic data and value type if (arg instanceof ParameterDeclaration) { @@ -264,12 +248,12 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { argType = arg.getTypeSemanticData().valueType; } else { semanticData = arg; - argType = CheckedType.fromCompilableType(arg.valueType); + argType = ProcessedType.fromCompilableType(arg.valueType); } // Get the compile-types for the parameter and argument (value provided) - const receivedCompileType = KipperTypeChecker.getTypeForAnalysis(receivedType); - const argCompileType = KipperTypeChecker.getTypeForAnalysis(argType); + const receivedCompileType = receivedType.get(); + const argCompileType = argType.get(); // If either one of the types is undefined, skip type checking (the types are invalid anyway) if (receivedCompileType === undefined || argCompileType === undefined) { @@ -315,8 +299,8 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { const rightOpTypeData = semanticData.rightOp.getTypeSemanticData(); // Get the compile-types for the operands - const leftOpType = KipperTypeChecker.getTypeForAnalysis(leftOpTypeData.evaluatedType); - const rightOpType = KipperTypeChecker.getTypeForAnalysis(rightOpTypeData.evaluatedType); + const leftOpType = leftOpTypeData.evaluatedType.get(); + const rightOpType = rightOpTypeData.evaluatedType.get(); // If either one of the types is undefined, skip type checking (the types are invalid anyway) if (leftOpType === undefined || rightOpType === undefined) { @@ -344,7 +328,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { const expTypeSemantics = semanticData.operand.getTypeSemanticData(); // Get the compile-types type of the expression - const expType = KipperTypeChecker.getTypeForAnalysis(expTypeSemantics.evaluatedType); + const expType = expTypeSemantics.evaluatedType.get(); // If the expression type is undefined, skip type checking (the type is invalid anyway) if (expType === undefined) { @@ -386,8 +370,8 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { */ public validArithmeticExpression(leftOp: Expression, rightOp: Expression, op: KipperArithmeticOperator): void { // Get the compile-types for both operands - const leftOpType = KipperTypeChecker.getTypeForAnalysis(leftOp.getTypeSemanticData().evaluatedType); - const rightOpType = KipperTypeChecker.getTypeForAnalysis(rightOp.getTypeSemanticData().evaluatedType); + const leftOpType = leftOp.getTypeSemanticData().evaluatedType.get(); + const rightOpType = rightOp.getTypeSemanticData().evaluatedType.get(); // If either one of the types is undefined, skip type checking (the types are invalid anyway) if (leftOpType === undefined || rightOpType === undefined) { @@ -420,8 +404,8 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @since 0.11.0 */ public validBitwiseExpression(leftOp: Expression, rightOp: Expression, op: KipperBitwiseOperator): void { - const leftOpType = KipperTypeChecker.getTypeForAnalysis(leftOp.getTypeSemanticData().evaluatedType); - const rightOpType = KipperTypeChecker.getTypeForAnalysis(rightOp.getTypeSemanticData().evaluatedType); + const leftOpType = leftOp.getTypeSemanticData().evaluatedType.get(); + const rightOpType = rightOp.getTypeSemanticData().evaluatedType.get(); // If either one of the types is undefined, skip type checking (the types are invalid anyway) if (leftOpType === undefined || rightOpType === undefined) { @@ -441,10 +425,10 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @throws {InvalidConversionTypeError} If the conversion is invalid/impossible. * @since 0.8.0 */ - public validConversion(operand: Expression, targetType: CheckedType): void { + public validConversion(operand: Expression, targetType: ProcessedType): void { // Get the compile-types for the specified conversion types - const originalCompileType = KipperTypeChecker.getTypeForAnalysis(operand.getTypeSemanticData().evaluatedType); - const targetCompileType = KipperTypeChecker.getTypeForAnalysis(targetType); + const originalCompileType = operand.getTypeSemanticData().evaluatedType.get(); + const targetCompileType = targetType.get(); // If either one of the types is undefined, skip type checking (the types are invalid anyway) if (originalCompileType === undefined || targetCompileType === undefined) { @@ -454,7 +438,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { // Check whether a supported pair of types exist. const viableConversion = kipperSupportedConversions.find( - (types) => types[0] === originalCompileType && types[1] === targetType.kipperType, + (types) => types[0] === originalCompileType && types[1] === targetType.rawType, ) !== undefined; // In case that the targetType are not the same and no conversion is possible, throw an error! @@ -473,13 +457,10 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { const semanticData = returnStatement.getSemanticData(); // If the return statement has no return value, then the value is automatically 'void' - const statementValueType = KipperTypeChecker.getTypeForAnalysis( - semanticData.returnValue?.getTypeSemanticData().evaluatedType ?? CheckedType.fromCompilableType("void"), - ); - const functionReturnType = KipperTypeChecker.getTypeForAnalysis( - // TODO! DON'T DO THIS. THIS IS PUTTING TYPE CHECKING OF A PARENT INTO A CHILD - this.getCheckedType(semanticData.function.getSemanticData().returnType), - ); + const statementValueType = semanticData.returnValue?.getTypeSemanticData().evaluatedType.get() ?? "void"; + + // TODO! DON'T DO THIS. THIS IS PUTTING TYPE CHECKING OF A PARENT INTO A CHILD + const functionReturnType = this.getCheckedType(semanticData.function.getSemanticData().returnType).get(); // If either one of the types is undefined, skip type checking (the types are invalid anyway) if (statementValueType === undefined || functionReturnType === undefined) { @@ -504,7 +485,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { public validReturnCodePathsInFunctionBody(func: FunctionDeclaration): void { const semanticData = func.getSemanticData(); const typeData = func.getTypeSemanticData(); - const returnType = KipperTypeChecker.getTypeForAnalysis(typeData.returnType); + const returnType = typeData.returnType.get(); // If the return type is undefined, skip type checking (the type is invalid anyway) if (returnType === undefined) { @@ -585,7 +566,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @since 0.10.0 */ public objectLikeIsIndexableOrAccessible(objLike: Expression): void { - const objType = KipperTypeChecker.getTypeForAnalysis(objLike.getTypeSemanticData().evaluatedType); + const objType = objLike.getTypeSemanticData().evaluatedType.get(); // If the obj type is undefined, skip type checking (the type is invalid anyway) if (objType === undefined) { @@ -606,8 +587,8 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @since 0.10.0 */ public validBracketNotationKey(objLike: Expression, key: Expression): void { - const objType = KipperTypeChecker.getTypeForAnalysis(objLike.getTypeSemanticData().evaluatedType); - const keyType = KipperTypeChecker.getTypeForAnalysis(key.getTypeSemanticData().evaluatedType); + const objType = objLike.getTypeSemanticData().evaluatedType.get(); + const keyType = key.getTypeSemanticData().evaluatedType.get(); // If the obj or key type are undefined, skip type checking (the types are invalid anyway) if (objType === undefined || keyType === undefined) { @@ -628,13 +609,9 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @since 0.10.0 */ public validSliceNotationKey(objLike: Expression, key: { start?: Expression; end?: Expression }): void { - const objType = KipperTypeChecker.getTypeForAnalysis(objLike.getTypeSemanticData().evaluatedType); - const startType = key.start - ? KipperTypeChecker.getTypeForAnalysis(key.start.getTypeSemanticData().evaluatedType) - : undefined; - const endType = key.end - ? KipperTypeChecker.getTypeForAnalysis(key.end.getTypeSemanticData().evaluatedType) - : undefined; + const objType = objLike.getTypeSemanticData().evaluatedType.get(); + const startType = key.start ? key.start.getTypeSemanticData().evaluatedType.get() : undefined; + const endType = key.end ? key.end.getTypeSemanticData().evaluatedType.get() : undefined; // If the obj type is undefined, skip type checking (the type is invalid anyway) if (objType === undefined) { @@ -654,14 +631,14 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @param memberAccess The member access expression to get the type for. * @since 0.10.0 */ - public getTypeOfMemberAccessExpression(memberAccess: MemberAccessExpression): CheckedType { + public getTypeOfMemberAccessExpression(memberAccess: MemberAccessExpression): ProcessedType { const semanticData = memberAccess.getSemanticData(); // First ensure the object is indexable this.objectLikeIsIndexableOrAccessible(semanticData.objectLike); const preAnalysisType = semanticData.objectLike.getTypeSemanticData().evaluatedType; - const objType = KipperTypeChecker.getTypeForAnalysis(preAnalysisType); + const objType = preAnalysisType.get(); // If the obj type is undefined, skip type checking (the type is invalid anyway) if (objType === undefined) { @@ -678,7 +655,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { // Also ensure the key is valid this.validBracketNotationKey(semanticData.objectLike, semanticData.propertyIndexOrKeyOrSlice); - return CheckedType.fromCompilableType("str"); + return ProcessedType.fromCompilableType("str"); } else { // Must be a list -> Not implemented yet throw this.notImplementedError( @@ -694,7 +671,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { <{ start?: Expression; end?: Expression }>semanticData.propertyIndexOrKeyOrSlice, ); - return CheckedType.fromCompilableType("str"); + return ProcessedType.fromCompilableType("str"); } else { // Must be a list -> Not implemented yet throw this.notImplementedError( @@ -713,8 +690,8 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @since 0.11.0 */ validConditionalExpression(trueBranch: Expression, falseBranch: Expression) { - const trueBranchType = KipperTypeChecker.getTypeForAnalysis(trueBranch.getTypeSemanticData().evaluatedType); - const falseBranchType = KipperTypeChecker.getTypeForAnalysis(falseBranch.getTypeSemanticData().evaluatedType); + const trueBranchType = trueBranch.getTypeSemanticData().evaluatedType.get(); + const falseBranchType = falseBranch.getTypeSemanticData().evaluatedType.get(); // If the branch types are undefined, skip type checking (the types are invalid anyway) if (trueBranchType === undefined || falseBranchType === undefined) { diff --git a/kipper/core/src/compiler/analysis/index.ts b/kipper/core/src/compiler/analysis/index.ts index 90404a5a2..6b0ba22bf 100644 --- a/kipper/core/src/compiler/analysis/index.ts +++ b/kipper/core/src/compiler/analysis/index.ts @@ -5,5 +5,5 @@ export * from "./handle-error"; export * from "./analyser/"; export * from "./symbol-table/"; -export * from "./type"; +export * from "./types"; export * from "./reference"; diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-declaration.ts b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-declaration.ts index a2d77bdec..b39b71660 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-declaration.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-declaration.ts @@ -4,7 +4,7 @@ */ import type { Declaration } from "../../../ast"; import type { KipperProgramContext } from "../../../program-ctx"; -import type { CheckedType } from "../../type"; +import type { ProcessedType } from "../../types"; /** * An symbol table entry of a variable, parameter or function declaration inside a Kipper scope. @@ -30,7 +30,7 @@ export abstract class ScopeDeclaration { * The value type of this declaration. * @since 0.10.0 */ - public abstract get type(): CheckedType; + public abstract get type(): ProcessedType; /** * Returns whether the scope declaration was defined during its declaration. diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts index a1e86bed7..adfed1b90 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts @@ -9,7 +9,7 @@ import type { ParameterDeclaration, } from "../../../ast"; import { ScopeDeclaration } from "./scope-declaration"; -import { CheckedType } from "../../type"; +import { ProcessedType } from "../../types"; /** * Represents the definition of a function inside a {@link Scope}. @@ -59,14 +59,14 @@ export class ScopeFunctionDeclaration extends ScopeDeclaration { * The type of this function. This is always "func". * @since 0.10.0 */ - public get type(): CheckedType { - return CheckedType.fromCompilableType("func"); + public get type(): ProcessedType { + return ProcessedType.fromCompilableType("func"); } /** * The return type of this function. This can be every {@link KipperType} except {@link KipperFuncType}. */ - public get returnType(): CheckedType { + public get returnType(): ProcessedType { return this.typeData.returnType; } diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-parameter-declaration.ts b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-parameter-declaration.ts index 5f55743e3..18b145aed 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-parameter-declaration.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-parameter-declaration.ts @@ -10,7 +10,7 @@ import type { ParameterDeclarationTypeSemantics, } from "../../../ast"; import type { LocalScope } from "../index"; -import type { CheckedType } from "../../type"; +import type { ProcessedType } from "../../types"; /** * Represents the definition of a parameter inside a {@link FunctionDeclaration function}. @@ -64,7 +64,7 @@ export class ScopeParameterDeclaration extends ScopeDeclaration { * The type of this parameter. * @since 0.10.0 */ - public get type(): CheckedType { + public get type(): ProcessedType { return this.typeData.valueType; } @@ -111,6 +111,6 @@ export class ScopeParameterDeclaration extends ScopeDeclaration { * @since 0.10.0 */ public get isCallable(): boolean { - return this.type.kipperType === "func"; + return this.type.rawType === "func"; } } diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts index 4193a9e3e..a75c76b3a 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts @@ -3,23 +3,18 @@ * @since 0.11.0 */ import { ScopeDeclaration } from "./scope-declaration"; -import type { - ClassDeclaration, - ClassDeclarationSemantics, - FunctionDeclarationSemantics, - InterfaceDeclaration, - InterfaceDeclarationSemantics, -} from "../../../ast"; -import { CheckedType } from "../../type"; +import type { TypeDeclaration, TypeDeclarationSemantics } from "../../../ast"; +import { ProcessedType } from "../../types"; +import { KipperNotImplementedError } from "../../../../errors"; /** * Represents the definition of a type such as a class or interface in a scope. * @since 0.11.0 */ export class ScopeTypeDeclaration extends ScopeDeclaration { - private readonly _node: InterfaceDeclaration | ClassDeclaration; + private readonly _node: TypeDeclaration; - public constructor(node: InterfaceDeclaration | ClassDeclaration) { + public constructor(node: TypeDeclaration) { super(); this._node = node; } @@ -29,14 +24,14 @@ export class ScopeTypeDeclaration extends ScopeDeclaration { * @throws UndefinedSemanticsError If this is accessed, before semantic analysis was performed. * @private */ - private get semanticData(): InterfaceDeclarationSemantics | ClassDeclarationSemantics { + private get semanticData(): TypeDeclarationSemantics { return this._node.getSemanticData(); } /** * Returns the {@link InterfaceDeclaration} or {@link ClassDeclaration AST node} this scope type declaration bases on. */ - public get node(): InterfaceDeclaration | ClassDeclaration { + public get node(): TypeDeclaration { return this._node; } @@ -51,8 +46,16 @@ export class ScopeTypeDeclaration extends ScopeDeclaration { * The type of this type. This is always "type". * @since 0.11.0 */ - public get type(): CheckedType { - return CheckedType.fromCompilableType("type"); + public get type(): ProcessedType { + return ProcessedType.fromCompilableType("type"); + } + + /** + * The value of this type, which is the type itself i.e. what value does this type represent. + * @since 0.11.0 + */ + public get typeValue(): ProcessedType { + throw new KipperNotImplementedError("Custom types are not implement yet"); } /** diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts index 45ef11b2f..6394ea8ab 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts @@ -5,7 +5,7 @@ import type { VariableDeclaration, VariableDeclarationSemantics, VariableDeclarationTypeSemantics } from "../../../ast"; import type { KipperStorageType } from "../../../const"; import type { Scope } from "../index"; -import type { CheckedType } from "../../type"; +import type { ProcessedType } from "../../types"; import { ScopeDeclaration } from "./scope-declaration"; /** @@ -61,7 +61,7 @@ export class ScopeVariableDeclaration extends ScopeDeclaration { /** * The value type of this variable. */ - public get type(): CheckedType { + public get type(): ProcessedType { return this.typeData.valueType; } @@ -102,6 +102,6 @@ export class ScopeVariableDeclaration extends ScopeDeclaration { * @since 0.10.0 */ public get isCallable(): boolean { - return this.type.kipperType === "func"; + return this.type.rawType === "func"; } } diff --git a/kipper/core/src/compiler/analysis/symbol-table/global-scope.ts b/kipper/core/src/compiler/analysis/symbol-table/global-scope.ts index 38f36fb3e..2e4ed732a 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/global-scope.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/global-scope.ts @@ -6,6 +6,8 @@ import type { KipperProgramContext } from "../../program-ctx"; import type { FunctionDeclaration, VariableDeclaration } from "../../ast"; import type { ScopeDeclaration } from "./entry"; +import type { TypeDeclaration } from "../../ast"; +import { ScopeTypeDeclaration } from "./entry"; import { ScopeFunctionDeclaration, ScopeVariableDeclaration } from "./entry"; import { Scope } from "./scope"; @@ -47,6 +49,17 @@ export class GlobalScope extends Scope { return scopeDeclaration; } + public addType(declaration: TypeDeclaration): ScopeTypeDeclaration { + const identifier = declaration.getSemanticData().identifier; + + // Ensuring that the declaration does not overwrite other declarations + this.programCtx.semanticCheck(declaration).identifierNotUsed(identifier, this.programCtx.globalScope); + + const scopeDeclaration = new ScopeTypeDeclaration(declaration); + this.entries.set(identifier, scopeDeclaration); + return scopeDeclaration; + } + public getEntry(identifier: string): ScopeDeclaration | undefined { return this.entries.get(identifier); } diff --git a/kipper/core/src/compiler/analysis/symbol-table/local-scope.ts b/kipper/core/src/compiler/analysis/symbol-table/local-scope.ts index 8aedaa557..dba57d4d6 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/local-scope.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/local-scope.ts @@ -3,10 +3,10 @@ * namespace. * @since 0.8.0 */ -import type { FunctionDeclaration, ScopeNode, VariableDeclaration } from "../../ast/"; +import type { FunctionDeclaration, ScopeNode, TypeDeclaration, VariableDeclaration } from "../../ast/"; import type { GlobalScope } from "./global-scope"; import { KipperNotImplementedError } from "../../../errors"; -import type { ScopeDeclaration, ScopeFunctionDeclaration } from "./entry"; +import type { ScopeDeclaration, ScopeFunctionDeclaration, ScopeTypeDeclaration } from "./entry"; import { ScopeVariableDeclaration } from "./entry"; import { Scope } from "./scope"; @@ -45,6 +45,12 @@ export class LocalScope extends Scope { return scopeDeclaration; } + public addType(declaration: TypeDeclaration): ScopeTypeDeclaration { + throw this.ctx.programCtx + .semanticCheck(declaration) + .notImplementedError(new KipperNotImplementedError("Local types have not been implemented yet.")); + } + public getEntry(identifier: string): ScopeDeclaration | undefined { return this.entries.get(identifier); } diff --git a/kipper/core/src/compiler/analysis/symbol-table/scope.ts b/kipper/core/src/compiler/analysis/symbol-table/scope.ts index 566c03c44..97bcb0597 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/scope.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/scope.ts @@ -2,8 +2,13 @@ * A symbol-table implementation in form of a scope that may contain both variables and functions. * @since 0.8.0 */ -import type { FunctionDeclaration, VariableDeclaration } from "../../ast"; -import type { ScopeDeclaration, ScopeFunctionDeclaration, ScopeVariableDeclaration } from "./entry"; +import type { FunctionDeclaration, TypeDeclaration, VariableDeclaration } from "../../ast"; +import type { + ScopeDeclaration, + ScopeFunctionDeclaration, + ScopeTypeDeclaration, + ScopeVariableDeclaration, +} from "./entry"; import type { SymbolTable } from "./symbol-table"; /** @@ -50,6 +55,14 @@ export abstract class Scope implements SymbolTable { */ public abstract addFunction(declaration: FunctionDeclaration): ScopeFunctionDeclaration; + /** + * Adds a new type declaration to the {@link entries symbol table entries}. + * @param declaration The declaration to add. + * @returns The generated {@link ScopeTypeDeclaration scope declaration}. + * @since 0.11.0 + */ + public abstract addType(declaration: TypeDeclaration): ScopeTypeDeclaration; + /** * Searches for a reference/entry with the specific identifier in the local hash table entries (local scope). * diff --git a/kipper/core/src/compiler/analysis/type.ts b/kipper/core/src/compiler/analysis/type.ts deleted file mode 100644 index 32466c5a9..000000000 --- a/kipper/core/src/compiler/analysis/type.ts +++ /dev/null @@ -1,148 +0,0 @@ -/** - * A type that has not been checked yet and may contain an invalid or unknown type. - * @since 0.10.0 - */ -import type { KipperCompilableType, KipperType } from "../const"; -import { TypeNotCompilableError } from "../../errors"; - -/** - * Represents an undefined custom type that was specified by the user, but can not be evaluated. - * - * This is used to represent an invalid type that can not be used for type checking. If a type like this is encountered, - * then the type checking will silently fail, as this type should have already thrown an error. - * @since 0.10.0 - */ -export class UndefinedCustomType { - constructor(public readonly identifier: string) {} -} - -/** - * The abstract base type of a general type that may exist/be valid, but also - * may not. This is a general representation to store a type's information - * in the {@link CompilableASTNode.semanticData semantic data} and - * {@link CompilableASTNode.typeData type data} of an {@link CompilableASTNode}. - * @since 0.10.0 - */ -export abstract class Type { - protected readonly _identifier: string; - - protected constructor(identifier: string) { - this._identifier = identifier; - } - - /** - * The identifier of this type. - * @since 0.10.0 - */ - public get identifier(): string { - return this._identifier; - } -} - -/** - * An unchecked type wrapper that may contain any type, even if it does not exist or is invalid. - * @since 0.10.0 - */ -export class UncheckedType extends Type { - constructor(identifier: string) { - super(identifier); - } - - /** - * The identifier of this type. - * - * This identifier has not been type-checked yet, and may not exist/be valid. - * @since 0.10.0 - */ - public get identifier(): string { - return super.identifier; - } -} - -/** - * A wrapper class for a {@link KipperType} that is used to properly represent a type during type checking. This is - * primarily intended to check to handle invalid/undefined types and continue with type checking despite their - * existence. - * - * This type may be used for a compilation if the field {@link CheckedType.isCompilable isCompilable} is true. - * @since 0.10.0 - */ -export class CheckedType extends Type { - protected readonly _kipperType: KipperType; - protected readonly _isCompilable: boolean; - - private constructor(identifier: string, kipperType: KipperType) { - super(identifier); - this._kipperType = kipperType; - this._isCompilable = !(this._kipperType instanceof UndefinedCustomType); - } - - /** - * Creates a new {@link CheckedType} instance based on the passed {@link KipperType}. - * - * If the type is invalid, the function will still return a {@link CheckedType}, but the field - * {@link CheckedType.isCompilable isCompilable} will be false and the instance WILL NOT be usable for a compilation. - */ - public static fromKipperType(kipperType: KipperType): CheckedType { - return new CheckedType(kipperType instanceof UndefinedCustomType ? kipperType.identifier : kipperType, kipperType); - } - - /** - * Creates a new instance of this class using the given {@link kipperType}. - * - * This instance will ALWAYS be compilable, since the type {@link KipperCompilableType} automatically excludes any - * undefined/invalid types to be stored in this class. - * @param kipperType The type to use for the created of a checked type. - */ - public static fromCompilableType(kipperType: KipperCompilableType): CheckedType { - return new CheckedType(kipperType, kipperType); - } - - /** - * The identifier of this type. - * - * If {@link kipperType} is of type {@link UndefinedCustomType}, then this will return the invalid - * {@link UndefinedCustomType.identifier type identifier} of {@link UndefinedCustomType}. - */ - public get identifier(): string { - return this._identifier; - } - - /** - * The {@link identifier} in a {@link KipperType} format. - * - * This mainly differentiates from {@link identifier} by possibly returning the class {@link UndefinedCustomType}, - * which represents an invalid type that should still be stored though. - */ - public get kipperType(): KipperType { - return this._kipperType; - } - - /** - * Returns whether the type is compilable. - * - * This function exists, since during type checking an undefined/invalid type may be encountered that should still - * be stored using this class though (but NOT compiled!). - * @since 0.10.0 - */ - public get isCompilable(): boolean { - return this._isCompilable; - } - - /** - * Gets the compilable type for this type. - * - * This function throws an error instead of returning undefined, since it's intended to be used in circumstances, - * where only due to a bug the type is not compilable. As such, it makes sense to strictly assert it will be - * compilable, unless an error occurs. - * @throws UndefinedCustomType If the {@link isCompilable} is false, which - * should only occur if the identifier is of type {@link UndefinedCustomType}. - * @since 0.10.0 - */ - public getCompilableType(): KipperCompilableType { - if (!this.isCompilable) { - throw new TypeNotCompilableError(); - } - return this.kipperType; - } -} diff --git a/kipper/core/src/compiler/analysis/types/built-in-type.ts b/kipper/core/src/compiler/analysis/types/built-in-type.ts new file mode 100644 index 000000000..e320196b9 --- /dev/null +++ b/kipper/core/src/compiler/analysis/types/built-in-type.ts @@ -0,0 +1,14 @@ +import { ProcessedType } from "./processed-type"; +import type { KipperCompilableType } from "../../const"; +import { KipperNotImplementedError } from "../../../errors"; + +/** + * Represents a built-in type that is used in the type analysis phase. + * @since 0.11.0 + */ +export class BuiltInType extends ProcessedType { + public constructor(identifier: KipperCompilableType) { + super(identifier, identifier); + throw new KipperNotImplementedError("Built-in type wrapper classes are not implement yet"); + } +} diff --git a/kipper/core/src/compiler/analysis/types/custom-type.ts b/kipper/core/src/compiler/analysis/types/custom-type.ts new file mode 100644 index 000000000..a90432de1 --- /dev/null +++ b/kipper/core/src/compiler/analysis/types/custom-type.ts @@ -0,0 +1,21 @@ +import { ProcessedType } from "./processed-type"; +import type { KipperCompilableType } from "../../const"; +import { KipperNotImplementedError } from "../../../errors"; + +export type CustomTypeConstraint = CustomPrimitiveTypeConstraint | CustomObjectTypeConstraint; +export type CustomPrimitiveTypeConstraint = KipperCompilableType; +export type CustomObjectTypeConstraint = { [key: string]: CustomTypeConstraint }; + +/** + * Represents a custom type which is not a built-in type. + * + * This type implements its own type constraints and can be used to represent complex type structures. + * @since 0.11.0 + */ +export class CustomType extends ProcessedType { + public constructor(identifier: string, constraints: CustomTypeConstraint) { + // TODO! Implement proper custom types once we can migrate past the old type system + super(identifier, "void"); + throw new KipperNotImplementedError("Custom types are not implement yet"); + } +} diff --git a/kipper/core/src/compiler/analysis/types/index.ts b/kipper/core/src/compiler/analysis/types/index.ts new file mode 100644 index 000000000..e5f7a6da9 --- /dev/null +++ b/kipper/core/src/compiler/analysis/types/index.ts @@ -0,0 +1,10 @@ +/** + * Types which are used in the type analysis phase. + * @since 0.11.0 + */ +export * from "./type"; +export * from "./raw-type"; +export * from "./processed-type"; +export * from "./undefined-type"; +export * from "./custom-type"; +export * from "./built-in-type"; diff --git a/kipper/core/src/compiler/analysis/types/processed-type.ts b/kipper/core/src/compiler/analysis/types/processed-type.ts new file mode 100644 index 000000000..8310f2625 --- /dev/null +++ b/kipper/core/src/compiler/analysis/types/processed-type.ts @@ -0,0 +1,101 @@ +import { Type } from "./type"; +import type { KipperCompilableType, KipperType } from "../../const"; +import { UndefinedType } from "./undefined-type"; +import { TypeNotCompilableError } from "../../../errors"; + +/** + * A wrapper class for a {@link KipperType} that is used to properly represent a type during type checking. This is + * primarily intended to check to handle invalid/undefined types and continue with type checking despite their + * existence. + * + * This type may be used for a compilation if the field {@link CheckedType.isCompilable isCompilable} is true. + * @since 0.10.0 + */ +export class ProcessedType extends Type { + protected readonly _rawType: KipperType; + protected readonly _isCompilable: boolean; + + protected constructor(identifier: string, rawType: KipperType) { + super(identifier); + this._rawType = rawType; + this._isCompilable = !(this._rawType instanceof UndefinedType); + } + + /** + * Gets the actual type stored in this class, which may be undefined if the type doesn't exist ({@link isCompilable} + * is false). + * @since 0.11.0 + */ + public get(): KipperCompilableType | undefined { + return this.isCompilable ? this.rawType : undefined; + } + + /** + * Creates a new {@link ProcessedType} instance based on the passed {@link KipperType}. + * + * If the type is invalid, the function will still return a {@link ProcessedType}, but the field + * {@link CheckedType.isCompilable isCompilable} will be false and the instance WILL NOT be usable for a compilation. + */ + public static fromKipperType(kipperType: KipperType): ProcessedType { + return new ProcessedType(kipperType instanceof UndefinedType ? kipperType.identifier : kipperType, kipperType); + } + + /** + * Creates a new instance of this class using the given {@link rawType}. + * + * This instance will ALWAYS be compilable, since the type {@link KipperCompilableType} automatically excludes any + * undefined/invalid types to be stored in this class. + * @param kipperType The type to use for the created of a checked type. + */ + public static fromCompilableType(kipperType: KipperCompilableType): ProcessedType { + return new ProcessedType(kipperType, kipperType); + } + + /** + * The identifier of this type. + * + * If {@link rawType} is of type {@link UndefinedType}, then this will return the invalid + * {@link UndefinedType.identifier type identifier} of {@link UndefinedType}. + */ + public get identifier(): string { + return this._identifier; + } + + /** + * The {@link identifier} in a {@link KipperType} format. + * + * This mainly differentiates from {@link identifier} by possibly returning the class {@link UndefinedType}, + * which represents an invalid type that should still be stored though. + */ + public get rawType(): KipperType { + return this._rawType; + } + + /** + * Returns whether the type is compilable. + * + * This function exists, since during type checking an undefined/invalid type may be encountered that should still + * be stored using this class though (but NOT compiled!). + * @since 0.10.0 + */ + public get isCompilable(): boolean { + return this._isCompilable; + } + + /** + * Gets the compilable type for this type. + * + * This function throws an error instead of returning undefined, since it's intended to be used in circumstances, + * where only due to a bug the type is not compilable. As such, it makes sense to strictly assert it will be + * compilable, unless an error occurs. + * @throws UndefinedType If the {@link isCompilable} is false, which + * should only occur if the identifier is of type {@link UndefinedType}. + * @since 0.10.0 + */ + public getCompilableType(): KipperCompilableType { + if (!this.isCompilable) { + throw new TypeNotCompilableError(); + } + return this.rawType; + } +} diff --git a/kipper/core/src/compiler/analysis/types/raw-type.ts b/kipper/core/src/compiler/analysis/types/raw-type.ts new file mode 100644 index 000000000..2f12e1d2f --- /dev/null +++ b/kipper/core/src/compiler/analysis/types/raw-type.ts @@ -0,0 +1,21 @@ +import { Type } from "./type"; + +/** + * An unchecked type wrapper that may contain any type, even if it does not exist or is invalid. + * @since 0.10.0 + */ +export class RawType extends Type { + constructor(identifier: string) { + super(identifier); + } + + /** + * The identifier of this type. + * + * This identifier has not been type-checked yet, and may not exist/be valid. + * @since 0.10.0 + */ + public get identifier(): string { + return super.identifier; + } +} diff --git a/kipper/core/src/compiler/analysis/types/type.ts b/kipper/core/src/compiler/analysis/types/type.ts new file mode 100644 index 000000000..d2e44183f --- /dev/null +++ b/kipper/core/src/compiler/analysis/types/type.ts @@ -0,0 +1,22 @@ +/** + * The abstract base type of a general type that may exist/be valid, but also + * may not. This is a general representation to store a type's information + * in the {@link CompilableASTNode.semanticData semantic data} and + * {@link CompilableASTNode.typeData type data} of an {@link CompilableASTNode}. + * @since 0.10.0 + */ +export abstract class Type { + protected readonly _identifier: string; + + protected constructor(identifier: string) { + this._identifier = identifier; + } + + /** + * The identifier of this type. + * @since 0.10.0 + */ + public get identifier(): string { + return this._identifier; + } +} diff --git a/kipper/core/src/compiler/analysis/types/undefined-type.ts b/kipper/core/src/compiler/analysis/types/undefined-type.ts new file mode 100644 index 000000000..dfdd1f2db --- /dev/null +++ b/kipper/core/src/compiler/analysis/types/undefined-type.ts @@ -0,0 +1,10 @@ +/** + * Represents an undefined custom type that was specified by the user, but can not be evaluated. + * + * This is used to represent an invalid type that can not be used for type checking. If a type like this is encountered, + * then the type checking will silently fail, as this type should have already thrown an error. + * @since 0.10.0 + */ +export class UndefinedType { + constructor(public readonly identifier: string) {} +} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration-semantics.ts index 7c5d20d73..d377f5031 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration-semantics.ts @@ -2,7 +2,7 @@ * Semantics for AST Node {@link FunctionDeclaration}. * @since 0.3.0 */ -import type { UncheckedType } from "../../../../analysis"; +import type { RawType } from "../../../../analysis"; import type { CompoundStatement, IdentifierTypeSpecifierExpression, ParameterDeclaration } from "../../../nodes"; import type { DeclarationSemantics } from "../declaration-semantics"; @@ -20,7 +20,7 @@ export interface FunctionDeclarationSemantics extends DeclarationSemantics { * The {@link KipperType return type} of the function. * @since 0.5.0 */ - returnType: UncheckedType; + returnType: RawType; /** * The type specifier expression for the return type. * @since 0.10.0 diff --git a/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration-type-semantics.ts index 9392138da..d1521f055 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration-type-semantics.ts @@ -2,7 +2,7 @@ * Type semantics for AST Node {@link FunctionDeclaration}. * @since 0.10.0 */ -import type { CheckedType } from "../../../../analysis"; +import type { ProcessedType } from "../../../../analysis"; import type { DeclarationTypeSemantics } from "../declaration-type-semantics"; /** @@ -14,5 +14,5 @@ export interface FunctionDeclarationTypeSemantics extends DeclarationTypeSemanti * The {@link KipperType return type} of the function. * @since 0.10.0 */ - returnType: CheckedType; + returnType: ProcessedType; } 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 c86d1a323..4bebc0b16 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 @@ -9,7 +9,7 @@ import type { FunctionDeclarationTypeSemantics } from "./function-declaration-ty import type { CompilableNodeParent } from "../../../compilable-ast-node"; import type { CompoundStatement, Statement } from "../../statements"; import type { IdentifierTypeSpecifierExpression } from "../../expressions"; -import type { ScopeFunctionDeclaration, UncheckedType } from "../../../../analysis"; +import type { ScopeFunctionDeclaration, RawType } from "../../../../analysis"; import { FunctionScope } from "../../../../analysis"; import type { FunctionDeclarationContext } from "../../../../parser"; import { @@ -174,7 +174,7 @@ export class FunctionDeclaration this.programCtx.semanticCheck(this).validFunctionBody(body); const identifier = this.tokenStream.getText(declaratorCtx.sourceInterval); - const type: UncheckedType = retTypeSpecifier.getSemanticData().typeIdentifier; + const type: RawType = retTypeSpecifier.getSemanticData().typeIdentifier; this.semanticData = { isDefined: parseTreeChildren.find((val) => val instanceof CompoundStatementContext) !== undefined, diff --git a/kipper/core/src/compiler/ast/nodes/declarations/index.ts b/kipper/core/src/compiler/ast/nodes/declarations/index.ts index b4c28662f..732b9860f 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/index.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/index.ts @@ -9,5 +9,4 @@ export * from "./declaration-type-semantics"; export * from "./parameter-declaration/"; export * from "./function-declaration/"; export * from "./variable-declaration/"; -export * from "./type-declaration/class-declaration/"; -export * from "./type-declaration/interface-declaration/"; +export * from "./type-declaration/"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-semantics.ts index 2e4118c63..6c0b56c65 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-semantics.ts @@ -2,7 +2,7 @@ * Semantics for AST Node {@link FunctionDeclaration}. * @since 0.3.0 */ -import type { UncheckedType } from "../../../../analysis"; +import type { RawType } from "../../../../analysis"; import type { FunctionDeclaration, IdentifierTypeSpecifierExpression } from "../../../nodes"; import type { DeclarationSemantics } from "../declaration-semantics"; @@ -20,7 +20,7 @@ export interface ParameterDeclarationSemantics extends DeclarationSemantics { * The {@link KipperType type} of the parameter. * @since 0.5.0 */ - valueType: UncheckedType; + valueType: RawType; /** * The type specifier expression for the parameter type. * @since 0.10.0 diff --git a/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-type-semantics.ts index 49170ea1d..d36ad00e9 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-type-semantics.ts @@ -2,7 +2,7 @@ * Type semantics for AST Node {@link FunctionDeclaration}. * @since 0.10.0 */ -import type { CheckedType } from "../../../../analysis"; +import type { ProcessedType } from "../../../../analysis"; import type { DeclarationTypeSemantics } from "../declaration-type-semantics"; /** @@ -14,5 +14,5 @@ export interface ParameterDeclarationTypeSemantics extends DeclarationTypeSemant * The {@link KipperType type} of the parameter. * @since 0.10.0 */ - valueType: CheckedType; + valueType: ProcessedType; } diff --git a/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-semantics.ts index f2f46ef42..68a1ad5c2 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-semantics.ts @@ -3,7 +3,7 @@ * @since 0.3.0 */ import type { KipperStorageType } from "../../../../const"; -import type { Scope, UncheckedType } from "../../../../analysis"; +import type { Scope, RawType } from "../../../../analysis"; import type { Expression, IdentifierTypeSpecifierExpression } from "../../../nodes"; import type { DeclarationSemantics } from "../declaration-semantics"; @@ -28,7 +28,7 @@ export interface VariableDeclarationSemantics extends DeclarationSemantics { * The identifier of the {@link valueTypeSpecifier.semanticData.identifier typeSpecifier}. * @since 0.5.0 */ - valueType: UncheckedType; + valueType: RawType; /** * The type specifier expression for the variable type. * @since 0.10.0 diff --git a/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-type-semantics.ts index 4bca21c55..b81568297 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-type-semantics.ts @@ -2,7 +2,7 @@ * Type semantics for AST Node {@link FunctionDeclaration}. * @since 0.10.0 */ -import type { CheckedType } from "../../../../analysis"; +import type { ProcessedType } from "../../../../analysis"; import type { DeclarationTypeSemantics } from "../declaration-type-semantics"; /** @@ -16,5 +16,5 @@ export interface VariableDeclarationTypeSemantics extends DeclarationTypeSemanti * This is the type evaluated using the {@link VariableDeclarationSemantics.valueType valueType identifier}. * @since 0.10.0 */ - valueType: CheckedType; + valueType: ProcessedType; } 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 0f8879197..d3f97e8f3 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 @@ -8,7 +8,7 @@ import type { VariableDeclarationSemantics } from "./variable-declaration-semantics"; import type { VariableDeclarationTypeSemantics } from "./variable-declaration-type-semantics"; import type { CompilableNodeParent } from "../../../compilable-ast-node"; -import type { ScopeVariableDeclaration, UncheckedType } from "../../../../analysis"; +import type { ScopeVariableDeclaration, RawType } from "../../../../analysis"; import type { Expression, IdentifierTypeSpecifierExpression } from "../../expressions"; import type { ParseTree } from "antlr4ts/tree"; import type { KipperStorageType } from "../../../../const"; @@ -160,7 +160,7 @@ export class VariableDeclaration extends Declarationthis.tokenStream.getText(storageTypeCtx.sourceInterval); - const valueType: UncheckedType = typeSpecifier.getSemanticData().typeIdentifier; + const valueType: RawType = typeSpecifier.getSemanticData().typeIdentifier; this.semanticData = { isDefined: isDefined, diff --git a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-and-expression/bitwise-and-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-and-expression/bitwise-and-expression.ts index cac1e0186..68bc0de35 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-and-expression/bitwise-and-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-and-expression/bitwise-and-expression.ts @@ -16,7 +16,7 @@ import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parse import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { Expression } from "../../expression"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { CheckedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../analysis"; /** * Bitwise and expression AST node. @@ -102,7 +102,7 @@ export class BitwiseAndExpression extends BitwiseExpression< .validBitwiseExpression(semanticData.leftOp, semanticData.rightOp, semanticData.operator); this.typeSemantics = { - evaluatedType: CheckedType.fromCompilableType("num"), + evaluatedType: ProcessedType.fromCompilableType("num"), }; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-or-expression/bitwise-or-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-or-expression/bitwise-or-expression.ts index 2a811f8da..7647b7124 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-or-expression/bitwise-or-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-or-expression/bitwise-or-expression.ts @@ -15,7 +15,7 @@ import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parse import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { Expression } from "../../expression"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { CheckedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../analysis"; import type { BitwiseOrExpressionSemantics } from "./bitwise-or-expression-semantics"; import type { BitwiseOrExpressionTypeSemantics } from "./bitwise-or-expression-type-semantics"; @@ -109,7 +109,7 @@ export class BitwiseOrExpression extends BitwiseExpression< .validBitwiseExpression(semanticData.leftOp, semanticData.rightOp, semanticData.operator); this.typeSemantics = { - evaluatedType: CheckedType.fromCompilableType("num"), + evaluatedType: ProcessedType.fromCompilableType("num"), }; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-shift-expression/bitwise-shift-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-shift-expression/bitwise-shift-expression.ts index 4b98ba23e..381a91375 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-shift-expression/bitwise-shift-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-shift-expression/bitwise-shift-expression.ts @@ -16,7 +16,7 @@ import { BitwiseShiftOperatorsContext, KindParseRuleMapping, ParseRuleKindMappin import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { Expression } from "../../expression"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { CheckedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../analysis"; import type { BitwiseShiftExpressionSemantics } from "./bitwise-shift-expression-semantics"; import type { BitwiseShiftExpressionTypeSemantics } from "./bitwise-shift-expression-type-semantics"; import type { KipperBitwiseShiftOperator } from "../../../../../const"; @@ -134,7 +134,7 @@ export class BitwiseShiftExpression extends BitwiseExpression< .validBitwiseExpression(semanticData.leftOp, semanticData.rightOp, semanticData.operator); this.typeSemantics = { - evaluatedType: CheckedType.fromCompilableType("num"), + evaluatedType: ProcessedType.fromCompilableType("num"), }; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-xor-expression/bitwise-xor-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-xor-expression/bitwise-xor-expression.ts index 0247fec37..d2e86c9fa 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-xor-expression/bitwise-xor-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-xor-expression/bitwise-xor-expression.ts @@ -13,7 +13,7 @@ import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parse import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { Expression } from "../../expression"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { CheckedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../analysis"; import type { BitwiseXorExpressionSemantics } from "./bitwise-xor-expression-semantics"; import type { BitwiseXorExpressionTypeSemantics } from "./bitwise-xor-expression-type-semantics"; @@ -114,7 +114,7 @@ export class BitwiseXorExpression extends BitwiseExpression< .validBitwiseExpression(semanticData.leftOp, semanticData.rightOp, semanticData.operator); this.typeSemantics = { - evaluatedType: CheckedType.fromCompilableType("num"), + evaluatedType: ProcessedType.fromCompilableType("num"), }; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression-semantics.ts index b789929d9..92353ddf9 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression-semantics.ts @@ -4,7 +4,7 @@ */ import type { ExpressionSemantics } from "../expression-semantics"; import type { Expression } from "../expression"; -import type { UncheckedType } from "../../../../analysis"; +import type { RawType } from "../../../../analysis"; import type { IdentifierTypeSpecifierExpression } from "../type-specifier-expression"; /** @@ -21,7 +21,7 @@ export interface CastOrConvertExpressionSemantics extends ExpressionSemantics { * The type the {@link exp} should be converted to. * @since 0.10.0 */ - castType: UncheckedType; + castType: RawType; /** * The type specifier that determined {@link castType}. * @since 0.10.0 diff --git a/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression-type-semantics.ts index c8518ff3b..7d9502141 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression-type-semantics.ts @@ -2,7 +2,7 @@ * Type semantics for AST Node {@link CastOrConvertExpression}. * @since 0.10.0 */ -import type { CheckedType } from "../../../../analysis"; +import type { ProcessedType } from "../../../../analysis"; import type { ExpressionTypeSemantics } from "../expression-type-semantics"; /** @@ -14,5 +14,5 @@ export interface CastOrConvertExpressionTypeSemantics extends ExpressionTypeSema * The type the {@link CastOrConvertExpressionSemantics.exp} should be converted to. * @since 0.10.0 */ - castType: CheckedType; + castType: ProcessedType; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression.ts index 41abd03da..902b51c3d 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression.ts @@ -14,7 +14,7 @@ import type { IdentifierTypeSpecifierExpression } from "../type-specifier-expres import { Expression } from "../expression"; import type { CastOrConvertExpressionContext } from "../../../../parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../parser"; -import type { UncheckedType } from "../../../../analysis"; +import type { RawType } from "../../../../analysis"; import { UnableToDetermineSemanticDataError } from "../../../../../errors"; import { getConversionFunctionIdentifier } from "../../../../../tools"; import { kipperInternalBuiltInFunctions } from "../../../../runtime-built-ins"; @@ -93,7 +93,7 @@ export class CastOrConvertExpression extends Expression< // Get the type using the type specifier const typeSpecifier = this.children[1]; - const type: UncheckedType = typeSpecifier.getSemanticData().typeIdentifier; + const type: RawType = typeSpecifier.getSemanticData().typeIdentifier; // Ensure that the children are fully present and not undefined if (!exp || !type) { diff --git a/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/equality-expression/equality-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/equality-expression/equality-expression.ts index fbbd5b30a..835ffad41 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/equality-expression/equality-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/equality-expression/equality-expression.ts @@ -11,7 +11,7 @@ import type { EqualityExpressionSemantics } from "./equality-expression-semantic import type { EqualityExpressionTypeSemantics } from "./equality-expression-type-semantics"; import type { Expression } from "../../expression"; import { ComparativeExpression } from "../comparative-expression"; -import { CheckedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../analysis"; import type { EqualityExpressionContext } from "../../../../../parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parser"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; @@ -122,7 +122,7 @@ export class EqualityExpression extends ComparativeExpression< public async primarySemanticTypeChecking(): Promise { // Equality expressions always return 'bool' this.typeSemantics = { - evaluatedType: CheckedType.fromCompilableType("bool"), + evaluatedType: ProcessedType.fromCompilableType("bool"), }; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/relational-expression/relational-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/relational-expression/relational-expression.ts index 230df2b3a..0fdc5ddf0 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/relational-expression/relational-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/relational-expression/relational-expression.ts @@ -24,7 +24,7 @@ import type { KipperRelationalOperator } from "../../../../../const"; import { kipperRelationalOperators } from "../../../../../const"; import { TerminalNode } from "antlr4ts/tree/TerminalNode"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { CheckedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../analysis"; /** * Relational expression, which can be used to compare two numeric expressions. @@ -134,7 +134,7 @@ export class RelationalExpression extends ComparativeExpression< public async primarySemanticTypeChecking(): Promise { // Relational expressions always return 'bool' this.typeSemantics = { - evaluatedType: CheckedType.fromCompilableType("bool"), + evaluatedType: ProcessedType.fromCompilableType("bool"), }; // Type check the relational expression and ensure its operands are of type 'num' diff --git a/kipper/core/src/compiler/ast/nodes/expressions/expression-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/expression-type-semantics.ts index f0320c47c..0ef1b7829 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/expression-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/expression-type-semantics.ts @@ -2,7 +2,7 @@ * Type semantics for an expression class that must be evaluated during Type Checking. * @since 0.10.0 */ -import type { CheckedType } from "../../../analysis"; +import type { ProcessedType } from "../../../analysis"; import type { TypeData } from "../../ast-node"; /** @@ -17,5 +17,5 @@ export interface ExpressionTypeSemantics extends TypeData { * This will always evaluate to "type", as a type specifier will always be a type. * @since 0.10.0 */ - evaluatedType: CheckedType; + evaluatedType: ProcessedType; } 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 707ffc393..a40f38251 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 @@ -15,7 +15,7 @@ import { Expression } from "../expression"; import type { FunctionCallExpressionContext } from "../../../../parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../parser"; import { UnableToDetermineSemanticDataError } from "../../../../../errors"; -import { CheckedType } from "../../../../analysis"; +import { ProcessedType } from "../../../../analysis"; /** * Function call class, which represents a function call expression in the Kipper language. @@ -134,11 +134,11 @@ export class FunctionCallExpression extends Expression< this.programCtx.typeCheck(this).validFunctionCallArguments(calledFunc, semanticData.args); // Get the type that the function call will evaluate to - let evaluatedType: CheckedType; - if (calledFunc.returnType instanceof CheckedType) { + let evaluatedType: ProcessedType; + if (calledFunc.returnType instanceof ProcessedType) { evaluatedType = calledFunc.returnType; } else { - evaluatedType = CheckedType.fromCompilableType(calledFunc.returnType); + evaluatedType = ProcessedType.fromCompilableType(calledFunc.returnType); } // The evaluated type is always equal to the return of the function 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 498006a7f..314d39c64 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 @@ -16,7 +16,7 @@ import type { LogicalAndExpressionContext } from "../../../../../parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parser"; import type { CompilableASTNode } from "../../../../compilable-ast-node"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { CheckedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../analysis"; /** * Logical-and expression, representing an expression which can be used to combine multiple conditions. It will @@ -115,7 +115,7 @@ export class LogicalAndExpression extends LogicalExpression< public async primarySemanticTypeChecking(): Promise { // Logical expressions always return 'bool' this.typeSemantics = { - evaluatedType: CheckedType.fromCompilableType("bool"), + evaluatedType: ProcessedType.fromCompilableType("bool"), }; } 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 586c3bc77..73be9f1c4 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 @@ -17,7 +17,7 @@ import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parse import type { CompilableASTNode } from "../../../../compilable-ast-node"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; import { kipperLogicalOrOperator } from "../../../../../const"; -import { CheckedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../analysis"; /** * Logical-or expression, representing an expression which can be used to combine multiple conditions. It returns true @@ -116,7 +116,7 @@ export class LogicalOrExpression extends LogicalExpression< public async primarySemanticTypeChecking(): Promise { // Logical expressions always return 'bool' this.typeSemantics = { - evaluatedType: CheckedType.fromCompilableType("bool"), + evaluatedType: ProcessedType.fromCompilableType("bool"), }; } 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 3d15626ca..0bc400843 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 @@ -14,7 +14,7 @@ import type { IncrementOrDecrementPostfixExpressionContext } from "../../../../. import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parser"; import type { CompilableASTNode } from "../../../../compilable-ast-node"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { CheckedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../analysis"; /** * Increment or Decrement expression, which represents a right-side -- or ++ expression modifying a numeric value. @@ -112,7 +112,7 @@ export class IncrementOrDecrementPostfixExpression extends PostfixExpression< public async primarySemanticTypeChecking(): Promise { this.typeSemantics = { // This will always be a number - evaluatedType: CheckedType.fromKipperType("num"), + evaluatedType: ProcessedType.fromKipperType("num"), }; // Ensure that this expression is valid (e.g. the operand is a number) 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 3571078ee..313015064 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 @@ -7,7 +7,7 @@ import type { ArrayPrimaryExpressionTypeSemantics } from "./array-primary-expres import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { ArrayPrimaryExpressionContext } from "../../../../../parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parser"; -import { CheckedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../analysis"; import { PrimaryExpression } from "../primary-expression"; /** @@ -90,7 +90,7 @@ export class ArrayPrimaryExpression extends PrimaryExpression< public async primarySemanticTypeChecking(): Promise { // This will always be of type 'list' this.typeSemantics = { - evaluatedType: CheckedType.fromCompilableType("list"), + evaluatedType: ProcessedType.fromCompilableType("list"), }; } 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 490f633fa..11d94103e 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 @@ -8,7 +8,7 @@ import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { KipperBoolTypeLiterals } from "../../../../../const"; import type { BoolPrimaryExpressionContext } from "../../../../../parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parser"; -import { CheckedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../analysis"; import { PrimaryExpression } from "../primary-expression"; /** @@ -91,7 +91,7 @@ export class BoolPrimaryExpression extends PrimaryExpression< public async primarySemanticTypeChecking(): Promise { // This will always be of type 'bool' this.typeSemantics = { - evaluatedType: CheckedType.fromCompilableType("bool"), + evaluatedType: ProcessedType.fromCompilableType("bool"), }; } 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 8698e4282..e16e57026 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 @@ -14,7 +14,7 @@ import { ParseRuleKindMapping, } from "../../../../../parser"; import type { CompilableASTNode } from "../../../../compilable-ast-node"; -import { CheckedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../analysis"; import { getParseRuleSource } from "../../../../../../tools"; /** @@ -116,7 +116,7 @@ export class FStringPrimaryExpression extends Expression< public async primarySemanticTypeChecking(): Promise { // This will always be of type 'str' this.typeSemantics = { - evaluatedType: CheckedType.fromCompilableType("str"), + evaluatedType: ProcessedType.fromCompilableType("str"), }; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/identifier-primary-expression/identifier-primary-expression-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/identifier-primary-expression/identifier-primary-expression-type-semantics.ts index d75c90fdd..c38dd1016 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/identifier-primary-expression/identifier-primary-expression-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/identifier-primary-expression/identifier-primary-expression-type-semantics.ts @@ -2,7 +2,7 @@ * Type semantics for AST Node {@link IdentifierPrimaryExpression}. * @since 0.10.0 */ -import type { CheckedType } from "../../../../../analysis"; +import type { ProcessedType } from "../../../../../analysis"; import type { PrimaryExpressionTypeSemantics } from "../primary-expression-type-semantics"; /** @@ -17,5 +17,5 @@ export interface IdentifierPrimaryExpressionTypeSemantics extends PrimaryExpress * {@link IdentifierPrimaryExpressionSemantics.identifier identifier} points to. * @since 0.10.0 */ - evaluatedType: CheckedType; + evaluatedType: ProcessedType; } 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 ce851a2cf..6330798e4 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 @@ -9,7 +9,7 @@ import type { IdentifierPrimaryExpressionTypeSemantics } from "./identifier-prim import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { IdentifierPrimaryExpressionContext } from "../../../../../parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parser"; -import { CheckedType, ScopeDeclaration } from "../../../../../analysis"; +import { ProcessedType, ScopeDeclaration } from "../../../../../analysis"; import { AssignmentExpression } from "../../assignment-expression/assignment-expression"; import { PrimaryExpression } from "../primary-expression"; @@ -119,12 +119,12 @@ export class IdentifierPrimaryExpression extends PrimaryExpression< const semanticData = this.getSemanticData(); const refTarget = semanticData.ref.refTarget; - let type: CheckedType; + let type: ProcessedType; if (refTarget instanceof ScopeDeclaration) { type = refTarget.type; } else { // Built-in function -> type is 'func' - type = CheckedType.fromCompilableType("valueType" in refTarget ? refTarget.valueType : "func"); + type = ProcessedType.fromCompilableType("valueType" in refTarget ? refTarget.valueType : "func"); } this.typeSemantics = { 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 cc38437f0..515396ba1 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 @@ -7,7 +7,7 @@ import type { NumberPrimaryExpressionTypeSemantics } from "./number-primary-expr import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { NumberPrimaryExpressionContext } from "../../../../../parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parser"; -import { CheckedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../analysis"; import { PrimaryExpression } from "../primary-expression"; /** @@ -92,7 +92,7 @@ export class NumberPrimaryExpression extends PrimaryExpression< public async primarySemanticTypeChecking(): Promise { // This will always be of type 'number' this.typeSemantics = { - evaluatedType: CheckedType.fromCompilableType("num"), + evaluatedType: ProcessedType.fromCompilableType("num"), }; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/string-primary-expression/string-primary-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/string-primary-expression/string-primary-expression.ts index 88f59b121..9894ee034 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/string-primary-expression/string-primary-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/string-primary-expression/string-primary-expression.ts @@ -7,7 +7,7 @@ import type { StringPrimaryExpressionTypeSemantics } from "./string-primary-expr import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { StringPrimaryExpressionContext } from "../../../../../parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parser"; -import { CheckedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../analysis"; import { PrimaryExpression } from "../primary-expression"; /** @@ -91,7 +91,7 @@ export class StringPrimaryExpression extends PrimaryExpression< public async primarySemanticTypeChecking(): Promise { // This will always be of type 'str' this.typeSemantics = { - evaluatedType: CheckedType.fromCompilableType("str"), + evaluatedType: ProcessedType.fromCompilableType("str"), }; } 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 160510eb2..174c7a9b4 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 @@ -8,7 +8,7 @@ import type { VoidOrNullOrUndefinedPrimaryExpressionSemantics } from "./void-or- import type { VoidOrNullOrUndefinedPrimaryExpressionTypeSemantics } from "./void-or-null-or-undefined-primary-expression-type-semantics"; import type { VoidOrNullOrUndefinedPrimaryExpressionContext } from "../../../../../parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parser"; -import { CheckedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../analysis"; import { PrimaryExpression } from "../primary-expression"; /** @@ -93,7 +93,7 @@ export class VoidOrNullOrUndefinedPrimaryExpression extends PrimaryExpression< // The evaluated type of this expression will always be equal to the constant identifier that this expression // contains e.g. either 'void', 'null' or 'undefined'. this.typeSemantics = { - evaluatedType: CheckedType.fromCompilableType(semanticData.constantIdentifier), + evaluatedType: ProcessedType.fromCompilableType(semanticData.constantIdentifier), }; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/identifier-type-specifier-expression/identifier-type-specifier-expression-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/identifier-type-specifier-expression/identifier-type-specifier-expression-semantics.ts index e48b6bf06..078725f10 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/identifier-type-specifier-expression/identifier-type-specifier-expression-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/identifier-type-specifier-expression/identifier-type-specifier-expression-semantics.ts @@ -2,7 +2,7 @@ * Semantics for AST Node {@link IdentifierTypeSpecifierExpression}. * @since 0.8.0 */ -import type { UncheckedType } from "../../../../../analysis"; +import type { RawType } from "../../../../../analysis"; import type { TypeSpecifierExpressionSemantics } from "../type-specifier-expression-semantics"; /** @@ -15,5 +15,5 @@ export interface IdentifierTypeSpecifierExpressionSemantics extends TypeSpecifie * therefore may be invalid/undefined. * @since 0.8.0 */ - typeIdentifier: UncheckedType; + typeIdentifier: RawType; } 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 734eb35ad..b5d19a394 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 @@ -13,7 +13,7 @@ import type { CompilableASTNode } from "../../../../compilable-ast-node"; import { TypeSpecifierExpression } from "../type-specifier-expression"; import type { IdentifierTypeSpecifierExpressionContext } from "../../../../../parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parser"; -import { CheckedType, UncheckedType } from "../../../../../analysis"; +import { ProcessedType, RawType } from "../../../../../analysis"; /** * Type specifier expression, which represents a simple identifier type specifier. @@ -85,7 +85,7 @@ export class IdentifierTypeSpecifierExpression extends TypeSpecifierExpression< */ public async primarySemanticAnalysis(): Promise { this.semanticData = { - typeIdentifier: new UncheckedType(this.sourceCode), + typeIdentifier: new RawType(this.sourceCode), }; } @@ -101,7 +101,7 @@ export class IdentifierTypeSpecifierExpression extends TypeSpecifierExpression< const valueType = this.programCtx.typeCheck(this).getCheckedType(semanticData.typeIdentifier); this.typeSemantics = { // A type specifier will always evaluate to be of type 'type' - evaluatedType: CheckedType.fromCompilableType("type"), + evaluatedType: ProcessedType.fromCompilableType("type"), storedType: valueType, }; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/type-specifier-expression-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/type-specifier-expression-type-semantics.ts index 284abeb1c..ee0b1f1fa 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/type-specifier-expression-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/type-specifier-expression-type-semantics.ts @@ -2,7 +2,7 @@ * Type semantics for AST Node {@link TypeSpecifierExpression}. * @since 0.10.0 */ -import type { CheckedType } from "../../../../analysis"; +import type { ProcessedType } from "../../../../analysis"; import type { ExpressionTypeSemantics } from "../expression-type-semantics"; /** @@ -15,5 +15,5 @@ export interface TypeSpecifierExpressionTypeSemantics extends ExpressionTypeSema * values should be stored in a variable. * @since 0.10.0 */ - storedType: CheckedType; + storedType: ProcessedType; } 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 2a327b0b2..841b5629d 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 @@ -14,7 +14,7 @@ import { UnaryExpression } from "../unary-expression"; import type { IncrementOrDecrementUnaryExpressionContext } from "../../../../../parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parser"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { CheckedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../analysis"; /** * Increment or decrement expression class, which represents a left-side -- or ++ expression modifying a numeric value. @@ -112,7 +112,7 @@ export class IncrementOrDecrementUnaryExpression extends UnaryExpression< public async primarySemanticTypeChecking(): Promise { this.typeSemantics = { // This will always be a number - evaluatedType: CheckedType.fromKipperType("num"), + evaluatedType: ProcessedType.fromKipperType("num"), }; // Ensure that this expression is valid (e.g. the operand is a number) 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 3ad8fe4ba..bd99e9caf 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 @@ -16,7 +16,7 @@ import { UnaryExpression } from "../unary-expression"; import type { OperatorModifiedUnaryExpressionContext } from "../../../../../parser"; import { KindParseRuleMapping, ParseRuleKindMapping, UnaryOperatorContext } from "../../../../../parser"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { CheckedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../analysis"; /** * Operator modified expressions, which are used to modify the value of an expression based on an @@ -125,7 +125,7 @@ export class OperatorModifiedUnaryExpression extends UnaryExpression< const semanticData = this.getSemanticData(); this.typeSemantics = { - evaluatedType: CheckedType.fromCompilableType(semanticData.operator === "!" ? "bool" : "num"), + evaluatedType: ProcessedType.fromCompilableType(semanticData.operator === "!" ? "bool" : "num"), }; // Ensure the operator is compatible with the type of the operand diff --git a/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement-type-semantics.ts index 37d842f7b..26a1508cf 100644 --- a/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement-type-semantics.ts @@ -2,7 +2,7 @@ * Type semantics for a {@link ReturnStatement}. * @since 0.10.0 */ -import type { CheckedType } from "../../../../analysis"; +import type { ProcessedType } from "../../../../analysis"; import type { StatementTypeSemantics } from "../statement-type-semantics"; /** @@ -14,5 +14,5 @@ export interface ReturnStatementTypeSemantics extends StatementTypeSemantics { * The type of value returned by this return statement. * @since 0.10.0 */ - returnType: CheckedType | undefined; + returnType: ProcessedType | undefined; } diff --git a/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement.ts b/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement.ts index 9662d3914..03b79b4d5 100644 --- a/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement.ts +++ b/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement.ts @@ -7,7 +7,7 @@ import type { ReturnStatementSemantics } from "./return-statement-semantics"; import type { ReturnStatementTypeSemantics } from "./return-statement-type-semantics"; import type { Expression } from "../../expressions"; import { Statement } from "../statement"; -import { CheckedType } from "../../../../analysis"; +import { ProcessedType } from "../../../../analysis"; import type { ReturnStatementContext } from "../../../../parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../parser"; @@ -116,7 +116,7 @@ export class ReturnStatement extends Statement = [ * All error types inside Kipper, which indicate an invalid type that can not be used for type checking. * @since 0.10.0 */ -export type KipperErrorType = UndefinedCustomType; +export type KipperErrorType = UndefinedType; /** * All available variable types inside Kipper. diff --git a/kipper/core/src/errors.ts b/kipper/core/src/errors.ts index 920eb1b03..7f1956cc3 100644 --- a/kipper/core/src/errors.ts +++ b/kipper/core/src/errors.ts @@ -273,7 +273,7 @@ export class UnableToGetInnerScopeError extends KipperInternalError { /** * Error that is thrown whenever {@link CheckedType.getCompilableType} is called, despite the type not being compilable. * - * This is thrown to avoid the compiler from using {@link UndefinedCustomType} for a compilation, as that would cause + * This is thrown to avoid the compiler from using {@link UndefinedType} for a compilation, as that would cause * undefined behavior. * @since 0.10.0 */ From a323cb4d2cf11013c5398803a197d16ebb436075 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Wed, 3 Jul 2024 16:29:03 +0200 Subject: [PATCH 08/57] other: Prettified code and optimised imports --- .../analysis/symbol-table/global-scope.ts | 6 +- kipper/core/src/compiler/ast/ast-generator.ts | 2 +- .../core/src/compiler/ast/common/ast-types.ts | 2 +- .../compiler/ast/mapping/ast-node-mapper.ts | 8 +- .../function-declaration.ts | 2 +- .../interface-declaration.ts | 1 - .../variable-declaration-semantics.ts | 2 +- .../variable-declaration.ts | 2 +- .../src/compiler/parser/antlr/KipperLexer.ts | 3 - .../src/compiler/parser/antlr/KipperParser.ts | 7 +- .../parser/antlr/KipperParserListener.ts | 226 +++++++++--------- .../parser/antlr/KipperParserVisitor.ts | 226 +++++++++--------- kipper/core/src/compiler/parser/parse-data.ts | 4 +- .../target-presets/semantic-analyser.ts | 5 +- 14 files changed, 244 insertions(+), 252 deletions(-) diff --git a/kipper/core/src/compiler/analysis/symbol-table/global-scope.ts b/kipper/core/src/compiler/analysis/symbol-table/global-scope.ts index 2e4ed732a..bad8450b2 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/global-scope.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/global-scope.ts @@ -4,11 +4,9 @@ * @since 0.8.0 */ import type { KipperProgramContext } from "../../program-ctx"; -import type { FunctionDeclaration, VariableDeclaration } from "../../ast"; +import type { FunctionDeclaration, TypeDeclaration, VariableDeclaration } from "../../ast"; import type { ScopeDeclaration } from "./entry"; -import type { TypeDeclaration } from "../../ast"; -import { ScopeTypeDeclaration } from "./entry"; -import { ScopeFunctionDeclaration, ScopeVariableDeclaration } from "./entry"; +import { ScopeFunctionDeclaration, ScopeTypeDeclaration, ScopeVariableDeclaration } from "./entry"; import { Scope } from "./scope"; /** diff --git a/kipper/core/src/compiler/ast/ast-generator.ts b/kipper/core/src/compiler/ast/ast-generator.ts index 5c0d4c40b..bee45d321 100644 --- a/kipper/core/src/compiler/ast/ast-generator.ts +++ b/kipper/core/src/compiler/ast/ast-generator.ts @@ -76,7 +76,7 @@ import type { import type { KipperProgramContext } from "../program-ctx"; import type { CompilableASTNode } from "./compilable-ast-node"; import type { ParserRuleContext } from "antlr4ts/ParserRuleContext"; -import { Declaration, Expression, Statement, RootASTNode } from "./nodes"; +import { Declaration, Expression, RootASTNode, Statement } from "./nodes"; import { DeclarationASTNodeFactory, ExpressionASTNodeFactory, StatementASTNodeFactory } from "./factories"; import { KipperInternalError } from "../../errors"; diff --git a/kipper/core/src/compiler/ast/common/ast-types.ts b/kipper/core/src/compiler/ast/common/ast-types.ts index 06533ca76..cd260fcc0 100644 --- a/kipper/core/src/compiler/ast/common/ast-types.ts +++ b/kipper/core/src/compiler/ast/common/ast-types.ts @@ -32,6 +32,7 @@ import type { IncrementOrDecrementUnaryExpressionContext, InterfaceDeclarationContext, JumpStatementContext, + KindParseRuleMapping, LogicalAndExpressionContext, LogicalOrExpressionContext, MultiplicativeExpressionContext, @@ -49,7 +50,6 @@ import type { VoidOrNullOrUndefinedPrimaryExpressionContext, WhileLoopIterationStatementContext, } from "../../parser"; -import type { KindParseRuleMapping } from "../../parser"; /** * Union type of all usable expression rule context classes implemented by the {@link ParseRuleKindMapping} for an 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 974a55cca..2655b83cb 100644 --- a/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts +++ b/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts @@ -67,6 +67,10 @@ import { AdditiveExpression, ArrayPrimaryExpression, AssignmentExpression, + BitwiseAndExpression, + BitwiseOrExpression, + BitwiseShiftExpression, + BitwiseXorExpression, BoolPrimaryExpression, CastOrConvertExpression, ClassDeclaration, @@ -105,10 +109,6 @@ import { VariableDeclaration, VoidOrNullOrUndefinedPrimaryExpression, WhileLoopIterationStatement, - BitwiseOrExpression, - BitwiseXorExpression, - BitwiseShiftExpression, - BitwiseAndExpression, } from "../nodes"; /** 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 4bebc0b16..fe2949347 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 @@ -9,7 +9,7 @@ import type { FunctionDeclarationTypeSemantics } from "./function-declaration-ty import type { CompilableNodeParent } from "../../../compilable-ast-node"; import type { CompoundStatement, Statement } from "../../statements"; import type { IdentifierTypeSpecifierExpression } from "../../expressions"; -import type { ScopeFunctionDeclaration, RawType } from "../../../../analysis"; +import type { RawType, ScopeFunctionDeclaration } from "../../../../analysis"; import { FunctionScope } from "../../../../analysis"; import type { FunctionDeclarationContext } from "../../../../parser"; import { 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 0527e8cd9..22c1b5ad7 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 @@ -8,7 +8,6 @@ import type { CompilableNodeParent } from "../../../../compilable-ast-node"; import type { ScopeTypeDeclaration } from "../../../../../analysis"; import type { InterfaceDeclarationContext } from "../../../../../parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parser"; -import { Declaration } from "../../declaration"; import { KipperNotImplementedError } from "../../../../../../errors"; import { TypeDeclaration } from "../type-declaration"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-semantics.ts index 68a1ad5c2..a5fac9081 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-semantics.ts @@ -3,7 +3,7 @@ * @since 0.3.0 */ import type { KipperStorageType } from "../../../../const"; -import type { Scope, RawType } from "../../../../analysis"; +import type { RawType, Scope } from "../../../../analysis"; import type { Expression, IdentifierTypeSpecifierExpression } from "../../../nodes"; import type { DeclarationSemantics } from "../declaration-semantics"; 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 d3f97e8f3..34ffb3904 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 @@ -8,7 +8,7 @@ import type { VariableDeclarationSemantics } from "./variable-declaration-semantics"; import type { VariableDeclarationTypeSemantics } from "./variable-declaration-type-semantics"; import type { CompilableNodeParent } from "../../../compilable-ast-node"; -import type { ScopeVariableDeclaration, RawType } from "../../../../analysis"; +import type { RawType, ScopeVariableDeclaration } from "../../../../analysis"; import type { Expression, IdentifierTypeSpecifierExpression } from "../../expressions"; import type { ParseTree } from "antlr4ts/tree"; import type { KipperStorageType } from "../../../../const"; diff --git a/kipper/core/src/compiler/parser/antlr/KipperLexer.ts b/kipper/core/src/compiler/parser/antlr/KipperLexer.ts index 9d4046409..feb7f934b 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperLexer.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperLexer.ts @@ -5,10 +5,7 @@ import KipperLexerBase from "./base/KipperLexerBase"; import { ATN } from "antlr4ts/atn/ATN"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; import { CharStream } from "antlr4ts/CharStream"; -import { Lexer } from "antlr4ts/Lexer"; import { LexerATNSimulator } from "antlr4ts/atn/LexerATNSimulator"; -import { NotNull } from "antlr4ts/Decorators"; -import { Override } from "antlr4ts/Decorators"; import { RuleContext } from "antlr4ts/RuleContext"; import { Vocabulary } from "antlr4ts/Vocabulary"; import { VocabularyImpl } from "antlr4ts/VocabularyImpl"; diff --git a/kipper/core/src/compiler/parser/antlr/KipperParser.ts b/kipper/core/src/compiler/parser/antlr/KipperParser.ts index 7e0876a1d..45aabc2aa 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParser.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperParser.ts @@ -2,20 +2,15 @@ // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax // kind values. -import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; +import { ASTKind, KipperParserRuleContext, ParseRuleKindMapping } from ".."; import KipperParserBase from "./base/KipperParserBase"; import { ATN } from "antlr4ts/atn/ATN"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; import { FailedPredicateException } from "antlr4ts/FailedPredicateException"; -import { NotNull } from "antlr4ts/Decorators"; import { NoViableAltException } from "antlr4ts/NoViableAltException"; -import { Override } from "antlr4ts/Decorators"; -import { Parser } from "antlr4ts/Parser"; import { ParserRuleContext } from "antlr4ts/ParserRuleContext"; import { ParserATNSimulator } from "antlr4ts/atn/ParserATNSimulator"; -import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; -import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; import { RecognitionException } from "antlr4ts/RecognitionException"; import { RuleContext } from "antlr4ts/RuleContext"; //import { RuleVersion } from "antlr4ts/RuleVersion"; diff --git a/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts b/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts index a5943ecb0..16caac934 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts @@ -2,122 +2,122 @@ // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax // kind values. -import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; -import KipperParserBase from "./base/KipperParserBase"; import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; -import { PassOnBitwiseShiftExpressionContext } from "./KipperParser"; -import { ActualBitwiseShiftExpressionContext } from "./KipperParser"; -import { PassOnBitwiseAndExpressionContext } from "./KipperParser"; -import { ActualBitwiseAndExpressionContext } from "./KipperParser"; -import { PassOnLogicalAndExpressionContext } from "./KipperParser"; -import { ActualLogicalAndExpressionContext } from "./KipperParser"; -import { PassOnBitwiseXorExpressionContext } from "./KipperParser"; -import { ActualBitwiseXorExpressionContext } from "./KipperParser"; -import { ExternalBlockItemContext } from "./KipperParser"; -import { PassOncomputedPrimaryExpressionContext } from "./KipperParser"; -import { FunctionCallExpressionContext } from "./KipperParser"; -import { ExplicitCallFunctionCallExpressionContext } from "./KipperParser"; -import { DotNotationMemberAccessExpressionContext } from "./KipperParser"; -import { BracketNotationMemberAccessExpressionContext } from "./KipperParser"; -import { SliceNotationMemberAccessExpressionContext } from "./KipperParser"; -import { PassOnAssignmentExpressionContext } from "./KipperParser"; -import { ActualAssignmentExpressionContext } from "./KipperParser"; -import { PassOnCastOrConvertExpressionContext } from "./KipperParser"; -import { ActualCastOrConvertExpressionContext } from "./KipperParser"; -import { PassOnBitwiseOrExpressionContext } from "./KipperParser"; -import { ActualBitwiseOrExpressionContext } from "./KipperParser"; -import { PassOnEqualityExpressionContext } from "./KipperParser"; -import { ActualEqualityExpressionContext } from "./KipperParser"; -import { PassOnAdditiveExpressionContext } from "./KipperParser"; -import { ActualAdditiveExpressionContext } from "./KipperParser"; -import { PassOnRelationalExpressionContext } from "./KipperParser"; -import { ActualRelationalExpressionContext } from "./KipperParser"; -import { PassOnConditionalExpressionContext } from "./KipperParser"; -import { ActualConditionalExpressionContext } from "./KipperParser"; -import { PassOnMultiplicativeExpressionContext } from "./KipperParser"; -import { ActualMultiplicativeExpressionContext } from "./KipperParser"; -import { PassOnLogicalOrExpressionContext } from "./KipperParser"; -import { ActualLogicalOrExpressionContext } from "./KipperParser"; -import { CompilationUnitContext } from "./KipperParser"; -import { TranslationUnitContext } from "./KipperParser"; -import { ExternalItemContext } from "./KipperParser"; -import { BlockItemListContext } from "./KipperParser"; -import { BlockItemContext } from "./KipperParser"; -import { DeclarationContext } from "./KipperParser"; -import { VariableDeclarationContext } from "./KipperParser"; -import { StorageTypeSpecifierContext } from "./KipperParser"; -import { InitDeclaratorContext } from "./KipperParser"; -import { InitializerContext } from "./KipperParser"; -import { DeclaratorContext } from "./KipperParser"; -import { DirectDeclaratorContext } from "./KipperParser"; -import { FunctionDeclarationContext } from "./KipperParser"; -import { ParameterListContext } from "./KipperParser"; -import { ParameterDeclarationContext } from "./KipperParser"; -import { InterfaceDeclarationContext } from "./KipperParser"; -import { ClassDeclarationContext } from "./KipperParser"; -import { StatementContext } from "./KipperParser"; -import { CompoundStatementContext } from "./KipperParser"; -import { ExpressionStatementContext } from "./KipperParser"; -import { SelectionStatementContext } from "./KipperParser"; -import { IfStatementContext } from "./KipperParser"; -import { SwitchStatementContext } from "./KipperParser"; -import { SwitchLabeledStatementContext } from "./KipperParser"; -import { IterationStatementContext } from "./KipperParser"; -import { ForLoopIterationStatementContext } from "./KipperParser"; -import { WhileLoopIterationStatementContext } from "./KipperParser"; -import { DoWhileLoopIterationStatementContext } from "./KipperParser"; -import { JumpStatementContext } from "./KipperParser"; -import { ReturnStatementContext } from "./KipperParser"; -import { PrimaryExpressionContext } from "./KipperParser"; -import { TangledPrimaryExpressionContext } from "./KipperParser"; -import { BoolPrimaryExpressionContext } from "./KipperParser"; -import { IdentifierPrimaryExpressionContext } from "./KipperParser"; -import { IdentifierContext } from "./KipperParser"; -import { IdentifierOrStringPrimaryExpressionContext } from "./KipperParser"; -import { StringPrimaryExpressionContext } from "./KipperParser"; -import { FStringPrimaryExpressionContext } from "./KipperParser"; -import { FStringSingleQuoteAtomContext } from "./KipperParser"; -import { FStringDoubleQuoteAtomContext } from "./KipperParser"; -import { NumberPrimaryExpressionContext } from "./KipperParser"; -import { ArrayPrimaryExpressionContext } from "./KipperParser"; -import { ObjectPrimaryExpressionContext } from "./KipperParser"; -import { ObjectPropertyContext } from "./KipperParser"; -import { VoidOrNullOrUndefinedPrimaryExpressionContext } from "./KipperParser"; -import { ComputedPrimaryExpressionContext } from "./KipperParser"; -import { ArgumentExpressionListContext } from "./KipperParser"; -import { DotNotationContext } from "./KipperParser"; -import { BracketNotationContext } from "./KipperParser"; -import { SliceNotationContext } from "./KipperParser"; -import { PostfixExpressionContext } from "./KipperParser"; -import { IncrementOrDecrementPostfixExpressionContext } from "./KipperParser"; -import { UnaryExpressionContext } from "./KipperParser"; -import { IncrementOrDecrementUnaryExpressionContext } from "./KipperParser"; -import { OperatorModifiedUnaryExpressionContext } from "./KipperParser"; -import { IncrementOrDecrementOperatorContext } from "./KipperParser"; -import { UnaryOperatorContext } from "./KipperParser"; -import { CastOrConvertExpressionContext } from "./KipperParser"; -import { MultiplicativeExpressionContext } from "./KipperParser"; -import { AdditiveExpressionContext } from "./KipperParser"; -import { BitwiseShiftExpressionContext } from "./KipperParser"; -import { BitwiseShiftOperatorsContext } from "./KipperParser"; -import { RelationalExpressionContext } from "./KipperParser"; -import { EqualityExpressionContext } from "./KipperParser"; -import { BitwiseAndExpressionContext } from "./KipperParser"; -import { BitwiseXorExpressionContext } from "./KipperParser"; -import { BitwiseOrExpressionContext } from "./KipperParser"; -import { LogicalAndExpressionContext } from "./KipperParser"; -import { LogicalOrExpressionContext } from "./KipperParser"; -import { ConditionalExpressionContext } from "./KipperParser"; -import { AssignmentExpressionContext } from "./KipperParser"; -import { AssignmentOperatorContext } from "./KipperParser"; -import { ExpressionContext } from "./KipperParser"; -import { TypeSpecifierExpressionContext } from "./KipperParser"; -import { IdentifierTypeSpecifierExpressionContext } from "./KipperParser"; -import { GenericTypeSpecifierExpressionContext } from "./KipperParser"; -import { TypeofTypeSpecifierExpressionContext } from "./KipperParser"; -import { TypeSpecifierIdentifierContext } from "./KipperParser"; +import { + ActualAdditiveExpressionContext, + ActualAssignmentExpressionContext, + ActualBitwiseAndExpressionContext, + ActualBitwiseOrExpressionContext, + ActualBitwiseShiftExpressionContext, + ActualBitwiseXorExpressionContext, + ActualCastOrConvertExpressionContext, + ActualConditionalExpressionContext, + ActualEqualityExpressionContext, + ActualLogicalAndExpressionContext, + ActualLogicalOrExpressionContext, + ActualMultiplicativeExpressionContext, + ActualRelationalExpressionContext, + AdditiveExpressionContext, + ArgumentExpressionListContext, + ArrayPrimaryExpressionContext, + AssignmentExpressionContext, + AssignmentOperatorContext, + BitwiseAndExpressionContext, + BitwiseOrExpressionContext, + BitwiseShiftExpressionContext, + BitwiseShiftOperatorsContext, + BitwiseXorExpressionContext, + BlockItemContext, + BlockItemListContext, + BoolPrimaryExpressionContext, + BracketNotationContext, + BracketNotationMemberAccessExpressionContext, + CastOrConvertExpressionContext, + ClassDeclarationContext, + CompilationUnitContext, + CompoundStatementContext, + ComputedPrimaryExpressionContext, + ConditionalExpressionContext, + DeclarationContext, + DeclaratorContext, + DirectDeclaratorContext, + DotNotationContext, + DotNotationMemberAccessExpressionContext, + DoWhileLoopIterationStatementContext, + EqualityExpressionContext, + ExplicitCallFunctionCallExpressionContext, + ExpressionContext, + ExpressionStatementContext, + ExternalBlockItemContext, + ExternalItemContext, + ForLoopIterationStatementContext, + FStringDoubleQuoteAtomContext, + FStringPrimaryExpressionContext, + FStringSingleQuoteAtomContext, + FunctionCallExpressionContext, + FunctionDeclarationContext, + GenericTypeSpecifierExpressionContext, + IdentifierContext, + IdentifierOrStringPrimaryExpressionContext, + IdentifierPrimaryExpressionContext, + IdentifierTypeSpecifierExpressionContext, + IfStatementContext, + IncrementOrDecrementOperatorContext, + IncrementOrDecrementPostfixExpressionContext, + IncrementOrDecrementUnaryExpressionContext, + InitDeclaratorContext, + InitializerContext, + InterfaceDeclarationContext, + IterationStatementContext, + JumpStatementContext, + LogicalAndExpressionContext, + LogicalOrExpressionContext, + MultiplicativeExpressionContext, + NumberPrimaryExpressionContext, + ObjectPrimaryExpressionContext, + ObjectPropertyContext, + OperatorModifiedUnaryExpressionContext, + ParameterDeclarationContext, + ParameterListContext, + PassOnAdditiveExpressionContext, + PassOnAssignmentExpressionContext, + PassOnBitwiseAndExpressionContext, + PassOnBitwiseOrExpressionContext, + PassOnBitwiseShiftExpressionContext, + PassOnBitwiseXorExpressionContext, + PassOnCastOrConvertExpressionContext, + PassOncomputedPrimaryExpressionContext, + PassOnConditionalExpressionContext, + PassOnEqualityExpressionContext, + PassOnLogicalAndExpressionContext, + PassOnLogicalOrExpressionContext, + PassOnMultiplicativeExpressionContext, + PassOnRelationalExpressionContext, + PostfixExpressionContext, + PrimaryExpressionContext, + RelationalExpressionContext, + ReturnStatementContext, + SelectionStatementContext, + SliceNotationContext, + SliceNotationMemberAccessExpressionContext, + StatementContext, + StorageTypeSpecifierContext, + StringPrimaryExpressionContext, + SwitchLabeledStatementContext, + SwitchStatementContext, + TangledPrimaryExpressionContext, + TranslationUnitContext, + TypeofTypeSpecifierExpressionContext, + TypeSpecifierExpressionContext, + TypeSpecifierIdentifierContext, + UnaryExpressionContext, + UnaryOperatorContext, + VariableDeclarationContext, + VoidOrNullOrUndefinedPrimaryExpressionContext, + WhileLoopIterationStatementContext, +} from "./KipperParser"; /** * This interface defines a complete listener for a parse tree produced by diff --git a/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts b/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts index cd5cc8c1e..4ddfe78c1 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts @@ -2,122 +2,122 @@ // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax // kind values. -import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; -import KipperParserBase from "./base/KipperParserBase"; import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; -import { PassOnBitwiseShiftExpressionContext } from "./KipperParser"; -import { ActualBitwiseShiftExpressionContext } from "./KipperParser"; -import { PassOnBitwiseAndExpressionContext } from "./KipperParser"; -import { ActualBitwiseAndExpressionContext } from "./KipperParser"; -import { PassOnLogicalAndExpressionContext } from "./KipperParser"; -import { ActualLogicalAndExpressionContext } from "./KipperParser"; -import { PassOnBitwiseXorExpressionContext } from "./KipperParser"; -import { ActualBitwiseXorExpressionContext } from "./KipperParser"; -import { ExternalBlockItemContext } from "./KipperParser"; -import { PassOncomputedPrimaryExpressionContext } from "./KipperParser"; -import { FunctionCallExpressionContext } from "./KipperParser"; -import { ExplicitCallFunctionCallExpressionContext } from "./KipperParser"; -import { DotNotationMemberAccessExpressionContext } from "./KipperParser"; -import { BracketNotationMemberAccessExpressionContext } from "./KipperParser"; -import { SliceNotationMemberAccessExpressionContext } from "./KipperParser"; -import { PassOnAssignmentExpressionContext } from "./KipperParser"; -import { ActualAssignmentExpressionContext } from "./KipperParser"; -import { PassOnCastOrConvertExpressionContext } from "./KipperParser"; -import { ActualCastOrConvertExpressionContext } from "./KipperParser"; -import { PassOnBitwiseOrExpressionContext } from "./KipperParser"; -import { ActualBitwiseOrExpressionContext } from "./KipperParser"; -import { PassOnEqualityExpressionContext } from "./KipperParser"; -import { ActualEqualityExpressionContext } from "./KipperParser"; -import { PassOnAdditiveExpressionContext } from "./KipperParser"; -import { ActualAdditiveExpressionContext } from "./KipperParser"; -import { PassOnRelationalExpressionContext } from "./KipperParser"; -import { ActualRelationalExpressionContext } from "./KipperParser"; -import { PassOnConditionalExpressionContext } from "./KipperParser"; -import { ActualConditionalExpressionContext } from "./KipperParser"; -import { PassOnMultiplicativeExpressionContext } from "./KipperParser"; -import { ActualMultiplicativeExpressionContext } from "./KipperParser"; -import { PassOnLogicalOrExpressionContext } from "./KipperParser"; -import { ActualLogicalOrExpressionContext } from "./KipperParser"; -import { CompilationUnitContext } from "./KipperParser"; -import { TranslationUnitContext } from "./KipperParser"; -import { ExternalItemContext } from "./KipperParser"; -import { BlockItemListContext } from "./KipperParser"; -import { BlockItemContext } from "./KipperParser"; -import { DeclarationContext } from "./KipperParser"; -import { VariableDeclarationContext } from "./KipperParser"; -import { StorageTypeSpecifierContext } from "./KipperParser"; -import { InitDeclaratorContext } from "./KipperParser"; -import { InitializerContext } from "./KipperParser"; -import { DeclaratorContext } from "./KipperParser"; -import { DirectDeclaratorContext } from "./KipperParser"; -import { FunctionDeclarationContext } from "./KipperParser"; -import { ParameterListContext } from "./KipperParser"; -import { ParameterDeclarationContext } from "./KipperParser"; -import { InterfaceDeclarationContext } from "./KipperParser"; -import { ClassDeclarationContext } from "./KipperParser"; -import { StatementContext } from "./KipperParser"; -import { CompoundStatementContext } from "./KipperParser"; -import { ExpressionStatementContext } from "./KipperParser"; -import { SelectionStatementContext } from "./KipperParser"; -import { IfStatementContext } from "./KipperParser"; -import { SwitchStatementContext } from "./KipperParser"; -import { SwitchLabeledStatementContext } from "./KipperParser"; -import { IterationStatementContext } from "./KipperParser"; -import { ForLoopIterationStatementContext } from "./KipperParser"; -import { WhileLoopIterationStatementContext } from "./KipperParser"; -import { DoWhileLoopIterationStatementContext } from "./KipperParser"; -import { JumpStatementContext } from "./KipperParser"; -import { ReturnStatementContext } from "./KipperParser"; -import { PrimaryExpressionContext } from "./KipperParser"; -import { TangledPrimaryExpressionContext } from "./KipperParser"; -import { BoolPrimaryExpressionContext } from "./KipperParser"; -import { IdentifierPrimaryExpressionContext } from "./KipperParser"; -import { IdentifierContext } from "./KipperParser"; -import { IdentifierOrStringPrimaryExpressionContext } from "./KipperParser"; -import { StringPrimaryExpressionContext } from "./KipperParser"; -import { FStringPrimaryExpressionContext } from "./KipperParser"; -import { FStringSingleQuoteAtomContext } from "./KipperParser"; -import { FStringDoubleQuoteAtomContext } from "./KipperParser"; -import { NumberPrimaryExpressionContext } from "./KipperParser"; -import { ArrayPrimaryExpressionContext } from "./KipperParser"; -import { ObjectPrimaryExpressionContext } from "./KipperParser"; -import { ObjectPropertyContext } from "./KipperParser"; -import { VoidOrNullOrUndefinedPrimaryExpressionContext } from "./KipperParser"; -import { ComputedPrimaryExpressionContext } from "./KipperParser"; -import { ArgumentExpressionListContext } from "./KipperParser"; -import { DotNotationContext } from "./KipperParser"; -import { BracketNotationContext } from "./KipperParser"; -import { SliceNotationContext } from "./KipperParser"; -import { PostfixExpressionContext } from "./KipperParser"; -import { IncrementOrDecrementPostfixExpressionContext } from "./KipperParser"; -import { UnaryExpressionContext } from "./KipperParser"; -import { IncrementOrDecrementUnaryExpressionContext } from "./KipperParser"; -import { OperatorModifiedUnaryExpressionContext } from "./KipperParser"; -import { IncrementOrDecrementOperatorContext } from "./KipperParser"; -import { UnaryOperatorContext } from "./KipperParser"; -import { CastOrConvertExpressionContext } from "./KipperParser"; -import { MultiplicativeExpressionContext } from "./KipperParser"; -import { AdditiveExpressionContext } from "./KipperParser"; -import { BitwiseShiftExpressionContext } from "./KipperParser"; -import { BitwiseShiftOperatorsContext } from "./KipperParser"; -import { RelationalExpressionContext } from "./KipperParser"; -import { EqualityExpressionContext } from "./KipperParser"; -import { BitwiseAndExpressionContext } from "./KipperParser"; -import { BitwiseXorExpressionContext } from "./KipperParser"; -import { BitwiseOrExpressionContext } from "./KipperParser"; -import { LogicalAndExpressionContext } from "./KipperParser"; -import { LogicalOrExpressionContext } from "./KipperParser"; -import { ConditionalExpressionContext } from "./KipperParser"; -import { AssignmentExpressionContext } from "./KipperParser"; -import { AssignmentOperatorContext } from "./KipperParser"; -import { ExpressionContext } from "./KipperParser"; -import { TypeSpecifierExpressionContext } from "./KipperParser"; -import { IdentifierTypeSpecifierExpressionContext } from "./KipperParser"; -import { GenericTypeSpecifierExpressionContext } from "./KipperParser"; -import { TypeofTypeSpecifierExpressionContext } from "./KipperParser"; -import { TypeSpecifierIdentifierContext } from "./KipperParser"; +import { + ActualAdditiveExpressionContext, + ActualAssignmentExpressionContext, + ActualBitwiseAndExpressionContext, + ActualBitwiseOrExpressionContext, + ActualBitwiseShiftExpressionContext, + ActualBitwiseXorExpressionContext, + ActualCastOrConvertExpressionContext, + ActualConditionalExpressionContext, + ActualEqualityExpressionContext, + ActualLogicalAndExpressionContext, + ActualLogicalOrExpressionContext, + ActualMultiplicativeExpressionContext, + ActualRelationalExpressionContext, + AdditiveExpressionContext, + ArgumentExpressionListContext, + ArrayPrimaryExpressionContext, + AssignmentExpressionContext, + AssignmentOperatorContext, + BitwiseAndExpressionContext, + BitwiseOrExpressionContext, + BitwiseShiftExpressionContext, + BitwiseShiftOperatorsContext, + BitwiseXorExpressionContext, + BlockItemContext, + BlockItemListContext, + BoolPrimaryExpressionContext, + BracketNotationContext, + BracketNotationMemberAccessExpressionContext, + CastOrConvertExpressionContext, + ClassDeclarationContext, + CompilationUnitContext, + CompoundStatementContext, + ComputedPrimaryExpressionContext, + ConditionalExpressionContext, + DeclarationContext, + DeclaratorContext, + DirectDeclaratorContext, + DotNotationContext, + DotNotationMemberAccessExpressionContext, + DoWhileLoopIterationStatementContext, + EqualityExpressionContext, + ExplicitCallFunctionCallExpressionContext, + ExpressionContext, + ExpressionStatementContext, + ExternalBlockItemContext, + ExternalItemContext, + ForLoopIterationStatementContext, + FStringDoubleQuoteAtomContext, + FStringPrimaryExpressionContext, + FStringSingleQuoteAtomContext, + FunctionCallExpressionContext, + FunctionDeclarationContext, + GenericTypeSpecifierExpressionContext, + IdentifierContext, + IdentifierOrStringPrimaryExpressionContext, + IdentifierPrimaryExpressionContext, + IdentifierTypeSpecifierExpressionContext, + IfStatementContext, + IncrementOrDecrementOperatorContext, + IncrementOrDecrementPostfixExpressionContext, + IncrementOrDecrementUnaryExpressionContext, + InitDeclaratorContext, + InitializerContext, + InterfaceDeclarationContext, + IterationStatementContext, + JumpStatementContext, + LogicalAndExpressionContext, + LogicalOrExpressionContext, + MultiplicativeExpressionContext, + NumberPrimaryExpressionContext, + ObjectPrimaryExpressionContext, + ObjectPropertyContext, + OperatorModifiedUnaryExpressionContext, + ParameterDeclarationContext, + ParameterListContext, + PassOnAdditiveExpressionContext, + PassOnAssignmentExpressionContext, + PassOnBitwiseAndExpressionContext, + PassOnBitwiseOrExpressionContext, + PassOnBitwiseShiftExpressionContext, + PassOnBitwiseXorExpressionContext, + PassOnCastOrConvertExpressionContext, + PassOncomputedPrimaryExpressionContext, + PassOnConditionalExpressionContext, + PassOnEqualityExpressionContext, + PassOnLogicalAndExpressionContext, + PassOnLogicalOrExpressionContext, + PassOnMultiplicativeExpressionContext, + PassOnRelationalExpressionContext, + PostfixExpressionContext, + PrimaryExpressionContext, + RelationalExpressionContext, + ReturnStatementContext, + SelectionStatementContext, + SliceNotationContext, + SliceNotationMemberAccessExpressionContext, + StatementContext, + StorageTypeSpecifierContext, + StringPrimaryExpressionContext, + SwitchLabeledStatementContext, + SwitchStatementContext, + TangledPrimaryExpressionContext, + TranslationUnitContext, + TypeofTypeSpecifierExpressionContext, + TypeSpecifierExpressionContext, + TypeSpecifierIdentifierContext, + UnaryExpressionContext, + UnaryOperatorContext, + VariableDeclarationContext, + VoidOrNullOrUndefinedPrimaryExpressionContext, + WhileLoopIterationStatementContext, +} from "./KipperParser"; /** * This interface defines a complete generic visitor for a parse tree produced diff --git a/kipper/core/src/compiler/parser/parse-data.ts b/kipper/core/src/compiler/parser/parse-data.ts index 395bc8ade..a61ac3103 100644 --- a/kipper/core/src/compiler/parser/parse-data.ts +++ b/kipper/core/src/compiler/parser/parse-data.ts @@ -1,6 +1,6 @@ import type { KipperParseStream } from "./parse-stream"; -import type { CompilationUnitContext, KipperParser } from "./antlr/KipperParser"; -import type { KipperLexer } from "./antlr/KipperLexer"; +import type { CompilationUnitContext, KipperParser } from "./antlr"; +import type { KipperLexer } from "./antlr"; /** * Parse data for a {@link KipperProgramContext}. diff --git a/kipper/core/src/compiler/target-presets/semantic-analyser.ts b/kipper/core/src/compiler/target-presets/semantic-analyser.ts index e5c32dc77..395dbe7f7 100644 --- a/kipper/core/src/compiler/target-presets/semantic-analyser.ts +++ b/kipper/core/src/compiler/target-presets/semantic-analyser.ts @@ -8,6 +8,10 @@ import type { AnalysableASTNode, ArrayPrimaryExpression, AssignmentExpression, + BitwiseAndExpression, + BitwiseOrExpression, + BitwiseShiftExpression, + BitwiseXorExpression, BoolPrimaryExpression, CastOrConvertExpression, ClassDeclaration, @@ -48,7 +52,6 @@ import type { VoidOrNullOrUndefinedPrimaryExpression, WhileLoopIterationStatement, } from "../ast"; -import type { BitwiseAndExpression, BitwiseOrExpression, BitwiseShiftExpression, BitwiseXorExpression } from "../ast"; import { KipperSemanticErrorHandler } from "../analysis"; import type { ObjectProperty } from "../ast/nodes/expressions/primary-expression/object-primary-expression/object-property/object-property"; From 6214d008a85666a4d30fb6f584ae6373db864797 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Wed, 3 Jul 2024 16:29:17 +0200 Subject: [PATCH 09/57] other: Updated CHANGELOG.md --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 004187ee6..aa17340fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,10 @@ To use development versions of Kipper download the - `BitwiseOrExpression`, which represents an AST bitwise OR expression. - `BitwiseXorExpression`, which represents an AST bitwise XOR expression. - `BitwiseShiftExpression`, which represents an AST bitwise shift expression. + - `InterfaceDeclaration`, which represents an AST interface declaration. + - `ClassDeclaration`, which represents an AST class declaration. + - `BuiltInType`, which represents a built-in type. + - `CustomType`, which represents a user defined type. - New interfaces: - `PrimaryExpressionSemantics`, which represents the semantics of a primary expression. - `PrimaryExpressionTypeSemantics`, which represents the type semantics of a primary expression. @@ -93,6 +97,13 @@ To use development versions of Kipper download the - `BitwiseXorExpressionTypeSemantics`, which represents the type semantics of a bitwise XOR expression. - `BitwiseShiftExpressionSemantics`, which represents the semantics of a bitwise shift expression. - `BitwiseShiftExpressionTypeSemantics`, which represents the type semantics of a bitwise shift expression. + - `InterfaceDeclarationSemantics`, which represents the semantics of an interface declaration. + - `InterfaceDeclarationTypeSemantics`, which represents the type semantics of an interface declaration. + - `ClassDeclarationSemantics`, which represents the semantics of a class declaration. + - `ClassDeclarationTypeSemantics`, which represents the type semantics of a class declaration. + - `TypeDeclaration`, which represents a type declaration. This is an abstract base class for all type declarations. + - `TypeDeclarationSemantics`, which represents the semantics of a type declaration. + - `TypeDeclarationTypeSemantics`, which represents the type semantics of a type declaration. - New parameters: - `ignoreParams` in `genJSFunction()`, which, if true makes the function signature define no parameters. - `ignoreParams` in `createJSFunctionSignature()`, which, if true makes the function signature define no parameters. From 22e90c476f50c616a6ae1225c58e62f72f2b9604 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Wed, 3 Jul 2024 18:53:00 +0200 Subject: [PATCH 10/57] major (#524): Restructured type structure in compiler --- .../analysis/analyser/type-checker.ts | 21 ++-- .../analysis/types/base/compilable-type.ts | 18 ++++ .../src/compiler/analysis/types/base/index.ts | 7 ++ .../analysis/types/base/processed-type.ts | 68 ++++++++++++ .../analysis/types/{ => base}/type.ts | 0 .../compiler/analysis/types/built-in-type.ts | 30 +++++- .../compiler/analysis/types/custom-type.ts | 33 ++++-- .../core/src/compiler/analysis/types/index.ts | 3 +- .../compiler/analysis/types/processed-type.ts | 101 ------------------ .../src/compiler/analysis/types/raw-type.ts | 2 +- .../compiler/analysis/types/undefined-type.ts | 18 +++- kipper/core/src/compiler/const.ts | 19 +--- kipper/core/src/compiler/runtime-built-ins.ts | 12 +-- kipper/core/src/errors.ts | 19 ++-- kipper/target-ts/src/built-in-generator.ts | 6 +- kipper/target-ts/src/target.ts | 6 +- kipper/target-ts/src/tools.ts | 10 +- 17 files changed, 203 insertions(+), 170 deletions(-) create mode 100644 kipper/core/src/compiler/analysis/types/base/compilable-type.ts create mode 100644 kipper/core/src/compiler/analysis/types/base/index.ts create mode 100644 kipper/core/src/compiler/analysis/types/base/processed-type.ts rename kipper/core/src/compiler/analysis/types/{ => base}/type.ts (100%) delete mode 100644 kipper/core/src/compiler/analysis/types/processed-type.ts diff --git a/kipper/core/src/compiler/analysis/analyser/type-checker.ts b/kipper/core/src/compiler/analysis/analyser/type-checker.ts index 131e2590a..f1f63effc 100644 --- a/kipper/core/src/compiler/analysis/analyser/type-checker.ts +++ b/kipper/core/src/compiler/analysis/analyser/type-checker.ts @@ -31,12 +31,12 @@ import { ScopeDeclaration, ScopeParameterDeclaration, ScopeVariableDeclaration } import type { KipperArithmeticOperator, KipperBitwiseOperator, - KipperCompilableType, + KipperBuiltInType, KipperReferenceable, KipperReferenceableFunction, } from "../../const"; import { - kipperCompilableTypes, + kipperBuiltInTypes, kipperIncrementOrDecrementOperators, kipperMultiplicativeOperators, kipperPlusOperator, @@ -81,7 +81,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @since 0.7.0 */ public typeExists(type: string): void { - if (kipperCompilableTypes.find((val) => val === type) === undefined) { + if (kipperBuiltInTypes.find((val) => val === type) === undefined) { throw this.assertError(new UnknownTypeError(type)); } } @@ -98,7 +98,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { // Ensure the type exists this.typeExists(type.identifier); - return ProcessedType.fromCompilableType(type.identifier); + return ProcessedType.fromCompilableType(type.identifier); } catch (e) { // If the error is not a KipperError, rethrow it (since it is not a type error, and we don't know what happened) if (!(e instanceof KipperError)) { @@ -126,10 +126,10 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @returns True if the types are matching, otherwise false. * @since 0.10.0 */ - public checkMatchingTypes(type1: KipperCompilableType, type2: KipperCompilableType): boolean { + public checkMatchingTypes(type1: KipperBuiltInType, type2: KipperBuiltInType): boolean { if (type1 !== type2) { // 'void' is compatible with 'undefined' - let interchangeableTypes = ["void", "undefined"]; + // Ensure that 'true' is still returned when type1 and type2 are compatible return interchangeableTypes.includes(type1) && interchangeableTypes.includes(type2); @@ -322,12 +322,9 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @since 0.9.0 */ public validUnaryExpression(operand: UnaryExpression | IncrementOrDecrementPostfixExpression): void { - const semanticData = ( - operand.getSemanticData() - ); + const semanticData = operand.getSemanticData() as + UnaryExpressionSemantics | IncrementOrDecrementPostfixExpressionSemantics; const expTypeSemantics = semanticData.operand.getTypeSemanticData(); - - // Get the compile-types type of the expression const expType = expTypeSemantics.evaluatedType.get(); // If the expression type is undefined, skip type checking (the type is invalid anyway) @@ -340,7 +337,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { throw this.assertError(new InvalidUnaryExpressionTypeError(semanticData.operator, expType)); } - // Ensure that the operand of an '++' and '--' modifier expression is a reference + // Ensure that the operand of an '++' and '--' modifier expression is a reference let isReference = semanticData.operand instanceof IdentifierPrimaryExpression; if ((>kipperIncrementOrDecrementOperators).includes(semanticData.operator) && !isReference) { // Edge-case: If the operand is a tangled expression, it should still work if the child is an identifier diff --git a/kipper/core/src/compiler/analysis/types/base/compilable-type.ts b/kipper/core/src/compiler/analysis/types/base/compilable-type.ts new file mode 100644 index 000000000..29fcdf037 --- /dev/null +++ b/kipper/core/src/compiler/analysis/types/base/compilable-type.ts @@ -0,0 +1,18 @@ +/** + * Represents a type that can be compiled i.e. a type that exists and type checks can be done on it. + * @since 0.11.0 + */ +export interface CompilableType { + /** + * The identifier of this type. + * @since 0.11.0 + */ + readonly identifier: string; + /** + * Returns whether the type is compilable. Is always true for this type. + * + * This only exists to differentiate this type from the base {@link ProcessedType}. + * @since 0.11.0 + */ + readonly isCompilable: true; +} diff --git a/kipper/core/src/compiler/analysis/types/base/index.ts b/kipper/core/src/compiler/analysis/types/base/index.ts new file mode 100644 index 000000000..6b44e81e4 --- /dev/null +++ b/kipper/core/src/compiler/analysis/types/base/index.ts @@ -0,0 +1,7 @@ +/** + * Abstract classes and interfaces, which are used to represent types in the type analysis phase. + * @since 0.11.0 + */ +export * from "./type"; +export * from "./processed-type"; +export * from "./compilable-type"; diff --git a/kipper/core/src/compiler/analysis/types/base/processed-type.ts b/kipper/core/src/compiler/analysis/types/base/processed-type.ts new file mode 100644 index 000000000..b45598b52 --- /dev/null +++ b/kipper/core/src/compiler/analysis/types/base/processed-type.ts @@ -0,0 +1,68 @@ +import type { CompilableType } from "./compilable-type"; +import { TypeNotCompilableError } from "../../../../errors"; +import { Type } from "./type"; + +/** + * A processed type that may be used for type checking and compilation. This type is the general type that will be used + * throughout type checking, as there can be references to invalid + * @since 0.10.0 + */ +export abstract class ProcessedType extends Type { + protected readonly _isCompilable: boolean; + + protected constructor(identifier: string, isCompilable: boolean) { + super(identifier); + this._isCompilable = isCompilable; + } + + /** + * Gets the actual type stored in this class, which may be undefined if the type doesn't exist ({@link isCompilable} + * is false). + * @since 0.11.0 + */ + public get(): string | undefined { + return this.isCompilable ? this.identifier : undefined; + } + + /** + * The identifier of this type. + */ + public get identifier(): string { + return this._identifier; + } + + /** + * Returns whether the type is compilable. + * + * This function exists, since during type checking an undefined/invalid type may be encountered that should still + * be stored using this class though (but NOT compiled!). + * @since 0.10.0 + */ + public get isCompilable(): boolean { + return this._isCompilable; + } + + /** + * Gets the compilable type for this type. + * + * This function throws an error instead of returning undefined, since it's intended to be used in circumstances, + * where only due to a bug the type is not compilable. As such, it makes sense to strictly assert it will be + * compilable, unless an error occurs. + * @throws UndefinedType If the {@link isCompilable} is false, which should only occur if the identifier is of + * type {@link UndefinedType}. + * @since 0.10.0 + */ + public getCompilableType(): CompilableType { + if (!this.isCompilable) { + throw new TypeNotCompilableError(); + } + return this; + } + + /** + * Returns whether this type is assignable to the given {@link type}. + * @param type The type to check against. + * @since 0.11.0 + */ + public abstract isAssignableTo(type: ProcessedType): boolean; +} diff --git a/kipper/core/src/compiler/analysis/types/type.ts b/kipper/core/src/compiler/analysis/types/base/type.ts similarity index 100% rename from kipper/core/src/compiler/analysis/types/type.ts rename to kipper/core/src/compiler/analysis/types/base/type.ts diff --git a/kipper/core/src/compiler/analysis/types/built-in-type.ts b/kipper/core/src/compiler/analysis/types/built-in-type.ts index e320196b9..c170f1436 100644 --- a/kipper/core/src/compiler/analysis/types/built-in-type.ts +++ b/kipper/core/src/compiler/analysis/types/built-in-type.ts @@ -1,14 +1,34 @@ -import { ProcessedType } from "./processed-type"; -import type { KipperCompilableType } from "../../const"; +import { ProcessedType } from "./base/processed-type"; +import type { KipperBuiltInType } from "../../const"; import { KipperNotImplementedError } from "../../../errors"; +import type { CompilableType } from "./base/compilable-type"; /** * Represents a built-in type that is used in the type analysis phase. * @since 0.11.0 */ -export class BuiltInType extends ProcessedType { - public constructor(identifier: KipperCompilableType) { - super(identifier, identifier); +export class BuiltInType extends ProcessedType implements CompilableType { + public static readonly interchangeableTypes = ["void", "undefined"]; + + public constructor(identifier: KipperBuiltInType) { + super(identifier, true); throw new KipperNotImplementedError("Built-in type wrapper classes are not implement yet"); } + + public get isCompilable(): true { + return true; + } + + /** + * Returns whether this type is assignable to another type. + * @param type The type to check against. + * @since 0.11.0 + */ + public isAssignableTo(type: ProcessedType): boolean { + if (this.identifier !== type.identifier) { + return BuiltInType.interchangeableTypes.includes(this.identifier) + && BuiltInType.interchangeableTypes.includes(type.identifier); + } + return true; + } } diff --git a/kipper/core/src/compiler/analysis/types/custom-type.ts b/kipper/core/src/compiler/analysis/types/custom-type.ts index a90432de1..641c7e566 100644 --- a/kipper/core/src/compiler/analysis/types/custom-type.ts +++ b/kipper/core/src/compiler/analysis/types/custom-type.ts @@ -1,9 +1,8 @@ -import { ProcessedType } from "./processed-type"; -import type { KipperCompilableType } from "../../const"; -import { KipperNotImplementedError } from "../../../errors"; +import type { KipperBuiltInType } from "../../const"; +import { ProcessedType } from "./base"; export type CustomTypeConstraint = CustomPrimitiveTypeConstraint | CustomObjectTypeConstraint; -export type CustomPrimitiveTypeConstraint = KipperCompilableType; +export type CustomPrimitiveTypeConstraint = KipperBuiltInType; export type CustomObjectTypeConstraint = { [key: string]: CustomTypeConstraint }; /** @@ -13,9 +12,27 @@ export type CustomObjectTypeConstraint = { [key: string]: CustomTypeConstraint } * @since 0.11.0 */ export class CustomType extends ProcessedType { - public constructor(identifier: string, constraints: CustomTypeConstraint) { - // TODO! Implement proper custom types once we can migrate past the old type system - super(identifier, "void"); - throw new KipperNotImplementedError("Custom types are not implement yet"); + private readonly _constraints: CustomTypeConstraint; + + public constructor(identifier: string, isCompilable: boolean, constraints: CustomTypeConstraint) { + super(identifier, isCompilable); + this._constraints = constraints; + } + + /** + * Returns the constraints of this type. + * @since 0.11.0 + */ + public get constraints(): CustomTypeConstraint { + return this._constraints; + } + + /** + * Checks whether this type is assignable to another type. + * @param type The type to check against. + * @since 0.11.0 + */ + isAssignableTo(type: ProcessedType): boolean { + return false; } } diff --git a/kipper/core/src/compiler/analysis/types/index.ts b/kipper/core/src/compiler/analysis/types/index.ts index e5f7a6da9..e46f92fb9 100644 --- a/kipper/core/src/compiler/analysis/types/index.ts +++ b/kipper/core/src/compiler/analysis/types/index.ts @@ -2,9 +2,8 @@ * Types which are used in the type analysis phase. * @since 0.11.0 */ -export * from "./type"; +export * from "./base/"; export * from "./raw-type"; -export * from "./processed-type"; export * from "./undefined-type"; export * from "./custom-type"; export * from "./built-in-type"; diff --git a/kipper/core/src/compiler/analysis/types/processed-type.ts b/kipper/core/src/compiler/analysis/types/processed-type.ts deleted file mode 100644 index 8310f2625..000000000 --- a/kipper/core/src/compiler/analysis/types/processed-type.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { Type } from "./type"; -import type { KipperCompilableType, KipperType } from "../../const"; -import { UndefinedType } from "./undefined-type"; -import { TypeNotCompilableError } from "../../../errors"; - -/** - * A wrapper class for a {@link KipperType} that is used to properly represent a type during type checking. This is - * primarily intended to check to handle invalid/undefined types and continue with type checking despite their - * existence. - * - * This type may be used for a compilation if the field {@link CheckedType.isCompilable isCompilable} is true. - * @since 0.10.0 - */ -export class ProcessedType extends Type { - protected readonly _rawType: KipperType; - protected readonly _isCompilable: boolean; - - protected constructor(identifier: string, rawType: KipperType) { - super(identifier); - this._rawType = rawType; - this._isCompilable = !(this._rawType instanceof UndefinedType); - } - - /** - * Gets the actual type stored in this class, which may be undefined if the type doesn't exist ({@link isCompilable} - * is false). - * @since 0.11.0 - */ - public get(): KipperCompilableType | undefined { - return this.isCompilable ? this.rawType : undefined; - } - - /** - * Creates a new {@link ProcessedType} instance based on the passed {@link KipperType}. - * - * If the type is invalid, the function will still return a {@link ProcessedType}, but the field - * {@link CheckedType.isCompilable isCompilable} will be false and the instance WILL NOT be usable for a compilation. - */ - public static fromKipperType(kipperType: KipperType): ProcessedType { - return new ProcessedType(kipperType instanceof UndefinedType ? kipperType.identifier : kipperType, kipperType); - } - - /** - * Creates a new instance of this class using the given {@link rawType}. - * - * This instance will ALWAYS be compilable, since the type {@link KipperCompilableType} automatically excludes any - * undefined/invalid types to be stored in this class. - * @param kipperType The type to use for the created of a checked type. - */ - public static fromCompilableType(kipperType: KipperCompilableType): ProcessedType { - return new ProcessedType(kipperType, kipperType); - } - - /** - * The identifier of this type. - * - * If {@link rawType} is of type {@link UndefinedType}, then this will return the invalid - * {@link UndefinedType.identifier type identifier} of {@link UndefinedType}. - */ - public get identifier(): string { - return this._identifier; - } - - /** - * The {@link identifier} in a {@link KipperType} format. - * - * This mainly differentiates from {@link identifier} by possibly returning the class {@link UndefinedType}, - * which represents an invalid type that should still be stored though. - */ - public get rawType(): KipperType { - return this._rawType; - } - - /** - * Returns whether the type is compilable. - * - * This function exists, since during type checking an undefined/invalid type may be encountered that should still - * be stored using this class though (but NOT compiled!). - * @since 0.10.0 - */ - public get isCompilable(): boolean { - return this._isCompilable; - } - - /** - * Gets the compilable type for this type. - * - * This function throws an error instead of returning undefined, since it's intended to be used in circumstances, - * where only due to a bug the type is not compilable. As such, it makes sense to strictly assert it will be - * compilable, unless an error occurs. - * @throws UndefinedType If the {@link isCompilable} is false, which - * should only occur if the identifier is of type {@link UndefinedType}. - * @since 0.10.0 - */ - public getCompilableType(): KipperCompilableType { - if (!this.isCompilable) { - throw new TypeNotCompilableError(); - } - return this.rawType; - } -} diff --git a/kipper/core/src/compiler/analysis/types/raw-type.ts b/kipper/core/src/compiler/analysis/types/raw-type.ts index 2f12e1d2f..6f46ac43e 100644 --- a/kipper/core/src/compiler/analysis/types/raw-type.ts +++ b/kipper/core/src/compiler/analysis/types/raw-type.ts @@ -1,4 +1,4 @@ -import { Type } from "./type"; +import { Type } from "./base"; /** * An unchecked type wrapper that may contain any type, even if it does not exist or is invalid. diff --git a/kipper/core/src/compiler/analysis/types/undefined-type.ts b/kipper/core/src/compiler/analysis/types/undefined-type.ts index dfdd1f2db..a4f4014c0 100644 --- a/kipper/core/src/compiler/analysis/types/undefined-type.ts +++ b/kipper/core/src/compiler/analysis/types/undefined-type.ts @@ -1,3 +1,6 @@ +import { ProcessedType } from "./base"; +import { TypeCanNotBeUsedForTypeCheckingError } from "../../../errors"; + /** * Represents an undefined custom type that was specified by the user, but can not be evaluated. * @@ -5,6 +8,17 @@ * then the type checking will silently fail, as this type should have already thrown an error. * @since 0.10.0 */ -export class UndefinedType { - constructor(public readonly identifier: string) {} +export class UndefinedType extends ProcessedType { + constructor(identifier: string) { + super(identifier, false); + } + + /** + * Checks whether this type is assignable to another type. + * @param type The type to check against. + * @since 0.10.0 + */ + isAssignableTo(type: ProcessedType): boolean { + throw new TypeCanNotBeUsedForTypeCheckingError(); + } } diff --git a/kipper/core/src/compiler/const.ts b/kipper/core/src/compiler/const.ts index 4057e3362..2d89a7846 100644 --- a/kipper/core/src/compiler/const.ts +++ b/kipper/core/src/compiler/const.ts @@ -150,7 +150,7 @@ export const kipperBoolType: KipperBoolType = "bool"; * list */ // eslint-disable-next-line @typescript-eslint/no-unused-vars -export type KipperListType = "list"; +export type KipperListType = "list"; /** * List type in Kipper. {@link KipperType ValueType} represents the type of the list content and only serves as a @@ -193,29 +193,18 @@ export const kipperPrimitiveTypes: Array = [ * only used for error handling/recovery and skips type checking altogether. * @since 0.10.0 */ -export type KipperCompilableType = KipperMetaType | KipperPrimitiveType | KipperFuncType | KipperListType; +export type KipperBuiltInType = KipperMetaType | KipperPrimitiveType | KipperFuncType | KipperListType; /** * All compilable and valid base types inside Kipper. * @since 0.10.0 */ -export const kipperCompilableTypes: Array = [ +export const kipperBuiltInTypes: Array = [ kipperFuncType, ...kipperPrimitiveTypes, kipperListType, ]; -/** - * All error types inside Kipper, which indicate an invalid type that can not be used for type checking. - * @since 0.10.0 - */ -export type KipperErrorType = UndefinedType; - -/** - * All available variable types inside Kipper. - */ -export type KipperType = KipperCompilableType | KipperErrorType; - /** * List of all supported variable type conversions that can be performed in a Kipper program. * @@ -223,7 +212,7 @@ export type KipperType = KipperCompilableType | KipperErrorType; * which generates for each conversion the translator function in the specific target. * @since 0.8.0 */ -export const kipperSupportedConversions: Array<[KipperType, KipperType]> = [ +export const kipperSupportedConversions: Array<[KipperBuiltInType, KipperBuiltInType]> = [ ["num", "str"], ["bool", "str"], ["void", "str"], diff --git a/kipper/core/src/compiler/runtime-built-ins.ts b/kipper/core/src/compiler/runtime-built-ins.ts index 3e44c9814..bee9dec8f 100644 --- a/kipper/core/src/compiler/runtime-built-ins.ts +++ b/kipper/core/src/compiler/runtime-built-ins.ts @@ -2,7 +2,7 @@ * Built-Ins file, which provides the blueprints for the Kipper built-in functions and variables. * @since 0.1.0 */ -import type { KipperCompilableType } from "./const"; +import type { KipperBuiltInType } from "./const"; /** * Interface representation of an argument of a {@link BuiltInFunction}. @@ -26,7 +26,7 @@ export interface BuiltInFunctionArgument { * // x is of type 'num' * // y is of type 'str' */ - valueType: KipperCompilableType; + valueType: KipperBuiltInType; } /** @@ -54,7 +54,7 @@ export interface BuiltInFunction { * The expected return of the function. If the return type is {@link KipperVoidType void}, then the function will not * return anything. */ - returnType: KipperCompilableType; + returnType: KipperBuiltInType; } /** @@ -80,7 +80,7 @@ export interface InternalFunctionArgument { * // x is of type 'num' * // y is of type 'str' */ - valueType: KipperCompilableType | Array; + valueType: KipperBuiltInType | Array; } /** @@ -114,7 +114,7 @@ export interface InternalFunction { * union. * @since 0.8.0 */ - returnType: KipperCompilableType; + returnType: KipperBuiltInType; } /** @@ -132,7 +132,7 @@ export interface BuiltInVariable { * The type of the variable. * @since 0.10.0 */ - valueType: KipperCompilableType; + valueType: KipperBuiltInType; /** * If true then the variable is local to the current file. If false then the variable is global and can be accessed * from any file. diff --git a/kipper/core/src/errors.ts b/kipper/core/src/errors.ts index 7f1956cc3..97bd3ee37 100644 --- a/kipper/core/src/errors.ts +++ b/kipper/core/src/errors.ts @@ -286,6 +286,16 @@ export class TypeNotCompilableError extends KipperInternalError { } } +/** + * Error that is thrown whenever a type is used for type checking that can not be used for type checking. + * @since 0.11.0 + */ +export class TypeCanNotBeUsedForTypeCheckingError extends KipperInternalError { + constructor() { + super("This Type can not be used for type checking. This is a bug in the compiler."); + } +} + /** * Error that is thrown whenever a parent node attempts to access the {@link CompilableASTNode.semanticData} of a child, * but the child had an error during semantic analysis. This is to prevent the parent from using the child's data @@ -577,13 +587,8 @@ export class ArithmeticOperationTypeError extends TypeError { * @since 0.6.0 */ export class BitwiseOperationTypeError extends TypeError { - constructor(firstType?: string, secondType?: string) { - if (firstType && secondType) { - // If the types caused the error, specify them in the error message - super(`Invalid bitwise operation between operands of type '${firstType}' and '${secondType}'.`); - } else { - super(`Invalid bitwise operation.`); - } + constructor(firstType: string, secondType: string) { + super(`Bitwise expressions are only allowed for type 'num'. Received '${firstType}' and '${secondType}'.`); } } diff --git a/kipper/target-ts/src/built-in-generator.ts b/kipper/target-ts/src/built-in-generator.ts index f8338178b..5f611caee 100644 --- a/kipper/target-ts/src/built-in-generator.ts +++ b/kipper/target-ts/src/built-in-generator.ts @@ -6,7 +6,7 @@ import type { BuiltInFunction, InternalFunction, TranslatedCodeLine } from "@kipper/core"; import { JavaScriptTargetBuiltInGenerator } from "@kipper/target-js"; import { getTSFunctionSignature, createTSFunctionSignature } from "./tools"; -import type { BuiltInVariable, KipperCompilableType, KipperProgramContext } from "@kipper/core"; +import type { BuiltInVariable, KipperBuiltInType, KipperProgramContext } from "@kipper/core"; import { TargetTS } from "./target"; /** @@ -19,8 +19,8 @@ import { TargetTS } from "./target"; export function genTSFunction( signature: { identifier: string; - params: Array<{ identifier: string; type: KipperCompilableType | Array }>; - returnType: KipperCompilableType | Array; + params: Array<{ identifier: string; type: KipperBuiltInType | Array }>; + returnType: KipperBuiltInType | Array; }, body: string, ignoreParams: boolean = false, diff --git a/kipper/target-ts/src/target.ts b/kipper/target-ts/src/target.ts index 2028cbfdf..77a1aaafd 100644 --- a/kipper/target-ts/src/target.ts +++ b/kipper/target-ts/src/target.ts @@ -2,7 +2,7 @@ * The TypeScript translation target for the Kipper language. * @since 0.10.0 */ -import type { BuiltInFunction, BuiltInVariable, KipperCompilableType } from "@kipper/core"; +import type { BuiltInFunction, BuiltInVariable, KipperBuiltInType } from "@kipper/core"; import { kipperBoolType, KipperCompileTarget, @@ -59,11 +59,11 @@ export class KipperTypeScriptTarget extends KipperCompileTarget { } /** - * Fetches the typescript equivalent for a {@link KipperCompilableType}. + * Fetches the typescript equivalent for a {@link KipperBuiltInType}. * @param kipperType The type to get the equivalent for. * @since 0.8.0 */ - public static getTypeScriptType(kipperType: KipperCompilableType | Array): string { + public static getTypeScriptType(kipperType: KipperBuiltInType | Array): string { if (Array.isArray(kipperType)) { // Recursively call this function for each type in the array return `${kipperType.map(this.getTypeScriptType).join(" | ")}`; diff --git a/kipper/target-ts/src/tools.ts b/kipper/target-ts/src/tools.ts index 6d2d1662e..f420e8a2f 100644 --- a/kipper/target-ts/src/tools.ts +++ b/kipper/target-ts/src/tools.ts @@ -6,7 +6,7 @@ import type { FunctionDeclaration, BuiltInFunction, BuiltInFunctionArgument, - KipperCompilableType, + KipperBuiltInType, InternalFunction, InternalFunctionArgument, } from "@kipper/core"; @@ -19,8 +19,8 @@ import { TargetTS } from "./target"; */ export function getTSFunctionSignature(funcSpec: InternalFunction | BuiltInFunction | FunctionDeclaration): { identifier: string; - params: Array<{ identifier: string; type: KipperCompilableType | Array }>; - returnType: KipperCompilableType | Array; + params: Array<{ identifier: string; type: KipperBuiltInType | Array }>; + returnType: KipperBuiltInType | Array; } { if ("antlrRuleCtx" in funcSpec) { const semanticData = funcSpec.getSemanticData(); @@ -56,8 +56,8 @@ export function getTSFunctionSignature(funcSpec: InternalFunction | BuiltInFunct export function createTSFunctionSignature( signature: { identifier: string; - params: Array<{ identifier: string; type: KipperCompilableType | Array }>; - returnType: KipperCompilableType | Array; + params: Array<{ identifier: string; type: KipperBuiltInType | Array }>; + returnType: KipperBuiltInType | Array; }, ignoreParams: boolean = false, ): string { From f53511843c3b517ea02cd878c5822e6c3a696fea Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Wed, 3 Jul 2024 18:53:08 +0200 Subject: [PATCH 11/57] other: Updated CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa17340fb..af864273d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,9 @@ To use development versions of Kipper download the - `ClassDeclaration`, which represents an AST class declaration. - `BuiltInType`, which represents a built-in type. - `CustomType`, which represents a user defined type. +- New errors: + - `TypeCanNotBeUsedForTypeCheckingError`, which is thrown when a type is used for type checking, but is not a valid + type. This is an error indicating an invalid logic that should be fixed. - New interfaces: - `PrimaryExpressionSemantics`, which represents the semantics of a primary expression. - `PrimaryExpressionTypeSemantics`, which represents the type semantics of a primary expression. From 346fe1ef1907f8299cb98d87df8be1c57f981d12 Mon Sep 17 00:00:00 2001 From: Fabian Date: Thu, 4 Jul 2024 16:52:06 +0200 Subject: [PATCH 12/57] minor (#525): Added interface-member-list-declaration.ts and interface-property-declaration.ts as AST Nodes, also adjusted the Antler tree to support properties and methods in interfaces --- kipper/core/KipperParser.g4 | 21 +- kipper/core/src/compiler/ast/ast-generator.ts | 33 +- .../core/src/compiler/ast/common/ast-types.ts | 2 + .../compiler/ast/mapping/ast-node-mapper.ts | 9 +- ...rface-member-list-declaration-semantics.ts | 7 + ...-member-list-declaration-type-semantics.ts | 5 + .../interface-member-list-declaration.ts | 30 + ...nterface-property-declaration-semantics.ts | 25 + ...ace-property-declaration-type-semantics.ts | 3 + .../interface-property-declaration.ts | 29 + .../src/compiler/parser/antlr/KipperLexer.ts | 468 +- .../compiler/parser/antlr/KipperParser.interp | 6 +- .../src/compiler/parser/antlr/KipperParser.ts | 6870 ++++++++--------- .../parser/antlr/KipperParserListener.ts | 282 +- .../parser/antlr/KipperParserVisitor.ts | 266 +- .../parser/parse-rule-kind-mapping.ts | 1 + 16 files changed, 3795 insertions(+), 4262 deletions(-) create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration-semantics.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration-type-semantics.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration-semantics.ts create mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-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-property-declaration/interface-property-declaration.ts diff --git a/kipper/core/KipperParser.g4 b/kipper/core/KipperParser.g4 index f64aa5c94..b9d6e4ce2 100644 --- a/kipper/core/KipperParser.g4 +++ b/kipper/core/KipperParser.g4 @@ -85,8 +85,25 @@ parameterDeclaration ; interfaceDeclaration - : 'interface' Identifier '{' '}' - ; + : 'interface' Identifier '{' interfaceMemberList? '}' + ; + +interfaceMemberList + : interfaceMemberDeclaration+ + ; + +interfaceMemberDeclaration + : propertySignature + | methodSignature + ; + +propertySignature + : Identifier ':' typeSpecifierExpression SemiColon + ; + +methodSignature + : Identifier '(' parameterList? ')' '->' typeSpecifierExpression SemiColon + ; classDeclaration : 'class' Identifier '{' '}' diff --git a/kipper/core/src/compiler/ast/ast-generator.ts b/kipper/core/src/compiler/ast/ast-generator.ts index bee45d321..30060a0ec 100644 --- a/kipper/core/src/compiler/ast/ast-generator.ts +++ b/kipper/core/src/compiler/ast/ast-generator.ts @@ -9,7 +9,7 @@ import type { ParserStatementContext, } from "./common"; import type { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; -import type { +import { ActualAdditiveExpressionContext, ActualAssignmentExpressionContext, ActualBitwiseAndExpressionContext, @@ -25,7 +25,7 @@ import type { ActualRelationalExpressionContext, ArrayPrimaryExpressionContext, BoolPrimaryExpressionContext, - BracketNotationMemberAccessExpressionContext, + BracketNotationMemberAccessExpressionContext, ClassDeclarationContext, CompilationUnitContext, CompoundStatementContext, DeclarationContext, @@ -48,7 +48,7 @@ import type { IncrementOrDecrementPostfixExpressionContext, IncrementOrDecrementUnaryExpressionContext, InitDeclaratorContext, - InitializerContext, + InitializerContext, InterfaceDeclarationContext, InterfaceMemberDeclarationContext, JumpStatementContext, KipperParserListener, KipperParserRuleContext, @@ -1063,6 +1063,33 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi */ public exitParameterDeclaration: (ctx: ParameterDeclarationContext) => void = this.handleExitingTreeNode; + /** + * Enter a parse tree produced by `KipperParser.structDeclaration`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + */ + public enterInterfaceDeclaration: (ctx: InterfaceDeclarationContext) => void = this.handleEnteringTreeNode; + + /** + * Exit a parse tree produced by `KipperParser.structDeclaration`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + */ + public exitInterfaceDeclaration: (ctx: InterfaceDeclarationContext) => void = this.handleExitingTreeNode; + + public enterInterfaceMemberDeclaration: (ctx: InterfaceMemberDeclarationContext) => void = this.handleEnteringTreeNode; + public exitInterfaceMemberDeclaration: (ctx: InterfaceMemberDeclarationContext) => void = this.handleExitingTreeNode; + + /** + * Enter a parse tree produced by `KipperParser.classDeclaration`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + */ + public enterClassDeclaration: (ctx: ClassDeclarationContext) => void = this.handleEnteringTreeNode; + + /** + * Exit a parse tree produced by `KipperParser.classDeclaration`. + * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). + */ + public exitClassDeclaration: (ctx: ClassDeclarationContext) => void = this.handleExitingTreeNode; + // ------------------------------------------------------------------------------------------------------------------- // Other // ------------------------------------------------------------------------------------------------------------------- diff --git a/kipper/core/src/compiler/ast/common/ast-types.ts b/kipper/core/src/compiler/ast/common/ast-types.ts index cd260fcc0..b7bff485c 100644 --- a/kipper/core/src/compiler/ast/common/ast-types.ts +++ b/kipper/core/src/compiler/ast/common/ast-types.ts @@ -132,6 +132,7 @@ export type ASTDeclarationKind = | typeof ParseRuleKindMapping.RULE_parameterDeclaration | typeof ParseRuleKindMapping.RULE_variableDeclaration | typeof ParseRuleKindMapping.RULE_interfaceDeclaration + | typeof ParseRuleKindMapping.RULE_interfaceMemberList | typeof ParseRuleKindMapping.RULE_classDeclaration; /** @@ -209,6 +210,7 @@ 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_interfaceMemberList] | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_classDeclaration]; /** 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 2655b83cb..2277a55dd 100644 --- a/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts +++ b/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts @@ -32,7 +32,7 @@ import { IfStatementContext, IncrementOrDecrementPostfixExpressionContext, IncrementOrDecrementUnaryExpressionContext, - InterfaceDeclarationContext, + InterfaceDeclarationContext, InterfaceMemberDeclarationContext, JumpStatementContext, LogicalAndExpressionContext, LogicalOrExpressionContext, @@ -110,6 +110,10 @@ import { VoidOrNullOrUndefinedPrimaryExpression, WhileLoopIterationStatement, } from "../nodes"; +import { InterfacePropertyDeclaration } from "../nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration"; +import { + InterfaceMemberListDeclaration +} from "../nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration"; /** * Mapper class which maps kind ids or rule names to their corresponding AST classes. @@ -128,6 +132,7 @@ export class ASTNodeMapper { [ParseRuleKindMapping.RULE_variableDeclaration]: VariableDeclaration, [ParseRuleKindMapping.RULE_parameterDeclaration]: ParameterDeclaration, [ParseRuleKindMapping.RULE_interfaceDeclaration]: InterfaceDeclaration, + [ParseRuleKindMapping.RULE_interfaceMemberList]: InterfaceMemberListDeclaration, [ParseRuleKindMapping.RULE_classDeclaration]: ClassDeclaration, } satisfies Record>; @@ -197,6 +202,7 @@ export class ASTNodeMapper { [ParseRuleKindMapping.RULE_variableDeclaration]: VariableDeclarationContext, [ParseRuleKindMapping.RULE_parameterDeclaration]: ParameterDeclarationContext, [ParseRuleKindMapping.RULE_interfaceDeclaration]: InterfaceDeclarationContext, + [ParseRuleKindMapping.RULE_interfaceMemberList]: InterfaceMemberDeclarationContext, [ParseRuleKindMapping.RULE_classDeclaration]: ClassDeclarationContext, } satisfies Record; @@ -271,6 +277,7 @@ export class ASTNodeMapper { RULE_variableDeclaration: VariableDeclaration, RULE_parameterDeclaration: ParameterDeclaration, RULE_interfaceDeclaration: InterfaceDeclaration, + RULE_interfaceMemberList: InterfaceMemberListDeclaration, RULE_classDeclaration: ClassDeclaration, } satisfies Record>; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration-semantics.ts new file mode 100644 index 000000000..5a8e62c3c --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration-semantics.ts @@ -0,0 +1,7 @@ +import type { TypeDeclarationSemantics } from "../../type-declaration-semantics"; + +export interface InterfaceMemberListDeclarationSemantics extends TypeDeclarationSemantics { + identifier: string; + + //some array that holds Members +} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration-type-semantics.ts new file mode 100644 index 000000000..d37f94157 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration-type-semantics.ts @@ -0,0 +1,5 @@ +import type { TypeDeclarationTypeSemantics } from "../../type-declaration-type-semantics"; + +export interface InterfaceMemberListDeclarationTypeSemantics extends TypeDeclarationTypeSemantics { + +} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration.ts new file mode 100644 index 000000000..819daa75e --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration.ts @@ -0,0 +1,30 @@ +import type { TranslatedCodeLine } from "../../../../../../const"; +import type { TargetASTNodeSemanticAnalyser, TargetASTNodeCodeGenerator } from "../../../../../../target-presets"; +import type { InterfaceMemberListDeclarationSemantics } from "./interface-member-list-declaration-semantics"; +import type { InterfaceMemberListDeclarationTypeSemantics } from "./interface-member-list-declaration-type-semantics"; +import { Declaration } from "../../../declaration"; +import type { ASTDeclarationKind, ASTDeclarationRuleName } from "../../../../../common"; + +export class InterfaceMemberListDeclaration extends Declaration + { + public get kind(): ASTDeclarationKind { + throw new Error("Method not implemented."); + } + public get ruleName(): ASTDeclarationRuleName { + throw new Error("Method not implemented."); + } + protected primarySemanticAnalysis?(): Promise { + throw new Error("Method not implemented."); + } + protected primarySemanticTypeChecking?(): Promise { + throw new Error("Method not implemented."); + } + protected checkForWarnings?(): Promise { + throw new Error("Method not implemented."); + } + + public targetSemanticAnalysis: TargetASTNodeSemanticAnalyser | undefined; + // @ts-ignore + public targetCodeGenerator: TargetASTNodeCodeGenerator; +} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration-semantics.ts new file mode 100644 index 000000000..27b15356a --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration-semantics.ts @@ -0,0 +1,25 @@ +/** + * Semantics for AST Node {@link InterfaceMemberProperty}. + * @since 0.11.0 + */ + +import type { TypeDeclarationSemantics } from "../../type-declaration-semantics"; +import type { IdentifierTypeSpecifierExpression } from "../../../../expressions"; + +/** + * Semantics for AST Node {@link InterfaceMemberProperty}. + * @since 0.11.0 + */ +export interface InterfaceMemberSemantics extends TypeDeclarationSemantics { + /** + * The identifier of this member property. + * @since 0.11.0 + */ + identifier: string; + + /** + * The type of this member property. + * @since 0.11.0 + */ + type: IdentifierTypeSpecifierExpression; +} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration-type-semantics.ts new file mode 100644 index 000000000..6ac6ed963 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration-type-semantics.ts @@ -0,0 +1,3 @@ +import type { TypeDeclarationTypeSemantics } from "../../type-declaration-type-semantics"; + +export interface InterfacePropertyDeclarationTypeSemantics extends TypeDeclarationTypeSemantics {} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration.ts new file mode 100644 index 000000000..bc2a0d957 --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration.ts @@ -0,0 +1,29 @@ +import type { TranslatedCodeLine } from "../../../../../../const"; +import type { TargetASTNodeSemanticAnalyser, TargetASTNodeCodeGenerator } from "../../../../../../target-presets"; +import type { ASTDeclarationKind, ASTDeclarationRuleName } from "../../../../../common"; +import { Declaration } from "../../../declaration"; +import type { InterfacePropertyDeclarationTypeSemantics } from "./interface-property-declaration-type-semantics"; +import type { InterfaceMemberSemantics } from "./interface-property-declaration-semantics"; + +export class InterfacePropertyDeclaration extends Declaration< + InterfaceMemberSemantics, + InterfacePropertyDeclarationTypeSemantics +> { + public get kind(): ASTDeclarationKind { + throw new Error("Method not implemented."); + } + public get ruleName(): ASTDeclarationRuleName { + throw new Error("Method not implemented."); + } + protected primarySemanticAnalysis?(): Promise { + throw new Error("Method not implemented."); + } + protected primarySemanticTypeChecking?(): Promise { + throw new Error("Method not implemented."); + } + protected checkForWarnings = undefined; + + public targetSemanticAnalysis: TargetASTNodeSemanticAnalyser | undefined; + //@ts-ignore + public targetCodeGenerator: TargetASTNodeCodeGenerator; +} diff --git a/kipper/core/src/compiler/parser/antlr/KipperLexer.ts b/kipper/core/src/compiler/parser/antlr/KipperLexer.ts index feb7f934b..d5ef16faa 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperLexer.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperLexer.ts @@ -1,17 +1,23 @@ // Generated from ./KipperLexer.g4 by ANTLR 4.9.0-SNAPSHOT -import KipperLexerBase from "./base/KipperLexerBase"; + + import KipperLexerBase from "./base/KipperLexerBase"; + import { ATN } from "antlr4ts/atn/ATN"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; import { CharStream } from "antlr4ts/CharStream"; +import { Lexer } from "antlr4ts/Lexer"; import { LexerATNSimulator } from "antlr4ts/atn/LexerATNSimulator"; +import { NotNull } from "antlr4ts/Decorators"; +import { Override } from "antlr4ts/Decorators"; import { RuleContext } from "antlr4ts/RuleContext"; import { Vocabulary } from "antlr4ts/Vocabulary"; import { VocabularyImpl } from "antlr4ts/VocabularyImpl"; import * as Utils from "antlr4ts/misc/Utils"; + export class KipperLexer extends KipperLexerBase { public static readonly FStringExpStart = 1; public static readonly BlockComment = 2; @@ -103,298 +109,70 @@ export class KipperLexer extends KipperLexerBase { public static readonly DOUBLE_QUOTE_FSTRING = 2; // tslint:disable:no-trailing-whitespace - public static readonly channelNames: string[] = ["DEFAULT_TOKEN_CHANNEL", "HIDDEN", "COMMENT"]; + public static readonly channelNames: string[] = [ + "DEFAULT_TOKEN_CHANNEL", "HIDDEN", "COMMENT", + ]; // tslint:disable:no-trailing-whitespace - public static readonly modeNames: string[] = ["DEFAULT_MODE", "SINGLE_QUOTE_FSTRING", "DOUBLE_QUOTE_FSTRING"]; + public static readonly modeNames: string[] = [ + "DEFAULT_MODE", "SINGLE_QUOTE_FSTRING", "DOUBLE_QUOTE_FSTRING", + ]; public static readonly ruleNames: string[] = [ - "BlockComment", - "LineComment", - "Const", - "Var", - "As", - "Spread", - "Switch", - "Case", - "Default", - "Break", - "Continue", - "Do", - "While", - "If", - "Else", - "For", - "Enum", - "DefFunc", - "Return", - "CallFunc", - "RetIndicator", - "Class", - "Interface", - "True", - "False", - "Typeof", - "Void", - "Null", - "Undefined", - "Comma", - "SemiColon", - "QuestionMark", - "Colon", - "LeftParen", - "RightParen", - "LeftBracket", - "RightBracket", - "FStringExpEnd", - "LeftBrace", - "RightBrace", - "Plus", - "PlusPlus", - "Minus", - "MinusMinus", - "Star", - "Div", - "Mod", - "PowerTo", - "AndAnd", - "OrOr", - "Not", - "Assign", - "PlusAssign", - "MinusAssign", - "StarAssign", - "DivAssign", - "ModAssign", - "Equal", - "NotEqual", - "Less", - "LessEqual", - "Greater", - "GreaterEqual", - "BitwiseAnd", - "BitwiseOr", - "BitwiseXor", - "BitwiseNot", - "BitwiseZeroFillLeftShift", - "BitwiseSignedRightShift", - "BitwiseZeroFillRightShift", - "Dot", - "Identifier", - "IntegerConstant", - "SingleQuoteStringLiteral", - "DoubleQuoteStringLiteral", - "FloatingConstant", - "Whitespace", - "Newline", - "FStringSingleQuoteStart", - "FStringDoubleQuoteStart", - "FStringSingleQuoteExpStart", - "FStringSingleQuoteEnd", - "FStringSingleQuoteAtom", - "FStringDoubleQuoteExpStart", - "FStringDoubleQuoteEnd", - "FStringDoubleQuoteAtom", - "IdentifierNondigit", - "Nondigit", - "Digit", - "DecimalConstant", - "BinaryConstant", - "OctalConstant", - "HexadecimalConstant", - "NonzeroDigit", - "BinaryDigit", - "OctalDigit", - "HexadecimalDigit", - "DecimalFloatingConstant", - "FractionalConstant", - "ExponentPart", - "DigitSequence", - "Sign", - "CCharSequence", - "CChar", - "EscapeSequence", - "SimpleEscapeSequence", - "OctalEscapeSequence", - "HexadecimalEscapeSequence", - "SingleQuoteFStringSCharSequence", - "SingleQuoteFStringSChar", - "DoubleQuoteFStringSCharSequence", - "DoubleQuoteFStringSChar", - "SingleQuoteSCharSequence", - "SingleQuoteSChar", - "DoubleQuoteSCharSequence", + "BlockComment", "LineComment", "Const", "Var", "As", "Spread", "Switch", + "Case", "Default", "Break", "Continue", "Do", "While", "If", "Else", "For", + "Enum", "DefFunc", "Return", "CallFunc", "RetIndicator", "Class", "Interface", + "True", "False", "Typeof", "Void", "Null", "Undefined", "Comma", "SemiColon", + "QuestionMark", "Colon", "LeftParen", "RightParen", "LeftBracket", "RightBracket", + "FStringExpEnd", "LeftBrace", "RightBrace", "Plus", "PlusPlus", "Minus", + "MinusMinus", "Star", "Div", "Mod", "PowerTo", "AndAnd", "OrOr", "Not", + "Assign", "PlusAssign", "MinusAssign", "StarAssign", "DivAssign", "ModAssign", + "Equal", "NotEqual", "Less", "LessEqual", "Greater", "GreaterEqual", "BitwiseAnd", + "BitwiseOr", "BitwiseXor", "BitwiseNot", "BitwiseZeroFillLeftShift", "BitwiseSignedRightShift", + "BitwiseZeroFillRightShift", "Dot", "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", + "DoubleQuoteStringLiteral", "FloatingConstant", "Whitespace", "Newline", + "FStringSingleQuoteStart", "FStringDoubleQuoteStart", "FStringSingleQuoteExpStart", + "FStringSingleQuoteEnd", "FStringSingleQuoteAtom", "FStringDoubleQuoteExpStart", + "FStringDoubleQuoteEnd", "FStringDoubleQuoteAtom", "IdentifierNondigit", + "Nondigit", "Digit", "DecimalConstant", "BinaryConstant", "OctalConstant", + "HexadecimalConstant", "NonzeroDigit", "BinaryDigit", "OctalDigit", "HexadecimalDigit", + "DecimalFloatingConstant", "FractionalConstant", "ExponentPart", "DigitSequence", + "Sign", "CCharSequence", "CChar", "EscapeSequence", "SimpleEscapeSequence", + "OctalEscapeSequence", "HexadecimalEscapeSequence", "SingleQuoteFStringSCharSequence", + "SingleQuoteFStringSChar", "DoubleQuoteFStringSCharSequence", "DoubleQuoteFStringSChar", + "SingleQuoteSCharSequence", "SingleQuoteSChar", "DoubleQuoteSCharSequence", "DoubleQuoteSChar", ]; private static readonly _LITERAL_NAMES: Array = [ - undefined, - undefined, - undefined, - undefined, - "'const'", - "'var'", - "'as'", - "'...'", - "'switch'", - "'case'", - "'default'", - "'break'", - "'continue'", - "'do'", - "'while'", - "'if'", - "'else'", - "'for'", - "'enum'", - "'def'", - "'return'", - "'call'", - "'->'", - "'class'", - "'interface'", - "'true'", - "'false'", - "'typeof'", - "'void'", - "'null'", - "'undefined'", - "','", - "';'", - "'?'", - "':'", - "'('", - "')'", - "'['", - "']'", - undefined, - "'{'", - "'}'", - "'+'", - "'++'", - "'-'", - "'--'", - "'*'", - "'/'", - "'%'", - "'**'", - "'&&'", - "'||'", - "'!'", - "'='", - "'+='", - "'-='", - "'*='", - "'/='", - "'%='", - "'=='", - "'!='", - "'<'", - "'<='", - "'>'", - "'>='", - "'&'", - "'|'", - "'^'", - "'~'", - "'<<'", - "'>>'", - "'>>>'", - "'.'", + undefined, undefined, undefined, undefined, "'const'", "'var'", "'as'", + "'...'", "'switch'", "'case'", "'default'", "'break'", "'continue'", "'do'", + "'while'", "'if'", "'else'", "'for'", "'enum'", "'def'", "'return'", "'call'", + "'->'", "'class'", "'interface'", "'true'", "'false'", "'typeof'", "'void'", + "'null'", "'undefined'", "','", "';'", "'?'", "':'", "'('", "')'", "'['", + "']'", undefined, "'{'", "'}'", "'+'", "'++'", "'-'", "'--'", "'*'", "'/'", + "'%'", "'**'", "'&&'", "'||'", "'!'", "'='", "'+='", "'-='", "'*='", "'/='", + "'%='", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'&'", "'|'", "'^'", + "'~'", "'<<'", "'>>'", "'>>>'", "'.'", ]; private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, - "FStringExpStart", - "BlockComment", - "LineComment", - "Const", - "Var", - "As", - "Spread", - "Switch", - "Case", - "Default", - "Break", - "Continue", - "Do", - "While", - "If", - "Else", - "For", - "Enum", - "DefFunc", - "Return", - "CallFunc", - "RetIndicator", - "Class", - "Interface", - "True", - "False", - "Typeof", - "Void", - "Null", - "Undefined", - "Comma", - "SemiColon", - "QuestionMark", - "Colon", - "LeftParen", - "RightParen", - "LeftBracket", - "RightBracket", - "FStringExpEnd", - "LeftBrace", - "RightBrace", - "Plus", - "PlusPlus", - "Minus", - "MinusMinus", - "Star", - "Div", - "Mod", - "PowerTo", - "AndAnd", - "OrOr", - "Not", - "Assign", - "PlusAssign", - "MinusAssign", - "StarAssign", - "DivAssign", - "ModAssign", - "Equal", - "NotEqual", - "Less", - "LessEqual", - "Greater", - "GreaterEqual", - "BitwiseAnd", - "BitwiseOr", - "BitwiseXor", - "BitwiseNot", - "BitwiseZeroFillLeftShift", - "BitwiseSignedRightShift", - "BitwiseZeroFillRightShift", - "Dot", - "Identifier", - "IntegerConstant", - "SingleQuoteStringLiteral", - "DoubleQuoteStringLiteral", - "FloatingConstant", - "Whitespace", - "Newline", - "FStringSingleQuoteStart", - "FStringDoubleQuoteStart", - "FStringSingleQuoteEnd", - "FStringSingleQuoteAtom", - "FStringDoubleQuoteEnd", - "FStringDoubleQuoteAtom", + undefined, "FStringExpStart", "BlockComment", "LineComment", "Const", + "Var", "As", "Spread", "Switch", "Case", "Default", "Break", "Continue", + "Do", "While", "If", "Else", "For", "Enum", "DefFunc", "Return", "CallFunc", + "RetIndicator", "Class", "Interface", "True", "False", "Typeof", "Void", + "Null", "Undefined", "Comma", "SemiColon", "QuestionMark", "Colon", "LeftParen", + "RightParen", "LeftBracket", "RightBracket", "FStringExpEnd", "LeftBrace", + "RightBrace", "Plus", "PlusPlus", "Minus", "MinusMinus", "Star", "Div", + "Mod", "PowerTo", "AndAnd", "OrOr", "Not", "Assign", "PlusAssign", "MinusAssign", + "StarAssign", "DivAssign", "ModAssign", "Equal", "NotEqual", "Less", "LessEqual", + "Greater", "GreaterEqual", "BitwiseAnd", "BitwiseOr", "BitwiseXor", "BitwiseNot", + "BitwiseZeroFillLeftShift", "BitwiseSignedRightShift", "BitwiseZeroFillRightShift", + "Dot", "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", "DoubleQuoteStringLiteral", + "FloatingConstant", "Whitespace", "Newline", "FStringSingleQuoteStart", + "FStringDoubleQuoteStart", "FStringSingleQuoteEnd", "FStringSingleQuoteAtom", + "FStringDoubleQuoteEnd", "FStringDoubleQuoteAtom", ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( - KipperLexer._LITERAL_NAMES, - KipperLexer._SYMBOLIC_NAMES, - [], - ); + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(KipperLexer._LITERAL_NAMES, KipperLexer._SYMBOLIC_NAMES, []); // @Override // @NotNull @@ -403,116 +181,107 @@ export class KipperLexer extends KipperLexerBase { } // tslint:enable:no-trailing-whitespace + constructor(input: CharStream) { super(input); this._interp = new LexerATNSimulator(KipperLexer._ATN, this); } // @Override - public get grammarFileName(): string { - return "KipperLexer.g4"; - } + public get grammarFileName(): string { return "KipperLexer.g4"; } // @Override - public get ruleNames(): string[] { - return KipperLexer.ruleNames; - } + public get ruleNames(): string[] { return KipperLexer.ruleNames; } // @Override - public get serializedATN(): string { - return KipperLexer._serializedATN; - } + public get serializedATN(): string { return KipperLexer._serializedATN; } // @Override - public get channelNames(): string[] { - return KipperLexer.channelNames; - } + public get channelNames(): string[] { return KipperLexer.channelNames; } // @Override - public get modeNames(): string[] { - return KipperLexer.modeNames; - } + public get modeNames(): string[] { return KipperLexer.modeNames; } // @Override public action(_localctx: RuleContext, ruleIndex: number, actionIndex: number): void { switch (ruleIndex) { - case 78: - this.FStringSingleQuoteStart_action(_localctx, actionIndex); - break; + case 78: + this.FStringSingleQuoteStart_action(_localctx, actionIndex); + break; - case 79: - this.FStringDoubleQuoteStart_action(_localctx, actionIndex); - break; + case 79: + this.FStringDoubleQuoteStart_action(_localctx, actionIndex); + break; - case 81: - this.FStringSingleQuoteEnd_action(_localctx, actionIndex); - break; + case 81: + this.FStringSingleQuoteEnd_action(_localctx, actionIndex); + break; - case 84: - this.FStringDoubleQuoteEnd_action(_localctx, actionIndex); - break; + case 84: + this.FStringDoubleQuoteEnd_action(_localctx, actionIndex); + break; } } private FStringSingleQuoteStart_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 0: - this.incrementFStringDepth(); - break; + case 0: + this.incrementFStringDepth() + break; } } private FStringDoubleQuoteStart_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 1: - this.incrementFStringDepth(); - break; + case 1: + this.incrementFStringDepth() + break; } } private FStringSingleQuoteEnd_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 2: - this.decrementFStringDepth(); - break; + case 2: + this.decrementFStringDepth() + break; } } private FStringDoubleQuoteEnd_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 3: - this.decrementFStringDepth(); - break; + case 3: + this.decrementFStringDepth() + break; } } // @Override public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { switch (ruleIndex) { - case 37: - return this.FStringExpEnd_sempred(_localctx, predIndex); + case 37: + return this.FStringExpEnd_sempred(_localctx, predIndex); - case 80: - return this.FStringSingleQuoteExpStart_sempred(_localctx, predIndex); + case 80: + return this.FStringSingleQuoteExpStart_sempred(_localctx, predIndex); - case 83: - return this.FStringDoubleQuoteExpStart_sempred(_localctx, predIndex); + case 83: + return this.FStringDoubleQuoteExpStart_sempred(_localctx, predIndex); } return true; } private FStringExpEnd_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 0: - return this.insideFString(); + case 0: + return this.insideFString(); } return true; } private FStringSingleQuoteExpStart_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 1: - return this.insideFString(); + case 1: + return this.insideFString(); } return true; } private FStringDoubleQuoteExpStart_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 2: - return this.insideFString(); + case 2: + return this.insideFString(); } return true; } @@ -526,7 +295,7 @@ export class KipperLexer extends KipperLexerBase { "\x04\x12\t\x12\x04\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16" + "\x04\x17\t\x17\x04\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B" + "\x04\x1C\t\x1C\x04\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!" + - "\t!\x04\"\t\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04'\t'\x04(\t(\x04)\t" + + "\t!\x04\"\t\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(\x04)\t" + ")\x04*\t*\x04+\t+\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x040\t0\x041\t1\x04" + "2\t2\x043\t3\x044\t4\x045\t5\x046\t6\x047\t7\x048\t8\x049\t9\x04:\t:\x04" + ";\t;\x04<\t<\x04=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x04B\tB\x04C\tC\x04" + @@ -554,8 +323,8 @@ export class KipperLexer extends KipperLexerBase { "\x1A\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03" + "\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1D\x03\x1D\x03\x1D\x03" + "\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03" + - '\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x03 \x03 \x03!\x03!\x03"\x03"\x03' + - "#\x03#\x03$\x03$\x03%\x03%\x03&\x03&\x03'\x03'\x03'\x03'\x03'\x03" + + "\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x03 \x03 \x03!\x03!\x03\"\x03\"\x03" + + "#\x03#\x03$\x03$\x03%\x03%\x03&\x03&\x03\'\x03\'\x03\'\x03\'\x03\'\x03" + "(\x03(\x03)\x03)\x03*\x03*\x03+\x03+\x03+\x03,\x03,\x03-\x03-\x03-\x03" + ".\x03.\x03/\x03/\x030\x030\x031\x031\x031\x032\x032\x032\x033\x033\x03" + "3\x034\x034\x035\x035\x036\x036\x036\x037\x037\x037\x038\x038\x038\x03" + @@ -582,9 +351,9 @@ export class KipperLexer extends KipperLexerBase { "s\u02D8\ns\x03t\x06t\u02DB\nt\rt\x0Et\u02DC\x03u\x03u\x05u\u02E1\nu\x03" + "\xF3\x02\x02v\x05\x02\x04\x07\x02\x05\t\x02\x06\v\x02\x07\r\x02\b\x0F" + "\x02\t\x11\x02\n\x13\x02\v\x15\x02\f\x17\x02\r\x19\x02\x0E\x1B\x02\x0F" + - "\x1D\x02\x10\x1F\x02\x11!\x02\x12#\x02\x13%\x02\x14'\x02\x15)\x02\x16" + + "\x1D\x02\x10\x1F\x02\x11!\x02\x12#\x02\x13%\x02\x14\'\x02\x15)\x02\x16" + "+\x02\x17-\x02\x18/\x02\x191\x02\x1A3\x02\x1B5\x02\x1C7\x02\x1D9\x02\x1E" + - ";\x02\x1F=\x02 ?\x02!A\x02\"C\x02#E\x02$G\x02%I\x02&K\x02'M\x02(O\x02" + + ";\x02\x1F=\x02 ?\x02!A\x02\"C\x02#E\x02$G\x02%I\x02&K\x02\'M\x02(O\x02" + ")Q\x02*S\x02+U\x02,W\x02-Y\x02.[\x02/]\x020_\x021a\x022c\x023e\x024g\x02" + "5i\x026k\x027m\x028o\x029q\x02:s\x02;u\x02{\x02?}\x02@\x7F" + "\x02A\x81\x02B\x83\x02C\x85\x02D\x87\x02E\x89\x02F\x8B\x02G\x8D\x02H\x8F" + @@ -596,7 +365,7 @@ export class KipperLexer extends KipperLexerBase { "\x02\xD3\x02\x02\xD5\x02\x02\xD7\x02\x02\xD9\x02\x02\xDB\x02\x02\xDD\x02" + "\x02\xDF\x02\x02\xE1\x02\x02\xE3\x02\x02\xE5\x02\x02\xE7\x02\x02\xE9\x02" + "\x02\xEB\x02\x02\x05\x02\x03\x04\x14\x05\x02\f\f\x0F\x0F\u202A\u202B\x06" + - '\x02\v\v\r\x0E""\xA2\xA2\x05\x02C\\aac|\x03\x022;\x04\x02DDdd\x04\x02' + + "\x02\v\v\r\x0E\"\"\xA2\xA2\x05\x02C\\aac|\x03\x022;\x04\x02DDdd\x04\x02" + "QQqq\x04\x02ZZzz\x03\x023;\x03\x0223\x03\x0229\x05\x022;CHch\x04\x02G" + "Ggg\x04\x02--//\x06\x02\f\f\x0F\x0F))^^\x0E\x02$$))AA^^cdhhppttvvxx}}" + "\x7F\x7F\b\x02\f\f\x0F\x0F))^^}}\x7F\x7F\b\x02\f\f\x0F\x0F$$^^}}\x7F\x7F" + @@ -606,7 +375,7 @@ export class KipperLexer extends KipperLexerBase { "\x02\x02\x02\x15\x03\x02\x02\x02\x02\x17\x03\x02\x02\x02\x02\x19\x03\x02" + "\x02\x02\x02\x1B\x03\x02\x02\x02\x02\x1D\x03\x02\x02\x02\x02\x1F\x03\x02" + "\x02\x02\x02!\x03\x02\x02\x02\x02#\x03\x02\x02\x02\x02%\x03\x02\x02\x02" + - "\x02'\x03\x02\x02\x02\x02)\x03\x02\x02\x02\x02+\x03\x02\x02\x02\x02-" + + "\x02\'\x03\x02\x02\x02\x02)\x03\x02\x02\x02\x02+\x03\x02\x02\x02\x02-" + "\x03\x02\x02\x02\x02/\x03\x02\x02\x02\x021\x03\x02\x02\x02\x023\x03\x02" + "\x02\x02\x025\x03\x02\x02\x02\x027\x03\x02\x02\x02\x029\x03\x02\x02\x02" + "\x02;\x03\x02\x02\x02\x02=\x03\x02\x02\x02\x02?\x03\x02\x02\x02\x02A\x03" + @@ -633,7 +402,7 @@ export class KipperLexer extends KipperLexerBase { "\x02\x02\x15\u0123\x03\x02\x02\x02\x17\u012B\x03\x02\x02\x02\x19\u0131" + "\x03\x02\x02\x02\x1B\u013A\x03\x02\x02\x02\x1D\u013D\x03\x02\x02\x02\x1F" + "\u0143\x03\x02\x02\x02!\u0146\x03\x02\x02\x02#\u014B\x03\x02\x02\x02%" + - "\u014F\x03\x02\x02\x02'\u0154\x03\x02\x02\x02)\u0158\x03\x02\x02\x02" + + "\u014F\x03\x02\x02\x02\'\u0154\x03\x02\x02\x02)\u0158\x03\x02\x02\x02" + "+\u015F\x03\x02\x02\x02-\u0164\x03\x02\x02\x02/\u0167\x03\x02\x02\x02" + "1\u016D\x03\x02\x02\x023\u0177\x03\x02\x02\x025\u017C\x03\x02\x02\x02" + "7\u0182\x03\x02\x02\x029\u0189\x03\x02\x02\x02;\u018E\x03\x02\x02\x02" + @@ -701,7 +470,7 @@ export class KipperLexer extends KipperLexerBase { "\x02\u0141\u0142\x07g\x02\x02\u0142\x1E\x03\x02\x02\x02\u0143\u0144\x07" + "k\x02\x02\u0144\u0145\x07h\x02\x02\u0145 \x03\x02\x02\x02\u0146\u0147" + "\x07g\x02\x02\u0147\u0148\x07n\x02\x02\u0148\u0149\x07u\x02\x02\u0149" + - '\u014A\x07g\x02\x02\u014A"\x03\x02\x02\x02\u014B\u014C\x07h\x02\x02\u014C' + + "\u014A\x07g\x02\x02\u014A\"\x03\x02\x02\x02\u014B\u014C\x07h\x02\x02\u014C" + "\u014D\x07q\x02\x02\u014D\u014E\x07t\x02\x02\u014E$\x03\x02\x02\x02\u014F" + "\u0150\x07g\x02\x02\u0150\u0151\x07p\x02\x02\u0151\u0152\x07w\x02\x02" + "\u0152\u0153\x07o\x02\x02\u0153&\x03\x02\x02\x02\u0154\u0155\x07f\x02" + @@ -736,14 +505,14 @@ export class KipperLexer extends KipperLexerBase { "\x02\x02\u01A5\u01A6\x07*\x02\x02\u01A6H\x03\x02\x02\x02\u01A7\u01A8\x07" + "+\x02\x02\u01A8J\x03\x02\x02\x02\u01A9\u01AA\x07]\x02\x02\u01AAL\x03\x02" + "\x02\x02\u01AB\u01AC\x07_\x02\x02\u01ACN\x03\x02\x02\x02\u01AD\u01AE\x06" + - "'\x02\x02\u01AE\u01AF\x07\x7F\x02\x02\u01AF\u01B0\x03\x02\x02\x02\u01B0" + - "\u01B1\b'\x03\x02\u01B1P\x03\x02\x02\x02\u01B2\u01B3\x07}\x02\x02\u01B3" + + "\'\x02\x02\u01AE\u01AF\x07\x7F\x02\x02\u01AF\u01B0\x03\x02\x02\x02\u01B0" + + "\u01B1\b\'\x03\x02\u01B1P\x03\x02\x02\x02\u01B2\u01B3\x07}\x02\x02\u01B3" + "R\x03\x02\x02\x02\u01B4\u01B5\x07\x7F\x02\x02\u01B5T\x03\x02\x02\x02\u01B6" + "\u01B7\x07-\x02\x02\u01B7V\x03\x02\x02\x02\u01B8\u01B9\x07-\x02\x02\u01B9" + "\u01BA\x07-\x02\x02\u01BAX\x03\x02\x02\x02\u01BB\u01BC\x07/\x02\x02\u01BC" + "Z\x03\x02\x02\x02\u01BD\u01BE\x07/\x02\x02\u01BE\u01BF\x07/\x02\x02\u01BF" + "\\\x03\x02\x02\x02\u01C0\u01C1\x07,\x02\x02\u01C1^\x03\x02\x02\x02\u01C2" + - "\u01C3\x071\x02\x02\u01C3`\x03\x02\x02\x02\u01C4\u01C5\x07'\x02\x02\u01C5" + + "\u01C3\x071\x02\x02\u01C3`\x03\x02\x02\x02\u01C4\u01C5\x07\'\x02\x02\u01C5" + "b\x03\x02\x02\x02\u01C6\u01C7\x07,\x02\x02\u01C7\u01C8\x07,\x02\x02\u01C8" + "d\x03\x02\x02\x02\u01C9\u01CA\x07(\x02\x02\u01CA\u01CB\x07(\x02\x02\u01CB" + "f\x03\x02\x02\x02\u01CC\u01CD\x07~\x02\x02\u01CD\u01CE\x07~\x02\x02\u01CE" + @@ -752,7 +521,7 @@ export class KipperLexer extends KipperLexerBase { "\u01D5\x07?\x02\x02\u01D5n\x03\x02\x02\x02\u01D6\u01D7\x07/\x02\x02\u01D7" + "\u01D8\x07?\x02\x02\u01D8p\x03\x02\x02\x02\u01D9\u01DA\x07,\x02\x02\u01DA" + "\u01DB\x07?\x02\x02\u01DBr\x03\x02\x02\x02\u01DC\u01DD\x071\x02\x02\u01DD" + - "\u01DE\x07?\x02\x02\u01DEt\x03\x02\x02\x02\u01DF\u01E0\x07'\x02\x02\u01E0" + + "\u01DE\x07?\x02\x02\u01DEt\x03\x02\x02\x02\u01DF\u01E0\x07\'\x02\x02\u01E0" + "\u01E1\x07?\x02\x02\u01E1v\x03\x02\x02\x02\u01E2\u01E3\x07?\x02\x02\u01E3" + "\u01E4\x07?\x02\x02\u01E4x\x03\x02\x02\x02\u01E5\u01E6\x07#\x02\x02\u01E6" + "\u01E7\x07?\x02\x02\u01E7z\x03\x02\x02\x02\u01E8\u01E9\x07>\x02\x02\u01E9" + @@ -868,7 +637,10 @@ export class KipperLexer extends KipperLexerBase { "\x02\x02\x03\x02\x03P\x02\x07\x03\x02\x03Q\x03\x07\x04\x02\t\x03\x02\x07" + "\x02\x02\x03S\x04\x03V\x05"; public static readonly _serializedATN: string = Utils.join( - [KipperLexer._serializedATNSegment0, KipperLexer._serializedATNSegment1], + [ + KipperLexer._serializedATNSegment0, + KipperLexer._serializedATNSegment1, + ], "", ); public static __ATN: ATN; @@ -879,4 +651,6 @@ export class KipperLexer extends KipperLexerBase { return KipperLexer.__ATN; } + } + diff --git a/kipper/core/src/compiler/parser/antlr/KipperParser.interp b/kipper/core/src/compiler/parser/antlr/KipperParser.interp index c4b1e6cca..817a0f49d 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParser.interp +++ b/kipper/core/src/compiler/parser/antlr/KipperParser.interp @@ -191,6 +191,10 @@ functionDeclaration parameterList parameterDeclaration interfaceDeclaration +interfaceMemberList +interfaceMemberDeclaration +propertySignature +methodSignature classDeclaration statement compoundStatement @@ -256,4 +260,4 @@ typeSpecifierIdentifier atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 87, 704, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 3, 2, 5, 2, 160, 10, 2, 3, 2, 3, 2, 3, 3, 6, 3, 165, 10, 3, 13, 3, 14, 3, 166, 3, 4, 3, 4, 3, 5, 6, 5, 172, 10, 5, 13, 5, 14, 5, 173, 3, 6, 3, 6, 3, 6, 5, 6, 179, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 187, 10, 7, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 199, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 211, 10, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 217, 10, 14, 3, 15, 3, 15, 3, 15, 7, 15, 222, 10, 15, 12, 15, 14, 15, 225, 11, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 247, 10, 19, 3, 20, 3, 20, 3, 20, 5, 20, 252, 10, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 5, 22, 263, 10, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 272, 10, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 280, 10, 24, 12, 24, 14, 24, 283, 11, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 5, 25, 295, 10, 25, 3, 26, 3, 26, 3, 26, 5, 26, 300, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 306, 10, 27, 3, 27, 3, 27, 5, 27, 310, 10, 27, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 316, 10, 27, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 322, 10, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 5, 31, 346, 10, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 5, 32, 359, 10, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 5, 37, 373, 10, 37, 3, 38, 3, 38, 3, 39, 3, 39, 7, 39, 379, 10, 39, 12, 39, 14, 39, 382, 11, 39, 3, 39, 3, 39, 3, 39, 7, 39, 387, 10, 39, 12, 39, 14, 39, 390, 11, 39, 3, 39, 5, 39, 393, 10, 39, 3, 40, 3, 40, 3, 40, 5, 40, 398, 10, 40, 3, 40, 5, 40, 401, 10, 40, 3, 41, 3, 41, 3, 41, 5, 41, 406, 10, 41, 3, 41, 5, 41, 409, 10, 41, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 7, 43, 417, 10, 43, 12, 43, 14, 43, 420, 11, 43, 5, 43, 422, 10, 43, 3, 43, 5, 43, 425, 10, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 7, 44, 433, 10, 44, 12, 44, 14, 44, 436, 11, 44, 5, 44, 438, 10, 44, 3, 44, 5, 44, 441, 10, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 5, 47, 457, 10, 47, 3, 47, 3, 47, 3, 47, 5, 47, 462, 10, 47, 3, 47, 3, 47, 3, 47, 5, 47, 467, 10, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 7, 47, 483, 10, 47, 12, 47, 14, 47, 486, 11, 47, 3, 48, 3, 48, 3, 48, 7, 48, 491, 10, 48, 12, 48, 14, 48, 494, 11, 48, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 507, 10, 51, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 513, 10, 51, 3, 51, 3, 51, 3, 52, 3, 52, 5, 52, 519, 10, 52, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 5, 54, 527, 10, 54, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 5, 59, 544, 10, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 7, 60, 552, 10, 60, 12, 60, 14, 60, 555, 11, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 7, 61, 563, 10, 61, 12, 61, 14, 61, 566, 11, 61, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 7, 62, 575, 10, 62, 12, 62, 14, 62, 578, 11, 62, 3, 63, 3, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 7, 64, 588, 10, 64, 12, 64, 14, 64, 591, 11, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 7, 65, 599, 10, 65, 12, 65, 14, 65, 602, 11, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 7, 66, 610, 10, 66, 12, 66, 14, 66, 613, 11, 66, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 7, 67, 621, 10, 67, 12, 67, 14, 67, 624, 11, 67, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 7, 68, 632, 10, 68, 12, 68, 14, 68, 635, 11, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 7, 69, 643, 10, 69, 12, 69, 14, 69, 646, 11, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 7, 70, 654, 10, 70, 12, 70, 14, 70, 657, 11, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 5, 71, 666, 10, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 5, 72, 673, 10, 72, 3, 73, 3, 73, 3, 74, 3, 74, 3, 74, 7, 74, 680, 10, 74, 12, 74, 14, 74, 683, 11, 74, 3, 75, 3, 75, 3, 75, 5, 75, 688, 10, 75, 3, 76, 3, 76, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 79, 3, 79, 3, 79, 2, 2, 13, 92, 118, 120, 122, 126, 128, 130, 132, 134, 136, 138, 80, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 70, 2, 72, 2, 74, 2, 76, 2, 78, 2, 80, 2, 82, 2, 84, 2, 86, 2, 88, 2, 90, 2, 92, 2, 94, 2, 96, 2, 98, 2, 100, 2, 102, 2, 104, 2, 106, 2, 108, 2, 110, 2, 112, 2, 114, 2, 116, 2, 118, 2, 120, 2, 122, 2, 124, 2, 126, 2, 128, 2, 130, 2, 132, 2, 134, 2, 136, 2, 138, 2, 140, 2, 142, 2, 144, 2, 146, 2, 148, 2, 150, 2, 152, 2, 154, 2, 156, 2, 2, 17, 3, 2, 6, 7, 3, 2, 13, 14, 3, 2, 27, 28, 3, 2, 77, 78, 4, 2, 76, 76, 79, 79, 3, 2, 30, 32, 4, 2, 45, 45, 47, 47, 6, 2, 44, 44, 46, 46, 54, 54, 70, 70, 3, 2, 48, 51, 4, 2, 44, 44, 46, 46, 3, 2, 71, 73, 3, 2, 63, 66, 3, 2, 61, 62, 3, 2, 55, 60, 4, 2, 30, 32, 75, 75, 2, 705, 2, 159, 3, 2, 2, 2, 4, 164, 3, 2, 2, 2, 6, 168, 3, 2, 2, 2, 8, 171, 3, 2, 2, 2, 10, 178, 3, 2, 2, 2, 12, 186, 3, 2, 2, 2, 14, 188, 3, 2, 2, 2, 16, 191, 3, 2, 2, 2, 18, 193, 3, 2, 2, 2, 20, 200, 3, 2, 2, 2, 22, 202, 3, 2, 2, 2, 24, 204, 3, 2, 2, 2, 26, 206, 3, 2, 2, 2, 28, 218, 3, 2, 2, 2, 30, 226, 3, 2, 2, 2, 32, 230, 3, 2, 2, 2, 34, 235, 3, 2, 2, 2, 36, 246, 3, 2, 2, 2, 38, 248, 3, 2, 2, 2, 40, 255, 3, 2, 2, 2, 42, 262, 3, 2, 2, 2, 44, 264, 3, 2, 2, 2, 46, 273, 3, 2, 2, 2, 48, 294, 3, 2, 2, 2, 50, 299, 3, 2, 2, 2, 52, 301, 3, 2, 2, 2, 54, 326, 3, 2, 2, 2, 56, 332, 3, 2, 2, 2, 58, 340, 3, 2, 2, 2, 60, 343, 3, 2, 2, 2, 62, 358, 3, 2, 2, 2, 64, 360, 3, 2, 2, 2, 66, 364, 3, 2, 2, 2, 68, 366, 3, 2, 2, 2, 70, 368, 3, 2, 2, 2, 72, 372, 3, 2, 2, 2, 74, 374, 3, 2, 2, 2, 76, 392, 3, 2, 2, 2, 78, 400, 3, 2, 2, 2, 80, 408, 3, 2, 2, 2, 82, 410, 3, 2, 2, 2, 84, 412, 3, 2, 2, 2, 86, 428, 3, 2, 2, 2, 88, 444, 3, 2, 2, 2, 90, 448, 3, 2, 2, 2, 92, 461, 3, 2, 2, 2, 94, 487, 3, 2, 2, 2, 96, 495, 3, 2, 2, 2, 98, 498, 3, 2, 2, 2, 100, 502, 3, 2, 2, 2, 102, 518, 3, 2, 2, 2, 104, 520, 3, 2, 2, 2, 106, 526, 3, 2, 2, 2, 108, 528, 3, 2, 2, 2, 110, 531, 3, 2, 2, 2, 112, 534, 3, 2, 2, 2, 114, 536, 3, 2, 2, 2, 116, 543, 3, 2, 2, 2, 118, 545, 3, 2, 2, 2, 120, 556, 3, 2, 2, 2, 122, 567, 3, 2, 2, 2, 124, 579, 3, 2, 2, 2, 126, 581, 3, 2, 2, 2, 128, 592, 3, 2, 2, 2, 130, 603, 3, 2, 2, 2, 132, 614, 3, 2, 2, 2, 134, 625, 3, 2, 2, 2, 136, 636, 3, 2, 2, 2, 138, 647, 3, 2, 2, 2, 140, 665, 3, 2, 2, 2, 142, 672, 3, 2, 2, 2, 144, 674, 3, 2, 2, 2, 146, 676, 3, 2, 2, 2, 148, 687, 3, 2, 2, 2, 150, 689, 3, 2, 2, 2, 152, 691, 3, 2, 2, 2, 154, 696, 3, 2, 2, 2, 156, 701, 3, 2, 2, 2, 158, 160, 5, 4, 3, 2, 159, 158, 3, 2, 2, 2, 159, 160, 3, 2, 2, 2, 160, 161, 3, 2, 2, 2, 161, 162, 7, 2, 2, 3, 162, 3, 3, 2, 2, 2, 163, 165, 5, 6, 4, 2, 164, 163, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 164, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 5, 3, 2, 2, 2, 168, 169, 5, 8, 5, 2, 169, 7, 3, 2, 2, 2, 170, 172, 5, 10, 6, 2, 171, 170, 3, 2, 2, 2, 172, 173, 3, 2, 2, 2, 173, 171, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 174, 9, 3, 2, 2, 2, 175, 179, 5, 36, 19, 2, 176, 179, 5, 12, 7, 2, 177, 179, 7, 34, 2, 2, 178, 175, 3, 2, 2, 2, 178, 176, 3, 2, 2, 2, 178, 177, 3, 2, 2, 2, 179, 11, 3, 2, 2, 2, 180, 181, 5, 14, 8, 2, 181, 182, 7, 34, 2, 2, 182, 187, 3, 2, 2, 2, 183, 187, 5, 26, 14, 2, 184, 187, 5, 32, 17, 2, 185, 187, 5, 34, 18, 2, 186, 180, 3, 2, 2, 2, 186, 183, 3, 2, 2, 2, 186, 184, 3, 2, 2, 2, 186, 185, 3, 2, 2, 2, 187, 13, 3, 2, 2, 2, 188, 189, 5, 16, 9, 2, 189, 190, 5, 18, 10, 2, 190, 15, 3, 2, 2, 2, 191, 192, 9, 2, 2, 2, 192, 17, 3, 2, 2, 2, 193, 194, 5, 22, 12, 2, 194, 195, 7, 36, 2, 2, 195, 198, 5, 148, 75, 2, 196, 197, 7, 55, 2, 2, 197, 199, 5, 20, 11, 2, 198, 196, 3, 2, 2, 2, 198, 199, 3, 2, 2, 2, 199, 19, 3, 2, 2, 2, 200, 201, 5, 142, 72, 2, 201, 21, 3, 2, 2, 2, 202, 203, 5, 24, 13, 2, 203, 23, 3, 2, 2, 2, 204, 205, 7, 75, 2, 2, 205, 25, 3, 2, 2, 2, 206, 207, 7, 21, 2, 2, 207, 208, 5, 22, 12, 2, 208, 210, 7, 37, 2, 2, 209, 211, 5, 28, 15, 2, 210, 209, 3, 2, 2, 2, 210, 211, 3, 2, 2, 2, 211, 212, 3, 2, 2, 2, 212, 213, 7, 38, 2, 2, 213, 214, 7, 24, 2, 2, 214, 216, 5, 148, 75, 2, 215, 217, 5, 38, 20, 2, 216, 215, 3, 2, 2, 2, 216, 217, 3, 2, 2, 2, 217, 27, 3, 2, 2, 2, 218, 223, 5, 30, 16, 2, 219, 220, 7, 33, 2, 2, 220, 222, 5, 30, 16, 2, 221, 219, 3, 2, 2, 2, 222, 225, 3, 2, 2, 2, 223, 221, 3, 2, 2, 2, 223, 224, 3, 2, 2, 2, 224, 29, 3, 2, 2, 2, 225, 223, 3, 2, 2, 2, 226, 227, 5, 22, 12, 2, 227, 228, 7, 36, 2, 2, 228, 229, 5, 148, 75, 2, 229, 31, 3, 2, 2, 2, 230, 231, 7, 26, 2, 2, 231, 232, 7, 75, 2, 2, 232, 233, 7, 42, 2, 2, 233, 234, 7, 43, 2, 2, 234, 33, 3, 2, 2, 2, 235, 236, 7, 25, 2, 2, 236, 237, 7, 75, 2, 2, 237, 238, 7, 42, 2, 2, 238, 239, 7, 43, 2, 2, 239, 35, 3, 2, 2, 2, 240, 247, 5, 40, 21, 2, 241, 247, 5, 42, 22, 2, 242, 247, 5, 50, 26, 2, 243, 247, 5, 58, 30, 2, 244, 247, 5, 60, 31, 2, 245, 247, 5, 38, 20, 2, 246, 240, 3, 2, 2, 2, 246, 241, 3, 2, 2, 2, 246, 242, 3, 2, 2, 2, 246, 243, 3, 2, 2, 2, 246, 244, 3, 2, 2, 2, 246, 245, 3, 2, 2, 2, 247, 37, 3, 2, 2, 2, 248, 249, 6, 20, 2, 2, 249, 251, 7, 42, 2, 2, 250, 252, 5, 8, 5, 2, 251, 250, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 254, 7, 43, 2, 2, 254, 39, 3, 2, 2, 2, 255, 256, 8, 21, 1, 2, 256, 257, 5, 146, 74, 2, 257, 258, 7, 34, 2, 2, 258, 259, 8, 21, 1, 2, 259, 41, 3, 2, 2, 2, 260, 263, 5, 44, 23, 2, 261, 263, 5, 46, 24, 2, 262, 260, 3, 2, 2, 2, 262, 261, 3, 2, 2, 2, 263, 43, 3, 2, 2, 2, 264, 265, 7, 17, 2, 2, 265, 266, 7, 37, 2, 2, 266, 267, 5, 146, 74, 2, 267, 268, 7, 38, 2, 2, 268, 271, 5, 36, 19, 2, 269, 270, 7, 18, 2, 2, 270, 272, 5, 36, 19, 2, 271, 269, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 45, 3, 2, 2, 2, 273, 274, 7, 10, 2, 2, 274, 275, 7, 37, 2, 2, 275, 276, 5, 146, 74, 2, 276, 277, 7, 38, 2, 2, 277, 281, 7, 42, 2, 2, 278, 280, 5, 48, 25, 2, 279, 278, 3, 2, 2, 2, 280, 283, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 284, 3, 2, 2, 2, 283, 281, 3, 2, 2, 2, 284, 285, 7, 43, 2, 2, 285, 47, 3, 2, 2, 2, 286, 287, 7, 11, 2, 2, 287, 288, 5, 146, 74, 2, 288, 289, 7, 36, 2, 2, 289, 290, 5, 36, 19, 2, 290, 295, 3, 2, 2, 2, 291, 292, 7, 12, 2, 2, 292, 293, 7, 36, 2, 2, 293, 295, 5, 36, 19, 2, 294, 286, 3, 2, 2, 2, 294, 291, 3, 2, 2, 2, 295, 49, 3, 2, 2, 2, 296, 300, 5, 52, 27, 2, 297, 300, 5, 54, 28, 2, 298, 300, 5, 56, 29, 2, 299, 296, 3, 2, 2, 2, 299, 297, 3, 2, 2, 2, 299, 298, 3, 2, 2, 2, 300, 51, 3, 2, 2, 2, 301, 302, 7, 19, 2, 2, 302, 309, 7, 37, 2, 2, 303, 306, 5, 14, 8, 2, 304, 306, 5, 146, 74, 2, 305, 303, 3, 2, 2, 2, 305, 304, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 308, 8, 27, 1, 2, 308, 310, 3, 2, 2, 2, 309, 305, 3, 2, 2, 2, 309, 310, 3, 2, 2, 2, 310, 311, 3, 2, 2, 2, 311, 315, 7, 34, 2, 2, 312, 313, 5, 146, 74, 2, 313, 314, 8, 27, 1, 2, 314, 316, 3, 2, 2, 2, 315, 312, 3, 2, 2, 2, 315, 316, 3, 2, 2, 2, 316, 317, 3, 2, 2, 2, 317, 321, 7, 34, 2, 2, 318, 319, 5, 146, 74, 2, 319, 320, 8, 27, 1, 2, 320, 322, 3, 2, 2, 2, 321, 318, 3, 2, 2, 2, 321, 322, 3, 2, 2, 2, 322, 323, 3, 2, 2, 2, 323, 324, 7, 38, 2, 2, 324, 325, 5, 36, 19, 2, 325, 53, 3, 2, 2, 2, 326, 327, 7, 16, 2, 2, 327, 328, 7, 37, 2, 2, 328, 329, 5, 146, 74, 2, 329, 330, 7, 38, 2, 2, 330, 331, 5, 36, 19, 2, 331, 55, 3, 2, 2, 2, 332, 333, 7, 15, 2, 2, 333, 334, 5, 36, 19, 2, 334, 335, 7, 16, 2, 2, 335, 336, 7, 37, 2, 2, 336, 337, 5, 146, 74, 2, 337, 338, 7, 38, 2, 2, 338, 339, 7, 34, 2, 2, 339, 57, 3, 2, 2, 2, 340, 341, 9, 3, 2, 2, 341, 342, 7, 34, 2, 2, 342, 59, 3, 2, 2, 2, 343, 345, 7, 22, 2, 2, 344, 346, 5, 146, 74, 2, 345, 344, 3, 2, 2, 2, 345, 346, 3, 2, 2, 2, 346, 347, 3, 2, 2, 2, 347, 348, 7, 34, 2, 2, 348, 61, 3, 2, 2, 2, 349, 359, 5, 64, 33, 2, 350, 359, 5, 84, 43, 2, 351, 359, 5, 86, 44, 2, 352, 359, 5, 66, 34, 2, 353, 359, 5, 68, 35, 2, 354, 359, 5, 74, 38, 2, 355, 359, 5, 76, 39, 2, 356, 359, 5, 82, 42, 2, 357, 359, 5, 90, 46, 2, 358, 349, 3, 2, 2, 2, 358, 350, 3, 2, 2, 2, 358, 351, 3, 2, 2, 2, 358, 352, 3, 2, 2, 2, 358, 353, 3, 2, 2, 2, 358, 354, 3, 2, 2, 2, 358, 355, 3, 2, 2, 2, 358, 356, 3, 2, 2, 2, 358, 357, 3, 2, 2, 2, 359, 63, 3, 2, 2, 2, 360, 361, 7, 37, 2, 2, 361, 362, 5, 146, 74, 2, 362, 363, 7, 38, 2, 2, 363, 65, 3, 2, 2, 2, 364, 365, 9, 4, 2, 2, 365, 67, 3, 2, 2, 2, 366, 367, 5, 70, 36, 2, 367, 69, 3, 2, 2, 2, 368, 369, 7, 75, 2, 2, 369, 71, 3, 2, 2, 2, 370, 373, 5, 70, 36, 2, 371, 373, 5, 74, 38, 2, 372, 370, 3, 2, 2, 2, 372, 371, 3, 2, 2, 2, 373, 73, 3, 2, 2, 2, 374, 375, 9, 5, 2, 2, 375, 75, 3, 2, 2, 2, 376, 380, 7, 82, 2, 2, 377, 379, 5, 78, 40, 2, 378, 377, 3, 2, 2, 2, 379, 382, 3, 2, 2, 2, 380, 378, 3, 2, 2, 2, 380, 381, 3, 2, 2, 2, 381, 383, 3, 2, 2, 2, 382, 380, 3, 2, 2, 2, 383, 393, 7, 84, 2, 2, 384, 388, 7, 83, 2, 2, 385, 387, 5, 80, 41, 2, 386, 385, 3, 2, 2, 2, 387, 390, 3, 2, 2, 2, 388, 386, 3, 2, 2, 2, 388, 389, 3, 2, 2, 2, 389, 391, 3, 2, 2, 2, 390, 388, 3, 2, 2, 2, 391, 393, 7, 86, 2, 2, 392, 376, 3, 2, 2, 2, 392, 384, 3, 2, 2, 2, 393, 77, 3, 2, 2, 2, 394, 401, 7, 85, 2, 2, 395, 397, 7, 3, 2, 2, 396, 398, 5, 146, 74, 2, 397, 396, 3, 2, 2, 2, 397, 398, 3, 2, 2, 2, 398, 399, 3, 2, 2, 2, 399, 401, 7, 41, 2, 2, 400, 394, 3, 2, 2, 2, 400, 395, 3, 2, 2, 2, 401, 79, 3, 2, 2, 2, 402, 409, 7, 87, 2, 2, 403, 405, 7, 3, 2, 2, 404, 406, 5, 146, 74, 2, 405, 404, 3, 2, 2, 2, 405, 406, 3, 2, 2, 2, 406, 407, 3, 2, 2, 2, 407, 409, 7, 41, 2, 2, 408, 402, 3, 2, 2, 2, 408, 403, 3, 2, 2, 2, 409, 81, 3, 2, 2, 2, 410, 411, 9, 6, 2, 2, 411, 83, 3, 2, 2, 2, 412, 421, 7, 39, 2, 2, 413, 418, 5, 146, 74, 2, 414, 415, 7, 33, 2, 2, 415, 417, 5, 146, 74, 2, 416, 414, 3, 2, 2, 2, 417, 420, 3, 2, 2, 2, 418, 416, 3, 2, 2, 2, 418, 419, 3, 2, 2, 2, 419, 422, 3, 2, 2, 2, 420, 418, 3, 2, 2, 2, 421, 413, 3, 2, 2, 2, 421, 422, 3, 2, 2, 2, 422, 424, 3, 2, 2, 2, 423, 425, 7, 33, 2, 2, 424, 423, 3, 2, 2, 2, 424, 425, 3, 2, 2, 2, 425, 426, 3, 2, 2, 2, 426, 427, 7, 40, 2, 2, 427, 85, 3, 2, 2, 2, 428, 437, 7, 42, 2, 2, 429, 434, 5, 88, 45, 2, 430, 431, 7, 33, 2, 2, 431, 433, 5, 88, 45, 2, 432, 430, 3, 2, 2, 2, 433, 436, 3, 2, 2, 2, 434, 432, 3, 2, 2, 2, 434, 435, 3, 2, 2, 2, 435, 438, 3, 2, 2, 2, 436, 434, 3, 2, 2, 2, 437, 429, 3, 2, 2, 2, 437, 438, 3, 2, 2, 2, 438, 440, 3, 2, 2, 2, 439, 441, 7, 33, 2, 2, 440, 439, 3, 2, 2, 2, 440, 441, 3, 2, 2, 2, 441, 442, 3, 2, 2, 2, 442, 443, 7, 43, 2, 2, 443, 87, 3, 2, 2, 2, 444, 445, 5, 72, 37, 2, 445, 446, 7, 36, 2, 2, 446, 447, 5, 146, 74, 2, 447, 89, 3, 2, 2, 2, 448, 449, 9, 7, 2, 2, 449, 91, 3, 2, 2, 2, 450, 451, 8, 47, 1, 2, 451, 462, 5, 62, 32, 2, 452, 453, 7, 23, 2, 2, 453, 454, 5, 92, 47, 2, 454, 456, 7, 37, 2, 2, 455, 457, 5, 94, 48, 2, 456, 455, 3, 2, 2, 2, 456, 457, 3, 2, 2, 2, 457, 458, 3, 2, 2, 2, 458, 459, 7, 38, 2, 2, 459, 460, 8, 47, 1, 2, 460, 462, 3, 2, 2, 2, 461, 450, 3, 2, 2, 2, 461, 452, 3, 2, 2, 2, 462, 484, 3, 2, 2, 2, 463, 464, 12, 7, 2, 2, 464, 466, 7, 37, 2, 2, 465, 467, 5, 94, 48, 2, 466, 465, 3, 2, 2, 2, 466, 467, 3, 2, 2, 2, 467, 468, 3, 2, 2, 2, 468, 469, 7, 38, 2, 2, 469, 483, 8, 47, 1, 2, 470, 471, 12, 5, 2, 2, 471, 472, 5, 96, 49, 2, 472, 473, 8, 47, 1, 2, 473, 483, 3, 2, 2, 2, 474, 475, 12, 4, 2, 2, 475, 476, 5, 98, 50, 2, 476, 477, 8, 47, 1, 2, 477, 483, 3, 2, 2, 2, 478, 479, 12, 3, 2, 2, 479, 480, 5, 100, 51, 2, 480, 481, 8, 47, 1, 2, 481, 483, 3, 2, 2, 2, 482, 463, 3, 2, 2, 2, 482, 470, 3, 2, 2, 2, 482, 474, 3, 2, 2, 2, 482, 478, 3, 2, 2, 2, 483, 486, 3, 2, 2, 2, 484, 482, 3, 2, 2, 2, 484, 485, 3, 2, 2, 2, 485, 93, 3, 2, 2, 2, 486, 484, 3, 2, 2, 2, 487, 492, 5, 142, 72, 2, 488, 489, 7, 33, 2, 2, 489, 491, 5, 142, 72, 2, 490, 488, 3, 2, 2, 2, 491, 494, 3, 2, 2, 2, 492, 490, 3, 2, 2, 2, 492, 493, 3, 2, 2, 2, 493, 95, 3, 2, 2, 2, 494, 492, 3, 2, 2, 2, 495, 496, 7, 74, 2, 2, 496, 497, 5, 70, 36, 2, 497, 97, 3, 2, 2, 2, 498, 499, 7, 39, 2, 2, 499, 500, 5, 146, 74, 2, 500, 501, 7, 40, 2, 2, 501, 99, 3, 2, 2, 2, 502, 506, 7, 39, 2, 2, 503, 504, 5, 146, 74, 2, 504, 505, 8, 51, 1, 2, 505, 507, 3, 2, 2, 2, 506, 503, 3, 2, 2, 2, 506, 507, 3, 2, 2, 2, 507, 508, 3, 2, 2, 2, 508, 512, 7, 36, 2, 2, 509, 510, 5, 146, 74, 2, 510, 511, 8, 51, 1, 2, 511, 513, 3, 2, 2, 2, 512, 509, 3, 2, 2, 2, 512, 513, 3, 2, 2, 2, 513, 514, 3, 2, 2, 2, 514, 515, 7, 40, 2, 2, 515, 101, 3, 2, 2, 2, 516, 519, 5, 92, 47, 2, 517, 519, 5, 104, 53, 2, 518, 516, 3, 2, 2, 2, 518, 517, 3, 2, 2, 2, 519, 103, 3, 2, 2, 2, 520, 521, 5, 92, 47, 2, 521, 522, 5, 112, 57, 2, 522, 105, 3, 2, 2, 2, 523, 527, 5, 102, 52, 2, 524, 527, 5, 108, 55, 2, 525, 527, 5, 110, 56, 2, 526, 523, 3, 2, 2, 2, 526, 524, 3, 2, 2, 2, 526, 525, 3, 2, 2, 2, 527, 107, 3, 2, 2, 2, 528, 529, 5, 112, 57, 2, 529, 530, 5, 102, 52, 2, 530, 109, 3, 2, 2, 2, 531, 532, 5, 114, 58, 2, 532, 533, 5, 102, 52, 2, 533, 111, 3, 2, 2, 2, 534, 535, 9, 8, 2, 2, 535, 113, 3, 2, 2, 2, 536, 537, 9, 9, 2, 2, 537, 115, 3, 2, 2, 2, 538, 544, 5, 106, 54, 2, 539, 540, 5, 106, 54, 2, 540, 541, 7, 8, 2, 2, 541, 542, 5, 148, 75, 2, 542, 544, 3, 2, 2, 2, 543, 538, 3, 2, 2, 2, 543, 539, 3, 2, 2, 2, 544, 117, 3, 2, 2, 2, 545, 546, 8, 60, 1, 2, 546, 547, 5, 116, 59, 2, 547, 553, 3, 2, 2, 2, 548, 549, 12, 3, 2, 2, 549, 550, 9, 10, 2, 2, 550, 552, 5, 116, 59, 2, 551, 548, 3, 2, 2, 2, 552, 555, 3, 2, 2, 2, 553, 551, 3, 2, 2, 2, 553, 554, 3, 2, 2, 2, 554, 119, 3, 2, 2, 2, 555, 553, 3, 2, 2, 2, 556, 557, 8, 61, 1, 2, 557, 558, 5, 118, 60, 2, 558, 564, 3, 2, 2, 2, 559, 560, 12, 3, 2, 2, 560, 561, 9, 11, 2, 2, 561, 563, 5, 118, 60, 2, 562, 559, 3, 2, 2, 2, 563, 566, 3, 2, 2, 2, 564, 562, 3, 2, 2, 2, 564, 565, 3, 2, 2, 2, 565, 121, 3, 2, 2, 2, 566, 564, 3, 2, 2, 2, 567, 568, 8, 62, 1, 2, 568, 569, 5, 120, 61, 2, 569, 576, 3, 2, 2, 2, 570, 571, 12, 3, 2, 2, 571, 572, 5, 124, 63, 2, 572, 573, 5, 130, 66, 2, 573, 575, 3, 2, 2, 2, 574, 570, 3, 2, 2, 2, 575, 578, 3, 2, 2, 2, 576, 574, 3, 2, 2, 2, 576, 577, 3, 2, 2, 2, 577, 123, 3, 2, 2, 2, 578, 576, 3, 2, 2, 2, 579, 580, 9, 12, 2, 2, 580, 125, 3, 2, 2, 2, 581, 582, 8, 64, 1, 2, 582, 583, 5, 122, 62, 2, 583, 589, 3, 2, 2, 2, 584, 585, 12, 3, 2, 2, 585, 586, 9, 13, 2, 2, 586, 588, 5, 122, 62, 2, 587, 584, 3, 2, 2, 2, 588, 591, 3, 2, 2, 2, 589, 587, 3, 2, 2, 2, 589, 590, 3, 2, 2, 2, 590, 127, 3, 2, 2, 2, 591, 589, 3, 2, 2, 2, 592, 593, 8, 65, 1, 2, 593, 594, 5, 126, 64, 2, 594, 600, 3, 2, 2, 2, 595, 596, 12, 3, 2, 2, 596, 597, 9, 14, 2, 2, 597, 599, 5, 126, 64, 2, 598, 595, 3, 2, 2, 2, 599, 602, 3, 2, 2, 2, 600, 598, 3, 2, 2, 2, 600, 601, 3, 2, 2, 2, 601, 129, 3, 2, 2, 2, 602, 600, 3, 2, 2, 2, 603, 604, 8, 66, 1, 2, 604, 605, 5, 128, 65, 2, 605, 611, 3, 2, 2, 2, 606, 607, 12, 3, 2, 2, 607, 608, 7, 67, 2, 2, 608, 610, 5, 128, 65, 2, 609, 606, 3, 2, 2, 2, 610, 613, 3, 2, 2, 2, 611, 609, 3, 2, 2, 2, 611, 612, 3, 2, 2, 2, 612, 131, 3, 2, 2, 2, 613, 611, 3, 2, 2, 2, 614, 615, 8, 67, 1, 2, 615, 616, 5, 130, 66, 2, 616, 622, 3, 2, 2, 2, 617, 618, 12, 3, 2, 2, 618, 619, 7, 69, 2, 2, 619, 621, 5, 130, 66, 2, 620, 617, 3, 2, 2, 2, 621, 624, 3, 2, 2, 2, 622, 620, 3, 2, 2, 2, 622, 623, 3, 2, 2, 2, 623, 133, 3, 2, 2, 2, 624, 622, 3, 2, 2, 2, 625, 626, 8, 68, 1, 2, 626, 627, 5, 132, 67, 2, 627, 633, 3, 2, 2, 2, 628, 629, 12, 3, 2, 2, 629, 630, 7, 68, 2, 2, 630, 632, 5, 132, 67, 2, 631, 628, 3, 2, 2, 2, 632, 635, 3, 2, 2, 2, 633, 631, 3, 2, 2, 2, 633, 634, 3, 2, 2, 2, 634, 135, 3, 2, 2, 2, 635, 633, 3, 2, 2, 2, 636, 637, 8, 69, 1, 2, 637, 638, 5, 134, 68, 2, 638, 644, 3, 2, 2, 2, 639, 640, 12, 3, 2, 2, 640, 641, 7, 52, 2, 2, 641, 643, 5, 134, 68, 2, 642, 639, 3, 2, 2, 2, 643, 646, 3, 2, 2, 2, 644, 642, 3, 2, 2, 2, 644, 645, 3, 2, 2, 2, 645, 137, 3, 2, 2, 2, 646, 644, 3, 2, 2, 2, 647, 648, 8, 70, 1, 2, 648, 649, 5, 136, 69, 2, 649, 655, 3, 2, 2, 2, 650, 651, 12, 3, 2, 2, 651, 652, 7, 53, 2, 2, 652, 654, 5, 136, 69, 2, 653, 650, 3, 2, 2, 2, 654, 657, 3, 2, 2, 2, 655, 653, 3, 2, 2, 2, 655, 656, 3, 2, 2, 2, 656, 139, 3, 2, 2, 2, 657, 655, 3, 2, 2, 2, 658, 666, 5, 138, 70, 2, 659, 660, 5, 138, 70, 2, 660, 661, 7, 35, 2, 2, 661, 662, 5, 140, 71, 2, 662, 663, 7, 36, 2, 2, 663, 664, 5, 140, 71, 2, 664, 666, 3, 2, 2, 2, 665, 658, 3, 2, 2, 2, 665, 659, 3, 2, 2, 2, 666, 141, 3, 2, 2, 2, 667, 673, 5, 140, 71, 2, 668, 669, 5, 92, 47, 2, 669, 670, 5, 144, 73, 2, 670, 671, 5, 142, 72, 2, 671, 673, 3, 2, 2, 2, 672, 667, 3, 2, 2, 2, 672, 668, 3, 2, 2, 2, 673, 143, 3, 2, 2, 2, 674, 675, 9, 15, 2, 2, 675, 145, 3, 2, 2, 2, 676, 681, 5, 142, 72, 2, 677, 678, 7, 33, 2, 2, 678, 680, 5, 142, 72, 2, 679, 677, 3, 2, 2, 2, 680, 683, 3, 2, 2, 2, 681, 679, 3, 2, 2, 2, 681, 682, 3, 2, 2, 2, 682, 147, 3, 2, 2, 2, 683, 681, 3, 2, 2, 2, 684, 688, 5, 150, 76, 2, 685, 688, 5, 152, 77, 2, 686, 688, 5, 154, 78, 2, 687, 684, 3, 2, 2, 2, 687, 685, 3, 2, 2, 2, 687, 686, 3, 2, 2, 2, 688, 149, 3, 2, 2, 2, 689, 690, 5, 156, 79, 2, 690, 151, 3, 2, 2, 2, 691, 692, 5, 156, 79, 2, 692, 693, 7, 63, 2, 2, 693, 694, 5, 156, 79, 2, 694, 695, 7, 65, 2, 2, 695, 153, 3, 2, 2, 2, 696, 697, 7, 29, 2, 2, 697, 698, 7, 37, 2, 2, 698, 699, 5, 156, 79, 2, 699, 700, 7, 38, 2, 2, 700, 155, 3, 2, 2, 2, 701, 702, 9, 16, 2, 2, 702, 157, 3, 2, 2, 2, 63, 159, 166, 173, 178, 186, 198, 210, 216, 223, 246, 251, 262, 271, 281, 294, 299, 305, 309, 315, 321, 345, 358, 372, 380, 388, 392, 397, 400, 405, 408, 418, 421, 424, 434, 437, 440, 456, 461, 466, 482, 484, 492, 506, 512, 518, 526, 543, 553, 564, 576, 589, 600, 611, 622, 633, 644, 655, 665, 672, 681, 687] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 87, 739, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 3, 2, 5, 2, 168, 10, 2, 3, 2, 3, 2, 3, 3, 6, 3, 173, 10, 3, 13, 3, 14, 3, 174, 3, 4, 3, 4, 3, 5, 6, 5, 180, 10, 5, 13, 5, 14, 5, 181, 3, 6, 3, 6, 3, 6, 5, 6, 187, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 195, 10, 7, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 207, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 219, 10, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 225, 10, 14, 3, 15, 3, 15, 3, 15, 7, 15, 230, 10, 15, 12, 15, 14, 15, 233, 11, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 5, 17, 243, 10, 17, 3, 17, 3, 17, 3, 18, 6, 18, 248, 10, 18, 13, 18, 14, 18, 249, 3, 19, 3, 19, 5, 19, 254, 10, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 5, 21, 264, 10, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 282, 10, 23, 3, 24, 3, 24, 3, 24, 5, 24, 287, 10, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 5, 26, 298, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 307, 10, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 7, 28, 315, 10, 28, 12, 28, 14, 28, 318, 11, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 5, 29, 330, 10, 29, 3, 30, 3, 30, 3, 30, 5, 30, 335, 10, 30, 3, 31, 3, 31, 3, 31, 3, 31, 5, 31, 341, 10, 31, 3, 31, 3, 31, 5, 31, 345, 10, 31, 3, 31, 3, 31, 3, 31, 3, 31, 5, 31, 351, 10, 31, 3, 31, 3, 31, 3, 31, 3, 31, 5, 31, 357, 10, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 5, 35, 381, 10, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 394, 10, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 5, 41, 408, 10, 41, 3, 42, 3, 42, 3, 43, 3, 43, 7, 43, 414, 10, 43, 12, 43, 14, 43, 417, 11, 43, 3, 43, 3, 43, 3, 43, 7, 43, 422, 10, 43, 12, 43, 14, 43, 425, 11, 43, 3, 43, 5, 43, 428, 10, 43, 3, 44, 3, 44, 3, 44, 5, 44, 433, 10, 44, 3, 44, 5, 44, 436, 10, 44, 3, 45, 3, 45, 3, 45, 5, 45, 441, 10, 45, 3, 45, 5, 45, 444, 10, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 7, 47, 452, 10, 47, 12, 47, 14, 47, 455, 11, 47, 5, 47, 457, 10, 47, 3, 47, 5, 47, 460, 10, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 7, 48, 468, 10, 48, 12, 48, 14, 48, 471, 11, 48, 5, 48, 473, 10, 48, 3, 48, 5, 48, 476, 10, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 492, 10, 51, 3, 51, 3, 51, 3, 51, 5, 51, 497, 10, 51, 3, 51, 3, 51, 3, 51, 5, 51, 502, 10, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 7, 51, 518, 10, 51, 12, 51, 14, 51, 521, 11, 51, 3, 52, 3, 52, 3, 52, 7, 52, 526, 10, 52, 12, 52, 14, 52, 529, 11, 52, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 542, 10, 55, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 548, 10, 55, 3, 55, 3, 55, 3, 56, 3, 56, 5, 56, 554, 10, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 5, 58, 562, 10, 58, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 5, 63, 579, 10, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 7, 64, 587, 10, 64, 12, 64, 14, 64, 590, 11, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 7, 65, 598, 10, 65, 12, 65, 14, 65, 601, 11, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 7, 66, 610, 10, 66, 12, 66, 14, 66, 613, 11, 66, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 7, 68, 623, 10, 68, 12, 68, 14, 68, 626, 11, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 7, 69, 634, 10, 69, 12, 69, 14, 69, 637, 11, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 7, 70, 645, 10, 70, 12, 70, 14, 70, 648, 11, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 7, 71, 656, 10, 71, 12, 71, 14, 71, 659, 11, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 7, 72, 667, 10, 72, 12, 72, 14, 72, 670, 11, 72, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 7, 73, 678, 10, 73, 12, 73, 14, 73, 681, 11, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 7, 74, 689, 10, 74, 12, 74, 14, 74, 692, 11, 74, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 5, 75, 701, 10, 75, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 5, 76, 708, 10, 76, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 7, 78, 715, 10, 78, 12, 78, 14, 78, 718, 11, 78, 3, 79, 3, 79, 3, 79, 5, 79, 723, 10, 79, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 2, 2, 13, 100, 126, 128, 130, 134, 136, 138, 140, 142, 144, 146, 84, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 70, 2, 72, 2, 74, 2, 76, 2, 78, 2, 80, 2, 82, 2, 84, 2, 86, 2, 88, 2, 90, 2, 92, 2, 94, 2, 96, 2, 98, 2, 100, 2, 102, 2, 104, 2, 106, 2, 108, 2, 110, 2, 112, 2, 114, 2, 116, 2, 118, 2, 120, 2, 122, 2, 124, 2, 126, 2, 128, 2, 130, 2, 132, 2, 134, 2, 136, 2, 138, 2, 140, 2, 142, 2, 144, 2, 146, 2, 148, 2, 150, 2, 152, 2, 154, 2, 156, 2, 158, 2, 160, 2, 162, 2, 164, 2, 2, 17, 3, 2, 6, 7, 3, 2, 13, 14, 3, 2, 27, 28, 3, 2, 77, 78, 4, 2, 76, 76, 79, 79, 3, 2, 30, 32, 4, 2, 45, 45, 47, 47, 6, 2, 44, 44, 46, 46, 54, 54, 70, 70, 3, 2, 48, 51, 4, 2, 44, 44, 46, 46, 3, 2, 71, 73, 3, 2, 63, 66, 3, 2, 61, 62, 3, 2, 55, 60, 4, 2, 30, 32, 75, 75, 2, 740, 2, 167, 3, 2, 2, 2, 4, 172, 3, 2, 2, 2, 6, 176, 3, 2, 2, 2, 8, 179, 3, 2, 2, 2, 10, 186, 3, 2, 2, 2, 12, 194, 3, 2, 2, 2, 14, 196, 3, 2, 2, 2, 16, 199, 3, 2, 2, 2, 18, 201, 3, 2, 2, 2, 20, 208, 3, 2, 2, 2, 22, 210, 3, 2, 2, 2, 24, 212, 3, 2, 2, 2, 26, 214, 3, 2, 2, 2, 28, 226, 3, 2, 2, 2, 30, 234, 3, 2, 2, 2, 32, 238, 3, 2, 2, 2, 34, 247, 3, 2, 2, 2, 36, 253, 3, 2, 2, 2, 38, 255, 3, 2, 2, 2, 40, 260, 3, 2, 2, 2, 42, 270, 3, 2, 2, 2, 44, 281, 3, 2, 2, 2, 46, 283, 3, 2, 2, 2, 48, 290, 3, 2, 2, 2, 50, 297, 3, 2, 2, 2, 52, 299, 3, 2, 2, 2, 54, 308, 3, 2, 2, 2, 56, 329, 3, 2, 2, 2, 58, 334, 3, 2, 2, 2, 60, 336, 3, 2, 2, 2, 62, 361, 3, 2, 2, 2, 64, 367, 3, 2, 2, 2, 66, 375, 3, 2, 2, 2, 68, 378, 3, 2, 2, 2, 70, 393, 3, 2, 2, 2, 72, 395, 3, 2, 2, 2, 74, 399, 3, 2, 2, 2, 76, 401, 3, 2, 2, 2, 78, 403, 3, 2, 2, 2, 80, 407, 3, 2, 2, 2, 82, 409, 3, 2, 2, 2, 84, 427, 3, 2, 2, 2, 86, 435, 3, 2, 2, 2, 88, 443, 3, 2, 2, 2, 90, 445, 3, 2, 2, 2, 92, 447, 3, 2, 2, 2, 94, 463, 3, 2, 2, 2, 96, 479, 3, 2, 2, 2, 98, 483, 3, 2, 2, 2, 100, 496, 3, 2, 2, 2, 102, 522, 3, 2, 2, 2, 104, 530, 3, 2, 2, 2, 106, 533, 3, 2, 2, 2, 108, 537, 3, 2, 2, 2, 110, 553, 3, 2, 2, 2, 112, 555, 3, 2, 2, 2, 114, 561, 3, 2, 2, 2, 116, 563, 3, 2, 2, 2, 118, 566, 3, 2, 2, 2, 120, 569, 3, 2, 2, 2, 122, 571, 3, 2, 2, 2, 124, 578, 3, 2, 2, 2, 126, 580, 3, 2, 2, 2, 128, 591, 3, 2, 2, 2, 130, 602, 3, 2, 2, 2, 132, 614, 3, 2, 2, 2, 134, 616, 3, 2, 2, 2, 136, 627, 3, 2, 2, 2, 138, 638, 3, 2, 2, 2, 140, 649, 3, 2, 2, 2, 142, 660, 3, 2, 2, 2, 144, 671, 3, 2, 2, 2, 146, 682, 3, 2, 2, 2, 148, 700, 3, 2, 2, 2, 150, 707, 3, 2, 2, 2, 152, 709, 3, 2, 2, 2, 154, 711, 3, 2, 2, 2, 156, 722, 3, 2, 2, 2, 158, 724, 3, 2, 2, 2, 160, 726, 3, 2, 2, 2, 162, 731, 3, 2, 2, 2, 164, 736, 3, 2, 2, 2, 166, 168, 5, 4, 3, 2, 167, 166, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 170, 7, 2, 2, 3, 170, 3, 3, 2, 2, 2, 171, 173, 5, 6, 4, 2, 172, 171, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 174, 172, 3, 2, 2, 2, 174, 175, 3, 2, 2, 2, 175, 5, 3, 2, 2, 2, 176, 177, 5, 8, 5, 2, 177, 7, 3, 2, 2, 2, 178, 180, 5, 10, 6, 2, 179, 178, 3, 2, 2, 2, 180, 181, 3, 2, 2, 2, 181, 179, 3, 2, 2, 2, 181, 182, 3, 2, 2, 2, 182, 9, 3, 2, 2, 2, 183, 187, 5, 44, 23, 2, 184, 187, 5, 12, 7, 2, 185, 187, 7, 34, 2, 2, 186, 183, 3, 2, 2, 2, 186, 184, 3, 2, 2, 2, 186, 185, 3, 2, 2, 2, 187, 11, 3, 2, 2, 2, 188, 189, 5, 14, 8, 2, 189, 190, 7, 34, 2, 2, 190, 195, 3, 2, 2, 2, 191, 195, 5, 26, 14, 2, 192, 195, 5, 32, 17, 2, 193, 195, 5, 42, 22, 2, 194, 188, 3, 2, 2, 2, 194, 191, 3, 2, 2, 2, 194, 192, 3, 2, 2, 2, 194, 193, 3, 2, 2, 2, 195, 13, 3, 2, 2, 2, 196, 197, 5, 16, 9, 2, 197, 198, 5, 18, 10, 2, 198, 15, 3, 2, 2, 2, 199, 200, 9, 2, 2, 2, 200, 17, 3, 2, 2, 2, 201, 202, 5, 22, 12, 2, 202, 203, 7, 36, 2, 2, 203, 206, 5, 156, 79, 2, 204, 205, 7, 55, 2, 2, 205, 207, 5, 20, 11, 2, 206, 204, 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 19, 3, 2, 2, 2, 208, 209, 5, 150, 76, 2, 209, 21, 3, 2, 2, 2, 210, 211, 5, 24, 13, 2, 211, 23, 3, 2, 2, 2, 212, 213, 7, 75, 2, 2, 213, 25, 3, 2, 2, 2, 214, 215, 7, 21, 2, 2, 215, 216, 5, 22, 12, 2, 216, 218, 7, 37, 2, 2, 217, 219, 5, 28, 15, 2, 218, 217, 3, 2, 2, 2, 218, 219, 3, 2, 2, 2, 219, 220, 3, 2, 2, 2, 220, 221, 7, 38, 2, 2, 221, 222, 7, 24, 2, 2, 222, 224, 5, 156, 79, 2, 223, 225, 5, 46, 24, 2, 224, 223, 3, 2, 2, 2, 224, 225, 3, 2, 2, 2, 225, 27, 3, 2, 2, 2, 226, 231, 5, 30, 16, 2, 227, 228, 7, 33, 2, 2, 228, 230, 5, 30, 16, 2, 229, 227, 3, 2, 2, 2, 230, 233, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 29, 3, 2, 2, 2, 233, 231, 3, 2, 2, 2, 234, 235, 5, 22, 12, 2, 235, 236, 7, 36, 2, 2, 236, 237, 5, 156, 79, 2, 237, 31, 3, 2, 2, 2, 238, 239, 7, 26, 2, 2, 239, 240, 7, 75, 2, 2, 240, 242, 7, 42, 2, 2, 241, 243, 5, 34, 18, 2, 242, 241, 3, 2, 2, 2, 242, 243, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 245, 7, 43, 2, 2, 245, 33, 3, 2, 2, 2, 246, 248, 5, 36, 19, 2, 247, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 247, 3, 2, 2, 2, 249, 250, 3, 2, 2, 2, 250, 35, 3, 2, 2, 2, 251, 254, 5, 38, 20, 2, 252, 254, 5, 40, 21, 2, 253, 251, 3, 2, 2, 2, 253, 252, 3, 2, 2, 2, 254, 37, 3, 2, 2, 2, 255, 256, 7, 75, 2, 2, 256, 257, 7, 36, 2, 2, 257, 258, 5, 156, 79, 2, 258, 259, 7, 34, 2, 2, 259, 39, 3, 2, 2, 2, 260, 261, 7, 75, 2, 2, 261, 263, 7, 37, 2, 2, 262, 264, 5, 28, 15, 2, 263, 262, 3, 2, 2, 2, 263, 264, 3, 2, 2, 2, 264, 265, 3, 2, 2, 2, 265, 266, 7, 38, 2, 2, 266, 267, 7, 24, 2, 2, 267, 268, 5, 156, 79, 2, 268, 269, 7, 34, 2, 2, 269, 41, 3, 2, 2, 2, 270, 271, 7, 25, 2, 2, 271, 272, 7, 75, 2, 2, 272, 273, 7, 42, 2, 2, 273, 274, 7, 43, 2, 2, 274, 43, 3, 2, 2, 2, 275, 282, 5, 48, 25, 2, 276, 282, 5, 50, 26, 2, 277, 282, 5, 58, 30, 2, 278, 282, 5, 66, 34, 2, 279, 282, 5, 68, 35, 2, 280, 282, 5, 46, 24, 2, 281, 275, 3, 2, 2, 2, 281, 276, 3, 2, 2, 2, 281, 277, 3, 2, 2, 2, 281, 278, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 281, 280, 3, 2, 2, 2, 282, 45, 3, 2, 2, 2, 283, 284, 6, 24, 2, 2, 284, 286, 7, 42, 2, 2, 285, 287, 5, 8, 5, 2, 286, 285, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 288, 3, 2, 2, 2, 288, 289, 7, 43, 2, 2, 289, 47, 3, 2, 2, 2, 290, 291, 8, 25, 1, 2, 291, 292, 5, 154, 78, 2, 292, 293, 7, 34, 2, 2, 293, 294, 8, 25, 1, 2, 294, 49, 3, 2, 2, 2, 295, 298, 5, 52, 27, 2, 296, 298, 5, 54, 28, 2, 297, 295, 3, 2, 2, 2, 297, 296, 3, 2, 2, 2, 298, 51, 3, 2, 2, 2, 299, 300, 7, 17, 2, 2, 300, 301, 7, 37, 2, 2, 301, 302, 5, 154, 78, 2, 302, 303, 7, 38, 2, 2, 303, 306, 5, 44, 23, 2, 304, 305, 7, 18, 2, 2, 305, 307, 5, 44, 23, 2, 306, 304, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 53, 3, 2, 2, 2, 308, 309, 7, 10, 2, 2, 309, 310, 7, 37, 2, 2, 310, 311, 5, 154, 78, 2, 311, 312, 7, 38, 2, 2, 312, 316, 7, 42, 2, 2, 313, 315, 5, 56, 29, 2, 314, 313, 3, 2, 2, 2, 315, 318, 3, 2, 2, 2, 316, 314, 3, 2, 2, 2, 316, 317, 3, 2, 2, 2, 317, 319, 3, 2, 2, 2, 318, 316, 3, 2, 2, 2, 319, 320, 7, 43, 2, 2, 320, 55, 3, 2, 2, 2, 321, 322, 7, 11, 2, 2, 322, 323, 5, 154, 78, 2, 323, 324, 7, 36, 2, 2, 324, 325, 5, 44, 23, 2, 325, 330, 3, 2, 2, 2, 326, 327, 7, 12, 2, 2, 327, 328, 7, 36, 2, 2, 328, 330, 5, 44, 23, 2, 329, 321, 3, 2, 2, 2, 329, 326, 3, 2, 2, 2, 330, 57, 3, 2, 2, 2, 331, 335, 5, 60, 31, 2, 332, 335, 5, 62, 32, 2, 333, 335, 5, 64, 33, 2, 334, 331, 3, 2, 2, 2, 334, 332, 3, 2, 2, 2, 334, 333, 3, 2, 2, 2, 335, 59, 3, 2, 2, 2, 336, 337, 7, 19, 2, 2, 337, 344, 7, 37, 2, 2, 338, 341, 5, 14, 8, 2, 339, 341, 5, 154, 78, 2, 340, 338, 3, 2, 2, 2, 340, 339, 3, 2, 2, 2, 341, 342, 3, 2, 2, 2, 342, 343, 8, 31, 1, 2, 343, 345, 3, 2, 2, 2, 344, 340, 3, 2, 2, 2, 344, 345, 3, 2, 2, 2, 345, 346, 3, 2, 2, 2, 346, 350, 7, 34, 2, 2, 347, 348, 5, 154, 78, 2, 348, 349, 8, 31, 1, 2, 349, 351, 3, 2, 2, 2, 350, 347, 3, 2, 2, 2, 350, 351, 3, 2, 2, 2, 351, 352, 3, 2, 2, 2, 352, 356, 7, 34, 2, 2, 353, 354, 5, 154, 78, 2, 354, 355, 8, 31, 1, 2, 355, 357, 3, 2, 2, 2, 356, 353, 3, 2, 2, 2, 356, 357, 3, 2, 2, 2, 357, 358, 3, 2, 2, 2, 358, 359, 7, 38, 2, 2, 359, 360, 5, 44, 23, 2, 360, 61, 3, 2, 2, 2, 361, 362, 7, 16, 2, 2, 362, 363, 7, 37, 2, 2, 363, 364, 5, 154, 78, 2, 364, 365, 7, 38, 2, 2, 365, 366, 5, 44, 23, 2, 366, 63, 3, 2, 2, 2, 367, 368, 7, 15, 2, 2, 368, 369, 5, 44, 23, 2, 369, 370, 7, 16, 2, 2, 370, 371, 7, 37, 2, 2, 371, 372, 5, 154, 78, 2, 372, 373, 7, 38, 2, 2, 373, 374, 7, 34, 2, 2, 374, 65, 3, 2, 2, 2, 375, 376, 9, 3, 2, 2, 376, 377, 7, 34, 2, 2, 377, 67, 3, 2, 2, 2, 378, 380, 7, 22, 2, 2, 379, 381, 5, 154, 78, 2, 380, 379, 3, 2, 2, 2, 380, 381, 3, 2, 2, 2, 381, 382, 3, 2, 2, 2, 382, 383, 7, 34, 2, 2, 383, 69, 3, 2, 2, 2, 384, 394, 5, 72, 37, 2, 385, 394, 5, 92, 47, 2, 386, 394, 5, 94, 48, 2, 387, 394, 5, 74, 38, 2, 388, 394, 5, 76, 39, 2, 389, 394, 5, 82, 42, 2, 390, 394, 5, 84, 43, 2, 391, 394, 5, 90, 46, 2, 392, 394, 5, 98, 50, 2, 393, 384, 3, 2, 2, 2, 393, 385, 3, 2, 2, 2, 393, 386, 3, 2, 2, 2, 393, 387, 3, 2, 2, 2, 393, 388, 3, 2, 2, 2, 393, 389, 3, 2, 2, 2, 393, 390, 3, 2, 2, 2, 393, 391, 3, 2, 2, 2, 393, 392, 3, 2, 2, 2, 394, 71, 3, 2, 2, 2, 395, 396, 7, 37, 2, 2, 396, 397, 5, 154, 78, 2, 397, 398, 7, 38, 2, 2, 398, 73, 3, 2, 2, 2, 399, 400, 9, 4, 2, 2, 400, 75, 3, 2, 2, 2, 401, 402, 5, 78, 40, 2, 402, 77, 3, 2, 2, 2, 403, 404, 7, 75, 2, 2, 404, 79, 3, 2, 2, 2, 405, 408, 5, 78, 40, 2, 406, 408, 5, 82, 42, 2, 407, 405, 3, 2, 2, 2, 407, 406, 3, 2, 2, 2, 408, 81, 3, 2, 2, 2, 409, 410, 9, 5, 2, 2, 410, 83, 3, 2, 2, 2, 411, 415, 7, 82, 2, 2, 412, 414, 5, 86, 44, 2, 413, 412, 3, 2, 2, 2, 414, 417, 3, 2, 2, 2, 415, 413, 3, 2, 2, 2, 415, 416, 3, 2, 2, 2, 416, 418, 3, 2, 2, 2, 417, 415, 3, 2, 2, 2, 418, 428, 7, 84, 2, 2, 419, 423, 7, 83, 2, 2, 420, 422, 5, 88, 45, 2, 421, 420, 3, 2, 2, 2, 422, 425, 3, 2, 2, 2, 423, 421, 3, 2, 2, 2, 423, 424, 3, 2, 2, 2, 424, 426, 3, 2, 2, 2, 425, 423, 3, 2, 2, 2, 426, 428, 7, 86, 2, 2, 427, 411, 3, 2, 2, 2, 427, 419, 3, 2, 2, 2, 428, 85, 3, 2, 2, 2, 429, 436, 7, 85, 2, 2, 430, 432, 7, 3, 2, 2, 431, 433, 5, 154, 78, 2, 432, 431, 3, 2, 2, 2, 432, 433, 3, 2, 2, 2, 433, 434, 3, 2, 2, 2, 434, 436, 7, 41, 2, 2, 435, 429, 3, 2, 2, 2, 435, 430, 3, 2, 2, 2, 436, 87, 3, 2, 2, 2, 437, 444, 7, 87, 2, 2, 438, 440, 7, 3, 2, 2, 439, 441, 5, 154, 78, 2, 440, 439, 3, 2, 2, 2, 440, 441, 3, 2, 2, 2, 441, 442, 3, 2, 2, 2, 442, 444, 7, 41, 2, 2, 443, 437, 3, 2, 2, 2, 443, 438, 3, 2, 2, 2, 444, 89, 3, 2, 2, 2, 445, 446, 9, 6, 2, 2, 446, 91, 3, 2, 2, 2, 447, 456, 7, 39, 2, 2, 448, 453, 5, 154, 78, 2, 449, 450, 7, 33, 2, 2, 450, 452, 5, 154, 78, 2, 451, 449, 3, 2, 2, 2, 452, 455, 3, 2, 2, 2, 453, 451, 3, 2, 2, 2, 453, 454, 3, 2, 2, 2, 454, 457, 3, 2, 2, 2, 455, 453, 3, 2, 2, 2, 456, 448, 3, 2, 2, 2, 456, 457, 3, 2, 2, 2, 457, 459, 3, 2, 2, 2, 458, 460, 7, 33, 2, 2, 459, 458, 3, 2, 2, 2, 459, 460, 3, 2, 2, 2, 460, 461, 3, 2, 2, 2, 461, 462, 7, 40, 2, 2, 462, 93, 3, 2, 2, 2, 463, 472, 7, 42, 2, 2, 464, 469, 5, 96, 49, 2, 465, 466, 7, 33, 2, 2, 466, 468, 5, 96, 49, 2, 467, 465, 3, 2, 2, 2, 468, 471, 3, 2, 2, 2, 469, 467, 3, 2, 2, 2, 469, 470, 3, 2, 2, 2, 470, 473, 3, 2, 2, 2, 471, 469, 3, 2, 2, 2, 472, 464, 3, 2, 2, 2, 472, 473, 3, 2, 2, 2, 473, 475, 3, 2, 2, 2, 474, 476, 7, 33, 2, 2, 475, 474, 3, 2, 2, 2, 475, 476, 3, 2, 2, 2, 476, 477, 3, 2, 2, 2, 477, 478, 7, 43, 2, 2, 478, 95, 3, 2, 2, 2, 479, 480, 5, 80, 41, 2, 480, 481, 7, 36, 2, 2, 481, 482, 5, 154, 78, 2, 482, 97, 3, 2, 2, 2, 483, 484, 9, 7, 2, 2, 484, 99, 3, 2, 2, 2, 485, 486, 8, 51, 1, 2, 486, 497, 5, 70, 36, 2, 487, 488, 7, 23, 2, 2, 488, 489, 5, 100, 51, 2, 489, 491, 7, 37, 2, 2, 490, 492, 5, 102, 52, 2, 491, 490, 3, 2, 2, 2, 491, 492, 3, 2, 2, 2, 492, 493, 3, 2, 2, 2, 493, 494, 7, 38, 2, 2, 494, 495, 8, 51, 1, 2, 495, 497, 3, 2, 2, 2, 496, 485, 3, 2, 2, 2, 496, 487, 3, 2, 2, 2, 497, 519, 3, 2, 2, 2, 498, 499, 12, 7, 2, 2, 499, 501, 7, 37, 2, 2, 500, 502, 5, 102, 52, 2, 501, 500, 3, 2, 2, 2, 501, 502, 3, 2, 2, 2, 502, 503, 3, 2, 2, 2, 503, 504, 7, 38, 2, 2, 504, 518, 8, 51, 1, 2, 505, 506, 12, 5, 2, 2, 506, 507, 5, 104, 53, 2, 507, 508, 8, 51, 1, 2, 508, 518, 3, 2, 2, 2, 509, 510, 12, 4, 2, 2, 510, 511, 5, 106, 54, 2, 511, 512, 8, 51, 1, 2, 512, 518, 3, 2, 2, 2, 513, 514, 12, 3, 2, 2, 514, 515, 5, 108, 55, 2, 515, 516, 8, 51, 1, 2, 516, 518, 3, 2, 2, 2, 517, 498, 3, 2, 2, 2, 517, 505, 3, 2, 2, 2, 517, 509, 3, 2, 2, 2, 517, 513, 3, 2, 2, 2, 518, 521, 3, 2, 2, 2, 519, 517, 3, 2, 2, 2, 519, 520, 3, 2, 2, 2, 520, 101, 3, 2, 2, 2, 521, 519, 3, 2, 2, 2, 522, 527, 5, 150, 76, 2, 523, 524, 7, 33, 2, 2, 524, 526, 5, 150, 76, 2, 525, 523, 3, 2, 2, 2, 526, 529, 3, 2, 2, 2, 527, 525, 3, 2, 2, 2, 527, 528, 3, 2, 2, 2, 528, 103, 3, 2, 2, 2, 529, 527, 3, 2, 2, 2, 530, 531, 7, 74, 2, 2, 531, 532, 5, 78, 40, 2, 532, 105, 3, 2, 2, 2, 533, 534, 7, 39, 2, 2, 534, 535, 5, 154, 78, 2, 535, 536, 7, 40, 2, 2, 536, 107, 3, 2, 2, 2, 537, 541, 7, 39, 2, 2, 538, 539, 5, 154, 78, 2, 539, 540, 8, 55, 1, 2, 540, 542, 3, 2, 2, 2, 541, 538, 3, 2, 2, 2, 541, 542, 3, 2, 2, 2, 542, 543, 3, 2, 2, 2, 543, 547, 7, 36, 2, 2, 544, 545, 5, 154, 78, 2, 545, 546, 8, 55, 1, 2, 546, 548, 3, 2, 2, 2, 547, 544, 3, 2, 2, 2, 547, 548, 3, 2, 2, 2, 548, 549, 3, 2, 2, 2, 549, 550, 7, 40, 2, 2, 550, 109, 3, 2, 2, 2, 551, 554, 5, 100, 51, 2, 552, 554, 5, 112, 57, 2, 553, 551, 3, 2, 2, 2, 553, 552, 3, 2, 2, 2, 554, 111, 3, 2, 2, 2, 555, 556, 5, 100, 51, 2, 556, 557, 5, 120, 61, 2, 557, 113, 3, 2, 2, 2, 558, 562, 5, 110, 56, 2, 559, 562, 5, 116, 59, 2, 560, 562, 5, 118, 60, 2, 561, 558, 3, 2, 2, 2, 561, 559, 3, 2, 2, 2, 561, 560, 3, 2, 2, 2, 562, 115, 3, 2, 2, 2, 563, 564, 5, 120, 61, 2, 564, 565, 5, 110, 56, 2, 565, 117, 3, 2, 2, 2, 566, 567, 5, 122, 62, 2, 567, 568, 5, 110, 56, 2, 568, 119, 3, 2, 2, 2, 569, 570, 9, 8, 2, 2, 570, 121, 3, 2, 2, 2, 571, 572, 9, 9, 2, 2, 572, 123, 3, 2, 2, 2, 573, 579, 5, 114, 58, 2, 574, 575, 5, 114, 58, 2, 575, 576, 7, 8, 2, 2, 576, 577, 5, 156, 79, 2, 577, 579, 3, 2, 2, 2, 578, 573, 3, 2, 2, 2, 578, 574, 3, 2, 2, 2, 579, 125, 3, 2, 2, 2, 580, 581, 8, 64, 1, 2, 581, 582, 5, 124, 63, 2, 582, 588, 3, 2, 2, 2, 583, 584, 12, 3, 2, 2, 584, 585, 9, 10, 2, 2, 585, 587, 5, 124, 63, 2, 586, 583, 3, 2, 2, 2, 587, 590, 3, 2, 2, 2, 588, 586, 3, 2, 2, 2, 588, 589, 3, 2, 2, 2, 589, 127, 3, 2, 2, 2, 590, 588, 3, 2, 2, 2, 591, 592, 8, 65, 1, 2, 592, 593, 5, 126, 64, 2, 593, 599, 3, 2, 2, 2, 594, 595, 12, 3, 2, 2, 595, 596, 9, 11, 2, 2, 596, 598, 5, 126, 64, 2, 597, 594, 3, 2, 2, 2, 598, 601, 3, 2, 2, 2, 599, 597, 3, 2, 2, 2, 599, 600, 3, 2, 2, 2, 600, 129, 3, 2, 2, 2, 601, 599, 3, 2, 2, 2, 602, 603, 8, 66, 1, 2, 603, 604, 5, 128, 65, 2, 604, 611, 3, 2, 2, 2, 605, 606, 12, 3, 2, 2, 606, 607, 5, 132, 67, 2, 607, 608, 5, 138, 70, 2, 608, 610, 3, 2, 2, 2, 609, 605, 3, 2, 2, 2, 610, 613, 3, 2, 2, 2, 611, 609, 3, 2, 2, 2, 611, 612, 3, 2, 2, 2, 612, 131, 3, 2, 2, 2, 613, 611, 3, 2, 2, 2, 614, 615, 9, 12, 2, 2, 615, 133, 3, 2, 2, 2, 616, 617, 8, 68, 1, 2, 617, 618, 5, 130, 66, 2, 618, 624, 3, 2, 2, 2, 619, 620, 12, 3, 2, 2, 620, 621, 9, 13, 2, 2, 621, 623, 5, 130, 66, 2, 622, 619, 3, 2, 2, 2, 623, 626, 3, 2, 2, 2, 624, 622, 3, 2, 2, 2, 624, 625, 3, 2, 2, 2, 625, 135, 3, 2, 2, 2, 626, 624, 3, 2, 2, 2, 627, 628, 8, 69, 1, 2, 628, 629, 5, 134, 68, 2, 629, 635, 3, 2, 2, 2, 630, 631, 12, 3, 2, 2, 631, 632, 9, 14, 2, 2, 632, 634, 5, 134, 68, 2, 633, 630, 3, 2, 2, 2, 634, 637, 3, 2, 2, 2, 635, 633, 3, 2, 2, 2, 635, 636, 3, 2, 2, 2, 636, 137, 3, 2, 2, 2, 637, 635, 3, 2, 2, 2, 638, 639, 8, 70, 1, 2, 639, 640, 5, 136, 69, 2, 640, 646, 3, 2, 2, 2, 641, 642, 12, 3, 2, 2, 642, 643, 7, 67, 2, 2, 643, 645, 5, 136, 69, 2, 644, 641, 3, 2, 2, 2, 645, 648, 3, 2, 2, 2, 646, 644, 3, 2, 2, 2, 646, 647, 3, 2, 2, 2, 647, 139, 3, 2, 2, 2, 648, 646, 3, 2, 2, 2, 649, 650, 8, 71, 1, 2, 650, 651, 5, 138, 70, 2, 651, 657, 3, 2, 2, 2, 652, 653, 12, 3, 2, 2, 653, 654, 7, 69, 2, 2, 654, 656, 5, 138, 70, 2, 655, 652, 3, 2, 2, 2, 656, 659, 3, 2, 2, 2, 657, 655, 3, 2, 2, 2, 657, 658, 3, 2, 2, 2, 658, 141, 3, 2, 2, 2, 659, 657, 3, 2, 2, 2, 660, 661, 8, 72, 1, 2, 661, 662, 5, 140, 71, 2, 662, 668, 3, 2, 2, 2, 663, 664, 12, 3, 2, 2, 664, 665, 7, 68, 2, 2, 665, 667, 5, 140, 71, 2, 666, 663, 3, 2, 2, 2, 667, 670, 3, 2, 2, 2, 668, 666, 3, 2, 2, 2, 668, 669, 3, 2, 2, 2, 669, 143, 3, 2, 2, 2, 670, 668, 3, 2, 2, 2, 671, 672, 8, 73, 1, 2, 672, 673, 5, 142, 72, 2, 673, 679, 3, 2, 2, 2, 674, 675, 12, 3, 2, 2, 675, 676, 7, 52, 2, 2, 676, 678, 5, 142, 72, 2, 677, 674, 3, 2, 2, 2, 678, 681, 3, 2, 2, 2, 679, 677, 3, 2, 2, 2, 679, 680, 3, 2, 2, 2, 680, 145, 3, 2, 2, 2, 681, 679, 3, 2, 2, 2, 682, 683, 8, 74, 1, 2, 683, 684, 5, 144, 73, 2, 684, 690, 3, 2, 2, 2, 685, 686, 12, 3, 2, 2, 686, 687, 7, 53, 2, 2, 687, 689, 5, 144, 73, 2, 688, 685, 3, 2, 2, 2, 689, 692, 3, 2, 2, 2, 690, 688, 3, 2, 2, 2, 690, 691, 3, 2, 2, 2, 691, 147, 3, 2, 2, 2, 692, 690, 3, 2, 2, 2, 693, 701, 5, 146, 74, 2, 694, 695, 5, 146, 74, 2, 695, 696, 7, 35, 2, 2, 696, 697, 5, 148, 75, 2, 697, 698, 7, 36, 2, 2, 698, 699, 5, 148, 75, 2, 699, 701, 3, 2, 2, 2, 700, 693, 3, 2, 2, 2, 700, 694, 3, 2, 2, 2, 701, 149, 3, 2, 2, 2, 702, 708, 5, 148, 75, 2, 703, 704, 5, 100, 51, 2, 704, 705, 5, 152, 77, 2, 705, 706, 5, 150, 76, 2, 706, 708, 3, 2, 2, 2, 707, 702, 3, 2, 2, 2, 707, 703, 3, 2, 2, 2, 708, 151, 3, 2, 2, 2, 709, 710, 9, 15, 2, 2, 710, 153, 3, 2, 2, 2, 711, 716, 5, 150, 76, 2, 712, 713, 7, 33, 2, 2, 713, 715, 5, 150, 76, 2, 714, 712, 3, 2, 2, 2, 715, 718, 3, 2, 2, 2, 716, 714, 3, 2, 2, 2, 716, 717, 3, 2, 2, 2, 717, 155, 3, 2, 2, 2, 718, 716, 3, 2, 2, 2, 719, 723, 5, 158, 80, 2, 720, 723, 5, 160, 81, 2, 721, 723, 5, 162, 82, 2, 722, 719, 3, 2, 2, 2, 722, 720, 3, 2, 2, 2, 722, 721, 3, 2, 2, 2, 723, 157, 3, 2, 2, 2, 724, 725, 5, 164, 83, 2, 725, 159, 3, 2, 2, 2, 726, 727, 5, 164, 83, 2, 727, 728, 7, 63, 2, 2, 728, 729, 5, 164, 83, 2, 729, 730, 7, 65, 2, 2, 730, 161, 3, 2, 2, 2, 731, 732, 7, 29, 2, 2, 732, 733, 7, 37, 2, 2, 733, 734, 5, 164, 83, 2, 734, 735, 7, 38, 2, 2, 735, 163, 3, 2, 2, 2, 736, 737, 9, 16, 2, 2, 737, 165, 3, 2, 2, 2, 67, 167, 174, 181, 186, 194, 206, 218, 224, 231, 242, 249, 253, 263, 281, 286, 297, 306, 316, 329, 334, 340, 344, 350, 356, 380, 393, 407, 415, 423, 427, 432, 435, 440, 443, 453, 456, 459, 469, 472, 475, 491, 496, 501, 517, 519, 527, 541, 547, 553, 561, 578, 588, 599, 611, 624, 635, 646, 657, 668, 679, 690, 700, 707, 716, 722] \ No newline at end of file diff --git a/kipper/core/src/compiler/parser/antlr/KipperParser.ts b/kipper/core/src/compiler/parser/antlr/KipperParser.ts index 45aabc2aa..00ef4bc32 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParser.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperParser.ts @@ -1,16 +1,23 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT -// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax -// kind values. -import { ASTKind, KipperParserRuleContext, ParseRuleKindMapping } from ".."; -import KipperParserBase from "./base/KipperParserBase"; + + // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax + // kind values. + import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; + import KipperParserBase from "./base/KipperParserBase"; + import { ATN } from "antlr4ts/atn/ATN"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; import { FailedPredicateException } from "antlr4ts/FailedPredicateException"; +import { NotNull } from "antlr4ts/Decorators"; import { NoViableAltException } from "antlr4ts/NoViableAltException"; +import { Override } from "antlr4ts/Decorators"; +import { Parser } from "antlr4ts/Parser"; import { ParserRuleContext } from "antlr4ts/ParserRuleContext"; import { ParserATNSimulator } from "antlr4ts/atn/ParserATNSimulator"; +import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; +import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; import { RecognitionException } from "antlr4ts/RecognitionException"; import { RuleContext } from "antlr4ts/RuleContext"; //import { RuleVersion } from "antlr4ts/RuleVersion"; @@ -25,6 +32,7 @@ import * as Utils from "antlr4ts/misc/Utils"; import { KipperParserListener } from "./KipperParserListener"; import { KipperParserVisitor } from "./KipperParserVisitor"; + export class KipperParser extends KipperParserBase { public static readonly FStringExpStart = 1; public static readonly BlockComment = 2; @@ -127,318 +135,130 @@ export class KipperParser extends KipperParserBase { public static readonly RULE_parameterList = 13; public static readonly RULE_parameterDeclaration = 14; public static readonly RULE_interfaceDeclaration = 15; - public static readonly RULE_classDeclaration = 16; - public static readonly RULE_statement = 17; - public static readonly RULE_compoundStatement = 18; - public static readonly RULE_expressionStatement = 19; - public static readonly RULE_selectionStatement = 20; - public static readonly RULE_ifStatement = 21; - public static readonly RULE_switchStatement = 22; - public static readonly RULE_switchLabeledStatement = 23; - public static readonly RULE_iterationStatement = 24; - public static readonly RULE_forLoopIterationStatement = 25; - public static readonly RULE_whileLoopIterationStatement = 26; - public static readonly RULE_doWhileLoopIterationStatement = 27; - public static readonly RULE_jumpStatement = 28; - public static readonly RULE_returnStatement = 29; - public static readonly RULE_primaryExpression = 30; - public static readonly RULE_tangledPrimaryExpression = 31; - public static readonly RULE_boolPrimaryExpression = 32; - public static readonly RULE_identifierPrimaryExpression = 33; - public static readonly RULE_identifier = 34; - public static readonly RULE_identifierOrStringPrimaryExpression = 35; - public static readonly RULE_stringPrimaryExpression = 36; - public static readonly RULE_fStringPrimaryExpression = 37; - public static readonly RULE_fStringSingleQuoteAtom = 38; - public static readonly RULE_fStringDoubleQuoteAtom = 39; - public static readonly RULE_numberPrimaryExpression = 40; - public static readonly RULE_arrayPrimaryExpression = 41; - public static readonly RULE_objectPrimaryExpression = 42; - public static readonly RULE_objectProperty = 43; - public static readonly RULE_voidOrNullOrUndefinedPrimaryExpression = 44; - public static readonly RULE_computedPrimaryExpression = 45; - public static readonly RULE_argumentExpressionList = 46; - public static readonly RULE_dotNotation = 47; - public static readonly RULE_bracketNotation = 48; - public static readonly RULE_sliceNotation = 49; - public static readonly RULE_postfixExpression = 50; - public static readonly RULE_incrementOrDecrementPostfixExpression = 51; - public static readonly RULE_unaryExpression = 52; - public static readonly RULE_incrementOrDecrementUnaryExpression = 53; - public static readonly RULE_operatorModifiedUnaryExpression = 54; - public static readonly RULE_incrementOrDecrementOperator = 55; - public static readonly RULE_unaryOperator = 56; - public static readonly RULE_castOrConvertExpression = 57; - public static readonly RULE_multiplicativeExpression = 58; - public static readonly RULE_additiveExpression = 59; - public static readonly RULE_bitwiseShiftExpression = 60; - public static readonly RULE_bitwiseShiftOperators = 61; - public static readonly RULE_relationalExpression = 62; - public static readonly RULE_equalityExpression = 63; - public static readonly RULE_bitwiseAndExpression = 64; - public static readonly RULE_bitwiseXorExpression = 65; - public static readonly RULE_bitwiseOrExpression = 66; - public static readonly RULE_logicalAndExpression = 67; - public static readonly RULE_logicalOrExpression = 68; - public static readonly RULE_conditionalExpression = 69; - public static readonly RULE_assignmentExpression = 70; - public static readonly RULE_assignmentOperator = 71; - public static readonly RULE_expression = 72; - public static readonly RULE_typeSpecifierExpression = 73; - public static readonly RULE_identifierTypeSpecifierExpression = 74; - public static readonly RULE_genericTypeSpecifierExpression = 75; - public static readonly RULE_typeofTypeSpecifierExpression = 76; - public static readonly RULE_typeSpecifierIdentifier = 77; + public static readonly RULE_interfaceMemberList = 16; + public static readonly RULE_interfaceMemberDeclaration = 17; + public static readonly RULE_propertySignature = 18; + public static readonly RULE_methodSignature = 19; + public static readonly RULE_classDeclaration = 20; + public static readonly RULE_statement = 21; + public static readonly RULE_compoundStatement = 22; + public static readonly RULE_expressionStatement = 23; + public static readonly RULE_selectionStatement = 24; + public static readonly RULE_ifStatement = 25; + public static readonly RULE_switchStatement = 26; + public static readonly RULE_switchLabeledStatement = 27; + public static readonly RULE_iterationStatement = 28; + public static readonly RULE_forLoopIterationStatement = 29; + public static readonly RULE_whileLoopIterationStatement = 30; + public static readonly RULE_doWhileLoopIterationStatement = 31; + public static readonly RULE_jumpStatement = 32; + public static readonly RULE_returnStatement = 33; + public static readonly RULE_primaryExpression = 34; + public static readonly RULE_tangledPrimaryExpression = 35; + public static readonly RULE_boolPrimaryExpression = 36; + public static readonly RULE_identifierPrimaryExpression = 37; + public static readonly RULE_identifier = 38; + public static readonly RULE_identifierOrStringPrimaryExpression = 39; + public static readonly RULE_stringPrimaryExpression = 40; + public static readonly RULE_fStringPrimaryExpression = 41; + public static readonly RULE_fStringSingleQuoteAtom = 42; + public static readonly RULE_fStringDoubleQuoteAtom = 43; + public static readonly RULE_numberPrimaryExpression = 44; + public static readonly RULE_arrayPrimaryExpression = 45; + public static readonly RULE_objectPrimaryExpression = 46; + public static readonly RULE_objectProperty = 47; + public static readonly RULE_voidOrNullOrUndefinedPrimaryExpression = 48; + public static readonly RULE_computedPrimaryExpression = 49; + public static readonly RULE_argumentExpressionList = 50; + public static readonly RULE_dotNotation = 51; + public static readonly RULE_bracketNotation = 52; + public static readonly RULE_sliceNotation = 53; + public static readonly RULE_postfixExpression = 54; + public static readonly RULE_incrementOrDecrementPostfixExpression = 55; + public static readonly RULE_unaryExpression = 56; + public static readonly RULE_incrementOrDecrementUnaryExpression = 57; + public static readonly RULE_operatorModifiedUnaryExpression = 58; + public static readonly RULE_incrementOrDecrementOperator = 59; + public static readonly RULE_unaryOperator = 60; + public static readonly RULE_castOrConvertExpression = 61; + public static readonly RULE_multiplicativeExpression = 62; + public static readonly RULE_additiveExpression = 63; + public static readonly RULE_bitwiseShiftExpression = 64; + public static readonly RULE_bitwiseShiftOperators = 65; + public static readonly RULE_relationalExpression = 66; + public static readonly RULE_equalityExpression = 67; + public static readonly RULE_bitwiseAndExpression = 68; + public static readonly RULE_bitwiseXorExpression = 69; + public static readonly RULE_bitwiseOrExpression = 70; + public static readonly RULE_logicalAndExpression = 71; + public static readonly RULE_logicalOrExpression = 72; + public static readonly RULE_conditionalExpression = 73; + public static readonly RULE_assignmentExpression = 74; + public static readonly RULE_assignmentOperator = 75; + public static readonly RULE_expression = 76; + public static readonly RULE_typeSpecifierExpression = 77; + public static readonly RULE_identifierTypeSpecifierExpression = 78; + public static readonly RULE_genericTypeSpecifierExpression = 79; + public static readonly RULE_typeofTypeSpecifierExpression = 80; + public static readonly RULE_typeSpecifierIdentifier = 81; // tslint:disable:no-trailing-whitespace public static readonly ruleNames: string[] = [ - "compilationUnit", - "translationUnit", - "externalItem", - "blockItemList", - "blockItem", - "declaration", - "variableDeclaration", - "storageTypeSpecifier", - "initDeclarator", - "initializer", - "declarator", - "directDeclarator", - "functionDeclaration", - "parameterList", - "parameterDeclaration", - "interfaceDeclaration", - "classDeclaration", - "statement", - "compoundStatement", - "expressionStatement", - "selectionStatement", - "ifStatement", - "switchStatement", - "switchLabeledStatement", - "iterationStatement", - "forLoopIterationStatement", - "whileLoopIterationStatement", - "doWhileLoopIterationStatement", - "jumpStatement", - "returnStatement", - "primaryExpression", - "tangledPrimaryExpression", - "boolPrimaryExpression", - "identifierPrimaryExpression", - "identifier", - "identifierOrStringPrimaryExpression", - "stringPrimaryExpression", - "fStringPrimaryExpression", - "fStringSingleQuoteAtom", - "fStringDoubleQuoteAtom", - "numberPrimaryExpression", - "arrayPrimaryExpression", - "objectPrimaryExpression", - "objectProperty", - "voidOrNullOrUndefinedPrimaryExpression", - "computedPrimaryExpression", - "argumentExpressionList", - "dotNotation", - "bracketNotation", - "sliceNotation", - "postfixExpression", - "incrementOrDecrementPostfixExpression", - "unaryExpression", - "incrementOrDecrementUnaryExpression", - "operatorModifiedUnaryExpression", - "incrementOrDecrementOperator", - "unaryOperator", - "castOrConvertExpression", - "multiplicativeExpression", - "additiveExpression", - "bitwiseShiftExpression", - "bitwiseShiftOperators", - "relationalExpression", - "equalityExpression", - "bitwiseAndExpression", - "bitwiseXorExpression", - "bitwiseOrExpression", - "logicalAndExpression", - "logicalOrExpression", - "conditionalExpression", - "assignmentExpression", - "assignmentOperator", - "expression", - "typeSpecifierExpression", - "identifierTypeSpecifierExpression", - "genericTypeSpecifierExpression", - "typeofTypeSpecifierExpression", - "typeSpecifierIdentifier", + "compilationUnit", "translationUnit", "externalItem", "blockItemList", + "blockItem", "declaration", "variableDeclaration", "storageTypeSpecifier", + "initDeclarator", "initializer", "declarator", "directDeclarator", "functionDeclaration", + "parameterList", "parameterDeclaration", "interfaceDeclaration", "interfaceMemberList", + "interfaceMemberDeclaration", "propertySignature", "methodSignature", + "classDeclaration", "statement", "compoundStatement", "expressionStatement", + "selectionStatement", "ifStatement", "switchStatement", "switchLabeledStatement", + "iterationStatement", "forLoopIterationStatement", "whileLoopIterationStatement", + "doWhileLoopIterationStatement", "jumpStatement", "returnStatement", "primaryExpression", + "tangledPrimaryExpression", "boolPrimaryExpression", "identifierPrimaryExpression", + "identifier", "identifierOrStringPrimaryExpression", "stringPrimaryExpression", + "fStringPrimaryExpression", "fStringSingleQuoteAtom", "fStringDoubleQuoteAtom", + "numberPrimaryExpression", "arrayPrimaryExpression", "objectPrimaryExpression", + "objectProperty", "voidOrNullOrUndefinedPrimaryExpression", "computedPrimaryExpression", + "argumentExpressionList", "dotNotation", "bracketNotation", "sliceNotation", + "postfixExpression", "incrementOrDecrementPostfixExpression", "unaryExpression", + "incrementOrDecrementUnaryExpression", "operatorModifiedUnaryExpression", + "incrementOrDecrementOperator", "unaryOperator", "castOrConvertExpression", + "multiplicativeExpression", "additiveExpression", "bitwiseShiftExpression", + "bitwiseShiftOperators", "relationalExpression", "equalityExpression", + "bitwiseAndExpression", "bitwiseXorExpression", "bitwiseOrExpression", + "logicalAndExpression", "logicalOrExpression", "conditionalExpression", + "assignmentExpression", "assignmentOperator", "expression", "typeSpecifierExpression", + "identifierTypeSpecifierExpression", "genericTypeSpecifierExpression", + "typeofTypeSpecifierExpression", "typeSpecifierIdentifier", ]; private static readonly _LITERAL_NAMES: Array = [ - undefined, - undefined, - undefined, - undefined, - "'const'", - "'var'", - "'as'", - "'...'", - "'switch'", - "'case'", - "'default'", - "'break'", - "'continue'", - "'do'", - "'while'", - "'if'", - "'else'", - "'for'", - "'enum'", - "'def'", - "'return'", - "'call'", - "'->'", - "'class'", - "'interface'", - "'true'", - "'false'", - "'typeof'", - "'void'", - "'null'", - "'undefined'", - "','", - "';'", - "'?'", - "':'", - "'('", - "')'", - "'['", - "']'", - undefined, - "'{'", - "'}'", - "'+'", - "'++'", - "'-'", - "'--'", - "'*'", - "'/'", - "'%'", - "'**'", - "'&&'", - "'||'", - "'!'", - "'='", - "'+='", - "'-='", - "'*='", - "'/='", - "'%='", - "'=='", - "'!='", - "'<'", - "'<='", - "'>'", - "'>='", - "'&'", - "'|'", - "'^'", - "'~'", - "'<<'", - "'>>'", - "'>>>'", - "'.'", + undefined, undefined, undefined, undefined, "'const'", "'var'", "'as'", + "'...'", "'switch'", "'case'", "'default'", "'break'", "'continue'", "'do'", + "'while'", "'if'", "'else'", "'for'", "'enum'", "'def'", "'return'", "'call'", + "'->'", "'class'", "'interface'", "'true'", "'false'", "'typeof'", "'void'", + "'null'", "'undefined'", "','", "';'", "'?'", "':'", "'('", "')'", "'['", + "']'", undefined, "'{'", "'}'", "'+'", "'++'", "'-'", "'--'", "'*'", "'/'", + "'%'", "'**'", "'&&'", "'||'", "'!'", "'='", "'+='", "'-='", "'*='", "'/='", + "'%='", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'&'", "'|'", "'^'", + "'~'", "'<<'", "'>>'", "'>>>'", "'.'", ]; private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, - "FStringExpStart", - "BlockComment", - "LineComment", - "Const", - "Var", - "As", - "Spread", - "Switch", - "Case", - "Default", - "Break", - "Continue", - "Do", - "While", - "If", - "Else", - "For", - "Enum", - "DefFunc", - "Return", - "CallFunc", - "RetIndicator", - "Class", - "Interface", - "True", - "False", - "Typeof", - "Void", - "Null", - "Undefined", - "Comma", - "SemiColon", - "QuestionMark", - "Colon", - "LeftParen", - "RightParen", - "LeftBracket", - "RightBracket", - "FStringExpEnd", - "LeftBrace", - "RightBrace", - "Plus", - "PlusPlus", - "Minus", - "MinusMinus", - "Star", - "Div", - "Mod", - "PowerTo", - "AndAnd", - "OrOr", - "Not", - "Assign", - "PlusAssign", - "MinusAssign", - "StarAssign", - "DivAssign", - "ModAssign", - "Equal", - "NotEqual", - "Less", - "LessEqual", - "Greater", - "GreaterEqual", - "BitwiseAnd", - "BitwiseOr", - "BitwiseXor", - "BitwiseNot", - "BitwiseZeroFillLeftShift", - "BitwiseSignedRightShift", - "BitwiseZeroFillRightShift", - "Dot", - "Identifier", - "IntegerConstant", - "SingleQuoteStringLiteral", - "DoubleQuoteStringLiteral", - "FloatingConstant", - "Whitespace", - "Newline", - "FStringSingleQuoteStart", - "FStringDoubleQuoteStart", - "FStringSingleQuoteEnd", - "FStringSingleQuoteAtom", - "FStringDoubleQuoteEnd", - "FStringDoubleQuoteAtom", + undefined, "FStringExpStart", "BlockComment", "LineComment", "Const", + "Var", "As", "Spread", "Switch", "Case", "Default", "Break", "Continue", + "Do", "While", "If", "Else", "For", "Enum", "DefFunc", "Return", "CallFunc", + "RetIndicator", "Class", "Interface", "True", "False", "Typeof", "Void", + "Null", "Undefined", "Comma", "SemiColon", "QuestionMark", "Colon", "LeftParen", + "RightParen", "LeftBracket", "RightBracket", "FStringExpEnd", "LeftBrace", + "RightBrace", "Plus", "PlusPlus", "Minus", "MinusMinus", "Star", "Div", + "Mod", "PowerTo", "AndAnd", "OrOr", "Not", "Assign", "PlusAssign", "MinusAssign", + "StarAssign", "DivAssign", "ModAssign", "Equal", "NotEqual", "Less", "LessEqual", + "Greater", "GreaterEqual", "BitwiseAnd", "BitwiseOr", "BitwiseXor", "BitwiseNot", + "BitwiseZeroFillLeftShift", "BitwiseSignedRightShift", "BitwiseZeroFillRightShift", + "Dot", "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", "DoubleQuoteStringLiteral", + "FloatingConstant", "Whitespace", "Newline", "FStringSingleQuoteStart", + "FStringDoubleQuoteStart", "FStringSingleQuoteEnd", "FStringSingleQuoteAtom", + "FStringDoubleQuoteEnd", "FStringDoubleQuoteAtom", ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( - KipperParser._LITERAL_NAMES, - KipperParser._SYMBOLIC_NAMES, - [], - ); + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(KipperParser._LITERAL_NAMES, KipperParser._SYMBOLIC_NAMES, []); // @Override // @NotNull @@ -448,19 +268,13 @@ export class KipperParser extends KipperParserBase { // tslint:enable:no-trailing-whitespace // @Override - public get grammarFileName(): string { - return "KipperParser.g4"; - } + public get grammarFileName(): string { return "KipperParser.g4"; } // @Override - public get ruleNames(): string[] { - return KipperParser.ruleNames; - } + public get ruleNames(): string[] { return KipperParser.ruleNames; } // @Override - public get serializedATN(): string { - return KipperParser._serializedATN; - } + public get serializedATN(): string { return KipperParser._serializedATN; } protected createFailedPredicateException(predicate?: string, message?: string): FailedPredicateException { return new FailedPredicateException(this, predicate, message); @@ -477,20 +291,21 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 157; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 0, this._ctx)) { - case 1: - { - this.state = 156; - this.translationUnit(); - } - break; + this.state = 165; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 0, this._ctx) ) { + case 1: + { + this.state = 164; + this.translationUnit(); } - this.state = 159; - this.match(KipperParser.EOF); + break; + } + this.state = 167; + this.match(KipperParser.EOF); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -498,7 +313,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -511,28 +327,29 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 162; - this._errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - this.state = 161; - this.externalItem(); - } - } - break; - default: - throw new NoViableAltException(this); + this.state = 170; + this._errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 169; + this.externalItem(); } - this.state = 164; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx); - } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 172; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -540,7 +357,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -553,10 +371,11 @@ export class KipperParser extends KipperParserBase { _localctx = new ExternalBlockItemContext(_localctx); this.enterOuterAlt(_localctx, 1); { - this.state = 166; - this.blockItemList(); + this.state = 174; + this.blockItemList(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -564,7 +383,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -577,28 +397,29 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 169; - this._errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - this.state = 168; - this.blockItem(); - } - } - break; - default: - throw new NoViableAltException(this); + this.state = 177; + this._errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 176; + this.blockItem(); } - this.state = 171; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); - } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 179; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -606,7 +427,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -618,32 +440,33 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 176; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 3, this._ctx)) { - case 1: - { - this.state = 173; - this.statement(); - } - break; + this.state = 184; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 3, this._ctx) ) { + case 1: + { + this.state = 181; + this.statement(); + } + break; - case 2: - { - this.state = 174; - this.declaration(); - } - break; + case 2: + { + this.state = 182; + this.declaration(); + } + break; - case 3: - { - this.state = 175; - this.match(KipperParser.SemiColon); - } - break; + case 3: + { + this.state = 183; + this.match(KipperParser.SemiColon); } + break; } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -651,7 +474,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -661,44 +485,45 @@ export class KipperParser extends KipperParserBase { let _localctx: DeclarationContext = new DeclarationContext(this._ctx, this.state); this.enterRule(_localctx, 10, KipperParser.RULE_declaration); try { - this.state = 184; + this.state = 192; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Const: - case KipperParser.Var: - this.enterOuterAlt(_localctx, 1); - { - this.state = 178; - this.variableDeclaration(); - this.state = 179; - this.match(KipperParser.SemiColon); - } - break; - case KipperParser.DefFunc: - this.enterOuterAlt(_localctx, 2); - { - this.state = 181; - this.functionDeclaration(); - } - break; - case KipperParser.Interface: - this.enterOuterAlt(_localctx, 3); - { - this.state = 182; - this.interfaceDeclaration(); - } - break; - case KipperParser.Class: - this.enterOuterAlt(_localctx, 4); - { - this.state = 183; - this.classDeclaration(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Const: + case KipperParser.Var: + this.enterOuterAlt(_localctx, 1); + { + this.state = 186; + this.variableDeclaration(); + this.state = 187; + this.match(KipperParser.SemiColon); + } + break; + case KipperParser.DefFunc: + this.enterOuterAlt(_localctx, 2); + { + this.state = 189; + this.functionDeclaration(); + } + break; + case KipperParser.Interface: + this.enterOuterAlt(_localctx, 3); + { + this.state = 190; + this.interfaceDeclaration(); + } + break; + case KipperParser.Class: + this.enterOuterAlt(_localctx, 4); + { + this.state = 191; + this.classDeclaration(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -706,7 +531,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -718,12 +544,13 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 186; - this.storageTypeSpecifier(); - this.state = 187; - this.initDeclarator(); + this.state = 194; + this.storageTypeSpecifier(); + this.state = 195; + this.initDeclarator(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -731,7 +558,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -744,20 +572,21 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 189; - _la = this._input.LA(1); - if (!(_la === KipperParser.Const || _la === KipperParser.Var)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 197; + _la = this._input.LA(1); + if (!(_la === KipperParser.Const || _la === KipperParser.Var)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -765,7 +594,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -778,25 +608,27 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 191; - this.declarator(); - this.state = 192; - this.match(KipperParser.Colon); - this.state = 193; - this.typeSpecifierExpression(); - this.state = 196; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Assign) { - { - this.state = 194; - this.match(KipperParser.Assign); - this.state = 195; - this.initializer(); - } + this.state = 199; + this.declarator(); + this.state = 200; + this.match(KipperParser.Colon); + this.state = 201; + this.typeSpecifierExpression(); + this.state = 204; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Assign) { + { + this.state = 202; + this.match(KipperParser.Assign); + this.state = 203; + this.initializer(); } } - } catch (re) { + + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -804,7 +636,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -816,10 +649,11 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 198; - this.assignmentExpression(); + this.state = 206; + this.assignmentExpression(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -827,7 +661,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -839,10 +674,11 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 200; - this.directDeclarator(); + this.state = 208; + this.directDeclarator(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -850,7 +686,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -862,10 +699,11 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 202; - this.match(KipperParser.Identifier); + this.state = 210; + this.match(KipperParser.Identifier); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -873,7 +711,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -886,40 +725,41 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 204; - this.match(KipperParser.DefFunc); - this.state = 205; - this.declarator(); - this.state = 206; - this.match(KipperParser.LeftParen); - this.state = 208; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Identifier) { - { - this.state = 207; - this.parameterList(); - } + this.state = 212; + this.match(KipperParser.DefFunc); + this.state = 213; + this.declarator(); + this.state = 214; + this.match(KipperParser.LeftParen); + this.state = 216; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Identifier) { + { + this.state = 215; + this.parameterList(); } + } - this.state = 210; - this.match(KipperParser.RightParen); - this.state = 211; - this.match(KipperParser.RetIndicator); - this.state = 212; - this.typeSpecifierExpression(); - this.state = 214; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 7, this._ctx)) { - case 1: - { - this.state = 213; - this.compoundStatement(); - } - break; + this.state = 218; + this.match(KipperParser.RightParen); + this.state = 219; + this.match(KipperParser.RetIndicator); + this.state = 220; + this.typeSpecifierExpression(); + this.state = 222; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 7, this._ctx) ) { + case 1: + { + this.state = 221; + this.compoundStatement(); } + break; } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -927,7 +767,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -940,26 +781,27 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 216; + this.state = 224; + this.parameterDeclaration(); + this.state = 229; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.Comma) { + { + { + this.state = 225; + this.match(KipperParser.Comma); + this.state = 226; this.parameterDeclaration(); - this.state = 221; + } + } + this.state = 231; this._errHandler.sync(this); _la = this._input.LA(1); - while (_la === KipperParser.Comma) { - { - { - this.state = 217; - this.match(KipperParser.Comma); - this.state = 218; - this.parameterDeclaration(); - } - } - this.state = 223; - this._errHandler.sync(this); - _la = this._input.LA(1); - } } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -967,7 +809,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -979,14 +822,15 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 224; - this.declarator(); - this.state = 225; - this.match(KipperParser.Colon); - this.state = 226; - this.typeSpecifierExpression(); + this.state = 232; + this.declarator(); + this.state = 233; + this.match(KipperParser.Colon); + this.state = 234; + this.typeSpecifierExpression(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -994,7 +838,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1003,19 +848,31 @@ export class KipperParser extends KipperParserBase { public interfaceDeclaration(): InterfaceDeclarationContext { let _localctx: InterfaceDeclarationContext = new InterfaceDeclarationContext(this._ctx, this.state); this.enterRule(_localctx, 30, KipperParser.RULE_interfaceDeclaration); + let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 228; - this.match(KipperParser.Interface); - this.state = 229; - this.match(KipperParser.Identifier); - this.state = 230; - this.match(KipperParser.LeftBrace); - this.state = 231; - this.match(KipperParser.RightBrace); + this.state = 236; + this.match(KipperParser.Interface); + this.state = 237; + this.match(KipperParser.Identifier); + this.state = 238; + this.match(KipperParser.LeftBrace); + this.state = 240; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Identifier) { + { + this.state = 239; + this.interfaceMemberList(); + } + } + + this.state = 242; + this.match(KipperParser.RightBrace); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1023,28 +880,37 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) - public classDeclaration(): ClassDeclarationContext { - let _localctx: ClassDeclarationContext = new ClassDeclarationContext(this._ctx, this.state); - this.enterRule(_localctx, 32, KipperParser.RULE_classDeclaration); + public interfaceMemberList(): InterfaceMemberListContext { + let _localctx: InterfaceMemberListContext = new InterfaceMemberListContext(this._ctx, this.state); + this.enterRule(_localctx, 32, KipperParser.RULE_interfaceMemberList); + let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 233; - this.match(KipperParser.Class); - this.state = 234; - this.match(KipperParser.Identifier); - this.state = 235; - this.match(KipperParser.LeftBrace); - this.state = 236; - this.match(KipperParser.RightBrace); - } - } catch (re) { + this.state = 245; + this._errHandler.sync(this); + _la = this._input.LA(1); + do { + { + { + this.state = 244; + this.interfaceMemberDeclaration(); + } + } + this.state = 247; + this._errHandler.sync(this); + _la = this._input.LA(1); + } while (_la === KipperParser.Identifier); + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1052,68 +918,38 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) - public statement(): StatementContext { - let _localctx: StatementContext = new StatementContext(this._ctx, this.state); - this.enterRule(_localctx, 34, KipperParser.RULE_statement); + public interfaceMemberDeclaration(): InterfaceMemberDeclarationContext { + let _localctx: InterfaceMemberDeclarationContext = new InterfaceMemberDeclarationContext(this._ctx, this.state); + this.enterRule(_localctx, 34, KipperParser.RULE_interfaceMemberDeclaration); try { - this.state = 244; + this.state = 251; this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 9, this._ctx)) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 238; - this.expressionStatement(); - } - break; - - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 239; - this.selectionStatement(); - } - break; - - case 3: - this.enterOuterAlt(_localctx, 3); - { - this.state = 240; - this.iterationStatement(); - } - break; - - case 4: - this.enterOuterAlt(_localctx, 4); - { - this.state = 241; - this.jumpStatement(); - } - break; - - case 5: - this.enterOuterAlt(_localctx, 5); - { - this.state = 242; - this.returnStatement(); - } - break; + switch ( this.interpreter.adaptivePredict(this._input, 11, this._ctx) ) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 249; + this.propertySignature(); + } + break; - case 6: - this.enterOuterAlt(_localctx, 6); - { - this.state = 243; - this.compoundStatement(); - } - break; + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 250; + this.methodSignature(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1121,38 +957,178 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) - public compoundStatement(): CompoundStatementContext { - let _localctx: CompoundStatementContext = new CompoundStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 36, KipperParser.RULE_compoundStatement); + public propertySignature(): PropertySignatureContext { + let _localctx: PropertySignatureContext = new PropertySignatureContext(this._ctx, this.state); + this.enterRule(_localctx, 36, KipperParser.RULE_propertySignature); try { this.enterOuterAlt(_localctx, 1); { - this.state = 246; - if (!this.notInsideExpressionStatement()) { - throw this.createFailedPredicateException("this.notInsideExpressionStatement()"); - } - this.state = 247; - this.match(KipperParser.LeftBrace); - this.state = 249; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 10, this._ctx)) { - case 1: - { - this.state = 248; - this.blockItemList(); - } - break; + this.state = 253; + this.match(KipperParser.Identifier); + this.state = 254; + this.match(KipperParser.Colon); + this.state = 255; + this.typeSpecifierExpression(); + this.state = 256; + this.match(KipperParser.SemiColon); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public methodSignature(): MethodSignatureContext { + let _localctx: MethodSignatureContext = new MethodSignatureContext(this._ctx, this.state); + this.enterRule(_localctx, 38, KipperParser.RULE_methodSignature); + let _la: number; + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 258; + this.match(KipperParser.Identifier); + this.state = 259; + this.match(KipperParser.LeftParen); + this.state = 261; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Identifier) { + { + this.state = 260; + this.parameterList(); + } + } + + this.state = 263; + this.match(KipperParser.RightParen); + this.state = 264; + this.match(KipperParser.RetIndicator); + this.state = 265; + this.typeSpecifierExpression(); + this.state = 266; + this.match(KipperParser.SemiColon); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public classDeclaration(): ClassDeclarationContext { + let _localctx: ClassDeclarationContext = new ClassDeclarationContext(this._ctx, this.state); + this.enterRule(_localctx, 40, KipperParser.RULE_classDeclaration); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 268; + this.match(KipperParser.Class); + this.state = 269; + this.match(KipperParser.Identifier); + this.state = 270; + this.match(KipperParser.LeftBrace); + this.state = 271; + this.match(KipperParser.RightBrace); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public statement(): StatementContext { + let _localctx: StatementContext = new StatementContext(this._ctx, this.state); + this.enterRule(_localctx, 42, KipperParser.RULE_statement); + try { + this.state = 279; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 13, this._ctx) ) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 273; + this.expressionStatement(); + } + break; + + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 274; + this.selectionStatement(); } - this.state = 251; - this.match(KipperParser.RightBrace); + break; + + case 3: + this.enterOuterAlt(_localctx, 3); + { + this.state = 275; + this.iterationStatement(); + } + break; + + case 4: + this.enterOuterAlt(_localctx, 4); + { + this.state = 276; + this.jumpStatement(); + } + break; + + case 5: + this.enterOuterAlt(_localctx, 5); + { + this.state = 277; + this.returnStatement(); + } + break; + + case 6: + this.enterOuterAlt(_localctx, 6); + { + this.state = 278; + this.compoundStatement(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1160,7 +1136,49 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public compoundStatement(): CompoundStatementContext { + let _localctx: CompoundStatementContext = new CompoundStatementContext(this._ctx, this.state); + this.enterRule(_localctx, 44, KipperParser.RULE_compoundStatement); + try { + this.enterOuterAlt(_localctx, 1); + { + this.state = 281; + if (!(this.notInsideExpressionStatement())) { + throw this.createFailedPredicateException("this.notInsideExpressionStatement()"); + } + this.state = 282; + this.match(KipperParser.LeftBrace); + this.state = 284; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 14, this._ctx) ) { + case 1: + { + this.state = 283; + this.blockItemList(); + } + break; + } + this.state = 286; + this.match(KipperParser.RightBrace); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { this.exitRule(); } return _localctx; @@ -1168,18 +1186,19 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public expressionStatement(): ExpressionStatementContext { let _localctx: ExpressionStatementContext = new ExpressionStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 38, KipperParser.RULE_expressionStatement); + this.enterRule(_localctx, 46, KipperParser.RULE_expressionStatement); try { this.enterOuterAlt(_localctx, 1); { - this.enterExpressionStatement(); - this.state = 254; - this.expression(); - this.state = 255; - this.match(KipperParser.SemiColon); - this.exitExpressionStatement(); + this.enterExpressionStatement() + this.state = 289; + this.expression(); + this.state = 290; + this.match(KipperParser.SemiColon); + this.exitExpressionStatement() } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1187,7 +1206,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1195,29 +1215,30 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public selectionStatement(): SelectionStatementContext { let _localctx: SelectionStatementContext = new SelectionStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 40, KipperParser.RULE_selectionStatement); + this.enterRule(_localctx, 48, KipperParser.RULE_selectionStatement); try { - this.state = 260; + this.state = 295; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.If: - this.enterOuterAlt(_localctx, 1); - { - this.state = 258; - this.ifStatement(); - } - break; - case KipperParser.Switch: - this.enterOuterAlt(_localctx, 2); - { - this.state = 259; - this.switchStatement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.If: + this.enterOuterAlt(_localctx, 1); + { + this.state = 293; + this.ifStatement(); + } + break; + case KipperParser.Switch: + this.enterOuterAlt(_localctx, 2); + { + this.state = 294; + this.switchStatement(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1225,7 +1246,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1233,34 +1255,35 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public ifStatement(): IfStatementContext { let _localctx: IfStatementContext = new IfStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 42, KipperParser.RULE_ifStatement); + this.enterRule(_localctx, 50, KipperParser.RULE_ifStatement); try { this.enterOuterAlt(_localctx, 1); { - this.state = 262; - this.match(KipperParser.If); - this.state = 263; - this.match(KipperParser.LeftParen); - this.state = 264; - this.expression(); - this.state = 265; - this.match(KipperParser.RightParen); - this.state = 266; + this.state = 297; + this.match(KipperParser.If); + this.state = 298; + this.match(KipperParser.LeftParen); + this.state = 299; + this.expression(); + this.state = 300; + this.match(KipperParser.RightParen); + this.state = 301; + this.statement(); + this.state = 304; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 16, this._ctx) ) { + case 1: + { + this.state = 302; + this.match(KipperParser.Else); + this.state = 303; this.statement(); - this.state = 269; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 12, this._ctx)) { - case 1: - { - this.state = 267; - this.match(KipperParser.Else); - this.state = 268; - this.statement(); - } - break; } + break; } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1268,7 +1291,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1276,39 +1300,40 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public switchStatement(): SwitchStatementContext { let _localctx: SwitchStatementContext = new SwitchStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 44, KipperParser.RULE_switchStatement); + this.enterRule(_localctx, 52, KipperParser.RULE_switchStatement); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 271; - this.match(KipperParser.Switch); - this.state = 272; - this.match(KipperParser.LeftParen); - this.state = 273; - this.expression(); - this.state = 274; - this.match(KipperParser.RightParen); - this.state = 275; - this.match(KipperParser.LeftBrace); - this.state = 279; + this.state = 306; + this.match(KipperParser.Switch); + this.state = 307; + this.match(KipperParser.LeftParen); + this.state = 308; + this.expression(); + this.state = 309; + this.match(KipperParser.RightParen); + this.state = 310; + this.match(KipperParser.LeftBrace); + this.state = 314; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.Case || _la === KipperParser.Default) { + { + { + this.state = 311; + this.switchLabeledStatement(); + } + } + this.state = 316; this._errHandler.sync(this); _la = this._input.LA(1); - while (_la === KipperParser.Case || _la === KipperParser.Default) { - { - { - this.state = 276; - this.switchLabeledStatement(); - } - } - this.state = 281; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 282; - this.match(KipperParser.RightBrace); } - } catch (re) { + this.state = 317; + this.match(KipperParser.RightBrace); + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1316,7 +1341,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1324,39 +1350,40 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public switchLabeledStatement(): SwitchLabeledStatementContext { let _localctx: SwitchLabeledStatementContext = new SwitchLabeledStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 46, KipperParser.RULE_switchLabeledStatement); + this.enterRule(_localctx, 54, KipperParser.RULE_switchLabeledStatement); try { - this.state = 292; + this.state = 327; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Case: - this.enterOuterAlt(_localctx, 1); - { - this.state = 284; - this.match(KipperParser.Case); - this.state = 285; - this.expression(); - this.state = 286; - this.match(KipperParser.Colon); - this.state = 287; - this.statement(); - } - break; - case KipperParser.Default: - this.enterOuterAlt(_localctx, 2); - { - this.state = 289; - this.match(KipperParser.Default); - this.state = 290; - this.match(KipperParser.Colon); - this.state = 291; - this.statement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Case: + this.enterOuterAlt(_localctx, 1); + { + this.state = 319; + this.match(KipperParser.Case); + this.state = 320; + this.expression(); + this.state = 321; + this.match(KipperParser.Colon); + this.state = 322; + this.statement(); + } + break; + case KipperParser.Default: + this.enterOuterAlt(_localctx, 2); + { + this.state = 324; + this.match(KipperParser.Default); + this.state = 325; + this.match(KipperParser.Colon); + this.state = 326; + this.statement(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1364,7 +1391,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1372,36 +1400,37 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public iterationStatement(): IterationStatementContext { let _localctx: IterationStatementContext = new IterationStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 48, KipperParser.RULE_iterationStatement); + this.enterRule(_localctx, 56, KipperParser.RULE_iterationStatement); try { - this.state = 297; + this.state = 332; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.For: - this.enterOuterAlt(_localctx, 1); - { - this.state = 294; - this.forLoopIterationStatement(); - } - break; - case KipperParser.While: - this.enterOuterAlt(_localctx, 2); - { - this.state = 295; - this.whileLoopIterationStatement(); - } - break; - case KipperParser.Do: - this.enterOuterAlt(_localctx, 3); - { - this.state = 296; - this.doWhileLoopIterationStatement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.For: + this.enterOuterAlt(_localctx, 1); + { + this.state = 329; + this.forLoopIterationStatement(); + } + break; + case KipperParser.While: + this.enterOuterAlt(_localctx, 2); + { + this.state = 330; + this.whileLoopIterationStatement(); + } + break; + case KipperParser.Do: + this.enterOuterAlt(_localctx, 3); + { + this.state = 331; + this.doWhileLoopIterationStatement(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1409,7 +1438,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1417,188 +1447,97 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public forLoopIterationStatement(): ForLoopIterationStatementContext { let _localctx: ForLoopIterationStatementContext = new ForLoopIterationStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 50, KipperParser.RULE_forLoopIterationStatement); + this.enterRule(_localctx, 58, KipperParser.RULE_forLoopIterationStatement); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 299; - this.match(KipperParser.For); - this.state = 300; - this.match(KipperParser.LeftParen); - this.state = 307; + this.state = 334; + this.match(KipperParser.For); + this.state = 335; + this.match(KipperParser.LeftParen); + this.state = 342; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Const) | (1 << KipperParser.Var) | (1 << KipperParser.CallFunc) | (1 << KipperParser.True) | (1 << KipperParser.False) | (1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0) || ((((_la - 35)) & ~0x1F) === 0 && ((1 << (_la - 35)) & ((1 << (KipperParser.LeftParen - 35)) | (1 << (KipperParser.LeftBracket - 35)) | (1 << (KipperParser.LeftBrace - 35)) | (1 << (KipperParser.Plus - 35)) | (1 << (KipperParser.PlusPlus - 35)) | (1 << (KipperParser.Minus - 35)) | (1 << (KipperParser.MinusMinus - 35)) | (1 << (KipperParser.Not - 35)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 338; this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - ((_la & ~0x1f) === 0 && - ((1 << _la) & - ((1 << KipperParser.Const) | - (1 << KipperParser.Var) | - (1 << KipperParser.CallFunc) | - (1 << KipperParser.True) | - (1 << KipperParser.False) | - (1 << KipperParser.Void) | - (1 << KipperParser.Null) | - (1 << KipperParser.Undefined))) !== - 0) || - (((_la - 35) & ~0x1f) === 0 && - ((1 << (_la - 35)) & - ((1 << (KipperParser.LeftParen - 35)) | - (1 << (KipperParser.LeftBracket - 35)) | - (1 << (KipperParser.LeftBrace - 35)) | - (1 << (KipperParser.Plus - 35)) | - (1 << (KipperParser.PlusPlus - 35)) | - (1 << (KipperParser.Minus - 35)) | - (1 << (KipperParser.MinusMinus - 35)) | - (1 << (KipperParser.Not - 35)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { + switch (this._input.LA(1)) { + case KipperParser.Const: + case KipperParser.Var: { - this.state = 303; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case KipperParser.Const: - case KipperParser.Var: - { - this.state = 301; - this.variableDeclaration(); - } - break; - case KipperParser.CallFunc: - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Plus: - case KipperParser.PlusPlus: - case KipperParser.Minus: - case KipperParser.MinusMinus: - case KipperParser.Not: - case KipperParser.BitwiseNot: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - { - this.state = 302; - this.expression(); - } - break; - default: - throw new NoViableAltException(this); - } - _localctx._forDeclaration = true; + this.state = 336; + this.variableDeclaration(); } - } - - this.state = 309; - this.match(KipperParser.SemiColon); - this.state = 313; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { + break; + case KipperParser.CallFunc: + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Plus: + case KipperParser.PlusPlus: + case KipperParser.Minus: + case KipperParser.MinusMinus: + case KipperParser.Not: + case KipperParser.BitwiseNot: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: { - this.state = 310; - this.expression(); - _localctx._forCondition = true; + this.state = 337; + this.expression(); } + break; + default: + throw new NoViableAltException(this); } + _localctx._forDeclaration = true + } + } - this.state = 315; - this.match(KipperParser.SemiColon); - this.state = 319; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 316; - this.expression(); - _localctx._forIterationExp = true; - } + this.state = 344; + this.match(KipperParser.SemiColon); + this.state = 348; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 345; + this.expression(); + _localctx._forCondition = true } + } - this.state = 321; - this.match(KipperParser.RightParen); - this.state = 322; - this.statement(); + this.state = 350; + this.match(KipperParser.SemiColon); + this.state = 354; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 351; + this.expression(); + _localctx._forIterationExp = true + } + } + + this.state = 356; + this.match(KipperParser.RightParen); + this.state = 357; + this.statement(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1606,7 +1545,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1614,22 +1554,23 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public whileLoopIterationStatement(): WhileLoopIterationStatementContext { let _localctx: WhileLoopIterationStatementContext = new WhileLoopIterationStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 52, KipperParser.RULE_whileLoopIterationStatement); + this.enterRule(_localctx, 60, KipperParser.RULE_whileLoopIterationStatement); try { this.enterOuterAlt(_localctx, 1); { - this.state = 324; - this.match(KipperParser.While); - this.state = 325; - this.match(KipperParser.LeftParen); - this.state = 326; - this.expression(); - this.state = 327; - this.match(KipperParser.RightParen); - this.state = 328; - this.statement(); - } - } catch (re) { + this.state = 359; + this.match(KipperParser.While); + this.state = 360; + this.match(KipperParser.LeftParen); + this.state = 361; + this.expression(); + this.state = 362; + this.match(KipperParser.RightParen); + this.state = 363; + this.statement(); + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1637,37 +1578,36 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public doWhileLoopIterationStatement(): DoWhileLoopIterationStatementContext { - let _localctx: DoWhileLoopIterationStatementContext = new DoWhileLoopIterationStatementContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 54, KipperParser.RULE_doWhileLoopIterationStatement); + let _localctx: DoWhileLoopIterationStatementContext = new DoWhileLoopIterationStatementContext(this._ctx, this.state); + this.enterRule(_localctx, 62, KipperParser.RULE_doWhileLoopIterationStatement); try { this.enterOuterAlt(_localctx, 1); { - this.state = 330; - this.match(KipperParser.Do); - this.state = 331; - this.statement(); - this.state = 332; - this.match(KipperParser.While); - this.state = 333; - this.match(KipperParser.LeftParen); - this.state = 334; - this.expression(); - this.state = 335; - this.match(KipperParser.RightParen); - this.state = 336; - this.match(KipperParser.SemiColon); + this.state = 365; + this.match(KipperParser.Do); + this.state = 366; + this.statement(); + this.state = 367; + this.match(KipperParser.While); + this.state = 368; + this.match(KipperParser.LeftParen); + this.state = 369; + this.expression(); + this.state = 370; + this.match(KipperParser.RightParen); + this.state = 371; + this.match(KipperParser.SemiColon); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1675,7 +1615,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1683,27 +1624,28 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public jumpStatement(): JumpStatementContext { let _localctx: JumpStatementContext = new JumpStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 56, KipperParser.RULE_jumpStatement); + this.enterRule(_localctx, 64, KipperParser.RULE_jumpStatement); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 338; - _la = this._input.LA(1); - if (!(_la === KipperParser.Break || _la === KipperParser.Continue)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 373; + _la = this._input.LA(1); + if (!(_la === KipperParser.Break || _la === KipperParser.Continue)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } - this.state = 339; - this.match(KipperParser.SemiColon); + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 374; + this.match(KipperParser.SemiColon); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1711,7 +1653,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1719,149 +1662,123 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public returnStatement(): ReturnStatementContext { let _localctx: ReturnStatementContext = new ReturnStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 58, KipperParser.RULE_returnStatement); + this.enterRule(_localctx, 66, KipperParser.RULE_returnStatement); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 341; - this.match(KipperParser.Return); - this.state = 343; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 342; - this.expression(); - } - } - - this.state = 345; - this.match(KipperParser.SemiColon); - } - } catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } finally { - this.exitRule(); - } - return _localctx; - } - // @RuleVersion(0) - public primaryExpression(): PrimaryExpressionContext { - let _localctx: PrimaryExpressionContext = new PrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 60, KipperParser.RULE_primaryExpression); - try { - this.state = 356; + this.state = 376; + this.match(KipperParser.Return); + this.state = 378; this._errHandler.sync(this); - switch (this._input.LA(1)) { - case KipperParser.LeftParen: - this.enterOuterAlt(_localctx, 1); - { - this.state = 347; - this.tangledPrimaryExpression(); - } - break; - case KipperParser.LeftBracket: - this.enterOuterAlt(_localctx, 2); - { - this.state = 348; - this.arrayPrimaryExpression(); - } - break; - case KipperParser.LeftBrace: - this.enterOuterAlt(_localctx, 3); - { - this.state = 349; - this.objectPrimaryExpression(); - } - break; - case KipperParser.True: - case KipperParser.False: - this.enterOuterAlt(_localctx, 4); - { - this.state = 350; - this.boolPrimaryExpression(); - } - break; - case KipperParser.Identifier: - this.enterOuterAlt(_localctx, 5); - { - this.state = 351; - this.identifierPrimaryExpression(); - } - break; - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - this.enterOuterAlt(_localctx, 6); - { - this.state = 352; - this.stringPrimaryExpression(); - } - break; - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 7); - { - this.state = 353; - this.fStringPrimaryExpression(); - } - break; - case KipperParser.IntegerConstant: - case KipperParser.FloatingConstant: - this.enterOuterAlt(_localctx, 8); - { - this.state = 354; - this.numberPrimaryExpression(); - } - break; - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - this.enterOuterAlt(_localctx, 9); - { - this.state = 355; - this.voidOrNullOrUndefinedPrimaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 377; + this.expression(); + } + } + + this.state = 380; + this.match(KipperParser.SemiColon); + } + } + catch (re) { + if (re instanceof RecognitionException) { + _localctx.exception = re; + this._errHandler.reportError(this, re); + this._errHandler.recover(this, re); + } else { + throw re; + } + } + finally { + this.exitRule(); + } + return _localctx; + } + // @RuleVersion(0) + public primaryExpression(): PrimaryExpressionContext { + let _localctx: PrimaryExpressionContext = new PrimaryExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 68, KipperParser.RULE_primaryExpression); + try { + this.state = 391; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case KipperParser.LeftParen: + this.enterOuterAlt(_localctx, 1); + { + this.state = 382; + this.tangledPrimaryExpression(); + } + break; + case KipperParser.LeftBracket: + this.enterOuterAlt(_localctx, 2); + { + this.state = 383; + this.arrayPrimaryExpression(); + } + break; + case KipperParser.LeftBrace: + this.enterOuterAlt(_localctx, 3); + { + this.state = 384; + this.objectPrimaryExpression(); + } + break; + case KipperParser.True: + case KipperParser.False: + this.enterOuterAlt(_localctx, 4); + { + this.state = 385; + this.boolPrimaryExpression(); + } + break; + case KipperParser.Identifier: + this.enterOuterAlt(_localctx, 5); + { + this.state = 386; + this.identifierPrimaryExpression(); + } + break; + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + this.enterOuterAlt(_localctx, 6); + { + this.state = 387; + this.stringPrimaryExpression(); + } + break; + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 7); + { + this.state = 388; + this.fStringPrimaryExpression(); + } + break; + case KipperParser.IntegerConstant: + case KipperParser.FloatingConstant: + this.enterOuterAlt(_localctx, 8); + { + this.state = 389; + this.numberPrimaryExpression(); + } + break; + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + this.enterOuterAlt(_localctx, 9); + { + this.state = 390; + this.voidOrNullOrUndefinedPrimaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1869,7 +1786,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1877,18 +1795,19 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public tangledPrimaryExpression(): TangledPrimaryExpressionContext { let _localctx: TangledPrimaryExpressionContext = new TangledPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 62, KipperParser.RULE_tangledPrimaryExpression); + this.enterRule(_localctx, 70, KipperParser.RULE_tangledPrimaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 358; - this.match(KipperParser.LeftParen); - this.state = 359; - this.expression(); - this.state = 360; - this.match(KipperParser.RightParen); + this.state = 393; + this.match(KipperParser.LeftParen); + this.state = 394; + this.expression(); + this.state = 395; + this.match(KipperParser.RightParen); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1896,7 +1815,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1904,25 +1824,26 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public boolPrimaryExpression(): BoolPrimaryExpressionContext { let _localctx: BoolPrimaryExpressionContext = new BoolPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 64, KipperParser.RULE_boolPrimaryExpression); + this.enterRule(_localctx, 72, KipperParser.RULE_boolPrimaryExpression); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 362; - _la = this._input.LA(1); - if (!(_la === KipperParser.True || _la === KipperParser.False)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 397; + _la = this._input.LA(1); + if (!(_la === KipperParser.True || _la === KipperParser.False)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1930,7 +1851,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1938,14 +1860,15 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public identifierPrimaryExpression(): IdentifierPrimaryExpressionContext { let _localctx: IdentifierPrimaryExpressionContext = new IdentifierPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 66, KipperParser.RULE_identifierPrimaryExpression); + this.enterRule(_localctx, 74, KipperParser.RULE_identifierPrimaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 364; - this.identifier(); + this.state = 399; + this.identifier(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1953,7 +1876,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1961,14 +1885,15 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public identifier(): IdentifierContext { let _localctx: IdentifierContext = new IdentifierContext(this._ctx, this.state); - this.enterRule(_localctx, 68, KipperParser.RULE_identifier); + this.enterRule(_localctx, 76, KipperParser.RULE_identifier); try { this.enterOuterAlt(_localctx, 1); { - this.state = 366; - this.match(KipperParser.Identifier); + this.state = 401; + this.match(KipperParser.Identifier); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1976,41 +1901,40 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public identifierOrStringPrimaryExpression(): IdentifierOrStringPrimaryExpressionContext { - let _localctx: IdentifierOrStringPrimaryExpressionContext = new IdentifierOrStringPrimaryExpressionContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 70, KipperParser.RULE_identifierOrStringPrimaryExpression); + let _localctx: IdentifierOrStringPrimaryExpressionContext = new IdentifierOrStringPrimaryExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 78, KipperParser.RULE_identifierOrStringPrimaryExpression); try { - this.state = 370; + this.state = 405; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Identifier: - this.enterOuterAlt(_localctx, 1); - { - this.state = 368; - this.identifier(); - } - break; - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - this.enterOuterAlt(_localctx, 2); - { - this.state = 369; - this.stringPrimaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Identifier: + this.enterOuterAlt(_localctx, 1); + { + this.state = 403; + this.identifier(); + } + break; + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + this.enterOuterAlt(_localctx, 2); + { + this.state = 404; + this.stringPrimaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2018,7 +1942,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2026,25 +1951,26 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public stringPrimaryExpression(): StringPrimaryExpressionContext { let _localctx: StringPrimaryExpressionContext = new StringPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 72, KipperParser.RULE_stringPrimaryExpression); + this.enterRule(_localctx, 80, KipperParser.RULE_stringPrimaryExpression); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 372; - _la = this._input.LA(1); - if (!(_la === KipperParser.SingleQuoteStringLiteral || _la === KipperParser.DoubleQuoteStringLiteral)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 407; + _la = this._input.LA(1); + if (!(_la === KipperParser.SingleQuoteStringLiteral || _la === KipperParser.DoubleQuoteStringLiteral)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2052,7 +1978,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2060,62 +1987,63 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public fStringPrimaryExpression(): FStringPrimaryExpressionContext { let _localctx: FStringPrimaryExpressionContext = new FStringPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 74, KipperParser.RULE_fStringPrimaryExpression); + this.enterRule(_localctx, 82, KipperParser.RULE_fStringPrimaryExpression); let _la: number; try { - this.state = 390; + this.state = 425; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringSingleQuoteStart: - this.enterOuterAlt(_localctx, 1); + case KipperParser.FStringSingleQuoteStart: + this.enterOuterAlt(_localctx, 1); + { + this.state = 409; + this.match(KipperParser.FStringSingleQuoteStart); + this.state = 413; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringSingleQuoteAtom) { { - this.state = 374; - this.match(KipperParser.FStringSingleQuoteStart); - this.state = 378; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringSingleQuoteAtom) { - { - { - this.state = 375; - this.fStringSingleQuoteAtom(); - } - } - this.state = 380; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 381; - this.match(KipperParser.FStringSingleQuoteEnd); + { + this.state = 410; + this.fStringSingleQuoteAtom(); } - break; - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 2); + } + this.state = 415; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 416; + this.match(KipperParser.FStringSingleQuoteEnd); + } + break; + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 2); + { + this.state = 417; + this.match(KipperParser.FStringDoubleQuoteStart); + this.state = 421; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringDoubleQuoteAtom) { { - this.state = 382; - this.match(KipperParser.FStringDoubleQuoteStart); - this.state = 386; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringDoubleQuoteAtom) { - { - { - this.state = 383; - this.fStringDoubleQuoteAtom(); - } - } - this.state = 388; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 389; - this.match(KipperParser.FStringDoubleQuoteEnd); + { + this.state = 418; + this.fStringDoubleQuoteAtom(); } - break; - default: - throw new NoViableAltException(this); + } + this.state = 423; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 424; + this.match(KipperParser.FStringDoubleQuoteEnd); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2123,7 +2051,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2131,71 +2060,43 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public fStringSingleQuoteAtom(): FStringSingleQuoteAtomContext { let _localctx: FStringSingleQuoteAtomContext = new FStringSingleQuoteAtomContext(this._ctx, this.state); - this.enterRule(_localctx, 76, KipperParser.RULE_fStringSingleQuoteAtom); + this.enterRule(_localctx, 84, KipperParser.RULE_fStringSingleQuoteAtom); let _la: number; try { - this.state = 398; + this.state = 433; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringSingleQuoteAtom: - this.enterOuterAlt(_localctx, 1); + case KipperParser.FStringSingleQuoteAtom: + this.enterOuterAlt(_localctx, 1); + { + this.state = 427; + this.match(KipperParser.FStringSingleQuoteAtom); + } + break; + case KipperParser.FStringExpStart: + this.enterOuterAlt(_localctx, 2); + { + this.state = 428; + this.match(KipperParser.FStringExpStart); + this.state = 430; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { { - this.state = 392; - this.match(KipperParser.FStringSingleQuoteAtom); + this.state = 429; + this.expression(); } - break; - case KipperParser.FStringExpStart: - this.enterOuterAlt(_localctx, 2); - { - this.state = 393; - this.match(KipperParser.FStringExpStart); - this.state = 395; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 394; - this.expression(); - } - } + } - this.state = 397; - this.match(KipperParser.FStringExpEnd); - } - break; - default: - throw new NoViableAltException(this); + this.state = 432; + this.match(KipperParser.FStringExpEnd); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2203,7 +2104,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2211,71 +2113,43 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public fStringDoubleQuoteAtom(): FStringDoubleQuoteAtomContext { let _localctx: FStringDoubleQuoteAtomContext = new FStringDoubleQuoteAtomContext(this._ctx, this.state); - this.enterRule(_localctx, 78, KipperParser.RULE_fStringDoubleQuoteAtom); + this.enterRule(_localctx, 86, KipperParser.RULE_fStringDoubleQuoteAtom); let _la: number; try { - this.state = 406; + this.state = 441; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringDoubleQuoteAtom: - this.enterOuterAlt(_localctx, 1); + case KipperParser.FStringDoubleQuoteAtom: + this.enterOuterAlt(_localctx, 1); + { + this.state = 435; + this.match(KipperParser.FStringDoubleQuoteAtom); + } + break; + case KipperParser.FStringExpStart: + this.enterOuterAlt(_localctx, 2); + { + this.state = 436; + this.match(KipperParser.FStringExpStart); + this.state = 438; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { { - this.state = 400; - this.match(KipperParser.FStringDoubleQuoteAtom); + this.state = 437; + this.expression(); } - break; - case KipperParser.FStringExpStart: - this.enterOuterAlt(_localctx, 2); - { - this.state = 401; - this.match(KipperParser.FStringExpStart); - this.state = 403; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 402; - this.expression(); - } - } + } - this.state = 405; - this.match(KipperParser.FStringExpEnd); - } - break; - default: - throw new NoViableAltException(this); + this.state = 440; + this.match(KipperParser.FStringExpEnd); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2283,7 +2157,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2291,25 +2166,26 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public numberPrimaryExpression(): NumberPrimaryExpressionContext { let _localctx: NumberPrimaryExpressionContext = new NumberPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 80, KipperParser.RULE_numberPrimaryExpression); + this.enterRule(_localctx, 88, KipperParser.RULE_numberPrimaryExpression); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 408; - _la = this._input.LA(1); - if (!(_la === KipperParser.IntegerConstant || _la === KipperParser.FloatingConstant)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 443; + _la = this._input.LA(1); + if (!(_la === KipperParser.IntegerConstant || _la === KipperParser.FloatingConstant)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2317,7 +2193,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2325,85 +2202,57 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public arrayPrimaryExpression(): ArrayPrimaryExpressionContext { let _localctx: ArrayPrimaryExpressionContext = new ArrayPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 82, KipperParser.RULE_arrayPrimaryExpression); + this.enterRule(_localctx, 90, KipperParser.RULE_arrayPrimaryExpression); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 410; - this.match(KipperParser.LeftBracket); - this.state = 419; + this.state = 445; + this.match(KipperParser.LeftBracket); + this.state = 454; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 446; + this.expression(); + this.state = 451; this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 411; + _alt = this.interpreter.adaptivePredict(this._input, 34, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 447; + this.match(KipperParser.Comma); + this.state = 448; this.expression(); - this.state = 416; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 412; - this.match(KipperParser.Comma); - this.state = 413; - this.expression(); - } - } - } - this.state = 418; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); + } } } + this.state = 453; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 34, this._ctx); } + } + } - this.state = 422; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Comma) { - { - this.state = 421; - this.match(KipperParser.Comma); - } + this.state = 457; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Comma) { + { + this.state = 456; + this.match(KipperParser.Comma); } + } - this.state = 424; - this.match(KipperParser.RightBracket); + this.state = 459; + this.match(KipperParser.RightBracket); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2411,7 +2260,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2419,63 +2269,57 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public objectPrimaryExpression(): ObjectPrimaryExpressionContext { let _localctx: ObjectPrimaryExpressionContext = new ObjectPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 84, KipperParser.RULE_objectPrimaryExpression); + this.enterRule(_localctx, 92, KipperParser.RULE_objectPrimaryExpression); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 426; - this.match(KipperParser.LeftBrace); - this.state = 435; + this.state = 461; + this.match(KipperParser.LeftBrace); + this.state = 470; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 73)) & ~0x1F) === 0 && ((1 << (_la - 73)) & ((1 << (KipperParser.Identifier - 73)) | (1 << (KipperParser.SingleQuoteStringLiteral - 73)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 73)))) !== 0)) { + { + this.state = 462; + this.objectProperty(); + this.state = 467; this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - ((_la - 73) & ~0x1f) === 0 && - ((1 << (_la - 73)) & - ((1 << (KipperParser.Identifier - 73)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 73)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 73)))) !== - 0 - ) { - { - this.state = 427; + _alt = this.interpreter.adaptivePredict(this._input, 37, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 463; + this.match(KipperParser.Comma); + this.state = 464; this.objectProperty(); - this.state = 432; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 428; - this.match(KipperParser.Comma); - this.state = 429; - this.objectProperty(); - } - } - } - this.state = 434; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); + } } } + this.state = 469; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 37, this._ctx); + } } + } - this.state = 438; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Comma) { - { - this.state = 437; - this.match(KipperParser.Comma); - } + this.state = 473; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Comma) { + { + this.state = 472; + this.match(KipperParser.Comma); } + } - this.state = 440; - this.match(KipperParser.RightBrace); + this.state = 475; + this.match(KipperParser.RightBrace); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2483,7 +2327,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2491,18 +2336,19 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public objectProperty(): ObjectPropertyContext { let _localctx: ObjectPropertyContext = new ObjectPropertyContext(this._ctx, this.state); - this.enterRule(_localctx, 86, KipperParser.RULE_objectProperty); + this.enterRule(_localctx, 94, KipperParser.RULE_objectProperty); try { this.enterOuterAlt(_localctx, 1); { - this.state = 442; - this.identifierOrStringPrimaryExpression(); - this.state = 443; - this.match(KipperParser.Colon); - this.state = 444; - this.expression(); + this.state = 477; + this.identifierOrStringPrimaryExpression(); + this.state = 478; + this.match(KipperParser.Colon); + this.state = 479; + this.expression(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2510,41 +2356,35 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public voidOrNullOrUndefinedPrimaryExpression(): VoidOrNullOrUndefinedPrimaryExpressionContext { - let _localctx: VoidOrNullOrUndefinedPrimaryExpressionContext = new VoidOrNullOrUndefinedPrimaryExpressionContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 88, KipperParser.RULE_voidOrNullOrUndefinedPrimaryExpression); + let _localctx: VoidOrNullOrUndefinedPrimaryExpressionContext = new VoidOrNullOrUndefinedPrimaryExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 96, KipperParser.RULE_voidOrNullOrUndefinedPrimaryExpression); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 446; - _la = this._input.LA(1); - if ( - !( - (_la & ~0x1f) === 0 && - ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 481; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2552,7 +2392,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2570,225 +2411,160 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: ComputedPrimaryExpressionContext = new ComputedPrimaryExpressionContext(this._ctx, _parentState); let _prevctx: ComputedPrimaryExpressionContext = _localctx; - let _startState: number = 90; - this.enterRecursionRule(_localctx, 90, KipperParser.RULE_computedPrimaryExpression, _p); + let _startState: number = 98; + this.enterRecursionRule(_localctx, 98, KipperParser.RULE_computedPrimaryExpression, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 459; + this.state = 494; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + { + _localctx = new PassOncomputedPrimaryExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 484; + this.primaryExpression(); + } + break; + case KipperParser.CallFunc: + { + _localctx = new ExplicitCallFunctionCallExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 485; + this.match(KipperParser.CallFunc); + this.state = 486; + this.computedPrimaryExpression(0); + this.state = 487; + this.match(KipperParser.LeftParen); + this.state = 489; this._errHandler.sync(this); - switch (this._input.LA(1)) { - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 488; + this.argumentExpressionList(); + } + } + + this.state = 491; + this.match(KipperParser.RightParen); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression + } + break; + default: + throw new NoViableAltException(this); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 517; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 44, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + this.state = 515; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 43, this._ctx) ) { + case 1: { - _localctx = new PassOncomputedPrimaryExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + _localctx = new FunctionCallExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 496; + if (!(this.precpred(this._ctx, 5))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 5)"); + } + this.state = 497; + this.match(KipperParser.LeftParen); + this.state = 499; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 498; + this.argumentExpressionList(); + } + } - this.state = 449; - this.primaryExpression(); + this.state = 501; + this.match(KipperParser.RightParen); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression } break; - case KipperParser.CallFunc: - { - _localctx = new ExplicitCallFunctionCallExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 450; - this.match(KipperParser.CallFunc); - this.state = 451; - this.computedPrimaryExpression(0); - this.state = 452; - this.match(KipperParser.LeftParen); - this.state = 454; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 453; - this.argumentExpressionList(); - } - } - this.state = 456; - this.match(KipperParser.RightParen); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression; + case 2: + { + _localctx = new DotNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 503; + if (!(this.precpred(this._ctx, 3))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 3)"); + } + this.state = 504; + this.dotNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression } break; - default: - throw new NoViableAltException(this); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 482; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); + + case 3: + { + _localctx = new BracketNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 507; + if (!(this.precpred(this._ctx, 2))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 2)"); + } + this.state = 508; + this.bracketNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression } - _prevctx = _localctx; + break; + + case 4: { - this.state = 480; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 39, this._ctx)) { - case 1: - { - _localctx = new FunctionCallExpressionContext( - new ComputedPrimaryExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 461; - if (!this.precpred(this._ctx, 5)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 5)"); - } - this.state = 462; - this.match(KipperParser.LeftParen); - this.state = 464; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 463; - this.argumentExpressionList(); - } - } - - this.state = 466; - this.match(KipperParser.RightParen); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression; - } - break; - - case 2: - { - _localctx = new DotNotationMemberAccessExpressionContext( - new ComputedPrimaryExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 468; - if (!this.precpred(this._ctx, 3)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 3)"); - } - this.state = 469; - this.dotNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; - } - break; - - case 3: - { - _localctx = new BracketNotationMemberAccessExpressionContext( - new ComputedPrimaryExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 472; - if (!this.precpred(this._ctx, 2)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 2)"); - } - this.state = 473; - this.bracketNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; - } - break; - - case 4: - { - _localctx = new SliceNotationMemberAccessExpressionContext( - new ComputedPrimaryExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 476; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 477; - this.sliceNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; - } - break; - } + _localctx = new SliceNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 511; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 512; + this.sliceNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression } + break; + } } - this.state = 484; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); } + this.state = 519; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 44, this._ctx); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2796,7 +2572,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -2804,31 +2581,32 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public argumentExpressionList(): ArgumentExpressionListContext { let _localctx: ArgumentExpressionListContext = new ArgumentExpressionListContext(this._ctx, this.state); - this.enterRule(_localctx, 92, KipperParser.RULE_argumentExpressionList); + this.enterRule(_localctx, 100, KipperParser.RULE_argumentExpressionList); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 485; + this.state = 520; + this.assignmentExpression(); + this.state = 525; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.Comma) { + { + { + this.state = 521; + this.match(KipperParser.Comma); + this.state = 522; this.assignmentExpression(); - this.state = 490; + } + } + this.state = 527; this._errHandler.sync(this); _la = this._input.LA(1); - while (_la === KipperParser.Comma) { - { - { - this.state = 486; - this.match(KipperParser.Comma); - this.state = 487; - this.assignmentExpression(); - } - } - this.state = 492; - this._errHandler.sync(this); - _la = this._input.LA(1); - } } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2836,7 +2614,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2844,16 +2623,17 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public dotNotation(): DotNotationContext { let _localctx: DotNotationContext = new DotNotationContext(this._ctx, this.state); - this.enterRule(_localctx, 94, KipperParser.RULE_dotNotation); + this.enterRule(_localctx, 102, KipperParser.RULE_dotNotation); try { this.enterOuterAlt(_localctx, 1); { - this.state = 493; - this.match(KipperParser.Dot); - this.state = 494; - this.identifier(); + this.state = 528; + this.match(KipperParser.Dot); + this.state = 529; + this.identifier(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2861,7 +2641,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2869,18 +2650,19 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public bracketNotation(): BracketNotationContext { let _localctx: BracketNotationContext = new BracketNotationContext(this._ctx, this.state); - this.enterRule(_localctx, 96, KipperParser.RULE_bracketNotation); + this.enterRule(_localctx, 104, KipperParser.RULE_bracketNotation); try { this.enterOuterAlt(_localctx, 1); { - this.state = 496; - this.match(KipperParser.LeftBracket); - this.state = 497; - this.expression(); - this.state = 498; - this.match(KipperParser.RightBracket); + this.state = 531; + this.match(KipperParser.LeftBracket); + this.state = 532; + this.expression(); + this.state = 533; + this.match(KipperParser.RightBracket); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2888,7 +2670,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2896,99 +2679,42 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public sliceNotation(): SliceNotationContext { let _localctx: SliceNotationContext = new SliceNotationContext(this._ctx, this.state); - this.enterRule(_localctx, 98, KipperParser.RULE_sliceNotation); + this.enterRule(_localctx, 106, KipperParser.RULE_sliceNotation); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 500; - this.match(KipperParser.LeftBracket); - this.state = 504; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 501; - this.expression(); - _localctx.sliceStart = true; - } + this.state = 535; + this.match(KipperParser.LeftBracket); + this.state = 539; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 536; + this.expression(); + _localctx.sliceStart = true } + } - this.state = 506; - this.match(KipperParser.Colon); - this.state = 510; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 507; - this.expression(); - _localctx.sliceEnd = true; - } + this.state = 541; + this.match(KipperParser.Colon); + this.state = 545; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 542; + this.expression(); + _localctx.sliceEnd = true } + } - this.state = 512; - this.match(KipperParser.RightBracket); + this.state = 547; + this.match(KipperParser.RightBracket); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2996,7 +2722,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3004,28 +2731,29 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public postfixExpression(): PostfixExpressionContext { let _localctx: PostfixExpressionContext = new PostfixExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 100, KipperParser.RULE_postfixExpression); + this.enterRule(_localctx, 108, KipperParser.RULE_postfixExpression); try { - this.state = 516; + this.state = 551; this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 44, this._ctx)) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 514; - this.computedPrimaryExpression(0); - } - break; + switch ( this.interpreter.adaptivePredict(this._input, 48, this._ctx) ) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 549; + this.computedPrimaryExpression(0); + } + break; - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 515; - this.incrementOrDecrementPostfixExpression(); - } - break; + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 550; + this.incrementOrDecrementPostfixExpression(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3033,27 +2761,26 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public incrementOrDecrementPostfixExpression(): IncrementOrDecrementPostfixExpressionContext { - let _localctx: IncrementOrDecrementPostfixExpressionContext = new IncrementOrDecrementPostfixExpressionContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 102, KipperParser.RULE_incrementOrDecrementPostfixExpression); + let _localctx: IncrementOrDecrementPostfixExpressionContext = new IncrementOrDecrementPostfixExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 110, KipperParser.RULE_incrementOrDecrementPostfixExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 518; - this.computedPrimaryExpression(0); - this.state = 519; - this.incrementOrDecrementOperator(); + this.state = 553; + this.computedPrimaryExpression(0); + this.state = 554; + this.incrementOrDecrementOperator(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3061,7 +2788,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3069,55 +2797,56 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public unaryExpression(): UnaryExpressionContext { let _localctx: UnaryExpressionContext = new UnaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 104, KipperParser.RULE_unaryExpression); + this.enterRule(_localctx, 112, KipperParser.RULE_unaryExpression); try { - this.state = 524; + this.state = 559; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.CallFunc: - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 1); - { - this.state = 521; - this.postfixExpression(); - } - break; - case KipperParser.PlusPlus: - case KipperParser.MinusMinus: - this.enterOuterAlt(_localctx, 2); - { - this.state = 522; - this.incrementOrDecrementUnaryExpression(); - } - break; - case KipperParser.Plus: - case KipperParser.Minus: - case KipperParser.Not: - case KipperParser.BitwiseNot: - this.enterOuterAlt(_localctx, 3); - { - this.state = 523; - this.operatorModifiedUnaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.CallFunc: + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 1); + { + this.state = 556; + this.postfixExpression(); + } + break; + case KipperParser.PlusPlus: + case KipperParser.MinusMinus: + this.enterOuterAlt(_localctx, 2); + { + this.state = 557; + this.incrementOrDecrementUnaryExpression(); + } + break; + case KipperParser.Plus: + case KipperParser.Minus: + case KipperParser.Not: + case KipperParser.BitwiseNot: + this.enterOuterAlt(_localctx, 3); + { + this.state = 558; + this.operatorModifiedUnaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3125,27 +2854,26 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public incrementOrDecrementUnaryExpression(): IncrementOrDecrementUnaryExpressionContext { - let _localctx: IncrementOrDecrementUnaryExpressionContext = new IncrementOrDecrementUnaryExpressionContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 106, KipperParser.RULE_incrementOrDecrementUnaryExpression); + let _localctx: IncrementOrDecrementUnaryExpressionContext = new IncrementOrDecrementUnaryExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 114, KipperParser.RULE_incrementOrDecrementUnaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 526; - this.incrementOrDecrementOperator(); - this.state = 527; - this.postfixExpression(); + this.state = 561; + this.incrementOrDecrementOperator(); + this.state = 562; + this.postfixExpression(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3153,27 +2881,26 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public operatorModifiedUnaryExpression(): OperatorModifiedUnaryExpressionContext { - let _localctx: OperatorModifiedUnaryExpressionContext = new OperatorModifiedUnaryExpressionContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 108, KipperParser.RULE_operatorModifiedUnaryExpression); + let _localctx: OperatorModifiedUnaryExpressionContext = new OperatorModifiedUnaryExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 116, KipperParser.RULE_operatorModifiedUnaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 529; - this.unaryOperator(); - this.state = 530; - this.postfixExpression(); + this.state = 564; + this.unaryOperator(); + this.state = 565; + this.postfixExpression(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3181,7 +2908,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3189,25 +2917,26 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public incrementOrDecrementOperator(): IncrementOrDecrementOperatorContext { let _localctx: IncrementOrDecrementOperatorContext = new IncrementOrDecrementOperatorContext(this._ctx, this.state); - this.enterRule(_localctx, 110, KipperParser.RULE_incrementOrDecrementOperator); + this.enterRule(_localctx, 118, KipperParser.RULE_incrementOrDecrementOperator); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 532; - _la = this._input.LA(1); - if (!(_la === KipperParser.PlusPlus || _la === KipperParser.MinusMinus)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 567; + _la = this._input.LA(1); + if (!(_la === KipperParser.PlusPlus || _la === KipperParser.MinusMinus)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3215,7 +2944,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3223,35 +2953,26 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public unaryOperator(): UnaryOperatorContext { let _localctx: UnaryOperatorContext = new UnaryOperatorContext(this._ctx, this.state); - this.enterRule(_localctx, 112, KipperParser.RULE_unaryOperator); + this.enterRule(_localctx, 120, KipperParser.RULE_unaryOperator); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 534; - _la = this._input.LA(1); - if ( - !( - ((_la - 42) & ~0x1f) === 0 && - ((1 << (_la - 42)) & - ((1 << (KipperParser.Plus - 42)) | - (1 << (KipperParser.Minus - 42)) | - (1 << (KipperParser.Not - 42)) | - (1 << (KipperParser.BitwiseNot - 42)))) !== - 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 569; + _la = this._input.LA(1); + if (!(((((_la - 42)) & ~0x1F) === 0 && ((1 << (_la - 42)) & ((1 << (KipperParser.Plus - 42)) | (1 << (KipperParser.Minus - 42)) | (1 << (KipperParser.Not - 42)) | (1 << (KipperParser.BitwiseNot - 42)))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3259,7 +2980,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3267,34 +2989,35 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public castOrConvertExpression(): CastOrConvertExpressionContext { let _localctx: CastOrConvertExpressionContext = new CastOrConvertExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 114, KipperParser.RULE_castOrConvertExpression); + this.enterRule(_localctx, 122, KipperParser.RULE_castOrConvertExpression); try { - this.state = 541; + this.state = 576; this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 46, this._ctx)) { - case 1: - _localctx = new PassOnCastOrConvertExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 536; - this.unaryExpression(); - } - break; + switch ( this.interpreter.adaptivePredict(this._input, 50, this._ctx) ) { + case 1: + _localctx = new PassOnCastOrConvertExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 571; + this.unaryExpression(); + } + break; - case 2: - _localctx = new ActualCastOrConvertExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 537; - this.unaryExpression(); - this.state = 538; - this.match(KipperParser.As); - this.state = 539; - this.typeSpecifierExpression(); - } - break; + case 2: + _localctx = new ActualCastOrConvertExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 572; + this.unaryExpression(); + this.state = 573; + this.match(KipperParser.As); + this.state = 574; + this.typeSpecifierExpression(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3302,7 +3025,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3320,74 +3044,63 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: MultiplicativeExpressionContext = new MultiplicativeExpressionContext(this._ctx, _parentState); let _prevctx: MultiplicativeExpressionContext = _localctx; - let _startState: number = 116; - this.enterRecursionRule(_localctx, 116, KipperParser.RULE_multiplicativeExpression, _p); + let _startState: number = 124; + this.enterRecursionRule(_localctx, 124, KipperParser.RULE_multiplicativeExpression, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnMultiplicativeExpressionContext(_localctx); - this._ctx = _localctx; + { + _localctx = new PassOnMultiplicativeExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 579; + this.castOrConvertExpression(); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 586; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } _prevctx = _localctx; + { + { + _localctx = new ActualMultiplicativeExpressionContext(new MultiplicativeExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_multiplicativeExpression); + this.state = 581; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 582; + _la = this._input.LA(1); + if (!(((((_la - 46)) & ~0x1F) === 0 && ((1 << (_la - 46)) & ((1 << (KipperParser.Star - 46)) | (1 << (KipperParser.Div - 46)) | (1 << (KipperParser.Mod - 46)) | (1 << (KipperParser.PowerTo - 46)))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this.state = 544; + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 583; this.castOrConvertExpression(); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 551; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 47, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualMultiplicativeExpressionContext( - new MultiplicativeExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_multiplicativeExpression); - this.state = 546; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 547; - _la = this._input.LA(1); - if ( - !( - ((_la - 46) & ~0x1f) === 0 && - ((1 << (_la - 46)) & - ((1 << (KipperParser.Star - 46)) | - (1 << (KipperParser.Div - 46)) | - (1 << (KipperParser.Mod - 46)) | - (1 << (KipperParser.PowerTo - 46)))) !== - 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 548; - this.castOrConvertExpression(); - } - } } - this.state = 553; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 47, this._ctx); + } } + this.state = 588; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3395,7 +3108,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3413,64 +3127,63 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: AdditiveExpressionContext = new AdditiveExpressionContext(this._ctx, _parentState); let _prevctx: AdditiveExpressionContext = _localctx; - let _startState: number = 118; - this.enterRecursionRule(_localctx, 118, KipperParser.RULE_additiveExpression, _p); + let _startState: number = 126; + this.enterRecursionRule(_localctx, 126, KipperParser.RULE_additiveExpression, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnAdditiveExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + { + _localctx = new PassOnAdditiveExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 555; - this.multiplicativeExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 562; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 48, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualAdditiveExpressionContext( - new AdditiveExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_additiveExpression); - this.state = 557; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 558; - _la = this._input.LA(1); - if (!(_la === KipperParser.Plus || _la === KipperParser.Minus)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 559; - this.multiplicativeExpression(0); - } + this.state = 590; + this.multiplicativeExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 597; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualAdditiveExpressionContext(new AdditiveExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_additiveExpression); + this.state = 592; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 593; + _la = this._input.LA(1); + if (!(_la === KipperParser.Plus || _la === KipperParser.Minus)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 594; + this.multiplicativeExpression(0); + } } - this.state = 564; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 48, this._ctx); } + this.state = 599; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3478,7 +3191,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3496,53 +3210,52 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: BitwiseShiftExpressionContext = new BitwiseShiftExpressionContext(this._ctx, _parentState); let _prevctx: BitwiseShiftExpressionContext = _localctx; - let _startState: number = 120; - this.enterRecursionRule(_localctx, 120, KipperParser.RULE_bitwiseShiftExpression, _p); + let _startState: number = 128; + this.enterRecursionRule(_localctx, 128, KipperParser.RULE_bitwiseShiftExpression, _p); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnBitwiseShiftExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + { + _localctx = new PassOnBitwiseShiftExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 566; - this.additiveExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 574; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 49, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualBitwiseShiftExpressionContext( - new BitwiseShiftExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseShiftExpression); - this.state = 568; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 569; - this.bitwiseShiftOperators(); - this.state = 570; - this.bitwiseAndExpression(0); - } - } + this.state = 601; + this.additiveExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 609; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 53, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualBitwiseShiftExpressionContext(new BitwiseShiftExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseShiftExpression); + this.state = 603; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 604; + this.bitwiseShiftOperators(); + this.state = 605; + this.bitwiseAndExpression(0); + } } - this.state = 576; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 49, this._ctx); } + this.state = 611; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 53, this._ctx); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3550,7 +3263,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3558,34 +3272,26 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public bitwiseShiftOperators(): BitwiseShiftOperatorsContext { let _localctx: BitwiseShiftOperatorsContext = new BitwiseShiftOperatorsContext(this._ctx, this.state); - this.enterRule(_localctx, 122, KipperParser.RULE_bitwiseShiftOperators); + this.enterRule(_localctx, 130, KipperParser.RULE_bitwiseShiftOperators); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 577; - _la = this._input.LA(1); - if ( - !( - ((_la - 69) & ~0x1f) === 0 && - ((1 << (_la - 69)) & - ((1 << (KipperParser.BitwiseZeroFillLeftShift - 69)) | - (1 << (KipperParser.BitwiseSignedRightShift - 69)) | - (1 << (KipperParser.BitwiseZeroFillRightShift - 69)))) !== - 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 612; + _la = this._input.LA(1); + if (!(((((_la - 69)) & ~0x1F) === 0 && ((1 << (_la - 69)) & ((1 << (KipperParser.BitwiseZeroFillLeftShift - 69)) | (1 << (KipperParser.BitwiseSignedRightShift - 69)) | (1 << (KipperParser.BitwiseZeroFillRightShift - 69)))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3593,7 +3299,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3611,74 +3318,63 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: RelationalExpressionContext = new RelationalExpressionContext(this._ctx, _parentState); let _prevctx: RelationalExpressionContext = _localctx; - let _startState: number = 124; - this.enterRecursionRule(_localctx, 124, KipperParser.RULE_relationalExpression, _p); + let _startState: number = 132; + this.enterRecursionRule(_localctx, 132, KipperParser.RULE_relationalExpression, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnRelationalExpressionContext(_localctx); - this._ctx = _localctx; + { + _localctx = new PassOnRelationalExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 615; + this.bitwiseShiftExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 622; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 54, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } _prevctx = _localctx; + { + { + _localctx = new ActualRelationalExpressionContext(new RelationalExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_relationalExpression); + this.state = 617; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 618; + _la = this._input.LA(1); + if (!(((((_la - 61)) & ~0x1F) === 0 && ((1 << (_la - 61)) & ((1 << (KipperParser.Less - 61)) | (1 << (KipperParser.LessEqual - 61)) | (1 << (KipperParser.Greater - 61)) | (1 << (KipperParser.GreaterEqual - 61)))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this.state = 580; + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 619; this.bitwiseShiftExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 587; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 50, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualRelationalExpressionContext( - new RelationalExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_relationalExpression); - this.state = 582; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 583; - _la = this._input.LA(1); - if ( - !( - ((_la - 61) & ~0x1f) === 0 && - ((1 << (_la - 61)) & - ((1 << (KipperParser.Less - 61)) | - (1 << (KipperParser.LessEqual - 61)) | - (1 << (KipperParser.Greater - 61)) | - (1 << (KipperParser.GreaterEqual - 61)))) !== - 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 584; - this.bitwiseShiftExpression(0); - } - } } - this.state = 589; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 50, this._ctx); + } } + this.state = 624; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 54, this._ctx); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3686,7 +3382,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3704,64 +3401,63 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: EqualityExpressionContext = new EqualityExpressionContext(this._ctx, _parentState); let _prevctx: EqualityExpressionContext = _localctx; - let _startState: number = 126; - this.enterRecursionRule(_localctx, 126, KipperParser.RULE_equalityExpression, _p); + let _startState: number = 134; + this.enterRecursionRule(_localctx, 134, KipperParser.RULE_equalityExpression, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnEqualityExpressionContext(_localctx); - this._ctx = _localctx; + { + _localctx = new PassOnEqualityExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 626; + this.relationalExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 633; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } _prevctx = _localctx; + { + { + _localctx = new ActualEqualityExpressionContext(new EqualityExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_equalityExpression); + this.state = 628; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 629; + _la = this._input.LA(1); + if (!(_la === KipperParser.Equal || _la === KipperParser.NotEqual)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this.state = 591; + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 630; this.relationalExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 598; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualEqualityExpressionContext( - new EqualityExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_equalityExpression); - this.state = 593; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 594; - _la = this._input.LA(1); - if (!(_la === KipperParser.Equal || _la === KipperParser.NotEqual)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 595; - this.relationalExpression(0); - } - } } - this.state = 600; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); + } } + this.state = 635; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3769,7 +3465,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3787,53 +3484,52 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: BitwiseAndExpressionContext = new BitwiseAndExpressionContext(this._ctx, _parentState); let _prevctx: BitwiseAndExpressionContext = _localctx; - let _startState: number = 128; - this.enterRecursionRule(_localctx, 128, KipperParser.RULE_bitwiseAndExpression, _p); + let _startState: number = 136; + this.enterRecursionRule(_localctx, 136, KipperParser.RULE_bitwiseAndExpression, _p); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnBitwiseAndExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + { + _localctx = new PassOnBitwiseAndExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 602; + this.state = 637; + this.equalityExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 644; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 56, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualBitwiseAndExpressionContext(new BitwiseAndExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseAndExpression); + this.state = 639; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 640; + this.match(KipperParser.BitwiseAnd); + this.state = 641; this.equalityExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 609; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualBitwiseAndExpressionContext( - new BitwiseAndExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseAndExpression); - this.state = 604; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 605; - this.match(KipperParser.BitwiseAnd); - this.state = 606; - this.equalityExpression(0); - } - } } - this.state = 611; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); + } } + this.state = 646; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 56, this._ctx); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3841,7 +3537,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3859,53 +3556,52 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: BitwiseXorExpressionContext = new BitwiseXorExpressionContext(this._ctx, _parentState); let _prevctx: BitwiseXorExpressionContext = _localctx; - let _startState: number = 130; - this.enterRecursionRule(_localctx, 130, KipperParser.RULE_bitwiseXorExpression, _p); + let _startState: number = 138; + this.enterRecursionRule(_localctx, 138, KipperParser.RULE_bitwiseXorExpression, _p); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnBitwiseXorExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + { + _localctx = new PassOnBitwiseXorExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 613; + this.state = 648; + this.bitwiseAndExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 655; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 57, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualBitwiseXorExpressionContext(new BitwiseXorExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseXorExpression); + this.state = 650; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 651; + this.match(KipperParser.BitwiseXor); + this.state = 652; this.bitwiseAndExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 620; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 53, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualBitwiseXorExpressionContext( - new BitwiseXorExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseXorExpression); - this.state = 615; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 616; - this.match(KipperParser.BitwiseXor); - this.state = 617; - this.bitwiseAndExpression(0); - } - } } - this.state = 622; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 53, this._ctx); + } } + this.state = 657; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 57, this._ctx); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3913,7 +3609,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3931,53 +3628,52 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: BitwiseOrExpressionContext = new BitwiseOrExpressionContext(this._ctx, _parentState); let _prevctx: BitwiseOrExpressionContext = _localctx; - let _startState: number = 132; - this.enterRecursionRule(_localctx, 132, KipperParser.RULE_bitwiseOrExpression, _p); + let _startState: number = 140; + this.enterRecursionRule(_localctx, 140, KipperParser.RULE_bitwiseOrExpression, _p); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnBitwiseOrExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + { + _localctx = new PassOnBitwiseOrExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 624; + this.state = 659; + this.bitwiseXorExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 666; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 58, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualBitwiseOrExpressionContext(new BitwiseOrExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseOrExpression); + this.state = 661; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 662; + this.match(KipperParser.BitwiseOr); + this.state = 663; this.bitwiseXorExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 631; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 54, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualBitwiseOrExpressionContext( - new BitwiseOrExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseOrExpression); - this.state = 626; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 627; - this.match(KipperParser.BitwiseOr); - this.state = 628; - this.bitwiseXorExpression(0); - } - } } - this.state = 633; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 54, this._ctx); + } } + this.state = 668; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 58, this._ctx); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3985,7 +3681,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -4003,53 +3700,52 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: LogicalAndExpressionContext = new LogicalAndExpressionContext(this._ctx, _parentState); let _prevctx: LogicalAndExpressionContext = _localctx; - let _startState: number = 134; - this.enterRecursionRule(_localctx, 134, KipperParser.RULE_logicalAndExpression, _p); + let _startState: number = 142; + this.enterRecursionRule(_localctx, 142, KipperParser.RULE_logicalAndExpression, _p); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnLogicalAndExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + { + _localctx = new PassOnLogicalAndExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 635; + this.state = 670; + this.bitwiseOrExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 677; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 59, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualLogicalAndExpressionContext(new LogicalAndExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalAndExpression); + this.state = 672; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 673; + this.match(KipperParser.AndAnd); + this.state = 674; this.bitwiseOrExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 642; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualLogicalAndExpressionContext( - new LogicalAndExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalAndExpression); - this.state = 637; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 638; - this.match(KipperParser.AndAnd); - this.state = 639; - this.bitwiseOrExpression(0); - } - } } - this.state = 644; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); + } } + this.state = 679; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 59, this._ctx); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4057,7 +3753,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -4075,53 +3772,52 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: LogicalOrExpressionContext = new LogicalOrExpressionContext(this._ctx, _parentState); let _prevctx: LogicalOrExpressionContext = _localctx; - let _startState: number = 136; - this.enterRecursionRule(_localctx, 136, KipperParser.RULE_logicalOrExpression, _p); + let _startState: number = 144; + this.enterRecursionRule(_localctx, 144, KipperParser.RULE_logicalOrExpression, _p); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnLogicalOrExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + { + _localctx = new PassOnLogicalOrExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 646; + this.state = 681; + this.logicalAndExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 688; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 60, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualLogicalOrExpressionContext(new LogicalOrExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalOrExpression); + this.state = 683; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 684; + this.match(KipperParser.OrOr); + this.state = 685; this.logicalAndExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 653; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 56, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualLogicalOrExpressionContext( - new LogicalOrExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalOrExpression); - this.state = 648; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 649; - this.match(KipperParser.OrOr); - this.state = 650; - this.logicalAndExpression(0); - } - } } - this.state = 655; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 56, this._ctx); + } } + this.state = 690; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 60, this._ctx); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4129,46 +3825,48 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; } // @RuleVersion(0) public conditionalExpression(): ConditionalExpressionContext { - let _localctx: ConditionalExpressionContext = new ConditionalExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 138, KipperParser.RULE_conditionalExpression); - try { - this.state = 663; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 57, this._ctx)) { - case 1: - _localctx = new PassOnConditionalExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 656; - this.logicalOrExpression(0); - } - break; + let _localctx: ConditionalExpressionContext = new ConditionalExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 146, KipperParser.RULE_conditionalExpression); + try { + this.state = 698; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 61, this._ctx) ) { + case 1: + _localctx = new PassOnConditionalExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 691; + this.logicalOrExpression(0); + } + break; - case 2: - _localctx = new ActualConditionalExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 657; - this.logicalOrExpression(0); - this.state = 658; - this.match(KipperParser.QuestionMark); - this.state = 659; - this.conditionalExpression(); - this.state = 660; - this.match(KipperParser.Colon); - this.state = 661; - this.conditionalExpression(); - } - break; + case 2: + _localctx = new ActualConditionalExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 692; + this.logicalOrExpression(0); + this.state = 693; + this.match(KipperParser.QuestionMark); + this.state = 694; + this.conditionalExpression(); + this.state = 695; + this.match(KipperParser.Colon); + this.state = 696; + this.conditionalExpression(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4176,7 +3874,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -4184,34 +3883,35 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public assignmentExpression(): AssignmentExpressionContext { let _localctx: AssignmentExpressionContext = new AssignmentExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 140, KipperParser.RULE_assignmentExpression); + this.enterRule(_localctx, 148, KipperParser.RULE_assignmentExpression); try { - this.state = 670; + this.state = 705; this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 58, this._ctx)) { - case 1: - _localctx = new PassOnAssignmentExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 665; - this.conditionalExpression(); - } - break; + switch ( this.interpreter.adaptivePredict(this._input, 62, this._ctx) ) { + case 1: + _localctx = new PassOnAssignmentExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 700; + this.conditionalExpression(); + } + break; - case 2: - _localctx = new ActualAssignmentExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 666; - this.computedPrimaryExpression(0); - this.state = 667; - this.assignmentOperator(); - this.state = 668; - this.assignmentExpression(); - } - break; + case 2: + _localctx = new ActualAssignmentExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 701; + this.computedPrimaryExpression(0); + this.state = 702; + this.assignmentOperator(); + this.state = 703; + this.assignmentExpression(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4219,7 +3919,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -4227,37 +3928,26 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public assignmentOperator(): AssignmentOperatorContext { let _localctx: AssignmentOperatorContext = new AssignmentOperatorContext(this._ctx, this.state); - this.enterRule(_localctx, 142, KipperParser.RULE_assignmentOperator); + this.enterRule(_localctx, 150, KipperParser.RULE_assignmentOperator); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 672; - _la = this._input.LA(1); - if ( - !( - ((_la - 53) & ~0x1f) === 0 && - ((1 << (_la - 53)) & - ((1 << (KipperParser.Assign - 53)) | - (1 << (KipperParser.PlusAssign - 53)) | - (1 << (KipperParser.MinusAssign - 53)) | - (1 << (KipperParser.StarAssign - 53)) | - (1 << (KipperParser.DivAssign - 53)) | - (1 << (KipperParser.ModAssign - 53)))) !== - 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 707; + _la = this._input.LA(1); + if (!(((((_la - 53)) & ~0x1F) === 0 && ((1 << (_la - 53)) & ((1 << (KipperParser.Assign - 53)) | (1 << (KipperParser.PlusAssign - 53)) | (1 << (KipperParser.MinusAssign - 53)) | (1 << (KipperParser.StarAssign - 53)) | (1 << (KipperParser.DivAssign - 53)) | (1 << (KipperParser.ModAssign - 53)))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4265,7 +3955,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -4273,33 +3964,34 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public expression(): ExpressionContext { let _localctx: ExpressionContext = new ExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 144, KipperParser.RULE_expression); + this.enterRule(_localctx, 152, KipperParser.RULE_expression); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 674; - this.assignmentExpression(); - this.state = 679; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 59, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 675; - this.match(KipperParser.Comma); - this.state = 676; - this.assignmentExpression(); - } - } + this.state = 709; + this.assignmentExpression(); + this.state = 714; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 63, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 710; + this.match(KipperParser.Comma); + this.state = 711; + this.assignmentExpression(); + } } - this.state = 681; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 59, this._ctx); } + this.state = 716; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 63, this._ctx); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4307,7 +3999,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -4315,36 +4008,37 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public typeSpecifierExpression(): TypeSpecifierExpressionContext { let _localctx: TypeSpecifierExpressionContext = new TypeSpecifierExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 146, KipperParser.RULE_typeSpecifierExpression); + this.enterRule(_localctx, 154, KipperParser.RULE_typeSpecifierExpression); try { - this.state = 685; + this.state = 720; this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 60, this._ctx)) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 682; - this.identifierTypeSpecifierExpression(); - } - break; + switch ( this.interpreter.adaptivePredict(this._input, 64, this._ctx) ) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 717; + this.identifierTypeSpecifierExpression(); + } + break; - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 683; - this.genericTypeSpecifierExpression(); - } - break; + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 718; + this.genericTypeSpecifierExpression(); + } + break; - case 3: - this.enterOuterAlt(_localctx, 3); - { - this.state = 684; - this.typeofTypeSpecifierExpression(); - } - break; + case 3: + this.enterOuterAlt(_localctx, 3); + { + this.state = 719; + this.typeofTypeSpecifierExpression(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4352,25 +4046,24 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public identifierTypeSpecifierExpression(): IdentifierTypeSpecifierExpressionContext { - let _localctx: IdentifierTypeSpecifierExpressionContext = new IdentifierTypeSpecifierExpressionContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 148, KipperParser.RULE_identifierTypeSpecifierExpression); + let _localctx: IdentifierTypeSpecifierExpressionContext = new IdentifierTypeSpecifierExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 156, KipperParser.RULE_identifierTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 687; - this.typeSpecifierIdentifier(); + this.state = 722; + this.typeSpecifierIdentifier(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4378,31 +4071,30 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public genericTypeSpecifierExpression(): GenericTypeSpecifierExpressionContext { - let _localctx: GenericTypeSpecifierExpressionContext = new GenericTypeSpecifierExpressionContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 150, KipperParser.RULE_genericTypeSpecifierExpression); + let _localctx: GenericTypeSpecifierExpressionContext = new GenericTypeSpecifierExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 158, KipperParser.RULE_genericTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 689; - this.typeSpecifierIdentifier(); - this.state = 690; - this.match(KipperParser.Less); - this.state = 691; - this.typeSpecifierIdentifier(); - this.state = 692; - this.match(KipperParser.Greater); + this.state = 724; + this.typeSpecifierIdentifier(); + this.state = 725; + this.match(KipperParser.Less); + this.state = 726; + this.typeSpecifierIdentifier(); + this.state = 727; + this.match(KipperParser.Greater); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4410,31 +4102,30 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public typeofTypeSpecifierExpression(): TypeofTypeSpecifierExpressionContext { - let _localctx: TypeofTypeSpecifierExpressionContext = new TypeofTypeSpecifierExpressionContext( - this._ctx, - this.state, - ); - this.enterRule(_localctx, 152, KipperParser.RULE_typeofTypeSpecifierExpression); + let _localctx: TypeofTypeSpecifierExpressionContext = new TypeofTypeSpecifierExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 160, KipperParser.RULE_typeofTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 694; - this.match(KipperParser.Typeof); - this.state = 695; - this.match(KipperParser.LeftParen); - this.state = 696; - this.typeSpecifierIdentifier(); - this.state = 697; - this.match(KipperParser.RightParen); + this.state = 729; + this.match(KipperParser.Typeof); + this.state = 730; + this.match(KipperParser.LeftParen); + this.state = 731; + this.typeSpecifierIdentifier(); + this.state = 732; + this.match(KipperParser.RightParen); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4442,7 +4133,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -4450,32 +4142,26 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext { let _localctx: TypeSpecifierIdentifierContext = new TypeSpecifierIdentifierContext(this._ctx, this.state); - this.enterRule(_localctx, 154, KipperParser.RULE_typeSpecifierIdentifier); + this.enterRule(_localctx, 162, KipperParser.RULE_typeSpecifierIdentifier); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 699; - _la = this._input.LA(1); - if ( - !( - ((_la & ~0x1f) === 0 && - ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== - 0) || - _la === KipperParser.Identifier - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 734; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0) || _la === KipperParser.Identifier)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4483,7 +4169,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -4491,471 +4178,491 @@ export class KipperParser extends KipperParserBase { public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { switch (ruleIndex) { - case 18: - return this.compoundStatement_sempred(_localctx as CompoundStatementContext, predIndex); + case 22: + return this.compoundStatement_sempred(_localctx as CompoundStatementContext, predIndex); - case 45: - return this.computedPrimaryExpression_sempred(_localctx as ComputedPrimaryExpressionContext, predIndex); + case 49: + return this.computedPrimaryExpression_sempred(_localctx as ComputedPrimaryExpressionContext, predIndex); - case 58: - return this.multiplicativeExpression_sempred(_localctx as MultiplicativeExpressionContext, predIndex); + case 62: + return this.multiplicativeExpression_sempred(_localctx as MultiplicativeExpressionContext, predIndex); - case 59: - return this.additiveExpression_sempred(_localctx as AdditiveExpressionContext, predIndex); + case 63: + return this.additiveExpression_sempred(_localctx as AdditiveExpressionContext, predIndex); - case 60: - return this.bitwiseShiftExpression_sempred(_localctx as BitwiseShiftExpressionContext, predIndex); + case 64: + return this.bitwiseShiftExpression_sempred(_localctx as BitwiseShiftExpressionContext, predIndex); - case 62: - return this.relationalExpression_sempred(_localctx as RelationalExpressionContext, predIndex); + case 66: + return this.relationalExpression_sempred(_localctx as RelationalExpressionContext, predIndex); - case 63: - return this.equalityExpression_sempred(_localctx as EqualityExpressionContext, predIndex); + case 67: + return this.equalityExpression_sempred(_localctx as EqualityExpressionContext, predIndex); - case 64: - return this.bitwiseAndExpression_sempred(_localctx as BitwiseAndExpressionContext, predIndex); + case 68: + return this.bitwiseAndExpression_sempred(_localctx as BitwiseAndExpressionContext, predIndex); - case 65: - return this.bitwiseXorExpression_sempred(_localctx as BitwiseXorExpressionContext, predIndex); + case 69: + return this.bitwiseXorExpression_sempred(_localctx as BitwiseXorExpressionContext, predIndex); - case 66: - return this.bitwiseOrExpression_sempred(_localctx as BitwiseOrExpressionContext, predIndex); + case 70: + return this.bitwiseOrExpression_sempred(_localctx as BitwiseOrExpressionContext, predIndex); - case 67: - return this.logicalAndExpression_sempred(_localctx as LogicalAndExpressionContext, predIndex); + case 71: + return this.logicalAndExpression_sempred(_localctx as LogicalAndExpressionContext, predIndex); - case 68: - return this.logicalOrExpression_sempred(_localctx as LogicalOrExpressionContext, predIndex); + case 72: + return this.logicalOrExpression_sempred(_localctx as LogicalOrExpressionContext, predIndex); } return true; } private compoundStatement_sempred(_localctx: CompoundStatementContext, predIndex: number): boolean { switch (predIndex) { - case 0: - return this.notInsideExpressionStatement(); + case 0: + return this.notInsideExpressionStatement(); } return true; } private computedPrimaryExpression_sempred(_localctx: ComputedPrimaryExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 1: - return this.precpred(this._ctx, 5); + case 1: + return this.precpred(this._ctx, 5); - case 2: - return this.precpred(this._ctx, 3); + case 2: + return this.precpred(this._ctx, 3); - case 3: - return this.precpred(this._ctx, 2); + case 3: + return this.precpred(this._ctx, 2); - case 4: - return this.precpred(this._ctx, 1); + case 4: + return this.precpred(this._ctx, 1); } return true; } private multiplicativeExpression_sempred(_localctx: MultiplicativeExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 5: - return this.precpred(this._ctx, 1); + case 5: + return this.precpred(this._ctx, 1); } return true; } private additiveExpression_sempred(_localctx: AdditiveExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 6: - return this.precpred(this._ctx, 1); + case 6: + return this.precpred(this._ctx, 1); } return true; } private bitwiseShiftExpression_sempred(_localctx: BitwiseShiftExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 7: - return this.precpred(this._ctx, 1); + case 7: + return this.precpred(this._ctx, 1); } return true; } private relationalExpression_sempred(_localctx: RelationalExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 8: - return this.precpred(this._ctx, 1); + case 8: + return this.precpred(this._ctx, 1); } return true; } private equalityExpression_sempred(_localctx: EqualityExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 9: - return this.precpred(this._ctx, 1); + case 9: + return this.precpred(this._ctx, 1); } return true; } private bitwiseAndExpression_sempred(_localctx: BitwiseAndExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 10: - return this.precpred(this._ctx, 1); + case 10: + return this.precpred(this._ctx, 1); } return true; } private bitwiseXorExpression_sempred(_localctx: BitwiseXorExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 11: - return this.precpred(this._ctx, 1); + case 11: + return this.precpred(this._ctx, 1); } return true; } private bitwiseOrExpression_sempred(_localctx: BitwiseOrExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 12: - return this.precpred(this._ctx, 1); + case 12: + return this.precpred(this._ctx, 1); } return true; } private logicalAndExpression_sempred(_localctx: LogicalAndExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 13: - return this.precpred(this._ctx, 1); + case 13: + return this.precpred(this._ctx, 1); } return true; } private logicalOrExpression_sempred(_localctx: LogicalOrExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 14: - return this.precpred(this._ctx, 1); + case 14: + return this.precpred(this._ctx, 1); } return true; } private static readonly _serializedATNSegments: number = 2; private static readonly _serializedATNSegment0: string = - "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03W\u02C0\x04\x02" + + "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03W\u02E3\x04\x02" + "\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07" + "\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r\t\r\x04" + "\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t\x12\x04" + "\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17\t\x17\x04" + "\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B\x04\x1C\t\x1C\x04" + - '\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04"\t"\x04#' + - "\t#\x04$\t$\x04%\t%\x04&\t&\x04'\t'\x04(\t(\x04)\t)\x04*\t*\x04+\t+" + + "\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04\"\t\"\x04#" + + "\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(\x04)\t)\x04*\t*\x04+\t+" + "\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x040\t0\x041\t1\x042\t2\x043\t3\x044" + "\t4\x045\t5\x046\t6\x047\t7\x048\t8\x049\t9\x04:\t:\x04;\t;\x04<\t<\x04" + "=\t=\x04>\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\x03\x02\x05\x02\xA0\n\x02\x03\x02\x03\x02\x03\x03\x06\x03\xA5\n\x03" + - "\r\x03\x0E\x03\xA6\x03\x04\x03\x04\x03\x05\x06\x05\xAC\n\x05\r\x05\x0E" + - "\x05\xAD\x03\x06\x03\x06\x03\x06\x05\x06\xB3\n\x06\x03\x07\x03\x07\x03" + - "\x07\x03\x07\x03\x07\x03\x07\x05\x07\xBB\n\x07\x03\b\x03\b\x03\b\x03\t" + - "\x03\t\x03\n\x03\n\x03\n\x03\n\x03\n\x05\n\xC7\n\n\x03\v\x03\v\x03\f\x03" + - "\f\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0E\x03\x0E\x05\x0E\xD3\n\x0E\x03\x0E" + - "\x03\x0E\x03\x0E\x03\x0E\x05\x0E\xD9\n\x0E\x03\x0F\x03\x0F\x03\x0F\x07" + - "\x0F\xDE\n\x0F\f\x0F\x0E\x0F\xE1\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\xF7\n" + - "\x13\x03\x14\x03\x14\x03\x14\x05\x14\xFC\n\x14\x03\x14\x03\x14\x03\x15" + - "\x03\x15\x03\x15\x03\x15\x03\x15\x03\x16\x03\x16\x05\x16\u0107\n\x16\x03" + - "\x17\x03\x17\x03\x17\x03\x17\x03\x17\x03\x17\x03\x17\x05\x17\u0110\n\x17" + - "\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x07\x18\u0118\n\x18\f" + - "\x18\x0E\x18\u011B\v\x18\x03\x18\x03\x18\x03\x19\x03\x19\x03\x19\x03\x19" + - "\x03\x19\x03\x19\x03\x19\x03\x19\x05\x19\u0127\n\x19\x03\x1A\x03\x1A\x03" + - "\x1A\x05\x1A\u012C\n\x1A\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x05\x1B\u0132" + - "\n\x1B\x03\x1B\x03\x1B\x05\x1B\u0136\n\x1B\x03\x1B\x03\x1B\x03\x1B\x03" + - "\x1B\x05\x1B\u013C\n\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x05\x1B\u0142" + - "\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\u015A\n\x1F\x03\x1F\x03" + - "\x1F\x03 \x03 \x03 \x03 \x03 \x03 \x03 \x03 \x03 \x05 \u0167\n \x03!\x03" + - '!\x03!\x03!\x03"\x03"\x03#\x03#\x03$\x03$\x03%\x03%\x05%\u0175\n%\x03' + - "&\x03&\x03'\x03'\x07'\u017B\n'\f'\x0E'\u017E\v'\x03'\x03'\x03" + - "'\x07'\u0183\n'\f'\x0E'\u0186\v'\x03'\x05'\u0189\n'\x03(\x03" + - "(\x03(\x05(\u018E\n(\x03(\x05(\u0191\n(\x03)\x03)\x03)\x05)\u0196\n)\x03" + - ")\x05)\u0199\n)\x03*\x03*\x03+\x03+\x03+\x03+\x07+\u01A1\n+\f+\x0E+\u01A4" + - "\v+\x05+\u01A6\n+\x03+\x05+\u01A9\n+\x03+\x03+\x03,\x03,\x03,\x03,\x07" + - ",\u01B1\n,\f,\x0E,\u01B4\v,\x05,\u01B6\n,\x03,\x05,\u01B9\n,\x03,\x03" + - ",\x03-\x03-\x03-\x03-\x03.\x03.\x03/\x03/\x03/\x03/\x03/\x03/\x05/\u01C9" + - "\n/\x03/\x03/\x03/\x05/\u01CE\n/\x03/\x03/\x03/\x05/\u01D3\n/\x03/\x03" + - "/\x03/\x03/\x03/\x03/\x03/\x03/\x03/\x03/\x03/\x03/\x03/\x03/\x07/\u01E3" + - "\n/\f/\x0E/\u01E6\v/\x030\x030\x030\x070\u01EB\n0\f0\x0E0\u01EE\v0\x03" + - "1\x031\x031\x032\x032\x032\x032\x033\x033\x033\x033\x053\u01FB\n3\x03" + - "3\x033\x033\x033\x053\u0201\n3\x033\x033\x034\x034\x054\u0207\n4\x035" + - "\x035\x035\x036\x036\x036\x056\u020F\n6\x037\x037\x037\x038\x038\x038" + - "\x039\x039\x03:\x03:\x03;\x03;\x03;\x03;\x03;\x05;\u0220\n;\x03<\x03<" + - "\x03<\x03<\x03<\x03<\x07<\u0228\n<\f<\x0E<\u022B\v<\x03=\x03=\x03=\x03" + - "=\x03=\x03=\x07=\u0233\n=\f=\x0E=\u0236\v=\x03>\x03>\x03>\x03>\x03>\x03" + - ">\x03>\x07>\u023F\n>\f>\x0E>\u0242\v>\x03?\x03?\x03@\x03@\x03@\x03@\x03" + - "@\x03@\x07@\u024C\n@\f@\x0E@\u024F\v@\x03A\x03A\x03A\x03A\x03A\x03A\x07" + - "A\u0257\nA\fA\x0EA\u025A\vA\x03B\x03B\x03B\x03B\x03B\x03B\x07B\u0262\n" + - "B\fB\x0EB\u0265\vB\x03C\x03C\x03C\x03C\x03C\x03C\x07C\u026D\nC\fC\x0E" + - "C\u0270\vC\x03D\x03D\x03D\x03D\x03D\x03D\x07D\u0278\nD\fD\x0ED\u027B\v" + - "D\x03E\x03E\x03E\x03E\x03E\x03E\x07E\u0283\nE\fE\x0EE\u0286\vE\x03F\x03" + - "F\x03F\x03F\x03F\x03F\x07F\u028E\nF\fF\x0EF\u0291\vF\x03G\x03G\x03G\x03" + - "G\x03G\x03G\x03G\x05G\u029A\nG\x03H\x03H\x03H\x03H\x03H\x05H\u02A1\nH" + - "\x03I\x03I\x03J\x03J\x03J\x07J\u02A8\nJ\fJ\x0EJ\u02AB\vJ\x03K\x03K\x03" + - "K\x05K\u02B0\nK\x03L\x03L\x03M\x03M\x03M\x03M\x03M\x03N\x03N\x03N\x03" + - "N\x03N\x03O\x03O\x03O\x02\x02\r\\vxz~\x80\x82\x84\x86\x88\x8AP\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\x028\x02:\x02<\x02>\x02@\x02B\x02D\x02F\x02H\x02" + - "J\x02L\x02N\x02P\x02R\x02T\x02V\x02X\x02Z\x02\\\x02^\x02`\x02b\x02d\x02" + - "f\x02h\x02j\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\x02\x11\x03\x02\x06\x07\x03" + - "\x02\r\x0E\x03\x02\x1B\x1C\x03\x02MN\x04\x02LLOO\x03\x02\x1E \x04\x02" + - "--//\x06\x02,,..66FF\x03\x0203\x04\x02,,..\x03\x02GI\x03\x02?B\x03\x02" + - "=>\x03\x027<\x04\x02\x1E KK\x02\u02C1\x02\x9F\x03\x02\x02\x02\x04\xA4" + - "\x03\x02\x02\x02\x06\xA8\x03\x02\x02\x02\b\xAB\x03\x02\x02\x02\n\xB2\x03" + - "\x02\x02\x02\f\xBA\x03\x02\x02\x02\x0E\xBC\x03\x02\x02\x02\x10\xBF\x03" + - "\x02\x02\x02\x12\xC1\x03\x02\x02\x02\x14\xC8\x03\x02\x02\x02\x16\xCA\x03" + - "\x02\x02\x02\x18\xCC\x03\x02\x02\x02\x1A\xCE\x03\x02\x02\x02\x1C\xDA\x03" + - '\x02\x02\x02\x1E\xE2\x03\x02\x02\x02 \xE6\x03\x02\x02\x02"\xEB\x03\x02' + - "\x02\x02$\xF6\x03\x02\x02\x02&\xF8\x03\x02\x02\x02(\xFF\x03\x02\x02\x02" + - "*\u0106\x03\x02\x02\x02,\u0108\x03\x02\x02\x02.\u0111\x03\x02\x02\x02" + - "0\u0126\x03\x02\x02\x022\u012B\x03\x02\x02\x024\u012D\x03\x02\x02\x02" + - "6\u0146\x03\x02\x02\x028\u014C\x03\x02\x02\x02:\u0154\x03\x02\x02\x02" + - "<\u0157\x03\x02\x02\x02>\u0166\x03\x02\x02\x02@\u0168\x03\x02\x02\x02" + - "B\u016C\x03\x02\x02\x02D\u016E\x03\x02\x02\x02F\u0170\x03\x02\x02\x02" + - "H\u0174\x03\x02\x02\x02J\u0176\x03\x02\x02\x02L\u0188\x03\x02\x02\x02" + - "N\u0190\x03\x02\x02\x02P\u0198\x03\x02\x02\x02R\u019A\x03\x02\x02\x02" + - "T\u019C\x03\x02\x02\x02V\u01AC\x03\x02\x02\x02X\u01BC\x03\x02\x02\x02" + - "Z\u01C0\x03\x02\x02\x02\\\u01CD\x03\x02\x02\x02^\u01E7\x03\x02\x02\x02" + - "`\u01EF\x03\x02\x02\x02b\u01F2\x03\x02\x02\x02d\u01F6\x03\x02\x02\x02" + - "f\u0206\x03\x02\x02\x02h\u0208\x03\x02\x02\x02j\u020E\x03\x02\x02\x02" + - "l\u0210\x03\x02\x02\x02n\u0213\x03\x02\x02\x02p\u0216\x03\x02\x02\x02" + - "r\u0218\x03\x02\x02\x02t\u021F\x03\x02\x02\x02v\u0221\x03\x02\x02\x02" + - "x\u022C\x03\x02\x02\x02z\u0237\x03\x02\x02\x02|\u0243\x03\x02\x02\x02" + - "~\u0245\x03\x02\x02\x02\x80\u0250\x03\x02\x02\x02\x82\u025B\x03\x02\x02" + - "\x02\x84\u0266\x03\x02\x02\x02\x86\u0271\x03\x02\x02\x02\x88\u027C\x03" + - "\x02\x02\x02\x8A\u0287\x03\x02\x02\x02\x8C\u0299\x03\x02\x02\x02\x8E\u02A0" + - "\x03\x02\x02\x02\x90\u02A2\x03\x02\x02\x02\x92\u02A4\x03\x02\x02\x02\x94" + - "\u02AF\x03\x02\x02\x02\x96\u02B1\x03\x02\x02\x02\x98\u02B3\x03\x02\x02" + - "\x02\x9A\u02B8\x03\x02\x02\x02\x9C\u02BD\x03\x02\x02\x02\x9E\xA0\x05\x04" + - "\x03\x02\x9F\x9E\x03\x02\x02\x02\x9F\xA0\x03\x02\x02\x02\xA0\xA1\x03\x02" + - "\x02\x02\xA1\xA2\x07\x02\x02\x03\xA2\x03\x03\x02\x02\x02\xA3\xA5\x05\x06" + - "\x04\x02\xA4\xA3\x03\x02\x02\x02\xA5\xA6\x03\x02\x02\x02\xA6\xA4\x03\x02" + - "\x02\x02\xA6\xA7\x03\x02\x02\x02\xA7\x05\x03\x02\x02\x02\xA8\xA9\x05\b" + - "\x05\x02\xA9\x07\x03\x02\x02\x02\xAA\xAC\x05\n\x06\x02\xAB\xAA\x03\x02" + - "\x02\x02\xAC\xAD\x03\x02\x02\x02\xAD\xAB\x03\x02\x02\x02\xAD\xAE\x03\x02" + - "\x02\x02\xAE\t\x03\x02\x02\x02\xAF\xB3\x05$\x13\x02\xB0\xB3\x05\f\x07" + - '\x02\xB1\xB3\x07"\x02\x02\xB2\xAF\x03\x02\x02\x02\xB2\xB0\x03\x02\x02' + - "\x02\xB2\xB1\x03\x02\x02\x02\xB3\v\x03\x02\x02\x02\xB4\xB5\x05\x0E\b\x02" + - '\xB5\xB6\x07"\x02\x02\xB6\xBB\x03\x02\x02\x02\xB7\xBB\x05\x1A\x0E\x02' + - '\xB8\xBB\x05 \x11\x02\xB9\xBB\x05"\x12\x02\xBA\xB4\x03\x02\x02\x02\xBA' + + "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\x05\x11" + + "\xF3\n\x11\x03\x11\x03\x11\x03\x12\x06\x12\xF8\n\x12\r\x12\x0E\x12\xF9" + + "\x03\x13\x03\x13\x05\x13\xFE\n\x13\x03\x14\x03\x14\x03\x14\x03\x14\x03" + + "\x14\x03\x15\x03\x15\x03\x15\x05\x15\u0108\n\x15\x03\x15\x03\x15\x03\x15" + + "\x03\x15\x03\x15\x03\x16\x03\x16\x03\x16\x03\x16\x03\x16\x03\x17\x03\x17" + + "\x03\x17\x03\x17\x03\x17\x03\x17\x05\x17\u011A\n\x17\x03\x18\x03\x18\x03" + + "\x18\x05\x18\u011F\n\x18\x03\x18\x03\x18\x03\x19\x03\x19\x03\x19\x03\x19" + + "\x03\x19\x03\x1A\x03\x1A\x05\x1A\u012A\n\x1A\x03\x1B\x03\x1B\x03\x1B\x03" + + "\x1B\x03\x1B\x03\x1B\x03\x1B\x05\x1B\u0133\n\x1B\x03\x1C\x03\x1C\x03\x1C" + + "\x03\x1C\x03\x1C\x03\x1C\x07\x1C\u013B\n\x1C\f\x1C\x0E\x1C\u013E\v\x1C" + + "\x03\x1C\x03\x1C\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D" + + "\x03\x1D\x05\x1D\u014A\n\x1D\x03\x1E\x03\x1E\x03\x1E\x05\x1E\u014F\n\x1E" + + "\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x05\x1F\u0155\n\x1F\x03\x1F\x03\x1F\x05" + + "\x1F\u0159\n\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x05\x1F\u015F\n\x1F\x03" + + "\x1F\x03\x1F\x03\x1F\x03\x1F\x05\x1F\u0165\n\x1F\x03\x1F\x03\x1F\x03\x1F" + + "\x03 \x03 \x03 \x03 \x03 \x03 \x03!\x03!\x03!\x03!\x03!\x03!\x03!\x03" + + "!\x03\"\x03\"\x03\"\x03#\x03#\x05#\u017D\n#\x03#\x03#\x03$\x03$\x03$\x03" + + "$\x03$\x03$\x03$\x03$\x03$\x05$\u018A\n$\x03%\x03%\x03%\x03%\x03&\x03" + + "&\x03\'\x03\'\x03(\x03(\x03)\x03)\x05)\u0198\n)\x03*\x03*\x03+\x03+\x07" + + "+\u019E\n+\f+\x0E+\u01A1\v+\x03+\x03+\x03+\x07+\u01A6\n+\f+\x0E+\u01A9" + + "\v+\x03+\x05+\u01AC\n+\x03,\x03,\x03,\x05,\u01B1\n,\x03,\x05,\u01B4\n" + + ",\x03-\x03-\x03-\x05-\u01B9\n-\x03-\x05-\u01BC\n-\x03.\x03.\x03/\x03/" + + "\x03/\x03/\x07/\u01C4\n/\f/\x0E/\u01C7\v/\x05/\u01C9\n/\x03/\x05/\u01CC" + + "\n/\x03/\x03/\x030\x030\x030\x030\x070\u01D4\n0\f0\x0E0\u01D7\v0\x050" + + "\u01D9\n0\x030\x050\u01DC\n0\x030\x030\x031\x031\x031\x031\x032\x032\x03" + + "3\x033\x033\x033\x033\x033\x053\u01EC\n3\x033\x033\x033\x053\u01F1\n3" + + "\x033\x033\x033\x053\u01F6\n3\x033\x033\x033\x033\x033\x033\x033\x033" + + "\x033\x033\x033\x033\x033\x033\x073\u0206\n3\f3\x0E3\u0209\v3\x034\x03" + + "4\x034\x074\u020E\n4\f4\x0E4\u0211\v4\x035\x035\x035\x036\x036\x036\x03" + + "6\x037\x037\x037\x037\x057\u021E\n7\x037\x037\x037\x037\x057\u0224\n7" + + "\x037\x037\x038\x038\x058\u022A\n8\x039\x039\x039\x03:\x03:\x03:\x05:" + + "\u0232\n:\x03;\x03;\x03;\x03<\x03<\x03<\x03=\x03=\x03>\x03>\x03?\x03?" + + "\x03?\x03?\x03?\x05?\u0243\n?\x03@\x03@\x03@\x03@\x03@\x03@\x07@\u024B" + + "\n@\f@\x0E@\u024E\v@\x03A\x03A\x03A\x03A\x03A\x03A\x07A\u0256\nA\fA\x0E" + + "A\u0259\vA\x03B\x03B\x03B\x03B\x03B\x03B\x03B\x07B\u0262\nB\fB\x0EB\u0265" + + "\vB\x03C\x03C\x03D\x03D\x03D\x03D\x03D\x03D\x07D\u026F\nD\fD\x0ED\u0272" + + "\vD\x03E\x03E\x03E\x03E\x03E\x03E\x07E\u027A\nE\fE\x0EE\u027D\vE\x03F" + + "\x03F\x03F\x03F\x03F\x03F\x07F\u0285\nF\fF\x0EF\u0288\vF\x03G\x03G\x03" + + "G\x03G\x03G\x03G\x07G\u0290\nG\fG\x0EG\u0293\vG\x03H\x03H\x03H\x03H\x03" + + "H\x03H\x07H\u029B\nH\fH\x0EH\u029E\vH\x03I\x03I\x03I\x03I\x03I\x03I\x07" + + "I\u02A6\nI\fI\x0EI\u02A9\vI\x03J\x03J\x03J\x03J\x03J\x03J\x07J\u02B1\n" + + "J\fJ\x0EJ\u02B4\vJ\x03K\x03K\x03K\x03K\x03K\x03K\x03K\x05K\u02BD\nK\x03" + + "L\x03L\x03L\x03L\x03L\x05L\u02C4\nL\x03M\x03M\x03N\x03N\x03N\x07N\u02CB" + + "\nN\fN\x0EN\u02CE\vN\x03O\x03O\x03O\x05O\u02D3\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\x06\x07" + + "\x03\x02\r\x0E\x03\x02\x1B\x1C\x03\x02MN\x04\x02LLOO\x03\x02\x1E \x04" + + "\x02--//\x06\x02,,..66FF\x03\x0203\x04\x02,,..\x03\x02GI\x03\x02?B\x03" + + "\x02=>\x03\x027<\x04\x02\x1E KK\x02\u02E4\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\"\xF7\x03" + + "\x02\x02\x02$\xFD\x03\x02\x02\x02&\xFF\x03\x02\x02\x02(\u0104\x03\x02" + + "\x02\x02*\u010E\x03\x02\x02\x02,\u0119\x03\x02\x02\x02.\u011B\x03\x02" + + "\x02\x020\u0122\x03\x02\x02\x022\u0129\x03\x02\x02\x024\u012B\x03\x02" + + "\x02\x026\u0134\x03\x02\x02\x028\u0149\x03\x02\x02\x02:\u014E\x03\x02" + + "\x02\x02<\u0150\x03\x02\x02\x02>\u0169\x03\x02\x02\x02@\u016F\x03\x02" + + "\x02\x02B\u0177\x03\x02\x02\x02D\u017A\x03\x02\x02\x02F\u0189\x03\x02" + + "\x02\x02H\u018B\x03\x02\x02\x02J\u018F\x03\x02\x02\x02L\u0191\x03\x02" + + "\x02\x02N\u0193\x03\x02\x02\x02P\u0197\x03\x02\x02\x02R\u0199\x03\x02" + + "\x02\x02T\u01AB\x03\x02\x02\x02V\u01B3\x03\x02\x02\x02X\u01BB\x03\x02" + + "\x02\x02Z\u01BD\x03\x02\x02\x02\\\u01BF\x03\x02\x02\x02^\u01CF\x03\x02" + + "\x02\x02`\u01DF\x03\x02\x02\x02b\u01E3\x03\x02\x02\x02d\u01F0\x03\x02" + + "\x02\x02f\u020A\x03\x02\x02\x02h\u0212\x03\x02\x02\x02j\u0215\x03\x02" + + "\x02\x02l\u0219\x03\x02\x02\x02n\u0229\x03\x02\x02\x02p\u022B\x03\x02" + + "\x02\x02r\u0231\x03\x02\x02\x02t\u0233\x03\x02\x02\x02v\u0236\x03\x02" + + "\x02\x02x\u0239\x03\x02\x02\x02z\u023B\x03\x02\x02\x02|\u0242\x03\x02" + + "\x02\x02~\u0244\x03\x02\x02\x02\x80\u024F\x03\x02\x02\x02\x82\u025A\x03" + + "\x02\x02\x02\x84\u0266\x03\x02\x02\x02\x86\u0268\x03\x02\x02\x02\x88\u0273" + + "\x03\x02\x02\x02\x8A\u027E\x03\x02\x02\x02\x8C\u0289\x03\x02\x02\x02\x8E" + + "\u0294\x03\x02\x02\x02\x90\u029F\x03\x02\x02\x02\x92\u02AA\x03\x02\x02" + + "\x02\x94\u02BC\x03\x02\x02\x02\x96\u02C3\x03\x02\x02\x02\x98\u02C5\x03" + + "\x02\x02\x02\x9A\u02C7\x03\x02\x02\x02\x9C\u02D2\x03\x02\x02\x02\x9E\u02D4" + + "\x03\x02\x02\x02\xA0\u02D6\x03\x02\x02\x02\xA2\u02DB\x03\x02\x02\x02\xA4" + + "\u02E0\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,\x17\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" + - "\r\x03\x02\x02\x02\xBC\xBD\x05\x10\t\x02\xBD\xBE\x05\x12\n\x02\xBE\x0F" + - "\x03\x02\x02\x02\xBF\xC0\t\x02\x02\x02\xC0\x11\x03\x02\x02\x02\xC1\xC2" + - "\x05\x16\f\x02\xC2\xC3\x07$\x02\x02\xC3\xC6\x05\x94K\x02\xC4\xC5\x077" + - "\x02\x02\xC5\xC7\x05\x14\v\x02\xC6\xC4\x03\x02\x02\x02\xC6\xC7\x03\x02" + - "\x02\x02\xC7\x13\x03\x02\x02\x02\xC8\xC9\x05\x8EH\x02\xC9\x15\x03\x02" + - "\x02\x02\xCA\xCB\x05\x18\r\x02\xCB\x17\x03\x02\x02\x02\xCC\xCD\x07K\x02" + - "\x02\xCD\x19\x03\x02\x02\x02\xCE\xCF\x07\x15\x02\x02\xCF\xD0\x05\x16\f" + - "\x02\xD0\xD2\x07%\x02\x02\xD1\xD3\x05\x1C\x0F\x02\xD2\xD1\x03\x02\x02" + - "\x02\xD2\xD3\x03\x02\x02\x02\xD3\xD4\x03\x02\x02\x02\xD4\xD5\x07&\x02" + - "\x02\xD5\xD6\x07\x18\x02\x02\xD6\xD8\x05\x94K\x02\xD7\xD9\x05&\x14\x02" + - "\xD8\xD7\x03\x02\x02\x02\xD8\xD9\x03\x02\x02\x02\xD9\x1B\x03\x02\x02\x02" + - "\xDA\xDF\x05\x1E\x10\x02\xDB\xDC\x07!\x02\x02\xDC\xDE\x05\x1E\x10\x02" + - "\xDD\xDB\x03\x02\x02\x02\xDE\xE1\x03\x02\x02\x02\xDF\xDD\x03\x02\x02\x02" + - "\xDF\xE0\x03\x02\x02\x02\xE0\x1D\x03\x02\x02\x02\xE1\xDF\x03\x02\x02\x02" + - "\xE2\xE3\x05\x16\f\x02\xE3\xE4\x07$\x02\x02\xE4\xE5\x05\x94K\x02\xE5\x1F" + - "\x03\x02\x02\x02\xE6\xE7\x07\x1A\x02\x02\xE7\xE8\x07K\x02\x02\xE8\xE9" + - "\x07*\x02\x02\xE9\xEA\x07+\x02\x02\xEA!\x03\x02\x02\x02\xEB\xEC\x07\x19" + - "\x02\x02\xEC\xED\x07K\x02\x02\xED\xEE\x07*\x02\x02\xEE\xEF\x07+\x02\x02" + - "\xEF#\x03\x02\x02\x02\xF0\xF7\x05(\x15\x02\xF1\xF7\x05*\x16\x02\xF2\xF7" + - "\x052\x1A\x02\xF3\xF7\x05:\x1E\x02\xF4\xF7\x05<\x1F\x02\xF5\xF7\x05&\x14" + - "\x02\xF6\xF0\x03\x02\x02\x02\xF6\xF1\x03\x02\x02\x02\xF6\xF2\x03\x02\x02" + - "\x02\xF6\xF3\x03\x02\x02\x02\xF6\xF4\x03\x02\x02\x02\xF6\xF5\x03\x02\x02" + - "\x02\xF7%\x03\x02\x02\x02\xF8\xF9\x06\x14\x02\x02\xF9\xFB\x07*\x02\x02" + - "\xFA\xFC\x05\b\x05\x02\xFB\xFA\x03\x02\x02\x02\xFB\xFC\x03\x02\x02\x02" + - "\xFC\xFD\x03\x02\x02\x02\xFD\xFE\x07+\x02\x02\xFE'\x03\x02\x02\x02\xFF" + - '\u0100\b\x15\x01\x02\u0100\u0101\x05\x92J\x02\u0101\u0102\x07"\x02\x02' + - "\u0102\u0103\b\x15\x01\x02\u0103)\x03\x02\x02\x02\u0104\u0107\x05,\x17" + - "\x02\u0105\u0107\x05.\x18\x02\u0106\u0104\x03\x02\x02\x02\u0106\u0105" + - "\x03\x02\x02\x02\u0107+\x03\x02\x02\x02\u0108\u0109\x07\x11\x02\x02\u0109" + - "\u010A\x07%\x02\x02\u010A\u010B\x05\x92J\x02\u010B\u010C\x07&\x02\x02" + - "\u010C\u010F\x05$\x13\x02\u010D\u010E\x07\x12\x02\x02\u010E\u0110\x05" + - "$\x13\x02\u010F\u010D\x03\x02\x02\x02\u010F\u0110\x03\x02\x02\x02\u0110" + - "-\x03\x02\x02\x02\u0111\u0112\x07\n\x02\x02\u0112\u0113\x07%\x02\x02\u0113" + - "\u0114\x05\x92J\x02\u0114\u0115\x07&\x02\x02\u0115\u0119\x07*\x02\x02" + - "\u0116\u0118\x050\x19\x02\u0117\u0116\x03\x02\x02\x02\u0118\u011B\x03" + - "\x02\x02\x02\u0119\u0117\x03\x02\x02\x02\u0119\u011A\x03\x02\x02\x02\u011A" + - "\u011C\x03\x02\x02\x02\u011B\u0119\x03\x02\x02\x02\u011C\u011D\x07+\x02" + - "\x02\u011D/\x03\x02\x02\x02\u011E\u011F\x07\v\x02\x02\u011F\u0120\x05" + - "\x92J\x02\u0120\u0121\x07$\x02\x02\u0121\u0122\x05$\x13\x02\u0122\u0127" + - "\x03\x02\x02\x02\u0123\u0124\x07\f\x02\x02\u0124\u0125\x07$\x02\x02\u0125" + - "\u0127\x05$\x13\x02\u0126\u011E\x03\x02\x02\x02\u0126\u0123\x03\x02\x02" + - "\x02\u01271\x03\x02\x02\x02\u0128\u012C\x054\x1B\x02\u0129\u012C\x056" + - "\x1C\x02\u012A\u012C\x058\x1D\x02\u012B\u0128\x03\x02\x02\x02\u012B\u0129" + - "\x03\x02\x02\x02\u012B\u012A\x03\x02\x02\x02\u012C3\x03\x02\x02\x02\u012D" + - "\u012E\x07\x13\x02\x02\u012E\u0135\x07%\x02\x02\u012F\u0132\x05\x0E\b" + - "\x02\u0130\u0132\x05\x92J\x02\u0131\u012F\x03\x02\x02\x02\u0131\u0130" + - "\x03\x02\x02\x02\u0132\u0133\x03\x02\x02\x02\u0133\u0134\b\x1B\x01\x02" + - "\u0134\u0136\x03\x02\x02\x02\u0135\u0131\x03\x02\x02\x02\u0135\u0136\x03" + - '\x02\x02\x02\u0136\u0137\x03\x02\x02\x02\u0137\u013B\x07"\x02\x02\u0138' + - "\u0139\x05\x92J\x02\u0139\u013A\b\x1B\x01\x02\u013A\u013C\x03\x02\x02" + - "\x02\u013B\u0138\x03\x02\x02\x02\u013B\u013C\x03\x02\x02\x02\u013C\u013D" + - '\x03\x02\x02\x02\u013D\u0141\x07"\x02\x02\u013E\u013F\x05\x92J\x02\u013F' + - "\u0140\b\x1B\x01\x02\u0140\u0142\x03\x02\x02\x02\u0141\u013E\x03\x02\x02" + - "\x02\u0141\u0142\x03\x02\x02\x02\u0142\u0143\x03\x02\x02\x02\u0143\u0144" + - "\x07&\x02\x02\u0144\u0145\x05$\x13\x02\u01455\x03\x02\x02\x02\u0146\u0147" + - "\x07\x10\x02\x02\u0147\u0148\x07%\x02\x02\u0148\u0149\x05\x92J\x02\u0149" + - "\u014A\x07&\x02\x02\u014A\u014B\x05$\x13\x02\u014B7\x03\x02\x02\x02\u014C" + - "\u014D\x07\x0F\x02\x02\u014D\u014E\x05$\x13\x02\u014E\u014F\x07\x10\x02" + - "\x02\u014F\u0150\x07%\x02\x02\u0150\u0151\x05\x92J\x02\u0151\u0152\x07" + - '&\x02\x02\u0152\u0153\x07"\x02\x02\u01539\x03\x02\x02\x02\u0154\u0155' + - '\t\x03\x02\x02\u0155\u0156\x07"\x02\x02\u0156;\x03\x02\x02\x02\u0157' + - "\u0159\x07\x16\x02\x02\u0158\u015A\x05\x92J\x02\u0159\u0158\x03\x02\x02" + - "\x02\u0159\u015A\x03\x02\x02\x02\u015A\u015B\x03\x02\x02\x02\u015B\u015C" + - '\x07"\x02\x02\u015C=\x03\x02\x02\x02\u015D\u0167\x05@!\x02\u015E\u0167' + - '\x05T+\x02\u015F\u0167\x05V,\x02\u0160\u0167\x05B"\x02\u0161\u0167\x05' + - "D#\x02\u0162\u0167\x05J&\x02\u0163\u0167\x05L'\x02\u0164\u0167\x05R*" + - "\x02\u0165\u0167\x05Z.\x02\u0166\u015D\x03\x02\x02\x02\u0166\u015E\x03" + - "\x02\x02\x02\u0166\u015F\x03\x02\x02\x02\u0166\u0160\x03\x02\x02\x02\u0166" + - "\u0161\x03\x02\x02\x02\u0166\u0162\x03\x02\x02\x02\u0166\u0163\x03\x02" + - "\x02\x02\u0166\u0164\x03\x02\x02\x02\u0166\u0165\x03\x02\x02\x02\u0167" + - "?\x03\x02\x02\x02\u0168\u0169\x07%\x02\x02\u0169\u016A\x05\x92J\x02\u016A" + - "\u016B\x07&\x02\x02\u016BA\x03\x02\x02\x02\u016C\u016D\t\x04\x02\x02\u016D" + - "C\x03\x02\x02\x02\u016E\u016F\x05F$\x02\u016FE\x03\x02\x02\x02\u0170\u0171" + - "\x07K\x02\x02\u0171G\x03\x02\x02\x02\u0172\u0175\x05F$\x02\u0173\u0175" + - "\x05J&\x02\u0174\u0172\x03\x02\x02\x02\u0174\u0173\x03\x02\x02\x02\u0175" + - "I\x03\x02\x02\x02\u0176\u0177\t\x05\x02\x02\u0177K\x03\x02\x02\x02\u0178" + - "\u017C\x07R\x02\x02\u0179\u017B\x05N(\x02\u017A\u0179\x03\x02\x02\x02" + - "\u017B\u017E\x03\x02\x02\x02\u017C\u017A\x03\x02\x02\x02\u017C\u017D\x03" + - "\x02\x02\x02\u017D\u017F\x03\x02\x02\x02\u017E\u017C\x03\x02\x02\x02\u017F" + - "\u0189\x07T\x02\x02\u0180\u0184\x07S\x02\x02\u0181\u0183\x05P)\x02\u0182" + - "\u0181\x03\x02\x02\x02\u0183\u0186\x03\x02\x02\x02\u0184\u0182\x03\x02" + - "\x02\x02\u0184\u0185\x03\x02\x02\x02\u0185\u0187\x03\x02\x02\x02\u0186" + - "\u0184\x03\x02\x02\x02\u0187\u0189\x07V\x02\x02\u0188\u0178\x03\x02\x02" + - "\x02\u0188\u0180\x03\x02\x02\x02\u0189M\x03\x02\x02\x02\u018A\u0191\x07" + - "U\x02\x02\u018B\u018D\x07\x03\x02\x02\u018C\u018E\x05\x92J\x02\u018D\u018C" + - "\x03\x02\x02\x02\u018D\u018E\x03\x02\x02\x02\u018E\u018F\x03\x02\x02\x02" + - "\u018F\u0191\x07)\x02\x02\u0190\u018A\x03\x02\x02\x02\u0190\u018B\x03" + - "\x02\x02\x02\u0191O\x03\x02\x02\x02\u0192\u0199\x07W\x02\x02\u0193\u0195" + - "\x07\x03\x02\x02\u0194\u0196\x05\x92J\x02\u0195\u0194\x03\x02\x02\x02" + - "\u0195\u0196\x03\x02\x02\x02\u0196\u0197\x03\x02\x02\x02\u0197\u0199\x07" + - ")\x02\x02\u0198\u0192\x03\x02\x02\x02\u0198\u0193\x03\x02\x02\x02\u0199" + - "Q\x03\x02\x02\x02\u019A\u019B\t\x06\x02\x02\u019BS\x03\x02\x02\x02\u019C" + - "\u01A5\x07'\x02\x02\u019D\u01A2\x05\x92J\x02\u019E\u019F\x07!\x02\x02" + - "\u019F\u01A1\x05\x92J\x02\u01A0\u019E\x03\x02\x02\x02\u01A1\u01A4\x03" + - "\x02\x02\x02\u01A2\u01A0\x03\x02\x02\x02\u01A2\u01A3\x03\x02\x02\x02\u01A3" + - "\u01A6\x03\x02\x02\x02\u01A4\u01A2\x03\x02\x02\x02\u01A5\u019D\x03\x02" + - "\x02\x02\u01A5\u01A6\x03\x02\x02\x02\u01A6\u01A8\x03\x02\x02\x02\u01A7" + - "\u01A9\x07!\x02\x02\u01A8\u01A7\x03\x02\x02\x02\u01A8\u01A9\x03\x02\x02" + - "\x02\u01A9\u01AA\x03\x02\x02\x02\u01AA\u01AB\x07(\x02\x02\u01ABU\x03\x02" + - "\x02\x02\u01AC\u01B5\x07*\x02\x02\u01AD\u01B2\x05X-\x02\u01AE\u01AF\x07" + - "!\x02\x02\u01AF\u01B1\x05X-\x02\u01B0\u01AE\x03\x02\x02\x02\u01B1\u01B4" + - "\x03\x02\x02\x02\u01B2\u01B0\x03\x02\x02\x02\u01B2\u01B3\x03\x02\x02\x02" + - "\u01B3\u01B6\x03\x02\x02\x02\u01B4\u01B2\x03\x02\x02\x02\u01B5\u01AD\x03" + - "\x02\x02\x02\u01B5\u01B6\x03\x02\x02\x02\u01B6\u01B8\x03\x02\x02\x02\u01B7" + - "\u01B9\x07!\x02\x02\u01B8\u01B7\x03\x02\x02\x02\u01B8\u01B9\x03\x02\x02" + - "\x02\u01B9\u01BA\x03\x02\x02\x02\u01BA\u01BB\x07+\x02\x02\u01BBW\x03\x02" + - "\x02\x02\u01BC\u01BD\x05H%\x02\u01BD\u01BE\x07$\x02\x02\u01BE\u01BF\x05" + - "\x92J\x02\u01BFY\x03\x02\x02\x02\u01C0\u01C1\t\x07\x02\x02\u01C1[\x03" + - "\x02\x02\x02\u01C2\u01C3\b/\x01\x02\u01C3\u01CE\x05> \x02\u01C4\u01C5" + - "\x07\x17\x02\x02\u01C5\u01C6\x05\\/\x02\u01C6\u01C8\x07%\x02\x02\u01C7" + - "\u01C9\x05^0\x02\u01C8\u01C7\x03\x02\x02\x02\u01C8\u01C9\x03\x02\x02\x02" + - "\u01C9\u01CA\x03\x02\x02\x02\u01CA\u01CB\x07&\x02\x02\u01CB\u01CC\b/\x01" + - "\x02\u01CC\u01CE\x03\x02\x02\x02\u01CD\u01C2\x03\x02\x02\x02\u01CD\u01C4" + - "\x03\x02\x02\x02\u01CE\u01E4\x03\x02\x02\x02\u01CF\u01D0\f\x07\x02\x02" + - "\u01D0\u01D2\x07%\x02\x02\u01D1\u01D3\x05^0\x02\u01D2\u01D1\x03\x02\x02" + - "\x02\u01D2\u01D3\x03\x02\x02\x02\u01D3\u01D4\x03\x02\x02\x02\u01D4\u01D5" + - "\x07&\x02\x02\u01D5\u01E3\b/\x01\x02\u01D6\u01D7\f\x05\x02\x02\u01D7\u01D8" + - "\x05`1\x02\u01D8\u01D9\b/\x01\x02\u01D9\u01E3\x03\x02\x02\x02\u01DA\u01DB" + - "\f\x04\x02\x02\u01DB\u01DC\x05b2\x02\u01DC\u01DD\b/\x01\x02\u01DD\u01E3" + - "\x03\x02\x02\x02\u01DE\u01DF\f\x03\x02\x02\u01DF\u01E0\x05d3\x02\u01E0" + - "\u01E1\b/\x01\x02\u01E1\u01E3\x03\x02\x02\x02\u01E2\u01CF\x03\x02\x02" + - "\x02\u01E2\u01D6\x03\x02\x02\x02\u01E2\u01DA\x03\x02\x02\x02\u01E2\u01DE" + - "\x03\x02\x02\x02\u01E3\u01E6\x03\x02\x02\x02\u01E4\u01E2\x03\x02\x02\x02" + - "\u01E4\u01E5\x03\x02\x02\x02\u01E5]\x03\x02\x02\x02\u01E6\u01E4\x03\x02" + - "\x02\x02\u01E7\u01EC\x05\x8EH\x02\u01E8\u01E9\x07!\x02\x02\u01E9\u01EB" + - "\x05\x8EH\x02\u01EA\u01E8\x03\x02\x02\x02\u01EB\u01EE\x03\x02\x02\x02" + - "\u01EC\u01EA\x03\x02\x02\x02\u01EC\u01ED\x03\x02\x02\x02\u01ED_\x03\x02" + - "\x02\x02\u01EE\u01EC\x03\x02\x02\x02\u01EF\u01F0\x07J\x02\x02\u01F0\u01F1" + - "\x05F$\x02\u01F1a\x03\x02\x02\x02\u01F2\u01F3\x07'\x02\x02\u01F3\u01F4" + - "\x05\x92J\x02\u01F4\u01F5\x07(\x02\x02\u01F5c\x03\x02\x02\x02\u01F6\u01FA" + - "\x07'\x02\x02\u01F7\u01F8\x05\x92J\x02\u01F8\u01F9\b3\x01\x02\u01F9\u01FB" + - "\x03\x02\x02\x02\u01FA\u01F7\x03\x02\x02\x02\u01FA\u01FB\x03\x02\x02\x02" + - "\u01FB\u01FC\x03\x02\x02\x02\u01FC\u0200\x07$\x02\x02\u01FD\u01FE\x05" + - "\x92J\x02\u01FE\u01FF\b3\x01\x02\u01FF\u0201\x03\x02\x02\x02\u0200\u01FD" + - "\x03\x02\x02\x02\u0200\u0201\x03\x02\x02\x02\u0201\u0202\x03\x02\x02\x02" + - "\u0202\u0203\x07(\x02\x02\u0203e\x03\x02\x02\x02\u0204\u0207\x05\\/\x02" + - "\u0205\u0207\x05h5\x02\u0206\u0204\x03\x02\x02\x02\u0206\u0205\x03\x02" + - "\x02\x02\u0207g\x03\x02\x02\x02\u0208\u0209\x05\\/\x02\u0209\u020A\x05" + - "p9\x02\u020Ai\x03\x02\x02\x02\u020B\u020F\x05f4\x02\u020C\u020F\x05l7" + - "\x02\u020D\u020F\x05n8\x02\u020E\u020B\x03\x02\x02\x02\u020E\u020C\x03" + - "\x02\x02\x02\u020E\u020D\x03\x02\x02\x02\u020Fk\x03\x02\x02\x02\u0210" + - "\u0211\x05p9\x02\u0211\u0212\x05f4\x02\u0212m\x03\x02\x02\x02\u0213\u0214" + - "\x05r:\x02\u0214\u0215\x05f4\x02\u0215o\x03\x02\x02\x02\u0216\u0217\t" + - "\b\x02\x02\u0217q\x03\x02\x02\x02\u0218\u0219\t\t\x02\x02\u0219s\x03\x02" + - "\x02\x02\u021A\u0220\x05j6\x02\u021B\u021C\x05j6\x02\u021C\u021D\x07\b" + - "\x02\x02\u021D\u021E\x05\x94K\x02\u021E\u0220\x03\x02\x02\x02\u021F\u021A" + - "\x03\x02\x02\x02\u021F\u021B\x03\x02\x02\x02\u0220u\x03\x02\x02\x02\u0221" + - "\u0222\b<\x01\x02\u0222\u0223\x05t;\x02\u0223\u0229\x03\x02\x02\x02\u0224" + - "\u0225\f\x03\x02\x02\u0225\u0226\t\n\x02\x02\u0226\u0228\x05t;\x02\u0227" + - "\u0224\x03\x02\x02\x02\u0228\u022B\x03\x02\x02\x02\u0229\u0227\x03\x02" + - "\x02\x02\u0229\u022A\x03\x02\x02\x02\u022Aw\x03\x02\x02\x02\u022B\u0229" + - "\x03\x02\x02\x02\u022C\u022D"; + "\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*\x16\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\x077\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\x07K\x02\x02\xD5\x19\x03\x02\x02\x02" + + "\xD6\xD7\x07\x15\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\x18\x02\x02\xDE" + + "\xE0\x05\x9CO\x02\xDF\xE1\x05.\x18\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" + + "\x1A\x02\x02\xEF\xF0\x07K\x02\x02\xF0\xF2\x07*\x02\x02\xF1\xF3\x05\"\x12" + + "\x02\xF2\xF1\x03\x02\x02\x02\xF2\xF3\x03\x02\x02\x02\xF3\xF4\x03\x02\x02" + + "\x02\xF4\xF5\x07+\x02\x02\xF5!\x03\x02\x02\x02\xF6\xF8\x05$\x13\x02\xF7" + + "\xF6\x03\x02\x02\x02\xF8\xF9\x03\x02\x02\x02\xF9\xF7\x03\x02\x02\x02\xF9" + + "\xFA\x03\x02\x02\x02\xFA#\x03\x02\x02\x02\xFB\xFE\x05&\x14\x02\xFC\xFE" + + "\x05(\x15\x02\xFD\xFB\x03\x02\x02\x02\xFD\xFC\x03\x02\x02\x02\xFE%\x03" + + "\x02\x02\x02\xFF\u0100\x07K\x02\x02\u0100\u0101\x07$\x02\x02\u0101\u0102" + + "\x05\x9CO\x02\u0102\u0103\x07\"\x02\x02\u0103\'\x03\x02\x02\x02\u0104" + + "\u0105\x07K\x02\x02\u0105\u0107\x07%\x02\x02\u0106\u0108\x05\x1C\x0F\x02" + + "\u0107\u0106\x03\x02\x02\x02\u0107\u0108\x03\x02\x02\x02\u0108\u0109\x03" + + "\x02\x02\x02\u0109\u010A\x07&\x02\x02\u010A\u010B\x07\x18\x02\x02\u010B" + + "\u010C\x05\x9CO\x02\u010C\u010D\x07\"\x02\x02\u010D)\x03\x02\x02\x02\u010E" + + "\u010F\x07\x19\x02\x02\u010F\u0110\x07K\x02\x02\u0110\u0111\x07*\x02\x02" + + "\u0111\u0112\x07+\x02\x02\u0112+\x03\x02\x02\x02\u0113\u011A\x050\x19" + + "\x02\u0114\u011A\x052\x1A\x02\u0115\u011A\x05:\x1E\x02\u0116\u011A\x05" + + "B\"\x02\u0117\u011A\x05D#\x02\u0118\u011A\x05.\x18\x02\u0119\u0113\x03" + + "\x02\x02\x02\u0119\u0114\x03\x02\x02\x02\u0119\u0115\x03\x02\x02\x02\u0119" + + "\u0116\x03\x02\x02\x02\u0119\u0117\x03\x02\x02\x02\u0119\u0118\x03\x02" + + "\x02\x02\u011A-\x03\x02\x02\x02\u011B\u011C\x06\x18\x02\x02\u011C\u011E" + + "\x07*\x02\x02\u011D\u011F\x05\b\x05\x02\u011E\u011D\x03\x02\x02\x02\u011E" + + "\u011F\x03\x02\x02\x02\u011F\u0120\x03\x02\x02\x02\u0120\u0121\x07+\x02" + + "\x02\u0121/\x03\x02\x02\x02\u0122\u0123\b\x19\x01\x02\u0123\u0124\x05" + + "\x9AN\x02\u0124\u0125\x07\"\x02\x02\u0125\u0126\b\x19\x01\x02\u01261\x03" + + "\x02\x02\x02\u0127\u012A\x054\x1B\x02\u0128\u012A\x056\x1C\x02\u0129\u0127" + + "\x03\x02\x02\x02\u0129\u0128\x03\x02\x02\x02\u012A3\x03\x02\x02\x02\u012B" + + "\u012C\x07\x11\x02\x02\u012C\u012D\x07%\x02\x02\u012D\u012E\x05\x9AN\x02" + + "\u012E\u012F\x07&\x02\x02\u012F\u0132\x05,\x17\x02\u0130\u0131\x07\x12" + + "\x02\x02\u0131\u0133\x05,\x17\x02\u0132\u0130\x03\x02\x02\x02\u0132\u0133" + + "\x03\x02\x02\x02\u01335\x03\x02\x02\x02\u0134\u0135\x07\n\x02\x02\u0135" + + "\u0136\x07%\x02\x02\u0136\u0137\x05\x9AN\x02\u0137\u0138\x07&\x02\x02" + + "\u0138\u013C\x07*\x02\x02\u0139\u013B\x058\x1D\x02\u013A\u0139\x03\x02" + + "\x02\x02\u013B\u013E\x03\x02\x02\x02\u013C\u013A\x03\x02\x02\x02\u013C" + + "\u013D\x03\x02\x02\x02\u013D\u013F\x03\x02\x02\x02\u013E\u013C\x03\x02" + + "\x02\x02\u013F\u0140\x07+\x02\x02\u01407\x03\x02\x02\x02\u0141\u0142\x07" + + "\v\x02\x02\u0142\u0143\x05\x9AN\x02\u0143\u0144\x07$\x02\x02\u0144\u0145" + + "\x05,\x17\x02\u0145\u014A\x03\x02\x02\x02\u0146\u0147\x07\f\x02\x02\u0147" + + "\u0148\x07$\x02\x02\u0148\u014A\x05,\x17\x02\u0149\u0141\x03\x02\x02\x02" + + "\u0149\u0146\x03\x02\x02\x02\u014A9\x03\x02\x02\x02\u014B\u014F\x05<\x1F" + + "\x02\u014C\u014F\x05> \x02\u014D\u014F\x05@!\x02\u014E\u014B\x03\x02\x02" + + "\x02\u014E\u014C\x03\x02\x02\x02\u014E\u014D\x03\x02\x02\x02\u014F;\x03" + + "\x02\x02\x02\u0150\u0151\x07\x13\x02\x02\u0151\u0158\x07%\x02\x02\u0152" + + "\u0155\x05\x0E\b\x02\u0153\u0155\x05\x9AN\x02\u0154\u0152\x03\x02\x02" + + "\x02\u0154\u0153\x03\x02\x02\x02\u0155\u0156\x03\x02\x02\x02\u0156\u0157" + + "\b\x1F\x01\x02\u0157\u0159\x03\x02\x02\x02\u0158\u0154\x03\x02\x02\x02" + + "\u0158\u0159\x03\x02\x02\x02\u0159\u015A\x03\x02\x02\x02\u015A\u015E\x07" + + "\"\x02\x02\u015B\u015C\x05\x9AN\x02\u015C\u015D\b\x1F\x01\x02\u015D\u015F" + + "\x03\x02\x02\x02\u015E\u015B\x03\x02\x02\x02\u015E\u015F\x03\x02\x02\x02" + + "\u015F\u0160\x03\x02\x02\x02\u0160\u0164\x07\"\x02\x02\u0161\u0162\x05" + + "\x9AN\x02\u0162\u0163\b\x1F\x01\x02\u0163\u0165\x03\x02\x02\x02\u0164" + + "\u0161\x03\x02\x02\x02\u0164\u0165\x03\x02\x02\x02\u0165\u0166\x03\x02" + + "\x02\x02\u0166\u0167\x07&\x02\x02\u0167\u0168\x05,\x17\x02\u0168=\x03" + + "\x02\x02\x02\u0169\u016A\x07\x10\x02\x02\u016A\u016B\x07%\x02\x02\u016B" + + "\u016C\x05\x9AN\x02\u016C\u016D\x07&\x02\x02\u016D\u016E\x05,\x17\x02" + + "\u016E?\x03\x02\x02\x02\u016F\u0170\x07\x0F\x02\x02\u0170\u0171\x05,\x17" + + "\x02\u0171\u0172\x07\x10\x02\x02\u0172\u0173\x07%\x02\x02\u0173\u0174" + + "\x05\x9AN\x02\u0174\u0175\x07&\x02\x02\u0175\u0176\x07\"\x02\x02\u0176" + + "A\x03\x02\x02\x02\u0177\u0178\t\x03\x02\x02\u0178\u0179\x07\"\x02\x02" + + "\u0179C\x03\x02\x02\x02\u017A\u017C\x07\x16\x02\x02\u017B\u017D\x05\x9A" + + "N\x02\u017C\u017B\x03\x02\x02\x02\u017C\u017D\x03\x02\x02\x02\u017D\u017E" + + "\x03\x02\x02\x02\u017E\u017F\x07\"\x02\x02\u017FE\x03\x02\x02\x02\u0180" + + "\u018A\x05H%\x02\u0181\u018A\x05\\/\x02\u0182\u018A\x05^0\x02\u0183\u018A" + + "\x05J&\x02\u0184\u018A\x05L\'\x02\u0185\u018A\x05R*\x02\u0186\u018A\x05" + + "T+\x02\u0187\u018A\x05Z.\x02\u0188\u018A\x05b2\x02\u0189\u0180\x03\x02" + + "\x02\x02\u0189\u0181\x03\x02\x02\x02\u0189\u0182\x03\x02\x02\x02\u0189" + + "\u0183\x03\x02\x02\x02\u0189\u0184\x03\x02\x02\x02\u0189\u0185\x03\x02" + + "\x02\x02\u0189\u0186\x03\x02\x02\x02\u0189\u0187\x03\x02\x02\x02\u0189" + + "\u0188\x03\x02\x02\x02\u018AG\x03\x02\x02\x02\u018B\u018C\x07%\x02\x02" + + "\u018C\u018D\x05\x9AN\x02\u018D\u018E\x07&\x02\x02\u018EI\x03\x02\x02" + + "\x02\u018F\u0190\t\x04\x02\x02\u0190K\x03\x02\x02\x02\u0191\u0192\x05" + + "N(\x02\u0192M\x03\x02\x02\x02\u0193\u0194\x07K\x02\x02\u0194O\x03\x02" + + "\x02\x02\u0195\u0198\x05N(\x02\u0196\u0198\x05R*\x02\u0197\u0195\x03\x02" + + "\x02\x02\u0197\u0196\x03\x02\x02\x02\u0198Q\x03\x02\x02\x02\u0199\u019A" + + "\t\x05\x02\x02\u019AS\x03\x02\x02\x02\u019B\u019F\x07R\x02\x02\u019C\u019E" + + "\x05V,\x02\u019D\u019C\x03\x02\x02\x02\u019E\u01A1\x03\x02\x02\x02\u019F" + + "\u019D\x03\x02\x02\x02\u019F\u01A0\x03\x02\x02\x02\u01A0\u01A2\x03\x02" + + "\x02\x02\u01A1\u019F\x03\x02\x02\x02\u01A2\u01AC\x07T\x02\x02\u01A3\u01A7" + + "\x07S\x02\x02\u01A4\u01A6\x05X-\x02\u01A5\u01A4\x03\x02\x02\x02\u01A6" + + "\u01A9\x03\x02\x02\x02\u01A7\u01A5\x03\x02\x02\x02\u01A7\u01A8\x03\x02" + + "\x02\x02\u01A8\u01AA\x03\x02\x02\x02\u01A9\u01A7\x03\x02\x02\x02\u01AA" + + "\u01AC\x07V\x02\x02\u01AB\u019B\x03\x02\x02\x02\u01AB\u01A3\x03\x02\x02" + + "\x02\u01ACU\x03\x02\x02\x02\u01AD\u01B4\x07U\x02\x02\u01AE\u01B0\x07\x03" + + "\x02\x02\u01AF\u01B1\x05\x9AN\x02\u01B0\u01AF\x03\x02\x02\x02\u01B0\u01B1" + + "\x03\x02\x02\x02\u01B1\u01B2\x03\x02\x02\x02\u01B2\u01B4\x07)\x02\x02" + + "\u01B3\u01AD\x03\x02\x02\x02\u01B3\u01AE\x03\x02\x02\x02\u01B4W\x03\x02" + + "\x02\x02\u01B5\u01BC\x07W\x02\x02\u01B6\u01B8\x07\x03\x02\x02\u01B7\u01B9" + + "\x05\x9AN\x02\u01B8\u01B7\x03\x02\x02\x02\u01B8\u01B9\x03\x02\x02\x02" + + "\u01B9\u01BA\x03\x02\x02\x02\u01BA\u01BC\x07)\x02\x02\u01BB\u01B5\x03" + + "\x02\x02\x02\u01BB\u01B6\x03\x02\x02\x02\u01BCY\x03\x02\x02\x02\u01BD" + + "\u01BE\t\x06\x02\x02\u01BE[\x03\x02\x02\x02\u01BF\u01C8\x07\'\x02\x02" + + "\u01C0\u01C5\x05\x9AN\x02\u01C1\u01C2\x07!\x02\x02\u01C2\u01C4\x05\x9A" + + "N\x02\u01C3\u01C1\x03\x02\x02\x02\u01C4\u01C7\x03\x02\x02\x02\u01C5\u01C3" + + "\x03\x02\x02\x02\u01C5\u01C6\x03\x02\x02\x02\u01C6\u01C9\x03\x02\x02\x02" + + "\u01C7\u01C5\x03\x02\x02\x02\u01C8\u01C0\x03\x02\x02\x02\u01C8\u01C9\x03" + + "\x02\x02\x02\u01C9\u01CB\x03\x02\x02\x02\u01CA\u01CC\x07!\x02\x02\u01CB" + + "\u01CA\x03\x02\x02\x02\u01CB\u01CC\x03\x02\x02\x02\u01CC\u01CD\x03\x02" + + "\x02\x02\u01CD\u01CE\x07(\x02\x02\u01CE]\x03\x02\x02\x02\u01CF\u01D8\x07" + + "*\x02\x02\u01D0\u01D5\x05`1\x02\u01D1\u01D2\x07!\x02\x02\u01D2\u01D4\x05" + + "`1\x02\u01D3\u01D1\x03\x02\x02\x02\u01D4\u01D7\x03\x02\x02\x02\u01D5\u01D3" + + "\x03\x02\x02\x02\u01D5\u01D6\x03\x02\x02\x02\u01D6\u01D9\x03\x02\x02\x02" + + "\u01D7\u01D5\x03\x02\x02\x02\u01D8\u01D0\x03\x02\x02\x02\u01D8\u01D9\x03" + + "\x02\x02\x02\u01D9\u01DB\x03\x02\x02\x02\u01DA\u01DC\x07!\x02\x02\u01DB" + + "\u01DA\x03\x02\x02\x02\u01DB\u01DC\x03\x02\x02\x02\u01DC\u01DD\x03\x02" + + "\x02\x02\u01DD\u01DE\x07+\x02\x02\u01DE_\x03\x02\x02\x02\u01DF\u01E0\x05" + + "P)\x02\u01E0\u01E1\x07$\x02\x02\u01E1\u01E2\x05\x9AN\x02\u01E2a\x03\x02" + + "\x02\x02\u01E3\u01E4\t\x07\x02\x02\u01E4c\x03\x02\x02\x02\u01E5\u01E6" + + "\b3\x01\x02\u01E6\u01F1\x05F$\x02\u01E7\u01E8\x07\x17\x02\x02\u01E8\u01E9" + + "\x05d3\x02\u01E9\u01EB\x07%\x02\x02\u01EA\u01EC\x05f4\x02\u01EB\u01EA" + + "\x03\x02\x02\x02\u01EB\u01EC\x03\x02\x02\x02\u01EC\u01ED\x03\x02\x02\x02" + + "\u01ED\u01EE\x07&\x02\x02\u01EE\u01EF\b3\x01\x02\u01EF\u01F1\x03\x02\x02" + + "\x02\u01F0\u01E5\x03\x02\x02\x02\u01F0\u01E7\x03\x02\x02\x02\u01F1\u0207" + + "\x03\x02\x02\x02\u01F2\u01F3\f\x07\x02\x02\u01F3\u01F5\x07%\x02\x02\u01F4" + + "\u01F6\x05f4\x02\u01F5\u01F4\x03\x02\x02\x02\u01F5\u01F6\x03\x02\x02\x02" + + "\u01F6\u01F7\x03\x02\x02\x02\u01F7\u01F8\x07&\x02\x02\u01F8\u0206\b3\x01" + + "\x02\u01F9\u01FA\f\x05\x02\x02\u01FA\u01FB\x05h5\x02\u01FB\u01FC\b3\x01" + + "\x02\u01FC\u0206\x03\x02\x02\x02\u01FD\u01FE\f\x04\x02\x02\u01FE\u01FF" + + "\x05j6\x02\u01FF\u0200\b3\x01\x02\u0200\u0206\x03\x02\x02\x02\u0201\u0202" + + "\f\x03\x02\x02\u0202\u0203\x05l7\x02\u0203\u0204\b3\x01\x02\u0204\u0206" + + "\x03\x02\x02\x02\u0205\u01F2\x03\x02\x02\x02\u0205\u01F9\x03\x02\x02\x02" + + "\u0205\u01FD\x03\x02\x02\x02\u0205\u0201\x03\x02\x02\x02\u0206\u0209\x03" + + "\x02\x02\x02\u0207\u0205\x03\x02\x02\x02\u0207\u0208\x03\x02\x02\x02\u0208" + + "e\x03\x02\x02\x02\u0209\u0207\x03\x02\x02\x02\u020A\u020F\x05\x96L\x02" + + "\u020B\u020C\x07!\x02\x02\u020C\u020E\x05\x96L\x02\u020D\u020B\x03\x02" + + "\x02\x02\u020E\u0211\x03\x02\x02\x02\u020F\u020D\x03\x02\x02\x02\u020F" + + "\u0210\x03\x02\x02\x02\u0210g\x03\x02\x02\x02\u0211\u020F\x03\x02\x02" + + "\x02\u0212\u0213\x07J\x02\x02\u0213\u0214\x05N(\x02\u0214i\x03\x02\x02" + + "\x02\u0215\u0216\x07\'\x02\x02\u0216\u0217\x05\x9AN\x02\u0217\u0218\x07" + + "(\x02\x02\u0218k\x03\x02\x02\x02\u0219\u021D\x07\'\x02\x02\u021A\u021B" + + "\x05\x9AN\x02\u021B\u021C\b7\x01\x02\u021C\u021E\x03\x02\x02\x02\u021D" + + "\u021A\x03\x02\x02\x02\u021D\u021E\x03\x02\x02\x02\u021E\u021F\x03\x02" + + "\x02\x02\u021F\u0223\x07$\x02\x02\u0220\u0221\x05\x9AN\x02\u0221\u0222" + + "\b7\x01\x02\u0222\u0224\x03\x02\x02\x02\u0223\u0220\x03\x02\x02\x02\u0223" + + "\u0224\x03"; private static readonly _serializedATNSegment1: string = - "\b=\x01\x02\u022D\u022E\x05v<\x02\u022E\u0234\x03\x02\x02\x02\u022F\u0230" + - "\f\x03\x02\x02\u0230\u0231\t\v\x02\x02\u0231\u0233\x05v<\x02\u0232\u022F" + - "\x03\x02\x02\x02\u0233\u0236\x03\x02\x02\x02\u0234\u0232\x03\x02\x02\x02" + - "\u0234\u0235\x03\x02\x02\x02\u0235y\x03\x02\x02\x02\u0236\u0234\x03\x02" + - "\x02\x02\u0237\u0238\b>\x01\x02\u0238\u0239\x05x=\x02\u0239\u0240\x03" + - "\x02\x02\x02\u023A\u023B\f\x03\x02\x02\u023B\u023C\x05|?\x02\u023C\u023D" + - "\x05\x82B\x02\u023D\u023F\x03\x02\x02\x02\u023E\u023A\x03\x02\x02\x02" + - "\u023F\u0242\x03\x02\x02\x02\u0240\u023E\x03\x02\x02\x02\u0240\u0241\x03" + - "\x02\x02\x02\u0241{\x03\x02\x02\x02\u0242\u0240\x03\x02\x02\x02\u0243" + - "\u0244\t\f\x02\x02\u0244}\x03\x02\x02\x02\u0245\u0246\b@\x01\x02\u0246" + - "\u0247\x05z>\x02\u0247\u024D\x03\x02\x02\x02\u0248\u0249\f\x03\x02\x02" + - "\u0249\u024A\t\r\x02\x02\u024A\u024C\x05z>\x02\u024B\u0248\x03\x02\x02" + - "\x02\u024C\u024F\x03\x02\x02\x02\u024D\u024B\x03\x02\x02\x02\u024D\u024E" + - "\x03\x02\x02\x02\u024E\x7F\x03\x02\x02\x02\u024F\u024D\x03\x02\x02\x02" + - "\u0250\u0251\bA\x01\x02\u0251\u0252\x05~@\x02\u0252\u0258\x03\x02\x02" + - "\x02\u0253\u0254\f\x03\x02\x02\u0254\u0255\t\x0E\x02\x02\u0255\u0257\x05" + - "~@\x02\u0256\u0253\x03\x02\x02\x02\u0257\u025A\x03\x02\x02\x02\u0258\u0256" + - "\x03\x02\x02\x02\u0258\u0259\x03\x02\x02\x02\u0259\x81\x03\x02\x02\x02" + - "\u025A\u0258\x03\x02\x02\x02\u025B\u025C\bB\x01\x02\u025C\u025D\x05\x80" + - "A\x02\u025D\u0263\x03\x02\x02\x02\u025E\u025F\f\x03\x02\x02\u025F\u0260" + - "\x07C\x02\x02\u0260\u0262\x05\x80A\x02\u0261\u025E\x03\x02\x02\x02\u0262" + - "\u0265\x03\x02\x02\x02\u0263\u0261\x03\x02\x02\x02\u0263\u0264\x03\x02" + - "\x02\x02\u0264\x83\x03\x02\x02\x02\u0265\u0263\x03\x02\x02\x02\u0266\u0267" + - "\bC\x01\x02\u0267\u0268\x05\x82B\x02\u0268\u026E\x03\x02\x02\x02\u0269" + - "\u026A\f\x03\x02\x02\u026A\u026B\x07E\x02\x02\u026B\u026D\x05\x82B\x02" + - "\u026C\u0269\x03\x02\x02\x02\u026D\u0270\x03\x02\x02\x02\u026E\u026C\x03" + - "\x02\x02\x02\u026E\u026F\x03\x02\x02\x02\u026F\x85\x03\x02\x02\x02\u0270" + - "\u026E\x03\x02\x02\x02\u0271\u0272\bD\x01\x02\u0272\u0273\x05\x84C\x02" + - "\u0273\u0279\x03\x02\x02\x02\u0274\u0275\f\x03\x02\x02\u0275\u0276\x07" + - "D\x02\x02\u0276\u0278\x05\x84C\x02\u0277\u0274\x03\x02\x02\x02\u0278\u027B" + - "\x03\x02\x02\x02\u0279\u0277\x03\x02\x02\x02\u0279\u027A\x03\x02\x02\x02" + - "\u027A\x87\x03\x02\x02\x02\u027B\u0279\x03\x02\x02\x02\u027C\u027D\bE" + - "\x01\x02\u027D\u027E\x05\x86D\x02\u027E\u0284\x03\x02\x02\x02\u027F\u0280" + - "\f\x03\x02\x02\u0280\u0281\x074\x02\x02\u0281\u0283\x05\x86D\x02\u0282" + - "\u027F\x03\x02\x02\x02\u0283\u0286\x03\x02\x02\x02\u0284\u0282\x03\x02" + - "\x02\x02\u0284\u0285\x03\x02\x02\x02\u0285\x89\x03\x02\x02\x02\u0286\u0284" + - "\x03\x02\x02\x02\u0287\u0288\bF\x01\x02\u0288\u0289\x05\x88E\x02\u0289" + - "\u028F\x03\x02\x02\x02\u028A\u028B\f\x03\x02\x02\u028B\u028C\x075\x02" + - "\x02\u028C\u028E\x05\x88E\x02\u028D\u028A\x03\x02\x02\x02\u028E\u0291" + - "\x03\x02\x02\x02\u028F\u028D\x03\x02\x02\x02\u028F\u0290\x03\x02\x02\x02" + - "\u0290\x8B\x03\x02\x02\x02\u0291\u028F\x03\x02\x02\x02\u0292\u029A\x05" + - "\x8AF\x02\u0293\u0294\x05\x8AF\x02\u0294\u0295\x07#\x02\x02\u0295\u0296" + - "\x05\x8CG\x02\u0296\u0297\x07$\x02\x02\u0297\u0298\x05\x8CG\x02\u0298" + - "\u029A\x03\x02\x02\x02\u0299\u0292\x03\x02\x02\x02\u0299\u0293\x03\x02" + - "\x02\x02\u029A\x8D\x03\x02\x02\x02\u029B\u02A1\x05\x8CG\x02\u029C\u029D" + - "\x05\\/\x02\u029D\u029E\x05\x90I\x02\u029E\u029F\x05\x8EH\x02\u029F\u02A1" + - "\x03\x02\x02\x02\u02A0\u029B\x03\x02\x02\x02\u02A0\u029C\x03\x02\x02\x02" + - "\u02A1\x8F\x03\x02\x02\x02\u02A2\u02A3\t\x0F\x02\x02\u02A3\x91\x03\x02" + - "\x02\x02\u02A4\u02A9\x05\x8EH\x02\u02A5\u02A6\x07!\x02\x02\u02A6\u02A8" + - "\x05\x8EH\x02\u02A7\u02A5\x03\x02\x02\x02\u02A8\u02AB\x03\x02\x02\x02" + - "\u02A9\u02A7\x03\x02\x02\x02\u02A9\u02AA\x03\x02\x02\x02\u02AA\x93\x03" + - "\x02\x02\x02\u02AB\u02A9\x03\x02\x02\x02\u02AC\u02B0\x05\x96L\x02\u02AD" + - "\u02B0\x05\x98M\x02\u02AE\u02B0\x05\x9AN\x02\u02AF\u02AC\x03\x02\x02\x02" + - "\u02AF\u02AD\x03\x02\x02\x02\u02AF\u02AE\x03\x02\x02\x02\u02B0\x95\x03" + - "\x02\x02\x02\u02B1\u02B2\x05\x9CO\x02\u02B2\x97\x03\x02\x02\x02\u02B3" + - "\u02B4\x05\x9CO\x02\u02B4\u02B5\x07?\x02\x02\u02B5\u02B6\x05\x9CO\x02" + - "\u02B6\u02B7\x07A\x02\x02\u02B7\x99\x03\x02\x02\x02\u02B8\u02B9\x07\x1D" + - "\x02\x02\u02B9\u02BA\x07%\x02\x02\u02BA\u02BB\x05\x9CO\x02\u02BB\u02BC" + - "\x07&\x02\x02\u02BC\x9B\x03\x02\x02\x02\u02BD\u02BE\t\x10\x02\x02\u02BE" + - "\x9D\x03\x02\x02\x02?\x9F\xA6\xAD\xB2\xBA\xC6\xD2\xD8\xDF\xF6\xFB\u0106" + - "\u010F\u0119\u0126\u012B\u0131\u0135\u013B\u0141\u0159\u0166\u0174\u017C" + - "\u0184\u0188\u018D\u0190\u0195\u0198\u01A2\u01A5\u01A8\u01B2\u01B5\u01B8" + - "\u01C8\u01CD\u01D2\u01E2\u01E4\u01EC\u01FA\u0200\u0206\u020E\u021F\u0229" + - "\u0234\u0240\u024D\u0258\u0263\u026E\u0279\u0284\u028F\u0299\u02A0\u02A9" + - "\u02AF"; + "\x02\x02\x02\u0224\u0225\x03\x02\x02\x02\u0225\u0226\x07(\x02\x02\u0226" + + "m\x03\x02\x02\x02\u0227\u022A\x05d3\x02\u0228\u022A\x05p9\x02\u0229\u0227" + + "\x03\x02\x02\x02\u0229\u0228\x03\x02\x02\x02\u022Ao\x03\x02\x02\x02\u022B" + + "\u022C\x05d3\x02\u022C\u022D\x05x=\x02\u022Dq\x03\x02\x02\x02\u022E\u0232" + + "\x05n8\x02\u022F\u0232\x05t;\x02\u0230\u0232\x05v<\x02\u0231\u022E\x03" + + "\x02\x02\x02\u0231\u022F\x03\x02\x02\x02\u0231\u0230\x03\x02\x02\x02\u0232" + + "s\x03\x02\x02\x02\u0233\u0234\x05x=\x02\u0234\u0235\x05n8\x02\u0235u\x03" + + "\x02\x02\x02\u0236\u0237\x05z>\x02\u0237\u0238\x05n8\x02\u0238w\x03\x02" + + "\x02\x02\u0239\u023A\t\b\x02\x02\u023Ay\x03\x02\x02\x02\u023B\u023C\t" + + "\t\x02\x02\u023C{\x03\x02\x02\x02\u023D\u0243\x05r:\x02\u023E\u023F\x05" + + "r:\x02\u023F\u0240\x07\b\x02\x02\u0240\u0241\x05\x9CO\x02\u0241\u0243" + + "\x03\x02\x02\x02\u0242\u023D\x03\x02\x02\x02\u0242\u023E\x03\x02\x02\x02" + + "\u0243}\x03\x02\x02\x02\u0244\u0245\b@\x01\x02\u0245\u0246\x05|?\x02\u0246" + + "\u024C\x03\x02\x02\x02\u0247\u0248\f\x03\x02\x02\u0248\u0249\t\n\x02\x02" + + "\u0249\u024B\x05|?\x02\u024A\u0247\x03\x02\x02\x02\u024B\u024E\x03\x02" + + "\x02\x02\u024C\u024A\x03\x02\x02\x02\u024C\u024D\x03\x02\x02\x02\u024D" + + "\x7F\x03\x02\x02\x02\u024E\u024C\x03\x02\x02\x02\u024F\u0250\bA\x01\x02" + + "\u0250\u0251\x05~@\x02\u0251\u0257\x03\x02\x02\x02\u0252\u0253\f\x03\x02" + + "\x02\u0253\u0254\t\v\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\x81\x03\x02\x02\x02\u0259\u0257\x03\x02\x02" + + "\x02\u025A\u025B\bB\x01\x02\u025B\u025C\x05\x80A\x02\u025C\u0263\x03\x02" + + "\x02\x02\u025D\u025E\f\x03\x02\x02\u025E\u025F\x05\x84C\x02\u025F\u0260" + + "\x05\x8AF\x02\u0260\u0262\x03\x02\x02\x02\u0261\u025D\x03\x02\x02\x02" + + "\u0262\u0265\x03\x02\x02\x02\u0263\u0261\x03\x02\x02\x02\u0263\u0264\x03" + + "\x02\x02\x02\u0264\x83\x03\x02\x02\x02\u0265\u0263\x03\x02\x02\x02\u0266" + + "\u0267\t\f\x02\x02\u0267\x85\x03\x02\x02\x02\u0268\u0269\bD\x01\x02\u0269" + + "\u026A\x05\x82B\x02\u026A\u0270\x03\x02\x02\x02\u026B\u026C\f\x03\x02" + + "\x02\u026C\u026D\t\r\x02\x02\u026D\u026F\x05\x82B\x02\u026E\u026B\x03" + + "\x02\x02\x02\u026F\u0272\x03\x02\x02\x02\u0270\u026E\x03\x02\x02\x02\u0270" + + "\u0271\x03\x02\x02\x02\u0271\x87\x03\x02\x02\x02\u0272\u0270\x03\x02\x02" + + "\x02\u0273\u0274\bE\x01\x02\u0274\u0275\x05\x86D\x02\u0275\u027B\x03\x02" + + "\x02\x02\u0276\u0277\f\x03\x02\x02\u0277\u0278\t\x0E\x02\x02\u0278\u027A" + + "\x05\x86D\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\x89\x03" + + "\x02\x02\x02\u027D\u027B\x03\x02\x02\x02\u027E\u027F\bF\x01\x02\u027F" + + "\u0280\x05\x88E\x02\u0280\u0286\x03\x02\x02\x02\u0281\u0282\f\x03\x02" + + "\x02\u0282\u0283\x07C\x02\x02\u0283\u0285\x05\x88E\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\x8B\x03\x02\x02\x02\u0288\u0286\x03\x02\x02" + + "\x02\u0289\u028A\bG\x01\x02\u028A\u028B\x05\x8AF\x02\u028B\u0291\x03\x02" + + "\x02\x02\u028C\u028D\f\x03\x02\x02\u028D\u028E\x07E\x02\x02\u028E\u0290" + + "\x05\x8AF\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\x8D\x03" + + "\x02\x02\x02\u0293\u0291\x03\x02\x02\x02\u0294\u0295\bH\x01\x02\u0295" + + "\u0296\x05\x8CG\x02\u0296\u029C\x03\x02\x02\x02\u0297\u0298\f\x03\x02" + + "\x02\u0298\u0299\x07D\x02\x02\u0299\u029B\x05\x8CG\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\x8F\x03\x02\x02\x02\u029E\u029C\x03\x02\x02" + + "\x02\u029F\u02A0\bI\x01\x02\u02A0\u02A1\x05\x8EH\x02\u02A1\u02A7\x03\x02" + + "\x02\x02\u02A2\u02A3\f\x03\x02\x02\u02A3\u02A4\x074\x02\x02\u02A4\u02A6" + + "\x05\x8EH\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\x91\x03" + + "\x02\x02\x02\u02A9\u02A7\x03\x02\x02\x02\u02AA\u02AB\bJ\x01\x02\u02AB" + + "\u02AC\x05\x90I\x02\u02AC\u02B2\x03\x02\x02\x02\u02AD\u02AE\f\x03\x02" + + "\x02\u02AE\u02AF\x075\x02\x02\u02AF\u02B1\x05\x90I\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\x93\x03\x02\x02\x02\u02B4\u02B2\x03\x02\x02" + + "\x02\u02B5\u02BD\x05\x92J\x02\u02B6\u02B7\x05\x92J\x02\u02B7\u02B8\x07" + + "#\x02\x02\u02B8\u02B9\x05\x94K\x02\u02B9\u02BA\x07$\x02\x02\u02BA\u02BB" + + "\x05\x94K\x02\u02BB\u02BD\x03\x02\x02\x02\u02BC\u02B5\x03\x02\x02\x02" + + "\u02BC\u02B6\x03\x02\x02\x02\u02BD\x95\x03\x02\x02\x02\u02BE\u02C4\x05" + + "\x94K\x02\u02BF\u02C0\x05d3\x02\u02C0\u02C1\x05\x98M\x02\u02C1\u02C2\x05" + + "\x96L\x02\u02C2\u02C4\x03\x02\x02\x02\u02C3\u02BE\x03\x02\x02\x02\u02C3" + + "\u02BF\x03\x02\x02\x02\u02C4\x97\x03\x02\x02\x02\u02C5\u02C6\t\x0F\x02" + + "\x02\u02C6\x99\x03\x02\x02\x02\u02C7\u02CC\x05\x96L\x02\u02C8\u02C9\x07" + + "!\x02\x02\u02C9\u02CB\x05\x96L\x02\u02CA\u02C8\x03\x02\x02\x02\u02CB\u02CE" + + "\x03\x02\x02\x02\u02CC\u02CA\x03\x02\x02\x02\u02CC\u02CD\x03\x02\x02\x02" + + "\u02CD\x9B\x03\x02\x02\x02\u02CE\u02CC\x03\x02\x02\x02\u02CF\u02D3\x05" + + "\x9EP\x02\u02D0\u02D3\x05\xA0Q\x02\u02D1\u02D3\x05\xA2R\x02\u02D2\u02CF" + + "\x03\x02\x02\x02\u02D2\u02D0\x03\x02\x02\x02\u02D2\u02D1\x03\x02\x02\x02" + + "\u02D3\x9D\x03\x02\x02\x02\u02D4\u02D5\x05\xA4S\x02\u02D5\x9F\x03\x02" + + "\x02\x02\u02D6\u02D7\x05\xA4S\x02\u02D7\u02D8\x07?\x02\x02\u02D8\u02D9" + + "\x05\xA4S\x02\u02D9\u02DA\x07A\x02\x02\u02DA\xA1\x03\x02\x02\x02\u02DB" + + "\u02DC\x07\x1D\x02\x02\u02DC\u02DD\x07%\x02\x02\u02DD\u02DE\x05\xA4S\x02" + + "\u02DE\u02DF\x07&\x02\x02\u02DF\xA3\x03\x02\x02\x02\u02E0\u02E1\t\x10" + + "\x02\x02\u02E1\xA5\x03\x02\x02\x02C\xA7\xAE\xB5\xBA\xC2\xCE\xDA\xE0\xE7" + + "\xF2\xF9\xFD\u0107\u0119\u011E\u0129\u0132\u013C\u0149\u014E\u0154\u0158" + + "\u015E\u0164\u017C\u0189\u0197\u019F\u01A7\u01AB\u01B0\u01B3\u01B8\u01BB" + + "\u01C5\u01C8\u01CB\u01D5\u01D8\u01DB\u01EB\u01F0\u01F5\u0205\u0207\u020F" + + "\u021D\u0223\u0229\u0231\u0242\u024C\u0257\u0263\u0270\u027B\u0286\u0291" + + "\u029C\u02A7\u02B2\u02BC\u02C3\u02CC\u02D2"; public static readonly _serializedATN: string = Utils.join( - [KipperParser._serializedATNSegment0, KipperParser._serializedATNSegment1], + [ + KipperParser._serializedATNSegment0, + KipperParser._serializedATNSegment1, + ], "", ); public static __ATN: ATN; @@ -4966,12 +4673,11 @@ export class KipperParser extends KipperParserBase { return KipperParser.__ATN; } + } export class CompilationUnitContext extends KipperParserRuleContext { - public EOF(): TerminalNode { - return this.getToken(KipperParser.EOF, 0); - } + public EOF(): TerminalNode { return this.getToken(KipperParser.EOF, 0); } public translationUnit(): TranslationUnitContext | undefined { return this.tryGetRuleContext(0, TranslationUnitContext); } @@ -4979,9 +4685,7 @@ export class CompilationUnitContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_compilationUnit; - } + public get ruleIndex(): number { return KipperParser.RULE_compilationUnit; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterCompilationUnit) { @@ -5004,6 +4708,7 @@ export class CompilationUnitContext extends KipperParserRuleContext { } } + export class TranslationUnitContext extends KipperParserRuleContext { public externalItem(): ExternalItemContext[]; public externalItem(i: number): ExternalItemContext; @@ -5018,9 +4723,7 @@ export class TranslationUnitContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_translationUnit; - } + public get ruleIndex(): number { return KipperParser.RULE_translationUnit; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTranslationUnit) { @@ -5043,14 +4746,13 @@ export class TranslationUnitContext extends KipperParserRuleContext { } } + export class ExternalItemContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_externalItem; - } + public get ruleIndex(): number { return KipperParser.RULE_externalItem; } public copyFrom(ctx: ExternalItemContext): void { super.copyFrom(ctx); } @@ -5085,6 +4787,7 @@ export class ExternalBlockItemContext extends ExternalItemContext { } } + export class BlockItemListContext extends KipperParserRuleContext { public blockItem(): BlockItemContext[]; public blockItem(i: number): BlockItemContext; @@ -5099,9 +4802,7 @@ export class BlockItemListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_blockItemList; - } + public get ruleIndex(): number { return KipperParser.RULE_blockItemList; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBlockItemList) { @@ -5124,6 +4825,7 @@ export class BlockItemListContext extends KipperParserRuleContext { } } + export class BlockItemContext extends KipperParserRuleContext { public statement(): StatementContext | undefined { return this.tryGetRuleContext(0, StatementContext); @@ -5131,16 +4833,12 @@ export class BlockItemContext extends KipperParserRuleContext { public declaration(): DeclarationContext | undefined { return this.tryGetRuleContext(0, DeclarationContext); } - public SemiColon(): TerminalNode | undefined { - return this.tryGetToken(KipperParser.SemiColon, 0); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_blockItem; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBlockItem) { @@ -5163,13 +4861,12 @@ export class BlockItemContext extends KipperParserRuleContext { } } + 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 SemiColon(): TerminalNode | undefined { return this.tryGetToken(KipperParser.SemiColon, 0); } public functionDeclaration(): FunctionDeclarationContext | undefined { return this.tryGetRuleContext(0, FunctionDeclarationContext); } @@ -5183,9 +4880,7 @@ export class DeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_declaration; - } + public get ruleIndex(): number { return KipperParser.RULE_declaration; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDeclaration) { @@ -5208,6 +4903,7 @@ export class DeclarationContext extends KipperParserRuleContext { } } + export class VariableDeclarationContext extends KipperParserRuleContext { public storageTypeSpecifier(): StorageTypeSpecifierContext { return this.getRuleContext(0, StorageTypeSpecifierContext); @@ -5219,9 +4915,7 @@ export class VariableDeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_variableDeclaration; - } + public get ruleIndex(): number { return KipperParser.RULE_variableDeclaration; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterVariableDeclaration) { @@ -5244,20 +4938,15 @@ export class VariableDeclarationContext extends KipperParserRuleContext { } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_storageTypeSpecifier; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStorageTypeSpecifier) { @@ -5280,19 +4969,16 @@ export class StorageTypeSpecifierContext extends KipperParserRuleContext { } } + export class InitDeclaratorContext extends KipperParserRuleContext { public declarator(): DeclaratorContext { return this.getRuleContext(0, DeclaratorContext); } - public Colon(): TerminalNode { - return this.getToken(KipperParser.Colon, 0); - } + 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 Assign(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Assign, 0); } public initializer(): InitializerContext | undefined { return this.tryGetRuleContext(0, InitializerContext); } @@ -5300,9 +4986,7 @@ export class InitDeclaratorContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_initDeclarator; - } + public get ruleIndex(): number { return KipperParser.RULE_initDeclarator; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterInitDeclarator) { @@ -5325,6 +5009,7 @@ export class InitDeclaratorContext extends KipperParserRuleContext { } } + export class InitializerContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext { return this.getRuleContext(0, AssignmentExpressionContext); @@ -5333,9 +5018,7 @@ export class InitializerContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_initializer; - } + public get ruleIndex(): number { return KipperParser.RULE_initializer; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterInitializer) { @@ -5358,6 +5041,7 @@ export class InitializerContext extends KipperParserRuleContext { } } + export class DeclaratorContext extends KipperParserRuleContext { public directDeclarator(): DirectDeclaratorContext { return this.getRuleContext(0, DirectDeclaratorContext); @@ -5366,9 +5050,7 @@ export class DeclaratorContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_declarator; - } + public get ruleIndex(): number { return KipperParser.RULE_declarator; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDeclarator) { @@ -5391,17 +5073,14 @@ export class DeclaratorContext extends KipperParserRuleContext { } } + export class DirectDeclaratorContext extends KipperParserRuleContext { - public Identifier(): TerminalNode { - return this.getToken(KipperParser.Identifier, 0); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_directDeclarator; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDirectDeclarator) { @@ -5424,22 +5103,15 @@ export class DirectDeclaratorContext extends KipperParserRuleContext { } } + export class FunctionDeclarationContext extends KipperParserRuleContext { - public DefFunc(): TerminalNode { - return this.getToken(KipperParser.DefFunc, 0); - } + 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 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); } @@ -5453,9 +5125,7 @@ export class FunctionDeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_functionDeclaration; - } + public get ruleIndex(): number { return KipperParser.RULE_functionDeclaration; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFunctionDeclaration) { @@ -5478,6 +5148,7 @@ export class FunctionDeclarationContext extends KipperParserRuleContext { } } + export class ParameterListContext extends KipperParserRuleContext { public parameterDeclaration(): ParameterDeclarationContext[]; public parameterDeclaration(i: number): ParameterDeclarationContext; @@ -5501,9 +5172,7 @@ export class ParameterListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_parameterList; - } + public get ruleIndex(): number { return KipperParser.RULE_parameterList; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterParameterList) { @@ -5526,13 +5195,12 @@ export class ParameterListContext extends KipperParserRuleContext { } } + export class ParameterDeclarationContext extends KipperParserRuleContext { public declarator(): DeclaratorContext { return this.getRuleContext(0, DeclaratorContext); } - public Colon(): TerminalNode { - return this.getToken(KipperParser.Colon, 0); - } + public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } public typeSpecifierExpression(): TypeSpecifierExpressionContext { return this.getRuleContext(0, TypeSpecifierExpressionContext); } @@ -5540,9 +5208,7 @@ export class ParameterDeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_parameterDeclaration; - } + public get ruleIndex(): number { return KipperParser.RULE_parameterDeclaration; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterParameterDeclaration) { @@ -5565,68 +5231,201 @@ export class ParameterDeclarationContext extends KipperParserRuleContext { } } + export class InterfaceDeclarationContext extends KipperParserRuleContext { - public Interface(): TerminalNode { - return this.getToken(KipperParser.Interface, 0); + public Interface(): TerminalNode { return this.getToken(KipperParser.Interface, 0); } + public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } + public LeftBrace(): TerminalNode { return this.getToken(KipperParser.LeftBrace, 0); } + public RightBrace(): TerminalNode { return this.getToken(KipperParser.RightBrace, 0); } + public interfaceMemberList(): InterfaceMemberListContext | undefined { + return this.tryGetRuleContext(0, InterfaceMemberListContext); + } + 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) { + return visitor.visitInterfaceDeclaration(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class InterfaceMemberListContext extends KipperParserRuleContext { + 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_interfaceMemberList; } + // @Override + public enterRule(listener: KipperParserListener): void { + if (listener.enterInterfaceMemberList) { + listener.enterInterfaceMemberList(this); + } + } + // @Override + public exitRule(listener: KipperParserListener): void { + if (listener.exitInterfaceMemberList) { + listener.exitInterfaceMemberList(this); + } + } + // @Override + public accept(visitor: KipperParserVisitor): Result { + if (visitor.visitInterfaceMemberList) { + return visitor.visitInterfaceMemberList(this); + } else { + return visitor.visitChildren(this); + } + } +} + + +export class InterfaceMemberDeclarationContext extends KipperParserRuleContext { + public propertySignature(): PropertySignatureContext | undefined { + return this.tryGetRuleContext(0, PropertySignatureContext); + } + public methodSignature(): MethodSignatureContext | undefined { + return this.tryGetRuleContext(0, MethodSignatureContext); + } + 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); + } + } +} + + +export class PropertySignatureContext extends KipperParserRuleContext { + public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 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); } + constructor(parent: ParserRuleContext | undefined, invokingState: number) { + super(parent, invokingState); + } + // @Override + public get ruleIndex(): number { return KipperParser.RULE_propertySignature; } + // @Override + public enterRule(listener: KipperParserListener): void { + if (listener.enterPropertySignature) { + listener.enterPropertySignature(this); + } + } + // @Override + public exitRule(listener: KipperParserListener): void { + if (listener.exitPropertySignature) { + listener.exitPropertySignature(this); + } } - public Identifier(): TerminalNode { - return this.getToken(KipperParser.Identifier, 0); + // @Override + public accept(visitor: KipperParserVisitor): Result { + if (visitor.visitPropertySignature) { + return visitor.visitPropertySignature(this); + } else { + return visitor.visitChildren(this); + } } - public LeftBrace(): TerminalNode { - return this.getToken(KipperParser.LeftBrace, 0); +} + + +export class MethodSignatureContext extends KipperParserRuleContext { + public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } + 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 RightBrace(): TerminalNode { - return this.getToken(KipperParser.RightBrace, 0); + 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_interfaceDeclaration; - } + public get ruleIndex(): number { return KipperParser.RULE_methodSignature; } // @Override public enterRule(listener: KipperParserListener): void { - if (listener.enterInterfaceDeclaration) { - listener.enterInterfaceDeclaration(this); + if (listener.enterMethodSignature) { + listener.enterMethodSignature(this); } } // @Override public exitRule(listener: KipperParserListener): void { - if (listener.exitInterfaceDeclaration) { - listener.exitInterfaceDeclaration(this); + if (listener.exitMethodSignature) { + listener.exitMethodSignature(this); } } // @Override public accept(visitor: KipperParserVisitor): Result { - if (visitor.visitInterfaceDeclaration) { - return visitor.visitInterfaceDeclaration(this); + if (visitor.visitMethodSignature) { + return visitor.visitMethodSignature(this); } else { return visitor.visitChildren(this); } } } + export class ClassDeclarationContext extends KipperParserRuleContext { - public Class(): TerminalNode { - return this.getToken(KipperParser.Class, 0); - } - public Identifier(): TerminalNode { - return this.getToken(KipperParser.Identifier, 0); - } - public LeftBrace(): TerminalNode { - return this.getToken(KipperParser.LeftBrace, 0); - } - public RightBrace(): TerminalNode { - return this.getToken(KipperParser.RightBrace, 0); - } + public Class(): TerminalNode { return this.getToken(KipperParser.Class, 0); } + public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_classDeclaration; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterClassDeclaration) { @@ -5649,6 +5448,7 @@ export class ClassDeclarationContext extends KipperParserRuleContext { } } + export class StatementContext extends KipperParserRuleContext { public expressionStatement(): ExpressionStatementContext | undefined { return this.tryGetRuleContext(0, ExpressionStatementContext); @@ -5672,9 +5472,7 @@ export class StatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_statement; - } + public get ruleIndex(): number { return KipperParser.RULE_statement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStatement) { @@ -5697,13 +5495,10 @@ export class StatementContext extends KipperParserRuleContext { } } + export class CompoundStatementContext extends KipperParserRuleContext { - public LeftBrace(): TerminalNode { - return this.getToken(KipperParser.LeftBrace, 0); - } - public RightBrace(): TerminalNode { - return this.getToken(KipperParser.RightBrace, 0); - } + 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); } @@ -5711,9 +5506,7 @@ export class CompoundStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_compoundStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_compoundStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterCompoundStatement) { @@ -5736,20 +5529,17 @@ export class CompoundStatementContext extends KipperParserRuleContext { } } + export class ExpressionStatementContext extends KipperParserRuleContext { public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } - public SemiColon(): TerminalNode { - return this.getToken(KipperParser.SemiColon, 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_expressionStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_expressionStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterExpressionStatement) { @@ -5772,6 +5562,7 @@ export class ExpressionStatementContext extends KipperParserRuleContext { } } + export class SelectionStatementContext extends KipperParserRuleContext { public ifStatement(): IfStatementContext | undefined { return this.tryGetRuleContext(0, IfStatementContext); @@ -5783,9 +5574,7 @@ export class SelectionStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_selectionStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_selectionStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSelectionStatement) { @@ -5808,19 +5597,14 @@ export class SelectionStatementContext extends KipperParserRuleContext { } } + export class IfStatementContext extends KipperParserRuleContext { - public If(): TerminalNode { - return this.getToken(KipperParser.If, 0); - } - public LeftParen(): TerminalNode { - return this.getToken(KipperParser.LeftParen, 0); - } + 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 RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } public statement(): StatementContext[]; public statement(i: number): StatementContext; public statement(i?: number): StatementContext | StatementContext[] { @@ -5830,16 +5614,12 @@ export class IfStatementContext extends KipperParserRuleContext { return this.getRuleContext(i, StatementContext); } } - public Else(): TerminalNode | undefined { - return this.tryGetToken(KipperParser.Else, 0); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_ifStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIfStatement) { @@ -5862,25 +5642,16 @@ export class IfStatementContext extends KipperParserRuleContext { } } + export class SwitchStatementContext extends KipperParserRuleContext { - public Switch(): TerminalNode { - return this.getToken(KipperParser.Switch, 0); - } - public LeftParen(): TerminalNode { - return this.getToken(KipperParser.LeftParen, 0); - } + 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 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[] { @@ -5894,9 +5665,7 @@ export class SwitchStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_switchStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_switchStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSwitchStatement) { @@ -5919,29 +5688,22 @@ export class SwitchStatementContext extends KipperParserRuleContext { } } + export class SwitchLabeledStatementContext extends KipperParserRuleContext { - public Case(): TerminalNode | undefined { - return this.tryGetToken(KipperParser.Case, 0); - } + 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 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_switchLabeledStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSwitchLabeledStatement) { @@ -5964,6 +5726,7 @@ export class SwitchLabeledStatementContext extends KipperParserRuleContext { } } + export class IterationStatementContext extends KipperParserRuleContext { public forLoopIterationStatement(): ForLoopIterationStatementContext | undefined { return this.tryGetRuleContext(0, ForLoopIterationStatementContext); @@ -5978,9 +5741,7 @@ export class IterationStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_iterationStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_iterationStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIterationStatement) { @@ -6003,16 +5764,13 @@ export class IterationStatementContext extends KipperParserRuleContext { } } + 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 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[] { @@ -6022,9 +5780,7 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { return this.getToken(KipperParser.SemiColon, i); } } - public RightParen(): TerminalNode { - return this.getToken(KipperParser.RightParen, 0); - } + public RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } public statement(): StatementContext { return this.getRuleContext(0, StatementContext); } @@ -6044,9 +5800,7 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_forLoopIterationStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_forLoopIterationStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterForLoopIterationStatement) { @@ -6069,19 +5823,14 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { } } + export class WhileLoopIterationStatementContext extends KipperParserRuleContext { - public While(): TerminalNode { - return this.getToken(KipperParser.While, 0); - } - public LeftParen(): TerminalNode { - return this.getToken(KipperParser.LeftParen, 0); - } + 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 RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } public statement(): StatementContext { return this.getRuleContext(0, StatementContext); } @@ -6089,9 +5838,7 @@ export class WhileLoopIterationStatementContext extends KipperParserRuleContext super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_whileLoopIterationStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_whileLoopIterationStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterWhileLoopIterationStatement) { @@ -6114,35 +5861,24 @@ export class WhileLoopIterationStatementContext extends KipperParserRuleContext } } + export class DoWhileLoopIterationStatementContext extends KipperParserRuleContext { - public Do(): TerminalNode { - return this.getToken(KipperParser.Do, 0); - } + 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 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_doWhileLoopIterationStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDoWhileLoopIterationStatement) { @@ -6165,23 +5901,16 @@ export class DoWhileLoopIterationStatementContext extends KipperParserRuleContex } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_jumpStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterJumpStatement) { @@ -6204,13 +5933,10 @@ export class JumpStatementContext extends KipperParserRuleContext { } } + export class ReturnStatementContext extends KipperParserRuleContext { - public Return(): TerminalNode { - return this.getToken(KipperParser.Return, 0); - } - public SemiColon(): TerminalNode { - return this.getToken(KipperParser.SemiColon, 0); - } + 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); } @@ -6218,9 +5944,7 @@ export class ReturnStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_returnStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_returnStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterReturnStatement) { @@ -6243,6 +5967,7 @@ export class ReturnStatementContext extends KipperParserRuleContext { } } + export class PrimaryExpressionContext extends KipperParserRuleContext { public tangledPrimaryExpression(): TangledPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, TangledPrimaryExpressionContext); @@ -6275,9 +6000,7 @@ export class PrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_primaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_primaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPrimaryExpression) { @@ -6300,23 +6023,18 @@ export class PrimaryExpressionContext extends KipperParserRuleContext { } } + export class TangledPrimaryExpressionContext extends KipperParserRuleContext { - public LeftParen(): TerminalNode { - return this.getToken(KipperParser.LeftParen, 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 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; - } + public get ruleIndex(): number { return KipperParser.RULE_tangledPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTangledPrimaryExpression) { @@ -6339,20 +6057,15 @@ export class TangledPrimaryExpressionContext extends KipperParserRuleContext { } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_boolPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBoolPrimaryExpression) { @@ -6375,6 +6088,7 @@ export class BoolPrimaryExpressionContext extends KipperParserRuleContext { } } + export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext { public identifier(): IdentifierContext { return this.getRuleContext(0, IdentifierContext); @@ -6383,9 +6097,7 @@ export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_identifierPrimaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_identifierPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierPrimaryExpression) { @@ -6408,17 +6120,14 @@ export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext } } + export class IdentifierContext extends KipperParserRuleContext { - public Identifier(): TerminalNode { - return this.getToken(KipperParser.Identifier, 0); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_identifier; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifier) { @@ -6441,6 +6150,7 @@ export class IdentifierContext extends KipperParserRuleContext { } } + export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRuleContext { public identifier(): IdentifierContext | undefined { return this.tryGetRuleContext(0, IdentifierContext); @@ -6452,9 +6162,7 @@ export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRule super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_identifierOrStringPrimaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_identifierOrStringPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierOrStringPrimaryExpression) { @@ -6477,20 +6185,15 @@ export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRule } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_stringPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStringPrimaryExpression) { @@ -6513,13 +6216,10 @@ export class StringPrimaryExpressionContext extends KipperParserRuleContext { } } + 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 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[] { @@ -6529,12 +6229,8 @@ 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 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[] { @@ -6548,9 +6244,7 @@ export class FStringPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_fStringPrimaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_fStringPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringPrimaryExpression) { @@ -6573,16 +6267,11 @@ export class FStringPrimaryExpressionContext extends KipperParserRuleContext { } } + 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 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); } @@ -6590,9 +6279,7 @@ export class FStringSingleQuoteAtomContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_fStringSingleQuoteAtom; - } + public get ruleIndex(): number { return KipperParser.RULE_fStringSingleQuoteAtom; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringSingleQuoteAtom) { @@ -6615,16 +6302,11 @@ export class FStringSingleQuoteAtomContext extends KipperParserRuleContext { } } + 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 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); } @@ -6632,9 +6314,7 @@ export class FStringDoubleQuoteAtomContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_fStringDoubleQuoteAtom; - } + public get ruleIndex(): number { return KipperParser.RULE_fStringDoubleQuoteAtom; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringDoubleQuoteAtom) { @@ -6657,20 +6337,15 @@ export class FStringDoubleQuoteAtomContext extends KipperParserRuleContext { } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_numberPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterNumberPrimaryExpression) { @@ -6693,13 +6368,10 @@ export class NumberPrimaryExpressionContext extends KipperParserRuleContext { } } + export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { - public LeftBracket(): TerminalNode { - return this.getToken(KipperParser.LeftBracket, 0); - } - public RightBracket(): TerminalNode { - return this.getToken(KipperParser.RightBracket, 0); - } + 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[] { @@ -6722,9 +6394,7 @@ export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_arrayPrimaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_arrayPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterArrayPrimaryExpression) { @@ -6747,13 +6417,10 @@ export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { } } + export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { - public LeftBrace(): TerminalNode { - return this.getToken(KipperParser.LeftBrace, 0); - } - public RightBrace(): TerminalNode { - return this.getToken(KipperParser.RightBrace, 0); - } + 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[] { @@ -6776,9 +6443,7 @@ export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_objectPrimaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_objectPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterObjectPrimaryExpression) { @@ -6801,13 +6466,12 @@ export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { } } + export class ObjectPropertyContext extends KipperParserRuleContext { public identifierOrStringPrimaryExpression(): IdentifierOrStringPrimaryExpressionContext { return this.getRuleContext(0, IdentifierOrStringPrimaryExpressionContext); } - public Colon(): TerminalNode { - return this.getToken(KipperParser.Colon, 0); - } + public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } @@ -6815,9 +6479,7 @@ export class ObjectPropertyContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_objectProperty; - } + public get ruleIndex(): number { return KipperParser.RULE_objectProperty; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterObjectProperty) { @@ -6840,23 +6502,16 @@ export class ObjectPropertyContext extends KipperParserRuleContext { } } + export class VoidOrNullOrUndefinedPrimaryExpressionContext extends KipperParserRuleContext { - 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_voidOrNullOrUndefinedPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterVoidOrNullOrUndefinedPrimaryExpression) { @@ -6879,15 +6534,14 @@ 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 get ruleIndex(): number { return KipperParser.RULE_computedPrimaryExpression; } public copyFrom(ctx: ComputedPrimaryExpressionContext): void { super.copyFrom(ctx); this._labelASTKind = ctx._labelASTKind; @@ -6926,12 +6580,8 @@ export class FunctionCallExpressionContext extends ComputedPrimaryExpressionCont 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 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); } @@ -6961,18 +6611,12 @@ export class FunctionCallExpressionContext extends ComputedPrimaryExpressionCont } } export class ExplicitCallFunctionCallExpressionContext extends ComputedPrimaryExpressionContext { - public CallFunc(): TerminalNode { - return this.getToken(KipperParser.CallFunc, 0); - } + 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 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); } @@ -7098,6 +6742,7 @@ export class SliceNotationMemberAccessExpressionContext extends ComputedPrimaryE } } + export class ArgumentExpressionListContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext[]; public assignmentExpression(i: number): AssignmentExpressionContext; @@ -7121,9 +6766,7 @@ export class ArgumentExpressionListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_argumentExpressionList; - } + public get ruleIndex(): number { return KipperParser.RULE_argumentExpressionList; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterArgumentExpressionList) { @@ -7146,10 +6789,9 @@ export class ArgumentExpressionListContext extends KipperParserRuleContext { } } + export class DotNotationContext extends KipperParserRuleContext { - public Dot(): TerminalNode { - return this.getToken(KipperParser.Dot, 0); - } + public Dot(): TerminalNode { return this.getToken(KipperParser.Dot, 0); } public identifier(): IdentifierContext { return this.getRuleContext(0, IdentifierContext); } @@ -7157,9 +6799,7 @@ export class DotNotationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_dotNotation; - } + public get ruleIndex(): number { return KipperParser.RULE_dotNotation; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDotNotation) { @@ -7182,23 +6822,18 @@ export class DotNotationContext extends KipperParserRuleContext { } } + export class BracketNotationContext extends KipperParserRuleContext { - public LeftBracket(): TerminalNode { - return this.getToken(KipperParser.LeftBracket, 0); - } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_bracketNotation; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBracketNotation) { @@ -7221,18 +6856,13 @@ 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 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[] { @@ -7246,9 +6876,7 @@ export class SliceNotationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_sliceNotation; - } + public get ruleIndex(): number { return KipperParser.RULE_sliceNotation; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSliceNotation) { @@ -7271,6 +6899,7 @@ export class SliceNotationContext extends KipperParserRuleContext { } } + export class PostfixExpressionContext extends KipperParserRuleContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, ComputedPrimaryExpressionContext); @@ -7282,9 +6911,7 @@ export class PostfixExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_postfixExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_postfixExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPostfixExpression) { @@ -7307,6 +6934,7 @@ export class PostfixExpressionContext extends KipperParserRuleContext { } } + export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRuleContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext { return this.getRuleContext(0, ComputedPrimaryExpressionContext); @@ -7318,9 +6946,7 @@ export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRu super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_incrementOrDecrementPostfixExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementPostfixExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementPostfixExpression) { @@ -7343,6 +6969,7 @@ export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRu } } + export class UnaryExpressionContext extends KipperParserRuleContext { public postfixExpression(): PostfixExpressionContext | undefined { return this.tryGetRuleContext(0, PostfixExpressionContext); @@ -7357,9 +6984,7 @@ export class UnaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_unaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_unaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterUnaryExpression) { @@ -7382,6 +7007,7 @@ export class UnaryExpressionContext extends KipperParserRuleContext { } } + export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRuleContext { public incrementOrDecrementOperator(): IncrementOrDecrementOperatorContext { return this.getRuleContext(0, IncrementOrDecrementOperatorContext); @@ -7393,9 +7019,7 @@ export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRule super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_incrementOrDecrementUnaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementUnaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementUnaryExpression) { @@ -7418,6 +7042,7 @@ export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRule } } + export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleContext { public unaryOperator(): UnaryOperatorContext { return this.getRuleContext(0, UnaryOperatorContext); @@ -7429,9 +7054,7 @@ export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleCont super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_operatorModifiedUnaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_operatorModifiedUnaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterOperatorModifiedUnaryExpression) { @@ -7454,20 +7077,15 @@ export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleCont } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementOperator; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementOperator) { @@ -7490,26 +7108,17 @@ export class IncrementOrDecrementOperatorContext extends KipperParserRuleContext } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_unaryOperator; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterUnaryOperator) { @@ -7532,14 +7141,13 @@ export class UnaryOperatorContext extends KipperParserRuleContext { } } + export class CastOrConvertExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_castOrConvertExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_castOrConvertExpression; } public copyFrom(ctx: CastOrConvertExpressionContext): void { super.copyFrom(ctx); } @@ -7577,9 +7185,7 @@ export class ActualCastOrConvertExpressionContext extends CastOrConvertExpressio public unaryExpression(): UnaryExpressionContext { return this.getRuleContext(0, UnaryExpressionContext); } - public As(): TerminalNode { - return this.getToken(KipperParser.As, 0); - } + public As(): TerminalNode { return this.getToken(KipperParser.As, 0); } public typeSpecifierExpression(): TypeSpecifierExpressionContext { return this.getRuleContext(0, TypeSpecifierExpressionContext); } @@ -7609,14 +7215,13 @@ export class ActualCastOrConvertExpressionContext extends CastOrConvertExpressio } } + export class MultiplicativeExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_multiplicativeExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_multiplicativeExpression; } public copyFrom(ctx: MultiplicativeExpressionContext): void { super.copyFrom(ctx); } @@ -7657,18 +7262,10 @@ export class ActualMultiplicativeExpressionContext extends MultiplicativeExpress 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); - } + 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); @@ -7695,14 +7292,13 @@ export class ActualMultiplicativeExpressionContext extends MultiplicativeExpress } } + export class AdditiveExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_additiveExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_additiveExpression; } public copyFrom(ctx: AdditiveExpressionContext): void { super.copyFrom(ctx); } @@ -7743,12 +7339,8 @@ export class ActualAdditiveExpressionContext extends 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); - } + 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); @@ -7775,14 +7367,13 @@ export class ActualAdditiveExpressionContext extends AdditiveExpressionContext { } } + export class BitwiseShiftExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_bitwiseShiftExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_bitwiseShiftExpression; } public copyFrom(ctx: BitwiseShiftExpressionContext): void { super.copyFrom(ctx); } @@ -7852,23 +7443,16 @@ export class ActualBitwiseShiftExpressionContext extends BitwiseShiftExpressionC } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_bitwiseShiftOperators; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBitwiseShiftOperators) { @@ -7891,14 +7475,13 @@ export class BitwiseShiftOperatorsContext extends KipperParserRuleContext { } } + export class RelationalExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_relationalExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_relationalExpression; } public copyFrom(ctx: RelationalExpressionContext): void { super.copyFrom(ctx); } @@ -7939,18 +7522,10 @@ export class ActualRelationalExpressionContext extends RelationalExpressionConte 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); - } + 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); @@ -7977,14 +7552,13 @@ export class ActualRelationalExpressionContext extends RelationalExpressionConte } } + export class EqualityExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_equalityExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_equalityExpression; } public copyFrom(ctx: EqualityExpressionContext): void { super.copyFrom(ctx); } @@ -8025,12 +7599,8 @@ export class ActualEqualityExpressionContext extends 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); - } + 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); @@ -8057,14 +7627,13 @@ export class ActualEqualityExpressionContext extends EqualityExpressionContext { } } + export class BitwiseAndExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_bitwiseAndExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_bitwiseAndExpression; } public copyFrom(ctx: BitwiseAndExpressionContext): void { super.copyFrom(ctx); } @@ -8102,9 +7671,7 @@ export class ActualBitwiseAndExpressionContext extends BitwiseAndExpressionConte public bitwiseAndExpression(): BitwiseAndExpressionContext { return this.getRuleContext(0, BitwiseAndExpressionContext); } - public BitwiseAnd(): TerminalNode { - return this.getToken(KipperParser.BitwiseAnd, 0); - } + public BitwiseAnd(): TerminalNode { return this.getToken(KipperParser.BitwiseAnd, 0); } public equalityExpression(): EqualityExpressionContext { return this.getRuleContext(0, EqualityExpressionContext); } @@ -8134,14 +7701,13 @@ export class ActualBitwiseAndExpressionContext extends BitwiseAndExpressionConte } } + export class BitwiseXorExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_bitwiseXorExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_bitwiseXorExpression; } public copyFrom(ctx: BitwiseXorExpressionContext): void { super.copyFrom(ctx); } @@ -8179,9 +7745,7 @@ export class ActualBitwiseXorExpressionContext extends BitwiseXorExpressionConte public bitwiseXorExpression(): BitwiseXorExpressionContext { return this.getRuleContext(0, BitwiseXorExpressionContext); } - public BitwiseXor(): TerminalNode { - return this.getToken(KipperParser.BitwiseXor, 0); - } + public BitwiseXor(): TerminalNode { return this.getToken(KipperParser.BitwiseXor, 0); } public bitwiseAndExpression(): BitwiseAndExpressionContext { return this.getRuleContext(0, BitwiseAndExpressionContext); } @@ -8211,14 +7775,13 @@ export class ActualBitwiseXorExpressionContext extends BitwiseXorExpressionConte } } + export class BitwiseOrExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_bitwiseOrExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_bitwiseOrExpression; } public copyFrom(ctx: BitwiseOrExpressionContext): void { super.copyFrom(ctx); } @@ -8256,9 +7819,7 @@ export class ActualBitwiseOrExpressionContext extends BitwiseOrExpressionContext public bitwiseOrExpression(): BitwiseOrExpressionContext { return this.getRuleContext(0, BitwiseOrExpressionContext); } - public BitwiseOr(): TerminalNode { - return this.getToken(KipperParser.BitwiseOr, 0); - } + public BitwiseOr(): TerminalNode { return this.getToken(KipperParser.BitwiseOr, 0); } public bitwiseXorExpression(): BitwiseXorExpressionContext { return this.getRuleContext(0, BitwiseXorExpressionContext); } @@ -8288,14 +7849,13 @@ export class ActualBitwiseOrExpressionContext extends BitwiseOrExpressionContext } } + export class LogicalAndExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_logicalAndExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_logicalAndExpression; } public copyFrom(ctx: LogicalAndExpressionContext): void { super.copyFrom(ctx); } @@ -8333,9 +7893,7 @@ export class ActualLogicalAndExpressionContext extends LogicalAndExpressionConte public logicalAndExpression(): LogicalAndExpressionContext { return this.getRuleContext(0, LogicalAndExpressionContext); } - public AndAnd(): TerminalNode { - return this.getToken(KipperParser.AndAnd, 0); - } + public AndAnd(): TerminalNode { return this.getToken(KipperParser.AndAnd, 0); } public bitwiseOrExpression(): BitwiseOrExpressionContext { return this.getRuleContext(0, BitwiseOrExpressionContext); } @@ -8365,14 +7923,13 @@ export class ActualLogicalAndExpressionContext extends LogicalAndExpressionConte } } + export class LogicalOrExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_logicalOrExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_logicalOrExpression; } public copyFrom(ctx: LogicalOrExpressionContext): void { super.copyFrom(ctx); } @@ -8410,9 +7967,7 @@ export class ActualLogicalOrExpressionContext extends LogicalOrExpressionContext public logicalOrExpression(): LogicalOrExpressionContext { return this.getRuleContext(0, LogicalOrExpressionContext); } - public OrOr(): TerminalNode { - return this.getToken(KipperParser.OrOr, 0); - } + public OrOr(): TerminalNode { return this.getToken(KipperParser.OrOr, 0); } public logicalAndExpression(): LogicalAndExpressionContext { return this.getRuleContext(0, LogicalAndExpressionContext); } @@ -8442,14 +7997,13 @@ export class ActualLogicalOrExpressionContext extends LogicalOrExpressionContext } } + export class ConditionalExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_conditionalExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_conditionalExpression; } public copyFrom(ctx: ConditionalExpressionContext): void { super.copyFrom(ctx); } @@ -8487,9 +8041,7 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon public logicalOrExpression(): LogicalOrExpressionContext { return this.getRuleContext(0, LogicalOrExpressionContext); } - public QuestionMark(): TerminalNode { - return this.getToken(KipperParser.QuestionMark, 0); - } + public QuestionMark(): TerminalNode { return this.getToken(KipperParser.QuestionMark, 0); } public conditionalExpression(): ConditionalExpressionContext[]; public conditionalExpression(i: number): ConditionalExpressionContext; public conditionalExpression(i?: number): ConditionalExpressionContext | ConditionalExpressionContext[] { @@ -8499,9 +8051,7 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon return this.getRuleContext(i, ConditionalExpressionContext); } } - public Colon(): TerminalNode { - return this.getToken(KipperParser.Colon, 0); - } + public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } constructor(ctx: ConditionalExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); @@ -8528,14 +8078,13 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon } } + export class AssignmentExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_assignmentExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_assignmentExpression; } public copyFrom(ctx: AssignmentExpressionContext): void { super.copyFrom(ctx); } @@ -8605,32 +8154,19 @@ export class ActualAssignmentExpressionContext extends AssignmentExpressionConte } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_assignmentOperator; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterAssignmentOperator) { @@ -8653,6 +8189,7 @@ export class AssignmentOperatorContext extends KipperParserRuleContext { } } + export class ExpressionContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext[]; public assignmentExpression(i: number): AssignmentExpressionContext; @@ -8676,9 +8213,7 @@ export class ExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_expression; - } + public get ruleIndex(): number { return KipperParser.RULE_expression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterExpression) { @@ -8701,6 +8236,7 @@ export class ExpressionContext extends KipperParserRuleContext { } } + export class TypeSpecifierExpressionContext extends KipperParserRuleContext { public identifierTypeSpecifierExpression(): IdentifierTypeSpecifierExpressionContext | undefined { return this.tryGetRuleContext(0, IdentifierTypeSpecifierExpressionContext); @@ -8715,9 +8251,7 @@ export class TypeSpecifierExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_typeSpecifierExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_typeSpecifierExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeSpecifierExpression) { @@ -8740,6 +8274,7 @@ export class TypeSpecifierExpressionContext extends KipperParserRuleContext { } } + export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleContext { public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext { return this.getRuleContext(0, TypeSpecifierIdentifierContext); @@ -8748,9 +8283,7 @@ export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleCo super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_identifierTypeSpecifierExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_identifierTypeSpecifierExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierTypeSpecifierExpression) { @@ -8773,6 +8306,7 @@ export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleCo } } + export class GenericTypeSpecifierExpressionContext extends KipperParserRuleContext { public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext[]; public typeSpecifierIdentifier(i: number): TypeSpecifierIdentifierContext; @@ -8783,19 +8317,13 @@ 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_genericTypeSpecifierExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterGenericTypeSpecifierExpression) { @@ -8818,26 +8346,19 @@ export class GenericTypeSpecifierExpressionContext extends KipperParserRuleConte } } + export class TypeofTypeSpecifierExpressionContext extends KipperParserRuleContext { - public Typeof(): TerminalNode { - return this.getToken(KipperParser.Typeof, 0); - } - public LeftParen(): TerminalNode { - return this.getToken(KipperParser.LeftParen, 0); - } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_typeofTypeSpecifierExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeofTypeSpecifierExpression) { @@ -8860,26 +8381,17 @@ export class TypeofTypeSpecifierExpressionContext extends KipperParserRuleContex } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_typeSpecifierIdentifier; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeSpecifierIdentifier) { @@ -8901,3 +8413,5 @@ export class TypeSpecifierIdentifierContext extends KipperParserRuleContext { } } } + + diff --git a/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts b/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts index 16caac934..7f1e7d0b9 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts @@ -1,123 +1,130 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT -// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax -// kind values. + + // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax + // kind values. + import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; + import KipperParserBase from "./base/KipperParserBase"; + import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; -import { - ActualAdditiveExpressionContext, - ActualAssignmentExpressionContext, - ActualBitwiseAndExpressionContext, - ActualBitwiseOrExpressionContext, - ActualBitwiseShiftExpressionContext, - ActualBitwiseXorExpressionContext, - ActualCastOrConvertExpressionContext, - ActualConditionalExpressionContext, - ActualEqualityExpressionContext, - ActualLogicalAndExpressionContext, - ActualLogicalOrExpressionContext, - ActualMultiplicativeExpressionContext, - ActualRelationalExpressionContext, - AdditiveExpressionContext, - ArgumentExpressionListContext, - ArrayPrimaryExpressionContext, - AssignmentExpressionContext, - AssignmentOperatorContext, - BitwiseAndExpressionContext, - BitwiseOrExpressionContext, - BitwiseShiftExpressionContext, - BitwiseShiftOperatorsContext, - BitwiseXorExpressionContext, - BlockItemContext, - BlockItemListContext, - BoolPrimaryExpressionContext, - BracketNotationContext, - BracketNotationMemberAccessExpressionContext, - CastOrConvertExpressionContext, - ClassDeclarationContext, - CompilationUnitContext, - CompoundStatementContext, - ComputedPrimaryExpressionContext, - ConditionalExpressionContext, - DeclarationContext, - DeclaratorContext, - DirectDeclaratorContext, - DotNotationContext, - DotNotationMemberAccessExpressionContext, - DoWhileLoopIterationStatementContext, - EqualityExpressionContext, - ExplicitCallFunctionCallExpressionContext, - ExpressionContext, - ExpressionStatementContext, - ExternalBlockItemContext, - ExternalItemContext, - ForLoopIterationStatementContext, - FStringDoubleQuoteAtomContext, - FStringPrimaryExpressionContext, - FStringSingleQuoteAtomContext, - FunctionCallExpressionContext, - FunctionDeclarationContext, - GenericTypeSpecifierExpressionContext, - IdentifierContext, - IdentifierOrStringPrimaryExpressionContext, - IdentifierPrimaryExpressionContext, - IdentifierTypeSpecifierExpressionContext, - IfStatementContext, - IncrementOrDecrementOperatorContext, - IncrementOrDecrementPostfixExpressionContext, - IncrementOrDecrementUnaryExpressionContext, - InitDeclaratorContext, - InitializerContext, - InterfaceDeclarationContext, - IterationStatementContext, - JumpStatementContext, - LogicalAndExpressionContext, - LogicalOrExpressionContext, - MultiplicativeExpressionContext, - NumberPrimaryExpressionContext, - ObjectPrimaryExpressionContext, - ObjectPropertyContext, - OperatorModifiedUnaryExpressionContext, - ParameterDeclarationContext, - ParameterListContext, - PassOnAdditiveExpressionContext, - PassOnAssignmentExpressionContext, - PassOnBitwiseAndExpressionContext, - PassOnBitwiseOrExpressionContext, - PassOnBitwiseShiftExpressionContext, - PassOnBitwiseXorExpressionContext, - PassOnCastOrConvertExpressionContext, - PassOncomputedPrimaryExpressionContext, - PassOnConditionalExpressionContext, - PassOnEqualityExpressionContext, - PassOnLogicalAndExpressionContext, - PassOnLogicalOrExpressionContext, - PassOnMultiplicativeExpressionContext, - PassOnRelationalExpressionContext, - PostfixExpressionContext, - PrimaryExpressionContext, - RelationalExpressionContext, - ReturnStatementContext, - SelectionStatementContext, - SliceNotationContext, - SliceNotationMemberAccessExpressionContext, - StatementContext, - StorageTypeSpecifierContext, - StringPrimaryExpressionContext, - SwitchLabeledStatementContext, - SwitchStatementContext, - TangledPrimaryExpressionContext, - TranslationUnitContext, - TypeofTypeSpecifierExpressionContext, - TypeSpecifierExpressionContext, - TypeSpecifierIdentifierContext, - UnaryExpressionContext, - UnaryOperatorContext, - VariableDeclarationContext, - VoidOrNullOrUndefinedPrimaryExpressionContext, - WhileLoopIterationStatementContext, -} from "./KipperParser"; +import { PassOnBitwiseShiftExpressionContext } from "./KipperParser"; +import { ActualBitwiseShiftExpressionContext } from "./KipperParser"; +import { PassOnBitwiseAndExpressionContext } from "./KipperParser"; +import { ActualBitwiseAndExpressionContext } from "./KipperParser"; +import { PassOnLogicalAndExpressionContext } from "./KipperParser"; +import { ActualLogicalAndExpressionContext } from "./KipperParser"; +import { PassOnBitwiseXorExpressionContext } from "./KipperParser"; +import { ActualBitwiseXorExpressionContext } from "./KipperParser"; +import { ExternalBlockItemContext } from "./KipperParser"; +import { PassOncomputedPrimaryExpressionContext } from "./KipperParser"; +import { FunctionCallExpressionContext } from "./KipperParser"; +import { ExplicitCallFunctionCallExpressionContext } from "./KipperParser"; +import { DotNotationMemberAccessExpressionContext } from "./KipperParser"; +import { BracketNotationMemberAccessExpressionContext } from "./KipperParser"; +import { SliceNotationMemberAccessExpressionContext } from "./KipperParser"; +import { PassOnAssignmentExpressionContext } from "./KipperParser"; +import { ActualAssignmentExpressionContext } from "./KipperParser"; +import { PassOnCastOrConvertExpressionContext } from "./KipperParser"; +import { ActualCastOrConvertExpressionContext } from "./KipperParser"; +import { PassOnBitwiseOrExpressionContext } from "./KipperParser"; +import { ActualBitwiseOrExpressionContext } from "./KipperParser"; +import { PassOnEqualityExpressionContext } from "./KipperParser"; +import { ActualEqualityExpressionContext } from "./KipperParser"; +import { PassOnAdditiveExpressionContext } from "./KipperParser"; +import { ActualAdditiveExpressionContext } from "./KipperParser"; +import { PassOnRelationalExpressionContext } from "./KipperParser"; +import { ActualRelationalExpressionContext } from "./KipperParser"; +import { PassOnConditionalExpressionContext } from "./KipperParser"; +import { ActualConditionalExpressionContext } from "./KipperParser"; +import { PassOnMultiplicativeExpressionContext } from "./KipperParser"; +import { ActualMultiplicativeExpressionContext } from "./KipperParser"; +import { PassOnLogicalOrExpressionContext } from "./KipperParser"; +import { ActualLogicalOrExpressionContext } from "./KipperParser"; +import { CompilationUnitContext } from "./KipperParser"; +import { TranslationUnitContext } from "./KipperParser"; +import { ExternalItemContext } from "./KipperParser"; +import { BlockItemListContext } from "./KipperParser"; +import { BlockItemContext } from "./KipperParser"; +import { DeclarationContext } from "./KipperParser"; +import { VariableDeclarationContext } from "./KipperParser"; +import { StorageTypeSpecifierContext } from "./KipperParser"; +import { InitDeclaratorContext } from "./KipperParser"; +import { InitializerContext } from "./KipperParser"; +import { DeclaratorContext } from "./KipperParser"; +import { DirectDeclaratorContext } from "./KipperParser"; +import { FunctionDeclarationContext } from "./KipperParser"; +import { ParameterListContext } from "./KipperParser"; +import { ParameterDeclarationContext } from "./KipperParser"; +import { InterfaceDeclarationContext } from "./KipperParser"; +import { InterfaceMemberListContext } from "./KipperParser"; +import { InterfaceMemberDeclarationContext } from "./KipperParser"; +import { PropertySignatureContext } from "./KipperParser"; +import { MethodSignatureContext } from "./KipperParser"; +import { ClassDeclarationContext } from "./KipperParser"; +import { StatementContext } from "./KipperParser"; +import { CompoundStatementContext } from "./KipperParser"; +import { ExpressionStatementContext } from "./KipperParser"; +import { SelectionStatementContext } from "./KipperParser"; +import { IfStatementContext } from "./KipperParser"; +import { SwitchStatementContext } from "./KipperParser"; +import { SwitchLabeledStatementContext } from "./KipperParser"; +import { IterationStatementContext } from "./KipperParser"; +import { ForLoopIterationStatementContext } from "./KipperParser"; +import { WhileLoopIterationStatementContext } from "./KipperParser"; +import { DoWhileLoopIterationStatementContext } from "./KipperParser"; +import { JumpStatementContext } from "./KipperParser"; +import { ReturnStatementContext } from "./KipperParser"; +import { PrimaryExpressionContext } from "./KipperParser"; +import { TangledPrimaryExpressionContext } from "./KipperParser"; +import { BoolPrimaryExpressionContext } from "./KipperParser"; +import { IdentifierPrimaryExpressionContext } from "./KipperParser"; +import { IdentifierContext } from "./KipperParser"; +import { IdentifierOrStringPrimaryExpressionContext } from "./KipperParser"; +import { StringPrimaryExpressionContext } from "./KipperParser"; +import { FStringPrimaryExpressionContext } from "./KipperParser"; +import { FStringSingleQuoteAtomContext } from "./KipperParser"; +import { FStringDoubleQuoteAtomContext } from "./KipperParser"; +import { NumberPrimaryExpressionContext } from "./KipperParser"; +import { ArrayPrimaryExpressionContext } from "./KipperParser"; +import { ObjectPrimaryExpressionContext } from "./KipperParser"; +import { ObjectPropertyContext } from "./KipperParser"; +import { VoidOrNullOrUndefinedPrimaryExpressionContext } from "./KipperParser"; +import { ComputedPrimaryExpressionContext } from "./KipperParser"; +import { ArgumentExpressionListContext } from "./KipperParser"; +import { DotNotationContext } from "./KipperParser"; +import { BracketNotationContext } from "./KipperParser"; +import { SliceNotationContext } from "./KipperParser"; +import { PostfixExpressionContext } from "./KipperParser"; +import { IncrementOrDecrementPostfixExpressionContext } from "./KipperParser"; +import { UnaryExpressionContext } from "./KipperParser"; +import { IncrementOrDecrementUnaryExpressionContext } from "./KipperParser"; +import { OperatorModifiedUnaryExpressionContext } from "./KipperParser"; +import { IncrementOrDecrementOperatorContext } from "./KipperParser"; +import { UnaryOperatorContext } from "./KipperParser"; +import { CastOrConvertExpressionContext } from "./KipperParser"; +import { MultiplicativeExpressionContext } from "./KipperParser"; +import { AdditiveExpressionContext } from "./KipperParser"; +import { BitwiseShiftExpressionContext } from "./KipperParser"; +import { BitwiseShiftOperatorsContext } from "./KipperParser"; +import { RelationalExpressionContext } from "./KipperParser"; +import { EqualityExpressionContext } from "./KipperParser"; +import { BitwiseAndExpressionContext } from "./KipperParser"; +import { BitwiseXorExpressionContext } from "./KipperParser"; +import { BitwiseOrExpressionContext } from "./KipperParser"; +import { LogicalAndExpressionContext } from "./KipperParser"; +import { LogicalOrExpressionContext } from "./KipperParser"; +import { ConditionalExpressionContext } from "./KipperParser"; +import { AssignmentExpressionContext } from "./KipperParser"; +import { AssignmentOperatorContext } from "./KipperParser"; +import { ExpressionContext } from "./KipperParser"; +import { TypeSpecifierExpressionContext } from "./KipperParser"; +import { IdentifierTypeSpecifierExpressionContext } from "./KipperParser"; +import { GenericTypeSpecifierExpressionContext } from "./KipperParser"; +import { TypeofTypeSpecifierExpressionContext } from "./KipperParser"; +import { TypeSpecifierIdentifierContext } from "./KipperParser"; + /** * This interface defines a complete listener for a parse tree produced by @@ -729,6 +736,50 @@ export interface KipperParserListener extends ParseTreeListener { */ exitInterfaceDeclaration?: (ctx: InterfaceDeclarationContext) => void; + /** + * Enter a parse tree produced by `KipperParser.interface-member-list-declaration`. + * @param ctx the parse tree + */ + enterInterfaceMemberList?: (ctx: InterfaceMemberListContext) => void; + /** + * Exit a parse tree produced by `KipperParser.interface-member-list-declaration`. + * @param ctx the parse tree + */ + exitInterfaceMemberList?: (ctx: InterfaceMemberListContext) => 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.propertySignature`. + * @param ctx the parse tree + */ + enterPropertySignature?: (ctx: PropertySignatureContext) => void; + /** + * Exit a parse tree produced by `KipperParser.propertySignature`. + * @param ctx the parse tree + */ + exitPropertySignature?: (ctx: PropertySignatureContext) => void; + + /** + * Enter a parse tree produced by `KipperParser.methodSignature`. + * @param ctx the parse tree + */ + enterMethodSignature?: (ctx: MethodSignatureContext) => void; + /** + * Exit a parse tree produced by `KipperParser.methodSignature`. + * @param ctx the parse tree + */ + exitMethodSignature?: (ctx: MethodSignatureContext) => void; + /** * Enter a parse tree produced by `KipperParser.classDeclaration`. * @param ctx the parse tree @@ -1411,3 +1462,4 @@ export interface KipperParserListener extends ParseTreeListener { */ exitTypeSpecifierIdentifier?: (ctx: TypeSpecifierIdentifierContext) => void; } + diff --git a/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts b/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts index 4ddfe78c1..d2914143a 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts @@ -1,123 +1,130 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT -// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax -// kind values. + + // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax + // kind values. + import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; + import KipperParserBase from "./base/KipperParserBase"; + import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; -import { - ActualAdditiveExpressionContext, - ActualAssignmentExpressionContext, - ActualBitwiseAndExpressionContext, - ActualBitwiseOrExpressionContext, - ActualBitwiseShiftExpressionContext, - ActualBitwiseXorExpressionContext, - ActualCastOrConvertExpressionContext, - ActualConditionalExpressionContext, - ActualEqualityExpressionContext, - ActualLogicalAndExpressionContext, - ActualLogicalOrExpressionContext, - ActualMultiplicativeExpressionContext, - ActualRelationalExpressionContext, - AdditiveExpressionContext, - ArgumentExpressionListContext, - ArrayPrimaryExpressionContext, - AssignmentExpressionContext, - AssignmentOperatorContext, - BitwiseAndExpressionContext, - BitwiseOrExpressionContext, - BitwiseShiftExpressionContext, - BitwiseShiftOperatorsContext, - BitwiseXorExpressionContext, - BlockItemContext, - BlockItemListContext, - BoolPrimaryExpressionContext, - BracketNotationContext, - BracketNotationMemberAccessExpressionContext, - CastOrConvertExpressionContext, - ClassDeclarationContext, - CompilationUnitContext, - CompoundStatementContext, - ComputedPrimaryExpressionContext, - ConditionalExpressionContext, - DeclarationContext, - DeclaratorContext, - DirectDeclaratorContext, - DotNotationContext, - DotNotationMemberAccessExpressionContext, - DoWhileLoopIterationStatementContext, - EqualityExpressionContext, - ExplicitCallFunctionCallExpressionContext, - ExpressionContext, - ExpressionStatementContext, - ExternalBlockItemContext, - ExternalItemContext, - ForLoopIterationStatementContext, - FStringDoubleQuoteAtomContext, - FStringPrimaryExpressionContext, - FStringSingleQuoteAtomContext, - FunctionCallExpressionContext, - FunctionDeclarationContext, - GenericTypeSpecifierExpressionContext, - IdentifierContext, - IdentifierOrStringPrimaryExpressionContext, - IdentifierPrimaryExpressionContext, - IdentifierTypeSpecifierExpressionContext, - IfStatementContext, - IncrementOrDecrementOperatorContext, - IncrementOrDecrementPostfixExpressionContext, - IncrementOrDecrementUnaryExpressionContext, - InitDeclaratorContext, - InitializerContext, - InterfaceDeclarationContext, - IterationStatementContext, - JumpStatementContext, - LogicalAndExpressionContext, - LogicalOrExpressionContext, - MultiplicativeExpressionContext, - NumberPrimaryExpressionContext, - ObjectPrimaryExpressionContext, - ObjectPropertyContext, - OperatorModifiedUnaryExpressionContext, - ParameterDeclarationContext, - ParameterListContext, - PassOnAdditiveExpressionContext, - PassOnAssignmentExpressionContext, - PassOnBitwiseAndExpressionContext, - PassOnBitwiseOrExpressionContext, - PassOnBitwiseShiftExpressionContext, - PassOnBitwiseXorExpressionContext, - PassOnCastOrConvertExpressionContext, - PassOncomputedPrimaryExpressionContext, - PassOnConditionalExpressionContext, - PassOnEqualityExpressionContext, - PassOnLogicalAndExpressionContext, - PassOnLogicalOrExpressionContext, - PassOnMultiplicativeExpressionContext, - PassOnRelationalExpressionContext, - PostfixExpressionContext, - PrimaryExpressionContext, - RelationalExpressionContext, - ReturnStatementContext, - SelectionStatementContext, - SliceNotationContext, - SliceNotationMemberAccessExpressionContext, - StatementContext, - StorageTypeSpecifierContext, - StringPrimaryExpressionContext, - SwitchLabeledStatementContext, - SwitchStatementContext, - TangledPrimaryExpressionContext, - TranslationUnitContext, - TypeofTypeSpecifierExpressionContext, - TypeSpecifierExpressionContext, - TypeSpecifierIdentifierContext, - UnaryExpressionContext, - UnaryOperatorContext, - VariableDeclarationContext, - VoidOrNullOrUndefinedPrimaryExpressionContext, - WhileLoopIterationStatementContext, -} from "./KipperParser"; +import { PassOnBitwiseShiftExpressionContext } from "./KipperParser"; +import { ActualBitwiseShiftExpressionContext } from "./KipperParser"; +import { PassOnBitwiseAndExpressionContext } from "./KipperParser"; +import { ActualBitwiseAndExpressionContext } from "./KipperParser"; +import { PassOnLogicalAndExpressionContext } from "./KipperParser"; +import { ActualLogicalAndExpressionContext } from "./KipperParser"; +import { PassOnBitwiseXorExpressionContext } from "./KipperParser"; +import { ActualBitwiseXorExpressionContext } from "./KipperParser"; +import { ExternalBlockItemContext } from "./KipperParser"; +import { PassOncomputedPrimaryExpressionContext } from "./KipperParser"; +import { FunctionCallExpressionContext } from "./KipperParser"; +import { ExplicitCallFunctionCallExpressionContext } from "./KipperParser"; +import { DotNotationMemberAccessExpressionContext } from "./KipperParser"; +import { BracketNotationMemberAccessExpressionContext } from "./KipperParser"; +import { SliceNotationMemberAccessExpressionContext } from "./KipperParser"; +import { PassOnAssignmentExpressionContext } from "./KipperParser"; +import { ActualAssignmentExpressionContext } from "./KipperParser"; +import { PassOnCastOrConvertExpressionContext } from "./KipperParser"; +import { ActualCastOrConvertExpressionContext } from "./KipperParser"; +import { PassOnBitwiseOrExpressionContext } from "./KipperParser"; +import { ActualBitwiseOrExpressionContext } from "./KipperParser"; +import { PassOnEqualityExpressionContext } from "./KipperParser"; +import { ActualEqualityExpressionContext } from "./KipperParser"; +import { PassOnAdditiveExpressionContext } from "./KipperParser"; +import { ActualAdditiveExpressionContext } from "./KipperParser"; +import { PassOnRelationalExpressionContext } from "./KipperParser"; +import { ActualRelationalExpressionContext } from "./KipperParser"; +import { PassOnConditionalExpressionContext } from "./KipperParser"; +import { ActualConditionalExpressionContext } from "./KipperParser"; +import { PassOnMultiplicativeExpressionContext } from "./KipperParser"; +import { ActualMultiplicativeExpressionContext } from "./KipperParser"; +import { PassOnLogicalOrExpressionContext } from "./KipperParser"; +import { ActualLogicalOrExpressionContext } from "./KipperParser"; +import { CompilationUnitContext } from "./KipperParser"; +import { TranslationUnitContext } from "./KipperParser"; +import { ExternalItemContext } from "./KipperParser"; +import { BlockItemListContext } from "./KipperParser"; +import { BlockItemContext } from "./KipperParser"; +import { DeclarationContext } from "./KipperParser"; +import { VariableDeclarationContext } from "./KipperParser"; +import { StorageTypeSpecifierContext } from "./KipperParser"; +import { InitDeclaratorContext } from "./KipperParser"; +import { InitializerContext } from "./KipperParser"; +import { DeclaratorContext } from "./KipperParser"; +import { DirectDeclaratorContext } from "./KipperParser"; +import { FunctionDeclarationContext } from "./KipperParser"; +import { ParameterListContext } from "./KipperParser"; +import { ParameterDeclarationContext } from "./KipperParser"; +import { InterfaceDeclarationContext } from "./KipperParser"; +import { InterfaceMemberListContext } from "./KipperParser"; +import { InterfaceMemberDeclarationContext } from "./KipperParser"; +import { PropertySignatureContext } from "./KipperParser"; +import { MethodSignatureContext } from "./KipperParser"; +import { ClassDeclarationContext } from "./KipperParser"; +import { StatementContext } from "./KipperParser"; +import { CompoundStatementContext } from "./KipperParser"; +import { ExpressionStatementContext } from "./KipperParser"; +import { SelectionStatementContext } from "./KipperParser"; +import { IfStatementContext } from "./KipperParser"; +import { SwitchStatementContext } from "./KipperParser"; +import { SwitchLabeledStatementContext } from "./KipperParser"; +import { IterationStatementContext } from "./KipperParser"; +import { ForLoopIterationStatementContext } from "./KipperParser"; +import { WhileLoopIterationStatementContext } from "./KipperParser"; +import { DoWhileLoopIterationStatementContext } from "./KipperParser"; +import { JumpStatementContext } from "./KipperParser"; +import { ReturnStatementContext } from "./KipperParser"; +import { PrimaryExpressionContext } from "./KipperParser"; +import { TangledPrimaryExpressionContext } from "./KipperParser"; +import { BoolPrimaryExpressionContext } from "./KipperParser"; +import { IdentifierPrimaryExpressionContext } from "./KipperParser"; +import { IdentifierContext } from "./KipperParser"; +import { IdentifierOrStringPrimaryExpressionContext } from "./KipperParser"; +import { StringPrimaryExpressionContext } from "./KipperParser"; +import { FStringPrimaryExpressionContext } from "./KipperParser"; +import { FStringSingleQuoteAtomContext } from "./KipperParser"; +import { FStringDoubleQuoteAtomContext } from "./KipperParser"; +import { NumberPrimaryExpressionContext } from "./KipperParser"; +import { ArrayPrimaryExpressionContext } from "./KipperParser"; +import { ObjectPrimaryExpressionContext } from "./KipperParser"; +import { ObjectPropertyContext } from "./KipperParser"; +import { VoidOrNullOrUndefinedPrimaryExpressionContext } from "./KipperParser"; +import { ComputedPrimaryExpressionContext } from "./KipperParser"; +import { ArgumentExpressionListContext } from "./KipperParser"; +import { DotNotationContext } from "./KipperParser"; +import { BracketNotationContext } from "./KipperParser"; +import { SliceNotationContext } from "./KipperParser"; +import { PostfixExpressionContext } from "./KipperParser"; +import { IncrementOrDecrementPostfixExpressionContext } from "./KipperParser"; +import { UnaryExpressionContext } from "./KipperParser"; +import { IncrementOrDecrementUnaryExpressionContext } from "./KipperParser"; +import { OperatorModifiedUnaryExpressionContext } from "./KipperParser"; +import { IncrementOrDecrementOperatorContext } from "./KipperParser"; +import { UnaryOperatorContext } from "./KipperParser"; +import { CastOrConvertExpressionContext } from "./KipperParser"; +import { MultiplicativeExpressionContext } from "./KipperParser"; +import { AdditiveExpressionContext } from "./KipperParser"; +import { BitwiseShiftExpressionContext } from "./KipperParser"; +import { BitwiseShiftOperatorsContext } from "./KipperParser"; +import { RelationalExpressionContext } from "./KipperParser"; +import { EqualityExpressionContext } from "./KipperParser"; +import { BitwiseAndExpressionContext } from "./KipperParser"; +import { BitwiseXorExpressionContext } from "./KipperParser"; +import { BitwiseOrExpressionContext } from "./KipperParser"; +import { LogicalAndExpressionContext } from "./KipperParser"; +import { LogicalOrExpressionContext } from "./KipperParser"; +import { ConditionalExpressionContext } from "./KipperParser"; +import { AssignmentExpressionContext } from "./KipperParser"; +import { AssignmentOperatorContext } from "./KipperParser"; +import { ExpressionContext } from "./KipperParser"; +import { TypeSpecifierExpressionContext } from "./KipperParser"; +import { IdentifierTypeSpecifierExpressionContext } from "./KipperParser"; +import { GenericTypeSpecifierExpressionContext } from "./KipperParser"; +import { TypeofTypeSpecifierExpressionContext } from "./KipperParser"; +import { TypeSpecifierIdentifierContext } from "./KipperParser"; + /** * This interface defines a complete generic visitor for a parse tree produced @@ -503,6 +510,34 @@ export interface KipperParserVisitor extends ParseTreeVisitor { */ visitInterfaceDeclaration?: (ctx: InterfaceDeclarationContext) => Result; + /** + * Visit a parse tree produced by `KipperParser.interface-member-list-declaration`. + * @param ctx the parse tree + * @return the visitor result + */ + visitInterfaceMemberList?: (ctx: InterfaceMemberListContext) => 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.propertySignature`. + * @param ctx the parse tree + * @return the visitor result + */ + visitPropertySignature?: (ctx: PropertySignatureContext) => Result; + + /** + * Visit a parse tree produced by `KipperParser.methodSignature`. + * @param ctx the parse tree + * @return the visitor result + */ + visitMethodSignature?: (ctx: MethodSignatureContext) => Result; + /** * Visit a parse tree produced by `KipperParser.classDeclaration`. * @param ctx the parse tree @@ -937,3 +972,4 @@ export interface KipperParserVisitor extends ParseTreeVisitor { */ visitTypeSpecifierIdentifier?: (ctx: TypeSpecifierIdentifierContext) => Result; } + diff --git a/kipper/core/src/compiler/parser/parse-rule-kind-mapping.ts b/kipper/core/src/compiler/parser/parse-rule-kind-mapping.ts index 6edb70f51..a0c9fd9d7 100644 --- a/kipper/core/src/compiler/parser/parse-rule-kind-mapping.ts +++ b/kipper/core/src/compiler/parser/parse-rule-kind-mapping.ts @@ -35,6 +35,7 @@ export const ParseRuleKindMapping = { RULE_parameterList: KipperParser.RULE_parameterList, RULE_parameterDeclaration: KipperParser.RULE_parameterDeclaration, RULE_interfaceDeclaration: KipperParser.RULE_interfaceDeclaration, + RULE_interfaceMemberList: KipperParser.RULE_interfaceMemberList, RULE_classDeclaration: KipperParser.RULE_classDeclaration, RULE_statement: KipperParser.RULE_statement, RULE_compoundStatement: KipperParser.RULE_compoundStatement, From b564ce3e54ba438ca30b73c2149cdd0e2025492a Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Fri, 5 Jul 2024 00:22:33 +0200 Subject: [PATCH 13/57] major (#524): Partially migrated away from old string types to the new ProcessedType structures This is still WIP! --- kipper/core/KipperLexer.tokens | 301 +- .../analysis/analyser/type-checker.ts | 68 +- .../symbol-table/entry/scope-declaration.ts | 6 +- .../entry/scope-function-declaration.ts | 4 +- .../entry/scope-parameter-declaration.ts | 4 +- .../entry/scope-type-declaration.ts | 49 +- .../entry/scope-variable-declaration.ts | 4 +- .../analysis/symbol-table/global-scope.ts | 19 +- .../compiler/analysis/types/built-in-type.ts | 32 +- .../compiler/analysis/types/custom-type.ts | 36 +- .../type-declaration-semantics.ts | 1 + .../type-declaration-type-semantics.ts | 9 +- .../bool-primary-expression-semantics.ts | 4 +- .../bool-primary-expression.ts | 4 +- ...-undefined-primary-expression-semantics.ts | 4 +- ...or-null-or-undefined-primary-expression.ts | 4 +- kipper/core/src/compiler/compile-config.ts | 4 +- kipper/core/src/compiler/const.ts | 84 +- .../lexer-parser/antlr/KipperLexer.interp | 8 +- .../lexer-parser/antlr/KipperLexer.tokens | 220 +- .../lexer-parser/antlr/KipperLexer.ts | 1236 ++-- .../lexer-parser/antlr/KipperParser.tokens | 297 +- .../lexer-parser/antlr/KipperParser.ts | 5562 +++++++---------- .../antlr/KipperParserListener.ts | 234 +- .../lexer-parser/antlr/KipperParserVisitor.ts | 234 +- .../lexer-parser/parse-rule-kind-mapping.ts | 8 +- .../compiler/parser/antlr/KipperLexer.interp | 308 - .../compiler/parser/antlr/KipperLexer.tokens | 153 - .../src/compiler/parser/antlr/KipperLexer.ts | 882 --- .../compiler/parser/antlr/KipperParser.tokens | 153 - kipper/core/src/compiler/program-ctx.ts | 21 +- kipper/core/src/compiler/runtime-built-ins.ts | 12 +- kipper/core/src/errors.ts | 10 + kipper/target-ts/src/built-in-generator.ts | 6 +- kipper/target-ts/src/target.ts | 42 +- kipper/target-ts/src/tools.ts | 10 +- 36 files changed, 3804 insertions(+), 6229 deletions(-) delete mode 100644 kipper/core/src/compiler/parser/antlr/KipperLexer.interp delete mode 100644 kipper/core/src/compiler/parser/antlr/KipperLexer.tokens delete mode 100644 kipper/core/src/compiler/parser/antlr/KipperLexer.ts delete mode 100644 kipper/core/src/compiler/parser/antlr/KipperParser.tokens diff --git a/kipper/core/KipperLexer.tokens b/kipper/core/KipperLexer.tokens index 4784df64b..a380f4448 100644 --- a/kipper/core/KipperLexer.tokens +++ b/kipper/core/KipperLexer.tokens @@ -1,153 +1,154 @@ FStringExpStart=1 BlockComment=2 LineComment=3 -Const=4 -Var=5 -As=6 -Spread=7 -Switch=8 -Case=9 -Default=10 -Break=11 -Continue=12 -Do=13 -While=14 -If=15 -Else=16 -For=17 -Enum=18 -DefFunc=19 -Return=20 -CallFunc=21 -RetIndicator=22 -Class=23 -Interface=24 -True=25 -False=26 -Typeof=27 -Void=28 -Null=29 -Undefined=30 -Comma=31 -SemiColon=32 -QuestionMark=33 -Colon=34 -LeftParen=35 -RightParen=36 -LeftBracket=37 -RightBracket=38 -FStringExpEnd=39 -LeftBrace=40 -RightBrace=41 -Plus=42 -PlusPlus=43 -Minus=44 -MinusMinus=45 -Star=46 -Div=47 -Mod=48 -PowerTo=49 -AndAnd=50 -OrOr=51 -Not=52 -Assign=53 -PlusAssign=54 -MinusAssign=55 -StarAssign=56 -DivAssign=57 -ModAssign=58 -Equal=59 -NotEqual=60 -Less=61 -LessEqual=62 -Greater=63 -GreaterEqual=64 -BitwiseAnd=65 -BitwiseOr=66 -BitwiseXor=67 -BitwiseNot=68 -BitwiseZeroFillLeftShift=69 -BitwiseSignedRightShift=70 -BitwiseZeroFillRightShift=71 -Dot=72 -Identifier=73 -IntegerConstant=74 -SingleQuoteStringLiteral=75 -DoubleQuoteStringLiteral=76 -FloatingConstant=77 -Whitespace=78 -Newline=79 -FStringSingleQuoteStart=80 -FStringDoubleQuoteStart=81 -FStringSingleQuoteEnd=82 -FStringSingleQuoteAtom=83 -FStringDoubleQuoteEnd=84 -FStringDoubleQuoteAtom=85 -'const'=4 -'var'=5 -'as'=6 -'...'=7 -'switch'=8 -'case'=9 -'default'=10 -'break'=11 -'continue'=12 -'do'=13 -'while'=14 -'if'=15 -'else'=16 -'for'=17 -'enum'=18 -'def'=19 -'return'=20 -'call'=21 -'->'=22 -'class'=23 -'interface'=24 -'true'=25 -'false'=26 -'typeof'=27 -'void'=28 -'null'=29 -'undefined'=30 -','=31 -';'=32 -'?'=33 -':'=34 -'('=35 -')'=36 -'['=37 -']'=38 -'{'=40 -'}'=41 -'+'=42 -'++'=43 -'-'=44 -'--'=45 -'*'=46 -'/'=47 -'%'=48 -'**'=49 -'&&'=50 -'||'=51 -'!'=52 -'='=53 -'+='=54 -'-='=55 -'*='=56 -'/='=57 -'%='=58 -'=='=59 -'!='=60 -'<'=61 -'<='=62 -'>'=63 -'>='=64 -'&'=65 -'|'=66 -'^'=67 -'~'=68 -'<<'=69 -'>>'=70 -'>>>'=71 -'.'=72 +Pragma=4 +Const=5 +Var=6 +As=7 +Spread=8 +Switch=9 +Case=10 +Default=11 +Break=12 +Continue=13 +Do=14 +While=15 +If=16 +Else=17 +For=18 +Enum=19 +DefFunc=20 +Return=21 +CallFunc=22 +RetIndicator=23 +Class=24 +Interface=25 +True=26 +False=27 +Typeof=28 +Void=29 +Null=30 +Undefined=31 +Comma=32 +SemiColon=33 +QuestionMark=34 +Colon=35 +LeftParen=36 +RightParen=37 +LeftBracket=38 +RightBracket=39 +FStringExpEnd=40 +LeftBrace=41 +RightBrace=42 +Plus=43 +PlusPlus=44 +Minus=45 +MinusMinus=46 +Star=47 +Div=48 +Mod=49 +PowerTo=50 +AndAnd=51 +OrOr=52 +Not=53 +Assign=54 +PlusAssign=55 +MinusAssign=56 +StarAssign=57 +DivAssign=58 +ModAssign=59 +Equal=60 +NotEqual=61 +Less=62 +LessEqual=63 +Greater=64 +GreaterEqual=65 +BitwiseAnd=66 +BitwiseOr=67 +BitwiseXor=68 +BitwiseNot=69 +BitwiseZeroFillLeftShift=70 +BitwiseSignedRightShift=71 +BitwiseZeroFillRightShift=72 +Dot=73 +Identifier=74 +IntegerConstant=75 +SingleQuoteStringLiteral=76 +DoubleQuoteStringLiteral=77 +FloatingConstant=78 +Whitespace=79 +Newline=80 +FStringSingleQuoteStart=81 +FStringDoubleQuoteStart=82 +FStringSingleQuoteEnd=83 +FStringSingleQuoteAtom=84 +FStringDoubleQuoteEnd=85 +FStringDoubleQuoteAtom=86 +'const'=5 +'var'=6 +'as'=7 +'...'=8 +'switch'=9 +'case'=10 +'default'=11 +'break'=12 +'continue'=13 +'do'=14 +'while'=15 +'if'=16 +'else'=17 +'for'=18 +'enum'=19 +'def'=20 +'return'=21 +'call'=22 +'->'=23 +'class'=24 +'interface'=25 +'true'=26 +'false'=27 +'typeof'=28 +'void'=29 +'null'=30 +'undefined'=31 +','=32 +';'=33 +'?'=34 +':'=35 +'('=36 +')'=37 +'['=38 +']'=39 +'{'=41 +'}'=42 +'+'=43 +'++'=44 +'-'=45 +'--'=46 +'*'=47 +'/'=48 +'%'=49 +'**'=50 +'&&'=51 +'||'=52 +'!'=53 +'='=54 +'+='=55 +'-='=56 +'*='=57 +'/='=58 +'%='=59 +'=='=60 +'!='=61 +'<'=62 +'<='=63 +'>'=64 +'>='=65 +'&'=66 +'|'=67 +'^'=68 +'~'=69 +'<<'=70 +'>>'=71 +'>>>'=72 +'.'=73 diff --git a/kipper/core/src/compiler/analysis/analyser/type-checker.ts b/kipper/core/src/compiler/analysis/analyser/type-checker.ts index f1f63effc..1e08e33ea 100644 --- a/kipper/core/src/compiler/analysis/analyser/type-checker.ts +++ b/kipper/core/src/compiler/analysis/analyser/type-checker.ts @@ -27,20 +27,26 @@ import { TangledPrimaryExpression, } from "../../ast"; import { KipperSemanticsAsserter } from "./err-handler"; -import { ScopeDeclaration, ScopeParameterDeclaration, ScopeVariableDeclaration } from "../symbol-table"; +import { + Scope, + ScopeDeclaration, + ScopeParameterDeclaration, + ScopeTypeDeclaration, + ScopeVariableDeclaration +} from "../symbol-table"; import type { KipperArithmeticOperator, KipperBitwiseOperator, - KipperBuiltInType, + KipperBuiltInTypeLiteral, KipperReferenceable, KipperReferenceableFunction, } from "../../const"; import { - kipperBuiltInTypes, + kipperBuiltInTypeLiterals, kipperIncrementOrDecrementOperators, kipperMultiplicativeOperators, kipperPlusOperator, - kipperStrType, + kipperStrTypeLiteral, kipperSupportedConversions, } from "../../const"; import { @@ -58,7 +64,7 @@ import { InvalidUnaryExpressionTypeError, KipperError, KipperNotImplementedError, - ReadOnlyWriteTypeError, + ReadOnlyWriteTypeError, ReferenceCanNotBeUsedAsTypeError, UnknownTypeError, ValueNotIndexableTypeError, } from "../../../errors"; @@ -76,31 +82,35 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { } /** - * Asserts that the passed type identifier exists. + * Fetches the type from the identifier and throws an error if the type is not found. * @param type The type to check. + * @param scope The scope to check in. * @since 0.7.0 */ - public typeExists(type: string): void { - if (kipperBuiltInTypes.find((val) => val === type) === undefined) { + public getTypeFromIdentifier(type: string, scope: Scope): ScopeTypeDeclaration { + const scopeEntry = scope.getEntryRecursively(type); + if (scopeEntry === undefined) { throw this.assertError(new UnknownTypeError(type)); + } else if (!(scopeEntry instanceof ScopeTypeDeclaration)) { + throw this.assertError(new ReferenceCanNotBeUsedAsTypeError(type)); } + return scopeEntry; } /** * Creates a new {@link ProcessedType} instance based on the passed {@link KipperType}. * - * If the type is invalid, the function will still return a {@link ProcessedType}, but the field + * If the rawType is invalid, the function will still return a {@link ProcessedType}, but the field * {@link ProcessedType.isCompilable} will be false and the instance WILL NOT be usable for a compilation. - * @param type The unchecked type to analyse. + * @param rawType The unchecked rawType to analyse. + * @param scope The scope to check in. */ - public getCheckedType(type: RawType): ProcessedType { + public getCheckedType(rawType: RawType, scope: Scope): ProcessedType { try { - // Ensure the type exists - this.typeExists(type.identifier); - - return ProcessedType.fromCompilableType(type.identifier); + const type = this.getTypeFromIdentifier(rawType.identifier, scope); + return } catch (e) { - // If the error is not a KipperError, rethrow it (since it is not a type error, and we don't know what happened) + // If the error is not a KipperError, rethrow it (since it is not a rawType error, and we don't know what happened) if (!(e instanceof KipperError)) { throw e; } @@ -110,8 +120,8 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { // throwing any errors, which would be VERY bad.) this.programCtx.reportError(e); - // Recover from the error by wrapping the undefined type - return ProcessedType.fromKipperType(new UndefinedType(type.identifier)); + // Recover from the error by wrapping the undefined rawType + return ProcessedType.fromKipperType(new UndefinedType(rawType.identifier)); } // If error recovery is not enabled, we shouldn't bother trying to handle invalid types @@ -119,24 +129,6 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { } } - /** - * Checks whether the passed types are matching. - * @param type1 The first type that is given. - * @param type2 The second type that is given. - * @returns True if the types are matching, otherwise false. - * @since 0.10.0 - */ - public checkMatchingTypes(type1: KipperBuiltInType, type2: KipperBuiltInType): boolean { - if (type1 !== type2) { - // 'void' is compatible with 'undefined' - - - // Ensure that 'true' is still returned when type1 and type2 are compatible - return interchangeableTypes.includes(type1) && interchangeableTypes.includes(type2); - } - return true; - } - /** * Asserts that the passed {@link ref} is callable. This function will only check {@link ScopeDeclaration} instances, * since {@link BuiltInFunction built-in functions} will always be callable. @@ -378,12 +370,12 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { // Numbers may use all arithmetic operators if (leftOpType !== "num" || rightOpType !== "num") { // Strings can use '+' to concat strings - if (op === kipperPlusOperator && leftOpType == kipperStrType && rightOpType == kipperStrType) { + if (op === kipperPlusOperator && leftOpType == kipperStrTypeLiteral && rightOpType == kipperStrTypeLiteral) { return; } // Strings can use * to repeat a string n times - if (op === kipperMultiplicativeOperators[0] && leftOpType == kipperStrType && rightOpType == "num") { + if (op === kipperMultiplicativeOperators[0] && leftOpType == kipperStrTypeLiteral && rightOpType == "num") { return; } diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-declaration.ts b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-declaration.ts index b39b71660..197fc08bb 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-declaration.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-declaration.ts @@ -15,15 +15,15 @@ import type { ProcessedType } from "../../types"; * @since 0.1.2 */ export abstract class ScopeDeclaration { - public abstract get node(): Declaration; + public abstract get node(): Declaration | undefined; public abstract get identifier(): string; /** * Fetches the {@link KipperProgramContext program context instance} for this token. */ - public get programCtx(): KipperProgramContext { - return this.node.programCtx; + public get programCtx(): KipperProgramContext | undefined { + return this.node?.programCtx; } /** diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts index adfed1b90..d9df2c774 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts @@ -9,7 +9,7 @@ import type { ParameterDeclaration, } from "../../../ast"; import { ScopeDeclaration } from "./scope-declaration"; -import { ProcessedType } from "../../types"; +import {BuiltInTypes, ProcessedType} from "../../types"; /** * Represents the definition of a function inside a {@link Scope}. @@ -60,7 +60,7 @@ export class ScopeFunctionDeclaration extends ScopeDeclaration { * @since 0.10.0 */ public get type(): ProcessedType { - return ProcessedType.fromCompilableType("func"); + return BuiltInTypes.func; } /** diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-parameter-declaration.ts b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-parameter-declaration.ts index 18b145aed..67485a2e0 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-parameter-declaration.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-parameter-declaration.ts @@ -10,7 +10,7 @@ import type { ParameterDeclarationTypeSemantics, } from "../../../ast"; import type { LocalScope } from "../index"; -import type { ProcessedType } from "../../types"; +import {BuiltInTypes, ProcessedType} from "../../types"; /** * Represents the definition of a parameter inside a {@link FunctionDeclaration function}. @@ -111,6 +111,6 @@ export class ScopeParameterDeclaration extends ScopeDeclaration { * @since 0.10.0 */ public get isCallable(): boolean { - return this.type.rawType === "func"; + return this.type === BuiltInTypes.func; } } diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts index a75c76b3a..9522ca267 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts @@ -3,8 +3,8 @@ * @since 0.11.0 */ import { ScopeDeclaration } from "./scope-declaration"; -import type { TypeDeclaration, TypeDeclarationSemantics } from "../../../ast"; -import { ProcessedType } from "../../types"; +import { TypeDeclaration, TypeDeclarationSemantics } from "../../../ast"; +import {BuiltInType, BuiltInTypes, CustomType, ProcessedType, Type} from "../../types"; import { KipperNotImplementedError } from "../../../../errors"; /** @@ -12,11 +12,35 @@ import { KipperNotImplementedError } from "../../../../errors"; * @since 0.11.0 */ export class ScopeTypeDeclaration extends ScopeDeclaration { - private readonly _node: TypeDeclaration; + private readonly _node?: TypeDeclaration; + private readonly _builtInType?: ProcessedType; - public constructor(node: TypeDeclaration) { + private constructor( + declaration?: TypeDeclaration, + builtInType?: BuiltInType, + ) { super(); - this._node = node; + + this._node = declaration; + this._builtInType = builtInType; + } + + /** + * Creates a new scope type declaration from a type declaration. + * @param node The type declaration node. + * @since 0.11.0 + */ + public static fromTypeDeclaration(node: TypeDeclaration): ScopeTypeDeclaration { + return new ScopeTypeDeclaration(node); + } + + /** + * Creates a new scope type declaration from a built-in type. + * @param identifier The identifier of the built-in type. + * @since 0.11.0 + */ + public static fromBuiltInType(type: BuiltInType): ScopeTypeDeclaration { + return new ScopeTypeDeclaration(undefined, type); } /** @@ -24,14 +48,14 @@ export class ScopeTypeDeclaration extends ScopeDeclaration { * @throws UndefinedSemanticsError If this is accessed, before semantic analysis was performed. * @private */ - private get semanticData(): TypeDeclarationSemantics { - return this._node.getSemanticData(); + private get semanticData(): TypeDeclarationSemantics | undefined { + return this._node?.getSemanticData(); } /** * Returns the {@link InterfaceDeclaration} or {@link ClassDeclaration AST node} this scope type declaration bases on. */ - public get node(): TypeDeclaration { + public get node(): TypeDeclaration | undefined { return this._node; } @@ -39,7 +63,7 @@ export class ScopeTypeDeclaration extends ScopeDeclaration { * The identifier of this type. */ public get identifier(): string { - return this.semanticData.identifier; + return this.semanticData?.identifier || this._builtInType!!.identifier; } /** @@ -47,15 +71,16 @@ export class ScopeTypeDeclaration extends ScopeDeclaration { * @since 0.11.0 */ public get type(): ProcessedType { - return ProcessedType.fromCompilableType("type"); + return BuiltInTypes.type; } /** * The value of this type, which is the type itself i.e. what value does this type represent. + * @throws {UndefinedSemanticsError} If this is accessed, before the type for the declaration finished. * @since 0.11.0 */ - public get typeValue(): ProcessedType { - throw new KipperNotImplementedError("Custom types are not implement yet"); + public get typeValue(): CustomType | ProcessedType { + return this.node?.getTypeSemanticData()?.type || this._builtInType!!; } /** diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts index 6394ea8ab..3ce58f095 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts @@ -5,7 +5,7 @@ import type { VariableDeclaration, VariableDeclarationSemantics, VariableDeclarationTypeSemantics } from "../../../ast"; import type { KipperStorageType } from "../../../const"; import type { Scope } from "../index"; -import type { ProcessedType } from "../../types"; +import {BuiltInTypes, ProcessedType} from "../../types"; import { ScopeDeclaration } from "./scope-declaration"; /** @@ -102,6 +102,6 @@ export class ScopeVariableDeclaration extends ScopeDeclaration { * @since 0.10.0 */ public get isCallable(): boolean { - return this.type.rawType === "func"; + return this.type === BuiltInTypes.func; } } diff --git a/kipper/core/src/compiler/analysis/symbol-table/global-scope.ts b/kipper/core/src/compiler/analysis/symbol-table/global-scope.ts index bad8450b2..452f47647 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/global-scope.ts +++ b/kipper/core/src/compiler/analysis/symbol-table/global-scope.ts @@ -4,10 +4,12 @@ * @since 0.8.0 */ import type { KipperProgramContext } from "../../program-ctx"; -import type { FunctionDeclaration, TypeDeclaration, VariableDeclaration } from "../../ast"; import type { ScopeDeclaration } from "./entry"; +import { FunctionDeclaration, TypeDeclaration, VariableDeclaration } from "../../ast"; import { ScopeFunctionDeclaration, ScopeTypeDeclaration, ScopeVariableDeclaration } from "./entry"; +import {KipperBuiltInTypeLiteral} from "../../const"; import { Scope } from "./scope"; +import {BuiltInType} from "../types"; /** * The global scope of a {@link KipperProgramContext}, which contains the global variables and functions of a @@ -47,14 +49,15 @@ export class GlobalScope extends Scope { return scopeDeclaration; } - public addType(declaration: TypeDeclaration): ScopeTypeDeclaration { - const identifier = declaration.getSemanticData().identifier; + public addType(declaration: TypeDeclaration): ScopeTypeDeclaration; + public addType(identifier: BuiltInType): ScopeTypeDeclaration; + public addType(declarationOrIdentifier: BuiltInType | TypeDeclaration): ScopeTypeDeclaration { + // Depending on the type of the argument, create either a built-in type or a custom type + const scopeDeclaration = declarationOrIdentifier instanceof TypeDeclaration ? + ScopeTypeDeclaration.fromTypeDeclaration(declarationOrIdentifier) : + ScopeTypeDeclaration.fromBuiltInType(declarationOrIdentifier); - // Ensuring that the declaration does not overwrite other declarations - this.programCtx.semanticCheck(declaration).identifierNotUsed(identifier, this.programCtx.globalScope); - - const scopeDeclaration = new ScopeTypeDeclaration(declaration); - this.entries.set(identifier, scopeDeclaration); + this.entries.set(scopeDeclaration.identifier, scopeDeclaration); return scopeDeclaration; } diff --git a/kipper/core/src/compiler/analysis/types/built-in-type.ts b/kipper/core/src/compiler/analysis/types/built-in-type.ts index c170f1436..bbb959c13 100644 --- a/kipper/core/src/compiler/analysis/types/built-in-type.ts +++ b/kipper/core/src/compiler/analysis/types/built-in-type.ts @@ -1,5 +1,5 @@ import { ProcessedType } from "./base/processed-type"; -import type { KipperBuiltInType } from "../../const"; +import {KipperBuiltInTypeLiteral, kipperBuiltInTypeLiterals} from "../../const"; import { KipperNotImplementedError } from "../../../errors"; import type { CompilableType } from "./base/compilable-type"; @@ -10,7 +10,7 @@ import type { CompilableType } from "./base/compilable-type"; export class BuiltInType extends ProcessedType implements CompilableType { public static readonly interchangeableTypes = ["void", "undefined"]; - public constructor(identifier: KipperBuiltInType) { + public constructor(identifier: KipperBuiltInTypeLiteral) { super(identifier, true); throw new KipperNotImplementedError("Built-in type wrapper classes are not implement yet"); } @@ -25,10 +25,30 @@ export class BuiltInType extends ProcessedType implements CompilableType { * @since 0.11.0 */ public isAssignableTo(type: ProcessedType): boolean { - if (this.identifier !== type.identifier) { - return BuiltInType.interchangeableTypes.includes(this.identifier) - && BuiltInType.interchangeableTypes.includes(type.identifier); + if (this === type) { + return true + } else if ( + BuiltInType.interchangeableTypes.includes(this.identifier) + && BuiltInType.interchangeableTypes.includes(type.identifier) + ) { + return true; } - return true; + return false; } } + +/** + * A map of all built-in types that are used in the type analysis phase. + * @since 0.11.0 + */ +export const BuiltInTypes = { + type: new BuiltInType("type"), + undefined: new BuiltInType("undefined"), + void: new BuiltInType("void"), + null: new BuiltInType("null"), + bool: new BuiltInType("bool"), + num: new BuiltInType("num"), + str: new BuiltInType("str"), + func: new BuiltInType("func"), + list: new BuiltInType("list"), +} satisfies Record; diff --git a/kipper/core/src/compiler/analysis/types/custom-type.ts b/kipper/core/src/compiler/analysis/types/custom-type.ts index 641c7e566..fd8c94965 100644 --- a/kipper/core/src/compiler/analysis/types/custom-type.ts +++ b/kipper/core/src/compiler/analysis/types/custom-type.ts @@ -1,9 +1,8 @@ -import type { KipperBuiltInType } from "../../const"; +import type { KipperBuiltInTypeLiteral } from "../../const"; import { ProcessedType } from "./base"; -export type CustomTypeConstraint = CustomPrimitiveTypeConstraint | CustomObjectTypeConstraint; -export type CustomPrimitiveTypeConstraint = KipperBuiltInType; -export type CustomObjectTypeConstraint = { [key: string]: CustomTypeConstraint }; +export type CustomTypeKind = "interface" | "class"; +export type CustomTypeFields = Map; /** * Represents a custom type which is not a built-in type. @@ -12,19 +11,31 @@ export type CustomObjectTypeConstraint = { [key: string]: CustomTypeConstraint } * @since 0.11.0 */ export class CustomType extends ProcessedType { - private readonly _constraints: CustomTypeConstraint; + private readonly _fields: CustomTypeFields; - public constructor(identifier: string, isCompilable: boolean, constraints: CustomTypeConstraint) { + /** + * The kind of this type. This is simply used to differentiate between classes and interfaces. + * @since 0.11.0 + */ + public readonly kind: CustomTypeKind; + + public constructor( + identifier: string, + isCompilable: boolean, + kind: CustomTypeKind, + fields: CustomTypeFields, + ) { super(identifier, isCompilable); - this._constraints = constraints; + this._fields = fields; + this.kind = kind; } /** - * Returns the constraints of this type. + * The fields of this type. * @since 0.11.0 */ - public get constraints(): CustomTypeConstraint { - return this._constraints; + public get fields(): CustomTypeFields { + return this._fields; } /** @@ -33,6 +44,11 @@ export class CustomType extends ProcessedType { * @since 0.11.0 */ isAssignableTo(type: ProcessedType): boolean { + if (type === this) { + return true; + } + + // TODO! Implement this once custom types are implemented return false; } } diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts index 6f1e836a1..b1bdf5ae3 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts @@ -1,4 +1,5 @@ import type { SemanticData } from "../../../ast-node"; +import {ProcessedType} from "../../../../analysis"; /** * Semantics for a {@link TypeDeclaration}. 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 530149ac1..8c8db7b13 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,7 +1,14 @@ import type { TypeData } from "../../../ast-node"; +import {CustomType} from "../../../../analysis"; /** * Type semantics for a {@link TypeDeclaration}. * @since 0.11.0 */ -export interface TypeDeclarationTypeSemantics extends TypeData {} +export interface TypeDeclarationTypeSemantics extends TypeData { + /** + * The processed type of the type declaration. + * @since 0.11.0 + */ + type: CustomType; +} diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/bool-primary-expression/bool-primary-expression-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/bool-primary-expression/bool-primary-expression-semantics.ts index c09a6cb78..0871c7aa5 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/bool-primary-expression/bool-primary-expression-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/bool-primary-expression/bool-primary-expression-semantics.ts @@ -2,7 +2,7 @@ * Semantics for AST Node {@link BoolPrimaryExpression}. * @since 0.8.0 */ -import type { KipperBoolTypeLiterals } from "../../../../../const"; +import type { KipperBoolTypeConstants } from "../../../../../const"; import type { PrimaryExpressionSemantics } from "../primary-expression-semantics"; /** @@ -14,5 +14,5 @@ export interface BoolPrimaryExpressionSemantics extends PrimaryExpressionSemanti * The value of this boolean constant expression. * @since 0.8.0 */ - value: KipperBoolTypeLiterals; + value: KipperBoolTypeConstants; } 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 802beabd4..3221a752a 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 @@ -5,7 +5,7 @@ import type { BoolPrimaryExpressionSemantics } from "./bool-primary-expression-semantics"; import type { BoolPrimaryExpressionTypeSemantics } from "./bool-primary-expression-type-semantics"; import type { CompilableASTNode } from "../../../../compilable-ast-node"; -import type { KipperBoolTypeLiterals } from "../../../../../const"; +import type { KipperBoolTypeConstants } from "../../../../../const"; import type { BoolPrimaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; import { ProcessedType } from "../../../../../analysis"; @@ -76,7 +76,7 @@ export class BoolPrimaryExpression extends PrimaryExpression< */ public async primarySemanticAnalysis(): Promise { this.semanticData = { - value: this.sourceCode, + value: this.sourceCode, }; } 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-semantics.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-semantics.ts index 58f239321..87ff0a4b0 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-semantics.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-semantics.ts @@ -2,7 +2,7 @@ * Semantics for AST Node {@link VoidOrNullOrUndefinedPrimaryExpression}. * @since 0.10.0 */ -import type { KipperNullType, KipperUndefinedType, KipperVoidType } from "../../../../../const"; +import type { KipperNullTypeLiteral, KipperUndefinedTypeLiteral, KipperVoidTypeLiteral } from "../../../../../const"; import type { PrimaryExpressionSemantics } from "../primary-expression-semantics"; /** @@ -14,5 +14,5 @@ export interface VoidOrNullOrUndefinedPrimaryExpressionSemantics extends Primary * The constant identifier of this expression. * @since 0.10.0 */ - constantIdentifier: KipperVoidType | KipperNullType | KipperUndefinedType; + constantIdentifier: KipperVoidTypeLiteral | KipperNullTypeLiteral | KipperUndefinedTypeLiteral; } 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 939b3e938..192b70d02 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 @@ -2,7 +2,7 @@ * Constant expression, representing the void, null or undefined keyword. * @since 0.10.0 */ -import type { KipperNullType, KipperUndefinedType, KipperVoidType } from "../../../../../const"; +import type { KipperNullTypeLiteral, KipperUndefinedTypeLiteral, KipperVoidTypeLiteral } from "../../../../../const"; import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { VoidOrNullOrUndefinedPrimaryExpressionSemantics } from "./void-or-null-or-undefined-primary-expression-semantics"; import type { VoidOrNullOrUndefinedPrimaryExpressionTypeSemantics } from "./void-or-null-or-undefined-primary-expression-type-semantics"; @@ -77,7 +77,7 @@ export class VoidOrNullOrUndefinedPrimaryExpression extends PrimaryExpression< public async primarySemanticAnalysis(): Promise { this.semanticData = { // Syntactically there can only be 'void', 'null' or 'undefined' stored in this expression - constantIdentifier: this.sourceCode, + constantIdentifier: this.sourceCode, value: this.sourceCode, // The value of this expression is equal to the constant identifier in string form }; } diff --git a/kipper/core/src/compiler/compile-config.ts b/kipper/core/src/compiler/compile-config.ts index eaef50a60..7c35e0436 100644 --- a/kipper/core/src/compiler/compile-config.ts +++ b/kipper/core/src/compiler/compile-config.ts @@ -138,8 +138,8 @@ export class EvaluatedCompileConfig implements CompileConfig { /** * The built-in functions that will be available in a Kipper program. * - * This will be extended by {@link extendBuiltInFunctions}. All built-in functions defined here must be implemented by the - * {@link target.builtInGenerator}. + * This will be extended by {@link extendBuiltInFunctions}. All built-in functions defined here must be implemented by + * the {@link target.builtInGenerator}. */ public readonly builtInFunctions: Array; diff --git a/kipper/core/src/compiler/const.ts b/kipper/core/src/compiler/const.ts index 2d89a7846..dde41b748 100644 --- a/kipper/core/src/compiler/const.ts +++ b/kipper/core/src/compiler/const.ts @@ -25,50 +25,50 @@ export const isBrowser = typeof window !== "undefined" && {}.toString.call(windo * type. * @since 0.8.0 */ -export type KipperMetaType = "type"; +export type KipperMetaTypeLiteral = "type"; /** * Represents the meta type in Kipper, which itself is used represents a type e.g. this is the type of a * type. * @since 0.8.0 */ -export const kipperMetaType: KipperMetaType = "type"; +export const kipperMetaTypeLiteral: KipperMetaTypeLiteral = "type"; /** * Null type in Kipper. * @since 0.10.0 */ -export type KipperNullType = "null"; +export type KipperNullTypeLiteral = "null"; /** * Null type in Kipper. * @since 0.10.0 */ -export const kipperNullType: KipperNullType = "null"; +export const kipperNullTypeLiteral: KipperNullTypeLiteral = "null"; /** * Undefined type in Kipper. * @since 0.10.0 */ -export type KipperUndefinedType = "undefined"; +export type KipperUndefinedTypeLiteral = "undefined"; /** * Undefined type in Kipper. * @since 0.10.0 */ -export const kipperUndefinedType: KipperUndefinedType = "undefined"; +export const kipperUndefinedTypeLiteral: KipperUndefinedTypeLiteral = "undefined"; /** * Function type in Kipper. * @since 0.6.0 */ -export type KipperFuncType = "func"; +export type KipperFuncTypeLiteral = "func"; /** * Function type in Kipper. * @since 0.6.0 */ -export const kipperFuncType: KipperFuncType = "func"; +export const kipperFuncTypeLiteral: KipperFuncTypeLiteral = "func"; /** * Void type in Kipper. @@ -76,7 +76,7 @@ export const kipperFuncType: KipperFuncType = "func"; * @example * void */ -export type KipperVoidType = "void"; +export type KipperVoidTypeLiteral = "void"; /** * Void type in Kipper. @@ -84,7 +84,7 @@ export type KipperVoidType = "void"; * @example * void */ -export const kipperVoidType: KipperVoidType = "void"; +export const kipperVoidTypeLiteral: KipperVoidTypeLiteral = "void"; /** * Numeric type in Kipper. @@ -92,7 +92,7 @@ export const kipperVoidType: KipperVoidType = "void"; * @example * num */ -export type KipperNumType = "num"; +export type KipperNumTypeLiteral = "num"; /** * Numeric type in Kipper. @@ -100,7 +100,7 @@ export type KipperNumType = "num"; * @example * num */ -export const kipperNumType: KipperNumType = "num"; +export const kipperNumTypeLiteral: KipperNumTypeLiteral = "num"; /** * String type in Kipper. @@ -108,7 +108,7 @@ export const kipperNumType: KipperNumType = "num"; * @example * str */ -export type KipperStrType = "str"; +export type KipperStrTypeLiteral = "str"; /** * String type in Kipper. @@ -116,7 +116,7 @@ export type KipperStrType = "str"; * @example * str */ -export const kipperStrType: KipperStrType = "str"; +export const kipperStrTypeLiteral: KipperStrTypeLiteral = "str"; /** * Boolean type in Kipper. @@ -124,15 +124,15 @@ export const kipperStrType: KipperStrType = "str"; * @example * bool */ -export type KipperBoolType = "bool"; +export type KipperBoolTypeLiteral = "bool"; /** - * Literal names for a Kipper boolean. + * Constant names for a Kipper boolean. * @since 0.8.0 * @example * var x: bool = true; */ -export type KipperBoolTypeLiterals = "true" | "false"; +export type KipperBoolTypeConstants = "true" | "false"; /** * Boolean type in Kipper. @@ -140,17 +140,14 @@ export type KipperBoolTypeLiterals = "true" | "false"; * @example * bool */ -export const kipperBoolType: KipperBoolType = "bool"; +export const kipperBoolTypeLiteral: KipperBoolTypeLiteral = "bool"; /** * List type in Kipper. {@link KipperType T} represents the type of the list content and only serves as a * type checking generic type, it will not change the type itself. * @since 0.5.0 - * @example - * list */ -// eslint-disable-next-line @typescript-eslint/no-unused-vars -export type KipperListType = "list"; +export type KipperListTypeLiteral = "list"; /** * List type in Kipper. {@link KipperType ValueType} represents the type of the list content and only serves as a @@ -159,31 +156,31 @@ export type KipperListType = "list"; * @example * list */ -export const kipperListType: KipperListType = "list"; +export const kipperListTypeLiteral: KipperListTypeLiteral = "list"; /** * All primitive types inside Kipper. * @since 0.6.0 */ -export type KipperPrimitiveType = - | KipperVoidType - | KipperNullType - | KipperUndefinedType - | KipperNumType - | KipperStrType - | KipperBoolType; +export type KipperPrimitiveTypeLiteral = + | KipperVoidTypeLiteral + | KipperNullTypeLiteral + | KipperUndefinedTypeLiteral + | KipperNumTypeLiteral + | KipperStrTypeLiteral + | KipperBoolTypeLiteral; /** * All primitive types inside Kipper. * @since 0.6.0 */ -export const kipperPrimitiveTypes: Array = [ - kipperVoidType, - kipperNullType, - kipperUndefinedType, - kipperNumType, - kipperStrType, - kipperBoolType, +export const kipperPrimitiveTypeLiterals: Array = [ + kipperVoidTypeLiteral, + kipperNullTypeLiteral, + kipperUndefinedTypeLiteral, + kipperNumTypeLiteral, + kipperStrTypeLiteral, + kipperBoolTypeLiteral, ]; /** @@ -193,16 +190,17 @@ export const kipperPrimitiveTypes: Array = [ * only used for error handling/recovery and skips type checking altogether. * @since 0.10.0 */ -export type KipperBuiltInType = KipperMetaType | KipperPrimitiveType | KipperFuncType | KipperListType; +export type KipperBuiltInTypeLiteral = KipperMetaTypeLiteral | KipperPrimitiveTypeLiteral | KipperFuncTypeLiteral | KipperListTypeLiteral; /** * All compilable and valid base types inside Kipper. * @since 0.10.0 */ -export const kipperBuiltInTypes: Array = [ - kipperFuncType, - ...kipperPrimitiveTypes, - kipperListType, +export const kipperBuiltInTypeLiterals: Array = [ + kipperMetaTypeLiteral, + kipperFuncTypeLiteral, + ...kipperPrimitiveTypeLiterals, + kipperListTypeLiteral, ]; /** @@ -212,7 +210,7 @@ export const kipperBuiltInTypes: Array = [ * which generates for each conversion the translator function in the specific target. * @since 0.8.0 */ -export const kipperSupportedConversions: Array<[KipperBuiltInType, KipperBuiltInType]> = [ +export const kipperSupportedConversions: Array<[KipperBuiltInTypeLiteral, KipperBuiltInTypeLiteral]> = [ ["num", "str"], ["bool", "str"], ["void", "str"], diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperLexer.interp b/kipper/core/src/compiler/lexer-parser/antlr/KipperLexer.interp index 6fb70de37..0e72778cf 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperLexer.interp +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperLexer.interp @@ -23,6 +23,8 @@ null 'return' 'call' '->' +'class' +'interface' 'true' 'false' 'typeof' @@ -110,6 +112,8 @@ DefFunc Return CallFunc RetIndicator +Class +Interface True False Typeof @@ -195,6 +199,8 @@ DefFunc Return CallFunc RetIndicator +Class +Interface True False Typeof @@ -304,4 +310,4 @@ SINGLE_QUOTE_FSTRING DOUBLE_QUOTE_FSTRING atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 86, 736, 8, 1, 8, 1, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, 9, 101, 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 4, 105, 9, 105, 4, 106, 9, 106, 4, 107, 9, 107, 4, 108, 9, 108, 4, 109, 9, 109, 4, 110, 9, 110, 4, 111, 9, 111, 4, 112, 9, 112, 4, 113, 9, 113, 4, 114, 9, 114, 4, 115, 9, 115, 4, 116, 9, 116, 4, 117, 9, 117, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 242, 10, 2, 12, 2, 14, 2, 245, 11, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 52, 3, 52, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 64, 3, 64, 3, 65, 3, 65, 3, 66, 3, 66, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 3, 69, 3, 69, 3, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 71, 3, 71, 3, 72, 3, 72, 3, 72, 7, 72, 514, 10, 72, 12, 72, 14, 72, 517, 11, 72, 3, 73, 3, 73, 3, 73, 3, 73, 5, 73, 523, 10, 73, 3, 74, 3, 74, 5, 74, 527, 10, 74, 3, 74, 3, 74, 3, 75, 3, 75, 5, 75, 533, 10, 75, 3, 75, 3, 75, 3, 76, 3, 76, 3, 77, 6, 77, 540, 10, 77, 13, 77, 14, 77, 541, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 3, 78, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 79, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 84, 3, 84, 3, 84, 3, 84, 3, 84, 3, 84, 3, 85, 3, 85, 3, 85, 3, 85, 3, 85, 3, 86, 3, 86, 3, 87, 3, 87, 3, 88, 3, 88, 3, 89, 3, 89, 3, 90, 6, 90, 597, 10, 90, 13, 90, 14, 90, 598, 3, 91, 3, 91, 3, 91, 6, 91, 604, 10, 91, 13, 91, 14, 91, 605, 3, 92, 3, 92, 3, 92, 6, 92, 611, 10, 92, 13, 92, 14, 92, 612, 3, 93, 3, 93, 3, 93, 6, 93, 618, 10, 93, 13, 93, 14, 93, 619, 3, 94, 3, 94, 3, 95, 3, 95, 3, 96, 3, 96, 3, 97, 3, 97, 3, 98, 3, 98, 5, 98, 632, 10, 98, 3, 98, 3, 98, 3, 98, 5, 98, 637, 10, 98, 3, 99, 5, 99, 640, 10, 99, 3, 99, 3, 99, 3, 99, 3, 99, 3, 99, 5, 99, 647, 10, 99, 3, 100, 3, 100, 5, 100, 651, 10, 100, 3, 100, 3, 100, 3, 101, 6, 101, 656, 10, 101, 13, 101, 14, 101, 657, 3, 102, 3, 102, 3, 103, 6, 103, 663, 10, 103, 13, 103, 14, 103, 664, 3, 104, 3, 104, 5, 104, 669, 10, 104, 3, 105, 3, 105, 3, 105, 5, 105, 674, 10, 105, 3, 106, 3, 106, 3, 106, 3, 107, 3, 107, 3, 107, 5, 107, 682, 10, 107, 3, 107, 5, 107, 685, 10, 107, 3, 108, 3, 108, 3, 108, 3, 108, 6, 108, 691, 10, 108, 13, 108, 14, 108, 692, 3, 109, 6, 109, 696, 10, 109, 13, 109, 14, 109, 697, 3, 110, 3, 110, 5, 110, 702, 10, 110, 3, 111, 6, 111, 705, 10, 111, 13, 111, 14, 111, 706, 3, 112, 3, 112, 5, 112, 711, 10, 112, 3, 113, 6, 113, 714, 10, 113, 13, 113, 14, 113, 715, 3, 114, 3, 114, 5, 114, 720, 10, 114, 3, 115, 6, 115, 723, 10, 115, 13, 115, 14, 115, 724, 3, 116, 3, 116, 5, 116, 729, 10, 116, 3, 117, 7, 117, 732, 10, 117, 12, 117, 14, 117, 735, 11, 117, 3, 243, 2, 2, 118, 5, 2, 4, 7, 2, 5, 9, 2, 6, 11, 2, 7, 13, 2, 8, 15, 2, 9, 17, 2, 10, 19, 2, 11, 21, 2, 12, 23, 2, 13, 25, 2, 14, 27, 2, 15, 29, 2, 16, 31, 2, 17, 33, 2, 18, 35, 2, 19, 37, 2, 20, 39, 2, 21, 41, 2, 22, 43, 2, 23, 45, 2, 24, 47, 2, 25, 49, 2, 26, 51, 2, 27, 53, 2, 28, 55, 2, 29, 57, 2, 30, 59, 2, 31, 61, 2, 32, 63, 2, 33, 65, 2, 34, 67, 2, 35, 69, 2, 36, 71, 2, 37, 73, 2, 38, 75, 2, 39, 77, 2, 40, 79, 2, 41, 81, 2, 42, 83, 2, 43, 85, 2, 44, 87, 2, 45, 89, 2, 46, 91, 2, 47, 93, 2, 48, 95, 2, 49, 97, 2, 50, 99, 2, 51, 101, 2, 52, 103, 2, 53, 105, 2, 54, 107, 2, 55, 109, 2, 56, 111, 2, 57, 113, 2, 58, 115, 2, 59, 117, 2, 60, 119, 2, 61, 121, 2, 62, 123, 2, 63, 125, 2, 64, 127, 2, 65, 129, 2, 66, 131, 2, 67, 133, 2, 68, 135, 2, 69, 137, 2, 70, 139, 2, 71, 141, 2, 72, 143, 2, 73, 145, 2, 74, 147, 2, 75, 149, 2, 76, 151, 2, 77, 153, 2, 78, 155, 2, 79, 157, 2, 80, 159, 2, 81, 161, 2, 82, 163, 2, 2, 165, 2, 83, 167, 2, 84, 169, 2, 2, 171, 2, 85, 173, 2, 86, 175, 2, 2, 177, 2, 2, 179, 2, 2, 181, 2, 2, 183, 2, 2, 185, 2, 2, 187, 2, 2, 189, 2, 2, 191, 2, 2, 193, 2, 2, 195, 2, 2, 197, 2, 2, 199, 2, 2, 201, 2, 2, 203, 2, 2, 205, 2, 2, 207, 2, 2, 209, 2, 2, 211, 2, 2, 213, 2, 2, 215, 2, 2, 217, 2, 2, 219, 2, 2, 221, 2, 2, 223, 2, 2, 225, 2, 2, 227, 2, 2, 229, 2, 2, 231, 2, 2, 233, 2, 2, 235, 2, 2, 5, 2, 3, 4, 20, 6, 2, 11, 11, 13, 14, 34, 34, 162, 162, 5, 2, 12, 12, 15, 15, 8234, 8235, 5, 2, 67, 92, 97, 97, 99, 124, 3, 2, 50, 59, 4, 2, 68, 68, 100, 100, 4, 2, 81, 81, 113, 113, 4, 2, 90, 90, 122, 122, 3, 2, 51, 59, 3, 2, 50, 51, 3, 2, 50, 57, 5, 2, 50, 59, 67, 72, 99, 104, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, 6, 2, 12, 12, 15, 15, 41, 41, 94, 94, 14, 2, 36, 36, 41, 41, 65, 65, 94, 94, 99, 100, 104, 104, 112, 112, 116, 116, 118, 118, 120, 120, 125, 125, 127, 127, 8, 2, 12, 12, 15, 15, 41, 41, 94, 94, 125, 125, 127, 127, 8, 2, 12, 12, 15, 15, 36, 36, 94, 94, 125, 125, 127, 127, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94, 2, 737, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, 2, 109, 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, 2, 2, 2, 2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 2, 123, 3, 2, 2, 2, 2, 125, 3, 2, 2, 2, 2, 127, 3, 2, 2, 2, 2, 129, 3, 2, 2, 2, 2, 131, 3, 2, 2, 2, 2, 133, 3, 2, 2, 2, 2, 135, 3, 2, 2, 2, 2, 137, 3, 2, 2, 2, 2, 139, 3, 2, 2, 2, 2, 141, 3, 2, 2, 2, 2, 143, 3, 2, 2, 2, 2, 145, 3, 2, 2, 2, 2, 147, 3, 2, 2, 2, 2, 149, 3, 2, 2, 2, 2, 151, 3, 2, 2, 2, 2, 153, 3, 2, 2, 2, 2, 155, 3, 2, 2, 2, 2, 157, 3, 2, 2, 2, 2, 159, 3, 2, 2, 2, 2, 161, 3, 2, 2, 2, 3, 163, 3, 2, 2, 2, 3, 165, 3, 2, 2, 2, 3, 167, 3, 2, 2, 2, 4, 169, 3, 2, 2, 2, 4, 171, 3, 2, 2, 2, 4, 173, 3, 2, 2, 2, 5, 237, 3, 2, 2, 2, 7, 251, 3, 2, 2, 2, 9, 258, 3, 2, 2, 2, 11, 270, 3, 2, 2, 2, 13, 276, 3, 2, 2, 2, 15, 280, 3, 2, 2, 2, 17, 283, 3, 2, 2, 2, 19, 287, 3, 2, 2, 2, 21, 294, 3, 2, 2, 2, 23, 299, 3, 2, 2, 2, 25, 307, 3, 2, 2, 2, 27, 313, 3, 2, 2, 2, 29, 322, 3, 2, 2, 2, 31, 325, 3, 2, 2, 2, 33, 331, 3, 2, 2, 2, 35, 334, 3, 2, 2, 2, 37, 339, 3, 2, 2, 2, 39, 343, 3, 2, 2, 2, 41, 348, 3, 2, 2, 2, 43, 352, 3, 2, 2, 2, 45, 359, 3, 2, 2, 2, 47, 364, 3, 2, 2, 2, 49, 367, 3, 2, 2, 2, 51, 372, 3, 2, 2, 2, 53, 378, 3, 2, 2, 2, 55, 385, 3, 2, 2, 2, 57, 390, 3, 2, 2, 2, 59, 395, 3, 2, 2, 2, 61, 405, 3, 2, 2, 2, 63, 407, 3, 2, 2, 2, 65, 409, 3, 2, 2, 2, 67, 411, 3, 2, 2, 2, 69, 413, 3, 2, 2, 2, 71, 415, 3, 2, 2, 2, 73, 417, 3, 2, 2, 2, 75, 419, 3, 2, 2, 2, 77, 421, 3, 2, 2, 2, 79, 426, 3, 2, 2, 2, 81, 428, 3, 2, 2, 2, 83, 430, 3, 2, 2, 2, 85, 432, 3, 2, 2, 2, 87, 435, 3, 2, 2, 2, 89, 437, 3, 2, 2, 2, 91, 440, 3, 2, 2, 2, 93, 442, 3, 2, 2, 2, 95, 444, 3, 2, 2, 2, 97, 446, 3, 2, 2, 2, 99, 449, 3, 2, 2, 2, 101, 452, 3, 2, 2, 2, 103, 455, 3, 2, 2, 2, 105, 457, 3, 2, 2, 2, 107, 459, 3, 2, 2, 2, 109, 462, 3, 2, 2, 2, 111, 465, 3, 2, 2, 2, 113, 468, 3, 2, 2, 2, 115, 471, 3, 2, 2, 2, 117, 474, 3, 2, 2, 2, 119, 477, 3, 2, 2, 2, 121, 480, 3, 2, 2, 2, 123, 482, 3, 2, 2, 2, 125, 485, 3, 2, 2, 2, 127, 487, 3, 2, 2, 2, 129, 490, 3, 2, 2, 2, 131, 492, 3, 2, 2, 2, 133, 494, 3, 2, 2, 2, 135, 496, 3, 2, 2, 2, 137, 498, 3, 2, 2, 2, 139, 501, 3, 2, 2, 2, 141, 504, 3, 2, 2, 2, 143, 508, 3, 2, 2, 2, 145, 510, 3, 2, 2, 2, 147, 522, 3, 2, 2, 2, 149, 524, 3, 2, 2, 2, 151, 530, 3, 2, 2, 2, 153, 536, 3, 2, 2, 2, 155, 539, 3, 2, 2, 2, 157, 545, 3, 2, 2, 2, 159, 549, 3, 2, 2, 2, 161, 556, 3, 2, 2, 2, 163, 563, 3, 2, 2, 2, 165, 569, 3, 2, 2, 2, 167, 574, 3, 2, 2, 2, 169, 576, 3, 2, 2, 2, 171, 582, 3, 2, 2, 2, 173, 587, 3, 2, 2, 2, 175, 589, 3, 2, 2, 2, 177, 591, 3, 2, 2, 2, 179, 593, 3, 2, 2, 2, 181, 596, 3, 2, 2, 2, 183, 600, 3, 2, 2, 2, 185, 607, 3, 2, 2, 2, 187, 614, 3, 2, 2, 2, 189, 621, 3, 2, 2, 2, 191, 623, 3, 2, 2, 2, 193, 625, 3, 2, 2, 2, 195, 627, 3, 2, 2, 2, 197, 636, 3, 2, 2, 2, 199, 646, 3, 2, 2, 2, 201, 648, 3, 2, 2, 2, 203, 655, 3, 2, 2, 2, 205, 659, 3, 2, 2, 2, 207, 662, 3, 2, 2, 2, 209, 668, 3, 2, 2, 2, 211, 673, 3, 2, 2, 2, 213, 675, 3, 2, 2, 2, 215, 678, 3, 2, 2, 2, 217, 686, 3, 2, 2, 2, 219, 695, 3, 2, 2, 2, 221, 701, 3, 2, 2, 2, 223, 704, 3, 2, 2, 2, 225, 710, 3, 2, 2, 2, 227, 713, 3, 2, 2, 2, 229, 719, 3, 2, 2, 2, 231, 722, 3, 2, 2, 2, 233, 728, 3, 2, 2, 2, 235, 733, 3, 2, 2, 2, 237, 238, 7, 49, 2, 2, 238, 239, 7, 44, 2, 2, 239, 243, 3, 2, 2, 2, 240, 242, 11, 2, 2, 2, 241, 240, 3, 2, 2, 2, 242, 245, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 243, 241, 3, 2, 2, 2, 244, 246, 3, 2, 2, 2, 245, 243, 3, 2, 2, 2, 246, 247, 7, 44, 2, 2, 247, 248, 7, 49, 2, 2, 248, 249, 3, 2, 2, 2, 249, 250, 8, 2, 2, 2, 250, 6, 3, 2, 2, 2, 251, 252, 7, 49, 2, 2, 252, 253, 7, 49, 2, 2, 253, 254, 3, 2, 2, 2, 254, 255, 5, 235, 117, 2, 255, 256, 3, 2, 2, 2, 256, 257, 8, 3, 2, 2, 257, 8, 3, 2, 2, 2, 258, 259, 7, 37, 2, 2, 259, 260, 7, 114, 2, 2, 260, 261, 7, 116, 2, 2, 261, 262, 7, 99, 2, 2, 262, 263, 7, 105, 2, 2, 263, 264, 7, 111, 2, 2, 264, 265, 7, 99, 2, 2, 265, 266, 3, 2, 2, 2, 266, 267, 5, 235, 117, 2, 267, 268, 3, 2, 2, 2, 268, 269, 8, 4, 3, 2, 269, 10, 3, 2, 2, 2, 270, 271, 7, 101, 2, 2, 271, 272, 7, 113, 2, 2, 272, 273, 7, 112, 2, 2, 273, 274, 7, 117, 2, 2, 274, 275, 7, 118, 2, 2, 275, 12, 3, 2, 2, 2, 276, 277, 7, 120, 2, 2, 277, 278, 7, 99, 2, 2, 278, 279, 7, 116, 2, 2, 279, 14, 3, 2, 2, 2, 280, 281, 7, 99, 2, 2, 281, 282, 7, 117, 2, 2, 282, 16, 3, 2, 2, 2, 283, 284, 7, 48, 2, 2, 284, 285, 7, 48, 2, 2, 285, 286, 7, 48, 2, 2, 286, 18, 3, 2, 2, 2, 287, 288, 7, 117, 2, 2, 288, 289, 7, 121, 2, 2, 289, 290, 7, 107, 2, 2, 290, 291, 7, 118, 2, 2, 291, 292, 7, 101, 2, 2, 292, 293, 7, 106, 2, 2, 293, 20, 3, 2, 2, 2, 294, 295, 7, 101, 2, 2, 295, 296, 7, 99, 2, 2, 296, 297, 7, 117, 2, 2, 297, 298, 7, 103, 2, 2, 298, 22, 3, 2, 2, 2, 299, 300, 7, 102, 2, 2, 300, 301, 7, 103, 2, 2, 301, 302, 7, 104, 2, 2, 302, 303, 7, 99, 2, 2, 303, 304, 7, 119, 2, 2, 304, 305, 7, 110, 2, 2, 305, 306, 7, 118, 2, 2, 306, 24, 3, 2, 2, 2, 307, 308, 7, 100, 2, 2, 308, 309, 7, 116, 2, 2, 309, 310, 7, 103, 2, 2, 310, 311, 7, 99, 2, 2, 311, 312, 7, 109, 2, 2, 312, 26, 3, 2, 2, 2, 313, 314, 7, 101, 2, 2, 314, 315, 7, 113, 2, 2, 315, 316, 7, 112, 2, 2, 316, 317, 7, 118, 2, 2, 317, 318, 7, 107, 2, 2, 318, 319, 7, 112, 2, 2, 319, 320, 7, 119, 2, 2, 320, 321, 7, 103, 2, 2, 321, 28, 3, 2, 2, 2, 322, 323, 7, 102, 2, 2, 323, 324, 7, 113, 2, 2, 324, 30, 3, 2, 2, 2, 325, 326, 7, 121, 2, 2, 326, 327, 7, 106, 2, 2, 327, 328, 7, 107, 2, 2, 328, 329, 7, 110, 2, 2, 329, 330, 7, 103, 2, 2, 330, 32, 3, 2, 2, 2, 331, 332, 7, 107, 2, 2, 332, 333, 7, 104, 2, 2, 333, 34, 3, 2, 2, 2, 334, 335, 7, 103, 2, 2, 335, 336, 7, 110, 2, 2, 336, 337, 7, 117, 2, 2, 337, 338, 7, 103, 2, 2, 338, 36, 3, 2, 2, 2, 339, 340, 7, 104, 2, 2, 340, 341, 7, 113, 2, 2, 341, 342, 7, 116, 2, 2, 342, 38, 3, 2, 2, 2, 343, 344, 7, 103, 2, 2, 344, 345, 7, 112, 2, 2, 345, 346, 7, 119, 2, 2, 346, 347, 7, 111, 2, 2, 347, 40, 3, 2, 2, 2, 348, 349, 7, 102, 2, 2, 349, 350, 7, 103, 2, 2, 350, 351, 7, 104, 2, 2, 351, 42, 3, 2, 2, 2, 352, 353, 7, 116, 2, 2, 353, 354, 7, 103, 2, 2, 354, 355, 7, 118, 2, 2, 355, 356, 7, 119, 2, 2, 356, 357, 7, 116, 2, 2, 357, 358, 7, 112, 2, 2, 358, 44, 3, 2, 2, 2, 359, 360, 7, 101, 2, 2, 360, 361, 7, 99, 2, 2, 361, 362, 7, 110, 2, 2, 362, 363, 7, 110, 2, 2, 363, 46, 3, 2, 2, 2, 364, 365, 7, 47, 2, 2, 365, 366, 7, 64, 2, 2, 366, 48, 3, 2, 2, 2, 367, 368, 7, 118, 2, 2, 368, 369, 7, 116, 2, 2, 369, 370, 7, 119, 2, 2, 370, 371, 7, 103, 2, 2, 371, 50, 3, 2, 2, 2, 372, 373, 7, 104, 2, 2, 373, 374, 7, 99, 2, 2, 374, 375, 7, 110, 2, 2, 375, 376, 7, 117, 2, 2, 376, 377, 7, 103, 2, 2, 377, 52, 3, 2, 2, 2, 378, 379, 7, 118, 2, 2, 379, 380, 7, 123, 2, 2, 380, 381, 7, 114, 2, 2, 381, 382, 7, 103, 2, 2, 382, 383, 7, 113, 2, 2, 383, 384, 7, 104, 2, 2, 384, 54, 3, 2, 2, 2, 385, 386, 7, 120, 2, 2, 386, 387, 7, 113, 2, 2, 387, 388, 7, 107, 2, 2, 388, 389, 7, 102, 2, 2, 389, 56, 3, 2, 2, 2, 390, 391, 7, 112, 2, 2, 391, 392, 7, 119, 2, 2, 392, 393, 7, 110, 2, 2, 393, 394, 7, 110, 2, 2, 394, 58, 3, 2, 2, 2, 395, 396, 7, 119, 2, 2, 396, 397, 7, 112, 2, 2, 397, 398, 7, 102, 2, 2, 398, 399, 7, 103, 2, 2, 399, 400, 7, 104, 2, 2, 400, 401, 7, 107, 2, 2, 401, 402, 7, 112, 2, 2, 402, 403, 7, 103, 2, 2, 403, 404, 7, 102, 2, 2, 404, 60, 3, 2, 2, 2, 405, 406, 7, 46, 2, 2, 406, 62, 3, 2, 2, 2, 407, 408, 7, 61, 2, 2, 408, 64, 3, 2, 2, 2, 409, 410, 7, 65, 2, 2, 410, 66, 3, 2, 2, 2, 411, 412, 7, 60, 2, 2, 412, 68, 3, 2, 2, 2, 413, 414, 7, 42, 2, 2, 414, 70, 3, 2, 2, 2, 415, 416, 7, 43, 2, 2, 416, 72, 3, 2, 2, 2, 417, 418, 7, 93, 2, 2, 418, 74, 3, 2, 2, 2, 419, 420, 7, 95, 2, 2, 420, 76, 3, 2, 2, 2, 421, 422, 6, 38, 2, 2, 422, 423, 7, 127, 2, 2, 423, 424, 3, 2, 2, 2, 424, 425, 8, 38, 4, 2, 425, 78, 3, 2, 2, 2, 426, 427, 7, 125, 2, 2, 427, 80, 3, 2, 2, 2, 428, 429, 7, 127, 2, 2, 429, 82, 3, 2, 2, 2, 430, 431, 7, 45, 2, 2, 431, 84, 3, 2, 2, 2, 432, 433, 7, 45, 2, 2, 433, 434, 7, 45, 2, 2, 434, 86, 3, 2, 2, 2, 435, 436, 7, 47, 2, 2, 436, 88, 3, 2, 2, 2, 437, 438, 7, 47, 2, 2, 438, 439, 7, 47, 2, 2, 439, 90, 3, 2, 2, 2, 440, 441, 7, 44, 2, 2, 441, 92, 3, 2, 2, 2, 442, 443, 7, 49, 2, 2, 443, 94, 3, 2, 2, 2, 444, 445, 7, 39, 2, 2, 445, 96, 3, 2, 2, 2, 446, 447, 7, 44, 2, 2, 447, 448, 7, 44, 2, 2, 448, 98, 3, 2, 2, 2, 449, 450, 7, 40, 2, 2, 450, 451, 7, 40, 2, 2, 451, 100, 3, 2, 2, 2, 452, 453, 7, 126, 2, 2, 453, 454, 7, 126, 2, 2, 454, 102, 3, 2, 2, 2, 455, 456, 7, 35, 2, 2, 456, 104, 3, 2, 2, 2, 457, 458, 7, 63, 2, 2, 458, 106, 3, 2, 2, 2, 459, 460, 7, 45, 2, 2, 460, 461, 7, 63, 2, 2, 461, 108, 3, 2, 2, 2, 462, 463, 7, 47, 2, 2, 463, 464, 7, 63, 2, 2, 464, 110, 3, 2, 2, 2, 465, 466, 7, 44, 2, 2, 466, 467, 7, 63, 2, 2, 467, 112, 3, 2, 2, 2, 468, 469, 7, 49, 2, 2, 469, 470, 7, 63, 2, 2, 470, 114, 3, 2, 2, 2, 471, 472, 7, 39, 2, 2, 472, 473, 7, 63, 2, 2, 473, 116, 3, 2, 2, 2, 474, 475, 7, 63, 2, 2, 475, 476, 7, 63, 2, 2, 476, 118, 3, 2, 2, 2, 477, 478, 7, 35, 2, 2, 478, 479, 7, 63, 2, 2, 479, 120, 3, 2, 2, 2, 480, 481, 7, 62, 2, 2, 481, 122, 3, 2, 2, 2, 482, 483, 7, 62, 2, 2, 483, 484, 7, 63, 2, 2, 484, 124, 3, 2, 2, 2, 485, 486, 7, 64, 2, 2, 486, 126, 3, 2, 2, 2, 487, 488, 7, 64, 2, 2, 488, 489, 7, 63, 2, 2, 489, 128, 3, 2, 2, 2, 490, 491, 7, 40, 2, 2, 491, 130, 3, 2, 2, 2, 492, 493, 7, 126, 2, 2, 493, 132, 3, 2, 2, 2, 494, 495, 7, 96, 2, 2, 495, 134, 3, 2, 2, 2, 496, 497, 7, 128, 2, 2, 497, 136, 3, 2, 2, 2, 498, 499, 7, 62, 2, 2, 499, 500, 7, 62, 2, 2, 500, 138, 3, 2, 2, 2, 501, 502, 7, 64, 2, 2, 502, 503, 7, 64, 2, 2, 503, 140, 3, 2, 2, 2, 504, 505, 7, 64, 2, 2, 505, 506, 7, 64, 2, 2, 506, 507, 7, 64, 2, 2, 507, 142, 3, 2, 2, 2, 508, 509, 7, 48, 2, 2, 509, 144, 3, 2, 2, 2, 510, 515, 5, 175, 87, 2, 511, 514, 5, 175, 87, 2, 512, 514, 5, 179, 89, 2, 513, 511, 3, 2, 2, 2, 513, 512, 3, 2, 2, 2, 514, 517, 3, 2, 2, 2, 515, 513, 3, 2, 2, 2, 515, 516, 3, 2, 2, 2, 516, 146, 3, 2, 2, 2, 517, 515, 3, 2, 2, 2, 518, 523, 5, 181, 90, 2, 519, 523, 5, 185, 92, 2, 520, 523, 5, 187, 93, 2, 521, 523, 5, 183, 91, 2, 522, 518, 3, 2, 2, 2, 522, 519, 3, 2, 2, 2, 522, 520, 3, 2, 2, 2, 522, 521, 3, 2, 2, 2, 523, 148, 3, 2, 2, 2, 524, 526, 7, 41, 2, 2, 525, 527, 5, 227, 113, 2, 526, 525, 3, 2, 2, 2, 526, 527, 3, 2, 2, 2, 527, 528, 3, 2, 2, 2, 528, 529, 7, 41, 2, 2, 529, 150, 3, 2, 2, 2, 530, 532, 7, 36, 2, 2, 531, 533, 5, 231, 115, 2, 532, 531, 3, 2, 2, 2, 532, 533, 3, 2, 2, 2, 533, 534, 3, 2, 2, 2, 534, 535, 7, 36, 2, 2, 535, 152, 3, 2, 2, 2, 536, 537, 5, 197, 98, 2, 537, 154, 3, 2, 2, 2, 538, 540, 9, 2, 2, 2, 539, 538, 3, 2, 2, 2, 540, 541, 3, 2, 2, 2, 541, 539, 3, 2, 2, 2, 541, 542, 3, 2, 2, 2, 542, 543, 3, 2, 2, 2, 543, 544, 8, 77, 5, 2, 544, 156, 3, 2, 2, 2, 545, 546, 9, 3, 2, 2, 546, 547, 3, 2, 2, 2, 547, 548, 8, 78, 5, 2, 548, 158, 3, 2, 2, 2, 549, 550, 7, 104, 2, 2, 550, 551, 7, 41, 2, 2, 551, 552, 3, 2, 2, 2, 552, 553, 8, 79, 6, 2, 553, 554, 3, 2, 2, 2, 554, 555, 8, 79, 7, 2, 555, 160, 3, 2, 2, 2, 556, 557, 7, 104, 2, 2, 557, 558, 7, 36, 2, 2, 558, 559, 3, 2, 2, 2, 559, 560, 8, 80, 8, 2, 560, 561, 3, 2, 2, 2, 561, 562, 8, 80, 9, 2, 562, 162, 3, 2, 2, 2, 563, 564, 6, 81, 3, 2, 564, 565, 7, 125, 2, 2, 565, 566, 3, 2, 2, 2, 566, 567, 8, 81, 10, 2, 567, 568, 8, 81, 11, 2, 568, 164, 3, 2, 2, 2, 569, 570, 7, 41, 2, 2, 570, 571, 8, 82, 12, 2, 571, 572, 3, 2, 2, 2, 572, 573, 8, 82, 4, 2, 573, 166, 3, 2, 2, 2, 574, 575, 5, 219, 109, 2, 575, 168, 3, 2, 2, 2, 576, 577, 6, 84, 4, 2, 577, 578, 7, 125, 2, 2, 578, 579, 3, 2, 2, 2, 579, 580, 8, 84, 10, 2, 580, 581, 8, 84, 11, 2, 581, 170, 3, 2, 2, 2, 582, 583, 7, 36, 2, 2, 583, 584, 8, 85, 13, 2, 584, 585, 3, 2, 2, 2, 585, 586, 8, 85, 4, 2, 586, 172, 3, 2, 2, 2, 587, 588, 5, 223, 111, 2, 588, 174, 3, 2, 2, 2, 589, 590, 5, 177, 88, 2, 590, 176, 3, 2, 2, 2, 591, 592, 9, 4, 2, 2, 592, 178, 3, 2, 2, 2, 593, 594, 9, 5, 2, 2, 594, 180, 3, 2, 2, 2, 595, 597, 5, 179, 89, 2, 596, 595, 3, 2, 2, 2, 597, 598, 3, 2, 2, 2, 598, 596, 3, 2, 2, 2, 598, 599, 3, 2, 2, 2, 599, 182, 3, 2, 2, 2, 600, 601, 7, 50, 2, 2, 601, 603, 9, 6, 2, 2, 602, 604, 5, 191, 95, 2, 603, 602, 3, 2, 2, 2, 604, 605, 3, 2, 2, 2, 605, 603, 3, 2, 2, 2, 605, 606, 3, 2, 2, 2, 606, 184, 3, 2, 2, 2, 607, 608, 7, 50, 2, 2, 608, 610, 9, 7, 2, 2, 609, 611, 5, 193, 96, 2, 610, 609, 3, 2, 2, 2, 611, 612, 3, 2, 2, 2, 612, 610, 3, 2, 2, 2, 612, 613, 3, 2, 2, 2, 613, 186, 3, 2, 2, 2, 614, 615, 7, 50, 2, 2, 615, 617, 9, 8, 2, 2, 616, 618, 5, 195, 97, 2, 617, 616, 3, 2, 2, 2, 618, 619, 3, 2, 2, 2, 619, 617, 3, 2, 2, 2, 619, 620, 3, 2, 2, 2, 620, 188, 3, 2, 2, 2, 621, 622, 9, 9, 2, 2, 622, 190, 3, 2, 2, 2, 623, 624, 9, 10, 2, 2, 624, 192, 3, 2, 2, 2, 625, 626, 9, 11, 2, 2, 626, 194, 3, 2, 2, 2, 627, 628, 9, 12, 2, 2, 628, 196, 3, 2, 2, 2, 629, 631, 5, 199, 99, 2, 630, 632, 5, 201, 100, 2, 631, 630, 3, 2, 2, 2, 631, 632, 3, 2, 2, 2, 632, 637, 3, 2, 2, 2, 633, 634, 5, 203, 101, 2, 634, 635, 5, 201, 100, 2, 635, 637, 3, 2, 2, 2, 636, 629, 3, 2, 2, 2, 636, 633, 3, 2, 2, 2, 637, 198, 3, 2, 2, 2, 638, 640, 5, 203, 101, 2, 639, 638, 3, 2, 2, 2, 639, 640, 3, 2, 2, 2, 640, 641, 3, 2, 2, 2, 641, 642, 7, 48, 2, 2, 642, 647, 5, 203, 101, 2, 643, 644, 5, 203, 101, 2, 644, 645, 7, 48, 2, 2, 645, 647, 3, 2, 2, 2, 646, 639, 3, 2, 2, 2, 646, 643, 3, 2, 2, 2, 647, 200, 3, 2, 2, 2, 648, 650, 9, 13, 2, 2, 649, 651, 5, 205, 102, 2, 650, 649, 3, 2, 2, 2, 650, 651, 3, 2, 2, 2, 651, 652, 3, 2, 2, 2, 652, 653, 5, 203, 101, 2, 653, 202, 3, 2, 2, 2, 654, 656, 5, 179, 89, 2, 655, 654, 3, 2, 2, 2, 656, 657, 3, 2, 2, 2, 657, 655, 3, 2, 2, 2, 657, 658, 3, 2, 2, 2, 658, 204, 3, 2, 2, 2, 659, 660, 9, 14, 2, 2, 660, 206, 3, 2, 2, 2, 661, 663, 5, 209, 104, 2, 662, 661, 3, 2, 2, 2, 663, 664, 3, 2, 2, 2, 664, 662, 3, 2, 2, 2, 664, 665, 3, 2, 2, 2, 665, 208, 3, 2, 2, 2, 666, 669, 10, 15, 2, 2, 667, 669, 5, 211, 105, 2, 668, 666, 3, 2, 2, 2, 668, 667, 3, 2, 2, 2, 669, 210, 3, 2, 2, 2, 670, 674, 5, 213, 106, 2, 671, 674, 5, 215, 107, 2, 672, 674, 5, 217, 108, 2, 673, 670, 3, 2, 2, 2, 673, 671, 3, 2, 2, 2, 673, 672, 3, 2, 2, 2, 674, 212, 3, 2, 2, 2, 675, 676, 7, 94, 2, 2, 676, 677, 9, 16, 2, 2, 677, 214, 3, 2, 2, 2, 678, 679, 7, 94, 2, 2, 679, 681, 5, 193, 96, 2, 680, 682, 5, 193, 96, 2, 681, 680, 3, 2, 2, 2, 681, 682, 3, 2, 2, 2, 682, 684, 3, 2, 2, 2, 683, 685, 5, 193, 96, 2, 684, 683, 3, 2, 2, 2, 684, 685, 3, 2, 2, 2, 685, 216, 3, 2, 2, 2, 686, 687, 7, 94, 2, 2, 687, 688, 7, 122, 2, 2, 688, 690, 3, 2, 2, 2, 689, 691, 5, 195, 97, 2, 690, 689, 3, 2, 2, 2, 691, 692, 3, 2, 2, 2, 692, 690, 3, 2, 2, 2, 692, 693, 3, 2, 2, 2, 693, 218, 3, 2, 2, 2, 694, 696, 5, 221, 110, 2, 695, 694, 3, 2, 2, 2, 696, 697, 3, 2, 2, 2, 697, 695, 3, 2, 2, 2, 697, 698, 3, 2, 2, 2, 698, 220, 3, 2, 2, 2, 699, 702, 10, 17, 2, 2, 700, 702, 5, 211, 105, 2, 701, 699, 3, 2, 2, 2, 701, 700, 3, 2, 2, 2, 702, 222, 3, 2, 2, 2, 703, 705, 5, 225, 112, 2, 704, 703, 3, 2, 2, 2, 705, 706, 3, 2, 2, 2, 706, 704, 3, 2, 2, 2, 706, 707, 3, 2, 2, 2, 707, 224, 3, 2, 2, 2, 708, 711, 10, 18, 2, 2, 709, 711, 5, 211, 105, 2, 710, 708, 3, 2, 2, 2, 710, 709, 3, 2, 2, 2, 711, 226, 3, 2, 2, 2, 712, 714, 5, 229, 114, 2, 713, 712, 3, 2, 2, 2, 714, 715, 3, 2, 2, 2, 715, 713, 3, 2, 2, 2, 715, 716, 3, 2, 2, 2, 716, 228, 3, 2, 2, 2, 717, 720, 10, 15, 2, 2, 718, 720, 5, 211, 105, 2, 719, 717, 3, 2, 2, 2, 719, 718, 3, 2, 2, 2, 720, 230, 3, 2, 2, 2, 721, 723, 5, 233, 116, 2, 722, 721, 3, 2, 2, 2, 723, 724, 3, 2, 2, 2, 724, 722, 3, 2, 2, 2, 724, 725, 3, 2, 2, 2, 725, 232, 3, 2, 2, 2, 726, 729, 10, 19, 2, 2, 727, 729, 5, 211, 105, 2, 728, 726, 3, 2, 2, 2, 728, 727, 3, 2, 2, 2, 729, 234, 3, 2, 2, 2, 730, 732, 10, 3, 2, 2, 731, 730, 3, 2, 2, 2, 732, 735, 3, 2, 2, 2, 733, 731, 3, 2, 2, 2, 733, 734, 3, 2, 2, 2, 734, 236, 3, 2, 2, 2, 735, 733, 3, 2, 2, 2, 37, 2, 3, 4, 243, 513, 515, 522, 526, 532, 541, 598, 605, 612, 619, 631, 636, 639, 646, 650, 657, 664, 668, 673, 681, 684, 692, 697, 701, 706, 710, 715, 719, 724, 728, 733, 14, 2, 4, 2, 2, 5, 2, 6, 2, 2, 2, 3, 2, 3, 79, 2, 7, 3, 2, 3, 80, 3, 7, 4, 2, 9, 3, 2, 7, 2, 2, 3, 82, 4, 3, 85, 5] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 88, 756, 8, 1, 8, 1, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, 9, 101, 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 4, 105, 9, 105, 4, 106, 9, 106, 4, 107, 9, 107, 4, 108, 9, 108, 4, 109, 9, 109, 4, 110, 9, 110, 4, 111, 9, 111, 4, 112, 9, 112, 4, 113, 9, 113, 4, 114, 9, 114, 4, 115, 9, 115, 4, 116, 9, 116, 4, 117, 9, 117, 4, 118, 9, 118, 4, 119, 9, 119, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 246, 10, 2, 12, 2, 14, 2, 249, 11, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 3, 42, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, 47, 3, 47, 3, 48, 3, 48, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 64, 3, 64, 3, 65, 3, 65, 3, 65, 3, 66, 3, 66, 3, 67, 3, 67, 3, 68, 3, 68, 3, 69, 3, 69, 3, 70, 3, 70, 3, 70, 3, 71, 3, 71, 3, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 73, 3, 73, 3, 74, 3, 74, 3, 74, 7, 74, 534, 10, 74, 12, 74, 14, 74, 537, 11, 74, 3, 75, 3, 75, 3, 75, 3, 75, 5, 75, 543, 10, 75, 3, 76, 3, 76, 5, 76, 547, 10, 76, 3, 76, 3, 76, 3, 77, 3, 77, 5, 77, 553, 10, 77, 3, 77, 3, 77, 3, 78, 3, 78, 3, 79, 6, 79, 560, 10, 79, 13, 79, 14, 79, 561, 3, 79, 3, 79, 3, 80, 3, 80, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 3, 83, 3, 83, 3, 83, 3, 84, 3, 84, 3, 84, 3, 84, 3, 84, 3, 85, 3, 85, 3, 86, 3, 86, 3, 86, 3, 86, 3, 86, 3, 86, 3, 87, 3, 87, 3, 87, 3, 87, 3, 87, 3, 88, 3, 88, 3, 89, 3, 89, 3, 90, 3, 90, 3, 91, 3, 91, 3, 92, 6, 92, 617, 10, 92, 13, 92, 14, 92, 618, 3, 93, 3, 93, 3, 93, 6, 93, 624, 10, 93, 13, 93, 14, 93, 625, 3, 94, 3, 94, 3, 94, 6, 94, 631, 10, 94, 13, 94, 14, 94, 632, 3, 95, 3, 95, 3, 95, 6, 95, 638, 10, 95, 13, 95, 14, 95, 639, 3, 96, 3, 96, 3, 97, 3, 97, 3, 98, 3, 98, 3, 99, 3, 99, 3, 100, 3, 100, 5, 100, 652, 10, 100, 3, 100, 3, 100, 3, 100, 5, 100, 657, 10, 100, 3, 101, 5, 101, 660, 10, 101, 3, 101, 3, 101, 3, 101, 3, 101, 3, 101, 5, 101, 667, 10, 101, 3, 102, 3, 102, 5, 102, 671, 10, 102, 3, 102, 3, 102, 3, 103, 6, 103, 676, 10, 103, 13, 103, 14, 103, 677, 3, 104, 3, 104, 3, 105, 6, 105, 683, 10, 105, 13, 105, 14, 105, 684, 3, 106, 3, 106, 5, 106, 689, 10, 106, 3, 107, 3, 107, 3, 107, 5, 107, 694, 10, 107, 3, 108, 3, 108, 3, 108, 3, 109, 3, 109, 3, 109, 5, 109, 702, 10, 109, 3, 109, 5, 109, 705, 10, 109, 3, 110, 3, 110, 3, 110, 3, 110, 6, 110, 711, 10, 110, 13, 110, 14, 110, 712, 3, 111, 6, 111, 716, 10, 111, 13, 111, 14, 111, 717, 3, 112, 3, 112, 5, 112, 722, 10, 112, 3, 113, 6, 113, 725, 10, 113, 13, 113, 14, 113, 726, 3, 114, 3, 114, 5, 114, 731, 10, 114, 3, 115, 6, 115, 734, 10, 115, 13, 115, 14, 115, 735, 3, 116, 3, 116, 5, 116, 740, 10, 116, 3, 117, 6, 117, 743, 10, 117, 13, 117, 14, 117, 744, 3, 118, 3, 118, 5, 118, 749, 10, 118, 3, 119, 7, 119, 752, 10, 119, 12, 119, 14, 119, 755, 11, 119, 3, 247, 2, 2, 120, 5, 2, 4, 7, 2, 5, 9, 2, 6, 11, 2, 7, 13, 2, 8, 15, 2, 9, 17, 2, 10, 19, 2, 11, 21, 2, 12, 23, 2, 13, 25, 2, 14, 27, 2, 15, 29, 2, 16, 31, 2, 17, 33, 2, 18, 35, 2, 19, 37, 2, 20, 39, 2, 21, 41, 2, 22, 43, 2, 23, 45, 2, 24, 47, 2, 25, 49, 2, 26, 51, 2, 27, 53, 2, 28, 55, 2, 29, 57, 2, 30, 59, 2, 31, 61, 2, 32, 63, 2, 33, 65, 2, 34, 67, 2, 35, 69, 2, 36, 71, 2, 37, 73, 2, 38, 75, 2, 39, 77, 2, 40, 79, 2, 41, 81, 2, 42, 83, 2, 43, 85, 2, 44, 87, 2, 45, 89, 2, 46, 91, 2, 47, 93, 2, 48, 95, 2, 49, 97, 2, 50, 99, 2, 51, 101, 2, 52, 103, 2, 53, 105, 2, 54, 107, 2, 55, 109, 2, 56, 111, 2, 57, 113, 2, 58, 115, 2, 59, 117, 2, 60, 119, 2, 61, 121, 2, 62, 123, 2, 63, 125, 2, 64, 127, 2, 65, 129, 2, 66, 131, 2, 67, 133, 2, 68, 135, 2, 69, 137, 2, 70, 139, 2, 71, 141, 2, 72, 143, 2, 73, 145, 2, 74, 147, 2, 75, 149, 2, 76, 151, 2, 77, 153, 2, 78, 155, 2, 79, 157, 2, 80, 159, 2, 81, 161, 2, 82, 163, 2, 83, 165, 2, 84, 167, 2, 2, 169, 2, 85, 171, 2, 86, 173, 2, 2, 175, 2, 87, 177, 2, 88, 179, 2, 2, 181, 2, 2, 183, 2, 2, 185, 2, 2, 187, 2, 2, 189, 2, 2, 191, 2, 2, 193, 2, 2, 195, 2, 2, 197, 2, 2, 199, 2, 2, 201, 2, 2, 203, 2, 2, 205, 2, 2, 207, 2, 2, 209, 2, 2, 211, 2, 2, 213, 2, 2, 215, 2, 2, 217, 2, 2, 219, 2, 2, 221, 2, 2, 223, 2, 2, 225, 2, 2, 227, 2, 2, 229, 2, 2, 231, 2, 2, 233, 2, 2, 235, 2, 2, 237, 2, 2, 239, 2, 2, 5, 2, 3, 4, 20, 6, 2, 11, 11, 13, 14, 34, 34, 162, 162, 5, 2, 12, 12, 15, 15, 8234, 8235, 5, 2, 67, 92, 97, 97, 99, 124, 3, 2, 50, 59, 4, 2, 68, 68, 100, 100, 4, 2, 81, 81, 113, 113, 4, 2, 90, 90, 122, 122, 3, 2, 51, 59, 3, 2, 50, 51, 3, 2, 50, 57, 5, 2, 50, 59, 67, 72, 99, 104, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, 6, 2, 12, 12, 15, 15, 41, 41, 94, 94, 14, 2, 36, 36, 41, 41, 65, 65, 94, 94, 99, 100, 104, 104, 112, 112, 116, 116, 118, 118, 120, 120, 125, 125, 127, 127, 8, 2, 12, 12, 15, 15, 41, 41, 94, 94, 125, 125, 127, 127, 8, 2, 12, 12, 15, 15, 36, 36, 94, 94, 125, 125, 127, 127, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94, 2, 757, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, 2, 109, 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, 2, 2, 2, 2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 2, 123, 3, 2, 2, 2, 2, 125, 3, 2, 2, 2, 2, 127, 3, 2, 2, 2, 2, 129, 3, 2, 2, 2, 2, 131, 3, 2, 2, 2, 2, 133, 3, 2, 2, 2, 2, 135, 3, 2, 2, 2, 2, 137, 3, 2, 2, 2, 2, 139, 3, 2, 2, 2, 2, 141, 3, 2, 2, 2, 2, 143, 3, 2, 2, 2, 2, 145, 3, 2, 2, 2, 2, 147, 3, 2, 2, 2, 2, 149, 3, 2, 2, 2, 2, 151, 3, 2, 2, 2, 2, 153, 3, 2, 2, 2, 2, 155, 3, 2, 2, 2, 2, 157, 3, 2, 2, 2, 2, 159, 3, 2, 2, 2, 2, 161, 3, 2, 2, 2, 2, 163, 3, 2, 2, 2, 2, 165, 3, 2, 2, 2, 3, 167, 3, 2, 2, 2, 3, 169, 3, 2, 2, 2, 3, 171, 3, 2, 2, 2, 4, 173, 3, 2, 2, 2, 4, 175, 3, 2, 2, 2, 4, 177, 3, 2, 2, 2, 5, 241, 3, 2, 2, 2, 7, 255, 3, 2, 2, 2, 9, 262, 3, 2, 2, 2, 11, 274, 3, 2, 2, 2, 13, 280, 3, 2, 2, 2, 15, 284, 3, 2, 2, 2, 17, 287, 3, 2, 2, 2, 19, 291, 3, 2, 2, 2, 21, 298, 3, 2, 2, 2, 23, 303, 3, 2, 2, 2, 25, 311, 3, 2, 2, 2, 27, 317, 3, 2, 2, 2, 29, 326, 3, 2, 2, 2, 31, 329, 3, 2, 2, 2, 33, 335, 3, 2, 2, 2, 35, 338, 3, 2, 2, 2, 37, 343, 3, 2, 2, 2, 39, 347, 3, 2, 2, 2, 41, 352, 3, 2, 2, 2, 43, 356, 3, 2, 2, 2, 45, 363, 3, 2, 2, 2, 47, 368, 3, 2, 2, 2, 49, 371, 3, 2, 2, 2, 51, 377, 3, 2, 2, 2, 53, 387, 3, 2, 2, 2, 55, 392, 3, 2, 2, 2, 57, 398, 3, 2, 2, 2, 59, 405, 3, 2, 2, 2, 61, 410, 3, 2, 2, 2, 63, 415, 3, 2, 2, 2, 65, 425, 3, 2, 2, 2, 67, 427, 3, 2, 2, 2, 69, 429, 3, 2, 2, 2, 71, 431, 3, 2, 2, 2, 73, 433, 3, 2, 2, 2, 75, 435, 3, 2, 2, 2, 77, 437, 3, 2, 2, 2, 79, 439, 3, 2, 2, 2, 81, 441, 3, 2, 2, 2, 83, 446, 3, 2, 2, 2, 85, 448, 3, 2, 2, 2, 87, 450, 3, 2, 2, 2, 89, 452, 3, 2, 2, 2, 91, 455, 3, 2, 2, 2, 93, 457, 3, 2, 2, 2, 95, 460, 3, 2, 2, 2, 97, 462, 3, 2, 2, 2, 99, 464, 3, 2, 2, 2, 101, 466, 3, 2, 2, 2, 103, 469, 3, 2, 2, 2, 105, 472, 3, 2, 2, 2, 107, 475, 3, 2, 2, 2, 109, 477, 3, 2, 2, 2, 111, 479, 3, 2, 2, 2, 113, 482, 3, 2, 2, 2, 115, 485, 3, 2, 2, 2, 117, 488, 3, 2, 2, 2, 119, 491, 3, 2, 2, 2, 121, 494, 3, 2, 2, 2, 123, 497, 3, 2, 2, 2, 125, 500, 3, 2, 2, 2, 127, 502, 3, 2, 2, 2, 129, 505, 3, 2, 2, 2, 131, 507, 3, 2, 2, 2, 133, 510, 3, 2, 2, 2, 135, 512, 3, 2, 2, 2, 137, 514, 3, 2, 2, 2, 139, 516, 3, 2, 2, 2, 141, 518, 3, 2, 2, 2, 143, 521, 3, 2, 2, 2, 145, 524, 3, 2, 2, 2, 147, 528, 3, 2, 2, 2, 149, 530, 3, 2, 2, 2, 151, 542, 3, 2, 2, 2, 153, 544, 3, 2, 2, 2, 155, 550, 3, 2, 2, 2, 157, 556, 3, 2, 2, 2, 159, 559, 3, 2, 2, 2, 161, 565, 3, 2, 2, 2, 163, 569, 3, 2, 2, 2, 165, 576, 3, 2, 2, 2, 167, 583, 3, 2, 2, 2, 169, 589, 3, 2, 2, 2, 171, 594, 3, 2, 2, 2, 173, 596, 3, 2, 2, 2, 175, 602, 3, 2, 2, 2, 177, 607, 3, 2, 2, 2, 179, 609, 3, 2, 2, 2, 181, 611, 3, 2, 2, 2, 183, 613, 3, 2, 2, 2, 185, 616, 3, 2, 2, 2, 187, 620, 3, 2, 2, 2, 189, 627, 3, 2, 2, 2, 191, 634, 3, 2, 2, 2, 193, 641, 3, 2, 2, 2, 195, 643, 3, 2, 2, 2, 197, 645, 3, 2, 2, 2, 199, 647, 3, 2, 2, 2, 201, 656, 3, 2, 2, 2, 203, 666, 3, 2, 2, 2, 205, 668, 3, 2, 2, 2, 207, 675, 3, 2, 2, 2, 209, 679, 3, 2, 2, 2, 211, 682, 3, 2, 2, 2, 213, 688, 3, 2, 2, 2, 215, 693, 3, 2, 2, 2, 217, 695, 3, 2, 2, 2, 219, 698, 3, 2, 2, 2, 221, 706, 3, 2, 2, 2, 223, 715, 3, 2, 2, 2, 225, 721, 3, 2, 2, 2, 227, 724, 3, 2, 2, 2, 229, 730, 3, 2, 2, 2, 231, 733, 3, 2, 2, 2, 233, 739, 3, 2, 2, 2, 235, 742, 3, 2, 2, 2, 237, 748, 3, 2, 2, 2, 239, 753, 3, 2, 2, 2, 241, 242, 7, 49, 2, 2, 242, 243, 7, 44, 2, 2, 243, 247, 3, 2, 2, 2, 244, 246, 11, 2, 2, 2, 245, 244, 3, 2, 2, 2, 246, 249, 3, 2, 2, 2, 247, 248, 3, 2, 2, 2, 247, 245, 3, 2, 2, 2, 248, 250, 3, 2, 2, 2, 249, 247, 3, 2, 2, 2, 250, 251, 7, 44, 2, 2, 251, 252, 7, 49, 2, 2, 252, 253, 3, 2, 2, 2, 253, 254, 8, 2, 2, 2, 254, 6, 3, 2, 2, 2, 255, 256, 7, 49, 2, 2, 256, 257, 7, 49, 2, 2, 257, 258, 3, 2, 2, 2, 258, 259, 5, 239, 119, 2, 259, 260, 3, 2, 2, 2, 260, 261, 8, 3, 2, 2, 261, 8, 3, 2, 2, 2, 262, 263, 7, 37, 2, 2, 263, 264, 7, 114, 2, 2, 264, 265, 7, 116, 2, 2, 265, 266, 7, 99, 2, 2, 266, 267, 7, 105, 2, 2, 267, 268, 7, 111, 2, 2, 268, 269, 7, 99, 2, 2, 269, 270, 3, 2, 2, 2, 270, 271, 5, 239, 119, 2, 271, 272, 3, 2, 2, 2, 272, 273, 8, 4, 3, 2, 273, 10, 3, 2, 2, 2, 274, 275, 7, 101, 2, 2, 275, 276, 7, 113, 2, 2, 276, 277, 7, 112, 2, 2, 277, 278, 7, 117, 2, 2, 278, 279, 7, 118, 2, 2, 279, 12, 3, 2, 2, 2, 280, 281, 7, 120, 2, 2, 281, 282, 7, 99, 2, 2, 282, 283, 7, 116, 2, 2, 283, 14, 3, 2, 2, 2, 284, 285, 7, 99, 2, 2, 285, 286, 7, 117, 2, 2, 286, 16, 3, 2, 2, 2, 287, 288, 7, 48, 2, 2, 288, 289, 7, 48, 2, 2, 289, 290, 7, 48, 2, 2, 290, 18, 3, 2, 2, 2, 291, 292, 7, 117, 2, 2, 292, 293, 7, 121, 2, 2, 293, 294, 7, 107, 2, 2, 294, 295, 7, 118, 2, 2, 295, 296, 7, 101, 2, 2, 296, 297, 7, 106, 2, 2, 297, 20, 3, 2, 2, 2, 298, 299, 7, 101, 2, 2, 299, 300, 7, 99, 2, 2, 300, 301, 7, 117, 2, 2, 301, 302, 7, 103, 2, 2, 302, 22, 3, 2, 2, 2, 303, 304, 7, 102, 2, 2, 304, 305, 7, 103, 2, 2, 305, 306, 7, 104, 2, 2, 306, 307, 7, 99, 2, 2, 307, 308, 7, 119, 2, 2, 308, 309, 7, 110, 2, 2, 309, 310, 7, 118, 2, 2, 310, 24, 3, 2, 2, 2, 311, 312, 7, 100, 2, 2, 312, 313, 7, 116, 2, 2, 313, 314, 7, 103, 2, 2, 314, 315, 7, 99, 2, 2, 315, 316, 7, 109, 2, 2, 316, 26, 3, 2, 2, 2, 317, 318, 7, 101, 2, 2, 318, 319, 7, 113, 2, 2, 319, 320, 7, 112, 2, 2, 320, 321, 7, 118, 2, 2, 321, 322, 7, 107, 2, 2, 322, 323, 7, 112, 2, 2, 323, 324, 7, 119, 2, 2, 324, 325, 7, 103, 2, 2, 325, 28, 3, 2, 2, 2, 326, 327, 7, 102, 2, 2, 327, 328, 7, 113, 2, 2, 328, 30, 3, 2, 2, 2, 329, 330, 7, 121, 2, 2, 330, 331, 7, 106, 2, 2, 331, 332, 7, 107, 2, 2, 332, 333, 7, 110, 2, 2, 333, 334, 7, 103, 2, 2, 334, 32, 3, 2, 2, 2, 335, 336, 7, 107, 2, 2, 336, 337, 7, 104, 2, 2, 337, 34, 3, 2, 2, 2, 338, 339, 7, 103, 2, 2, 339, 340, 7, 110, 2, 2, 340, 341, 7, 117, 2, 2, 341, 342, 7, 103, 2, 2, 342, 36, 3, 2, 2, 2, 343, 344, 7, 104, 2, 2, 344, 345, 7, 113, 2, 2, 345, 346, 7, 116, 2, 2, 346, 38, 3, 2, 2, 2, 347, 348, 7, 103, 2, 2, 348, 349, 7, 112, 2, 2, 349, 350, 7, 119, 2, 2, 350, 351, 7, 111, 2, 2, 351, 40, 3, 2, 2, 2, 352, 353, 7, 102, 2, 2, 353, 354, 7, 103, 2, 2, 354, 355, 7, 104, 2, 2, 355, 42, 3, 2, 2, 2, 356, 357, 7, 116, 2, 2, 357, 358, 7, 103, 2, 2, 358, 359, 7, 118, 2, 2, 359, 360, 7, 119, 2, 2, 360, 361, 7, 116, 2, 2, 361, 362, 7, 112, 2, 2, 362, 44, 3, 2, 2, 2, 363, 364, 7, 101, 2, 2, 364, 365, 7, 99, 2, 2, 365, 366, 7, 110, 2, 2, 366, 367, 7, 110, 2, 2, 367, 46, 3, 2, 2, 2, 368, 369, 7, 47, 2, 2, 369, 370, 7, 64, 2, 2, 370, 48, 3, 2, 2, 2, 371, 372, 7, 101, 2, 2, 372, 373, 7, 110, 2, 2, 373, 374, 7, 99, 2, 2, 374, 375, 7, 117, 2, 2, 375, 376, 7, 117, 2, 2, 376, 50, 3, 2, 2, 2, 377, 378, 7, 107, 2, 2, 378, 379, 7, 112, 2, 2, 379, 380, 7, 118, 2, 2, 380, 381, 7, 103, 2, 2, 381, 382, 7, 116, 2, 2, 382, 383, 7, 104, 2, 2, 383, 384, 7, 99, 2, 2, 384, 385, 7, 101, 2, 2, 385, 386, 7, 103, 2, 2, 386, 52, 3, 2, 2, 2, 387, 388, 7, 118, 2, 2, 388, 389, 7, 116, 2, 2, 389, 390, 7, 119, 2, 2, 390, 391, 7, 103, 2, 2, 391, 54, 3, 2, 2, 2, 392, 393, 7, 104, 2, 2, 393, 394, 7, 99, 2, 2, 394, 395, 7, 110, 2, 2, 395, 396, 7, 117, 2, 2, 396, 397, 7, 103, 2, 2, 397, 56, 3, 2, 2, 2, 398, 399, 7, 118, 2, 2, 399, 400, 7, 123, 2, 2, 400, 401, 7, 114, 2, 2, 401, 402, 7, 103, 2, 2, 402, 403, 7, 113, 2, 2, 403, 404, 7, 104, 2, 2, 404, 58, 3, 2, 2, 2, 405, 406, 7, 120, 2, 2, 406, 407, 7, 113, 2, 2, 407, 408, 7, 107, 2, 2, 408, 409, 7, 102, 2, 2, 409, 60, 3, 2, 2, 2, 410, 411, 7, 112, 2, 2, 411, 412, 7, 119, 2, 2, 412, 413, 7, 110, 2, 2, 413, 414, 7, 110, 2, 2, 414, 62, 3, 2, 2, 2, 415, 416, 7, 119, 2, 2, 416, 417, 7, 112, 2, 2, 417, 418, 7, 102, 2, 2, 418, 419, 7, 103, 2, 2, 419, 420, 7, 104, 2, 2, 420, 421, 7, 107, 2, 2, 421, 422, 7, 112, 2, 2, 422, 423, 7, 103, 2, 2, 423, 424, 7, 102, 2, 2, 424, 64, 3, 2, 2, 2, 425, 426, 7, 46, 2, 2, 426, 66, 3, 2, 2, 2, 427, 428, 7, 61, 2, 2, 428, 68, 3, 2, 2, 2, 429, 430, 7, 65, 2, 2, 430, 70, 3, 2, 2, 2, 431, 432, 7, 60, 2, 2, 432, 72, 3, 2, 2, 2, 433, 434, 7, 42, 2, 2, 434, 74, 3, 2, 2, 2, 435, 436, 7, 43, 2, 2, 436, 76, 3, 2, 2, 2, 437, 438, 7, 93, 2, 2, 438, 78, 3, 2, 2, 2, 439, 440, 7, 95, 2, 2, 440, 80, 3, 2, 2, 2, 441, 442, 6, 40, 2, 2, 442, 443, 7, 127, 2, 2, 443, 444, 3, 2, 2, 2, 444, 445, 8, 40, 4, 2, 445, 82, 3, 2, 2, 2, 446, 447, 7, 125, 2, 2, 447, 84, 3, 2, 2, 2, 448, 449, 7, 127, 2, 2, 449, 86, 3, 2, 2, 2, 450, 451, 7, 45, 2, 2, 451, 88, 3, 2, 2, 2, 452, 453, 7, 45, 2, 2, 453, 454, 7, 45, 2, 2, 454, 90, 3, 2, 2, 2, 455, 456, 7, 47, 2, 2, 456, 92, 3, 2, 2, 2, 457, 458, 7, 47, 2, 2, 458, 459, 7, 47, 2, 2, 459, 94, 3, 2, 2, 2, 460, 461, 7, 44, 2, 2, 461, 96, 3, 2, 2, 2, 462, 463, 7, 49, 2, 2, 463, 98, 3, 2, 2, 2, 464, 465, 7, 39, 2, 2, 465, 100, 3, 2, 2, 2, 466, 467, 7, 44, 2, 2, 467, 468, 7, 44, 2, 2, 468, 102, 3, 2, 2, 2, 469, 470, 7, 40, 2, 2, 470, 471, 7, 40, 2, 2, 471, 104, 3, 2, 2, 2, 472, 473, 7, 126, 2, 2, 473, 474, 7, 126, 2, 2, 474, 106, 3, 2, 2, 2, 475, 476, 7, 35, 2, 2, 476, 108, 3, 2, 2, 2, 477, 478, 7, 63, 2, 2, 478, 110, 3, 2, 2, 2, 479, 480, 7, 45, 2, 2, 480, 481, 7, 63, 2, 2, 481, 112, 3, 2, 2, 2, 482, 483, 7, 47, 2, 2, 483, 484, 7, 63, 2, 2, 484, 114, 3, 2, 2, 2, 485, 486, 7, 44, 2, 2, 486, 487, 7, 63, 2, 2, 487, 116, 3, 2, 2, 2, 488, 489, 7, 49, 2, 2, 489, 490, 7, 63, 2, 2, 490, 118, 3, 2, 2, 2, 491, 492, 7, 39, 2, 2, 492, 493, 7, 63, 2, 2, 493, 120, 3, 2, 2, 2, 494, 495, 7, 63, 2, 2, 495, 496, 7, 63, 2, 2, 496, 122, 3, 2, 2, 2, 497, 498, 7, 35, 2, 2, 498, 499, 7, 63, 2, 2, 499, 124, 3, 2, 2, 2, 500, 501, 7, 62, 2, 2, 501, 126, 3, 2, 2, 2, 502, 503, 7, 62, 2, 2, 503, 504, 7, 63, 2, 2, 504, 128, 3, 2, 2, 2, 505, 506, 7, 64, 2, 2, 506, 130, 3, 2, 2, 2, 507, 508, 7, 64, 2, 2, 508, 509, 7, 63, 2, 2, 509, 132, 3, 2, 2, 2, 510, 511, 7, 40, 2, 2, 511, 134, 3, 2, 2, 2, 512, 513, 7, 126, 2, 2, 513, 136, 3, 2, 2, 2, 514, 515, 7, 96, 2, 2, 515, 138, 3, 2, 2, 2, 516, 517, 7, 128, 2, 2, 517, 140, 3, 2, 2, 2, 518, 519, 7, 62, 2, 2, 519, 520, 7, 62, 2, 2, 520, 142, 3, 2, 2, 2, 521, 522, 7, 64, 2, 2, 522, 523, 7, 64, 2, 2, 523, 144, 3, 2, 2, 2, 524, 525, 7, 64, 2, 2, 525, 526, 7, 64, 2, 2, 526, 527, 7, 64, 2, 2, 527, 146, 3, 2, 2, 2, 528, 529, 7, 48, 2, 2, 529, 148, 3, 2, 2, 2, 530, 535, 5, 179, 89, 2, 531, 534, 5, 179, 89, 2, 532, 534, 5, 183, 91, 2, 533, 531, 3, 2, 2, 2, 533, 532, 3, 2, 2, 2, 534, 537, 3, 2, 2, 2, 535, 533, 3, 2, 2, 2, 535, 536, 3, 2, 2, 2, 536, 150, 3, 2, 2, 2, 537, 535, 3, 2, 2, 2, 538, 543, 5, 185, 92, 2, 539, 543, 5, 189, 94, 2, 540, 543, 5, 191, 95, 2, 541, 543, 5, 187, 93, 2, 542, 538, 3, 2, 2, 2, 542, 539, 3, 2, 2, 2, 542, 540, 3, 2, 2, 2, 542, 541, 3, 2, 2, 2, 543, 152, 3, 2, 2, 2, 544, 546, 7, 41, 2, 2, 545, 547, 5, 231, 115, 2, 546, 545, 3, 2, 2, 2, 546, 547, 3, 2, 2, 2, 547, 548, 3, 2, 2, 2, 548, 549, 7, 41, 2, 2, 549, 154, 3, 2, 2, 2, 550, 552, 7, 36, 2, 2, 551, 553, 5, 235, 117, 2, 552, 551, 3, 2, 2, 2, 552, 553, 3, 2, 2, 2, 553, 554, 3, 2, 2, 2, 554, 555, 7, 36, 2, 2, 555, 156, 3, 2, 2, 2, 556, 557, 5, 201, 100, 2, 557, 158, 3, 2, 2, 2, 558, 560, 9, 2, 2, 2, 559, 558, 3, 2, 2, 2, 560, 561, 3, 2, 2, 2, 561, 559, 3, 2, 2, 2, 561, 562, 3, 2, 2, 2, 562, 563, 3, 2, 2, 2, 563, 564, 8, 79, 5, 2, 564, 160, 3, 2, 2, 2, 565, 566, 9, 3, 2, 2, 566, 567, 3, 2, 2, 2, 567, 568, 8, 80, 5, 2, 568, 162, 3, 2, 2, 2, 569, 570, 7, 104, 2, 2, 570, 571, 7, 41, 2, 2, 571, 572, 3, 2, 2, 2, 572, 573, 8, 81, 6, 2, 573, 574, 3, 2, 2, 2, 574, 575, 8, 81, 7, 2, 575, 164, 3, 2, 2, 2, 576, 577, 7, 104, 2, 2, 577, 578, 7, 36, 2, 2, 578, 579, 3, 2, 2, 2, 579, 580, 8, 82, 8, 2, 580, 581, 3, 2, 2, 2, 581, 582, 8, 82, 9, 2, 582, 166, 3, 2, 2, 2, 583, 584, 6, 83, 3, 2, 584, 585, 7, 125, 2, 2, 585, 586, 3, 2, 2, 2, 586, 587, 8, 83, 10, 2, 587, 588, 8, 83, 11, 2, 588, 168, 3, 2, 2, 2, 589, 590, 7, 41, 2, 2, 590, 591, 8, 84, 12, 2, 591, 592, 3, 2, 2, 2, 592, 593, 8, 84, 4, 2, 593, 170, 3, 2, 2, 2, 594, 595, 5, 223, 111, 2, 595, 172, 3, 2, 2, 2, 596, 597, 6, 86, 4, 2, 597, 598, 7, 125, 2, 2, 598, 599, 3, 2, 2, 2, 599, 600, 8, 86, 10, 2, 600, 601, 8, 86, 11, 2, 601, 174, 3, 2, 2, 2, 602, 603, 7, 36, 2, 2, 603, 604, 8, 87, 13, 2, 604, 605, 3, 2, 2, 2, 605, 606, 8, 87, 4, 2, 606, 176, 3, 2, 2, 2, 607, 608, 5, 227, 113, 2, 608, 178, 3, 2, 2, 2, 609, 610, 5, 181, 90, 2, 610, 180, 3, 2, 2, 2, 611, 612, 9, 4, 2, 2, 612, 182, 3, 2, 2, 2, 613, 614, 9, 5, 2, 2, 614, 184, 3, 2, 2, 2, 615, 617, 5, 183, 91, 2, 616, 615, 3, 2, 2, 2, 617, 618, 3, 2, 2, 2, 618, 616, 3, 2, 2, 2, 618, 619, 3, 2, 2, 2, 619, 186, 3, 2, 2, 2, 620, 621, 7, 50, 2, 2, 621, 623, 9, 6, 2, 2, 622, 624, 5, 195, 97, 2, 623, 622, 3, 2, 2, 2, 624, 625, 3, 2, 2, 2, 625, 623, 3, 2, 2, 2, 625, 626, 3, 2, 2, 2, 626, 188, 3, 2, 2, 2, 627, 628, 7, 50, 2, 2, 628, 630, 9, 7, 2, 2, 629, 631, 5, 197, 98, 2, 630, 629, 3, 2, 2, 2, 631, 632, 3, 2, 2, 2, 632, 630, 3, 2, 2, 2, 632, 633, 3, 2, 2, 2, 633, 190, 3, 2, 2, 2, 634, 635, 7, 50, 2, 2, 635, 637, 9, 8, 2, 2, 636, 638, 5, 199, 99, 2, 637, 636, 3, 2, 2, 2, 638, 639, 3, 2, 2, 2, 639, 637, 3, 2, 2, 2, 639, 640, 3, 2, 2, 2, 640, 192, 3, 2, 2, 2, 641, 642, 9, 9, 2, 2, 642, 194, 3, 2, 2, 2, 643, 644, 9, 10, 2, 2, 644, 196, 3, 2, 2, 2, 645, 646, 9, 11, 2, 2, 646, 198, 3, 2, 2, 2, 647, 648, 9, 12, 2, 2, 648, 200, 3, 2, 2, 2, 649, 651, 5, 203, 101, 2, 650, 652, 5, 205, 102, 2, 651, 650, 3, 2, 2, 2, 651, 652, 3, 2, 2, 2, 652, 657, 3, 2, 2, 2, 653, 654, 5, 207, 103, 2, 654, 655, 5, 205, 102, 2, 655, 657, 3, 2, 2, 2, 656, 649, 3, 2, 2, 2, 656, 653, 3, 2, 2, 2, 657, 202, 3, 2, 2, 2, 658, 660, 5, 207, 103, 2, 659, 658, 3, 2, 2, 2, 659, 660, 3, 2, 2, 2, 660, 661, 3, 2, 2, 2, 661, 662, 7, 48, 2, 2, 662, 667, 5, 207, 103, 2, 663, 664, 5, 207, 103, 2, 664, 665, 7, 48, 2, 2, 665, 667, 3, 2, 2, 2, 666, 659, 3, 2, 2, 2, 666, 663, 3, 2, 2, 2, 667, 204, 3, 2, 2, 2, 668, 670, 9, 13, 2, 2, 669, 671, 5, 209, 104, 2, 670, 669, 3, 2, 2, 2, 670, 671, 3, 2, 2, 2, 671, 672, 3, 2, 2, 2, 672, 673, 5, 207, 103, 2, 673, 206, 3, 2, 2, 2, 674, 676, 5, 183, 91, 2, 675, 674, 3, 2, 2, 2, 676, 677, 3, 2, 2, 2, 677, 675, 3, 2, 2, 2, 677, 678, 3, 2, 2, 2, 678, 208, 3, 2, 2, 2, 679, 680, 9, 14, 2, 2, 680, 210, 3, 2, 2, 2, 681, 683, 5, 213, 106, 2, 682, 681, 3, 2, 2, 2, 683, 684, 3, 2, 2, 2, 684, 682, 3, 2, 2, 2, 684, 685, 3, 2, 2, 2, 685, 212, 3, 2, 2, 2, 686, 689, 10, 15, 2, 2, 687, 689, 5, 215, 107, 2, 688, 686, 3, 2, 2, 2, 688, 687, 3, 2, 2, 2, 689, 214, 3, 2, 2, 2, 690, 694, 5, 217, 108, 2, 691, 694, 5, 219, 109, 2, 692, 694, 5, 221, 110, 2, 693, 690, 3, 2, 2, 2, 693, 691, 3, 2, 2, 2, 693, 692, 3, 2, 2, 2, 694, 216, 3, 2, 2, 2, 695, 696, 7, 94, 2, 2, 696, 697, 9, 16, 2, 2, 697, 218, 3, 2, 2, 2, 698, 699, 7, 94, 2, 2, 699, 701, 5, 197, 98, 2, 700, 702, 5, 197, 98, 2, 701, 700, 3, 2, 2, 2, 701, 702, 3, 2, 2, 2, 702, 704, 3, 2, 2, 2, 703, 705, 5, 197, 98, 2, 704, 703, 3, 2, 2, 2, 704, 705, 3, 2, 2, 2, 705, 220, 3, 2, 2, 2, 706, 707, 7, 94, 2, 2, 707, 708, 7, 122, 2, 2, 708, 710, 3, 2, 2, 2, 709, 711, 5, 199, 99, 2, 710, 709, 3, 2, 2, 2, 711, 712, 3, 2, 2, 2, 712, 710, 3, 2, 2, 2, 712, 713, 3, 2, 2, 2, 713, 222, 3, 2, 2, 2, 714, 716, 5, 225, 112, 2, 715, 714, 3, 2, 2, 2, 716, 717, 3, 2, 2, 2, 717, 715, 3, 2, 2, 2, 717, 718, 3, 2, 2, 2, 718, 224, 3, 2, 2, 2, 719, 722, 10, 17, 2, 2, 720, 722, 5, 215, 107, 2, 721, 719, 3, 2, 2, 2, 721, 720, 3, 2, 2, 2, 722, 226, 3, 2, 2, 2, 723, 725, 5, 229, 114, 2, 724, 723, 3, 2, 2, 2, 725, 726, 3, 2, 2, 2, 726, 724, 3, 2, 2, 2, 726, 727, 3, 2, 2, 2, 727, 228, 3, 2, 2, 2, 728, 731, 10, 18, 2, 2, 729, 731, 5, 215, 107, 2, 730, 728, 3, 2, 2, 2, 730, 729, 3, 2, 2, 2, 731, 230, 3, 2, 2, 2, 732, 734, 5, 233, 116, 2, 733, 732, 3, 2, 2, 2, 734, 735, 3, 2, 2, 2, 735, 733, 3, 2, 2, 2, 735, 736, 3, 2, 2, 2, 736, 232, 3, 2, 2, 2, 737, 740, 10, 15, 2, 2, 738, 740, 5, 215, 107, 2, 739, 737, 3, 2, 2, 2, 739, 738, 3, 2, 2, 2, 740, 234, 3, 2, 2, 2, 741, 743, 5, 237, 118, 2, 742, 741, 3, 2, 2, 2, 743, 744, 3, 2, 2, 2, 744, 742, 3, 2, 2, 2, 744, 745, 3, 2, 2, 2, 745, 236, 3, 2, 2, 2, 746, 749, 10, 19, 2, 2, 747, 749, 5, 215, 107, 2, 748, 746, 3, 2, 2, 2, 748, 747, 3, 2, 2, 2, 749, 238, 3, 2, 2, 2, 750, 752, 10, 3, 2, 2, 751, 750, 3, 2, 2, 2, 752, 755, 3, 2, 2, 2, 753, 751, 3, 2, 2, 2, 753, 754, 3, 2, 2, 2, 754, 240, 3, 2, 2, 2, 755, 753, 3, 2, 2, 2, 37, 2, 3, 4, 247, 533, 535, 542, 546, 552, 561, 618, 625, 632, 639, 651, 656, 659, 666, 670, 677, 684, 688, 693, 701, 704, 712, 717, 721, 726, 730, 735, 739, 744, 748, 753, 14, 2, 4, 2, 2, 5, 2, 6, 2, 2, 2, 3, 2, 3, 81, 2, 7, 3, 2, 3, 82, 3, 7, 4, 2, 9, 3, 2, 7, 2, 2, 3, 84, 4, 3, 87, 5] \ No newline at end of file diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperLexer.tokens b/kipper/core/src/compiler/lexer-parser/antlr/KipperLexer.tokens index 7c4c655e8..a380f4448 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperLexer.tokens +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperLexer.tokens @@ -21,67 +21,69 @@ DefFunc=20 Return=21 CallFunc=22 RetIndicator=23 -True=24 -False=25 -Typeof=26 -Void=27 -Null=28 -Undefined=29 -Comma=30 -SemiColon=31 -QuestionMark=32 -Colon=33 -LeftParen=34 -RightParen=35 -LeftBracket=36 -RightBracket=37 -FStringExpEnd=38 -LeftBrace=39 -RightBrace=40 -Plus=41 -PlusPlus=42 -Minus=43 -MinusMinus=44 -Star=45 -Div=46 -Mod=47 -PowerTo=48 -AndAnd=49 -OrOr=50 -Not=51 -Assign=52 -PlusAssign=53 -MinusAssign=54 -StarAssign=55 -DivAssign=56 -ModAssign=57 -Equal=58 -NotEqual=59 -Less=60 -LessEqual=61 -Greater=62 -GreaterEqual=63 -BitwiseAnd=64 -BitwiseOr=65 -BitwiseXor=66 -BitwiseNot=67 -BitwiseZeroFillLeftShift=68 -BitwiseSignedRightShift=69 -BitwiseZeroFillRightShift=70 -Dot=71 -Identifier=72 -IntegerConstant=73 -SingleQuoteStringLiteral=74 -DoubleQuoteStringLiteral=75 -FloatingConstant=76 -Whitespace=77 -Newline=78 -FStringSingleQuoteStart=79 -FStringDoubleQuoteStart=80 -FStringSingleQuoteEnd=81 -FStringSingleQuoteAtom=82 -FStringDoubleQuoteEnd=83 -FStringDoubleQuoteAtom=84 +Class=24 +Interface=25 +True=26 +False=27 +Typeof=28 +Void=29 +Null=30 +Undefined=31 +Comma=32 +SemiColon=33 +QuestionMark=34 +Colon=35 +LeftParen=36 +RightParen=37 +LeftBracket=38 +RightBracket=39 +FStringExpEnd=40 +LeftBrace=41 +RightBrace=42 +Plus=43 +PlusPlus=44 +Minus=45 +MinusMinus=46 +Star=47 +Div=48 +Mod=49 +PowerTo=50 +AndAnd=51 +OrOr=52 +Not=53 +Assign=54 +PlusAssign=55 +MinusAssign=56 +StarAssign=57 +DivAssign=58 +ModAssign=59 +Equal=60 +NotEqual=61 +Less=62 +LessEqual=63 +Greater=64 +GreaterEqual=65 +BitwiseAnd=66 +BitwiseOr=67 +BitwiseXor=68 +BitwiseNot=69 +BitwiseZeroFillLeftShift=70 +BitwiseSignedRightShift=71 +BitwiseZeroFillRightShift=72 +Dot=73 +Identifier=74 +IntegerConstant=75 +SingleQuoteStringLiteral=76 +DoubleQuoteStringLiteral=77 +FloatingConstant=78 +Whitespace=79 +Newline=80 +FStringSingleQuoteStart=81 +FStringDoubleQuoteStart=82 +FStringSingleQuoteEnd=83 +FStringSingleQuoteAtom=84 +FStringDoubleQuoteEnd=85 +FStringDoubleQuoteAtom=86 'const'=5 'var'=6 'as'=7 @@ -101,50 +103,52 @@ FStringDoubleQuoteAtom=84 'return'=21 'call'=22 '->'=23 -'true'=24 -'false'=25 -'typeof'=26 -'void'=27 -'null'=28 -'undefined'=29 -','=30 -';'=31 -'?'=32 -':'=33 -'('=34 -')'=35 -'['=36 -']'=37 -'{'=39 -'}'=40 -'+'=41 -'++'=42 -'-'=43 -'--'=44 -'*'=45 -'/'=46 -'%'=47 -'**'=48 -'&&'=49 -'||'=50 -'!'=51 -'='=52 -'+='=53 -'-='=54 -'*='=55 -'/='=56 -'%='=57 -'=='=58 -'!='=59 -'<'=60 -'<='=61 -'>'=62 -'>='=63 -'&'=64 -'|'=65 -'^'=66 -'~'=67 -'<<'=68 -'>>'=69 -'>>>'=70 -'.'=71 +'class'=24 +'interface'=25 +'true'=26 +'false'=27 +'typeof'=28 +'void'=29 +'null'=30 +'undefined'=31 +','=32 +';'=33 +'?'=34 +':'=35 +'('=36 +')'=37 +'['=38 +']'=39 +'{'=41 +'}'=42 +'+'=43 +'++'=44 +'-'=45 +'--'=46 +'*'=47 +'/'=48 +'%'=49 +'**'=50 +'&&'=51 +'||'=52 +'!'=53 +'='=54 +'+='=55 +'-='=56 +'*='=57 +'/='=58 +'%='=59 +'=='=60 +'!='=61 +'<'=62 +'<='=63 +'>'=64 +'>='=65 +'&'=66 +'|'=67 +'^'=68 +'~'=69 +'<<'=70 +'>>'=71 +'>>>'=72 +'.'=73 diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperLexer.ts b/kipper/core/src/compiler/lexer-parser/antlr/KipperLexer.ts index efaaec50c..dceb3a35c 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperLexer.ts +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperLexer.ts @@ -1,6 +1,8 @@ // Generated from ./KipperLexer.g4 by ANTLR 4.9.0-SNAPSHOT -import KipperLexerBase from "./base/KipperLexerBase"; + + import KipperLexerBase from "./base/KipperLexerBase"; + import { ATN } from "antlr4ts/atn/ATN"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; @@ -15,6 +17,7 @@ import { VocabularyImpl } from "antlr4ts/VocabularyImpl"; import * as Utils from "antlr4ts/misc/Utils"; + export class KipperLexer extends KipperLexerBase { public static readonly FStringExpStart = 1; public static readonly BlockComment = 2; @@ -39,363 +42,139 @@ export class KipperLexer extends KipperLexerBase { public static readonly Return = 21; public static readonly CallFunc = 22; public static readonly RetIndicator = 23; - public static readonly True = 24; - public static readonly False = 25; - public static readonly Typeof = 26; - public static readonly Void = 27; - public static readonly Null = 28; - public static readonly Undefined = 29; - public static readonly Comma = 30; - public static readonly SemiColon = 31; - public static readonly QuestionMark = 32; - public static readonly Colon = 33; - public static readonly LeftParen = 34; - public static readonly RightParen = 35; - public static readonly LeftBracket = 36; - public static readonly RightBracket = 37; - public static readonly FStringExpEnd = 38; - public static readonly LeftBrace = 39; - public static readonly RightBrace = 40; - public static readonly Plus = 41; - public static readonly PlusPlus = 42; - public static readonly Minus = 43; - public static readonly MinusMinus = 44; - public static readonly Star = 45; - public static readonly Div = 46; - public static readonly Mod = 47; - public static readonly PowerTo = 48; - public static readonly AndAnd = 49; - public static readonly OrOr = 50; - public static readonly Not = 51; - public static readonly Assign = 52; - public static readonly PlusAssign = 53; - public static readonly MinusAssign = 54; - public static readonly StarAssign = 55; - public static readonly DivAssign = 56; - public static readonly ModAssign = 57; - public static readonly Equal = 58; - public static readonly NotEqual = 59; - public static readonly Less = 60; - public static readonly LessEqual = 61; - public static readonly Greater = 62; - public static readonly GreaterEqual = 63; - public static readonly BitwiseAnd = 64; - public static readonly BitwiseOr = 65; - public static readonly BitwiseXor = 66; - public static readonly BitwiseNot = 67; - public static readonly BitwiseZeroFillLeftShift = 68; - public static readonly BitwiseSignedRightShift = 69; - public static readonly BitwiseZeroFillRightShift = 70; - public static readonly Dot = 71; - public static readonly Identifier = 72; - public static readonly IntegerConstant = 73; - public static readonly SingleQuoteStringLiteral = 74; - public static readonly DoubleQuoteStringLiteral = 75; - public static readonly FloatingConstant = 76; - public static readonly Whitespace = 77; - public static readonly Newline = 78; - public static readonly FStringSingleQuoteStart = 79; - public static readonly FStringDoubleQuoteStart = 80; - public static readonly FStringSingleQuoteEnd = 81; - public static readonly FStringSingleQuoteAtom = 82; - public static readonly FStringDoubleQuoteEnd = 83; - public static readonly FStringDoubleQuoteAtom = 84; + public static readonly Class = 24; + public static readonly Interface = 25; + public static readonly True = 26; + public static readonly False = 27; + public static readonly Typeof = 28; + public static readonly Void = 29; + public static readonly Null = 30; + public static readonly Undefined = 31; + public static readonly Comma = 32; + public static readonly SemiColon = 33; + public static readonly QuestionMark = 34; + public static readonly Colon = 35; + public static readonly LeftParen = 36; + public static readonly RightParen = 37; + public static readonly LeftBracket = 38; + public static readonly RightBracket = 39; + public static readonly FStringExpEnd = 40; + public static readonly LeftBrace = 41; + public static readonly RightBrace = 42; + public static readonly Plus = 43; + public static readonly PlusPlus = 44; + public static readonly Minus = 45; + public static readonly MinusMinus = 46; + public static readonly Star = 47; + public static readonly Div = 48; + public static readonly Mod = 49; + public static readonly PowerTo = 50; + public static readonly AndAnd = 51; + public static readonly OrOr = 52; + public static readonly Not = 53; + public static readonly Assign = 54; + public static readonly PlusAssign = 55; + public static readonly MinusAssign = 56; + public static readonly StarAssign = 57; + public static readonly DivAssign = 58; + public static readonly ModAssign = 59; + public static readonly Equal = 60; + public static readonly NotEqual = 61; + public static readonly Less = 62; + public static readonly LessEqual = 63; + public static readonly Greater = 64; + public static readonly GreaterEqual = 65; + public static readonly BitwiseAnd = 66; + public static readonly BitwiseOr = 67; + public static readonly BitwiseXor = 68; + public static readonly BitwiseNot = 69; + public static readonly BitwiseZeroFillLeftShift = 70; + public static readonly BitwiseSignedRightShift = 71; + public static readonly BitwiseZeroFillRightShift = 72; + public static readonly Dot = 73; + public static readonly Identifier = 74; + public static readonly IntegerConstant = 75; + public static readonly SingleQuoteStringLiteral = 76; + public static readonly DoubleQuoteStringLiteral = 77; + public static readonly FloatingConstant = 78; + public static readonly Whitespace = 79; + public static readonly Newline = 80; + public static readonly FStringSingleQuoteStart = 81; + public static readonly FStringDoubleQuoteStart = 82; + public static readonly FStringSingleQuoteEnd = 83; + public static readonly FStringSingleQuoteAtom = 84; + public static readonly FStringDoubleQuoteEnd = 85; + public static readonly FStringDoubleQuoteAtom = 86; public static readonly COMMENT = 2; public static readonly PRAGMA = 3; public static readonly SINGLE_QUOTE_FSTRING = 1; public static readonly DOUBLE_QUOTE_FSTRING = 2; // tslint:disable:no-trailing-whitespace - public static readonly channelNames: string[] = ["DEFAULT_TOKEN_CHANNEL", "HIDDEN", "COMMENT", "PRAGMA"]; + public static readonly channelNames: string[] = [ + "DEFAULT_TOKEN_CHANNEL", "HIDDEN", "COMMENT", "PRAGMA", + ]; // tslint:disable:no-trailing-whitespace - public static readonly modeNames: string[] = ["DEFAULT_MODE", "SINGLE_QUOTE_FSTRING", "DOUBLE_QUOTE_FSTRING"]; + public static readonly modeNames: string[] = [ + "DEFAULT_MODE", "SINGLE_QUOTE_FSTRING", "DOUBLE_QUOTE_FSTRING", + ]; public static readonly ruleNames: string[] = [ - "BlockComment", - "LineComment", - "Pragma", - "Const", - "Var", - "As", - "Spread", - "Switch", - "Case", - "Default", - "Break", - "Continue", - "Do", - "While", - "If", - "Else", - "For", - "Enum", - "DefFunc", - "Return", - "CallFunc", - "RetIndicator", - "True", - "False", - "Typeof", - "Void", - "Null", - "Undefined", - "Comma", - "SemiColon", - "QuestionMark", - "Colon", - "LeftParen", - "RightParen", - "LeftBracket", - "RightBracket", - "FStringExpEnd", - "LeftBrace", - "RightBrace", - "Plus", - "PlusPlus", - "Minus", - "MinusMinus", - "Star", - "Div", - "Mod", - "PowerTo", - "AndAnd", - "OrOr", - "Not", - "Assign", - "PlusAssign", - "MinusAssign", - "StarAssign", - "DivAssign", - "ModAssign", - "Equal", - "NotEqual", - "Less", - "LessEqual", - "Greater", - "GreaterEqual", - "BitwiseAnd", - "BitwiseOr", - "BitwiseXor", - "BitwiseNot", - "BitwiseZeroFillLeftShift", - "BitwiseSignedRightShift", - "BitwiseZeroFillRightShift", - "Dot", - "Identifier", - "IntegerConstant", - "SingleQuoteStringLiteral", - "DoubleQuoteStringLiteral", - "FloatingConstant", - "Whitespace", - "Newline", - "FStringSingleQuoteStart", - "FStringDoubleQuoteStart", - "FStringSingleQuoteExpStart", - "FStringSingleQuoteEnd", - "FStringSingleQuoteAtom", - "FStringDoubleQuoteExpStart", - "FStringDoubleQuoteEnd", - "FStringDoubleQuoteAtom", - "IdentifierNondigit", - "Nondigit", - "Digit", - "DecimalConstant", - "BinaryConstant", - "OctalConstant", - "HexadecimalConstant", - "NonzeroDigit", - "BinaryDigit", - "OctalDigit", - "HexadecimalDigit", - "DecimalFloatingConstant", - "FractionalConstant", - "ExponentPart", - "DigitSequence", - "Sign", - "CCharSequence", - "CChar", - "EscapeSequence", - "SimpleEscapeSequence", - "OctalEscapeSequence", - "HexadecimalEscapeSequence", - "SingleQuoteFStringSCharSequence", - "SingleQuoteFStringSChar", - "DoubleQuoteFStringSCharSequence", - "DoubleQuoteFStringSChar", - "SingleQuoteSCharSequence", - "SingleQuoteSChar", - "DoubleQuoteSCharSequence", - "DoubleQuoteSChar", - "CommentContent", + "BlockComment", "LineComment", "Pragma", "Const", "Var", "As", "Spread", + "Switch", "Case", "Default", "Break", "Continue", "Do", "While", "If", + "Else", "For", "Enum", "DefFunc", "Return", "CallFunc", "RetIndicator", + "Class", "Interface", "True", "False", "Typeof", "Void", "Null", "Undefined", + "Comma", "SemiColon", "QuestionMark", "Colon", "LeftParen", "RightParen", + "LeftBracket", "RightBracket", "FStringExpEnd", "LeftBrace", "RightBrace", + "Plus", "PlusPlus", "Minus", "MinusMinus", "Star", "Div", "Mod", "PowerTo", + "AndAnd", "OrOr", "Not", "Assign", "PlusAssign", "MinusAssign", "StarAssign", + "DivAssign", "ModAssign", "Equal", "NotEqual", "Less", "LessEqual", "Greater", + "GreaterEqual", "BitwiseAnd", "BitwiseOr", "BitwiseXor", "BitwiseNot", + "BitwiseZeroFillLeftShift", "BitwiseSignedRightShift", "BitwiseZeroFillRightShift", + "Dot", "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", "DoubleQuoteStringLiteral", + "FloatingConstant", "Whitespace", "Newline", "FStringSingleQuoteStart", + "FStringDoubleQuoteStart", "FStringSingleQuoteExpStart", "FStringSingleQuoteEnd", + "FStringSingleQuoteAtom", "FStringDoubleQuoteExpStart", "FStringDoubleQuoteEnd", + "FStringDoubleQuoteAtom", "IdentifierNondigit", "Nondigit", "Digit", "DecimalConstant", + "BinaryConstant", "OctalConstant", "HexadecimalConstant", "NonzeroDigit", + "BinaryDigit", "OctalDigit", "HexadecimalDigit", "DecimalFloatingConstant", + "FractionalConstant", "ExponentPart", "DigitSequence", "Sign", "CCharSequence", + "CChar", "EscapeSequence", "SimpleEscapeSequence", "OctalEscapeSequence", + "HexadecimalEscapeSequence", "SingleQuoteFStringSCharSequence", "SingleQuoteFStringSChar", + "DoubleQuoteFStringSCharSequence", "DoubleQuoteFStringSChar", "SingleQuoteSCharSequence", + "SingleQuoteSChar", "DoubleQuoteSCharSequence", "DoubleQuoteSChar", "CommentContent", ]; private static readonly _LITERAL_NAMES: Array = [ - undefined, - undefined, - undefined, - undefined, - undefined, - "'const'", - "'var'", - "'as'", - "'...'", - "'switch'", - "'case'", - "'default'", - "'break'", - "'continue'", - "'do'", - "'while'", - "'if'", - "'else'", - "'for'", - "'enum'", - "'def'", - "'return'", - "'call'", - "'->'", - "'true'", - "'false'", - "'typeof'", - "'void'", - "'null'", - "'undefined'", - "','", - "';'", - "'?'", - "':'", - "'('", - "')'", - "'['", - "']'", - undefined, - "'{'", - "'}'", - "'+'", - "'++'", - "'-'", - "'--'", - "'*'", - "'/'", - "'%'", - "'**'", - "'&&'", - "'||'", - "'!'", - "'='", - "'+='", - "'-='", - "'*='", - "'/='", - "'%='", - "'=='", - "'!='", - "'<'", - "'<='", - "'>'", - "'>='", - "'&'", - "'|'", - "'^'", - "'~'", - "'<<'", - "'>>'", - "'>>>'", - "'.'", + undefined, undefined, undefined, undefined, undefined, "'const'", "'var'", + "'as'", "'...'", "'switch'", "'case'", "'default'", "'break'", "'continue'", + "'do'", "'while'", "'if'", "'else'", "'for'", "'enum'", "'def'", "'return'", + "'call'", "'->'", "'class'", "'interface'", "'true'", "'false'", "'typeof'", + "'void'", "'null'", "'undefined'", "','", "';'", "'?'", "':'", "'('", + "')'", "'['", "']'", undefined, "'{'", "'}'", "'+'", "'++'", "'-'", "'--'", + "'*'", "'/'", "'%'", "'**'", "'&&'", "'||'", "'!'", "'='", "'+='", "'-='", + "'*='", "'/='", "'%='", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", + "'&'", "'|'", "'^'", "'~'", "'<<'", "'>>'", "'>>>'", "'.'", ]; private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, - "FStringExpStart", - "BlockComment", - "LineComment", - "Pragma", - "Const", - "Var", - "As", - "Spread", - "Switch", - "Case", - "Default", - "Break", - "Continue", - "Do", - "While", - "If", - "Else", - "For", - "Enum", - "DefFunc", - "Return", - "CallFunc", - "RetIndicator", - "True", - "False", - "Typeof", - "Void", - "Null", - "Undefined", - "Comma", - "SemiColon", - "QuestionMark", - "Colon", - "LeftParen", - "RightParen", - "LeftBracket", - "RightBracket", - "FStringExpEnd", - "LeftBrace", - "RightBrace", - "Plus", - "PlusPlus", - "Minus", - "MinusMinus", - "Star", - "Div", - "Mod", - "PowerTo", - "AndAnd", - "OrOr", - "Not", - "Assign", - "PlusAssign", - "MinusAssign", - "StarAssign", - "DivAssign", - "ModAssign", - "Equal", - "NotEqual", - "Less", - "LessEqual", - "Greater", - "GreaterEqual", - "BitwiseAnd", - "BitwiseOr", - "BitwiseXor", - "BitwiseNot", - "BitwiseZeroFillLeftShift", - "BitwiseSignedRightShift", - "BitwiseZeroFillRightShift", - "Dot", - "Identifier", - "IntegerConstant", - "SingleQuoteStringLiteral", - "DoubleQuoteStringLiteral", - "FloatingConstant", - "Whitespace", - "Newline", - "FStringSingleQuoteStart", - "FStringDoubleQuoteStart", - "FStringSingleQuoteEnd", - "FStringSingleQuoteAtom", - "FStringDoubleQuoteEnd", - "FStringDoubleQuoteAtom", + undefined, "FStringExpStart", "BlockComment", "LineComment", "Pragma", + "Const", "Var", "As", "Spread", "Switch", "Case", "Default", "Break", + "Continue", "Do", "While", "If", "Else", "For", "Enum", "DefFunc", "Return", + "CallFunc", "RetIndicator", "Class", "Interface", "True", "False", "Typeof", + "Void", "Null", "Undefined", "Comma", "SemiColon", "QuestionMark", "Colon", + "LeftParen", "RightParen", "LeftBracket", "RightBracket", "FStringExpEnd", + "LeftBrace", "RightBrace", "Plus", "PlusPlus", "Minus", "MinusMinus", + "Star", "Div", "Mod", "PowerTo", "AndAnd", "OrOr", "Not", "Assign", "PlusAssign", + "MinusAssign", "StarAssign", "DivAssign", "ModAssign", "Equal", "NotEqual", + "Less", "LessEqual", "Greater", "GreaterEqual", "BitwiseAnd", "BitwiseOr", + "BitwiseXor", "BitwiseNot", "BitwiseZeroFillLeftShift", "BitwiseSignedRightShift", + "BitwiseZeroFillRightShift", "Dot", "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", + "DoubleQuoteStringLiteral", "FloatingConstant", "Whitespace", "Newline", + "FStringSingleQuoteStart", "FStringDoubleQuoteStart", "FStringSingleQuoteEnd", + "FStringSingleQuoteAtom", "FStringDoubleQuoteEnd", "FStringDoubleQuoteAtom", ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( - KipperLexer._LITERAL_NAMES, - KipperLexer._SYMBOLIC_NAMES, - [], - ); + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(KipperLexer._LITERAL_NAMES, KipperLexer._SYMBOLIC_NAMES, []); // @Override // @NotNull @@ -404,130 +183,121 @@ export class KipperLexer extends KipperLexerBase { } // tslint:enable:no-trailing-whitespace + constructor(input: CharStream) { super(input); this._interp = new LexerATNSimulator(KipperLexer._ATN, this); } // @Override - public get grammarFileName(): string { - return "KipperLexer.g4"; - } + public get grammarFileName(): string { return "KipperLexer.g4"; } // @Override - public get ruleNames(): string[] { - return KipperLexer.ruleNames; - } + public get ruleNames(): string[] { return KipperLexer.ruleNames; } // @Override - public get serializedATN(): string { - return KipperLexer._serializedATN; - } + public get serializedATN(): string { return KipperLexer._serializedATN; } // @Override - public get channelNames(): string[] { - return KipperLexer.channelNames; - } + public get channelNames(): string[] { return KipperLexer.channelNames; } // @Override - public get modeNames(): string[] { - return KipperLexer.modeNames; - } + public get modeNames(): string[] { return KipperLexer.modeNames; } // @Override public action(_localctx: RuleContext, ruleIndex: number, actionIndex: number): void { switch (ruleIndex) { - case 77: - this.FStringSingleQuoteStart_action(_localctx, actionIndex); - break; + case 79: + this.FStringSingleQuoteStart_action(_localctx, actionIndex); + break; - case 78: - this.FStringDoubleQuoteStart_action(_localctx, actionIndex); - break; + case 80: + this.FStringDoubleQuoteStart_action(_localctx, actionIndex); + break; - case 80: - this.FStringSingleQuoteEnd_action(_localctx, actionIndex); - break; + case 82: + this.FStringSingleQuoteEnd_action(_localctx, actionIndex); + break; - case 83: - this.FStringDoubleQuoteEnd_action(_localctx, actionIndex); - break; + case 85: + this.FStringDoubleQuoteEnd_action(_localctx, actionIndex); + break; } } private FStringSingleQuoteStart_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 0: - this.incrementFStringDepth(); - break; + case 0: + this.incrementFStringDepth() + break; } } private FStringDoubleQuoteStart_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 1: - this.incrementFStringDepth(); - break; + case 1: + this.incrementFStringDepth() + break; } } private FStringSingleQuoteEnd_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 2: - this.decrementFStringDepth(); - break; + case 2: + this.decrementFStringDepth() + break; } } private FStringDoubleQuoteEnd_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 3: - this.decrementFStringDepth(); - break; + case 3: + this.decrementFStringDepth() + break; } } // @Override public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { switch (ruleIndex) { - case 36: - return this.FStringExpEnd_sempred(_localctx, predIndex); + case 38: + return this.FStringExpEnd_sempred(_localctx, predIndex); - case 79: - return this.FStringSingleQuoteExpStart_sempred(_localctx, predIndex); + case 81: + return this.FStringSingleQuoteExpStart_sempred(_localctx, predIndex); - case 82: - return this.FStringDoubleQuoteExpStart_sempred(_localctx, predIndex); + case 84: + return this.FStringDoubleQuoteExpStart_sempred(_localctx, predIndex); } return true; } private FStringExpEnd_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 0: - return this.insideFString(); + case 0: + return this.insideFString(); } return true; } private FStringSingleQuoteExpStart_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 1: - return this.insideFString(); + case 1: + return this.insideFString(); } return true; } private FStringDoubleQuoteExpStart_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 2: - return this.insideFString(); + case 2: + return this.insideFString(); } return true; } private static readonly _serializedATNSegments: number = 2; private static readonly _serializedATNSegment0: string = - "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x02V\u02E0\b\x01" + + "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x02X\u02F4\b\x01" + "\b\x01\b\x01\x04\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04" + "\x06\t\x06\x04\x07\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f" + "\t\f\x04\r\t\r\x04\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11" + "\x04\x12\t\x12\x04\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16" + "\x04\x17\t\x17\x04\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B" + "\x04\x1C\t\x1C\x04\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!" + - "\t!\x04\"\t\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04'\t'\x04(\t(\x04)\t" + + "\t!\x04\"\t\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(\x04)\t" + ")\x04*\t*\x04+\t+\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x040\t0\x041\t1\x04" + "2\t2\x043\t3\x044\t4\x045\t5\x046\t6\x047\t7\x048\t8\x049\t9\x04:\t:\x04" + ";\t;\x04<\t<\x04=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x04B\tB\x04C\tC\x04" + @@ -536,339 +306,351 @@ export class KipperLexer extends KipperLexerBase { "V\tV\x04W\tW\x04X\tX\x04Y\tY\x04Z\tZ\x04[\t[\x04\\\t\\\x04]\t]\x04^\t" + "^\x04_\t_\x04`\t`\x04a\ta\x04b\tb\x04c\tc\x04d\td\x04e\te\x04f\tf\x04" + "g\tg\x04h\th\x04i\ti\x04j\tj\x04k\tk\x04l\tl\x04m\tm\x04n\tn\x04o\to\x04" + - "p\tp\x04q\tq\x04r\tr\x04s\ts\x04t\tt\x04u\tu\x03\x02\x03\x02\x03\x02\x03" + - "\x02\x07\x02\xF2\n\x02\f\x02\x0E\x02\xF5\v\x02\x03\x02\x03\x02\x03\x02" + - "\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + - "\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04" + - "\x03\x04\x03\x04\x03\x04\x03\x05\x03\x05\x03\x05\x03\x05\x03\x05\x03\x05" + - "\x03\x06\x03\x06\x03\x06\x03\x06\x03\x07\x03\x07\x03\x07\x03\b\x03\b\x03" + - "\b\x03\b\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\n\x03\n\x03\n\x03" + - "\n\x03\n\x03\v\x03\v\x03\v\x03\v\x03\v\x03\v\x03\v\x03\v\x03\f\x03\f\x03" + - "\f\x03\f\x03\f\x03\f\x03\r\x03\r\x03\r\x03\r\x03\r\x03\r\x03\r\x03\r\x03" + - "\r\x03\x0E\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x03\x0F\x03" + - "\x0F\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\x13\x03\x13\x03\x13\x03\x13\x03\x13\x03" + - "\x14\x03\x14\x03\x14\x03\x14\x03\x15\x03\x15\x03\x15\x03\x15\x03\x15\x03" + - "\x15\x03\x15\x03\x16\x03\x16\x03\x16\x03\x16\x03\x16\x03\x17\x03\x17\x03" + - "\x17\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x19\x03\x19\x03\x19\x03" + - "\x19\x03\x19\x03\x19\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03" + - "\x1A\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\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\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x03 \x03 \x03!\x03" + - '!\x03"\x03"\x03#\x03#\x03$\x03$\x03%\x03%\x03&\x03&\x03&\x03&\x03&\x03' + - "'\x03'\x03(\x03(\x03)\x03)\x03*\x03*\x03*\x03+\x03+\x03,\x03,\x03,\x03" + - "-\x03-\x03.\x03.\x03/\x03/\x030\x030\x030\x031\x031\x031\x032\x032\x03" + - "2\x033\x033\x034\x034\x035\x035\x035\x036\x036\x036\x037\x037\x037\x03" + - "8\x038\x038\x039\x039\x039\x03:\x03:\x03:\x03;\x03;\x03;\x03<\x03<\x03" + - "=\x03=\x03=\x03>\x03>\x03?\x03?\x03?\x03@\x03@\x03A\x03A\x03B\x03B\x03" + - "C\x03C\x03D\x03D\x03D\x03E\x03E\x03E\x03F\x03F\x03F\x03F\x03G\x03G\x03" + - "H\x03H\x03H\x07H\u0202\nH\fH\x0EH\u0205\vH\x03I\x03I\x03I\x03I\x05I\u020B" + - "\nI\x03J\x03J\x05J\u020F\nJ\x03J\x03J\x03K\x03K\x05K\u0215\nK\x03K\x03" + - "K\x03L\x03L\x03M\x06M\u021C\nM\rM\x0EM\u021D\x03M\x03M\x03N\x03N\x03N" + - "\x03N\x03O\x03O\x03O\x03O\x03O\x03O\x03O\x03P\x03P\x03P\x03P\x03P\x03" + - "P\x03P\x03Q\x03Q\x03Q\x03Q\x03Q\x03Q\x03R\x03R\x03R\x03R\x03R\x03S\x03" + - "S\x03T\x03T\x03T\x03T\x03T\x03T\x03U\x03U\x03U\x03U\x03U\x03V\x03V\x03" + - "W\x03W\x03X\x03X\x03Y\x03Y\x03Z\x06Z\u0255\nZ\rZ\x0EZ\u0256\x03[\x03[" + - "\x03[\x06[\u025C\n[\r[\x0E[\u025D\x03\\\x03\\\x03\\\x06\\\u0263\n\\\r" + - "\\\x0E\\\u0264\x03]\x03]\x03]\x06]\u026A\n]\r]\x0E]\u026B\x03^\x03^\x03" + - "_\x03_\x03`\x03`\x03a\x03a\x03b\x03b\x05b\u0278\nb\x03b\x03b\x03b\x05" + - "b\u027D\nb\x03c\x05c\u0280\nc\x03c\x03c\x03c\x03c\x03c\x05c\u0287\nc\x03" + - "d\x03d\x05d\u028B\nd\x03d\x03d\x03e\x06e\u0290\ne\re\x0Ee\u0291\x03f\x03" + - "f\x03g\x06g\u0297\ng\rg\x0Eg\u0298\x03h\x03h\x05h\u029D\nh\x03i\x03i\x03" + - "i\x05i\u02A2\ni\x03j\x03j\x03j\x03k\x03k\x03k\x05k\u02AA\nk\x03k\x05k" + - "\u02AD\nk\x03l\x03l\x03l\x03l\x06l\u02B3\nl\rl\x0El\u02B4\x03m\x06m\u02B8" + - "\nm\rm\x0Em\u02B9\x03n\x03n\x05n\u02BE\nn\x03o\x06o\u02C1\no\ro\x0Eo\u02C2" + - "\x03p\x03p\x05p\u02C7\np\x03q\x06q\u02CA\nq\rq\x0Eq\u02CB\x03r\x03r\x05" + - "r\u02D0\nr\x03s\x06s\u02D3\ns\rs\x0Es\u02D4\x03t\x03t\x05t\u02D9\nt\x03" + - "u\x07u\u02DC\nu\fu\x0Eu\u02DF\vu\x03\xF3\x02\x02v\x05\x02\x04\x07\x02" + - "\x05\t\x02\x06\v\x02\x07\r\x02\b\x0F\x02\t\x11\x02\n\x13\x02\v\x15\x02" + - "\f\x17\x02\r\x19\x02\x0E\x1B\x02\x0F\x1D\x02\x10\x1F\x02\x11!\x02\x12" + - "#\x02\x13%\x02\x14'\x02\x15)\x02\x16+\x02\x17-\x02\x18/\x02\x191\x02" + - '\x1A3\x02\x1B5\x02\x1C7\x02\x1D9\x02\x1E;\x02\x1F=\x02 ?\x02!A\x02"C' + - "\x02#E\x02$G\x02%I\x02&K\x02'M\x02(O\x02)Q\x02*S\x02+U\x02,W\x02-Y\x02" + - ".[\x02/]\x020_\x021a\x022c\x023e\x024g\x025i\x026k\x027m\x028o\x029q\x02" + - ":s\x02;u\x02{\x02?}\x02@\x7F\x02A\x81\x02B\x83\x02C\x85\x02" + - "D\x87\x02E\x89\x02F\x8B\x02G\x8D\x02H\x8F\x02I\x91\x02J\x93\x02K\x95\x02" + - "L\x97\x02M\x99\x02N\x9B\x02O\x9D\x02P\x9F\x02Q\xA1\x02R\xA3\x02\x02\xA5" + - "\x02S\xA7\x02T\xA9\x02\x02\xAB\x02U\xAD\x02V\xAF\x02\x02\xB1\x02\x02\xB3" + - "\x02\x02\xB5\x02\x02\xB7\x02\x02\xB9\x02\x02\xBB\x02\x02\xBD\x02\x02\xBF" + - "\x02\x02\xC1\x02\x02\xC3\x02\x02\xC5\x02\x02\xC7\x02\x02\xC9\x02\x02\xCB" + - "\x02\x02\xCD\x02\x02\xCF\x02\x02\xD1\x02\x02\xD3\x02\x02\xD5\x02\x02\xD7" + - "\x02\x02\xD9\x02\x02\xDB\x02\x02\xDD\x02\x02\xDF\x02\x02\xE1\x02\x02\xE3" + - "\x02\x02\xE5\x02\x02\xE7\x02\x02\xE9\x02\x02\xEB\x02\x02\x05\x02\x03\x04" + - '\x14\x06\x02\v\v\r\x0E""\xA2\xA2\x05\x02\f\f\x0F\x0F\u202A\u202B\x05' + - "\x02C\\aac|\x03\x022;\x04\x02DDdd\x04\x02QQqq\x04\x02ZZzz\x03\x023;\x03" + - "\x0223\x03\x0229\x05\x022;CHch\x04\x02GGgg\x04\x02--//\x06\x02\f\f\x0F" + - "\x0F))^^\x0E\x02$$))AA^^cdhhppttvvxx}}\x7F\x7F\b\x02\f\f\x0F\x0F))^^}" + - "}\x7F\x7F\b\x02\f\f\x0F\x0F$$^^}}\x7F\x7F\x06\x02\f\f\x0F\x0F$$^^\x02" + - "\u02E1\x02\x05\x03\x02\x02\x02\x02\x07\x03\x02\x02\x02\x02\t\x03\x02\x02" + - "\x02\x02\v\x03\x02\x02\x02\x02\r\x03\x02\x02\x02\x02\x0F\x03\x02\x02\x02" + - "\x02\x11\x03\x02\x02\x02\x02\x13\x03\x02\x02\x02\x02\x15\x03\x02\x02\x02" + - "\x02\x17\x03\x02\x02\x02\x02\x19\x03\x02\x02\x02\x02\x1B\x03\x02\x02\x02" + - "\x02\x1D\x03\x02\x02\x02\x02\x1F\x03\x02\x02\x02\x02!\x03\x02\x02\x02" + - "\x02#\x03\x02\x02\x02\x02%\x03\x02\x02\x02\x02'\x03\x02\x02\x02\x02)" + - "\x03\x02\x02\x02\x02+\x03\x02\x02\x02\x02-\x03\x02\x02\x02\x02/\x03\x02" + - "\x02\x02\x021\x03\x02\x02\x02\x023\x03\x02\x02\x02\x025\x03\x02\x02\x02" + - "\x027\x03\x02\x02\x02\x029\x03\x02\x02\x02\x02;\x03\x02\x02\x02\x02=\x03" + - "\x02\x02\x02\x02?\x03\x02\x02\x02\x02A\x03\x02\x02\x02\x02C\x03\x02\x02" + - "\x02\x02E\x03\x02\x02\x02\x02G\x03\x02\x02\x02\x02I\x03\x02\x02\x02\x02" + - "K\x03\x02\x02\x02\x02M\x03\x02\x02\x02\x02O\x03\x02\x02\x02\x02Q\x03\x02" + - "\x02\x02\x02S\x03\x02\x02\x02\x02U\x03\x02\x02\x02\x02W\x03\x02\x02\x02" + - "\x02Y\x03\x02\x02\x02\x02[\x03\x02\x02\x02\x02]\x03\x02\x02\x02\x02_\x03" + - "\x02\x02\x02\x02a\x03\x02\x02\x02\x02c\x03\x02\x02\x02\x02e\x03\x02\x02" + - "\x02\x02g\x03\x02\x02\x02\x02i\x03\x02\x02\x02\x02k\x03\x02\x02\x02\x02" + - "m\x03\x02\x02\x02\x02o\x03\x02\x02\x02\x02q\x03\x02\x02\x02\x02s\x03\x02" + - "\x02\x02\x02u\x03\x02\x02\x02\x02w\x03\x02\x02\x02\x02y\x03\x02\x02\x02" + - "\x02{\x03\x02\x02\x02\x02}\x03\x02\x02\x02\x02\x7F\x03\x02\x02\x02\x02" + - "\x81\x03\x02\x02\x02\x02\x83\x03\x02\x02\x02\x02\x85\x03\x02\x02\x02\x02" + - "\x87\x03\x02\x02\x02\x02\x89\x03\x02\x02\x02\x02\x8B\x03\x02\x02\x02\x02" + - "\x8D\x03\x02\x02\x02\x02\x8F\x03\x02\x02\x02\x02\x91\x03\x02\x02\x02\x02" + - "\x93\x03\x02\x02\x02\x02\x95\x03\x02\x02\x02\x02\x97\x03\x02\x02\x02\x02" + - "\x99\x03\x02\x02\x02\x02\x9B\x03\x02\x02\x02\x02\x9D\x03\x02\x02\x02\x02" + - "\x9F\x03\x02\x02\x02\x02\xA1\x03\x02\x02\x02\x03\xA3\x03\x02\x02\x02\x03" + - "\xA5\x03\x02\x02\x02\x03\xA7\x03\x02\x02\x02\x04\xA9\x03\x02\x02\x02\x04" + - "\xAB\x03\x02\x02\x02\x04\xAD\x03\x02\x02\x02\x05\xED\x03\x02\x02\x02\x07" + - "\xFB\x03\x02\x02\x02\t\u0102\x03\x02\x02\x02\v\u010E\x03\x02\x02\x02\r" + - "\u0114\x03\x02\x02\x02\x0F\u0118\x03\x02\x02\x02\x11\u011B\x03\x02\x02" + - "\x02\x13\u011F\x03\x02\x02\x02\x15\u0126\x03\x02\x02\x02\x17\u012B\x03" + - "\x02\x02\x02\x19\u0133\x03\x02\x02\x02\x1B\u0139\x03\x02\x02\x02\x1D\u0142" + - "\x03\x02\x02\x02\x1F\u0145\x03\x02\x02\x02!\u014B\x03\x02\x02\x02#\u014E" + - "\x03\x02\x02\x02%\u0153\x03\x02\x02\x02'\u0157\x03\x02\x02\x02)\u015C" + - "\x03\x02\x02\x02+\u0160\x03\x02\x02\x02-\u0167\x03\x02\x02\x02/\u016C" + - "\x03\x02\x02\x021\u016F\x03\x02\x02\x023\u0174\x03\x02\x02\x025\u017A" + - "\x03\x02\x02\x027\u0181\x03\x02\x02\x029\u0186\x03\x02\x02\x02;\u018B" + - "\x03\x02\x02\x02=\u0195\x03\x02\x02\x02?\u0197\x03\x02\x02\x02A\u0199" + - "\x03\x02\x02\x02C\u019B\x03\x02\x02\x02E\u019D\x03\x02\x02\x02G\u019F" + - "\x03\x02\x02\x02I\u01A1\x03\x02\x02\x02K\u01A3\x03\x02\x02\x02M\u01A5" + - "\x03\x02\x02\x02O\u01AA\x03\x02\x02\x02Q\u01AC\x03\x02\x02\x02S\u01AE" + - "\x03\x02\x02\x02U\u01B0\x03\x02\x02\x02W\u01B3\x03\x02\x02\x02Y\u01B5" + - "\x03\x02\x02\x02[\u01B8\x03\x02\x02\x02]\u01BA\x03\x02\x02\x02_\u01BC" + - "\x03\x02\x02\x02a\u01BE\x03\x02\x02\x02c\u01C1\x03\x02\x02\x02e\u01C4" + - "\x03\x02\x02\x02g\u01C7\x03\x02\x02\x02i\u01C9\x03\x02\x02\x02k\u01CB" + - "\x03\x02\x02\x02m\u01CE\x03\x02\x02\x02o\u01D1\x03\x02\x02\x02q\u01D4" + - "\x03\x02\x02\x02s\u01D7\x03\x02\x02\x02u\u01DA\x03\x02\x02\x02w\u01DD" + - "\x03\x02\x02\x02y\u01E0\x03\x02\x02\x02{\u01E2\x03\x02\x02\x02}\u01E5" + - "\x03\x02\x02\x02\x7F\u01E7\x03\x02\x02\x02\x81\u01EA\x03\x02\x02\x02\x83" + - "\u01EC\x03\x02\x02\x02\x85\u01EE\x03\x02\x02\x02\x87\u01F0\x03\x02\x02" + - "\x02\x89\u01F2\x03\x02\x02\x02\x8B\u01F5\x03\x02\x02\x02\x8D\u01F8\x03" + - "\x02\x02\x02\x8F\u01FC\x03\x02\x02\x02\x91\u01FE\x03\x02\x02\x02\x93\u020A" + - "\x03\x02\x02\x02\x95\u020C\x03\x02\x02\x02\x97\u0212\x03\x02\x02\x02\x99" + - "\u0218\x03\x02\x02\x02\x9B\u021B\x03\x02\x02\x02\x9D\u0221\x03\x02\x02" + - "\x02\x9F\u0225\x03\x02\x02\x02\xA1\u022C\x03\x02\x02\x02\xA3\u0233\x03" + - "\x02\x02\x02\xA5\u0239\x03\x02\x02\x02\xA7\u023E\x03\x02\x02\x02\xA9\u0240" + - "\x03\x02\x02\x02\xAB\u0246\x03\x02\x02\x02\xAD\u024B\x03\x02\x02\x02\xAF" + - "\u024D\x03\x02\x02\x02\xB1\u024F\x03\x02\x02\x02\xB3\u0251\x03\x02\x02" + - "\x02\xB5\u0254\x03\x02\x02\x02\xB7\u0258\x03\x02\x02\x02\xB9\u025F\x03" + - "\x02\x02\x02\xBB\u0266\x03\x02\x02\x02\xBD\u026D\x03\x02\x02\x02\xBF\u026F" + - "\x03\x02\x02\x02\xC1\u0271\x03\x02\x02\x02\xC3\u0273\x03\x02\x02\x02\xC5" + - "\u027C\x03\x02\x02\x02\xC7\u0286\x03\x02\x02\x02\xC9\u0288\x03\x02\x02" + - "\x02\xCB\u028F\x03\x02\x02\x02\xCD\u0293\x03\x02\x02\x02\xCF\u0296\x03" + - "\x02\x02\x02\xD1\u029C\x03\x02\x02\x02\xD3\u02A1\x03\x02\x02\x02\xD5\u02A3" + - "\x03\x02\x02\x02\xD7\u02A6\x03\x02\x02\x02\xD9\u02AE\x03\x02\x02\x02\xDB" + - "\u02B7\x03\x02\x02\x02\xDD\u02BD\x03\x02\x02\x02\xDF\u02C0\x03\x02\x02" + - "\x02\xE1\u02C6\x03\x02\x02\x02\xE3\u02C9\x03\x02\x02\x02\xE5\u02CF\x03" + - "\x02\x02\x02\xE7\u02D2\x03\x02\x02\x02\xE9\u02D8\x03\x02\x02\x02\xEB\u02DD" + - "\x03\x02\x02\x02\xED\xEE\x071\x02\x02\xEE\xEF\x07,\x02\x02\xEF\xF3\x03" + - "\x02\x02\x02\xF0\xF2\v\x02\x02\x02\xF1\xF0\x03\x02\x02\x02\xF2\xF5\x03" + - "\x02\x02\x02\xF3\xF4\x03\x02\x02\x02\xF3\xF1\x03\x02\x02\x02\xF4\xF6\x03" + - "\x02\x02\x02\xF5\xF3\x03\x02\x02\x02\xF6\xF7\x07,\x02\x02\xF7\xF8\x07" + - "1\x02\x02\xF8\xF9\x03\x02\x02\x02\xF9\xFA\b\x02\x02\x02\xFA\x06\x03\x02" + - "\x02\x02\xFB\xFC\x071\x02\x02\xFC\xFD\x071\x02\x02\xFD\xFE\x03\x02\x02" + - "\x02\xFE\xFF\x05\xEBu\x02\xFF\u0100\x03\x02\x02\x02\u0100\u0101\b\x03" + - "\x02\x02\u0101\b\x03\x02\x02\x02\u0102\u0103\x07%\x02\x02\u0103\u0104" + - "\x07r\x02\x02\u0104\u0105\x07t\x02\x02\u0105\u0106\x07c\x02\x02\u0106" + - "\u0107\x07i\x02\x02\u0107\u0108\x07o\x02\x02\u0108\u0109\x07c\x02\x02" + - "\u0109\u010A\x03\x02\x02\x02\u010A\u010B\x05\xEBu\x02\u010B\u010C\x03" + - "\x02\x02\x02\u010C\u010D\b\x04\x03\x02\u010D\n\x03\x02\x02\x02\u010E\u010F" + - "\x07e\x02\x02\u010F\u0110\x07q\x02\x02\u0110\u0111\x07p\x02\x02\u0111" + - "\u0112\x07u\x02\x02\u0112\u0113\x07v\x02\x02\u0113\f\x03\x02\x02\x02\u0114" + - "\u0115\x07x\x02\x02\u0115\u0116\x07c\x02\x02\u0116\u0117\x07t\x02\x02" + - "\u0117\x0E\x03\x02\x02\x02\u0118\u0119\x07c\x02\x02\u0119\u011A\x07u\x02" + - "\x02\u011A\x10\x03\x02\x02\x02\u011B\u011C\x070\x02\x02\u011C\u011D\x07" + - "0\x02\x02\u011D\u011E\x070\x02\x02\u011E\x12\x03\x02\x02\x02\u011F\u0120" + - "\x07u\x02\x02\u0120\u0121\x07y\x02\x02\u0121\u0122\x07k\x02\x02\u0122" + - "\u0123\x07v\x02\x02\u0123\u0124\x07e\x02\x02\u0124\u0125\x07j\x02\x02" + - "\u0125\x14\x03\x02\x02\x02\u0126\u0127\x07e\x02\x02\u0127\u0128\x07c\x02" + - "\x02\u0128\u0129\x07u\x02\x02\u0129\u012A\x07g\x02\x02\u012A\x16\x03\x02" + - "\x02\x02\u012B\u012C\x07f\x02\x02\u012C\u012D\x07g\x02\x02\u012D\u012E" + - "\x07h\x02\x02\u012E\u012F\x07c\x02\x02\u012F\u0130\x07w\x02\x02\u0130" + - "\u0131\x07n\x02\x02\u0131\u0132\x07v\x02\x02\u0132\x18\x03\x02\x02\x02" + - "\u0133\u0134\x07d\x02\x02\u0134\u0135\x07t\x02\x02\u0135\u0136\x07g\x02" + - "\x02\u0136\u0137\x07c\x02\x02\u0137\u0138\x07m\x02\x02\u0138\x1A\x03\x02" + - "\x02\x02\u0139\u013A\x07e\x02\x02\u013A\u013B\x07q\x02\x02\u013B\u013C" + - "\x07p\x02\x02\u013C\u013D\x07v\x02\x02\u013D\u013E\x07k\x02\x02\u013E" + - "\u013F\x07p\x02\x02\u013F\u0140\x07w\x02\x02\u0140\u0141\x07g\x02\x02" + - "\u0141\x1C\x03\x02\x02\x02\u0142\u0143\x07f\x02\x02\u0143\u0144\x07q\x02" + - "\x02\u0144\x1E\x03\x02\x02\x02\u0145\u0146\x07y\x02\x02\u0146\u0147\x07" + - "j\x02\x02\u0147\u0148\x07k\x02\x02\u0148\u0149\x07n\x02\x02\u0149\u014A" + - "\x07g\x02\x02\u014A \x03\x02\x02\x02\u014B\u014C\x07k\x02\x02\u014C\u014D" + - '\x07h\x02\x02\u014D"\x03\x02\x02\x02\u014E\u014F\x07g\x02\x02\u014F\u0150' + - "\x07n\x02\x02\u0150\u0151\x07u\x02\x02\u0151\u0152\x07g\x02\x02\u0152" + - "$\x03\x02\x02\x02\u0153\u0154\x07h\x02\x02\u0154\u0155\x07q\x02\x02\u0155" + - "\u0156\x07t\x02\x02\u0156&\x03\x02\x02\x02\u0157\u0158\x07g\x02\x02\u0158" + - "\u0159\x07p\x02\x02\u0159\u015A\x07w\x02\x02\u015A\u015B\x07o\x02\x02" + - "\u015B(\x03\x02\x02\x02\u015C\u015D\x07f\x02\x02\u015D\u015E\x07g\x02" + - "\x02\u015E\u015F\x07h\x02\x02\u015F*\x03\x02\x02\x02\u0160\u0161\x07t" + - "\x02\x02\u0161\u0162\x07g\x02\x02\u0162\u0163\x07v\x02\x02\u0163\u0164" + - "\x07w\x02\x02\u0164\u0165\x07t\x02\x02\u0165\u0166\x07p\x02\x02\u0166" + - ",\x03\x02\x02\x02\u0167\u0168\x07e\x02\x02\u0168\u0169\x07c\x02\x02\u0169" + - "\u016A\x07n\x02\x02\u016A\u016B\x07n\x02\x02\u016B.\x03\x02\x02\x02\u016C" + - "\u016D\x07/\x02\x02\u016D\u016E\x07@\x02\x02\u016E0\x03\x02\x02\x02\u016F" + - "\u0170\x07v\x02\x02\u0170\u0171\x07t\x02\x02\u0171\u0172\x07w\x02\x02" + - "\u0172\u0173\x07g\x02\x02\u01732\x03\x02\x02\x02\u0174\u0175\x07h\x02" + - "\x02\u0175\u0176\x07c\x02\x02\u0176\u0177\x07n\x02\x02\u0177\u0178\x07" + - "u\x02\x02\u0178\u0179\x07g\x02\x02\u01794\x03\x02\x02\x02\u017A\u017B" + - "\x07v\x02\x02\u017B\u017C\x07{\x02\x02\u017C\u017D\x07r\x02\x02\u017D" + - "\u017E\x07g\x02\x02\u017E\u017F\x07q\x02\x02\u017F\u0180\x07h\x02\x02" + - "\u01806\x03\x02\x02\x02\u0181\u0182\x07x\x02\x02\u0182\u0183\x07q\x02" + - "\x02\u0183\u0184\x07k\x02\x02\u0184\u0185\x07f\x02\x02\u01858\x03\x02" + - "\x02\x02\u0186\u0187\x07p\x02\x02\u0187\u0188\x07w\x02\x02\u0188\u0189" + - "\x07n\x02\x02\u0189\u018A\x07n\x02\x02\u018A:\x03\x02\x02\x02\u018B\u018C" + - "\x07w\x02\x02\u018C\u018D\x07p\x02\x02\u018D\u018E\x07f\x02\x02\u018E" + - "\u018F\x07g\x02\x02\u018F\u0190\x07h\x02\x02\u0190\u0191\x07k\x02\x02" + - "\u0191\u0192\x07p\x02\x02\u0192\u0193\x07g\x02\x02\u0193\u0194\x07f\x02" + - "\x02\u0194<\x03\x02\x02\x02\u0195\u0196\x07.\x02\x02\u0196>\x03\x02\x02" + - "\x02\u0197\u0198\x07=\x02\x02\u0198@\x03\x02\x02\x02\u0199\u019A\x07A" + - "\x02\x02\u019AB\x03\x02\x02\x02\u019B\u019C\x07<\x02\x02\u019CD\x03\x02" + - "\x02\x02\u019D\u019E\x07*\x02\x02\u019EF\x03\x02\x02\x02\u019F\u01A0\x07" + - "+\x02\x02\u01A0H\x03\x02\x02\x02\u01A1\u01A2\x07]\x02\x02\u01A2J\x03\x02" + - "\x02\x02\u01A3\u01A4\x07_\x02\x02\u01A4L\x03\x02\x02\x02\u01A5\u01A6\x06" + - "&\x02\x02\u01A6\u01A7\x07\x7F\x02\x02\u01A7\u01A8\x03\x02\x02\x02\u01A8" + - "\u01A9\b&\x04\x02\u01A9N\x03\x02\x02\x02\u01AA\u01AB\x07}\x02\x02\u01AB" + - "P\x03\x02\x02\x02\u01AC\u01AD\x07\x7F\x02\x02\u01ADR\x03\x02\x02\x02\u01AE" + - "\u01AF\x07-\x02\x02\u01AFT\x03\x02\x02\x02\u01B0\u01B1\x07-\x02\x02\u01B1" + - "\u01B2\x07-\x02\x02\u01B2V\x03\x02\x02\x02\u01B3\u01B4\x07/\x02\x02\u01B4" + - "X\x03\x02\x02\x02\u01B5\u01B6\x07/\x02\x02\u01B6\u01B7\x07/\x02\x02\u01B7" + - "Z\x03\x02\x02\x02\u01B8\u01B9\x07,\x02\x02\u01B9\\\x03\x02\x02\x02\u01BA" + - "\u01BB\x071\x02\x02\u01BB^\x03\x02\x02\x02\u01BC\u01BD\x07'\x02\x02\u01BD" + - "`\x03\x02\x02\x02\u01BE\u01BF\x07,\x02\x02\u01BF\u01C0\x07,\x02\x02\u01C0" + - "b\x03\x02\x02\x02\u01C1\u01C2\x07(\x02\x02\u01C2\u01C3\x07(\x02\x02\u01C3" + - "d\x03\x02\x02\x02\u01C4\u01C5\x07~\x02\x02\u01C5\u01C6\x07~\x02\x02\u01C6" + - "f\x03\x02\x02\x02\u01C7\u01C8\x07#\x02\x02\u01C8h\x03\x02\x02\x02\u01C9" + - "\u01CA\x07?\x02\x02\u01CAj\x03\x02\x02\x02\u01CB\u01CC\x07-\x02\x02\u01CC" + - "\u01CD\x07?\x02\x02\u01CDl\x03\x02\x02\x02\u01CE\u01CF\x07/\x02\x02\u01CF" + - "\u01D0\x07?\x02\x02\u01D0n\x03\x02\x02\x02\u01D1\u01D2\x07,\x02\x02\u01D2" + - "\u01D3\x07?\x02\x02\u01D3p\x03\x02\x02\x02\u01D4\u01D5\x071\x02\x02\u01D5" + - "\u01D6\x07?\x02\x02\u01D6r\x03\x02\x02\x02\u01D7\u01D8\x07'\x02\x02\u01D8" + - "\u01D9\x07?\x02\x02\u01D9t\x03\x02\x02\x02\u01DA\u01DB\x07?\x02\x02\u01DB" + - "\u01DC\x07?\x02\x02\u01DCv\x03\x02\x02\x02\u01DD\u01DE\x07#\x02\x02\u01DE" + - "\u01DF\x07?\x02\x02\u01DFx\x03\x02\x02\x02\u01E0\u01E1\x07>\x02\x02\u01E1" + - "z\x03\x02\x02\x02\u01E2\u01E3\x07>\x02\x02\u01E3\u01E4\x07?\x02\x02\u01E4" + - "|\x03\x02\x02\x02\u01E5\u01E6\x07@\x02\x02\u01E6~\x03\x02\x02\x02\u01E7" + - "\u01E8\x07@\x02\x02\u01E8\u01E9\x07?\x02\x02\u01E9\x80\x03\x02\x02\x02" + - "\u01EA\u01EB\x07(\x02\x02\u01EB\x82\x03\x02\x02\x02\u01EC\u01ED\x07~\x02" + - "\x02\u01ED\x84\x03\x02\x02\x02\u01EE\u01EF\x07`\x02\x02\u01EF\x86\x03" + - "\x02\x02\x02\u01F0\u01F1\x07\x80\x02\x02\u01F1\x88\x03\x02\x02\x02\u01F2" + - "\u01F3\x07>\x02\x02\u01F3\u01F4\x07>\x02\x02\u01F4\x8A\x03\x02\x02\x02" + - "\u01F5\u01F6\x07@\x02\x02\u01F6\u01F7\x07@\x02\x02\u01F7\x8C\x03\x02\x02" + - "\x02\u01F8\u01F9\x07@\x02\x02\u01F9\u01FA\x07@\x02\x02\u01FA\u01FB\x07" + - "@\x02\x02\u01FB\x8E\x03\x02\x02\x02\u01FC\u01FD\x070\x02\x02\u01FD\x90" + - "\x03\x02\x02\x02\u01FE\u0203\x05\xAFW\x02\u01FF\u0202\x05\xAFW\x02\u0200" + - "\u0202\x05\xB3Y\x02\u0201\u01FF\x03\x02\x02\x02\u0201\u0200\x03\x02\x02" + - "\x02\u0202\u0205\x03\x02\x02\x02\u0203\u0201\x03\x02\x02\x02\u0203\u0204" + - "\x03\x02\x02\x02\u0204\x92\x03\x02\x02\x02\u0205\u0203\x03\x02\x02\x02" + - "\u0206\u020B\x05\xB5Z\x02\u0207\u020B\x05\xB9\\\x02\u0208\u020B\x05\xBB" + - "]\x02\u0209\u020B\x05\xB7[\x02\u020A\u0206\x03\x02\x02\x02\u020A\u0207" + - "\x03\x02\x02\x02\u020A\u0208\x03\x02\x02\x02\u020A\u0209\x03\x02\x02\x02" + - "\u020B\x94"; + "p\tp\x04q\tq\x04r\tr\x04s\ts\x04t\tt\x04u\tu\x04v\tv\x04w\tw\x03\x02\x03" + + "\x02\x03\x02\x03\x02\x07\x02\xF6\n\x02\f\x02\x0E\x02\xF9\v\x02\x03\x02" + + "\x03\x02\x03\x02\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x03\x03\x03\x03" + + "\x03\x03\x03\x03\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04" + + "\x03\x04\x03\x04\x03\x04\x03\x04\x03\x04\x03\x05\x03\x05\x03\x05\x03\x05" + + "\x03\x05\x03\x05\x03\x06\x03\x06\x03\x06\x03\x06\x03\x07\x03\x07\x03\x07" + + "\x03\b\x03\b\x03\b\x03\b\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03\t\x03" + + "\n\x03\n\x03\n\x03\n\x03\n\x03\v\x03\v\x03\v\x03\v\x03\v\x03\v\x03\v\x03" + + "\v\x03\f\x03\f\x03\f\x03\f\x03\f\x03\f\x03\r\x03\r\x03\r\x03\r\x03\r\x03" + + "\r\x03\r\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x03\x0F\x03" + + "\x0F\x03\x0F\x03\x0F\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\x13\x03\x13\x03\x13\x03" + + "\x13\x03\x13\x03\x14\x03\x14\x03\x14\x03\x14\x03\x15\x03\x15\x03\x15\x03" + + "\x15\x03\x15\x03\x15\x03\x15\x03\x16\x03\x16\x03\x16\x03\x16\x03\x16\x03" + + "\x17\x03\x17\x03\x17\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03" + + "\x19\x03\x19\x03\x19\x03\x19\x03\x19\x03\x19\x03\x19\x03\x19\x03\x19\x03" + + "\x19\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x03\x1B\x03" + + "\x1B\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03" + + "\x1C\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1E\x03" + + "\x1E\x03\x1E\x03\x1F\x03\x1F\x03\x1F\x03\x1F\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&\x03&\x03\'\x03\'\x03(\x03(\x03(\x03(\x03(\x03)\x03)\x03" + + "*\x03*\x03+\x03+\x03,\x03,\x03,\x03-\x03-\x03.\x03.\x03.\x03/\x03/\x03" + + "0\x030\x031\x031\x032\x032\x032\x033\x033\x033\x034\x034\x034\x035\x03" + + "5\x036\x036\x037\x037\x037\x038\x038\x038\x039\x039\x039\x03:\x03:\x03" + + ":\x03;\x03;\x03;\x03<\x03<\x03<\x03=\x03=\x03=\x03>\x03>\x03?\x03?\x03" + + "?\x03@\x03@\x03A\x03A\x03A\x03B\x03B\x03C\x03C\x03D\x03D\x03E\x03E\x03" + + "F\x03F\x03F\x03G\x03G\x03G\x03H\x03H\x03H\x03H\x03I\x03I\x03J\x03J\x03" + + "J\x07J\u0216\nJ\fJ\x0EJ\u0219\vJ\x03K\x03K\x03K\x03K\x05K\u021F\nK\x03" + + "L\x03L\x05L\u0223\nL\x03L\x03L\x03M\x03M\x05M\u0229\nM\x03M\x03M\x03N" + + "\x03N\x03O\x06O\u0230\nO\rO\x0EO\u0231\x03O\x03O\x03P\x03P\x03P\x03P\x03" + + "Q\x03Q\x03Q\x03Q\x03Q\x03Q\x03Q\x03R\x03R\x03R\x03R\x03R\x03R\x03R\x03" + + "S\x03S\x03S\x03S\x03S\x03S\x03T\x03T\x03T\x03T\x03T\x03U\x03U\x03V\x03" + + "V\x03V\x03V\x03V\x03V\x03W\x03W\x03W\x03W\x03W\x03X\x03X\x03Y\x03Y\x03" + + "Z\x03Z\x03[\x03[\x03\\\x06\\\u0269\n\\\r\\\x0E\\\u026A\x03]\x03]\x03]" + + "\x06]\u0270\n]\r]\x0E]\u0271\x03^\x03^\x03^\x06^\u0277\n^\r^\x0E^\u0278" + + "\x03_\x03_\x03_\x06_\u027E\n_\r_\x0E_\u027F\x03`\x03`\x03a\x03a\x03b\x03" + + "b\x03c\x03c\x03d\x03d\x05d\u028C\nd\x03d\x03d\x03d\x05d\u0291\nd\x03e" + + "\x05e\u0294\ne\x03e\x03e\x03e\x03e\x03e\x05e\u029B\ne\x03f\x03f\x05f\u029F" + + "\nf\x03f\x03f\x03g\x06g\u02A4\ng\rg\x0Eg\u02A5\x03h\x03h\x03i\x06i\u02AB" + + "\ni\ri\x0Ei\u02AC\x03j\x03j\x05j\u02B1\nj\x03k\x03k\x03k\x05k\u02B6\n" + + "k\x03l\x03l\x03l\x03m\x03m\x03m\x05m\u02BE\nm\x03m\x05m\u02C1\nm\x03n" + + "\x03n\x03n\x03n\x06n\u02C7\nn\rn\x0En\u02C8\x03o\x06o\u02CC\no\ro\x0E" + + "o\u02CD\x03p\x03p\x05p\u02D2\np\x03q\x06q\u02D5\nq\rq\x0Eq\u02D6\x03r" + + "\x03r\x05r\u02DB\nr\x03s\x06s\u02DE\ns\rs\x0Es\u02DF\x03t\x03t\x05t\u02E4" + + "\nt\x03u\x06u\u02E7\nu\ru\x0Eu\u02E8\x03v\x03v\x05v\u02ED\nv\x03w\x07" + + "w\u02F0\nw\fw\x0Ew\u02F3\vw\x03\xF7\x02\x02x\x05\x02\x04\x07\x02\x05\t" + + "\x02\x06\v\x02\x07\r\x02\b\x0F\x02\t\x11\x02\n\x13\x02\v\x15\x02\f\x17" + + "\x02\r\x19\x02\x0E\x1B\x02\x0F\x1D\x02\x10\x1F\x02\x11!\x02\x12#\x02\x13" + + "%\x02\x14\'\x02\x15)\x02\x16+\x02\x17-\x02\x18/\x02\x191\x02\x1A3\x02" + + "\x1B5\x02\x1C7\x02\x1D9\x02\x1E;\x02\x1F=\x02 ?\x02!A\x02\"C\x02#E\x02" + + "$G\x02%I\x02&K\x02\'M\x02(O\x02)Q\x02*S\x02+U\x02,W\x02-Y\x02.[\x02/]" + + "\x020_\x021a\x022c\x023e\x024g\x025i\x026k\x027m\x028o\x029q\x02:s\x02" + + ";u\x02{\x02?}\x02@\x7F\x02A\x81\x02B\x83\x02C\x85\x02D\x87" + + "\x02E\x89\x02F\x8B\x02G\x8D\x02H\x8F\x02I\x91\x02J\x93\x02K\x95\x02L\x97" + + "\x02M\x99\x02N\x9B\x02O\x9D\x02P\x9F\x02Q\xA1\x02R\xA3\x02S\xA5\x02T\xA7" + + "\x02\x02\xA9\x02U\xAB\x02V\xAD\x02\x02\xAF\x02W\xB1\x02X\xB3\x02\x02\xB5" + + "\x02\x02\xB7\x02\x02\xB9\x02\x02\xBB\x02\x02\xBD\x02\x02\xBF\x02\x02\xC1" + + "\x02\x02\xC3\x02\x02\xC5\x02\x02\xC7\x02\x02\xC9\x02\x02\xCB\x02\x02\xCD" + + "\x02\x02\xCF\x02\x02\xD1\x02\x02\xD3\x02\x02\xD5\x02\x02\xD7\x02\x02\xD9" + + "\x02\x02\xDB\x02\x02\xDD\x02\x02\xDF\x02\x02\xE1\x02\x02\xE3\x02\x02\xE5" + + "\x02\x02\xE7\x02\x02\xE9\x02\x02\xEB\x02\x02\xED\x02\x02\xEF\x02\x02\x05" + + "\x02\x03\x04\x14\x06\x02\v\v\r\x0E\"\"\xA2\xA2\x05\x02\f\f\x0F\x0F\u202A" + + "\u202B\x05\x02C\\aac|\x03\x022;\x04\x02DDdd\x04\x02QQqq\x04\x02ZZzz\x03" + + "\x023;\x03\x0223\x03\x0229\x05\x022;CHch\x04\x02GGgg\x04\x02--//\x06\x02" + + "\f\f\x0F\x0F))^^\x0E\x02$$))AA^^cdhhppttvvxx}}\x7F\x7F\b\x02\f\f\x0F\x0F" + + "))^^}}\x7F\x7F\b\x02\f\f\x0F\x0F$$^^}}\x7F\x7F\x06\x02\f\f\x0F\x0F$$^" + + "^\x02\u02F5\x02\x05\x03\x02\x02\x02\x02\x07\x03\x02\x02\x02\x02\t\x03" + + "\x02\x02\x02\x02\v\x03\x02\x02\x02\x02\r\x03\x02\x02\x02\x02\x0F\x03\x02" + + "\x02\x02\x02\x11\x03\x02\x02\x02\x02\x13\x03\x02\x02\x02\x02\x15\x03\x02" + + "\x02\x02\x02\x17\x03\x02\x02\x02\x02\x19\x03\x02\x02\x02\x02\x1B\x03\x02" + + "\x02\x02\x02\x1D\x03\x02\x02\x02\x02\x1F\x03\x02\x02\x02\x02!\x03\x02" + + "\x02\x02\x02#\x03\x02\x02\x02\x02%\x03\x02\x02\x02\x02\'\x03\x02\x02\x02" + + "\x02)\x03\x02\x02\x02\x02+\x03\x02\x02\x02\x02-\x03\x02\x02\x02\x02/\x03" + + "\x02\x02\x02\x021\x03\x02\x02\x02\x023\x03\x02\x02\x02\x025\x03\x02\x02" + + "\x02\x027\x03\x02\x02\x02\x029\x03\x02\x02\x02\x02;\x03\x02\x02\x02\x02" + + "=\x03\x02\x02\x02\x02?\x03\x02\x02\x02\x02A\x03\x02\x02\x02\x02C\x03\x02" + + "\x02\x02\x02E\x03\x02\x02\x02\x02G\x03\x02\x02\x02\x02I\x03\x02\x02\x02" + + "\x02K\x03\x02\x02\x02\x02M\x03\x02\x02\x02\x02O\x03\x02\x02\x02\x02Q\x03" + + "\x02\x02\x02\x02S\x03\x02\x02\x02\x02U\x03\x02\x02\x02\x02W\x03\x02\x02" + + "\x02\x02Y\x03\x02\x02\x02\x02[\x03\x02\x02\x02\x02]\x03\x02\x02\x02\x02" + + "_\x03\x02\x02\x02\x02a\x03\x02\x02\x02\x02c\x03\x02\x02\x02\x02e\x03\x02" + + "\x02\x02\x02g\x03\x02\x02\x02\x02i\x03\x02\x02\x02\x02k\x03\x02\x02\x02" + + "\x02m\x03\x02\x02\x02\x02o\x03\x02\x02\x02\x02q\x03\x02\x02\x02\x02s\x03" + + "\x02\x02\x02\x02u\x03\x02\x02\x02\x02w\x03\x02\x02\x02\x02y\x03\x02\x02" + + "\x02\x02{\x03\x02\x02\x02\x02}\x03\x02\x02\x02\x02\x7F\x03\x02\x02\x02" + + "\x02\x81\x03\x02\x02\x02\x02\x83\x03\x02\x02\x02\x02\x85\x03\x02\x02\x02" + + "\x02\x87\x03\x02\x02\x02\x02\x89\x03\x02\x02\x02\x02\x8B\x03\x02\x02\x02" + + "\x02\x8D\x03\x02\x02\x02\x02\x8F\x03\x02\x02\x02\x02\x91\x03\x02\x02\x02" + + "\x02\x93\x03\x02\x02\x02\x02\x95\x03\x02\x02\x02\x02\x97\x03\x02\x02\x02" + + "\x02\x99\x03\x02\x02\x02\x02\x9B\x03\x02\x02\x02\x02\x9D\x03\x02\x02\x02" + + "\x02\x9F\x03\x02\x02\x02\x02\xA1\x03\x02\x02\x02\x02\xA3\x03\x02\x02\x02" + + "\x02\xA5\x03\x02\x02\x02\x03\xA7\x03\x02\x02\x02\x03\xA9\x03\x02\x02\x02" + + "\x03\xAB\x03\x02\x02\x02\x04\xAD\x03\x02\x02\x02\x04\xAF\x03\x02\x02\x02" + + "\x04\xB1\x03\x02\x02\x02\x05\xF1\x03\x02\x02\x02\x07\xFF\x03\x02\x02\x02" + + "\t\u0106\x03\x02\x02\x02\v\u0112\x03\x02\x02\x02\r\u0118\x03\x02\x02\x02" + + "\x0F\u011C\x03\x02\x02\x02\x11\u011F\x03\x02\x02\x02\x13\u0123\x03\x02" + + "\x02\x02\x15\u012A\x03\x02\x02\x02\x17\u012F\x03\x02\x02\x02\x19\u0137" + + "\x03\x02\x02\x02\x1B\u013D\x03\x02\x02\x02\x1D\u0146\x03\x02\x02\x02\x1F" + + "\u0149\x03\x02\x02\x02!\u014F\x03\x02\x02\x02#\u0152\x03\x02\x02\x02%" + + "\u0157\x03\x02\x02\x02\'\u015B\x03\x02\x02\x02)\u0160\x03\x02\x02\x02" + + "+\u0164\x03\x02\x02\x02-\u016B\x03\x02\x02\x02/\u0170\x03\x02\x02\x02" + + "1\u0173\x03\x02\x02\x023\u0179\x03\x02\x02\x025\u0183\x03\x02\x02\x02" + + "7\u0188\x03\x02\x02\x029\u018E\x03\x02\x02\x02;\u0195\x03\x02\x02\x02" + + "=\u019A\x03\x02\x02\x02?\u019F\x03\x02\x02\x02A\u01A9\x03\x02\x02\x02" + + "C\u01AB\x03\x02\x02\x02E\u01AD\x03\x02\x02\x02G\u01AF\x03\x02\x02\x02" + + "I\u01B1\x03\x02\x02\x02K\u01B3\x03\x02\x02\x02M\u01B5\x03\x02\x02\x02" + + "O\u01B7\x03\x02\x02\x02Q\u01B9\x03\x02\x02\x02S\u01BE\x03\x02\x02\x02" + + "U\u01C0\x03\x02\x02\x02W\u01C2\x03\x02\x02\x02Y\u01C4\x03\x02\x02\x02" + + "[\u01C7\x03\x02\x02\x02]\u01C9\x03\x02\x02\x02_\u01CC\x03\x02\x02\x02" + + "a\u01CE\x03\x02\x02\x02c\u01D0\x03\x02\x02\x02e\u01D2\x03\x02\x02\x02" + + "g\u01D5\x03\x02\x02\x02i\u01D8\x03\x02\x02\x02k\u01DB\x03\x02\x02\x02" + + "m\u01DD\x03\x02\x02\x02o\u01DF\x03\x02\x02\x02q\u01E2\x03\x02\x02\x02" + + "s\u01E5\x03\x02\x02\x02u\u01E8\x03\x02\x02\x02w\u01EB\x03\x02\x02\x02" + + "y\u01EE\x03\x02\x02\x02{\u01F1\x03\x02\x02\x02}\u01F4\x03\x02\x02\x02" + + "\x7F\u01F6\x03\x02\x02\x02\x81\u01F9\x03\x02\x02\x02\x83\u01FB\x03\x02" + + "\x02\x02\x85\u01FE\x03\x02\x02\x02\x87\u0200\x03\x02\x02\x02\x89\u0202" + + "\x03\x02\x02\x02\x8B\u0204\x03\x02\x02\x02\x8D\u0206\x03\x02\x02\x02\x8F" + + "\u0209\x03\x02\x02\x02\x91\u020C\x03\x02\x02\x02\x93\u0210\x03\x02\x02" + + "\x02\x95\u0212\x03\x02\x02\x02\x97\u021E\x03\x02\x02\x02\x99\u0220\x03" + + "\x02\x02\x02\x9B\u0226\x03\x02\x02\x02\x9D\u022C\x03\x02\x02\x02\x9F\u022F" + + "\x03\x02\x02\x02\xA1\u0235\x03\x02\x02\x02\xA3\u0239\x03\x02\x02\x02\xA5" + + "\u0240\x03\x02\x02\x02\xA7\u0247\x03\x02\x02\x02\xA9\u024D\x03\x02\x02" + + "\x02\xAB\u0252\x03\x02\x02\x02\xAD\u0254\x03\x02\x02\x02\xAF\u025A\x03" + + "\x02\x02\x02\xB1\u025F\x03\x02\x02\x02\xB3\u0261\x03\x02\x02\x02\xB5\u0263" + + "\x03\x02\x02\x02\xB7\u0265\x03\x02\x02\x02\xB9\u0268\x03\x02\x02\x02\xBB" + + "\u026C\x03\x02\x02\x02\xBD\u0273\x03\x02\x02\x02\xBF\u027A\x03\x02\x02" + + "\x02\xC1\u0281\x03\x02\x02\x02\xC3\u0283\x03\x02\x02\x02\xC5\u0285\x03" + + "\x02\x02\x02\xC7\u0287\x03\x02\x02\x02\xC9\u0290\x03\x02\x02\x02\xCB\u029A" + + "\x03\x02\x02\x02\xCD\u029C\x03\x02\x02\x02\xCF\u02A3\x03\x02\x02\x02\xD1" + + "\u02A7\x03\x02\x02\x02\xD3\u02AA\x03\x02\x02\x02\xD5\u02B0\x03\x02\x02" + + "\x02\xD7\u02B5\x03\x02\x02\x02\xD9\u02B7\x03\x02\x02\x02\xDB\u02BA\x03" + + "\x02\x02\x02\xDD\u02C2\x03\x02\x02\x02\xDF\u02CB\x03\x02\x02\x02\xE1\u02D1" + + "\x03\x02\x02\x02\xE3\u02D4\x03\x02\x02\x02\xE5\u02DA\x03\x02\x02\x02\xE7" + + "\u02DD\x03\x02\x02\x02\xE9\u02E3\x03\x02\x02\x02\xEB\u02E6\x03\x02\x02" + + "\x02\xED\u02EC\x03\x02\x02\x02\xEF\u02F1\x03\x02\x02\x02\xF1\xF2\x071" + + "\x02\x02\xF2\xF3\x07,\x02\x02\xF3\xF7\x03\x02\x02\x02\xF4\xF6\v\x02\x02" + + "\x02\xF5\xF4\x03\x02\x02\x02\xF6\xF9\x03\x02\x02\x02\xF7\xF8\x03\x02\x02" + + "\x02\xF7\xF5\x03\x02\x02\x02\xF8\xFA\x03\x02\x02\x02\xF9\xF7\x03\x02\x02" + + "\x02\xFA\xFB\x07,\x02\x02\xFB\xFC\x071\x02\x02\xFC\xFD\x03\x02\x02\x02" + + "\xFD\xFE\b\x02\x02\x02\xFE\x06\x03\x02\x02\x02\xFF\u0100\x071\x02\x02" + + "\u0100\u0101\x071\x02\x02\u0101\u0102\x03\x02\x02\x02\u0102\u0103\x05" + + "\xEFw\x02\u0103\u0104\x03\x02\x02\x02\u0104\u0105\b\x03\x02\x02\u0105" + + "\b\x03\x02\x02\x02\u0106\u0107\x07%\x02\x02\u0107\u0108\x07r\x02\x02\u0108" + + "\u0109\x07t\x02\x02\u0109\u010A\x07c\x02\x02\u010A\u010B\x07i\x02\x02" + + "\u010B\u010C\x07o\x02\x02\u010C\u010D\x07c\x02\x02\u010D\u010E\x03\x02" + + "\x02\x02\u010E\u010F\x05\xEFw\x02\u010F\u0110\x03\x02\x02\x02\u0110\u0111" + + "\b\x04\x03\x02\u0111\n\x03\x02\x02\x02\u0112\u0113\x07e\x02\x02\u0113" + + "\u0114\x07q\x02\x02\u0114\u0115\x07p\x02\x02\u0115\u0116\x07u\x02\x02" + + "\u0116\u0117\x07v\x02\x02\u0117\f\x03\x02\x02\x02\u0118\u0119\x07x\x02" + + "\x02\u0119\u011A\x07c\x02\x02\u011A\u011B\x07t\x02\x02\u011B\x0E\x03\x02" + + "\x02\x02\u011C\u011D\x07c\x02\x02\u011D\u011E\x07u\x02\x02\u011E\x10\x03" + + "\x02\x02\x02\u011F\u0120\x070\x02\x02\u0120\u0121\x070\x02\x02\u0121\u0122" + + "\x070\x02\x02\u0122\x12\x03\x02\x02\x02\u0123\u0124\x07u\x02\x02\u0124" + + "\u0125\x07y\x02\x02\u0125\u0126\x07k\x02\x02\u0126\u0127\x07v\x02\x02" + + "\u0127\u0128\x07e\x02\x02\u0128\u0129\x07j\x02\x02\u0129\x14\x03\x02\x02" + + "\x02\u012A\u012B\x07e\x02\x02\u012B\u012C\x07c\x02\x02\u012C\u012D\x07" + + "u\x02\x02\u012D\u012E\x07g\x02\x02\u012E\x16\x03\x02\x02\x02\u012F\u0130" + + "\x07f\x02\x02\u0130\u0131\x07g\x02\x02\u0131\u0132\x07h\x02\x02\u0132" + + "\u0133\x07c\x02\x02\u0133\u0134\x07w\x02\x02\u0134\u0135\x07n\x02\x02" + + "\u0135\u0136\x07v\x02\x02\u0136\x18\x03\x02\x02\x02\u0137\u0138\x07d\x02" + + "\x02\u0138\u0139\x07t\x02\x02\u0139\u013A\x07g\x02\x02\u013A\u013B\x07" + + "c\x02\x02\u013B\u013C\x07m\x02\x02\u013C\x1A\x03\x02\x02\x02\u013D\u013E" + + "\x07e\x02\x02\u013E\u013F\x07q\x02\x02\u013F\u0140\x07p\x02\x02\u0140" + + "\u0141\x07v\x02\x02\u0141\u0142\x07k\x02\x02\u0142\u0143\x07p\x02\x02" + + "\u0143\u0144\x07w\x02\x02\u0144\u0145\x07g\x02\x02\u0145\x1C\x03\x02\x02" + + "\x02\u0146\u0147\x07f\x02\x02\u0147\u0148\x07q\x02\x02\u0148\x1E\x03\x02" + + "\x02\x02\u0149\u014A\x07y\x02\x02\u014A\u014B\x07j\x02\x02\u014B\u014C" + + "\x07k\x02\x02\u014C\u014D\x07n\x02\x02\u014D\u014E\x07g\x02\x02\u014E" + + " \x03\x02\x02\x02\u014F\u0150\x07k\x02\x02\u0150\u0151\x07h\x02\x02\u0151" + + "\"\x03\x02\x02\x02\u0152\u0153\x07g\x02\x02\u0153\u0154\x07n\x02\x02\u0154" + + "\u0155\x07u\x02\x02\u0155\u0156\x07g\x02\x02\u0156$\x03\x02\x02\x02\u0157" + + "\u0158\x07h\x02\x02\u0158\u0159\x07q\x02\x02\u0159\u015A\x07t\x02\x02" + + "\u015A&\x03\x02\x02\x02\u015B\u015C\x07g\x02\x02\u015C\u015D\x07p\x02" + + "\x02\u015D\u015E\x07w\x02\x02\u015E\u015F\x07o\x02\x02\u015F(\x03\x02" + + "\x02\x02\u0160\u0161\x07f\x02\x02\u0161\u0162\x07g\x02\x02\u0162\u0163" + + "\x07h\x02\x02\u0163*\x03\x02\x02\x02\u0164\u0165\x07t\x02\x02\u0165\u0166" + + "\x07g\x02\x02\u0166\u0167\x07v\x02\x02\u0167\u0168\x07w\x02\x02\u0168" + + "\u0169\x07t\x02\x02\u0169\u016A\x07p\x02\x02\u016A,\x03\x02\x02\x02\u016B" + + "\u016C\x07e\x02\x02\u016C\u016D\x07c\x02\x02\u016D\u016E\x07n\x02\x02" + + "\u016E\u016F\x07n\x02\x02\u016F.\x03\x02\x02\x02\u0170\u0171\x07/\x02" + + "\x02\u0171\u0172\x07@\x02\x02\u01720\x03\x02\x02\x02\u0173\u0174\x07e" + + "\x02\x02\u0174\u0175\x07n\x02\x02\u0175\u0176\x07c\x02\x02\u0176\u0177" + + "\x07u\x02\x02\u0177\u0178\x07u\x02\x02\u01782\x03\x02\x02\x02\u0179\u017A" + + "\x07k\x02\x02\u017A\u017B\x07p\x02\x02\u017B\u017C\x07v\x02\x02\u017C" + + "\u017D\x07g\x02\x02\u017D\u017E\x07t\x02\x02\u017E\u017F\x07h\x02\x02" + + "\u017F\u0180\x07c\x02\x02\u0180\u0181\x07e\x02\x02\u0181\u0182\x07g\x02" + + "\x02\u01824\x03\x02\x02\x02\u0183\u0184\x07v\x02\x02\u0184\u0185\x07t" + + "\x02\x02\u0185\u0186\x07w\x02\x02\u0186\u0187\x07g\x02\x02\u01876\x03" + + "\x02\x02\x02\u0188\u0189\x07h\x02\x02\u0189\u018A\x07c\x02\x02\u018A\u018B" + + "\x07n\x02\x02\u018B\u018C\x07u\x02\x02\u018C\u018D\x07g\x02\x02\u018D" + + "8\x03\x02\x02\x02\u018E\u018F\x07v\x02\x02\u018F\u0190\x07{\x02\x02\u0190" + + "\u0191\x07r\x02\x02\u0191\u0192\x07g\x02\x02\u0192\u0193\x07q\x02\x02" + + "\u0193\u0194\x07h\x02\x02\u0194:\x03\x02\x02\x02\u0195\u0196\x07x\x02" + + "\x02\u0196\u0197\x07q\x02\x02\u0197\u0198\x07k\x02\x02\u0198\u0199\x07" + + "f\x02\x02\u0199<\x03\x02\x02\x02\u019A\u019B\x07p\x02\x02\u019B\u019C" + + "\x07w\x02\x02\u019C\u019D\x07n\x02\x02\u019D\u019E\x07n\x02\x02\u019E" + + ">\x03\x02\x02\x02\u019F\u01A0\x07w\x02\x02\u01A0\u01A1\x07p\x02\x02\u01A1" + + "\u01A2\x07f\x02\x02\u01A2\u01A3\x07g\x02\x02\u01A3\u01A4\x07h\x02\x02" + + "\u01A4\u01A5\x07k\x02\x02\u01A5\u01A6\x07p\x02\x02\u01A6\u01A7\x07g\x02" + + "\x02\u01A7\u01A8\x07f\x02\x02\u01A8@\x03\x02\x02\x02\u01A9\u01AA\x07." + + "\x02\x02\u01AAB\x03\x02\x02\x02\u01AB\u01AC\x07=\x02\x02\u01ACD\x03\x02" + + "\x02\x02\u01AD\u01AE\x07A\x02\x02\u01AEF\x03\x02\x02\x02\u01AF\u01B0\x07" + + "<\x02\x02\u01B0H\x03\x02\x02\x02\u01B1\u01B2\x07*\x02\x02\u01B2J\x03\x02" + + "\x02\x02\u01B3\u01B4\x07+\x02\x02\u01B4L\x03\x02\x02\x02\u01B5\u01B6\x07" + + "]\x02\x02\u01B6N\x03\x02\x02\x02\u01B7\u01B8\x07_\x02\x02\u01B8P\x03\x02" + + "\x02\x02\u01B9\u01BA\x06(\x02\x02\u01BA\u01BB\x07\x7F\x02\x02\u01BB\u01BC" + + "\x03\x02\x02\x02\u01BC\u01BD\b(\x04\x02\u01BDR\x03\x02\x02\x02\u01BE\u01BF" + + "\x07}\x02\x02\u01BFT\x03\x02\x02\x02\u01C0\u01C1\x07\x7F\x02\x02\u01C1" + + "V\x03\x02\x02\x02\u01C2\u01C3\x07-\x02\x02\u01C3X\x03\x02\x02\x02\u01C4" + + "\u01C5\x07-\x02\x02\u01C5\u01C6\x07-\x02\x02\u01C6Z\x03\x02\x02\x02\u01C7" + + "\u01C8\x07/\x02\x02\u01C8\\\x03\x02\x02\x02\u01C9\u01CA\x07/\x02\x02\u01CA" + + "\u01CB\x07/\x02\x02\u01CB^\x03\x02\x02\x02\u01CC\u01CD\x07,\x02\x02\u01CD" + + "`\x03\x02\x02\x02\u01CE\u01CF\x071\x02\x02\u01CFb\x03\x02\x02\x02\u01D0" + + "\u01D1\x07\'\x02\x02\u01D1d\x03\x02\x02\x02\u01D2\u01D3\x07,\x02\x02\u01D3" + + "\u01D4\x07,\x02\x02\u01D4f\x03\x02\x02\x02\u01D5\u01D6\x07(\x02\x02\u01D6" + + "\u01D7\x07(\x02\x02\u01D7h\x03\x02\x02\x02\u01D8\u01D9\x07~\x02\x02\u01D9" + + "\u01DA\x07~\x02\x02\u01DAj\x03\x02\x02\x02\u01DB\u01DC\x07#\x02\x02\u01DC" + + "l\x03\x02\x02\x02\u01DD\u01DE\x07?\x02\x02\u01DEn\x03\x02\x02\x02\u01DF" + + "\u01E0\x07-\x02\x02\u01E0\u01E1\x07?\x02\x02\u01E1p\x03\x02\x02\x02\u01E2" + + "\u01E3\x07/\x02\x02\u01E3\u01E4\x07?\x02\x02\u01E4r\x03\x02\x02\x02\u01E5" + + "\u01E6\x07,\x02\x02\u01E6\u01E7\x07?\x02\x02\u01E7t\x03\x02\x02\x02\u01E8" + + "\u01E9\x071\x02\x02\u01E9\u01EA\x07?\x02\x02\u01EAv\x03\x02\x02\x02\u01EB" + + "\u01EC\x07\'\x02\x02\u01EC\u01ED\x07?\x02\x02\u01EDx\x03\x02\x02\x02\u01EE" + + "\u01EF\x07?\x02\x02\u01EF\u01F0\x07?\x02\x02\u01F0z\x03\x02\x02\x02\u01F1" + + "\u01F2\x07#\x02\x02\u01F2\u01F3\x07?\x02\x02\u01F3|\x03\x02\x02\x02\u01F4" + + "\u01F5\x07>\x02\x02\u01F5~\x03\x02\x02\x02\u01F6\u01F7\x07>\x02\x02\u01F7" + + "\u01F8\x07?\x02\x02\u01F8\x80\x03\x02\x02\x02\u01F9\u01FA\x07@\x02\x02" + + "\u01FA\x82\x03\x02\x02\x02\u01FB\u01FC\x07@\x02\x02\u01FC\u01FD\x07?\x02" + + "\x02\u01FD\x84\x03\x02\x02\x02\u01FE\u01FF\x07(\x02\x02\u01FF\x86\x03" + + "\x02\x02\x02\u0200\u0201\x07~\x02\x02\u0201\x88\x03\x02\x02\x02\u0202" + + "\u0203\x07`\x02\x02\u0203\x8A\x03\x02\x02\x02\u0204\u0205\x07\x80\x02" + + "\x02\u0205\x8C\x03\x02\x02\x02\u0206\u0207\x07>\x02\x02\u0207\u0208\x07" + + ">\x02\x02\u0208\x8E\x03\x02"; private static readonly _serializedATNSegment1: string = - "\x03\x02\x02\x02\u020C\u020E\x07)\x02\x02\u020D\u020F\x05\xE3q\x02\u020E" + - "\u020D\x03\x02\x02\x02\u020E\u020F\x03\x02\x02\x02\u020F\u0210\x03\x02" + - "\x02\x02\u0210\u0211\x07)\x02\x02\u0211\x96\x03\x02\x02\x02\u0212\u0214" + - "\x07$\x02\x02\u0213\u0215\x05\xE7s\x02\u0214\u0213\x03\x02\x02\x02\u0214" + - "\u0215\x03\x02\x02\x02\u0215\u0216\x03\x02\x02\x02\u0216\u0217\x07$\x02" + - "\x02\u0217\x98\x03\x02\x02\x02\u0218\u0219\x05\xC5b\x02\u0219\x9A\x03" + - "\x02\x02\x02\u021A\u021C\t\x02\x02\x02\u021B\u021A\x03\x02\x02\x02\u021C" + - "\u021D\x03\x02\x02\x02\u021D\u021B\x03\x02\x02\x02\u021D\u021E\x03\x02" + - "\x02\x02\u021E\u021F\x03\x02\x02\x02\u021F\u0220\bM\x05\x02\u0220\x9C" + - "\x03\x02\x02\x02\u0221\u0222\t\x03\x02\x02\u0222\u0223\x03\x02\x02\x02" + - "\u0223\u0224\bN\x05\x02\u0224\x9E\x03\x02\x02\x02\u0225\u0226\x07h\x02" + - "\x02\u0226\u0227\x07)\x02\x02\u0227\u0228\x03\x02\x02\x02\u0228\u0229" + - "\bO\x06\x02\u0229\u022A\x03\x02\x02\x02\u022A\u022B\bO\x07\x02\u022B\xA0" + - "\x03\x02\x02\x02\u022C\u022D\x07h\x02\x02\u022D\u022E\x07$\x02\x02\u022E" + - "\u022F\x03\x02\x02\x02\u022F\u0230\bP\b\x02\u0230\u0231\x03\x02\x02\x02" + - "\u0231\u0232\bP\t\x02\u0232\xA2\x03\x02\x02\x02\u0233\u0234\x06Q\x03\x02" + - "\u0234\u0235\x07}\x02\x02\u0235\u0236\x03\x02\x02\x02\u0236\u0237\bQ\n" + - "\x02\u0237\u0238\bQ\v\x02\u0238\xA4\x03\x02\x02\x02\u0239\u023A\x07)\x02" + - "\x02\u023A\u023B\bR\f\x02\u023B\u023C\x03\x02\x02\x02\u023C\u023D\bR\x04" + - "\x02\u023D\xA6\x03\x02\x02\x02\u023E\u023F\x05\xDBm\x02\u023F\xA8\x03" + - "\x02\x02\x02\u0240\u0241\x06T\x04\x02\u0241\u0242\x07}\x02\x02\u0242\u0243" + - "\x03\x02\x02\x02\u0243\u0244\bT\n\x02\u0244\u0245\bT\v\x02\u0245\xAA\x03" + - "\x02\x02\x02\u0246\u0247\x07$\x02\x02\u0247\u0248\bU\r\x02\u0248\u0249" + - "\x03\x02\x02\x02\u0249\u024A\bU\x04\x02\u024A\xAC\x03\x02\x02\x02\u024B" + - "\u024C\x05\xDFo\x02\u024C\xAE\x03\x02\x02\x02\u024D\u024E\x05\xB1X\x02" + - "\u024E\xB0\x03\x02\x02\x02\u024F\u0250\t\x04\x02\x02\u0250\xB2\x03\x02" + - "\x02\x02\u0251\u0252\t\x05\x02\x02\u0252\xB4\x03\x02\x02\x02\u0253\u0255" + - "\x05\xB3Y\x02\u0254\u0253\x03\x02\x02\x02\u0255\u0256\x03\x02\x02\x02" + - "\u0256\u0254\x03\x02\x02\x02\u0256\u0257\x03\x02\x02\x02\u0257\xB6\x03" + - "\x02\x02\x02\u0258\u0259\x072\x02\x02\u0259\u025B\t\x06\x02\x02\u025A" + - "\u025C\x05\xBF_\x02\u025B\u025A\x03\x02\x02\x02\u025C\u025D\x03\x02\x02" + - "\x02\u025D\u025B\x03\x02\x02\x02\u025D\u025E\x03\x02\x02\x02\u025E\xB8" + - "\x03\x02\x02\x02\u025F\u0260\x072\x02\x02\u0260\u0262\t\x07\x02\x02\u0261" + - "\u0263\x05\xC1`\x02\u0262\u0261\x03\x02\x02\x02\u0263\u0264\x03\x02\x02" + - "\x02\u0264\u0262\x03\x02\x02\x02\u0264\u0265\x03\x02\x02\x02\u0265\xBA" + - "\x03\x02\x02\x02\u0266\u0267\x072\x02\x02\u0267\u0269\t\b\x02\x02\u0268" + - "\u026A\x05\xC3a\x02\u0269\u0268\x03\x02\x02\x02\u026A\u026B\x03\x02\x02" + - "\x02\u026B\u0269\x03\x02\x02\x02\u026B\u026C\x03\x02\x02\x02\u026C\xBC" + - "\x03\x02\x02\x02\u026D\u026E\t\t\x02\x02\u026E\xBE\x03\x02\x02\x02\u026F" + - "\u0270\t\n\x02\x02\u0270\xC0\x03\x02\x02\x02\u0271\u0272\t\v\x02\x02\u0272" + - "\xC2\x03\x02\x02\x02\u0273\u0274\t\f\x02\x02\u0274\xC4\x03\x02\x02\x02" + - "\u0275\u0277\x05\xC7c\x02\u0276\u0278\x05\xC9d\x02\u0277\u0276\x03\x02" + - "\x02\x02\u0277\u0278\x03\x02\x02\x02\u0278\u027D\x03\x02\x02\x02\u0279" + - "\u027A\x05\xCBe\x02\u027A\u027B\x05\xC9d\x02\u027B\u027D\x03\x02\x02\x02" + - "\u027C\u0275\x03\x02\x02\x02\u027C\u0279\x03\x02\x02\x02\u027D\xC6\x03" + - "\x02\x02\x02\u027E\u0280\x05\xCBe\x02\u027F\u027E\x03\x02\x02\x02\u027F" + - "\u0280\x03\x02\x02\x02\u0280\u0281\x03\x02\x02\x02\u0281\u0282\x070\x02" + - "\x02\u0282\u0287\x05\xCBe\x02\u0283\u0284\x05\xCBe\x02\u0284\u0285\x07" + - "0\x02\x02\u0285\u0287\x03\x02\x02\x02\u0286\u027F\x03\x02\x02\x02\u0286" + - "\u0283\x03\x02\x02\x02\u0287\xC8\x03\x02\x02\x02\u0288\u028A\t\r\x02\x02" + - "\u0289\u028B\x05\xCDf\x02\u028A\u0289\x03\x02\x02\x02\u028A\u028B\x03" + - "\x02\x02\x02\u028B\u028C\x03\x02\x02\x02\u028C\u028D\x05\xCBe\x02\u028D" + - "\xCA\x03\x02\x02\x02\u028E\u0290\x05\xB3Y\x02\u028F\u028E\x03\x02\x02" + - "\x02\u0290\u0291\x03\x02\x02\x02\u0291\u028F\x03\x02\x02\x02\u0291\u0292" + - "\x03\x02\x02\x02\u0292\xCC\x03\x02\x02\x02\u0293\u0294\t\x0E\x02\x02\u0294" + - "\xCE\x03\x02\x02\x02\u0295\u0297\x05\xD1h\x02\u0296\u0295\x03\x02\x02" + - "\x02\u0297\u0298\x03\x02\x02\x02\u0298\u0296\x03\x02\x02\x02\u0298\u0299" + - "\x03\x02\x02\x02\u0299\xD0\x03\x02\x02\x02\u029A\u029D\n\x0F\x02\x02\u029B" + - "\u029D\x05\xD3i\x02\u029C\u029A\x03\x02\x02\x02\u029C\u029B\x03\x02\x02" + - "\x02\u029D\xD2\x03\x02\x02\x02\u029E\u02A2\x05\xD5j\x02\u029F\u02A2\x05" + - "\xD7k\x02\u02A0\u02A2\x05\xD9l\x02\u02A1\u029E\x03\x02\x02\x02\u02A1\u029F" + - "\x03\x02\x02\x02\u02A1\u02A0\x03\x02\x02\x02\u02A2\xD4\x03\x02\x02\x02" + - "\u02A3\u02A4\x07^\x02\x02\u02A4\u02A5\t\x10\x02\x02\u02A5\xD6\x03\x02" + - "\x02\x02\u02A6\u02A7\x07^\x02\x02\u02A7\u02A9\x05\xC1`\x02\u02A8\u02AA" + - "\x05\xC1`\x02\u02A9\u02A8\x03\x02\x02\x02\u02A9\u02AA\x03\x02\x02\x02" + - "\u02AA\u02AC\x03\x02\x02\x02\u02AB\u02AD\x05\xC1`\x02\u02AC\u02AB\x03" + - "\x02\x02\x02\u02AC\u02AD\x03\x02\x02\x02\u02AD\xD8\x03\x02\x02\x02\u02AE" + - "\u02AF\x07^\x02\x02\u02AF\u02B0\x07z\x02\x02\u02B0\u02B2\x03\x02\x02\x02" + - "\u02B1\u02B3\x05\xC3a\x02\u02B2\u02B1\x03\x02\x02\x02\u02B3\u02B4\x03" + - "\x02\x02\x02\u02B4\u02B2\x03\x02\x02\x02\u02B4\u02B5\x03\x02\x02\x02\u02B5" + - "\xDA\x03\x02\x02\x02\u02B6\u02B8\x05\xDDn\x02\u02B7\u02B6\x03\x02\x02" + - "\x02\u02B8\u02B9\x03\x02\x02\x02\u02B9\u02B7\x03\x02\x02\x02\u02B9\u02BA" + - "\x03\x02\x02\x02\u02BA\xDC\x03\x02\x02\x02\u02BB\u02BE\n\x11\x02\x02\u02BC" + - "\u02BE\x05\xD3i\x02\u02BD\u02BB\x03\x02\x02\x02\u02BD\u02BC\x03\x02\x02" + - "\x02\u02BE\xDE\x03\x02\x02\x02\u02BF\u02C1\x05\xE1p\x02\u02C0\u02BF\x03" + - "\x02\x02\x02\u02C1\u02C2\x03\x02\x02\x02\u02C2\u02C0\x03\x02\x02\x02\u02C2" + - "\u02C3\x03\x02\x02\x02\u02C3\xE0\x03\x02\x02\x02\u02C4\u02C7\n\x12\x02" + - "\x02\u02C5\u02C7\x05\xD3i\x02\u02C6\u02C4\x03\x02\x02\x02\u02C6\u02C5" + - "\x03\x02\x02\x02\u02C7\xE2\x03\x02\x02\x02\u02C8\u02CA\x05\xE5r\x02\u02C9" + - "\u02C8\x03\x02\x02\x02\u02CA\u02CB\x03\x02\x02\x02\u02CB\u02C9\x03\x02" + - "\x02\x02\u02CB\u02CC\x03\x02\x02\x02\u02CC\xE4\x03\x02\x02\x02\u02CD\u02D0" + - "\n\x0F\x02\x02\u02CE\u02D0\x05\xD3i\x02\u02CF\u02CD\x03\x02\x02\x02\u02CF" + - "\u02CE\x03\x02\x02\x02\u02D0\xE6\x03\x02\x02\x02\u02D1\u02D3\x05\xE9t" + - "\x02\u02D2\u02D1\x03\x02\x02\x02\u02D3\u02D4\x03\x02\x02\x02\u02D4\u02D2" + - "\x03\x02\x02\x02\u02D4\u02D5\x03\x02\x02\x02\u02D5\xE8\x03\x02\x02\x02" + - "\u02D6\u02D9\n\x13\x02\x02\u02D7\u02D9\x05\xD3i\x02\u02D8\u02D6\x03\x02" + - "\x02\x02\u02D8\u02D7\x03\x02\x02\x02\u02D9\xEA\x03\x02\x02\x02\u02DA\u02DC" + - "\n\x03\x02\x02\u02DB\u02DA\x03\x02\x02\x02\u02DC\u02DF\x03\x02\x02\x02" + - "\u02DD\u02DB\x03\x02\x02\x02\u02DD\u02DE\x03\x02\x02\x02\u02DE\xEC\x03" + - "\x02\x02\x02\u02DF\u02DD\x03\x02\x02\x02%\x02\x03\x04\xF3\u0201\u0203" + - "\u020A\u020E\u0214\u021D\u0256\u025D\u0264\u026B\u0277\u027C\u027F\u0286" + - "\u028A\u0291\u0298\u029C\u02A1\u02A9\u02AC\u02B4\u02B9\u02BD\u02C2\u02C6" + - "\u02CB\u02CF\u02D4\u02D8\u02DD\x0E\x02\x04\x02\x02\x05\x02\x06\x02\x02" + - "\x02\x03\x02\x03O\x02\x07\x03\x02\x03P\x03\x07\x04\x02\t\x03\x02\x07\x02" + - "\x02\x03R\x04\x03U\x05"; + "\x02\x02\u0209\u020A\x07@\x02\x02\u020A\u020B\x07@\x02\x02\u020B\x90\x03" + + "\x02\x02\x02\u020C\u020D\x07@\x02\x02\u020D\u020E\x07@\x02\x02\u020E\u020F" + + "\x07@\x02\x02\u020F\x92\x03\x02\x02\x02\u0210\u0211\x070\x02\x02\u0211" + + "\x94\x03\x02\x02\x02\u0212\u0217\x05\xB3Y\x02\u0213\u0216\x05\xB3Y\x02" + + "\u0214\u0216\x05\xB7[\x02\u0215\u0213\x03\x02\x02\x02\u0215\u0214\x03" + + "\x02\x02\x02\u0216\u0219\x03\x02\x02\x02\u0217\u0215\x03\x02\x02\x02\u0217" + + "\u0218\x03\x02\x02\x02\u0218\x96\x03\x02\x02\x02\u0219\u0217\x03\x02\x02" + + "\x02\u021A\u021F\x05\xB9\\\x02\u021B\u021F\x05\xBD^\x02\u021C\u021F\x05" + + "\xBF_\x02\u021D\u021F\x05\xBB]\x02\u021E\u021A\x03\x02\x02\x02\u021E\u021B" + + "\x03\x02\x02\x02\u021E\u021C\x03\x02\x02\x02\u021E\u021D\x03\x02\x02\x02" + + "\u021F\x98\x03\x02\x02\x02\u0220\u0222\x07)\x02\x02\u0221\u0223\x05\xE7" + + "s\x02\u0222\u0221\x03\x02\x02\x02\u0222\u0223\x03\x02\x02\x02\u0223\u0224" + + "\x03\x02\x02\x02\u0224\u0225\x07)\x02\x02\u0225\x9A\x03\x02\x02\x02\u0226" + + "\u0228\x07$\x02\x02\u0227\u0229\x05\xEBu\x02\u0228\u0227\x03\x02\x02\x02" + + "\u0228\u0229\x03\x02\x02\x02\u0229\u022A\x03\x02\x02\x02\u022A\u022B\x07" + + "$\x02\x02\u022B\x9C\x03\x02\x02\x02\u022C\u022D\x05\xC9d\x02\u022D\x9E" + + "\x03\x02\x02\x02\u022E\u0230\t\x02\x02\x02\u022F\u022E\x03\x02\x02\x02" + + "\u0230\u0231\x03\x02\x02\x02\u0231\u022F\x03\x02\x02\x02\u0231\u0232\x03" + + "\x02\x02\x02\u0232\u0233\x03\x02\x02\x02\u0233\u0234\bO\x05\x02\u0234" + + "\xA0\x03\x02\x02\x02\u0235\u0236\t\x03\x02\x02\u0236\u0237\x03\x02\x02" + + "\x02\u0237\u0238\bP\x05\x02\u0238\xA2\x03\x02\x02\x02\u0239\u023A\x07" + + "h\x02\x02\u023A\u023B\x07)\x02\x02\u023B\u023C\x03\x02\x02\x02\u023C\u023D" + + "\bQ\x06\x02\u023D\u023E\x03\x02\x02\x02\u023E\u023F\bQ\x07\x02\u023F\xA4" + + "\x03\x02\x02\x02\u0240\u0241\x07h\x02\x02\u0241\u0242\x07$\x02\x02\u0242" + + "\u0243\x03\x02\x02\x02\u0243\u0244\bR\b\x02\u0244\u0245\x03\x02\x02\x02" + + "\u0245\u0246\bR\t\x02\u0246\xA6\x03\x02\x02\x02\u0247\u0248\x06S\x03\x02" + + "\u0248\u0249\x07}\x02\x02\u0249\u024A\x03\x02\x02\x02\u024A\u024B\bS\n" + + "\x02\u024B\u024C\bS\v\x02\u024C\xA8\x03\x02\x02\x02\u024D\u024E\x07)\x02" + + "\x02\u024E\u024F\bT\f\x02\u024F\u0250\x03\x02\x02\x02\u0250\u0251\bT\x04" + + "\x02\u0251\xAA\x03\x02\x02\x02\u0252\u0253\x05\xDFo\x02\u0253\xAC\x03" + + "\x02\x02\x02\u0254\u0255\x06V\x04\x02\u0255\u0256\x07}\x02\x02\u0256\u0257" + + "\x03\x02\x02\x02\u0257\u0258\bV\n\x02\u0258\u0259\bV\v\x02\u0259\xAE\x03" + + "\x02\x02\x02\u025A\u025B\x07$\x02\x02\u025B\u025C\bW\r\x02\u025C\u025D" + + "\x03\x02\x02\x02\u025D\u025E\bW\x04\x02\u025E\xB0\x03\x02\x02\x02\u025F" + + "\u0260\x05\xE3q\x02\u0260\xB2\x03\x02\x02\x02\u0261\u0262\x05\xB5Z\x02" + + "\u0262\xB4\x03\x02\x02\x02\u0263\u0264\t\x04\x02\x02\u0264\xB6\x03\x02" + + "\x02\x02\u0265\u0266\t\x05\x02\x02\u0266\xB8\x03\x02\x02\x02\u0267\u0269" + + "\x05\xB7[\x02\u0268\u0267\x03\x02\x02\x02\u0269\u026A\x03\x02\x02\x02" + + "\u026A\u0268\x03\x02\x02\x02\u026A\u026B\x03\x02\x02\x02\u026B\xBA\x03" + + "\x02\x02\x02\u026C\u026D\x072\x02\x02\u026D\u026F\t\x06\x02\x02\u026E" + + "\u0270\x05\xC3a\x02\u026F\u026E\x03\x02\x02\x02\u0270\u0271\x03\x02\x02" + + "\x02\u0271\u026F\x03\x02\x02\x02\u0271\u0272\x03\x02\x02\x02\u0272\xBC" + + "\x03\x02\x02\x02\u0273\u0274\x072\x02\x02\u0274\u0276\t\x07\x02\x02\u0275" + + "\u0277\x05\xC5b\x02\u0276\u0275\x03\x02\x02\x02\u0277\u0278\x03\x02\x02" + + "\x02\u0278\u0276\x03\x02\x02\x02\u0278\u0279\x03\x02\x02\x02\u0279\xBE" + + "\x03\x02\x02\x02\u027A\u027B\x072\x02\x02\u027B\u027D\t\b\x02\x02\u027C" + + "\u027E\x05\xC7c\x02\u027D\u027C\x03\x02\x02\x02\u027E\u027F\x03\x02\x02" + + "\x02\u027F\u027D\x03\x02\x02\x02\u027F\u0280\x03\x02\x02\x02\u0280\xC0" + + "\x03\x02\x02\x02\u0281\u0282\t\t\x02\x02\u0282\xC2\x03\x02\x02\x02\u0283" + + "\u0284\t\n\x02\x02\u0284\xC4\x03\x02\x02\x02\u0285\u0286\t\v\x02\x02\u0286" + + "\xC6\x03\x02\x02\x02\u0287\u0288\t\f\x02\x02\u0288\xC8\x03\x02\x02\x02" + + "\u0289\u028B\x05\xCBe\x02\u028A\u028C\x05\xCDf\x02\u028B\u028A\x03\x02" + + "\x02\x02\u028B\u028C\x03\x02\x02\x02\u028C\u0291\x03\x02\x02\x02\u028D" + + "\u028E\x05\xCFg\x02\u028E\u028F\x05\xCDf\x02\u028F\u0291\x03\x02\x02\x02" + + "\u0290\u0289\x03\x02\x02\x02\u0290\u028D\x03\x02\x02\x02\u0291\xCA\x03" + + "\x02\x02\x02\u0292\u0294\x05\xCFg\x02\u0293\u0292\x03\x02\x02\x02\u0293" + + "\u0294\x03\x02\x02\x02\u0294\u0295\x03\x02\x02\x02\u0295\u0296\x070\x02" + + "\x02\u0296\u029B\x05\xCFg\x02\u0297\u0298\x05\xCFg\x02\u0298\u0299\x07" + + "0\x02\x02\u0299\u029B\x03\x02\x02\x02\u029A\u0293\x03\x02\x02\x02\u029A" + + "\u0297\x03\x02\x02\x02\u029B\xCC\x03\x02\x02\x02\u029C\u029E\t\r\x02\x02" + + "\u029D\u029F\x05\xD1h\x02\u029E\u029D\x03\x02\x02\x02\u029E\u029F\x03" + + "\x02\x02\x02\u029F\u02A0\x03\x02\x02\x02\u02A0\u02A1\x05\xCFg\x02\u02A1" + + "\xCE\x03\x02\x02\x02\u02A2\u02A4\x05\xB7[\x02\u02A3\u02A2\x03\x02\x02" + + "\x02\u02A4\u02A5\x03\x02\x02\x02\u02A5\u02A3\x03\x02\x02\x02\u02A5\u02A6" + + "\x03\x02\x02\x02\u02A6\xD0\x03\x02\x02\x02\u02A7\u02A8\t\x0E\x02\x02\u02A8" + + "\xD2\x03\x02\x02\x02\u02A9\u02AB\x05\xD5j\x02\u02AA\u02A9\x03\x02\x02" + + "\x02\u02AB\u02AC\x03\x02\x02\x02\u02AC\u02AA\x03\x02\x02\x02\u02AC\u02AD" + + "\x03\x02\x02\x02\u02AD\xD4\x03\x02\x02\x02\u02AE\u02B1\n\x0F\x02\x02\u02AF" + + "\u02B1\x05\xD7k\x02\u02B0\u02AE\x03\x02\x02\x02\u02B0\u02AF\x03\x02\x02" + + "\x02\u02B1\xD6\x03\x02\x02\x02\u02B2\u02B6\x05\xD9l\x02\u02B3\u02B6\x05" + + "\xDBm\x02\u02B4\u02B6\x05\xDDn\x02\u02B5\u02B2\x03\x02\x02\x02\u02B5\u02B3" + + "\x03\x02\x02\x02\u02B5\u02B4\x03\x02\x02\x02\u02B6\xD8\x03\x02\x02\x02" + + "\u02B7\u02B8\x07^\x02\x02\u02B8\u02B9\t\x10\x02\x02\u02B9\xDA\x03\x02" + + "\x02\x02\u02BA\u02BB\x07^\x02\x02\u02BB\u02BD\x05\xC5b\x02\u02BC\u02BE" + + "\x05\xC5b\x02\u02BD\u02BC\x03\x02\x02\x02\u02BD\u02BE\x03\x02\x02\x02" + + "\u02BE\u02C0\x03\x02\x02\x02\u02BF\u02C1\x05\xC5b\x02\u02C0\u02BF\x03" + + "\x02\x02\x02\u02C0\u02C1\x03\x02\x02\x02\u02C1\xDC\x03\x02\x02\x02\u02C2" + + "\u02C3\x07^\x02\x02\u02C3\u02C4\x07z\x02\x02\u02C4\u02C6\x03\x02\x02\x02" + + "\u02C5\u02C7\x05\xC7c\x02\u02C6\u02C5\x03\x02\x02\x02\u02C7\u02C8\x03" + + "\x02\x02\x02\u02C8\u02C6\x03\x02\x02\x02\u02C8\u02C9\x03\x02\x02\x02\u02C9" + + "\xDE\x03\x02\x02\x02\u02CA\u02CC\x05\xE1p\x02\u02CB\u02CA\x03\x02\x02" + + "\x02\u02CC\u02CD\x03\x02\x02\x02\u02CD\u02CB\x03\x02\x02\x02\u02CD\u02CE" + + "\x03\x02\x02\x02\u02CE\xE0\x03\x02\x02\x02\u02CF\u02D2\n\x11\x02\x02\u02D0" + + "\u02D2\x05\xD7k\x02\u02D1\u02CF\x03\x02\x02\x02\u02D1\u02D0\x03\x02\x02" + + "\x02\u02D2\xE2\x03\x02\x02\x02\u02D3\u02D5\x05\xE5r\x02\u02D4\u02D3\x03" + + "\x02\x02\x02\u02D5\u02D6\x03\x02\x02\x02\u02D6\u02D4\x03\x02\x02\x02\u02D6" + + "\u02D7\x03\x02\x02\x02\u02D7\xE4\x03\x02\x02\x02\u02D8\u02DB\n\x12\x02" + + "\x02\u02D9\u02DB\x05\xD7k\x02\u02DA\u02D8\x03\x02\x02\x02\u02DA\u02D9" + + "\x03\x02\x02\x02\u02DB\xE6\x03\x02\x02\x02\u02DC\u02DE\x05\xE9t\x02\u02DD" + + "\u02DC\x03\x02\x02\x02\u02DE\u02DF\x03\x02\x02\x02\u02DF\u02DD\x03\x02" + + "\x02\x02\u02DF\u02E0\x03\x02\x02\x02\u02E0\xE8\x03\x02\x02\x02\u02E1\u02E4" + + "\n\x0F\x02\x02\u02E2\u02E4\x05\xD7k\x02\u02E3\u02E1\x03\x02\x02\x02\u02E3" + + "\u02E2\x03\x02\x02\x02\u02E4\xEA\x03\x02\x02\x02\u02E5\u02E7\x05\xEDv" + + "\x02\u02E6\u02E5\x03\x02\x02\x02\u02E7\u02E8\x03\x02\x02\x02\u02E8\u02E6" + + "\x03\x02\x02\x02\u02E8\u02E9\x03\x02\x02\x02\u02E9\xEC\x03\x02\x02\x02" + + "\u02EA\u02ED\n\x13\x02\x02\u02EB\u02ED\x05\xD7k\x02\u02EC\u02EA\x03\x02" + + "\x02\x02\u02EC\u02EB\x03\x02\x02\x02\u02ED\xEE\x03\x02\x02\x02\u02EE\u02F0" + + "\n\x03\x02\x02\u02EF\u02EE\x03\x02\x02\x02\u02F0\u02F3\x03\x02\x02\x02" + + "\u02F1\u02EF\x03\x02\x02\x02\u02F1\u02F2\x03\x02\x02\x02\u02F2\xF0\x03" + + "\x02\x02\x02\u02F3\u02F1\x03\x02\x02\x02%\x02\x03\x04\xF7\u0215\u0217" + + "\u021E\u0222\u0228\u0231\u026A\u0271\u0278\u027F\u028B\u0290\u0293\u029A" + + "\u029E\u02A5\u02AC\u02B0\u02B5\u02BD\u02C0\u02C8\u02CD\u02D1\u02D6\u02DA" + + "\u02DF\u02E3\u02E8\u02EC\u02F1\x0E\x02\x04\x02\x02\x05\x02\x06\x02\x02" + + "\x02\x03\x02\x03Q\x02\x07\x03\x02\x03R\x03\x07\x04\x02\t\x03\x02\x07\x02" + + "\x02\x03T\x04\x03W\x05"; public static readonly _serializedATN: string = Utils.join( - [KipperLexer._serializedATNSegment0, KipperLexer._serializedATNSegment1], + [ + KipperLexer._serializedATNSegment0, + KipperLexer._serializedATNSegment1, + ], "", ); public static __ATN: ATN; @@ -879,4 +661,6 @@ export class KipperLexer extends KipperLexerBase { return KipperLexer.__ATN; } + } + diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.tokens b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.tokens index 7c4c655e8..4784df64b 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.tokens +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.tokens @@ -1,150 +1,153 @@ FStringExpStart=1 BlockComment=2 LineComment=3 -Pragma=4 -Const=5 -Var=6 -As=7 -Spread=8 -Switch=9 -Case=10 -Default=11 -Break=12 -Continue=13 -Do=14 -While=15 -If=16 -Else=17 -For=18 -Enum=19 -DefFunc=20 -Return=21 -CallFunc=22 -RetIndicator=23 -True=24 -False=25 -Typeof=26 -Void=27 -Null=28 -Undefined=29 -Comma=30 -SemiColon=31 -QuestionMark=32 -Colon=33 -LeftParen=34 -RightParen=35 -LeftBracket=36 -RightBracket=37 -FStringExpEnd=38 -LeftBrace=39 -RightBrace=40 -Plus=41 -PlusPlus=42 -Minus=43 -MinusMinus=44 -Star=45 -Div=46 -Mod=47 -PowerTo=48 -AndAnd=49 -OrOr=50 -Not=51 -Assign=52 -PlusAssign=53 -MinusAssign=54 -StarAssign=55 -DivAssign=56 -ModAssign=57 -Equal=58 -NotEqual=59 -Less=60 -LessEqual=61 -Greater=62 -GreaterEqual=63 -BitwiseAnd=64 -BitwiseOr=65 -BitwiseXor=66 -BitwiseNot=67 -BitwiseZeroFillLeftShift=68 -BitwiseSignedRightShift=69 -BitwiseZeroFillRightShift=70 -Dot=71 -Identifier=72 -IntegerConstant=73 -SingleQuoteStringLiteral=74 -DoubleQuoteStringLiteral=75 -FloatingConstant=76 -Whitespace=77 -Newline=78 -FStringSingleQuoteStart=79 -FStringDoubleQuoteStart=80 -FStringSingleQuoteEnd=81 -FStringSingleQuoteAtom=82 -FStringDoubleQuoteEnd=83 -FStringDoubleQuoteAtom=84 -'const'=5 -'var'=6 -'as'=7 -'...'=8 -'switch'=9 -'case'=10 -'default'=11 -'break'=12 -'continue'=13 -'do'=14 -'while'=15 -'if'=16 -'else'=17 -'for'=18 -'enum'=19 -'def'=20 -'return'=21 -'call'=22 -'->'=23 -'true'=24 -'false'=25 -'typeof'=26 -'void'=27 -'null'=28 -'undefined'=29 -','=30 -';'=31 -'?'=32 -':'=33 -'('=34 -')'=35 -'['=36 -']'=37 -'{'=39 -'}'=40 -'+'=41 -'++'=42 -'-'=43 -'--'=44 -'*'=45 -'/'=46 -'%'=47 -'**'=48 -'&&'=49 -'||'=50 -'!'=51 -'='=52 -'+='=53 -'-='=54 -'*='=55 -'/='=56 -'%='=57 -'=='=58 -'!='=59 -'<'=60 -'<='=61 -'>'=62 -'>='=63 -'&'=64 -'|'=65 -'^'=66 -'~'=67 -'<<'=68 -'>>'=69 -'>>>'=70 -'.'=71 +Const=4 +Var=5 +As=6 +Spread=7 +Switch=8 +Case=9 +Default=10 +Break=11 +Continue=12 +Do=13 +While=14 +If=15 +Else=16 +For=17 +Enum=18 +DefFunc=19 +Return=20 +CallFunc=21 +RetIndicator=22 +Class=23 +Interface=24 +True=25 +False=26 +Typeof=27 +Void=28 +Null=29 +Undefined=30 +Comma=31 +SemiColon=32 +QuestionMark=33 +Colon=34 +LeftParen=35 +RightParen=36 +LeftBracket=37 +RightBracket=38 +FStringExpEnd=39 +LeftBrace=40 +RightBrace=41 +Plus=42 +PlusPlus=43 +Minus=44 +MinusMinus=45 +Star=46 +Div=47 +Mod=48 +PowerTo=49 +AndAnd=50 +OrOr=51 +Not=52 +Assign=53 +PlusAssign=54 +MinusAssign=55 +StarAssign=56 +DivAssign=57 +ModAssign=58 +Equal=59 +NotEqual=60 +Less=61 +LessEqual=62 +Greater=63 +GreaterEqual=64 +BitwiseAnd=65 +BitwiseOr=66 +BitwiseXor=67 +BitwiseNot=68 +BitwiseZeroFillLeftShift=69 +BitwiseSignedRightShift=70 +BitwiseZeroFillRightShift=71 +Dot=72 +Identifier=73 +IntegerConstant=74 +SingleQuoteStringLiteral=75 +DoubleQuoteStringLiteral=76 +FloatingConstant=77 +Whitespace=78 +Newline=79 +FStringSingleQuoteStart=80 +FStringDoubleQuoteStart=81 +FStringSingleQuoteEnd=82 +FStringSingleQuoteAtom=83 +FStringDoubleQuoteEnd=84 +FStringDoubleQuoteAtom=85 +'const'=4 +'var'=5 +'as'=6 +'...'=7 +'switch'=8 +'case'=9 +'default'=10 +'break'=11 +'continue'=12 +'do'=13 +'while'=14 +'if'=15 +'else'=16 +'for'=17 +'enum'=18 +'def'=19 +'return'=20 +'call'=21 +'->'=22 +'class'=23 +'interface'=24 +'true'=25 +'false'=26 +'typeof'=27 +'void'=28 +'null'=29 +'undefined'=30 +','=31 +';'=32 +'?'=33 +':'=34 +'('=35 +')'=36 +'['=37 +']'=38 +'{'=40 +'}'=41 +'+'=42 +'++'=43 +'-'=44 +'--'=45 +'*'=46 +'/'=47 +'%'=48 +'**'=49 +'&&'=50 +'||'=51 +'!'=52 +'='=53 +'+='=54 +'-='=55 +'*='=56 +'/='=57 +'%='=58 +'=='=59 +'!='=60 +'<'=61 +'<='=62 +'>'=63 +'>='=64 +'&'=65 +'|'=66 +'^'=67 +'~'=68 +'<<'=69 +'>>'=70 +'>>>'=71 +'.'=72 diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts index 45aabc2aa..e26588813 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts @@ -1,16 +1,23 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT -// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax -// kind values. -import { ASTKind, KipperParserRuleContext, ParseRuleKindMapping } from ".."; -import KipperParserBase from "./base/KipperParserBase"; + + // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax + // kind values. + import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; + import KipperParserBase from "./base/KipperParserBase"; + import { ATN } from "antlr4ts/atn/ATN"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; import { FailedPredicateException } from "antlr4ts/FailedPredicateException"; +import { NotNull } from "antlr4ts/Decorators"; import { NoViableAltException } from "antlr4ts/NoViableAltException"; +import { Override } from "antlr4ts/Decorators"; +import { Parser } from "antlr4ts/Parser"; import { ParserRuleContext } from "antlr4ts/ParserRuleContext"; import { ParserATNSimulator } from "antlr4ts/atn/ParserATNSimulator"; +import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; +import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; import { RecognitionException } from "antlr4ts/RecognitionException"; import { RuleContext } from "antlr4ts/RuleContext"; //import { RuleVersion } from "antlr4ts/RuleVersion"; @@ -25,6 +32,7 @@ import * as Utils from "antlr4ts/misc/Utils"; import { KipperParserListener } from "./KipperParserListener"; import { KipperParserVisitor } from "./KipperParserVisitor"; + export class KipperParser extends KipperParserBase { public static readonly FStringExpStart = 1; public static readonly BlockComment = 2; @@ -191,254 +199,61 @@ export class KipperParser extends KipperParserBase { public static readonly RULE_typeSpecifierIdentifier = 77; // tslint:disable:no-trailing-whitespace public static readonly ruleNames: string[] = [ - "compilationUnit", - "translationUnit", - "externalItem", - "blockItemList", - "blockItem", - "declaration", - "variableDeclaration", - "storageTypeSpecifier", - "initDeclarator", - "initializer", - "declarator", - "directDeclarator", - "functionDeclaration", - "parameterList", - "parameterDeclaration", - "interfaceDeclaration", - "classDeclaration", - "statement", - "compoundStatement", - "expressionStatement", - "selectionStatement", - "ifStatement", - "switchStatement", - "switchLabeledStatement", - "iterationStatement", - "forLoopIterationStatement", - "whileLoopIterationStatement", - "doWhileLoopIterationStatement", - "jumpStatement", - "returnStatement", - "primaryExpression", - "tangledPrimaryExpression", - "boolPrimaryExpression", - "identifierPrimaryExpression", - "identifier", - "identifierOrStringPrimaryExpression", - "stringPrimaryExpression", - "fStringPrimaryExpression", - "fStringSingleQuoteAtom", - "fStringDoubleQuoteAtom", - "numberPrimaryExpression", - "arrayPrimaryExpression", - "objectPrimaryExpression", - "objectProperty", - "voidOrNullOrUndefinedPrimaryExpression", - "computedPrimaryExpression", - "argumentExpressionList", - "dotNotation", - "bracketNotation", - "sliceNotation", - "postfixExpression", - "incrementOrDecrementPostfixExpression", - "unaryExpression", - "incrementOrDecrementUnaryExpression", - "operatorModifiedUnaryExpression", - "incrementOrDecrementOperator", - "unaryOperator", - "castOrConvertExpression", - "multiplicativeExpression", - "additiveExpression", - "bitwiseShiftExpression", - "bitwiseShiftOperators", - "relationalExpression", - "equalityExpression", - "bitwiseAndExpression", - "bitwiseXorExpression", - "bitwiseOrExpression", - "logicalAndExpression", - "logicalOrExpression", - "conditionalExpression", - "assignmentExpression", - "assignmentOperator", - "expression", - "typeSpecifierExpression", - "identifierTypeSpecifierExpression", - "genericTypeSpecifierExpression", - "typeofTypeSpecifierExpression", - "typeSpecifierIdentifier", + "compilationUnit", "translationUnit", "externalItem", "blockItemList", + "blockItem", "declaration", "variableDeclaration", "storageTypeSpecifier", + "initDeclarator", "initializer", "declarator", "directDeclarator", "functionDeclaration", + "parameterList", "parameterDeclaration", "interfaceDeclaration", "classDeclaration", + "statement", "compoundStatement", "expressionStatement", "selectionStatement", + "ifStatement", "switchStatement", "switchLabeledStatement", "iterationStatement", + "forLoopIterationStatement", "whileLoopIterationStatement", "doWhileLoopIterationStatement", + "jumpStatement", "returnStatement", "primaryExpression", "tangledPrimaryExpression", + "boolPrimaryExpression", "identifierPrimaryExpression", "identifier", + "identifierOrStringPrimaryExpression", "stringPrimaryExpression", "fStringPrimaryExpression", + "fStringSingleQuoteAtom", "fStringDoubleQuoteAtom", "numberPrimaryExpression", + "arrayPrimaryExpression", "objectPrimaryExpression", "objectProperty", + "voidOrNullOrUndefinedPrimaryExpression", "computedPrimaryExpression", + "argumentExpressionList", "dotNotation", "bracketNotation", "sliceNotation", + "postfixExpression", "incrementOrDecrementPostfixExpression", "unaryExpression", + "incrementOrDecrementUnaryExpression", "operatorModifiedUnaryExpression", + "incrementOrDecrementOperator", "unaryOperator", "castOrConvertExpression", + "multiplicativeExpression", "additiveExpression", "bitwiseShiftExpression", + "bitwiseShiftOperators", "relationalExpression", "equalityExpression", + "bitwiseAndExpression", "bitwiseXorExpression", "bitwiseOrExpression", + "logicalAndExpression", "logicalOrExpression", "conditionalExpression", + "assignmentExpression", "assignmentOperator", "expression", "typeSpecifierExpression", + "identifierTypeSpecifierExpression", "genericTypeSpecifierExpression", + "typeofTypeSpecifierExpression", "typeSpecifierIdentifier", ]; private static readonly _LITERAL_NAMES: Array = [ - undefined, - undefined, - undefined, - undefined, - "'const'", - "'var'", - "'as'", - "'...'", - "'switch'", - "'case'", - "'default'", - "'break'", - "'continue'", - "'do'", - "'while'", - "'if'", - "'else'", - "'for'", - "'enum'", - "'def'", - "'return'", - "'call'", - "'->'", - "'class'", - "'interface'", - "'true'", - "'false'", - "'typeof'", - "'void'", - "'null'", - "'undefined'", - "','", - "';'", - "'?'", - "':'", - "'('", - "')'", - "'['", - "']'", - undefined, - "'{'", - "'}'", - "'+'", - "'++'", - "'-'", - "'--'", - "'*'", - "'/'", - "'%'", - "'**'", - "'&&'", - "'||'", - "'!'", - "'='", - "'+='", - "'-='", - "'*='", - "'/='", - "'%='", - "'=='", - "'!='", - "'<'", - "'<='", - "'>'", - "'>='", - "'&'", - "'|'", - "'^'", - "'~'", - "'<<'", - "'>>'", - "'>>>'", - "'.'", + undefined, undefined, undefined, undefined, "'const'", "'var'", "'as'", + "'...'", "'switch'", "'case'", "'default'", "'break'", "'continue'", "'do'", + "'while'", "'if'", "'else'", "'for'", "'enum'", "'def'", "'return'", "'call'", + "'->'", "'class'", "'interface'", "'true'", "'false'", "'typeof'", "'void'", + "'null'", "'undefined'", "','", "';'", "'?'", "':'", "'('", "')'", "'['", + "']'", undefined, "'{'", "'}'", "'+'", "'++'", "'-'", "'--'", "'*'", "'/'", + "'%'", "'**'", "'&&'", "'||'", "'!'", "'='", "'+='", "'-='", "'*='", "'/='", + "'%='", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'&'", "'|'", "'^'", + "'~'", "'<<'", "'>>'", "'>>>'", "'.'", ]; private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, - "FStringExpStart", - "BlockComment", - "LineComment", - "Const", - "Var", - "As", - "Spread", - "Switch", - "Case", - "Default", - "Break", - "Continue", - "Do", - "While", - "If", - "Else", - "For", - "Enum", - "DefFunc", - "Return", - "CallFunc", - "RetIndicator", - "Class", - "Interface", - "True", - "False", - "Typeof", - "Void", - "Null", - "Undefined", - "Comma", - "SemiColon", - "QuestionMark", - "Colon", - "LeftParen", - "RightParen", - "LeftBracket", - "RightBracket", - "FStringExpEnd", - "LeftBrace", - "RightBrace", - "Plus", - "PlusPlus", - "Minus", - "MinusMinus", - "Star", - "Div", - "Mod", - "PowerTo", - "AndAnd", - "OrOr", - "Not", - "Assign", - "PlusAssign", - "MinusAssign", - "StarAssign", - "DivAssign", - "ModAssign", - "Equal", - "NotEqual", - "Less", - "LessEqual", - "Greater", - "GreaterEqual", - "BitwiseAnd", - "BitwiseOr", - "BitwiseXor", - "BitwiseNot", - "BitwiseZeroFillLeftShift", - "BitwiseSignedRightShift", - "BitwiseZeroFillRightShift", - "Dot", - "Identifier", - "IntegerConstant", - "SingleQuoteStringLiteral", - "DoubleQuoteStringLiteral", - "FloatingConstant", - "Whitespace", - "Newline", - "FStringSingleQuoteStart", - "FStringDoubleQuoteStart", - "FStringSingleQuoteEnd", - "FStringSingleQuoteAtom", - "FStringDoubleQuoteEnd", - "FStringDoubleQuoteAtom", + undefined, "FStringExpStart", "BlockComment", "LineComment", "Const", + "Var", "As", "Spread", "Switch", "Case", "Default", "Break", "Continue", + "Do", "While", "If", "Else", "For", "Enum", "DefFunc", "Return", "CallFunc", + "RetIndicator", "Class", "Interface", "True", "False", "Typeof", "Void", + "Null", "Undefined", "Comma", "SemiColon", "QuestionMark", "Colon", "LeftParen", + "RightParen", "LeftBracket", "RightBracket", "FStringExpEnd", "LeftBrace", + "RightBrace", "Plus", "PlusPlus", "Minus", "MinusMinus", "Star", "Div", + "Mod", "PowerTo", "AndAnd", "OrOr", "Not", "Assign", "PlusAssign", "MinusAssign", + "StarAssign", "DivAssign", "ModAssign", "Equal", "NotEqual", "Less", "LessEqual", + "Greater", "GreaterEqual", "BitwiseAnd", "BitwiseOr", "BitwiseXor", "BitwiseNot", + "BitwiseZeroFillLeftShift", "BitwiseSignedRightShift", "BitwiseZeroFillRightShift", + "Dot", "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", "DoubleQuoteStringLiteral", + "FloatingConstant", "Whitespace", "Newline", "FStringSingleQuoteStart", + "FStringDoubleQuoteStart", "FStringSingleQuoteEnd", "FStringSingleQuoteAtom", + "FStringDoubleQuoteEnd", "FStringDoubleQuoteAtom", ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( - KipperParser._LITERAL_NAMES, - KipperParser._SYMBOLIC_NAMES, - [], - ); + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(KipperParser._LITERAL_NAMES, KipperParser._SYMBOLIC_NAMES, []); // @Override // @NotNull @@ -448,19 +263,13 @@ export class KipperParser extends KipperParserBase { // tslint:enable:no-trailing-whitespace // @Override - public get grammarFileName(): string { - return "KipperParser.g4"; - } + public get grammarFileName(): string { return "KipperParser.g4"; } // @Override - public get ruleNames(): string[] { - return KipperParser.ruleNames; - } + public get ruleNames(): string[] { return KipperParser.ruleNames; } // @Override - public get serializedATN(): string { - return KipperParser._serializedATN; - } + public get serializedATN(): string { return KipperParser._serializedATN; } protected createFailedPredicateException(predicate?: string, message?: string): FailedPredicateException { return new FailedPredicateException(this, predicate, message); @@ -477,20 +286,21 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 157; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 0, this._ctx)) { - case 1: - { - this.state = 156; - this.translationUnit(); - } - break; + this.state = 157; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 0, this._ctx) ) { + case 1: + { + this.state = 156; + this.translationUnit(); } - this.state = 159; - this.match(KipperParser.EOF); + break; + } + this.state = 159; + this.match(KipperParser.EOF); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -498,7 +308,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -511,28 +322,29 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 162; - this._errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - this.state = 161; - this.externalItem(); - } - } - break; - default: - throw new NoViableAltException(this); + this.state = 162; + this._errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 161; + this.externalItem(); } - this.state = 164; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx); - } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 164; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -540,7 +352,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -553,10 +366,11 @@ export class KipperParser extends KipperParserBase { _localctx = new ExternalBlockItemContext(_localctx); this.enterOuterAlt(_localctx, 1); { - this.state = 166; - this.blockItemList(); + this.state = 166; + this.blockItemList(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -564,7 +378,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -577,28 +392,29 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 169; - this._errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - this.state = 168; - this.blockItem(); - } - } - break; - default: - throw new NoViableAltException(this); + this.state = 169; + this._errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 168; + this.blockItem(); } - this.state = 171; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); - } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 171; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -606,7 +422,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -618,32 +435,33 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 176; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 3, this._ctx)) { - case 1: - { - this.state = 173; - this.statement(); - } - break; + this.state = 176; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 3, this._ctx) ) { + case 1: + { + this.state = 173; + this.statement(); + } + break; - case 2: - { - this.state = 174; - this.declaration(); - } - break; + case 2: + { + this.state = 174; + this.declaration(); + } + break; - case 3: - { - this.state = 175; - this.match(KipperParser.SemiColon); - } - break; + case 3: + { + this.state = 175; + this.match(KipperParser.SemiColon); } + break; + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -651,7 +469,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -664,41 +483,42 @@ export class KipperParser extends KipperParserBase { this.state = 184; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Const: - case KipperParser.Var: - this.enterOuterAlt(_localctx, 1); - { - this.state = 178; - this.variableDeclaration(); - this.state = 179; - this.match(KipperParser.SemiColon); - } - break; - case KipperParser.DefFunc: - this.enterOuterAlt(_localctx, 2); - { - this.state = 181; - this.functionDeclaration(); - } - break; - case KipperParser.Interface: - this.enterOuterAlt(_localctx, 3); - { - this.state = 182; - this.interfaceDeclaration(); - } - break; - case KipperParser.Class: - this.enterOuterAlt(_localctx, 4); - { - this.state = 183; - this.classDeclaration(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Const: + case KipperParser.Var: + this.enterOuterAlt(_localctx, 1); + { + this.state = 178; + this.variableDeclaration(); + this.state = 179; + this.match(KipperParser.SemiColon); + } + break; + case KipperParser.DefFunc: + this.enterOuterAlt(_localctx, 2); + { + this.state = 181; + this.functionDeclaration(); + } + break; + case KipperParser.Interface: + this.enterOuterAlt(_localctx, 3); + { + this.state = 182; + this.interfaceDeclaration(); + } + break; + case KipperParser.Class: + this.enterOuterAlt(_localctx, 4); + { + this.state = 183; + this.classDeclaration(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -706,7 +526,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -718,12 +539,13 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 186; - this.storageTypeSpecifier(); - this.state = 187; - this.initDeclarator(); + this.state = 186; + this.storageTypeSpecifier(); + this.state = 187; + this.initDeclarator(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -731,7 +553,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -744,20 +567,21 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 189; - _la = this._input.LA(1); - if (!(_la === KipperParser.Const || _la === KipperParser.Var)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 189; + _la = this._input.LA(1); + if (!(_la === KipperParser.Const || _la === KipperParser.Var)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -765,7 +589,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -778,25 +603,27 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 191; - this.declarator(); - this.state = 192; - this.match(KipperParser.Colon); - this.state = 193; - this.typeSpecifierExpression(); - this.state = 196; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Assign) { - { - this.state = 194; - this.match(KipperParser.Assign); - this.state = 195; - this.initializer(); - } + this.state = 191; + this.declarator(); + this.state = 192; + this.match(KipperParser.Colon); + this.state = 193; + this.typeSpecifierExpression(); + this.state = 196; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Assign) { + { + this.state = 194; + this.match(KipperParser.Assign); + this.state = 195; + this.initializer(); } } - } catch (re) { + + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -804,7 +631,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -816,10 +644,11 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 198; - this.assignmentExpression(); + this.state = 198; + this.assignmentExpression(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -827,7 +656,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -839,10 +669,11 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 200; - this.directDeclarator(); + this.state = 200; + this.directDeclarator(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -850,7 +681,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -862,10 +694,11 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 202; - this.match(KipperParser.Identifier); + this.state = 202; + this.match(KipperParser.Identifier); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -873,7 +706,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -886,40 +720,41 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 204; - this.match(KipperParser.DefFunc); - this.state = 205; - this.declarator(); - this.state = 206; - this.match(KipperParser.LeftParen); - this.state = 208; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Identifier) { - { - this.state = 207; - this.parameterList(); - } + this.state = 204; + this.match(KipperParser.DefFunc); + this.state = 205; + this.declarator(); + this.state = 206; + this.match(KipperParser.LeftParen); + this.state = 208; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Identifier) { + { + this.state = 207; + this.parameterList(); } + } - this.state = 210; - this.match(KipperParser.RightParen); - this.state = 211; - this.match(KipperParser.RetIndicator); - this.state = 212; - this.typeSpecifierExpression(); - this.state = 214; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 7, this._ctx)) { - case 1: - { - this.state = 213; - this.compoundStatement(); - } - break; + this.state = 210; + this.match(KipperParser.RightParen); + this.state = 211; + this.match(KipperParser.RetIndicator); + this.state = 212; + this.typeSpecifierExpression(); + this.state = 214; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 7, this._ctx) ) { + case 1: + { + this.state = 213; + this.compoundStatement(); } + break; + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -927,7 +762,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -940,26 +776,27 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 216; + this.state = 216; + this.parameterDeclaration(); + this.state = 221; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.Comma) { + { + { + this.state = 217; + this.match(KipperParser.Comma); + this.state = 218; this.parameterDeclaration(); - this.state = 221; + } + } + this.state = 223; this._errHandler.sync(this); _la = this._input.LA(1); - while (_la === KipperParser.Comma) { - { - { - this.state = 217; - this.match(KipperParser.Comma); - this.state = 218; - this.parameterDeclaration(); - } - } - this.state = 223; - this._errHandler.sync(this); - _la = this._input.LA(1); - } } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -967,7 +804,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -979,14 +817,15 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 224; - this.declarator(); - this.state = 225; - this.match(KipperParser.Colon); - this.state = 226; - this.typeSpecifierExpression(); + this.state = 224; + this.declarator(); + this.state = 225; + this.match(KipperParser.Colon); + this.state = 226; + this.typeSpecifierExpression(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -994,7 +833,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1006,16 +846,17 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 228; - this.match(KipperParser.Interface); - this.state = 229; - this.match(KipperParser.Identifier); - this.state = 230; - this.match(KipperParser.LeftBrace); - this.state = 231; - this.match(KipperParser.RightBrace); - } - } catch (re) { + this.state = 228; + this.match(KipperParser.Interface); + this.state = 229; + this.match(KipperParser.Identifier); + this.state = 230; + this.match(KipperParser.LeftBrace); + this.state = 231; + this.match(KipperParser.RightBrace); + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1023,7 +864,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1035,16 +877,17 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 233; - this.match(KipperParser.Class); - this.state = 234; - this.match(KipperParser.Identifier); - this.state = 235; - this.match(KipperParser.LeftBrace); - this.state = 236; - this.match(KipperParser.RightBrace); - } - } catch (re) { + this.state = 233; + this.match(KipperParser.Class); + this.state = 234; + this.match(KipperParser.Identifier); + this.state = 235; + this.match(KipperParser.LeftBrace); + this.state = 236; + this.match(KipperParser.RightBrace); + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1052,7 +895,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1064,56 +908,57 @@ export class KipperParser extends KipperParserBase { try { this.state = 244; this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 9, this._ctx)) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 238; - this.expressionStatement(); - } - break; + switch ( this.interpreter.adaptivePredict(this._input, 9, this._ctx) ) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 238; + this.expressionStatement(); + } + break; - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 239; - this.selectionStatement(); - } - break; + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 239; + this.selectionStatement(); + } + break; - case 3: - this.enterOuterAlt(_localctx, 3); - { - this.state = 240; - this.iterationStatement(); - } - break; + case 3: + this.enterOuterAlt(_localctx, 3); + { + this.state = 240; + this.iterationStatement(); + } + break; - case 4: - this.enterOuterAlt(_localctx, 4); - { - this.state = 241; - this.jumpStatement(); - } - break; + case 4: + this.enterOuterAlt(_localctx, 4); + { + this.state = 241; + this.jumpStatement(); + } + break; - case 5: - this.enterOuterAlt(_localctx, 5); - { - this.state = 242; - this.returnStatement(); - } - break; + case 5: + this.enterOuterAlt(_localctx, 5); + { + this.state = 242; + this.returnStatement(); + } + break; - case 6: - this.enterOuterAlt(_localctx, 6); - { - this.state = 243; - this.compoundStatement(); - } - break; + case 6: + this.enterOuterAlt(_localctx, 6); + { + this.state = 243; + this.compoundStatement(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1121,7 +966,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1133,26 +979,27 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 246; - if (!this.notInsideExpressionStatement()) { - throw this.createFailedPredicateException("this.notInsideExpressionStatement()"); - } - this.state = 247; - this.match(KipperParser.LeftBrace); - this.state = 249; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 10, this._ctx)) { - case 1: - { - this.state = 248; - this.blockItemList(); - } - break; + this.state = 246; + if (!(this.notInsideExpressionStatement())) { + throw this.createFailedPredicateException("this.notInsideExpressionStatement()"); + } + this.state = 247; + this.match(KipperParser.LeftBrace); + this.state = 249; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 10, this._ctx) ) { + case 1: + { + this.state = 248; + this.blockItemList(); } - this.state = 251; - this.match(KipperParser.RightBrace); + break; + } + this.state = 251; + this.match(KipperParser.RightBrace); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1160,7 +1007,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1172,14 +1020,15 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.enterExpressionStatement(); - this.state = 254; - this.expression(); - this.state = 255; - this.match(KipperParser.SemiColon); - this.exitExpressionStatement(); + this.enterExpressionStatement() + this.state = 254; + this.expression(); + this.state = 255; + this.match(KipperParser.SemiColon); + this.exitExpressionStatement() } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1187,7 +1036,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1200,24 +1050,25 @@ export class KipperParser extends KipperParserBase { this.state = 260; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.If: - this.enterOuterAlt(_localctx, 1); - { - this.state = 258; - this.ifStatement(); - } - break; - case KipperParser.Switch: - this.enterOuterAlt(_localctx, 2); - { - this.state = 259; - this.switchStatement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.If: + this.enterOuterAlt(_localctx, 1); + { + this.state = 258; + this.ifStatement(); + } + break; + case KipperParser.Switch: + this.enterOuterAlt(_localctx, 2); + { + this.state = 259; + this.switchStatement(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1225,7 +1076,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1237,30 +1089,31 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 262; - this.match(KipperParser.If); - this.state = 263; - this.match(KipperParser.LeftParen); - this.state = 264; - this.expression(); - this.state = 265; - this.match(KipperParser.RightParen); - this.state = 266; + this.state = 262; + this.match(KipperParser.If); + this.state = 263; + this.match(KipperParser.LeftParen); + this.state = 264; + this.expression(); + this.state = 265; + this.match(KipperParser.RightParen); + this.state = 266; + this.statement(); + this.state = 269; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 12, this._ctx) ) { + case 1: + { + this.state = 267; + this.match(KipperParser.Else); + this.state = 268; this.statement(); - this.state = 269; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 12, this._ctx)) { - case 1: - { - this.state = 267; - this.match(KipperParser.Else); - this.state = 268; - this.statement(); - } - break; } + break; } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1268,7 +1121,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1281,34 +1135,35 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 271; - this.match(KipperParser.Switch); - this.state = 272; - this.match(KipperParser.LeftParen); - this.state = 273; - this.expression(); - this.state = 274; - this.match(KipperParser.RightParen); - this.state = 275; - this.match(KipperParser.LeftBrace); - this.state = 279; + this.state = 271; + this.match(KipperParser.Switch); + this.state = 272; + this.match(KipperParser.LeftParen); + this.state = 273; + this.expression(); + this.state = 274; + this.match(KipperParser.RightParen); + this.state = 275; + this.match(KipperParser.LeftBrace); + this.state = 279; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.Case || _la === KipperParser.Default) { + { + { + this.state = 276; + this.switchLabeledStatement(); + } + } + this.state = 281; this._errHandler.sync(this); _la = this._input.LA(1); - while (_la === KipperParser.Case || _la === KipperParser.Default) { - { - { - this.state = 276; - this.switchLabeledStatement(); - } - } - this.state = 281; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 282; - this.match(KipperParser.RightBrace); } - } catch (re) { + this.state = 282; + this.match(KipperParser.RightBrace); + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1316,7 +1171,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1329,34 +1185,35 @@ export class KipperParser extends KipperParserBase { this.state = 292; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Case: - this.enterOuterAlt(_localctx, 1); - { - this.state = 284; - this.match(KipperParser.Case); - this.state = 285; - this.expression(); - this.state = 286; - this.match(KipperParser.Colon); - this.state = 287; - this.statement(); - } - break; - case KipperParser.Default: - this.enterOuterAlt(_localctx, 2); - { - this.state = 289; - this.match(KipperParser.Default); - this.state = 290; - this.match(KipperParser.Colon); - this.state = 291; - this.statement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Case: + this.enterOuterAlt(_localctx, 1); + { + this.state = 284; + this.match(KipperParser.Case); + this.state = 285; + this.expression(); + this.state = 286; + this.match(KipperParser.Colon); + this.state = 287; + this.statement(); + } + break; + case KipperParser.Default: + this.enterOuterAlt(_localctx, 2); + { + this.state = 289; + this.match(KipperParser.Default); + this.state = 290; + this.match(KipperParser.Colon); + this.state = 291; + this.statement(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1364,7 +1221,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1377,31 +1235,32 @@ export class KipperParser extends KipperParserBase { this.state = 297; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.For: - this.enterOuterAlt(_localctx, 1); - { - this.state = 294; - this.forLoopIterationStatement(); - } - break; - case KipperParser.While: - this.enterOuterAlt(_localctx, 2); - { - this.state = 295; - this.whileLoopIterationStatement(); - } - break; - case KipperParser.Do: - this.enterOuterAlt(_localctx, 3); - { - this.state = 296; - this.doWhileLoopIterationStatement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.For: + this.enterOuterAlt(_localctx, 1); + { + this.state = 294; + this.forLoopIterationStatement(); + } + break; + case KipperParser.While: + this.enterOuterAlt(_localctx, 2); + { + this.state = 295; + this.whileLoopIterationStatement(); + } + break; + case KipperParser.Do: + this.enterOuterAlt(_localctx, 3); + { + this.state = 296; + this.doWhileLoopIterationStatement(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1409,7 +1268,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1422,183 +1282,92 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 299; - this.match(KipperParser.For); - this.state = 300; - this.match(KipperParser.LeftParen); - this.state = 307; + this.state = 299; + this.match(KipperParser.For); + this.state = 300; + this.match(KipperParser.LeftParen); + this.state = 307; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Const) | (1 << KipperParser.Var) | (1 << KipperParser.CallFunc) | (1 << KipperParser.True) | (1 << KipperParser.False) | (1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0) || ((((_la - 35)) & ~0x1F) === 0 && ((1 << (_la - 35)) & ((1 << (KipperParser.LeftParen - 35)) | (1 << (KipperParser.LeftBracket - 35)) | (1 << (KipperParser.LeftBrace - 35)) | (1 << (KipperParser.Plus - 35)) | (1 << (KipperParser.PlusPlus - 35)) | (1 << (KipperParser.Minus - 35)) | (1 << (KipperParser.MinusMinus - 35)) | (1 << (KipperParser.Not - 35)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 303; this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - ((_la & ~0x1f) === 0 && - ((1 << _la) & - ((1 << KipperParser.Const) | - (1 << KipperParser.Var) | - (1 << KipperParser.CallFunc) | - (1 << KipperParser.True) | - (1 << KipperParser.False) | - (1 << KipperParser.Void) | - (1 << KipperParser.Null) | - (1 << KipperParser.Undefined))) !== - 0) || - (((_la - 35) & ~0x1f) === 0 && - ((1 << (_la - 35)) & - ((1 << (KipperParser.LeftParen - 35)) | - (1 << (KipperParser.LeftBracket - 35)) | - (1 << (KipperParser.LeftBrace - 35)) | - (1 << (KipperParser.Plus - 35)) | - (1 << (KipperParser.PlusPlus - 35)) | - (1 << (KipperParser.Minus - 35)) | - (1 << (KipperParser.MinusMinus - 35)) | - (1 << (KipperParser.Not - 35)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { + switch (this._input.LA(1)) { + case KipperParser.Const: + case KipperParser.Var: { - this.state = 303; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case KipperParser.Const: - case KipperParser.Var: - { - this.state = 301; - this.variableDeclaration(); - } - break; - case KipperParser.CallFunc: - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Plus: - case KipperParser.PlusPlus: - case KipperParser.Minus: - case KipperParser.MinusMinus: - case KipperParser.Not: - case KipperParser.BitwiseNot: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - { - this.state = 302; - this.expression(); - } - break; - default: - throw new NoViableAltException(this); - } - _localctx._forDeclaration = true; + this.state = 301; + this.variableDeclaration(); } - } - - this.state = 309; - this.match(KipperParser.SemiColon); - this.state = 313; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { + break; + case KipperParser.CallFunc: + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Plus: + case KipperParser.PlusPlus: + case KipperParser.Minus: + case KipperParser.MinusMinus: + case KipperParser.Not: + case KipperParser.BitwiseNot: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: { - this.state = 310; - this.expression(); - _localctx._forCondition = true; + this.state = 302; + this.expression(); } + break; + default: + throw new NoViableAltException(this); } + _localctx._forDeclaration = true + } + } - this.state = 315; - this.match(KipperParser.SemiColon); - this.state = 319; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 316; - this.expression(); - _localctx._forIterationExp = true; - } + this.state = 309; + this.match(KipperParser.SemiColon); + this.state = 313; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 310; + this.expression(); + _localctx._forCondition = true + } + } + + this.state = 315; + this.match(KipperParser.SemiColon); + this.state = 319; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 316; + this.expression(); + _localctx._forIterationExp = true } + } - this.state = 321; - this.match(KipperParser.RightParen); - this.state = 322; - this.statement(); + this.state = 321; + this.match(KipperParser.RightParen); + this.state = 322; + this.statement(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1606,7 +1375,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1618,18 +1388,19 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 324; - this.match(KipperParser.While); - this.state = 325; - this.match(KipperParser.LeftParen); - this.state = 326; - this.expression(); - this.state = 327; - this.match(KipperParser.RightParen); - this.state = 328; - this.statement(); - } - } catch (re) { + this.state = 324; + this.match(KipperParser.While); + this.state = 325; + this.match(KipperParser.LeftParen); + this.state = 326; + this.expression(); + this.state = 327; + this.match(KipperParser.RightParen); + this.state = 328; + this.statement(); + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1637,37 +1408,36 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public doWhileLoopIterationStatement(): DoWhileLoopIterationStatementContext { - let _localctx: DoWhileLoopIterationStatementContext = new DoWhileLoopIterationStatementContext( - this._ctx, - this.state, - ); + let _localctx: DoWhileLoopIterationStatementContext = new DoWhileLoopIterationStatementContext(this._ctx, this.state); this.enterRule(_localctx, 54, KipperParser.RULE_doWhileLoopIterationStatement); try { this.enterOuterAlt(_localctx, 1); { - this.state = 330; - this.match(KipperParser.Do); - this.state = 331; - this.statement(); - this.state = 332; - this.match(KipperParser.While); - this.state = 333; - this.match(KipperParser.LeftParen); - this.state = 334; - this.expression(); - this.state = 335; - this.match(KipperParser.RightParen); - this.state = 336; - this.match(KipperParser.SemiColon); - } - } catch (re) { + this.state = 330; + this.match(KipperParser.Do); + this.state = 331; + this.statement(); + this.state = 332; + this.match(KipperParser.While); + this.state = 333; + this.match(KipperParser.LeftParen); + this.state = 334; + this.expression(); + this.state = 335; + this.match(KipperParser.RightParen); + this.state = 336; + this.match(KipperParser.SemiColon); + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1675,7 +1445,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1688,22 +1459,23 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 338; - _la = this._input.LA(1); - if (!(_la === KipperParser.Break || _la === KipperParser.Continue)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 338; + _la = this._input.LA(1); + if (!(_la === KipperParser.Break || _la === KipperParser.Continue)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } - this.state = 339; - this.match(KipperParser.SemiColon); + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 339; + this.match(KipperParser.SemiColon); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1711,7 +1483,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1724,51 +1497,23 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 341; - this.match(KipperParser.Return); - this.state = 343; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 342; - this.expression(); - } + this.state = 341; + this.match(KipperParser.Return); + this.state = 343; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 342; + this.expression(); } + } - this.state = 345; - this.match(KipperParser.SemiColon); + this.state = 345; + this.match(KipperParser.SemiColon); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1776,7 +1521,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1789,79 +1535,80 @@ export class KipperParser extends KipperParserBase { this.state = 356; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.LeftParen: - this.enterOuterAlt(_localctx, 1); - { - this.state = 347; - this.tangledPrimaryExpression(); - } - break; - case KipperParser.LeftBracket: - this.enterOuterAlt(_localctx, 2); - { - this.state = 348; - this.arrayPrimaryExpression(); - } - break; - case KipperParser.LeftBrace: - this.enterOuterAlt(_localctx, 3); - { - this.state = 349; - this.objectPrimaryExpression(); - } - break; - case KipperParser.True: - case KipperParser.False: - this.enterOuterAlt(_localctx, 4); - { - this.state = 350; - this.boolPrimaryExpression(); - } - break; - case KipperParser.Identifier: - this.enterOuterAlt(_localctx, 5); - { - this.state = 351; - this.identifierPrimaryExpression(); - } - break; - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - this.enterOuterAlt(_localctx, 6); - { - this.state = 352; - this.stringPrimaryExpression(); - } - break; - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 7); - { - this.state = 353; - this.fStringPrimaryExpression(); - } - break; - case KipperParser.IntegerConstant: - case KipperParser.FloatingConstant: - this.enterOuterAlt(_localctx, 8); - { - this.state = 354; - this.numberPrimaryExpression(); - } - break; - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - this.enterOuterAlt(_localctx, 9); - { - this.state = 355; - this.voidOrNullOrUndefinedPrimaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.LeftParen: + this.enterOuterAlt(_localctx, 1); + { + this.state = 347; + this.tangledPrimaryExpression(); + } + break; + case KipperParser.LeftBracket: + this.enterOuterAlt(_localctx, 2); + { + this.state = 348; + this.arrayPrimaryExpression(); + } + break; + case KipperParser.LeftBrace: + this.enterOuterAlt(_localctx, 3); + { + this.state = 349; + this.objectPrimaryExpression(); + } + break; + case KipperParser.True: + case KipperParser.False: + this.enterOuterAlt(_localctx, 4); + { + this.state = 350; + this.boolPrimaryExpression(); + } + break; + case KipperParser.Identifier: + this.enterOuterAlt(_localctx, 5); + { + this.state = 351; + this.identifierPrimaryExpression(); + } + break; + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + this.enterOuterAlt(_localctx, 6); + { + this.state = 352; + this.stringPrimaryExpression(); + } + break; + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 7); + { + this.state = 353; + this.fStringPrimaryExpression(); + } + break; + case KipperParser.IntegerConstant: + case KipperParser.FloatingConstant: + this.enterOuterAlt(_localctx, 8); + { + this.state = 354; + this.numberPrimaryExpression(); + } + break; + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + this.enterOuterAlt(_localctx, 9); + { + this.state = 355; + this.voidOrNullOrUndefinedPrimaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1869,7 +1616,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1881,14 +1629,15 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 358; - this.match(KipperParser.LeftParen); - this.state = 359; - this.expression(); - this.state = 360; - this.match(KipperParser.RightParen); + this.state = 358; + this.match(KipperParser.LeftParen); + this.state = 359; + this.expression(); + this.state = 360; + this.match(KipperParser.RightParen); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1896,7 +1645,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1909,20 +1659,21 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 362; - _la = this._input.LA(1); - if (!(_la === KipperParser.True || _la === KipperParser.False)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 362; + _la = this._input.LA(1); + if (!(_la === KipperParser.True || _la === KipperParser.False)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1930,7 +1681,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1942,10 +1694,11 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 364; - this.identifier(); + this.state = 364; + this.identifier(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1953,7 +1706,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -1965,10 +1719,11 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 366; - this.match(KipperParser.Identifier); + this.state = 366; + this.match(KipperParser.Identifier); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1976,41 +1731,40 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public identifierOrStringPrimaryExpression(): IdentifierOrStringPrimaryExpressionContext { - let _localctx: IdentifierOrStringPrimaryExpressionContext = new IdentifierOrStringPrimaryExpressionContext( - this._ctx, - this.state, - ); + let _localctx: IdentifierOrStringPrimaryExpressionContext = new IdentifierOrStringPrimaryExpressionContext(this._ctx, this.state); this.enterRule(_localctx, 70, KipperParser.RULE_identifierOrStringPrimaryExpression); try { this.state = 370; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Identifier: - this.enterOuterAlt(_localctx, 1); - { - this.state = 368; - this.identifier(); - } - break; - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - this.enterOuterAlt(_localctx, 2); - { - this.state = 369; - this.stringPrimaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Identifier: + this.enterOuterAlt(_localctx, 1); + { + this.state = 368; + this.identifier(); + } + break; + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + this.enterOuterAlt(_localctx, 2); + { + this.state = 369; + this.stringPrimaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2018,7 +1772,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2031,20 +1786,21 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 372; - _la = this._input.LA(1); - if (!(_la === KipperParser.SingleQuoteStringLiteral || _la === KipperParser.DoubleQuoteStringLiteral)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 372; + _la = this._input.LA(1); + if (!(_la === KipperParser.SingleQuoteStringLiteral || _la === KipperParser.DoubleQuoteStringLiteral)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2052,7 +1808,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2066,56 +1823,57 @@ export class KipperParser extends KipperParserBase { this.state = 390; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringSingleQuoteStart: - this.enterOuterAlt(_localctx, 1); + case KipperParser.FStringSingleQuoteStart: + this.enterOuterAlt(_localctx, 1); + { + this.state = 374; + this.match(KipperParser.FStringSingleQuoteStart); + this.state = 378; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringSingleQuoteAtom) { { - this.state = 374; - this.match(KipperParser.FStringSingleQuoteStart); - this.state = 378; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringSingleQuoteAtom) { - { - { - this.state = 375; - this.fStringSingleQuoteAtom(); - } - } - this.state = 380; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 381; - this.match(KipperParser.FStringSingleQuoteEnd); + { + this.state = 375; + this.fStringSingleQuoteAtom(); } - break; - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 2); + } + this.state = 380; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 381; + this.match(KipperParser.FStringSingleQuoteEnd); + } + break; + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 2); + { + this.state = 382; + this.match(KipperParser.FStringDoubleQuoteStart); + this.state = 386; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringDoubleQuoteAtom) { { - this.state = 382; - this.match(KipperParser.FStringDoubleQuoteStart); - this.state = 386; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringDoubleQuoteAtom) { - { - { - this.state = 383; - this.fStringDoubleQuoteAtom(); - } - } - this.state = 388; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 389; - this.match(KipperParser.FStringDoubleQuoteEnd); + { + this.state = 383; + this.fStringDoubleQuoteAtom(); } - break; - default: - throw new NoViableAltException(this); + } + this.state = 388; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 389; + this.match(KipperParser.FStringDoubleQuoteEnd); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2123,7 +1881,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2137,65 +1896,37 @@ export class KipperParser extends KipperParserBase { this.state = 398; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringSingleQuoteAtom: - this.enterOuterAlt(_localctx, 1); + case KipperParser.FStringSingleQuoteAtom: + this.enterOuterAlt(_localctx, 1); + { + this.state = 392; + this.match(KipperParser.FStringSingleQuoteAtom); + } + break; + case KipperParser.FStringExpStart: + this.enterOuterAlt(_localctx, 2); + { + this.state = 393; + this.match(KipperParser.FStringExpStart); + this.state = 395; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { { - this.state = 392; - this.match(KipperParser.FStringSingleQuoteAtom); + this.state = 394; + this.expression(); } - break; - case KipperParser.FStringExpStart: - this.enterOuterAlt(_localctx, 2); - { - this.state = 393; - this.match(KipperParser.FStringExpStart); - this.state = 395; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 394; - this.expression(); - } - } + } - this.state = 397; - this.match(KipperParser.FStringExpEnd); - } - break; - default: - throw new NoViableAltException(this); + this.state = 397; + this.match(KipperParser.FStringExpEnd); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2203,7 +1934,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2217,65 +1949,37 @@ export class KipperParser extends KipperParserBase { this.state = 406; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringDoubleQuoteAtom: - this.enterOuterAlt(_localctx, 1); + case KipperParser.FStringDoubleQuoteAtom: + this.enterOuterAlt(_localctx, 1); + { + this.state = 400; + this.match(KipperParser.FStringDoubleQuoteAtom); + } + break; + case KipperParser.FStringExpStart: + this.enterOuterAlt(_localctx, 2); + { + this.state = 401; + this.match(KipperParser.FStringExpStart); + this.state = 403; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { { - this.state = 400; - this.match(KipperParser.FStringDoubleQuoteAtom); + this.state = 402; + this.expression(); } - break; - case KipperParser.FStringExpStart: - this.enterOuterAlt(_localctx, 2); - { - this.state = 401; - this.match(KipperParser.FStringExpStart); - this.state = 403; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 402; - this.expression(); - } - } + } - this.state = 405; - this.match(KipperParser.FStringExpEnd); - } - break; - default: - throw new NoViableAltException(this); + this.state = 405; + this.match(KipperParser.FStringExpEnd); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2283,7 +1987,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2296,20 +2001,21 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 408; - _la = this._input.LA(1); - if (!(_la === KipperParser.IntegerConstant || _la === KipperParser.FloatingConstant)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 408; + _la = this._input.LA(1); + if (!(_la === KipperParser.IntegerConstant || _la === KipperParser.FloatingConstant)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2317,7 +2023,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2331,79 +2038,51 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 410; - this.match(KipperParser.LeftBracket); - this.state = 419; + this.state = 410; + this.match(KipperParser.LeftBracket); + this.state = 419; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 411; + this.expression(); + this.state = 416; this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 411; + _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 412; + this.match(KipperParser.Comma); + this.state = 413; this.expression(); - this.state = 416; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 412; - this.match(KipperParser.Comma); - this.state = 413; - this.expression(); - } - } - } - this.state = 418; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); + } } } + this.state = 418; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); } + } + } - this.state = 422; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Comma) { - { - this.state = 421; - this.match(KipperParser.Comma); - } + this.state = 422; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Comma) { + { + this.state = 421; + this.match(KipperParser.Comma); } + } - this.state = 424; - this.match(KipperParser.RightBracket); + this.state = 424; + this.match(KipperParser.RightBracket); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2411,7 +2090,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2425,57 +2105,51 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 426; - this.match(KipperParser.LeftBrace); - this.state = 435; + this.state = 426; + this.match(KipperParser.LeftBrace); + this.state = 435; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 73)) & ~0x1F) === 0 && ((1 << (_la - 73)) & ((1 << (KipperParser.Identifier - 73)) | (1 << (KipperParser.SingleQuoteStringLiteral - 73)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 73)))) !== 0)) { + { + this.state = 427; + this.objectProperty(); + this.state = 432; this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - ((_la - 73) & ~0x1f) === 0 && - ((1 << (_la - 73)) & - ((1 << (KipperParser.Identifier - 73)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 73)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 73)))) !== - 0 - ) { - { - this.state = 427; + _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 428; + this.match(KipperParser.Comma); + this.state = 429; this.objectProperty(); - this.state = 432; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 428; - this.match(KipperParser.Comma); - this.state = 429; - this.objectProperty(); - } - } - } - this.state = 434; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); + } } } + this.state = 434; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); + } } + } - this.state = 438; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Comma) { - { - this.state = 437; - this.match(KipperParser.Comma); - } + this.state = 438; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Comma) { + { + this.state = 437; + this.match(KipperParser.Comma); } + } - this.state = 440; - this.match(KipperParser.RightBrace); + this.state = 440; + this.match(KipperParser.RightBrace); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2483,7 +2157,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2495,14 +2170,15 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 442; - this.identifierOrStringPrimaryExpression(); - this.state = 443; - this.match(KipperParser.Colon); - this.state = 444; - this.expression(); + this.state = 442; + this.identifierOrStringPrimaryExpression(); + this.state = 443; + this.match(KipperParser.Colon); + this.state = 444; + this.expression(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2510,41 +2186,35 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public voidOrNullOrUndefinedPrimaryExpression(): VoidOrNullOrUndefinedPrimaryExpressionContext { - let _localctx: VoidOrNullOrUndefinedPrimaryExpressionContext = new VoidOrNullOrUndefinedPrimaryExpressionContext( - this._ctx, - this.state, - ); + let _localctx: VoidOrNullOrUndefinedPrimaryExpressionContext = new VoidOrNullOrUndefinedPrimaryExpressionContext(this._ctx, this.state); this.enterRule(_localctx, 88, KipperParser.RULE_voidOrNullOrUndefinedPrimaryExpression); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 446; - _la = this._input.LA(1); - if ( - !( - (_la & ~0x1f) === 0 && - ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 446; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2552,7 +2222,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2577,218 +2248,153 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 459; + this.state = 459; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + { + _localctx = new PassOncomputedPrimaryExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 449; + this.primaryExpression(); + } + break; + case KipperParser.CallFunc: + { + _localctx = new ExplicitCallFunctionCallExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 450; + this.match(KipperParser.CallFunc); + this.state = 451; + this.computedPrimaryExpression(0); + this.state = 452; + this.match(KipperParser.LeftParen); + this.state = 454; this._errHandler.sync(this); - switch (this._input.LA(1)) { - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 453; + this.argumentExpressionList(); + } + } + + this.state = 456; + this.match(KipperParser.RightParen); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression + } + break; + default: + throw new NoViableAltException(this); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 482; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + this.state = 480; + this._errHandler.sync(this); + switch ( this.interpreter.adaptivePredict(this._input, 39, this._ctx) ) { + case 1: { - _localctx = new PassOncomputedPrimaryExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + _localctx = new FunctionCallExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 461; + if (!(this.precpred(this._ctx, 5))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 5)"); + } + this.state = 462; + this.match(KipperParser.LeftParen); + this.state = 464; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 463; + this.argumentExpressionList(); + } + } - this.state = 449; - this.primaryExpression(); + this.state = 466; + this.match(KipperParser.RightParen); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression } break; - case KipperParser.CallFunc: - { - _localctx = new ExplicitCallFunctionCallExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 450; - this.match(KipperParser.CallFunc); - this.state = 451; - this.computedPrimaryExpression(0); - this.state = 452; - this.match(KipperParser.LeftParen); - this.state = 454; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 453; - this.argumentExpressionList(); - } - } - this.state = 456; - this.match(KipperParser.RightParen); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression; + case 2: + { + _localctx = new DotNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 468; + if (!(this.precpred(this._ctx, 3))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 3)"); + } + this.state = 469; + this.dotNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression } break; - default: - throw new NoViableAltException(this); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 482; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); + + case 3: + { + _localctx = new BracketNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 472; + if (!(this.precpred(this._ctx, 2))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 2)"); } - _prevctx = _localctx; + this.state = 473; + this.bracketNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression + } + break; + + case 4: { - this.state = 480; - this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 39, this._ctx)) { - case 1: - { - _localctx = new FunctionCallExpressionContext( - new ComputedPrimaryExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 461; - if (!this.precpred(this._ctx, 5)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 5)"); - } - this.state = 462; - this.match(KipperParser.LeftParen); - this.state = 464; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 463; - this.argumentExpressionList(); - } - } - - this.state = 466; - this.match(KipperParser.RightParen); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression; - } - break; - - case 2: - { - _localctx = new DotNotationMemberAccessExpressionContext( - new ComputedPrimaryExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 468; - if (!this.precpred(this._ctx, 3)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 3)"); - } - this.state = 469; - this.dotNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; - } - break; - - case 3: - { - _localctx = new BracketNotationMemberAccessExpressionContext( - new ComputedPrimaryExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 472; - if (!this.precpred(this._ctx, 2)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 2)"); - } - this.state = 473; - this.bracketNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; - } - break; - - case 4: - { - _localctx = new SliceNotationMemberAccessExpressionContext( - new ComputedPrimaryExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 476; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 477; - this.sliceNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; - } - break; - } + _localctx = new SliceNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 476; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); } + this.state = 477; + this.sliceNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression + } + break; + } } - this.state = 484; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); } + this.state = 484; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2796,7 +2402,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -2809,26 +2416,27 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 485; + this.state = 485; + this.assignmentExpression(); + this.state = 490; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.Comma) { + { + { + this.state = 486; + this.match(KipperParser.Comma); + this.state = 487; this.assignmentExpression(); - this.state = 490; + } + } + this.state = 492; this._errHandler.sync(this); _la = this._input.LA(1); - while (_la === KipperParser.Comma) { - { - { - this.state = 486; - this.match(KipperParser.Comma); - this.state = 487; - this.assignmentExpression(); - } - } - this.state = 492; - this._errHandler.sync(this); - _la = this._input.LA(1); - } } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2836,7 +2444,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2848,12 +2457,13 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 493; - this.match(KipperParser.Dot); - this.state = 494; - this.identifier(); + this.state = 493; + this.match(KipperParser.Dot); + this.state = 494; + this.identifier(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2861,7 +2471,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2873,14 +2484,15 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 496; - this.match(KipperParser.LeftBracket); - this.state = 497; - this.expression(); - this.state = 498; - this.match(KipperParser.RightBracket); + this.state = 496; + this.match(KipperParser.LeftBracket); + this.state = 497; + this.expression(); + this.state = 498; + this.match(KipperParser.RightBracket); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2888,7 +2500,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -2901,94 +2514,37 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 500; - this.match(KipperParser.LeftBracket); - this.state = 504; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 501; - this.expression(); - _localctx.sliceStart = true; - } + this.state = 500; + this.match(KipperParser.LeftBracket); + this.state = 504; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 501; + this.expression(); + _localctx.sliceStart = true } + } - this.state = 506; - this.match(KipperParser.Colon); - this.state = 510; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== - 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== - 0) - ) { - { - this.state = 507; - this.expression(); - _localctx.sliceEnd = true; - } + this.state = 506; + this.match(KipperParser.Colon); + this.state = 510; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + { + this.state = 507; + this.expression(); + _localctx.sliceEnd = true } + } - this.state = 512; - this.match(KipperParser.RightBracket); + this.state = 512; + this.match(KipperParser.RightBracket); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2996,7 +2552,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3008,24 +2565,25 @@ export class KipperParser extends KipperParserBase { try { this.state = 516; this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 44, this._ctx)) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 514; - this.computedPrimaryExpression(0); - } - break; - - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 515; - this.incrementOrDecrementPostfixExpression(); - } - break; + switch ( this.interpreter.adaptivePredict(this._input, 44, this._ctx) ) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 514; + this.computedPrimaryExpression(0); + } + break; + + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 515; + this.incrementOrDecrementPostfixExpression(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3033,27 +2591,26 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public incrementOrDecrementPostfixExpression(): IncrementOrDecrementPostfixExpressionContext { - let _localctx: IncrementOrDecrementPostfixExpressionContext = new IncrementOrDecrementPostfixExpressionContext( - this._ctx, - this.state, - ); + let _localctx: IncrementOrDecrementPostfixExpressionContext = new IncrementOrDecrementPostfixExpressionContext(this._ctx, this.state); this.enterRule(_localctx, 102, KipperParser.RULE_incrementOrDecrementPostfixExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 518; - this.computedPrimaryExpression(0); - this.state = 519; - this.incrementOrDecrementOperator(); + this.state = 518; + this.computedPrimaryExpression(0); + this.state = 519; + this.incrementOrDecrementOperator(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3061,7 +2618,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3074,50 +2632,51 @@ export class KipperParser extends KipperParserBase { this.state = 524; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.CallFunc: - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 1); - { - this.state = 521; - this.postfixExpression(); - } - break; - case KipperParser.PlusPlus: - case KipperParser.MinusMinus: - this.enterOuterAlt(_localctx, 2); - { - this.state = 522; - this.incrementOrDecrementUnaryExpression(); - } - break; - case KipperParser.Plus: - case KipperParser.Minus: - case KipperParser.Not: - case KipperParser.BitwiseNot: - this.enterOuterAlt(_localctx, 3); - { - this.state = 523; - this.operatorModifiedUnaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.CallFunc: + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 1); + { + this.state = 521; + this.postfixExpression(); + } + break; + case KipperParser.PlusPlus: + case KipperParser.MinusMinus: + this.enterOuterAlt(_localctx, 2); + { + this.state = 522; + this.incrementOrDecrementUnaryExpression(); + } + break; + case KipperParser.Plus: + case KipperParser.Minus: + case KipperParser.Not: + case KipperParser.BitwiseNot: + this.enterOuterAlt(_localctx, 3); + { + this.state = 523; + this.operatorModifiedUnaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3125,27 +2684,26 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public incrementOrDecrementUnaryExpression(): IncrementOrDecrementUnaryExpressionContext { - let _localctx: IncrementOrDecrementUnaryExpressionContext = new IncrementOrDecrementUnaryExpressionContext( - this._ctx, - this.state, - ); + let _localctx: IncrementOrDecrementUnaryExpressionContext = new IncrementOrDecrementUnaryExpressionContext(this._ctx, this.state); this.enterRule(_localctx, 106, KipperParser.RULE_incrementOrDecrementUnaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 526; - this.incrementOrDecrementOperator(); - this.state = 527; - this.postfixExpression(); + this.state = 526; + this.incrementOrDecrementOperator(); + this.state = 527; + this.postfixExpression(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3153,27 +2711,26 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public operatorModifiedUnaryExpression(): OperatorModifiedUnaryExpressionContext { - let _localctx: OperatorModifiedUnaryExpressionContext = new OperatorModifiedUnaryExpressionContext( - this._ctx, - this.state, - ); + let _localctx: OperatorModifiedUnaryExpressionContext = new OperatorModifiedUnaryExpressionContext(this._ctx, this.state); this.enterRule(_localctx, 108, KipperParser.RULE_operatorModifiedUnaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 529; - this.unaryOperator(); - this.state = 530; - this.postfixExpression(); + this.state = 529; + this.unaryOperator(); + this.state = 530; + this.postfixExpression(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3181,7 +2738,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3194,20 +2752,21 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 532; - _la = this._input.LA(1); - if (!(_la === KipperParser.PlusPlus || _la === KipperParser.MinusMinus)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 532; + _la = this._input.LA(1); + if (!(_la === KipperParser.PlusPlus || _la === KipperParser.MinusMinus)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3215,7 +2774,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3228,30 +2788,21 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 534; - _la = this._input.LA(1); - if ( - !( - ((_la - 42) & ~0x1f) === 0 && - ((1 << (_la - 42)) & - ((1 << (KipperParser.Plus - 42)) | - (1 << (KipperParser.Minus - 42)) | - (1 << (KipperParser.Not - 42)) | - (1 << (KipperParser.BitwiseNot - 42)))) !== - 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 534; + _la = this._input.LA(1); + if (!(((((_la - 42)) & ~0x1F) === 0 && ((1 << (_la - 42)) & ((1 << (KipperParser.Plus - 42)) | (1 << (KipperParser.Minus - 42)) | (1 << (KipperParser.Not - 42)) | (1 << (KipperParser.BitwiseNot - 42)))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3259,7 +2810,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3271,30 +2823,31 @@ export class KipperParser extends KipperParserBase { try { this.state = 541; this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 46, this._ctx)) { - case 1: - _localctx = new PassOnCastOrConvertExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 536; - this.unaryExpression(); - } - break; + switch ( this.interpreter.adaptivePredict(this._input, 46, this._ctx) ) { + case 1: + _localctx = new PassOnCastOrConvertExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 536; + this.unaryExpression(); + } + break; - case 2: - _localctx = new ActualCastOrConvertExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 537; - this.unaryExpression(); - this.state = 538; - this.match(KipperParser.As); - this.state = 539; - this.typeSpecifierExpression(); - } - break; + case 2: + _localctx = new ActualCastOrConvertExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 537; + this.unaryExpression(); + this.state = 538; + this.match(KipperParser.As); + this.state = 539; + this.typeSpecifierExpression(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3302,7 +2855,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3327,67 +2881,56 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnMultiplicativeExpressionContext(_localctx); - this._ctx = _localctx; + { + _localctx = new PassOnMultiplicativeExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 544; + this.castOrConvertExpression(); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 551; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 47, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } _prevctx = _localctx; + { + { + _localctx = new ActualMultiplicativeExpressionContext(new MultiplicativeExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_multiplicativeExpression); + this.state = 546; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 547; + _la = this._input.LA(1); + if (!(((((_la - 46)) & ~0x1F) === 0 && ((1 << (_la - 46)) & ((1 << (KipperParser.Star - 46)) | (1 << (KipperParser.Div - 46)) | (1 << (KipperParser.Mod - 46)) | (1 << (KipperParser.PowerTo - 46)))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this.state = 544; + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 548; this.castOrConvertExpression(); + } + } } - this._ctx._stop = this._input.tryLT(-1); - this.state = 551; + this.state = 553; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 47, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualMultiplicativeExpressionContext( - new MultiplicativeExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_multiplicativeExpression); - this.state = 546; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 547; - _la = this._input.LA(1); - if ( - !( - ((_la - 46) & ~0x1f) === 0 && - ((1 << (_la - 46)) & - ((1 << (KipperParser.Star - 46)) | - (1 << (KipperParser.Div - 46)) | - (1 << (KipperParser.Mod - 46)) | - (1 << (KipperParser.PowerTo - 46)))) !== - 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 548; - this.castOrConvertExpression(); - } - } - } - this.state = 553; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 47, this._ctx); - } } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3395,7 +2938,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3420,57 +2964,56 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnAdditiveExpressionContext(_localctx); - this._ctx = _localctx; + { + _localctx = new PassOnAdditiveExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 555; + this.multiplicativeExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 562; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 48, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } _prevctx = _localctx; + { + { + _localctx = new ActualAdditiveExpressionContext(new AdditiveExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_additiveExpression); + this.state = 557; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 558; + _la = this._input.LA(1); + if (!(_la === KipperParser.Plus || _la === KipperParser.Minus)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this.state = 555; + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 559; this.multiplicativeExpression(0); + } + } } - this._ctx._stop = this._input.tryLT(-1); - this.state = 562; + this.state = 564; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 48, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualAdditiveExpressionContext( - new AdditiveExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_additiveExpression); - this.state = 557; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 558; - _la = this._input.LA(1); - if (!(_la === KipperParser.Plus || _la === KipperParser.Minus)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 559; - this.multiplicativeExpression(0); - } - } - } - this.state = 564; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 48, this._ctx); - } } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3478,7 +3021,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3502,47 +3046,46 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnBitwiseShiftExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + { + _localctx = new PassOnBitwiseShiftExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 566; - this.additiveExpression(0); + this.state = 566; + this.additiveExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 574; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 49, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualBitwiseShiftExpressionContext(new BitwiseShiftExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseShiftExpression); + this.state = 568; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 569; + this.bitwiseShiftOperators(); + this.state = 570; + this.bitwiseAndExpression(0); + } + } } - this._ctx._stop = this._input.tryLT(-1); - this.state = 574; + this.state = 576; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 49, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualBitwiseShiftExpressionContext( - new BitwiseShiftExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseShiftExpression); - this.state = 568; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 569; - this.bitwiseShiftOperators(); - this.state = 570; - this.bitwiseAndExpression(0); - } - } - } - this.state = 576; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 49, this._ctx); - } } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3550,7 +3093,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3563,29 +3107,21 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 577; - _la = this._input.LA(1); - if ( - !( - ((_la - 69) & ~0x1f) === 0 && - ((1 << (_la - 69)) & - ((1 << (KipperParser.BitwiseZeroFillLeftShift - 69)) | - (1 << (KipperParser.BitwiseSignedRightShift - 69)) | - (1 << (KipperParser.BitwiseZeroFillRightShift - 69)))) !== - 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 577; + _la = this._input.LA(1); + if (!(((((_la - 69)) & ~0x1F) === 0 && ((1 << (_la - 69)) & ((1 << (KipperParser.BitwiseZeroFillLeftShift - 69)) | (1 << (KipperParser.BitwiseSignedRightShift - 69)) | (1 << (KipperParser.BitwiseZeroFillRightShift - 69)))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3593,7 +3129,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -3618,67 +3155,56 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnRelationalExpressionContext(_localctx); - this._ctx = _localctx; + { + _localctx = new PassOnRelationalExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 580; + this.bitwiseShiftExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 587; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 50, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } _prevctx = _localctx; + { + { + _localctx = new ActualRelationalExpressionContext(new RelationalExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_relationalExpression); + this.state = 582; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 583; + _la = this._input.LA(1); + if (!(((((_la - 61)) & ~0x1F) === 0 && ((1 << (_la - 61)) & ((1 << (KipperParser.Less - 61)) | (1 << (KipperParser.LessEqual - 61)) | (1 << (KipperParser.Greater - 61)) | (1 << (KipperParser.GreaterEqual - 61)))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this.state = 580; + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 584; this.bitwiseShiftExpression(0); + } + } } - this._ctx._stop = this._input.tryLT(-1); - this.state = 587; + this.state = 589; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 50, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualRelationalExpressionContext( - new RelationalExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_relationalExpression); - this.state = 582; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 583; - _la = this._input.LA(1); - if ( - !( - ((_la - 61) & ~0x1f) === 0 && - ((1 << (_la - 61)) & - ((1 << (KipperParser.Less - 61)) | - (1 << (KipperParser.LessEqual - 61)) | - (1 << (KipperParser.Greater - 61)) | - (1 << (KipperParser.GreaterEqual - 61)))) !== - 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 584; - this.bitwiseShiftExpression(0); - } - } - } - this.state = 589; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 50, this._ctx); - } } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3686,7 +3212,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3711,57 +3238,56 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnEqualityExpressionContext(_localctx); - this._ctx = _localctx; + { + _localctx = new PassOnEqualityExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + + this.state = 591; + this.relationalExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 598; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } _prevctx = _localctx; + { + { + _localctx = new ActualEqualityExpressionContext(new EqualityExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_equalityExpression); + this.state = 593; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 594; + _la = this._input.LA(1); + if (!(_la === KipperParser.Equal || _la === KipperParser.NotEqual)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this.state = 591; + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 595; this.relationalExpression(0); + } + } } - this._ctx._stop = this._input.tryLT(-1); - this.state = 598; + this.state = 600; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualEqualityExpressionContext( - new EqualityExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_equalityExpression); - this.state = 593; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 594; - _la = this._input.LA(1); - if (!(_la === KipperParser.Equal || _la === KipperParser.NotEqual)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 595; - this.relationalExpression(0); - } - } - } - this.state = 600; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); - } } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3769,7 +3295,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3793,47 +3320,46 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnBitwiseAndExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + { + _localctx = new PassOnBitwiseAndExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 602; - this.equalityExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 609; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualBitwiseAndExpressionContext( - new BitwiseAndExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseAndExpression); - this.state = 604; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 605; - this.match(KipperParser.BitwiseAnd); - this.state = 606; - this.equalityExpression(0); - } - } + this.state = 602; + this.equalityExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 609; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualBitwiseAndExpressionContext(new BitwiseAndExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseAndExpression); + this.state = 604; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 605; + this.match(KipperParser.BitwiseAnd); + this.state = 606; + this.equalityExpression(0); + } } - this.state = 611; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); } + this.state = 611; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3841,7 +3367,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3865,47 +3392,46 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnBitwiseXorExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + { + _localctx = new PassOnBitwiseXorExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 613; + this.state = 613; + this.bitwiseAndExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 620; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 53, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualBitwiseXorExpressionContext(new BitwiseXorExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseXorExpression); + this.state = 615; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 616; + this.match(KipperParser.BitwiseXor); + this.state = 617; this.bitwiseAndExpression(0); + } + } } - this._ctx._stop = this._input.tryLT(-1); - this.state = 620; + this.state = 622; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 53, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualBitwiseXorExpressionContext( - new BitwiseXorExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseXorExpression); - this.state = 615; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 616; - this.match(KipperParser.BitwiseXor); - this.state = 617; - this.bitwiseAndExpression(0); - } - } - } - this.state = 622; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 53, this._ctx); - } } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3913,7 +3439,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3937,47 +3464,46 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnBitwiseOrExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + { + _localctx = new PassOnBitwiseOrExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 624; + this.state = 624; + this.bitwiseXorExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 631; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 54, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualBitwiseOrExpressionContext(new BitwiseOrExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseOrExpression); + this.state = 626; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 627; + this.match(KipperParser.BitwiseOr); + this.state = 628; this.bitwiseXorExpression(0); + } + } } - this._ctx._stop = this._input.tryLT(-1); - this.state = 631; + this.state = 633; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 54, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualBitwiseOrExpressionContext( - new BitwiseOrExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseOrExpression); - this.state = 626; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 627; - this.match(KipperParser.BitwiseOr); - this.state = 628; - this.bitwiseXorExpression(0); - } - } - } - this.state = 633; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 54, this._ctx); - } } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3985,7 +3511,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -4009,47 +3536,46 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnLogicalAndExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + { + _localctx = new PassOnLogicalAndExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 635; + this.state = 635; + this.bitwiseOrExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 642; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualLogicalAndExpressionContext(new LogicalAndExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalAndExpression); + this.state = 637; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 638; + this.match(KipperParser.AndAnd); + this.state = 639; this.bitwiseOrExpression(0); + } + } } - this._ctx._stop = this._input.tryLT(-1); - this.state = 642; + this.state = 644; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualLogicalAndExpressionContext( - new LogicalAndExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalAndExpression); - this.state = 637; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 638; - this.match(KipperParser.AndAnd); - this.state = 639; - this.bitwiseOrExpression(0); - } - } - } - this.state = 644; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); - } } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4057,7 +3583,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -4081,47 +3608,46 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnLogicalOrExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; + { + _localctx = new PassOnLogicalOrExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 646; + this.state = 646; + this.logicalAndExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 653; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 56, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualLogicalOrExpressionContext(new LogicalOrExpressionContext(_parentctx, _parentState)); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalOrExpression); + this.state = 648; + if (!(this.precpred(this._ctx, 1))) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 649; + this.match(KipperParser.OrOr); + this.state = 650; this.logicalAndExpression(0); + } + } } - this._ctx._stop = this._input.tryLT(-1); - this.state = 653; + this.state = 655; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 56, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - { - _localctx = new ActualLogicalOrExpressionContext( - new LogicalOrExpressionContext(_parentctx, _parentState), - ); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalOrExpression); - this.state = 648; - if (!this.precpred(this._ctx, 1)) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 649; - this.match(KipperParser.OrOr); - this.state = 650; - this.logicalAndExpression(0); - } - } - } - this.state = 655; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 56, this._ctx); - } } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4129,7 +3655,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -4141,34 +3668,35 @@ export class KipperParser extends KipperParserBase { try { this.state = 663; this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 57, this._ctx)) { - case 1: - _localctx = new PassOnConditionalExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 656; - this.logicalOrExpression(0); - } - break; + switch ( this.interpreter.adaptivePredict(this._input, 57, this._ctx) ) { + case 1: + _localctx = new PassOnConditionalExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 656; + this.logicalOrExpression(0); + } + break; - case 2: - _localctx = new ActualConditionalExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 657; - this.logicalOrExpression(0); - this.state = 658; - this.match(KipperParser.QuestionMark); - this.state = 659; - this.conditionalExpression(); - this.state = 660; - this.match(KipperParser.Colon); - this.state = 661; - this.conditionalExpression(); - } - break; + case 2: + _localctx = new ActualConditionalExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 657; + this.logicalOrExpression(0); + this.state = 658; + this.match(KipperParser.QuestionMark); + this.state = 659; + this.conditionalExpression(); + this.state = 660; + this.match(KipperParser.Colon); + this.state = 661; + this.conditionalExpression(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4176,7 +3704,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -4188,30 +3717,31 @@ export class KipperParser extends KipperParserBase { try { this.state = 670; this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 58, this._ctx)) { - case 1: - _localctx = new PassOnAssignmentExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 665; - this.conditionalExpression(); - } - break; + switch ( this.interpreter.adaptivePredict(this._input, 58, this._ctx) ) { + case 1: + _localctx = new PassOnAssignmentExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 665; + this.conditionalExpression(); + } + break; - case 2: - _localctx = new ActualAssignmentExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 666; - this.computedPrimaryExpression(0); - this.state = 667; - this.assignmentOperator(); - this.state = 668; - this.assignmentExpression(); - } - break; + case 2: + _localctx = new ActualAssignmentExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 666; + this.computedPrimaryExpression(0); + this.state = 667; + this.assignmentOperator(); + this.state = 668; + this.assignmentExpression(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4219,7 +3749,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -4232,32 +3763,21 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 672; - _la = this._input.LA(1); - if ( - !( - ((_la - 53) & ~0x1f) === 0 && - ((1 << (_la - 53)) & - ((1 << (KipperParser.Assign - 53)) | - (1 << (KipperParser.PlusAssign - 53)) | - (1 << (KipperParser.MinusAssign - 53)) | - (1 << (KipperParser.StarAssign - 53)) | - (1 << (KipperParser.DivAssign - 53)) | - (1 << (KipperParser.ModAssign - 53)))) !== - 0 - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 672; + _la = this._input.LA(1); + if (!(((((_la - 53)) & ~0x1F) === 0 && ((1 << (_la - 53)) & ((1 << (KipperParser.Assign - 53)) | (1 << (KipperParser.PlusAssign - 53)) | (1 << (KipperParser.MinusAssign - 53)) | (1 << (KipperParser.StarAssign - 53)) | (1 << (KipperParser.DivAssign - 53)) | (1 << (KipperParser.ModAssign - 53)))) !== 0))) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4265,7 +3785,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -4278,28 +3799,29 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 674; - this.assignmentExpression(); - this.state = 679; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 59, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 675; - this.match(KipperParser.Comma); - this.state = 676; - this.assignmentExpression(); - } - } + this.state = 674; + this.assignmentExpression(); + this.state = 679; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 59, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 675; + this.match(KipperParser.Comma); + this.state = 676; + this.assignmentExpression(); + } } - this.state = 681; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 59, this._ctx); } + this.state = 681; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 59, this._ctx); } - } catch (re) { + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4307,7 +3829,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -4319,32 +3842,33 @@ export class KipperParser extends KipperParserBase { try { this.state = 685; this._errHandler.sync(this); - switch (this.interpreter.adaptivePredict(this._input, 60, this._ctx)) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 682; - this.identifierTypeSpecifierExpression(); - } - break; + switch ( this.interpreter.adaptivePredict(this._input, 60, this._ctx) ) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 682; + this.identifierTypeSpecifierExpression(); + } + break; - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 683; - this.genericTypeSpecifierExpression(); - } - break; + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 683; + this.genericTypeSpecifierExpression(); + } + break; - case 3: - this.enterOuterAlt(_localctx, 3); - { - this.state = 684; - this.typeofTypeSpecifierExpression(); - } - break; + case 3: + this.enterOuterAlt(_localctx, 3); + { + this.state = 684; + this.typeofTypeSpecifierExpression(); + } + break; } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4352,25 +3876,24 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public identifierTypeSpecifierExpression(): IdentifierTypeSpecifierExpressionContext { - let _localctx: IdentifierTypeSpecifierExpressionContext = new IdentifierTypeSpecifierExpressionContext( - this._ctx, - this.state, - ); + let _localctx: IdentifierTypeSpecifierExpressionContext = new IdentifierTypeSpecifierExpressionContext(this._ctx, this.state); this.enterRule(_localctx, 148, KipperParser.RULE_identifierTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 687; - this.typeSpecifierIdentifier(); + this.state = 687; + this.typeSpecifierIdentifier(); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4378,31 +3901,30 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public genericTypeSpecifierExpression(): GenericTypeSpecifierExpressionContext { - let _localctx: GenericTypeSpecifierExpressionContext = new GenericTypeSpecifierExpressionContext( - this._ctx, - this.state, - ); + let _localctx: GenericTypeSpecifierExpressionContext = new GenericTypeSpecifierExpressionContext(this._ctx, this.state); this.enterRule(_localctx, 150, KipperParser.RULE_genericTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 689; - this.typeSpecifierIdentifier(); - this.state = 690; - this.match(KipperParser.Less); - this.state = 691; - this.typeSpecifierIdentifier(); - this.state = 692; - this.match(KipperParser.Greater); - } - } catch (re) { + this.state = 689; + this.typeSpecifierIdentifier(); + this.state = 690; + this.match(KipperParser.Less); + this.state = 691; + this.typeSpecifierIdentifier(); + this.state = 692; + this.match(KipperParser.Greater); + } + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4410,31 +3932,30 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public typeofTypeSpecifierExpression(): TypeofTypeSpecifierExpressionContext { - let _localctx: TypeofTypeSpecifierExpressionContext = new TypeofTypeSpecifierExpressionContext( - this._ctx, - this.state, - ); + let _localctx: TypeofTypeSpecifierExpressionContext = new TypeofTypeSpecifierExpressionContext(this._ctx, this.state); this.enterRule(_localctx, 152, KipperParser.RULE_typeofTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 694; - this.match(KipperParser.Typeof); - this.state = 695; - this.match(KipperParser.LeftParen); - this.state = 696; - this.typeSpecifierIdentifier(); - this.state = 697; - this.match(KipperParser.RightParen); + this.state = 694; + this.match(KipperParser.Typeof); + this.state = 695; + this.match(KipperParser.LeftParen); + this.state = 696; + this.typeSpecifierIdentifier(); + this.state = 697; + this.match(KipperParser.RightParen); } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4442,7 +3963,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -4455,27 +3977,21 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 699; - _la = this._input.LA(1); - if ( - !( - ((_la & ~0x1f) === 0 && - ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== - 0) || - _la === KipperParser.Identifier - ) - ) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - - this._errHandler.reportMatch(this); - this.consume(); + this.state = 699; + _la = this._input.LA(1); + if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0) || _la === KipperParser.Identifier)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; } + + this._errHandler.reportMatch(this); + this.consume(); + } } - } catch (re) { + } + catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4483,7 +3999,8 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } finally { + } + finally { this.exitRule(); } return _localctx; @@ -4491,134 +4008,134 @@ export class KipperParser extends KipperParserBase { public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { switch (ruleIndex) { - case 18: - return this.compoundStatement_sempred(_localctx as CompoundStatementContext, predIndex); + case 18: + return this.compoundStatement_sempred(_localctx as CompoundStatementContext, predIndex); - case 45: - return this.computedPrimaryExpression_sempred(_localctx as ComputedPrimaryExpressionContext, predIndex); + case 45: + return this.computedPrimaryExpression_sempred(_localctx as ComputedPrimaryExpressionContext, predIndex); - case 58: - return this.multiplicativeExpression_sempred(_localctx as MultiplicativeExpressionContext, predIndex); + case 58: + return this.multiplicativeExpression_sempred(_localctx as MultiplicativeExpressionContext, predIndex); - case 59: - return this.additiveExpression_sempred(_localctx as AdditiveExpressionContext, predIndex); + case 59: + return this.additiveExpression_sempred(_localctx as AdditiveExpressionContext, predIndex); - case 60: - return this.bitwiseShiftExpression_sempred(_localctx as BitwiseShiftExpressionContext, predIndex); + case 60: + return this.bitwiseShiftExpression_sempred(_localctx as BitwiseShiftExpressionContext, predIndex); - case 62: - return this.relationalExpression_sempred(_localctx as RelationalExpressionContext, predIndex); + case 62: + return this.relationalExpression_sempred(_localctx as RelationalExpressionContext, predIndex); - case 63: - return this.equalityExpression_sempred(_localctx as EqualityExpressionContext, predIndex); + case 63: + return this.equalityExpression_sempred(_localctx as EqualityExpressionContext, predIndex); - case 64: - return this.bitwiseAndExpression_sempred(_localctx as BitwiseAndExpressionContext, predIndex); + case 64: + return this.bitwiseAndExpression_sempred(_localctx as BitwiseAndExpressionContext, predIndex); - case 65: - return this.bitwiseXorExpression_sempred(_localctx as BitwiseXorExpressionContext, predIndex); + case 65: + return this.bitwiseXorExpression_sempred(_localctx as BitwiseXorExpressionContext, predIndex); - case 66: - return this.bitwiseOrExpression_sempred(_localctx as BitwiseOrExpressionContext, predIndex); + case 66: + return this.bitwiseOrExpression_sempred(_localctx as BitwiseOrExpressionContext, predIndex); - case 67: - return this.logicalAndExpression_sempred(_localctx as LogicalAndExpressionContext, predIndex); + case 67: + return this.logicalAndExpression_sempred(_localctx as LogicalAndExpressionContext, predIndex); - case 68: - return this.logicalOrExpression_sempred(_localctx as LogicalOrExpressionContext, predIndex); + case 68: + return this.logicalOrExpression_sempred(_localctx as LogicalOrExpressionContext, predIndex); } return true; } private compoundStatement_sempred(_localctx: CompoundStatementContext, predIndex: number): boolean { switch (predIndex) { - case 0: - return this.notInsideExpressionStatement(); + case 0: + return this.notInsideExpressionStatement(); } return true; } private computedPrimaryExpression_sempred(_localctx: ComputedPrimaryExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 1: - return this.precpred(this._ctx, 5); + case 1: + return this.precpred(this._ctx, 5); - case 2: - return this.precpred(this._ctx, 3); + case 2: + return this.precpred(this._ctx, 3); - case 3: - return this.precpred(this._ctx, 2); + case 3: + return this.precpred(this._ctx, 2); - case 4: - return this.precpred(this._ctx, 1); + case 4: + return this.precpred(this._ctx, 1); } return true; } private multiplicativeExpression_sempred(_localctx: MultiplicativeExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 5: - return this.precpred(this._ctx, 1); + case 5: + return this.precpred(this._ctx, 1); } return true; } private additiveExpression_sempred(_localctx: AdditiveExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 6: - return this.precpred(this._ctx, 1); + case 6: + return this.precpred(this._ctx, 1); } return true; } private bitwiseShiftExpression_sempred(_localctx: BitwiseShiftExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 7: - return this.precpred(this._ctx, 1); + case 7: + return this.precpred(this._ctx, 1); } return true; } private relationalExpression_sempred(_localctx: RelationalExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 8: - return this.precpred(this._ctx, 1); + case 8: + return this.precpred(this._ctx, 1); } return true; } private equalityExpression_sempred(_localctx: EqualityExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 9: - return this.precpred(this._ctx, 1); + case 9: + return this.precpred(this._ctx, 1); } return true; } private bitwiseAndExpression_sempred(_localctx: BitwiseAndExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 10: - return this.precpred(this._ctx, 1); + case 10: + return this.precpred(this._ctx, 1); } return true; } private bitwiseXorExpression_sempred(_localctx: BitwiseXorExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 11: - return this.precpred(this._ctx, 1); + case 11: + return this.precpred(this._ctx, 1); } return true; } private bitwiseOrExpression_sempred(_localctx: BitwiseOrExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 12: - return this.precpred(this._ctx, 1); + case 12: + return this.precpred(this._ctx, 1); } return true; } private logicalAndExpression_sempred(_localctx: LogicalAndExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 13: - return this.precpred(this._ctx, 1); + case 13: + return this.precpred(this._ctx, 1); } return true; } private logicalOrExpression_sempred(_localctx: LogicalOrExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 14: - return this.precpred(this._ctx, 1); + case 14: + return this.precpred(this._ctx, 1); } return true; } @@ -4631,8 +4148,8 @@ export class KipperParser extends KipperParserBase { "\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t\x12\x04" + "\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17\t\x17\x04" + "\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B\x04\x1C\t\x1C\x04" + - '\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04"\t"\x04#' + - "\t#\x04$\t$\x04%\t%\x04&\t&\x04'\t'\x04(\t(\x04)\t)\x04*\t*\x04+\t+" + + "\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04\"\t\"\x04#" + + "\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(\x04)\t)\x04*\t*\x04+\t+" + "\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x040\t0\x041\t1\x042\t2\x043\t3\x044" + "\t4\x045\t5\x046\t6\x047\t7\x048\t8\x049\t9\x04:\t:\x04;\t;\x04<\t<\x04" + "=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x04B\tB\x04C\tC\x04D\tD\x04E\tE\x04" + @@ -4660,9 +4177,9 @@ export class KipperParser extends KipperParserBase { "\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\u015A\n\x1F\x03\x1F\x03" + "\x1F\x03 \x03 \x03 \x03 \x03 \x03 \x03 \x03 \x03 \x05 \u0167\n \x03!\x03" + - '!\x03!\x03!\x03"\x03"\x03#\x03#\x03$\x03$\x03%\x03%\x05%\u0175\n%\x03' + - "&\x03&\x03'\x03'\x07'\u017B\n'\f'\x0E'\u017E\v'\x03'\x03'\x03" + - "'\x07'\u0183\n'\f'\x0E'\u0186\v'\x03'\x05'\u0189\n'\x03(\x03" + + "!\x03!\x03!\x03\"\x03\"\x03#\x03#\x03$\x03$\x03%\x03%\x05%\u0175\n%\x03" + + "&\x03&\x03\'\x03\'\x07\'\u017B\n\'\f\'\x0E\'\u017E\v\'\x03\'\x03\'\x03" + + "\'\x07\'\u0183\n\'\f\'\x0E\'\u0186\v\'\x03\'\x05\'\u0189\n\'\x03(\x03" + "(\x03(\x05(\u018E\n(\x03(\x05(\u0191\n(\x03)\x03)\x03)\x05)\u0196\n)\x03" + ")\x05)\u0199\n)\x03*\x03*\x03+\x03+\x03+\x03+\x07+\u01A1\n+\f+\x0E+\u01A4" + "\v+\x05+\u01A6\n+\x03+\x05+\u01A9\n+\x03+\x03+\x03,\x03,\x03,\x03,\x07" + @@ -4689,7 +4206,7 @@ export class KipperParser extends KipperParserBase { "K\x05K\u02B0\nK\x03L\x03L\x03M\x03M\x03M\x03M\x03M\x03N\x03N\x03N\x03" + "N\x03N\x03O\x03O\x03O\x02\x02\r\\vxz~\x80\x82\x84\x86\x88\x8AP\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' + + "\x02\x18\x02\x1A\x02\x1C\x02\x1E\x02 \x02\"\x02$\x02&\x02(\x02*\x02,\x02" + ".\x020\x022\x024\x026\x028\x02:\x02<\x02>\x02@\x02B\x02D\x02F\x02H\x02" + "J\x02L\x02N\x02P\x02R\x02T\x02V\x02X\x02Z\x02\\\x02^\x02`\x02b\x02d\x02" + "f\x02h\x02j\x02l\x02n\x02p\x02r\x02t\x02v\x02x\x02z\x02|\x02~\x02\x80" + @@ -4702,7 +4219,7 @@ export class KipperParser extends KipperParserBase { "\x02\x02\x02\f\xBA\x03\x02\x02\x02\x0E\xBC\x03\x02\x02\x02\x10\xBF\x03" + "\x02\x02\x02\x12\xC1\x03\x02\x02\x02\x14\xC8\x03\x02\x02\x02\x16\xCA\x03" + "\x02\x02\x02\x18\xCC\x03\x02\x02\x02\x1A\xCE\x03\x02\x02\x02\x1C\xDA\x03" + - '\x02\x02\x02\x1E\xE2\x03\x02\x02\x02 \xE6\x03\x02\x02\x02"\xEB\x03\x02' + + "\x02\x02\x02\x1E\xE2\x03\x02\x02\x02 \xE6\x03\x02\x02\x02\"\xEB\x03\x02" + "\x02\x02$\xF6\x03\x02\x02\x02&\xF8\x03\x02\x02\x02(\xFF\x03\x02\x02\x02" + "*\u0106\x03\x02\x02\x02,\u0108\x03\x02\x02\x02.\u0111\x03\x02\x02\x02" + "0\u0126\x03\x02\x02\x022\u012B\x03\x02\x02\x024\u012D\x03\x02\x02\x02" + @@ -4731,10 +4248,10 @@ export class KipperParser extends KipperParserBase { "\x05\x02\xA9\x07\x03\x02\x02\x02\xAA\xAC\x05\n\x06\x02\xAB\xAA\x03\x02" + "\x02\x02\xAC\xAD\x03\x02\x02\x02\xAD\xAB\x03\x02\x02\x02\xAD\xAE\x03\x02" + "\x02\x02\xAE\t\x03\x02\x02\x02\xAF\xB3\x05$\x13\x02\xB0\xB3\x05\f\x07" + - '\x02\xB1\xB3\x07"\x02\x02\xB2\xAF\x03\x02\x02\x02\xB2\xB0\x03\x02\x02' + + "\x02\xB1\xB3\x07\"\x02\x02\xB2\xAF\x03\x02\x02\x02\xB2\xB0\x03\x02\x02" + "\x02\xB2\xB1\x03\x02\x02\x02\xB3\v\x03\x02\x02\x02\xB4\xB5\x05\x0E\b\x02" + - '\xB5\xB6\x07"\x02\x02\xB6\xBB\x03\x02\x02\x02\xB7\xBB\x05\x1A\x0E\x02' + - '\xB8\xBB\x05 \x11\x02\xB9\xBB\x05"\x12\x02\xBA\xB4\x03\x02\x02\x02\xBA' + + "\xB5\xB6\x07\"\x02\x02\xB6\xBB\x03\x02\x02\x02\xB7\xBB\x05\x1A\x0E\x02" + + "\xB8\xBB\x05 \x11\x02\xB9\xBB\x05\"\x12\x02\xBA\xB4\x03\x02\x02\x02\xBA" + "\xB7\x03\x02\x02\x02\xBA\xB8\x03\x02\x02\x02\xBA\xB9\x03\x02\x02\x02\xBB" + "\r\x03\x02\x02\x02\xBC\xBD\x05\x10\t\x02\xBD\xBE\x05\x12\n\x02\xBE\x0F" + "\x03\x02\x02\x02\xBF\xC0\t\x02\x02\x02\xC0\x11\x03\x02\x02\x02\xC1\xC2" + @@ -4760,8 +4277,8 @@ export class KipperParser extends KipperParserBase { "\x02\xF6\xF3\x03\x02\x02\x02\xF6\xF4\x03\x02\x02\x02\xF6\xF5\x03\x02\x02" + "\x02\xF7%\x03\x02\x02\x02\xF8\xF9\x06\x14\x02\x02\xF9\xFB\x07*\x02\x02" + "\xFA\xFC\x05\b\x05\x02\xFB\xFA\x03\x02\x02\x02\xFB\xFC\x03\x02\x02\x02" + - "\xFC\xFD\x03\x02\x02\x02\xFD\xFE\x07+\x02\x02\xFE'\x03\x02\x02\x02\xFF" + - '\u0100\b\x15\x01\x02\u0100\u0101\x05\x92J\x02\u0101\u0102\x07"\x02\x02' + + "\xFC\xFD\x03\x02\x02\x02\xFD\xFE\x07+\x02\x02\xFE\'\x03\x02\x02\x02\xFF" + + "\u0100\b\x15\x01\x02\u0100\u0101\x05\x92J\x02\u0101\u0102\x07\"\x02\x02" + "\u0102\u0103\b\x15\x01\x02\u0103)\x03\x02\x02\x02\u0104\u0107\x05,\x17" + "\x02\u0105\u0107\x05.\x18\x02\u0106\u0104\x03\x02\x02\x02\u0106\u0105" + "\x03\x02\x02\x02\u0107+\x03\x02\x02\x02\u0108\u0109\x07\x11\x02\x02\u0109" + @@ -4784,10 +4301,10 @@ export class KipperParser extends KipperParserBase { "\x02\u0130\u0132\x05\x92J\x02\u0131\u012F\x03\x02\x02\x02\u0131\u0130" + "\x03\x02\x02\x02\u0132\u0133\x03\x02\x02\x02\u0133\u0134\b\x1B\x01\x02" + "\u0134\u0136\x03\x02\x02\x02\u0135\u0131\x03\x02\x02\x02\u0135\u0136\x03" + - '\x02\x02\x02\u0136\u0137\x03\x02\x02\x02\u0137\u013B\x07"\x02\x02\u0138' + + "\x02\x02\x02\u0136\u0137\x03\x02\x02\x02\u0137\u013B\x07\"\x02\x02\u0138" + "\u0139\x05\x92J\x02\u0139\u013A\b\x1B\x01\x02\u013A\u013C\x03\x02\x02" + "\x02\u013B\u0138\x03\x02\x02\x02\u013B\u013C\x03\x02\x02\x02\u013C\u013D" + - '\x03\x02\x02\x02\u013D\u0141\x07"\x02\x02\u013E\u013F\x05\x92J\x02\u013F' + + "\x03\x02\x02\x02\u013D\u0141\x07\"\x02\x02\u013E\u013F\x05\x92J\x02\u013F" + "\u0140\b\x1B\x01\x02\u0140\u0142\x03\x02\x02\x02\u0141\u013E\x03\x02\x02" + "\x02\u0141\u0142\x03\x02\x02\x02\u0142\u0143\x03\x02\x02\x02\u0143\u0144" + "\x07&\x02\x02\u0144\u0145\x05$\x13\x02\u01455\x03\x02\x02\x02\u0146\u0147" + @@ -4795,13 +4312,13 @@ export class KipperParser extends KipperParserBase { "\u014A\x07&\x02\x02\u014A\u014B\x05$\x13\x02\u014B7\x03\x02\x02\x02\u014C" + "\u014D\x07\x0F\x02\x02\u014D\u014E\x05$\x13\x02\u014E\u014F\x07\x10\x02" + "\x02\u014F\u0150\x07%\x02\x02\u0150\u0151\x05\x92J\x02\u0151\u0152\x07" + - '&\x02\x02\u0152\u0153\x07"\x02\x02\u01539\x03\x02\x02\x02\u0154\u0155' + - '\t\x03\x02\x02\u0155\u0156\x07"\x02\x02\u0156;\x03\x02\x02\x02\u0157' + + "&\x02\x02\u0152\u0153\x07\"\x02\x02\u01539\x03\x02\x02\x02\u0154\u0155" + + "\t\x03\x02\x02\u0155\u0156\x07\"\x02\x02\u0156;\x03\x02\x02\x02\u0157" + "\u0159\x07\x16\x02\x02\u0158\u015A\x05\x92J\x02\u0159\u0158\x03\x02\x02" + "\x02\u0159\u015A\x03\x02\x02\x02\u015A\u015B\x03\x02\x02\x02\u015B\u015C" + - '\x07"\x02\x02\u015C=\x03\x02\x02\x02\u015D\u0167\x05@!\x02\u015E\u0167' + - '\x05T+\x02\u015F\u0167\x05V,\x02\u0160\u0167\x05B"\x02\u0161\u0167\x05' + - "D#\x02\u0162\u0167\x05J&\x02\u0163\u0167\x05L'\x02\u0164\u0167\x05R*" + + "\x07\"\x02\x02\u015C=\x03\x02\x02\x02\u015D\u0167\x05@!\x02\u015E\u0167" + + "\x05T+\x02\u015F\u0167\x05V,\x02\u0160\u0167\x05B\"\x02\u0161\u0167\x05" + + "D#\x02\u0162\u0167\x05J&\x02\u0163\u0167\x05L\'\x02\u0164\u0167\x05R*" + "\x02\u0165\u0167\x05Z.\x02\u0166\u015D\x03\x02\x02\x02\u0166\u015E\x03" + "\x02\x02\x02\u0166\u015F\x03\x02\x02\x02\u0166\u0160\x03\x02\x02\x02\u0166" + "\u0161\x03\x02\x02\x02\u0166\u0162\x03\x02\x02\x02\u0166\u0163\x03\x02" + @@ -4828,7 +4345,7 @@ export class KipperParser extends KipperParserBase { "\u0195\u0196\x03\x02\x02\x02\u0196\u0197\x03\x02\x02\x02\u0197\u0199\x07" + ")\x02\x02\u0198\u0192\x03\x02\x02\x02\u0198\u0193\x03\x02\x02\x02\u0199" + "Q\x03\x02\x02\x02\u019A\u019B\t\x06\x02\x02\u019BS\x03\x02\x02\x02\u019C" + - "\u01A5\x07'\x02\x02\u019D\u01A2\x05\x92J\x02\u019E\u019F\x07!\x02\x02" + + "\u01A5\x07\'\x02\x02\u019D\u01A2\x05\x92J\x02\u019E\u019F\x07!\x02\x02" + "\u019F\u01A1\x05\x92J\x02\u01A0\u019E\x03\x02\x02\x02\u01A1\u01A4\x03" + "\x02\x02\x02\u01A2\u01A0\x03\x02\x02\x02\u01A2\u01A3\x03\x02\x02\x02\u01A3" + "\u01A6\x03\x02\x02\x02\u01A4\u01A2\x03\x02\x02\x02\u01A5\u019D\x03\x02" + @@ -4864,9 +4381,9 @@ export class KipperParser extends KipperParserBase { "\x05\x8EH\x02\u01EA\u01E8\x03\x02\x02\x02\u01EB\u01EE\x03\x02\x02\x02" + "\u01EC\u01EA\x03\x02\x02\x02\u01EC\u01ED\x03\x02\x02\x02\u01ED_\x03\x02" + "\x02\x02\u01EE\u01EC\x03\x02\x02\x02\u01EF\u01F0\x07J\x02\x02\u01F0\u01F1" + - "\x05F$\x02\u01F1a\x03\x02\x02\x02\u01F2\u01F3\x07'\x02\x02\u01F3\u01F4" + + "\x05F$\x02\u01F1a\x03\x02\x02\x02\u01F2\u01F3\x07\'\x02\x02\u01F3\u01F4" + "\x05\x92J\x02\u01F4\u01F5\x07(\x02\x02\u01F5c\x03\x02\x02\x02\u01F6\u01FA" + - "\x07'\x02\x02\u01F7\u01F8\x05\x92J\x02\u01F8\u01F9\b3\x01\x02\u01F9\u01FB" + + "\x07\'\x02\x02\u01F7\u01F8\x05\x92J\x02\u01F8\u01F9\b3\x01\x02\u01F9\u01FB" + "\x03\x02\x02\x02\u01FA\u01F7\x03\x02\x02\x02\u01FA\u01FB\x03\x02\x02\x02" + "\u01FB\u01FC\x03\x02\x02\x02\u01FC\u0200\x07$\x02\x02\u01FD\u01FE\x05" + "\x92J\x02\u01FE\u01FF\b3\x01\x02\u01FF\u0201\x03\x02\x02\x02\u0200\u01FD" + @@ -4955,7 +4472,10 @@ export class KipperParser extends KipperParserBase { "\u0234\u0240\u024D\u0258\u0263\u026E\u0279\u0284\u028F\u0299\u02A0\u02A9" + "\u02AF"; public static readonly _serializedATN: string = Utils.join( - [KipperParser._serializedATNSegment0, KipperParser._serializedATNSegment1], + [ + KipperParser._serializedATNSegment0, + KipperParser._serializedATNSegment1, + ], "", ); public static __ATN: ATN; @@ -4966,12 +4486,11 @@ export class KipperParser extends KipperParserBase { return KipperParser.__ATN; } + } export class CompilationUnitContext extends KipperParserRuleContext { - public EOF(): TerminalNode { - return this.getToken(KipperParser.EOF, 0); - } + public EOF(): TerminalNode { return this.getToken(KipperParser.EOF, 0); } public translationUnit(): TranslationUnitContext | undefined { return this.tryGetRuleContext(0, TranslationUnitContext); } @@ -4979,9 +4498,7 @@ export class CompilationUnitContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_compilationUnit; - } + public get ruleIndex(): number { return KipperParser.RULE_compilationUnit; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterCompilationUnit) { @@ -5004,6 +4521,7 @@ export class CompilationUnitContext extends KipperParserRuleContext { } } + export class TranslationUnitContext extends KipperParserRuleContext { public externalItem(): ExternalItemContext[]; public externalItem(i: number): ExternalItemContext; @@ -5018,9 +4536,7 @@ export class TranslationUnitContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_translationUnit; - } + public get ruleIndex(): number { return KipperParser.RULE_translationUnit; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTranslationUnit) { @@ -5043,14 +4559,13 @@ export class TranslationUnitContext extends KipperParserRuleContext { } } + export class ExternalItemContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_externalItem; - } + public get ruleIndex(): number { return KipperParser.RULE_externalItem; } public copyFrom(ctx: ExternalItemContext): void { super.copyFrom(ctx); } @@ -5085,6 +4600,7 @@ export class ExternalBlockItemContext extends ExternalItemContext { } } + export class BlockItemListContext extends KipperParserRuleContext { public blockItem(): BlockItemContext[]; public blockItem(i: number): BlockItemContext; @@ -5099,9 +4615,7 @@ export class BlockItemListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_blockItemList; - } + public get ruleIndex(): number { return KipperParser.RULE_blockItemList; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBlockItemList) { @@ -5124,6 +4638,7 @@ export class BlockItemListContext extends KipperParserRuleContext { } } + export class BlockItemContext extends KipperParserRuleContext { public statement(): StatementContext | undefined { return this.tryGetRuleContext(0, StatementContext); @@ -5131,16 +4646,12 @@ export class BlockItemContext extends KipperParserRuleContext { public declaration(): DeclarationContext | undefined { return this.tryGetRuleContext(0, DeclarationContext); } - public SemiColon(): TerminalNode | undefined { - return this.tryGetToken(KipperParser.SemiColon, 0); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_blockItem; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBlockItem) { @@ -5163,13 +4674,12 @@ export class BlockItemContext extends KipperParserRuleContext { } } + 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 SemiColon(): TerminalNode | undefined { return this.tryGetToken(KipperParser.SemiColon, 0); } public functionDeclaration(): FunctionDeclarationContext | undefined { return this.tryGetRuleContext(0, FunctionDeclarationContext); } @@ -5183,9 +4693,7 @@ export class DeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_declaration; - } + public get ruleIndex(): number { return KipperParser.RULE_declaration; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDeclaration) { @@ -5208,6 +4716,7 @@ export class DeclarationContext extends KipperParserRuleContext { } } + export class VariableDeclarationContext extends KipperParserRuleContext { public storageTypeSpecifier(): StorageTypeSpecifierContext { return this.getRuleContext(0, StorageTypeSpecifierContext); @@ -5219,9 +4728,7 @@ export class VariableDeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_variableDeclaration; - } + public get ruleIndex(): number { return KipperParser.RULE_variableDeclaration; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterVariableDeclaration) { @@ -5244,20 +4751,15 @@ export class VariableDeclarationContext extends KipperParserRuleContext { } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_storageTypeSpecifier; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStorageTypeSpecifier) { @@ -5280,19 +4782,16 @@ export class StorageTypeSpecifierContext extends KipperParserRuleContext { } } + export class InitDeclaratorContext extends KipperParserRuleContext { public declarator(): DeclaratorContext { return this.getRuleContext(0, DeclaratorContext); } - public Colon(): TerminalNode { - return this.getToken(KipperParser.Colon, 0); - } + 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 Assign(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Assign, 0); } public initializer(): InitializerContext | undefined { return this.tryGetRuleContext(0, InitializerContext); } @@ -5300,9 +4799,7 @@ export class InitDeclaratorContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_initDeclarator; - } + public get ruleIndex(): number { return KipperParser.RULE_initDeclarator; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterInitDeclarator) { @@ -5325,6 +4822,7 @@ export class InitDeclaratorContext extends KipperParserRuleContext { } } + export class InitializerContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext { return this.getRuleContext(0, AssignmentExpressionContext); @@ -5333,9 +4831,7 @@ export class InitializerContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_initializer; - } + public get ruleIndex(): number { return KipperParser.RULE_initializer; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterInitializer) { @@ -5358,6 +4854,7 @@ export class InitializerContext extends KipperParserRuleContext { } } + export class DeclaratorContext extends KipperParserRuleContext { public directDeclarator(): DirectDeclaratorContext { return this.getRuleContext(0, DirectDeclaratorContext); @@ -5366,9 +4863,7 @@ export class DeclaratorContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_declarator; - } + public get ruleIndex(): number { return KipperParser.RULE_declarator; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDeclarator) { @@ -5391,17 +4886,14 @@ export class DeclaratorContext extends KipperParserRuleContext { } } + export class DirectDeclaratorContext extends KipperParserRuleContext { - public Identifier(): TerminalNode { - return this.getToken(KipperParser.Identifier, 0); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_directDeclarator; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDirectDeclarator) { @@ -5424,22 +4916,15 @@ export class DirectDeclaratorContext extends KipperParserRuleContext { } } + export class FunctionDeclarationContext extends KipperParserRuleContext { - public DefFunc(): TerminalNode { - return this.getToken(KipperParser.DefFunc, 0); - } + 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); + 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); } @@ -5453,9 +4938,7 @@ export class FunctionDeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_functionDeclaration; - } + public get ruleIndex(): number { return KipperParser.RULE_functionDeclaration; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFunctionDeclaration) { @@ -5478,6 +4961,7 @@ export class FunctionDeclarationContext extends KipperParserRuleContext { } } + export class ParameterListContext extends KipperParserRuleContext { public parameterDeclaration(): ParameterDeclarationContext[]; public parameterDeclaration(i: number): ParameterDeclarationContext; @@ -5501,9 +4985,7 @@ export class ParameterListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_parameterList; - } + public get ruleIndex(): number { return KipperParser.RULE_parameterList; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterParameterList) { @@ -5526,13 +5008,12 @@ export class ParameterListContext extends KipperParserRuleContext { } } + export class ParameterDeclarationContext extends KipperParserRuleContext { public declarator(): DeclaratorContext { return this.getRuleContext(0, DeclaratorContext); } - public Colon(): TerminalNode { - return this.getToken(KipperParser.Colon, 0); - } + public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } public typeSpecifierExpression(): TypeSpecifierExpressionContext { return this.getRuleContext(0, TypeSpecifierExpressionContext); } @@ -5540,9 +5021,7 @@ export class ParameterDeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_parameterDeclaration; - } + public get ruleIndex(): number { return KipperParser.RULE_parameterDeclaration; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterParameterDeclaration) { @@ -5565,26 +5044,17 @@ export class ParameterDeclarationContext extends KipperParserRuleContext { } } + export class InterfaceDeclarationContext extends KipperParserRuleContext { - public Interface(): TerminalNode { - return this.getToken(KipperParser.Interface, 0); - } - public Identifier(): TerminalNode { - return this.getToken(KipperParser.Identifier, 0); - } - public LeftBrace(): TerminalNode { - return this.getToken(KipperParser.LeftBrace, 0); - } - public RightBrace(): TerminalNode { - return this.getToken(KipperParser.RightBrace, 0); - } + public Interface(): TerminalNode { return this.getToken(KipperParser.Interface, 0); } + public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } + 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_interfaceDeclaration; - } + public get ruleIndex(): number { return KipperParser.RULE_interfaceDeclaration; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterInterfaceDeclaration) { @@ -5607,26 +5077,17 @@ 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); - } - public LeftBrace(): TerminalNode { - return this.getToken(KipperParser.LeftBrace, 0); - } - public RightBrace(): TerminalNode { - return this.getToken(KipperParser.RightBrace, 0); - } + public Class(): TerminalNode { return this.getToken(KipperParser.Class, 0); } + public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_classDeclaration; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterClassDeclaration) { @@ -5649,6 +5110,7 @@ export class ClassDeclarationContext extends KipperParserRuleContext { } } + export class StatementContext extends KipperParserRuleContext { public expressionStatement(): ExpressionStatementContext | undefined { return this.tryGetRuleContext(0, ExpressionStatementContext); @@ -5672,9 +5134,7 @@ export class StatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_statement; - } + public get ruleIndex(): number { return KipperParser.RULE_statement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStatement) { @@ -5697,13 +5157,10 @@ export class StatementContext extends KipperParserRuleContext { } } + export class CompoundStatementContext extends KipperParserRuleContext { - public LeftBrace(): TerminalNode { - return this.getToken(KipperParser.LeftBrace, 0); - } - public RightBrace(): TerminalNode { - return this.getToken(KipperParser.RightBrace, 0); - } + 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); } @@ -5711,9 +5168,7 @@ export class CompoundStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_compoundStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_compoundStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterCompoundStatement) { @@ -5736,20 +5191,17 @@ export class CompoundStatementContext extends KipperParserRuleContext { } } + export class ExpressionStatementContext extends KipperParserRuleContext { public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } - public SemiColon(): TerminalNode { - return this.getToken(KipperParser.SemiColon, 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_expressionStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_expressionStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterExpressionStatement) { @@ -5772,6 +5224,7 @@ export class ExpressionStatementContext extends KipperParserRuleContext { } } + export class SelectionStatementContext extends KipperParserRuleContext { public ifStatement(): IfStatementContext | undefined { return this.tryGetRuleContext(0, IfStatementContext); @@ -5783,9 +5236,7 @@ export class SelectionStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_selectionStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_selectionStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSelectionStatement) { @@ -5808,19 +5259,14 @@ export class SelectionStatementContext extends KipperParserRuleContext { } } + export class IfStatementContext extends KipperParserRuleContext { - public If(): TerminalNode { - return this.getToken(KipperParser.If, 0); - } - public LeftParen(): TerminalNode { - return this.getToken(KipperParser.LeftParen, 0); - } + 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 RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } public statement(): StatementContext[]; public statement(i: number): StatementContext; public statement(i?: number): StatementContext | StatementContext[] { @@ -5830,16 +5276,12 @@ export class IfStatementContext extends KipperParserRuleContext { return this.getRuleContext(i, StatementContext); } } - public Else(): TerminalNode | undefined { - return this.tryGetToken(KipperParser.Else, 0); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_ifStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIfStatement) { @@ -5862,25 +5304,16 @@ export class IfStatementContext extends KipperParserRuleContext { } } + export class SwitchStatementContext extends KipperParserRuleContext { - public Switch(): TerminalNode { - return this.getToken(KipperParser.Switch, 0); - } - public LeftParen(): TerminalNode { - return this.getToken(KipperParser.LeftParen, 0); - } + 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 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[] { @@ -5894,9 +5327,7 @@ export class SwitchStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_switchStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_switchStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSwitchStatement) { @@ -5919,29 +5350,22 @@ export class SwitchStatementContext extends KipperParserRuleContext { } } + export class SwitchLabeledStatementContext extends KipperParserRuleContext { - public Case(): TerminalNode | undefined { - return this.tryGetToken(KipperParser.Case, 0); - } + 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 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_switchLabeledStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSwitchLabeledStatement) { @@ -5964,6 +5388,7 @@ export class SwitchLabeledStatementContext extends KipperParserRuleContext { } } + export class IterationStatementContext extends KipperParserRuleContext { public forLoopIterationStatement(): ForLoopIterationStatementContext | undefined { return this.tryGetRuleContext(0, ForLoopIterationStatementContext); @@ -5978,9 +5403,7 @@ export class IterationStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_iterationStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_iterationStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIterationStatement) { @@ -6003,16 +5426,13 @@ export class IterationStatementContext extends KipperParserRuleContext { } } + 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 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[] { @@ -6022,9 +5442,7 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { return this.getToken(KipperParser.SemiColon, i); } } - public RightParen(): TerminalNode { - return this.getToken(KipperParser.RightParen, 0); - } + public RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } public statement(): StatementContext { return this.getRuleContext(0, StatementContext); } @@ -6044,9 +5462,7 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_forLoopIterationStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_forLoopIterationStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterForLoopIterationStatement) { @@ -6069,19 +5485,14 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { } } + export class WhileLoopIterationStatementContext extends KipperParserRuleContext { - public While(): TerminalNode { - return this.getToken(KipperParser.While, 0); - } - public LeftParen(): TerminalNode { - return this.getToken(KipperParser.LeftParen, 0); - } + 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 RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } public statement(): StatementContext { return this.getRuleContext(0, StatementContext); } @@ -6089,9 +5500,7 @@ export class WhileLoopIterationStatementContext extends KipperParserRuleContext super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_whileLoopIterationStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_whileLoopIterationStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterWhileLoopIterationStatement) { @@ -6114,35 +5523,24 @@ export class WhileLoopIterationStatementContext extends KipperParserRuleContext } } + export class DoWhileLoopIterationStatementContext extends KipperParserRuleContext { - public Do(): TerminalNode { - return this.getToken(KipperParser.Do, 0); - } + 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 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_doWhileLoopIterationStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDoWhileLoopIterationStatement) { @@ -6165,23 +5563,16 @@ export class DoWhileLoopIterationStatementContext extends KipperParserRuleContex } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_jumpStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterJumpStatement) { @@ -6204,13 +5595,10 @@ export class JumpStatementContext extends KipperParserRuleContext { } } + export class ReturnStatementContext extends KipperParserRuleContext { - public Return(): TerminalNode { - return this.getToken(KipperParser.Return, 0); - } - public SemiColon(): TerminalNode { - return this.getToken(KipperParser.SemiColon, 0); - } + 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); } @@ -6218,9 +5606,7 @@ export class ReturnStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_returnStatement; - } + public get ruleIndex(): number { return KipperParser.RULE_returnStatement; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterReturnStatement) { @@ -6243,6 +5629,7 @@ export class ReturnStatementContext extends KipperParserRuleContext { } } + export class PrimaryExpressionContext extends KipperParserRuleContext { public tangledPrimaryExpression(): TangledPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, TangledPrimaryExpressionContext); @@ -6275,9 +5662,7 @@ export class PrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_primaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_primaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPrimaryExpression) { @@ -6300,23 +5685,18 @@ export class PrimaryExpressionContext extends KipperParserRuleContext { } } + export class TangledPrimaryExpressionContext extends KipperParserRuleContext { - public LeftParen(): TerminalNode { - return this.getToken(KipperParser.LeftParen, 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 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; - } + public get ruleIndex(): number { return KipperParser.RULE_tangledPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTangledPrimaryExpression) { @@ -6339,20 +5719,15 @@ export class TangledPrimaryExpressionContext extends KipperParserRuleContext { } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_boolPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBoolPrimaryExpression) { @@ -6375,6 +5750,7 @@ export class BoolPrimaryExpressionContext extends KipperParserRuleContext { } } + export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext { public identifier(): IdentifierContext { return this.getRuleContext(0, IdentifierContext); @@ -6383,9 +5759,7 @@ export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_identifierPrimaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_identifierPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierPrimaryExpression) { @@ -6408,17 +5782,14 @@ export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext } } + export class IdentifierContext extends KipperParserRuleContext { - public Identifier(): TerminalNode { - return this.getToken(KipperParser.Identifier, 0); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_identifier; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifier) { @@ -6441,6 +5812,7 @@ export class IdentifierContext extends KipperParserRuleContext { } } + export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRuleContext { public identifier(): IdentifierContext | undefined { return this.tryGetRuleContext(0, IdentifierContext); @@ -6452,9 +5824,7 @@ export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRule super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_identifierOrStringPrimaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_identifierOrStringPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierOrStringPrimaryExpression) { @@ -6477,20 +5847,15 @@ export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRule } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_stringPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStringPrimaryExpression) { @@ -6513,13 +5878,10 @@ export class StringPrimaryExpressionContext extends KipperParserRuleContext { } } + 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 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[] { @@ -6529,12 +5891,8 @@ 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 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[] { @@ -6548,9 +5906,7 @@ export class FStringPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_fStringPrimaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_fStringPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringPrimaryExpression) { @@ -6573,16 +5929,11 @@ export class FStringPrimaryExpressionContext extends KipperParserRuleContext { } } + 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 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); } @@ -6590,9 +5941,7 @@ export class FStringSingleQuoteAtomContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_fStringSingleQuoteAtom; - } + public get ruleIndex(): number { return KipperParser.RULE_fStringSingleQuoteAtom; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringSingleQuoteAtom) { @@ -6615,16 +5964,11 @@ export class FStringSingleQuoteAtomContext extends KipperParserRuleContext { } } + 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 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); } @@ -6632,9 +5976,7 @@ export class FStringDoubleQuoteAtomContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_fStringDoubleQuoteAtom; - } + public get ruleIndex(): number { return KipperParser.RULE_fStringDoubleQuoteAtom; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringDoubleQuoteAtom) { @@ -6657,20 +5999,15 @@ export class FStringDoubleQuoteAtomContext extends KipperParserRuleContext { } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_numberPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterNumberPrimaryExpression) { @@ -6693,13 +6030,10 @@ export class NumberPrimaryExpressionContext extends KipperParserRuleContext { } } + export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { - public LeftBracket(): TerminalNode { - return this.getToken(KipperParser.LeftBracket, 0); - } - public RightBracket(): TerminalNode { - return this.getToken(KipperParser.RightBracket, 0); - } + 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[] { @@ -6722,9 +6056,7 @@ export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_arrayPrimaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_arrayPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterArrayPrimaryExpression) { @@ -6747,13 +6079,10 @@ export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { } } + export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { - public LeftBrace(): TerminalNode { - return this.getToken(KipperParser.LeftBrace, 0); - } - public RightBrace(): TerminalNode { - return this.getToken(KipperParser.RightBrace, 0); - } + 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[] { @@ -6776,9 +6105,7 @@ export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_objectPrimaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_objectPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterObjectPrimaryExpression) { @@ -6801,13 +6128,12 @@ export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { } } + export class ObjectPropertyContext extends KipperParserRuleContext { public identifierOrStringPrimaryExpression(): IdentifierOrStringPrimaryExpressionContext { return this.getRuleContext(0, IdentifierOrStringPrimaryExpressionContext); } - public Colon(): TerminalNode { - return this.getToken(KipperParser.Colon, 0); - } + public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } @@ -6815,9 +6141,7 @@ export class ObjectPropertyContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_objectProperty; - } + public get ruleIndex(): number { return KipperParser.RULE_objectProperty; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterObjectProperty) { @@ -6840,23 +6164,16 @@ export class ObjectPropertyContext extends KipperParserRuleContext { } } + export class VoidOrNullOrUndefinedPrimaryExpressionContext extends KipperParserRuleContext { - 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_voidOrNullOrUndefinedPrimaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterVoidOrNullOrUndefinedPrimaryExpression) { @@ -6879,15 +6196,14 @@ 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 get ruleIndex(): number { return KipperParser.RULE_computedPrimaryExpression; } public copyFrom(ctx: ComputedPrimaryExpressionContext): void { super.copyFrom(ctx); this._labelASTKind = ctx._labelASTKind; @@ -6926,12 +6242,8 @@ export class FunctionCallExpressionContext extends ComputedPrimaryExpressionCont 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 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); } @@ -6961,18 +6273,12 @@ export class FunctionCallExpressionContext extends ComputedPrimaryExpressionCont } } export class ExplicitCallFunctionCallExpressionContext extends ComputedPrimaryExpressionContext { - public CallFunc(): TerminalNode { - return this.getToken(KipperParser.CallFunc, 0); - } + 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 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); } @@ -7098,6 +6404,7 @@ export class SliceNotationMemberAccessExpressionContext extends ComputedPrimaryE } } + export class ArgumentExpressionListContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext[]; public assignmentExpression(i: number): AssignmentExpressionContext; @@ -7121,9 +6428,7 @@ export class ArgumentExpressionListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_argumentExpressionList; - } + public get ruleIndex(): number { return KipperParser.RULE_argumentExpressionList; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterArgumentExpressionList) { @@ -7146,10 +6451,9 @@ export class ArgumentExpressionListContext extends KipperParserRuleContext { } } + export class DotNotationContext extends KipperParserRuleContext { - public Dot(): TerminalNode { - return this.getToken(KipperParser.Dot, 0); - } + public Dot(): TerminalNode { return this.getToken(KipperParser.Dot, 0); } public identifier(): IdentifierContext { return this.getRuleContext(0, IdentifierContext); } @@ -7157,9 +6461,7 @@ export class DotNotationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_dotNotation; - } + public get ruleIndex(): number { return KipperParser.RULE_dotNotation; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDotNotation) { @@ -7182,23 +6484,18 @@ export class DotNotationContext extends KipperParserRuleContext { } } + export class BracketNotationContext extends KipperParserRuleContext { - public LeftBracket(): TerminalNode { - return this.getToken(KipperParser.LeftBracket, 0); - } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_bracketNotation; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBracketNotation) { @@ -7221,18 +6518,13 @@ 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 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[] { @@ -7246,9 +6538,7 @@ export class SliceNotationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_sliceNotation; - } + public get ruleIndex(): number { return KipperParser.RULE_sliceNotation; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSliceNotation) { @@ -7271,6 +6561,7 @@ export class SliceNotationContext extends KipperParserRuleContext { } } + export class PostfixExpressionContext extends KipperParserRuleContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, ComputedPrimaryExpressionContext); @@ -7282,9 +6573,7 @@ export class PostfixExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_postfixExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_postfixExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPostfixExpression) { @@ -7307,6 +6596,7 @@ export class PostfixExpressionContext extends KipperParserRuleContext { } } + export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRuleContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext { return this.getRuleContext(0, ComputedPrimaryExpressionContext); @@ -7318,9 +6608,7 @@ export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRu super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_incrementOrDecrementPostfixExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementPostfixExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementPostfixExpression) { @@ -7343,6 +6631,7 @@ export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRu } } + export class UnaryExpressionContext extends KipperParserRuleContext { public postfixExpression(): PostfixExpressionContext | undefined { return this.tryGetRuleContext(0, PostfixExpressionContext); @@ -7357,9 +6646,7 @@ export class UnaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_unaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_unaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterUnaryExpression) { @@ -7382,6 +6669,7 @@ export class UnaryExpressionContext extends KipperParserRuleContext { } } + export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRuleContext { public incrementOrDecrementOperator(): IncrementOrDecrementOperatorContext { return this.getRuleContext(0, IncrementOrDecrementOperatorContext); @@ -7393,9 +6681,7 @@ export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRule super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_incrementOrDecrementUnaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementUnaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementUnaryExpression) { @@ -7418,6 +6704,7 @@ export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRule } } + export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleContext { public unaryOperator(): UnaryOperatorContext { return this.getRuleContext(0, UnaryOperatorContext); @@ -7429,9 +6716,7 @@ export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleCont super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_operatorModifiedUnaryExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_operatorModifiedUnaryExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterOperatorModifiedUnaryExpression) { @@ -7454,20 +6739,15 @@ export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleCont } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementOperator; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementOperator) { @@ -7490,26 +6770,17 @@ export class IncrementOrDecrementOperatorContext extends KipperParserRuleContext } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_unaryOperator; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterUnaryOperator) { @@ -7532,14 +6803,13 @@ export class UnaryOperatorContext extends KipperParserRuleContext { } } + export class CastOrConvertExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_castOrConvertExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_castOrConvertExpression; } public copyFrom(ctx: CastOrConvertExpressionContext): void { super.copyFrom(ctx); } @@ -7577,9 +6847,7 @@ export class ActualCastOrConvertExpressionContext extends CastOrConvertExpressio public unaryExpression(): UnaryExpressionContext { return this.getRuleContext(0, UnaryExpressionContext); } - public As(): TerminalNode { - return this.getToken(KipperParser.As, 0); - } + public As(): TerminalNode { return this.getToken(KipperParser.As, 0); } public typeSpecifierExpression(): TypeSpecifierExpressionContext { return this.getRuleContext(0, TypeSpecifierExpressionContext); } @@ -7609,14 +6877,13 @@ export class ActualCastOrConvertExpressionContext extends CastOrConvertExpressio } } + export class MultiplicativeExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_multiplicativeExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_multiplicativeExpression; } public copyFrom(ctx: MultiplicativeExpressionContext): void { super.copyFrom(ctx); } @@ -7657,18 +6924,10 @@ export class ActualMultiplicativeExpressionContext extends MultiplicativeExpress 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); - } + 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); @@ -7695,14 +6954,13 @@ export class ActualMultiplicativeExpressionContext extends MultiplicativeExpress } } + export class AdditiveExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_additiveExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_additiveExpression; } public copyFrom(ctx: AdditiveExpressionContext): void { super.copyFrom(ctx); } @@ -7743,12 +7001,8 @@ export class ActualAdditiveExpressionContext extends 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); - } + 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); @@ -7775,14 +7029,13 @@ export class ActualAdditiveExpressionContext extends AdditiveExpressionContext { } } + export class BitwiseShiftExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_bitwiseShiftExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_bitwiseShiftExpression; } public copyFrom(ctx: BitwiseShiftExpressionContext): void { super.copyFrom(ctx); } @@ -7852,23 +7105,16 @@ export class ActualBitwiseShiftExpressionContext extends BitwiseShiftExpressionC } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_bitwiseShiftOperators; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBitwiseShiftOperators) { @@ -7891,14 +7137,13 @@ export class BitwiseShiftOperatorsContext extends KipperParserRuleContext { } } + export class RelationalExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_relationalExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_relationalExpression; } public copyFrom(ctx: RelationalExpressionContext): void { super.copyFrom(ctx); } @@ -7939,18 +7184,10 @@ export class ActualRelationalExpressionContext extends RelationalExpressionConte 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); - } + 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); @@ -7977,14 +7214,13 @@ export class ActualRelationalExpressionContext extends RelationalExpressionConte } } + export class EqualityExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_equalityExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_equalityExpression; } public copyFrom(ctx: EqualityExpressionContext): void { super.copyFrom(ctx); } @@ -8025,12 +7261,8 @@ export class ActualEqualityExpressionContext extends 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); - } + 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); @@ -8057,14 +7289,13 @@ export class ActualEqualityExpressionContext extends EqualityExpressionContext { } } + export class BitwiseAndExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_bitwiseAndExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_bitwiseAndExpression; } public copyFrom(ctx: BitwiseAndExpressionContext): void { super.copyFrom(ctx); } @@ -8102,9 +7333,7 @@ export class ActualBitwiseAndExpressionContext extends BitwiseAndExpressionConte public bitwiseAndExpression(): BitwiseAndExpressionContext { return this.getRuleContext(0, BitwiseAndExpressionContext); } - public BitwiseAnd(): TerminalNode { - return this.getToken(KipperParser.BitwiseAnd, 0); - } + public BitwiseAnd(): TerminalNode { return this.getToken(KipperParser.BitwiseAnd, 0); } public equalityExpression(): EqualityExpressionContext { return this.getRuleContext(0, EqualityExpressionContext); } @@ -8134,14 +7363,13 @@ export class ActualBitwiseAndExpressionContext extends BitwiseAndExpressionConte } } + export class BitwiseXorExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_bitwiseXorExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_bitwiseXorExpression; } public copyFrom(ctx: BitwiseXorExpressionContext): void { super.copyFrom(ctx); } @@ -8179,9 +7407,7 @@ export class ActualBitwiseXorExpressionContext extends BitwiseXorExpressionConte public bitwiseXorExpression(): BitwiseXorExpressionContext { return this.getRuleContext(0, BitwiseXorExpressionContext); } - public BitwiseXor(): TerminalNode { - return this.getToken(KipperParser.BitwiseXor, 0); - } + public BitwiseXor(): TerminalNode { return this.getToken(KipperParser.BitwiseXor, 0); } public bitwiseAndExpression(): BitwiseAndExpressionContext { return this.getRuleContext(0, BitwiseAndExpressionContext); } @@ -8211,14 +7437,13 @@ export class ActualBitwiseXorExpressionContext extends BitwiseXorExpressionConte } } + export class BitwiseOrExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_bitwiseOrExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_bitwiseOrExpression; } public copyFrom(ctx: BitwiseOrExpressionContext): void { super.copyFrom(ctx); } @@ -8256,9 +7481,7 @@ export class ActualBitwiseOrExpressionContext extends BitwiseOrExpressionContext public bitwiseOrExpression(): BitwiseOrExpressionContext { return this.getRuleContext(0, BitwiseOrExpressionContext); } - public BitwiseOr(): TerminalNode { - return this.getToken(KipperParser.BitwiseOr, 0); - } + public BitwiseOr(): TerminalNode { return this.getToken(KipperParser.BitwiseOr, 0); } public bitwiseXorExpression(): BitwiseXorExpressionContext { return this.getRuleContext(0, BitwiseXorExpressionContext); } @@ -8288,14 +7511,13 @@ export class ActualBitwiseOrExpressionContext extends BitwiseOrExpressionContext } } + export class LogicalAndExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_logicalAndExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_logicalAndExpression; } public copyFrom(ctx: LogicalAndExpressionContext): void { super.copyFrom(ctx); } @@ -8333,9 +7555,7 @@ export class ActualLogicalAndExpressionContext extends LogicalAndExpressionConte public logicalAndExpression(): LogicalAndExpressionContext { return this.getRuleContext(0, LogicalAndExpressionContext); } - public AndAnd(): TerminalNode { - return this.getToken(KipperParser.AndAnd, 0); - } + public AndAnd(): TerminalNode { return this.getToken(KipperParser.AndAnd, 0); } public bitwiseOrExpression(): BitwiseOrExpressionContext { return this.getRuleContext(0, BitwiseOrExpressionContext); } @@ -8365,14 +7585,13 @@ export class ActualLogicalAndExpressionContext extends LogicalAndExpressionConte } } + export class LogicalOrExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_logicalOrExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_logicalOrExpression; } public copyFrom(ctx: LogicalOrExpressionContext): void { super.copyFrom(ctx); } @@ -8410,9 +7629,7 @@ export class ActualLogicalOrExpressionContext extends LogicalOrExpressionContext public logicalOrExpression(): LogicalOrExpressionContext { return this.getRuleContext(0, LogicalOrExpressionContext); } - public OrOr(): TerminalNode { - return this.getToken(KipperParser.OrOr, 0); - } + public OrOr(): TerminalNode { return this.getToken(KipperParser.OrOr, 0); } public logicalAndExpression(): LogicalAndExpressionContext { return this.getRuleContext(0, LogicalAndExpressionContext); } @@ -8442,14 +7659,13 @@ export class ActualLogicalOrExpressionContext extends LogicalOrExpressionContext } } + export class ConditionalExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_conditionalExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_conditionalExpression; } public copyFrom(ctx: ConditionalExpressionContext): void { super.copyFrom(ctx); } @@ -8487,9 +7703,7 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon public logicalOrExpression(): LogicalOrExpressionContext { return this.getRuleContext(0, LogicalOrExpressionContext); } - public QuestionMark(): TerminalNode { - return this.getToken(KipperParser.QuestionMark, 0); - } + public QuestionMark(): TerminalNode { return this.getToken(KipperParser.QuestionMark, 0); } public conditionalExpression(): ConditionalExpressionContext[]; public conditionalExpression(i: number): ConditionalExpressionContext; public conditionalExpression(i?: number): ConditionalExpressionContext | ConditionalExpressionContext[] { @@ -8499,9 +7713,7 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon return this.getRuleContext(i, ConditionalExpressionContext); } } - public Colon(): TerminalNode { - return this.getToken(KipperParser.Colon, 0); - } + public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } constructor(ctx: ConditionalExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); @@ -8528,14 +7740,13 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon } } + export class AssignmentExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_assignmentExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_assignmentExpression; } public copyFrom(ctx: AssignmentExpressionContext): void { super.copyFrom(ctx); } @@ -8605,32 +7816,19 @@ export class ActualAssignmentExpressionContext extends AssignmentExpressionConte } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_assignmentOperator; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterAssignmentOperator) { @@ -8653,6 +7851,7 @@ export class AssignmentOperatorContext extends KipperParserRuleContext { } } + export class ExpressionContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext[]; public assignmentExpression(i: number): AssignmentExpressionContext; @@ -8676,9 +7875,7 @@ export class ExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_expression; - } + public get ruleIndex(): number { return KipperParser.RULE_expression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterExpression) { @@ -8701,6 +7898,7 @@ export class ExpressionContext extends KipperParserRuleContext { } } + export class TypeSpecifierExpressionContext extends KipperParserRuleContext { public identifierTypeSpecifierExpression(): IdentifierTypeSpecifierExpressionContext | undefined { return this.tryGetRuleContext(0, IdentifierTypeSpecifierExpressionContext); @@ -8715,9 +7913,7 @@ export class TypeSpecifierExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_typeSpecifierExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_typeSpecifierExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeSpecifierExpression) { @@ -8740,6 +7936,7 @@ export class TypeSpecifierExpressionContext extends KipperParserRuleContext { } } + export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleContext { public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext { return this.getRuleContext(0, TypeSpecifierIdentifierContext); @@ -8748,9 +7945,7 @@ export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleCo super(parent, invokingState); } // @Override - public get ruleIndex(): number { - return KipperParser.RULE_identifierTypeSpecifierExpression; - } + public get ruleIndex(): number { return KipperParser.RULE_identifierTypeSpecifierExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierTypeSpecifierExpression) { @@ -8773,6 +7968,7 @@ export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleCo } } + export class GenericTypeSpecifierExpressionContext extends KipperParserRuleContext { public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext[]; public typeSpecifierIdentifier(i: number): TypeSpecifierIdentifierContext; @@ -8783,19 +7979,13 @@ 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_genericTypeSpecifierExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterGenericTypeSpecifierExpression) { @@ -8818,26 +8008,19 @@ export class GenericTypeSpecifierExpressionContext extends KipperParserRuleConte } } + export class TypeofTypeSpecifierExpressionContext extends KipperParserRuleContext { - public Typeof(): TerminalNode { - return this.getToken(KipperParser.Typeof, 0); - } - public LeftParen(): TerminalNode { - return this.getToken(KipperParser.LeftParen, 0); - } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_typeofTypeSpecifierExpression; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeofTypeSpecifierExpression) { @@ -8860,26 +8043,17 @@ export class TypeofTypeSpecifierExpressionContext extends KipperParserRuleContex } } + 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); - } + 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; - } + public get ruleIndex(): number { return KipperParser.RULE_typeSpecifierIdentifier; } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeSpecifierIdentifier) { @@ -8901,3 +8075,5 @@ export class TypeSpecifierIdentifierContext extends KipperParserRuleContext { } } } + + diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParserListener.ts b/kipper/core/src/compiler/lexer-parser/antlr/KipperParserListener.ts index 16caac934..2ff067774 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParserListener.ts +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParserListener.ts @@ -1,123 +1,126 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT -// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax -// kind values. + + // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax + // kind values. + import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; + import KipperParserBase from "./base/KipperParserBase"; + import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; -import { - ActualAdditiveExpressionContext, - ActualAssignmentExpressionContext, - ActualBitwiseAndExpressionContext, - ActualBitwiseOrExpressionContext, - ActualBitwiseShiftExpressionContext, - ActualBitwiseXorExpressionContext, - ActualCastOrConvertExpressionContext, - ActualConditionalExpressionContext, - ActualEqualityExpressionContext, - ActualLogicalAndExpressionContext, - ActualLogicalOrExpressionContext, - ActualMultiplicativeExpressionContext, - ActualRelationalExpressionContext, - AdditiveExpressionContext, - ArgumentExpressionListContext, - ArrayPrimaryExpressionContext, - AssignmentExpressionContext, - AssignmentOperatorContext, - BitwiseAndExpressionContext, - BitwiseOrExpressionContext, - BitwiseShiftExpressionContext, - BitwiseShiftOperatorsContext, - BitwiseXorExpressionContext, - BlockItemContext, - BlockItemListContext, - BoolPrimaryExpressionContext, - BracketNotationContext, - BracketNotationMemberAccessExpressionContext, - CastOrConvertExpressionContext, - ClassDeclarationContext, - CompilationUnitContext, - CompoundStatementContext, - ComputedPrimaryExpressionContext, - ConditionalExpressionContext, - DeclarationContext, - DeclaratorContext, - DirectDeclaratorContext, - DotNotationContext, - DotNotationMemberAccessExpressionContext, - DoWhileLoopIterationStatementContext, - EqualityExpressionContext, - ExplicitCallFunctionCallExpressionContext, - ExpressionContext, - ExpressionStatementContext, - ExternalBlockItemContext, - ExternalItemContext, - ForLoopIterationStatementContext, - FStringDoubleQuoteAtomContext, - FStringPrimaryExpressionContext, - FStringSingleQuoteAtomContext, - FunctionCallExpressionContext, - FunctionDeclarationContext, - GenericTypeSpecifierExpressionContext, - IdentifierContext, - IdentifierOrStringPrimaryExpressionContext, - IdentifierPrimaryExpressionContext, - IdentifierTypeSpecifierExpressionContext, - IfStatementContext, - IncrementOrDecrementOperatorContext, - IncrementOrDecrementPostfixExpressionContext, - IncrementOrDecrementUnaryExpressionContext, - InitDeclaratorContext, - InitializerContext, - InterfaceDeclarationContext, - IterationStatementContext, - JumpStatementContext, - LogicalAndExpressionContext, - LogicalOrExpressionContext, - MultiplicativeExpressionContext, - NumberPrimaryExpressionContext, - ObjectPrimaryExpressionContext, - ObjectPropertyContext, - OperatorModifiedUnaryExpressionContext, - ParameterDeclarationContext, - ParameterListContext, - PassOnAdditiveExpressionContext, - PassOnAssignmentExpressionContext, - PassOnBitwiseAndExpressionContext, - PassOnBitwiseOrExpressionContext, - PassOnBitwiseShiftExpressionContext, - PassOnBitwiseXorExpressionContext, - PassOnCastOrConvertExpressionContext, - PassOncomputedPrimaryExpressionContext, - PassOnConditionalExpressionContext, - PassOnEqualityExpressionContext, - PassOnLogicalAndExpressionContext, - PassOnLogicalOrExpressionContext, - PassOnMultiplicativeExpressionContext, - PassOnRelationalExpressionContext, - PostfixExpressionContext, - PrimaryExpressionContext, - RelationalExpressionContext, - ReturnStatementContext, - SelectionStatementContext, - SliceNotationContext, - SliceNotationMemberAccessExpressionContext, - StatementContext, - StorageTypeSpecifierContext, - StringPrimaryExpressionContext, - SwitchLabeledStatementContext, - SwitchStatementContext, - TangledPrimaryExpressionContext, - TranslationUnitContext, - TypeofTypeSpecifierExpressionContext, - TypeSpecifierExpressionContext, - TypeSpecifierIdentifierContext, - UnaryExpressionContext, - UnaryOperatorContext, - VariableDeclarationContext, - VoidOrNullOrUndefinedPrimaryExpressionContext, - WhileLoopIterationStatementContext, -} from "./KipperParser"; +import { PassOnBitwiseShiftExpressionContext } from "./KipperParser"; +import { ActualBitwiseShiftExpressionContext } from "./KipperParser"; +import { PassOnBitwiseAndExpressionContext } from "./KipperParser"; +import { ActualBitwiseAndExpressionContext } from "./KipperParser"; +import { PassOnLogicalAndExpressionContext } from "./KipperParser"; +import { ActualLogicalAndExpressionContext } from "./KipperParser"; +import { PassOnBitwiseXorExpressionContext } from "./KipperParser"; +import { ActualBitwiseXorExpressionContext } from "./KipperParser"; +import { ExternalBlockItemContext } from "./KipperParser"; +import { PassOncomputedPrimaryExpressionContext } from "./KipperParser"; +import { FunctionCallExpressionContext } from "./KipperParser"; +import { ExplicitCallFunctionCallExpressionContext } from "./KipperParser"; +import { DotNotationMemberAccessExpressionContext } from "./KipperParser"; +import { BracketNotationMemberAccessExpressionContext } from "./KipperParser"; +import { SliceNotationMemberAccessExpressionContext } from "./KipperParser"; +import { PassOnAssignmentExpressionContext } from "./KipperParser"; +import { ActualAssignmentExpressionContext } from "./KipperParser"; +import { PassOnCastOrConvertExpressionContext } from "./KipperParser"; +import { ActualCastOrConvertExpressionContext } from "./KipperParser"; +import { PassOnBitwiseOrExpressionContext } from "./KipperParser"; +import { ActualBitwiseOrExpressionContext } from "./KipperParser"; +import { PassOnEqualityExpressionContext } from "./KipperParser"; +import { ActualEqualityExpressionContext } from "./KipperParser"; +import { PassOnAdditiveExpressionContext } from "./KipperParser"; +import { ActualAdditiveExpressionContext } from "./KipperParser"; +import { PassOnRelationalExpressionContext } from "./KipperParser"; +import { ActualRelationalExpressionContext } from "./KipperParser"; +import { PassOnConditionalExpressionContext } from "./KipperParser"; +import { ActualConditionalExpressionContext } from "./KipperParser"; +import { PassOnMultiplicativeExpressionContext } from "./KipperParser"; +import { ActualMultiplicativeExpressionContext } from "./KipperParser"; +import { PassOnLogicalOrExpressionContext } from "./KipperParser"; +import { ActualLogicalOrExpressionContext } from "./KipperParser"; +import { CompilationUnitContext } from "./KipperParser"; +import { TranslationUnitContext } from "./KipperParser"; +import { ExternalItemContext } from "./KipperParser"; +import { BlockItemListContext } from "./KipperParser"; +import { BlockItemContext } from "./KipperParser"; +import { DeclarationContext } from "./KipperParser"; +import { VariableDeclarationContext } from "./KipperParser"; +import { StorageTypeSpecifierContext } from "./KipperParser"; +import { InitDeclaratorContext } from "./KipperParser"; +import { InitializerContext } from "./KipperParser"; +import { DeclaratorContext } from "./KipperParser"; +import { DirectDeclaratorContext } from "./KipperParser"; +import { FunctionDeclarationContext } from "./KipperParser"; +import { ParameterListContext } from "./KipperParser"; +import { ParameterDeclarationContext } from "./KipperParser"; +import { InterfaceDeclarationContext } from "./KipperParser"; +import { ClassDeclarationContext } from "./KipperParser"; +import { StatementContext } from "./KipperParser"; +import { CompoundStatementContext } from "./KipperParser"; +import { ExpressionStatementContext } from "./KipperParser"; +import { SelectionStatementContext } from "./KipperParser"; +import { IfStatementContext } from "./KipperParser"; +import { SwitchStatementContext } from "./KipperParser"; +import { SwitchLabeledStatementContext } from "./KipperParser"; +import { IterationStatementContext } from "./KipperParser"; +import { ForLoopIterationStatementContext } from "./KipperParser"; +import { WhileLoopIterationStatementContext } from "./KipperParser"; +import { DoWhileLoopIterationStatementContext } from "./KipperParser"; +import { JumpStatementContext } from "./KipperParser"; +import { ReturnStatementContext } from "./KipperParser"; +import { PrimaryExpressionContext } from "./KipperParser"; +import { TangledPrimaryExpressionContext } from "./KipperParser"; +import { BoolPrimaryExpressionContext } from "./KipperParser"; +import { IdentifierPrimaryExpressionContext } from "./KipperParser"; +import { IdentifierContext } from "./KipperParser"; +import { IdentifierOrStringPrimaryExpressionContext } from "./KipperParser"; +import { StringPrimaryExpressionContext } from "./KipperParser"; +import { FStringPrimaryExpressionContext } from "./KipperParser"; +import { FStringSingleQuoteAtomContext } from "./KipperParser"; +import { FStringDoubleQuoteAtomContext } from "./KipperParser"; +import { NumberPrimaryExpressionContext } from "./KipperParser"; +import { ArrayPrimaryExpressionContext } from "./KipperParser"; +import { ObjectPrimaryExpressionContext } from "./KipperParser"; +import { ObjectPropertyContext } from "./KipperParser"; +import { VoidOrNullOrUndefinedPrimaryExpressionContext } from "./KipperParser"; +import { ComputedPrimaryExpressionContext } from "./KipperParser"; +import { ArgumentExpressionListContext } from "./KipperParser"; +import { DotNotationContext } from "./KipperParser"; +import { BracketNotationContext } from "./KipperParser"; +import { SliceNotationContext } from "./KipperParser"; +import { PostfixExpressionContext } from "./KipperParser"; +import { IncrementOrDecrementPostfixExpressionContext } from "./KipperParser"; +import { UnaryExpressionContext } from "./KipperParser"; +import { IncrementOrDecrementUnaryExpressionContext } from "./KipperParser"; +import { OperatorModifiedUnaryExpressionContext } from "./KipperParser"; +import { IncrementOrDecrementOperatorContext } from "./KipperParser"; +import { UnaryOperatorContext } from "./KipperParser"; +import { CastOrConvertExpressionContext } from "./KipperParser"; +import { MultiplicativeExpressionContext } from "./KipperParser"; +import { AdditiveExpressionContext } from "./KipperParser"; +import { BitwiseShiftExpressionContext } from "./KipperParser"; +import { BitwiseShiftOperatorsContext } from "./KipperParser"; +import { RelationalExpressionContext } from "./KipperParser"; +import { EqualityExpressionContext } from "./KipperParser"; +import { BitwiseAndExpressionContext } from "./KipperParser"; +import { BitwiseXorExpressionContext } from "./KipperParser"; +import { BitwiseOrExpressionContext } from "./KipperParser"; +import { LogicalAndExpressionContext } from "./KipperParser"; +import { LogicalOrExpressionContext } from "./KipperParser"; +import { ConditionalExpressionContext } from "./KipperParser"; +import { AssignmentExpressionContext } from "./KipperParser"; +import { AssignmentOperatorContext } from "./KipperParser"; +import { ExpressionContext } from "./KipperParser"; +import { TypeSpecifierExpressionContext } from "./KipperParser"; +import { IdentifierTypeSpecifierExpressionContext } from "./KipperParser"; +import { GenericTypeSpecifierExpressionContext } from "./KipperParser"; +import { TypeofTypeSpecifierExpressionContext } from "./KipperParser"; +import { TypeSpecifierIdentifierContext } from "./KipperParser"; + /** * This interface defines a complete listener for a parse tree produced by @@ -1411,3 +1414,4 @@ export interface KipperParserListener extends ParseTreeListener { */ exitTypeSpecifierIdentifier?: (ctx: TypeSpecifierIdentifierContext) => void; } + diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParserVisitor.ts b/kipper/core/src/compiler/lexer-parser/antlr/KipperParserVisitor.ts index 4ddfe78c1..a8273d0fb 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParserVisitor.ts +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParserVisitor.ts @@ -1,123 +1,126 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT -// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax -// kind values. + + // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax + // kind values. + import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; + import KipperParserBase from "./base/KipperParserBase"; + import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; -import { - ActualAdditiveExpressionContext, - ActualAssignmentExpressionContext, - ActualBitwiseAndExpressionContext, - ActualBitwiseOrExpressionContext, - ActualBitwiseShiftExpressionContext, - ActualBitwiseXorExpressionContext, - ActualCastOrConvertExpressionContext, - ActualConditionalExpressionContext, - ActualEqualityExpressionContext, - ActualLogicalAndExpressionContext, - ActualLogicalOrExpressionContext, - ActualMultiplicativeExpressionContext, - ActualRelationalExpressionContext, - AdditiveExpressionContext, - ArgumentExpressionListContext, - ArrayPrimaryExpressionContext, - AssignmentExpressionContext, - AssignmentOperatorContext, - BitwiseAndExpressionContext, - BitwiseOrExpressionContext, - BitwiseShiftExpressionContext, - BitwiseShiftOperatorsContext, - BitwiseXorExpressionContext, - BlockItemContext, - BlockItemListContext, - BoolPrimaryExpressionContext, - BracketNotationContext, - BracketNotationMemberAccessExpressionContext, - CastOrConvertExpressionContext, - ClassDeclarationContext, - CompilationUnitContext, - CompoundStatementContext, - ComputedPrimaryExpressionContext, - ConditionalExpressionContext, - DeclarationContext, - DeclaratorContext, - DirectDeclaratorContext, - DotNotationContext, - DotNotationMemberAccessExpressionContext, - DoWhileLoopIterationStatementContext, - EqualityExpressionContext, - ExplicitCallFunctionCallExpressionContext, - ExpressionContext, - ExpressionStatementContext, - ExternalBlockItemContext, - ExternalItemContext, - ForLoopIterationStatementContext, - FStringDoubleQuoteAtomContext, - FStringPrimaryExpressionContext, - FStringSingleQuoteAtomContext, - FunctionCallExpressionContext, - FunctionDeclarationContext, - GenericTypeSpecifierExpressionContext, - IdentifierContext, - IdentifierOrStringPrimaryExpressionContext, - IdentifierPrimaryExpressionContext, - IdentifierTypeSpecifierExpressionContext, - IfStatementContext, - IncrementOrDecrementOperatorContext, - IncrementOrDecrementPostfixExpressionContext, - IncrementOrDecrementUnaryExpressionContext, - InitDeclaratorContext, - InitializerContext, - InterfaceDeclarationContext, - IterationStatementContext, - JumpStatementContext, - LogicalAndExpressionContext, - LogicalOrExpressionContext, - MultiplicativeExpressionContext, - NumberPrimaryExpressionContext, - ObjectPrimaryExpressionContext, - ObjectPropertyContext, - OperatorModifiedUnaryExpressionContext, - ParameterDeclarationContext, - ParameterListContext, - PassOnAdditiveExpressionContext, - PassOnAssignmentExpressionContext, - PassOnBitwiseAndExpressionContext, - PassOnBitwiseOrExpressionContext, - PassOnBitwiseShiftExpressionContext, - PassOnBitwiseXorExpressionContext, - PassOnCastOrConvertExpressionContext, - PassOncomputedPrimaryExpressionContext, - PassOnConditionalExpressionContext, - PassOnEqualityExpressionContext, - PassOnLogicalAndExpressionContext, - PassOnLogicalOrExpressionContext, - PassOnMultiplicativeExpressionContext, - PassOnRelationalExpressionContext, - PostfixExpressionContext, - PrimaryExpressionContext, - RelationalExpressionContext, - ReturnStatementContext, - SelectionStatementContext, - SliceNotationContext, - SliceNotationMemberAccessExpressionContext, - StatementContext, - StorageTypeSpecifierContext, - StringPrimaryExpressionContext, - SwitchLabeledStatementContext, - SwitchStatementContext, - TangledPrimaryExpressionContext, - TranslationUnitContext, - TypeofTypeSpecifierExpressionContext, - TypeSpecifierExpressionContext, - TypeSpecifierIdentifierContext, - UnaryExpressionContext, - UnaryOperatorContext, - VariableDeclarationContext, - VoidOrNullOrUndefinedPrimaryExpressionContext, - WhileLoopIterationStatementContext, -} from "./KipperParser"; +import { PassOnBitwiseShiftExpressionContext } from "./KipperParser"; +import { ActualBitwiseShiftExpressionContext } from "./KipperParser"; +import { PassOnBitwiseAndExpressionContext } from "./KipperParser"; +import { ActualBitwiseAndExpressionContext } from "./KipperParser"; +import { PassOnLogicalAndExpressionContext } from "./KipperParser"; +import { ActualLogicalAndExpressionContext } from "./KipperParser"; +import { PassOnBitwiseXorExpressionContext } from "./KipperParser"; +import { ActualBitwiseXorExpressionContext } from "./KipperParser"; +import { ExternalBlockItemContext } from "./KipperParser"; +import { PassOncomputedPrimaryExpressionContext } from "./KipperParser"; +import { FunctionCallExpressionContext } from "./KipperParser"; +import { ExplicitCallFunctionCallExpressionContext } from "./KipperParser"; +import { DotNotationMemberAccessExpressionContext } from "./KipperParser"; +import { BracketNotationMemberAccessExpressionContext } from "./KipperParser"; +import { SliceNotationMemberAccessExpressionContext } from "./KipperParser"; +import { PassOnAssignmentExpressionContext } from "./KipperParser"; +import { ActualAssignmentExpressionContext } from "./KipperParser"; +import { PassOnCastOrConvertExpressionContext } from "./KipperParser"; +import { ActualCastOrConvertExpressionContext } from "./KipperParser"; +import { PassOnBitwiseOrExpressionContext } from "./KipperParser"; +import { ActualBitwiseOrExpressionContext } from "./KipperParser"; +import { PassOnEqualityExpressionContext } from "./KipperParser"; +import { ActualEqualityExpressionContext } from "./KipperParser"; +import { PassOnAdditiveExpressionContext } from "./KipperParser"; +import { ActualAdditiveExpressionContext } from "./KipperParser"; +import { PassOnRelationalExpressionContext } from "./KipperParser"; +import { ActualRelationalExpressionContext } from "./KipperParser"; +import { PassOnConditionalExpressionContext } from "./KipperParser"; +import { ActualConditionalExpressionContext } from "./KipperParser"; +import { PassOnMultiplicativeExpressionContext } from "./KipperParser"; +import { ActualMultiplicativeExpressionContext } from "./KipperParser"; +import { PassOnLogicalOrExpressionContext } from "./KipperParser"; +import { ActualLogicalOrExpressionContext } from "./KipperParser"; +import { CompilationUnitContext } from "./KipperParser"; +import { TranslationUnitContext } from "./KipperParser"; +import { ExternalItemContext } from "./KipperParser"; +import { BlockItemListContext } from "./KipperParser"; +import { BlockItemContext } from "./KipperParser"; +import { DeclarationContext } from "./KipperParser"; +import { VariableDeclarationContext } from "./KipperParser"; +import { StorageTypeSpecifierContext } from "./KipperParser"; +import { InitDeclaratorContext } from "./KipperParser"; +import { InitializerContext } from "./KipperParser"; +import { DeclaratorContext } from "./KipperParser"; +import { DirectDeclaratorContext } from "./KipperParser"; +import { FunctionDeclarationContext } from "./KipperParser"; +import { ParameterListContext } from "./KipperParser"; +import { ParameterDeclarationContext } from "./KipperParser"; +import { InterfaceDeclarationContext } from "./KipperParser"; +import { ClassDeclarationContext } from "./KipperParser"; +import { StatementContext } from "./KipperParser"; +import { CompoundStatementContext } from "./KipperParser"; +import { ExpressionStatementContext } from "./KipperParser"; +import { SelectionStatementContext } from "./KipperParser"; +import { IfStatementContext } from "./KipperParser"; +import { SwitchStatementContext } from "./KipperParser"; +import { SwitchLabeledStatementContext } from "./KipperParser"; +import { IterationStatementContext } from "./KipperParser"; +import { ForLoopIterationStatementContext } from "./KipperParser"; +import { WhileLoopIterationStatementContext } from "./KipperParser"; +import { DoWhileLoopIterationStatementContext } from "./KipperParser"; +import { JumpStatementContext } from "./KipperParser"; +import { ReturnStatementContext } from "./KipperParser"; +import { PrimaryExpressionContext } from "./KipperParser"; +import { TangledPrimaryExpressionContext } from "./KipperParser"; +import { BoolPrimaryExpressionContext } from "./KipperParser"; +import { IdentifierPrimaryExpressionContext } from "./KipperParser"; +import { IdentifierContext } from "./KipperParser"; +import { IdentifierOrStringPrimaryExpressionContext } from "./KipperParser"; +import { StringPrimaryExpressionContext } from "./KipperParser"; +import { FStringPrimaryExpressionContext } from "./KipperParser"; +import { FStringSingleQuoteAtomContext } from "./KipperParser"; +import { FStringDoubleQuoteAtomContext } from "./KipperParser"; +import { NumberPrimaryExpressionContext } from "./KipperParser"; +import { ArrayPrimaryExpressionContext } from "./KipperParser"; +import { ObjectPrimaryExpressionContext } from "./KipperParser"; +import { ObjectPropertyContext } from "./KipperParser"; +import { VoidOrNullOrUndefinedPrimaryExpressionContext } from "./KipperParser"; +import { ComputedPrimaryExpressionContext } from "./KipperParser"; +import { ArgumentExpressionListContext } from "./KipperParser"; +import { DotNotationContext } from "./KipperParser"; +import { BracketNotationContext } from "./KipperParser"; +import { SliceNotationContext } from "./KipperParser"; +import { PostfixExpressionContext } from "./KipperParser"; +import { IncrementOrDecrementPostfixExpressionContext } from "./KipperParser"; +import { UnaryExpressionContext } from "./KipperParser"; +import { IncrementOrDecrementUnaryExpressionContext } from "./KipperParser"; +import { OperatorModifiedUnaryExpressionContext } from "./KipperParser"; +import { IncrementOrDecrementOperatorContext } from "./KipperParser"; +import { UnaryOperatorContext } from "./KipperParser"; +import { CastOrConvertExpressionContext } from "./KipperParser"; +import { MultiplicativeExpressionContext } from "./KipperParser"; +import { AdditiveExpressionContext } from "./KipperParser"; +import { BitwiseShiftExpressionContext } from "./KipperParser"; +import { BitwiseShiftOperatorsContext } from "./KipperParser"; +import { RelationalExpressionContext } from "./KipperParser"; +import { EqualityExpressionContext } from "./KipperParser"; +import { BitwiseAndExpressionContext } from "./KipperParser"; +import { BitwiseXorExpressionContext } from "./KipperParser"; +import { BitwiseOrExpressionContext } from "./KipperParser"; +import { LogicalAndExpressionContext } from "./KipperParser"; +import { LogicalOrExpressionContext } from "./KipperParser"; +import { ConditionalExpressionContext } from "./KipperParser"; +import { AssignmentExpressionContext } from "./KipperParser"; +import { AssignmentOperatorContext } from "./KipperParser"; +import { ExpressionContext } from "./KipperParser"; +import { TypeSpecifierExpressionContext } from "./KipperParser"; +import { IdentifierTypeSpecifierExpressionContext } from "./KipperParser"; +import { GenericTypeSpecifierExpressionContext } from "./KipperParser"; +import { TypeofTypeSpecifierExpressionContext } from "./KipperParser"; +import { TypeSpecifierIdentifierContext } from "./KipperParser"; + /** * This interface defines a complete generic visitor for a parse tree produced @@ -937,3 +940,4 @@ export interface KipperParserVisitor extends ParseTreeVisitor { */ visitTypeSpecifierIdentifier?: (ctx: TypeSpecifierIdentifierContext) => Result; } + 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 ffbb650b5..6edb70f51 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 @@ -25,15 +25,17 @@ export const ParseRuleKindMapping = { RULE_blockItemList: KipperParser.RULE_blockItemList, RULE_blockItem: KipperParser.RULE_blockItem, RULE_declaration: KipperParser.RULE_declaration, - RULE_functionDeclaration: KipperParser.RULE_functionDeclaration, RULE_variableDeclaration: KipperParser.RULE_variableDeclaration, RULE_storageTypeSpecifier: KipperParser.RULE_storageTypeSpecifier, + RULE_initDeclarator: KipperParser.RULE_initDeclarator, + RULE_initializer: KipperParser.RULE_initializer, RULE_declarator: KipperParser.RULE_declarator, RULE_directDeclarator: KipperParser.RULE_directDeclarator, - RULE_initDeclarator: KipperParser.RULE_initDeclarator, + RULE_functionDeclaration: KipperParser.RULE_functionDeclaration, RULE_parameterList: KipperParser.RULE_parameterList, RULE_parameterDeclaration: KipperParser.RULE_parameterDeclaration, - RULE_initializer: KipperParser.RULE_initializer, + RULE_interfaceDeclaration: KipperParser.RULE_interfaceDeclaration, + RULE_classDeclaration: KipperParser.RULE_classDeclaration, RULE_statement: KipperParser.RULE_statement, RULE_compoundStatement: KipperParser.RULE_compoundStatement, RULE_expressionStatement: KipperParser.RULE_expressionStatement, diff --git a/kipper/core/src/compiler/parser/antlr/KipperLexer.interp b/kipper/core/src/compiler/parser/antlr/KipperLexer.interp deleted file mode 100644 index 5a9bf7be0..000000000 --- a/kipper/core/src/compiler/parser/antlr/KipperLexer.interp +++ /dev/null @@ -1,308 +0,0 @@ -token literal names: -null -null -null -null -'const' -'var' -'as' -'...' -'switch' -'case' -'default' -'break' -'continue' -'do' -'while' -'if' -'else' -'for' -'enum' -'def' -'return' -'call' -'->' -'class' -'interface' -'true' -'false' -'typeof' -'void' -'null' -'undefined' -',' -';' -'?' -':' -'(' -')' -'[' -']' -null -'{' -'}' -'+' -'++' -'-' -'--' -'*' -'/' -'%' -'**' -'&&' -'||' -'!' -'=' -'+=' -'-=' -'*=' -'/=' -'%=' -'==' -'!=' -'<' -'<=' -'>' -'>=' -'&' -'|' -'^' -'~' -'<<' -'>>' -'>>>' -'.' -null -null -null -null -null -null -null -null -null -null -null -null -null - -token symbolic names: -null -FStringExpStart -BlockComment -LineComment -Const -Var -As -Spread -Switch -Case -Default -Break -Continue -Do -While -If -Else -For -Enum -DefFunc -Return -CallFunc -RetIndicator -Class -Interface -True -False -Typeof -Void -Null -Undefined -Comma -SemiColon -QuestionMark -Colon -LeftParen -RightParen -LeftBracket -RightBracket -FStringExpEnd -LeftBrace -RightBrace -Plus -PlusPlus -Minus -MinusMinus -Star -Div -Mod -PowerTo -AndAnd -OrOr -Not -Assign -PlusAssign -MinusAssign -StarAssign -DivAssign -ModAssign -Equal -NotEqual -Less -LessEqual -Greater -GreaterEqual -BitwiseAnd -BitwiseOr -BitwiseXor -BitwiseNot -BitwiseZeroFillLeftShift -BitwiseSignedRightShift -BitwiseZeroFillRightShift -Dot -Identifier -IntegerConstant -SingleQuoteStringLiteral -DoubleQuoteStringLiteral -FloatingConstant -Whitespace -Newline -FStringSingleQuoteStart -FStringDoubleQuoteStart -FStringSingleQuoteEnd -FStringSingleQuoteAtom -FStringDoubleQuoteEnd -FStringDoubleQuoteAtom - -rule names: -BlockComment -LineComment -Const -Var -As -Spread -Switch -Case -Default -Break -Continue -Do -While -If -Else -For -Enum -DefFunc -Return -CallFunc -RetIndicator -Class -Interface -True -False -Typeof -Void -Null -Undefined -Comma -SemiColon -QuestionMark -Colon -LeftParen -RightParen -LeftBracket -RightBracket -FStringExpEnd -LeftBrace -RightBrace -Plus -PlusPlus -Minus -MinusMinus -Star -Div -Mod -PowerTo -AndAnd -OrOr -Not -Assign -PlusAssign -MinusAssign -StarAssign -DivAssign -ModAssign -Equal -NotEqual -Less -LessEqual -Greater -GreaterEqual -BitwiseAnd -BitwiseOr -BitwiseXor -BitwiseNot -BitwiseZeroFillLeftShift -BitwiseSignedRightShift -BitwiseZeroFillRightShift -Dot -Identifier -IntegerConstant -SingleQuoteStringLiteral -DoubleQuoteStringLiteral -FloatingConstant -Whitespace -Newline -FStringSingleQuoteStart -FStringDoubleQuoteStart -FStringSingleQuoteExpStart -FStringSingleQuoteEnd -FStringSingleQuoteAtom -FStringDoubleQuoteExpStart -FStringDoubleQuoteEnd -FStringDoubleQuoteAtom -IdentifierNondigit -Nondigit -Digit -DecimalConstant -BinaryConstant -OctalConstant -HexadecimalConstant -NonzeroDigit -BinaryDigit -OctalDigit -HexadecimalDigit -DecimalFloatingConstant -FractionalConstant -ExponentPart -DigitSequence -Sign -CCharSequence -CChar -EscapeSequence -SimpleEscapeSequence -OctalEscapeSequence -HexadecimalEscapeSequence -SingleQuoteFStringSCharSequence -SingleQuoteFStringSChar -DoubleQuoteFStringSCharSequence -DoubleQuoteFStringSChar -SingleQuoteSCharSequence -SingleQuoteSChar -DoubleQuoteSCharSequence -DoubleQuoteSChar - -channel names: -DEFAULT_TOKEN_CHANNEL -HIDDEN -null -null -COMMENT - -mode names: -DEFAULT_MODE -SINGLE_QUOTE_FSTRING -DOUBLE_QUOTE_FSTRING - -atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 2, 87, 738, 8, 1, 8, 1, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, 9, 101, 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 4, 105, 9, 105, 4, 106, 9, 106, 4, 107, 9, 107, 4, 108, 9, 108, 4, 109, 9, 109, 4, 110, 9, 110, 4, 111, 9, 111, 4, 112, 9, 112, 4, 113, 9, 113, 4, 114, 9, 114, 4, 115, 9, 115, 4, 116, 9, 116, 4, 117, 9, 117, 3, 2, 3, 2, 3, 2, 3, 2, 7, 2, 242, 10, 2, 12, 2, 14, 2, 245, 11, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 256, 10, 3, 12, 3, 14, 3, 259, 11, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 62, 3, 62, 3, 62, 3, 63, 3, 63, 3, 64, 3, 64, 3, 64, 3, 65, 3, 65, 3, 66, 3, 66, 3, 67, 3, 67, 3, 68, 3, 68, 3, 69, 3, 69, 3, 69, 3, 70, 3, 70, 3, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 72, 3, 72, 3, 73, 3, 73, 3, 73, 7, 73, 522, 10, 73, 12, 73, 14, 73, 525, 11, 73, 3, 74, 3, 74, 3, 74, 3, 74, 5, 74, 531, 10, 74, 3, 75, 3, 75, 5, 75, 535, 10, 75, 3, 75, 3, 75, 3, 76, 3, 76, 5, 76, 541, 10, 76, 3, 76, 3, 76, 3, 77, 3, 77, 3, 78, 6, 78, 548, 10, 78, 13, 78, 14, 78, 549, 3, 78, 3, 78, 3, 79, 3, 79, 3, 79, 3, 79, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 3, 83, 3, 83, 3, 84, 3, 84, 3, 85, 3, 85, 3, 85, 3, 85, 3, 85, 3, 85, 3, 86, 3, 86, 3, 86, 3, 86, 3, 86, 3, 87, 3, 87, 3, 88, 3, 88, 3, 89, 3, 89, 3, 90, 3, 90, 3, 91, 6, 91, 605, 10, 91, 13, 91, 14, 91, 606, 3, 92, 3, 92, 3, 92, 6, 92, 612, 10, 92, 13, 92, 14, 92, 613, 3, 93, 3, 93, 3, 93, 6, 93, 619, 10, 93, 13, 93, 14, 93, 620, 3, 94, 3, 94, 3, 94, 6, 94, 626, 10, 94, 13, 94, 14, 94, 627, 3, 95, 3, 95, 3, 96, 3, 96, 3, 97, 3, 97, 3, 98, 3, 98, 3, 99, 3, 99, 5, 99, 640, 10, 99, 3, 99, 3, 99, 3, 99, 5, 99, 645, 10, 99, 3, 100, 5, 100, 648, 10, 100, 3, 100, 3, 100, 3, 100, 3, 100, 3, 100, 5, 100, 655, 10, 100, 3, 101, 3, 101, 5, 101, 659, 10, 101, 3, 101, 3, 101, 3, 102, 6, 102, 664, 10, 102, 13, 102, 14, 102, 665, 3, 103, 3, 103, 3, 104, 6, 104, 671, 10, 104, 13, 104, 14, 104, 672, 3, 105, 3, 105, 5, 105, 677, 10, 105, 3, 106, 3, 106, 3, 106, 5, 106, 682, 10, 106, 3, 107, 3, 107, 3, 107, 3, 108, 3, 108, 3, 108, 5, 108, 690, 10, 108, 3, 108, 5, 108, 693, 10, 108, 3, 109, 3, 109, 3, 109, 3, 109, 6, 109, 699, 10, 109, 13, 109, 14, 109, 700, 3, 110, 6, 110, 704, 10, 110, 13, 110, 14, 110, 705, 3, 111, 3, 111, 5, 111, 710, 10, 111, 3, 112, 6, 112, 713, 10, 112, 13, 112, 14, 112, 714, 3, 113, 3, 113, 5, 113, 719, 10, 113, 3, 114, 6, 114, 722, 10, 114, 13, 114, 14, 114, 723, 3, 115, 3, 115, 5, 115, 728, 10, 115, 3, 116, 6, 116, 731, 10, 116, 13, 116, 14, 116, 732, 3, 117, 3, 117, 5, 117, 737, 10, 117, 3, 243, 2, 2, 118, 5, 2, 4, 7, 2, 5, 9, 2, 6, 11, 2, 7, 13, 2, 8, 15, 2, 9, 17, 2, 10, 19, 2, 11, 21, 2, 12, 23, 2, 13, 25, 2, 14, 27, 2, 15, 29, 2, 16, 31, 2, 17, 33, 2, 18, 35, 2, 19, 37, 2, 20, 39, 2, 21, 41, 2, 22, 43, 2, 23, 45, 2, 24, 47, 2, 25, 49, 2, 26, 51, 2, 27, 53, 2, 28, 55, 2, 29, 57, 2, 30, 59, 2, 31, 61, 2, 32, 63, 2, 33, 65, 2, 34, 67, 2, 35, 69, 2, 36, 71, 2, 37, 73, 2, 38, 75, 2, 39, 77, 2, 40, 79, 2, 41, 81, 2, 42, 83, 2, 43, 85, 2, 44, 87, 2, 45, 89, 2, 46, 91, 2, 47, 93, 2, 48, 95, 2, 49, 97, 2, 50, 99, 2, 51, 101, 2, 52, 103, 2, 53, 105, 2, 54, 107, 2, 55, 109, 2, 56, 111, 2, 57, 113, 2, 58, 115, 2, 59, 117, 2, 60, 119, 2, 61, 121, 2, 62, 123, 2, 63, 125, 2, 64, 127, 2, 65, 129, 2, 66, 131, 2, 67, 133, 2, 68, 135, 2, 69, 137, 2, 70, 139, 2, 71, 141, 2, 72, 143, 2, 73, 145, 2, 74, 147, 2, 75, 149, 2, 76, 151, 2, 77, 153, 2, 78, 155, 2, 79, 157, 2, 80, 159, 2, 81, 161, 2, 82, 163, 2, 83, 165, 2, 2, 167, 2, 84, 169, 2, 85, 171, 2, 2, 173, 2, 86, 175, 2, 87, 177, 2, 2, 179, 2, 2, 181, 2, 2, 183, 2, 2, 185, 2, 2, 187, 2, 2, 189, 2, 2, 191, 2, 2, 193, 2, 2, 195, 2, 2, 197, 2, 2, 199, 2, 2, 201, 2, 2, 203, 2, 2, 205, 2, 2, 207, 2, 2, 209, 2, 2, 211, 2, 2, 213, 2, 2, 215, 2, 2, 217, 2, 2, 219, 2, 2, 221, 2, 2, 223, 2, 2, 225, 2, 2, 227, 2, 2, 229, 2, 2, 231, 2, 2, 233, 2, 2, 235, 2, 2, 5, 2, 3, 4, 20, 5, 2, 12, 12, 15, 15, 8234, 8235, 6, 2, 11, 11, 13, 14, 34, 34, 162, 162, 5, 2, 67, 92, 97, 97, 99, 124, 3, 2, 50, 59, 4, 2, 68, 68, 100, 100, 4, 2, 81, 81, 113, 113, 4, 2, 90, 90, 122, 122, 3, 2, 51, 59, 3, 2, 50, 51, 3, 2, 50, 57, 5, 2, 50, 59, 67, 72, 99, 104, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, 6, 2, 12, 12, 15, 15, 41, 41, 94, 94, 14, 2, 36, 36, 41, 41, 65, 65, 94, 94, 99, 100, 104, 104, 112, 112, 116, 116, 118, 118, 120, 120, 125, 125, 127, 127, 8, 2, 12, 12, 15, 15, 41, 41, 94, 94, 125, 125, 127, 127, 8, 2, 12, 12, 15, 15, 36, 36, 94, 94, 125, 125, 127, 127, 6, 2, 12, 12, 15, 15, 36, 36, 94, 94, 2, 740, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, 2, 109, 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, 2, 2, 2, 2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 2, 123, 3, 2, 2, 2, 2, 125, 3, 2, 2, 2, 2, 127, 3, 2, 2, 2, 2, 129, 3, 2, 2, 2, 2, 131, 3, 2, 2, 2, 2, 133, 3, 2, 2, 2, 2, 135, 3, 2, 2, 2, 2, 137, 3, 2, 2, 2, 2, 139, 3, 2, 2, 2, 2, 141, 3, 2, 2, 2, 2, 143, 3, 2, 2, 2, 2, 145, 3, 2, 2, 2, 2, 147, 3, 2, 2, 2, 2, 149, 3, 2, 2, 2, 2, 151, 3, 2, 2, 2, 2, 153, 3, 2, 2, 2, 2, 155, 3, 2, 2, 2, 2, 157, 3, 2, 2, 2, 2, 159, 3, 2, 2, 2, 2, 161, 3, 2, 2, 2, 2, 163, 3, 2, 2, 2, 3, 165, 3, 2, 2, 2, 3, 167, 3, 2, 2, 2, 3, 169, 3, 2, 2, 2, 4, 171, 3, 2, 2, 2, 4, 173, 3, 2, 2, 2, 4, 175, 3, 2, 2, 2, 5, 237, 3, 2, 2, 2, 7, 251, 3, 2, 2, 2, 9, 262, 3, 2, 2, 2, 11, 268, 3, 2, 2, 2, 13, 272, 3, 2, 2, 2, 15, 275, 3, 2, 2, 2, 17, 279, 3, 2, 2, 2, 19, 286, 3, 2, 2, 2, 21, 291, 3, 2, 2, 2, 23, 299, 3, 2, 2, 2, 25, 305, 3, 2, 2, 2, 27, 314, 3, 2, 2, 2, 29, 317, 3, 2, 2, 2, 31, 323, 3, 2, 2, 2, 33, 326, 3, 2, 2, 2, 35, 331, 3, 2, 2, 2, 37, 335, 3, 2, 2, 2, 39, 340, 3, 2, 2, 2, 41, 344, 3, 2, 2, 2, 43, 351, 3, 2, 2, 2, 45, 356, 3, 2, 2, 2, 47, 359, 3, 2, 2, 2, 49, 365, 3, 2, 2, 2, 51, 375, 3, 2, 2, 2, 53, 380, 3, 2, 2, 2, 55, 386, 3, 2, 2, 2, 57, 393, 3, 2, 2, 2, 59, 398, 3, 2, 2, 2, 61, 403, 3, 2, 2, 2, 63, 413, 3, 2, 2, 2, 65, 415, 3, 2, 2, 2, 67, 417, 3, 2, 2, 2, 69, 419, 3, 2, 2, 2, 71, 421, 3, 2, 2, 2, 73, 423, 3, 2, 2, 2, 75, 425, 3, 2, 2, 2, 77, 427, 3, 2, 2, 2, 79, 429, 3, 2, 2, 2, 81, 434, 3, 2, 2, 2, 83, 436, 3, 2, 2, 2, 85, 438, 3, 2, 2, 2, 87, 440, 3, 2, 2, 2, 89, 443, 3, 2, 2, 2, 91, 445, 3, 2, 2, 2, 93, 448, 3, 2, 2, 2, 95, 450, 3, 2, 2, 2, 97, 452, 3, 2, 2, 2, 99, 454, 3, 2, 2, 2, 101, 457, 3, 2, 2, 2, 103, 460, 3, 2, 2, 2, 105, 463, 3, 2, 2, 2, 107, 465, 3, 2, 2, 2, 109, 467, 3, 2, 2, 2, 111, 470, 3, 2, 2, 2, 113, 473, 3, 2, 2, 2, 115, 476, 3, 2, 2, 2, 117, 479, 3, 2, 2, 2, 119, 482, 3, 2, 2, 2, 121, 485, 3, 2, 2, 2, 123, 488, 3, 2, 2, 2, 125, 490, 3, 2, 2, 2, 127, 493, 3, 2, 2, 2, 129, 495, 3, 2, 2, 2, 131, 498, 3, 2, 2, 2, 133, 500, 3, 2, 2, 2, 135, 502, 3, 2, 2, 2, 137, 504, 3, 2, 2, 2, 139, 506, 3, 2, 2, 2, 141, 509, 3, 2, 2, 2, 143, 512, 3, 2, 2, 2, 145, 516, 3, 2, 2, 2, 147, 518, 3, 2, 2, 2, 149, 530, 3, 2, 2, 2, 151, 532, 3, 2, 2, 2, 153, 538, 3, 2, 2, 2, 155, 544, 3, 2, 2, 2, 157, 547, 3, 2, 2, 2, 159, 553, 3, 2, 2, 2, 161, 557, 3, 2, 2, 2, 163, 564, 3, 2, 2, 2, 165, 571, 3, 2, 2, 2, 167, 577, 3, 2, 2, 2, 169, 582, 3, 2, 2, 2, 171, 584, 3, 2, 2, 2, 173, 590, 3, 2, 2, 2, 175, 595, 3, 2, 2, 2, 177, 597, 3, 2, 2, 2, 179, 599, 3, 2, 2, 2, 181, 601, 3, 2, 2, 2, 183, 604, 3, 2, 2, 2, 185, 608, 3, 2, 2, 2, 187, 615, 3, 2, 2, 2, 189, 622, 3, 2, 2, 2, 191, 629, 3, 2, 2, 2, 193, 631, 3, 2, 2, 2, 195, 633, 3, 2, 2, 2, 197, 635, 3, 2, 2, 2, 199, 644, 3, 2, 2, 2, 201, 654, 3, 2, 2, 2, 203, 656, 3, 2, 2, 2, 205, 663, 3, 2, 2, 2, 207, 667, 3, 2, 2, 2, 209, 670, 3, 2, 2, 2, 211, 676, 3, 2, 2, 2, 213, 681, 3, 2, 2, 2, 215, 683, 3, 2, 2, 2, 217, 686, 3, 2, 2, 2, 219, 694, 3, 2, 2, 2, 221, 703, 3, 2, 2, 2, 223, 709, 3, 2, 2, 2, 225, 712, 3, 2, 2, 2, 227, 718, 3, 2, 2, 2, 229, 721, 3, 2, 2, 2, 231, 727, 3, 2, 2, 2, 233, 730, 3, 2, 2, 2, 235, 736, 3, 2, 2, 2, 237, 238, 7, 49, 2, 2, 238, 239, 7, 44, 2, 2, 239, 243, 3, 2, 2, 2, 240, 242, 11, 2, 2, 2, 241, 240, 3, 2, 2, 2, 242, 245, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 243, 241, 3, 2, 2, 2, 244, 246, 3, 2, 2, 2, 245, 243, 3, 2, 2, 2, 246, 247, 7, 44, 2, 2, 247, 248, 7, 49, 2, 2, 248, 249, 3, 2, 2, 2, 249, 250, 8, 2, 2, 2, 250, 6, 3, 2, 2, 2, 251, 252, 7, 49, 2, 2, 252, 253, 7, 49, 2, 2, 253, 257, 3, 2, 2, 2, 254, 256, 10, 2, 2, 2, 255, 254, 3, 2, 2, 2, 256, 259, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 260, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 260, 261, 8, 3, 2, 2, 261, 8, 3, 2, 2, 2, 262, 263, 7, 101, 2, 2, 263, 264, 7, 113, 2, 2, 264, 265, 7, 112, 2, 2, 265, 266, 7, 117, 2, 2, 266, 267, 7, 118, 2, 2, 267, 10, 3, 2, 2, 2, 268, 269, 7, 120, 2, 2, 269, 270, 7, 99, 2, 2, 270, 271, 7, 116, 2, 2, 271, 12, 3, 2, 2, 2, 272, 273, 7, 99, 2, 2, 273, 274, 7, 117, 2, 2, 274, 14, 3, 2, 2, 2, 275, 276, 7, 48, 2, 2, 276, 277, 7, 48, 2, 2, 277, 278, 7, 48, 2, 2, 278, 16, 3, 2, 2, 2, 279, 280, 7, 117, 2, 2, 280, 281, 7, 121, 2, 2, 281, 282, 7, 107, 2, 2, 282, 283, 7, 118, 2, 2, 283, 284, 7, 101, 2, 2, 284, 285, 7, 106, 2, 2, 285, 18, 3, 2, 2, 2, 286, 287, 7, 101, 2, 2, 287, 288, 7, 99, 2, 2, 288, 289, 7, 117, 2, 2, 289, 290, 7, 103, 2, 2, 290, 20, 3, 2, 2, 2, 291, 292, 7, 102, 2, 2, 292, 293, 7, 103, 2, 2, 293, 294, 7, 104, 2, 2, 294, 295, 7, 99, 2, 2, 295, 296, 7, 119, 2, 2, 296, 297, 7, 110, 2, 2, 297, 298, 7, 118, 2, 2, 298, 22, 3, 2, 2, 2, 299, 300, 7, 100, 2, 2, 300, 301, 7, 116, 2, 2, 301, 302, 7, 103, 2, 2, 302, 303, 7, 99, 2, 2, 303, 304, 7, 109, 2, 2, 304, 24, 3, 2, 2, 2, 305, 306, 7, 101, 2, 2, 306, 307, 7, 113, 2, 2, 307, 308, 7, 112, 2, 2, 308, 309, 7, 118, 2, 2, 309, 310, 7, 107, 2, 2, 310, 311, 7, 112, 2, 2, 311, 312, 7, 119, 2, 2, 312, 313, 7, 103, 2, 2, 313, 26, 3, 2, 2, 2, 314, 315, 7, 102, 2, 2, 315, 316, 7, 113, 2, 2, 316, 28, 3, 2, 2, 2, 317, 318, 7, 121, 2, 2, 318, 319, 7, 106, 2, 2, 319, 320, 7, 107, 2, 2, 320, 321, 7, 110, 2, 2, 321, 322, 7, 103, 2, 2, 322, 30, 3, 2, 2, 2, 323, 324, 7, 107, 2, 2, 324, 325, 7, 104, 2, 2, 325, 32, 3, 2, 2, 2, 326, 327, 7, 103, 2, 2, 327, 328, 7, 110, 2, 2, 328, 329, 7, 117, 2, 2, 329, 330, 7, 103, 2, 2, 330, 34, 3, 2, 2, 2, 331, 332, 7, 104, 2, 2, 332, 333, 7, 113, 2, 2, 333, 334, 7, 116, 2, 2, 334, 36, 3, 2, 2, 2, 335, 336, 7, 103, 2, 2, 336, 337, 7, 112, 2, 2, 337, 338, 7, 119, 2, 2, 338, 339, 7, 111, 2, 2, 339, 38, 3, 2, 2, 2, 340, 341, 7, 102, 2, 2, 341, 342, 7, 103, 2, 2, 342, 343, 7, 104, 2, 2, 343, 40, 3, 2, 2, 2, 344, 345, 7, 116, 2, 2, 345, 346, 7, 103, 2, 2, 346, 347, 7, 118, 2, 2, 347, 348, 7, 119, 2, 2, 348, 349, 7, 116, 2, 2, 349, 350, 7, 112, 2, 2, 350, 42, 3, 2, 2, 2, 351, 352, 7, 101, 2, 2, 352, 353, 7, 99, 2, 2, 353, 354, 7, 110, 2, 2, 354, 355, 7, 110, 2, 2, 355, 44, 3, 2, 2, 2, 356, 357, 7, 47, 2, 2, 357, 358, 7, 64, 2, 2, 358, 46, 3, 2, 2, 2, 359, 360, 7, 101, 2, 2, 360, 361, 7, 110, 2, 2, 361, 362, 7, 99, 2, 2, 362, 363, 7, 117, 2, 2, 363, 364, 7, 117, 2, 2, 364, 48, 3, 2, 2, 2, 365, 366, 7, 107, 2, 2, 366, 367, 7, 112, 2, 2, 367, 368, 7, 118, 2, 2, 368, 369, 7, 103, 2, 2, 369, 370, 7, 116, 2, 2, 370, 371, 7, 104, 2, 2, 371, 372, 7, 99, 2, 2, 372, 373, 7, 101, 2, 2, 373, 374, 7, 103, 2, 2, 374, 50, 3, 2, 2, 2, 375, 376, 7, 118, 2, 2, 376, 377, 7, 116, 2, 2, 377, 378, 7, 119, 2, 2, 378, 379, 7, 103, 2, 2, 379, 52, 3, 2, 2, 2, 380, 381, 7, 104, 2, 2, 381, 382, 7, 99, 2, 2, 382, 383, 7, 110, 2, 2, 383, 384, 7, 117, 2, 2, 384, 385, 7, 103, 2, 2, 385, 54, 3, 2, 2, 2, 386, 387, 7, 118, 2, 2, 387, 388, 7, 123, 2, 2, 388, 389, 7, 114, 2, 2, 389, 390, 7, 103, 2, 2, 390, 391, 7, 113, 2, 2, 391, 392, 7, 104, 2, 2, 392, 56, 3, 2, 2, 2, 393, 394, 7, 120, 2, 2, 394, 395, 7, 113, 2, 2, 395, 396, 7, 107, 2, 2, 396, 397, 7, 102, 2, 2, 397, 58, 3, 2, 2, 2, 398, 399, 7, 112, 2, 2, 399, 400, 7, 119, 2, 2, 400, 401, 7, 110, 2, 2, 401, 402, 7, 110, 2, 2, 402, 60, 3, 2, 2, 2, 403, 404, 7, 119, 2, 2, 404, 405, 7, 112, 2, 2, 405, 406, 7, 102, 2, 2, 406, 407, 7, 103, 2, 2, 407, 408, 7, 104, 2, 2, 408, 409, 7, 107, 2, 2, 409, 410, 7, 112, 2, 2, 410, 411, 7, 103, 2, 2, 411, 412, 7, 102, 2, 2, 412, 62, 3, 2, 2, 2, 413, 414, 7, 46, 2, 2, 414, 64, 3, 2, 2, 2, 415, 416, 7, 61, 2, 2, 416, 66, 3, 2, 2, 2, 417, 418, 7, 65, 2, 2, 418, 68, 3, 2, 2, 2, 419, 420, 7, 60, 2, 2, 420, 70, 3, 2, 2, 2, 421, 422, 7, 42, 2, 2, 422, 72, 3, 2, 2, 2, 423, 424, 7, 43, 2, 2, 424, 74, 3, 2, 2, 2, 425, 426, 7, 93, 2, 2, 426, 76, 3, 2, 2, 2, 427, 428, 7, 95, 2, 2, 428, 78, 3, 2, 2, 2, 429, 430, 6, 39, 2, 2, 430, 431, 7, 127, 2, 2, 431, 432, 3, 2, 2, 2, 432, 433, 8, 39, 3, 2, 433, 80, 3, 2, 2, 2, 434, 435, 7, 125, 2, 2, 435, 82, 3, 2, 2, 2, 436, 437, 7, 127, 2, 2, 437, 84, 3, 2, 2, 2, 438, 439, 7, 45, 2, 2, 439, 86, 3, 2, 2, 2, 440, 441, 7, 45, 2, 2, 441, 442, 7, 45, 2, 2, 442, 88, 3, 2, 2, 2, 443, 444, 7, 47, 2, 2, 444, 90, 3, 2, 2, 2, 445, 446, 7, 47, 2, 2, 446, 447, 7, 47, 2, 2, 447, 92, 3, 2, 2, 2, 448, 449, 7, 44, 2, 2, 449, 94, 3, 2, 2, 2, 450, 451, 7, 49, 2, 2, 451, 96, 3, 2, 2, 2, 452, 453, 7, 39, 2, 2, 453, 98, 3, 2, 2, 2, 454, 455, 7, 44, 2, 2, 455, 456, 7, 44, 2, 2, 456, 100, 3, 2, 2, 2, 457, 458, 7, 40, 2, 2, 458, 459, 7, 40, 2, 2, 459, 102, 3, 2, 2, 2, 460, 461, 7, 126, 2, 2, 461, 462, 7, 126, 2, 2, 462, 104, 3, 2, 2, 2, 463, 464, 7, 35, 2, 2, 464, 106, 3, 2, 2, 2, 465, 466, 7, 63, 2, 2, 466, 108, 3, 2, 2, 2, 467, 468, 7, 45, 2, 2, 468, 469, 7, 63, 2, 2, 469, 110, 3, 2, 2, 2, 470, 471, 7, 47, 2, 2, 471, 472, 7, 63, 2, 2, 472, 112, 3, 2, 2, 2, 473, 474, 7, 44, 2, 2, 474, 475, 7, 63, 2, 2, 475, 114, 3, 2, 2, 2, 476, 477, 7, 49, 2, 2, 477, 478, 7, 63, 2, 2, 478, 116, 3, 2, 2, 2, 479, 480, 7, 39, 2, 2, 480, 481, 7, 63, 2, 2, 481, 118, 3, 2, 2, 2, 482, 483, 7, 63, 2, 2, 483, 484, 7, 63, 2, 2, 484, 120, 3, 2, 2, 2, 485, 486, 7, 35, 2, 2, 486, 487, 7, 63, 2, 2, 487, 122, 3, 2, 2, 2, 488, 489, 7, 62, 2, 2, 489, 124, 3, 2, 2, 2, 490, 491, 7, 62, 2, 2, 491, 492, 7, 63, 2, 2, 492, 126, 3, 2, 2, 2, 493, 494, 7, 64, 2, 2, 494, 128, 3, 2, 2, 2, 495, 496, 7, 64, 2, 2, 496, 497, 7, 63, 2, 2, 497, 130, 3, 2, 2, 2, 498, 499, 7, 40, 2, 2, 499, 132, 3, 2, 2, 2, 500, 501, 7, 126, 2, 2, 501, 134, 3, 2, 2, 2, 502, 503, 7, 96, 2, 2, 503, 136, 3, 2, 2, 2, 504, 505, 7, 128, 2, 2, 505, 138, 3, 2, 2, 2, 506, 507, 7, 62, 2, 2, 507, 508, 7, 62, 2, 2, 508, 140, 3, 2, 2, 2, 509, 510, 7, 64, 2, 2, 510, 511, 7, 64, 2, 2, 511, 142, 3, 2, 2, 2, 512, 513, 7, 64, 2, 2, 513, 514, 7, 64, 2, 2, 514, 515, 7, 64, 2, 2, 515, 144, 3, 2, 2, 2, 516, 517, 7, 48, 2, 2, 517, 146, 3, 2, 2, 2, 518, 523, 5, 177, 88, 2, 519, 522, 5, 177, 88, 2, 520, 522, 5, 181, 90, 2, 521, 519, 3, 2, 2, 2, 521, 520, 3, 2, 2, 2, 522, 525, 3, 2, 2, 2, 523, 521, 3, 2, 2, 2, 523, 524, 3, 2, 2, 2, 524, 148, 3, 2, 2, 2, 525, 523, 3, 2, 2, 2, 526, 531, 5, 183, 91, 2, 527, 531, 5, 187, 93, 2, 528, 531, 5, 189, 94, 2, 529, 531, 5, 185, 92, 2, 530, 526, 3, 2, 2, 2, 530, 527, 3, 2, 2, 2, 530, 528, 3, 2, 2, 2, 530, 529, 3, 2, 2, 2, 531, 150, 3, 2, 2, 2, 532, 534, 7, 41, 2, 2, 533, 535, 5, 229, 114, 2, 534, 533, 3, 2, 2, 2, 534, 535, 3, 2, 2, 2, 535, 536, 3, 2, 2, 2, 536, 537, 7, 41, 2, 2, 537, 152, 3, 2, 2, 2, 538, 540, 7, 36, 2, 2, 539, 541, 5, 233, 116, 2, 540, 539, 3, 2, 2, 2, 540, 541, 3, 2, 2, 2, 541, 542, 3, 2, 2, 2, 542, 543, 7, 36, 2, 2, 543, 154, 3, 2, 2, 2, 544, 545, 5, 199, 99, 2, 545, 156, 3, 2, 2, 2, 546, 548, 9, 3, 2, 2, 547, 546, 3, 2, 2, 2, 548, 549, 3, 2, 2, 2, 549, 547, 3, 2, 2, 2, 549, 550, 3, 2, 2, 2, 550, 551, 3, 2, 2, 2, 551, 552, 8, 78, 4, 2, 552, 158, 3, 2, 2, 2, 553, 554, 9, 2, 2, 2, 554, 555, 3, 2, 2, 2, 555, 556, 8, 79, 4, 2, 556, 160, 3, 2, 2, 2, 557, 558, 7, 104, 2, 2, 558, 559, 7, 41, 2, 2, 559, 560, 3, 2, 2, 2, 560, 561, 8, 80, 5, 2, 561, 562, 3, 2, 2, 2, 562, 563, 8, 80, 6, 2, 563, 162, 3, 2, 2, 2, 564, 565, 7, 104, 2, 2, 565, 566, 7, 36, 2, 2, 566, 567, 3, 2, 2, 2, 567, 568, 8, 81, 7, 2, 568, 569, 3, 2, 2, 2, 569, 570, 8, 81, 8, 2, 570, 164, 3, 2, 2, 2, 571, 572, 6, 82, 3, 2, 572, 573, 7, 125, 2, 2, 573, 574, 3, 2, 2, 2, 574, 575, 8, 82, 9, 2, 575, 576, 8, 82, 10, 2, 576, 166, 3, 2, 2, 2, 577, 578, 7, 41, 2, 2, 578, 579, 8, 83, 11, 2, 579, 580, 3, 2, 2, 2, 580, 581, 8, 83, 3, 2, 581, 168, 3, 2, 2, 2, 582, 583, 5, 221, 110, 2, 583, 170, 3, 2, 2, 2, 584, 585, 6, 85, 4, 2, 585, 586, 7, 125, 2, 2, 586, 587, 3, 2, 2, 2, 587, 588, 8, 85, 9, 2, 588, 589, 8, 85, 10, 2, 589, 172, 3, 2, 2, 2, 590, 591, 7, 36, 2, 2, 591, 592, 8, 86, 12, 2, 592, 593, 3, 2, 2, 2, 593, 594, 8, 86, 3, 2, 594, 174, 3, 2, 2, 2, 595, 596, 5, 225, 112, 2, 596, 176, 3, 2, 2, 2, 597, 598, 5, 179, 89, 2, 598, 178, 3, 2, 2, 2, 599, 600, 9, 4, 2, 2, 600, 180, 3, 2, 2, 2, 601, 602, 9, 5, 2, 2, 602, 182, 3, 2, 2, 2, 603, 605, 5, 181, 90, 2, 604, 603, 3, 2, 2, 2, 605, 606, 3, 2, 2, 2, 606, 604, 3, 2, 2, 2, 606, 607, 3, 2, 2, 2, 607, 184, 3, 2, 2, 2, 608, 609, 7, 50, 2, 2, 609, 611, 9, 6, 2, 2, 610, 612, 5, 193, 96, 2, 611, 610, 3, 2, 2, 2, 612, 613, 3, 2, 2, 2, 613, 611, 3, 2, 2, 2, 613, 614, 3, 2, 2, 2, 614, 186, 3, 2, 2, 2, 615, 616, 7, 50, 2, 2, 616, 618, 9, 7, 2, 2, 617, 619, 5, 195, 97, 2, 618, 617, 3, 2, 2, 2, 619, 620, 3, 2, 2, 2, 620, 618, 3, 2, 2, 2, 620, 621, 3, 2, 2, 2, 621, 188, 3, 2, 2, 2, 622, 623, 7, 50, 2, 2, 623, 625, 9, 8, 2, 2, 624, 626, 5, 197, 98, 2, 625, 624, 3, 2, 2, 2, 626, 627, 3, 2, 2, 2, 627, 625, 3, 2, 2, 2, 627, 628, 3, 2, 2, 2, 628, 190, 3, 2, 2, 2, 629, 630, 9, 9, 2, 2, 630, 192, 3, 2, 2, 2, 631, 632, 9, 10, 2, 2, 632, 194, 3, 2, 2, 2, 633, 634, 9, 11, 2, 2, 634, 196, 3, 2, 2, 2, 635, 636, 9, 12, 2, 2, 636, 198, 3, 2, 2, 2, 637, 639, 5, 201, 100, 2, 638, 640, 5, 203, 101, 2, 639, 638, 3, 2, 2, 2, 639, 640, 3, 2, 2, 2, 640, 645, 3, 2, 2, 2, 641, 642, 5, 205, 102, 2, 642, 643, 5, 203, 101, 2, 643, 645, 3, 2, 2, 2, 644, 637, 3, 2, 2, 2, 644, 641, 3, 2, 2, 2, 645, 200, 3, 2, 2, 2, 646, 648, 5, 205, 102, 2, 647, 646, 3, 2, 2, 2, 647, 648, 3, 2, 2, 2, 648, 649, 3, 2, 2, 2, 649, 650, 7, 48, 2, 2, 650, 655, 5, 205, 102, 2, 651, 652, 5, 205, 102, 2, 652, 653, 7, 48, 2, 2, 653, 655, 3, 2, 2, 2, 654, 647, 3, 2, 2, 2, 654, 651, 3, 2, 2, 2, 655, 202, 3, 2, 2, 2, 656, 658, 9, 13, 2, 2, 657, 659, 5, 207, 103, 2, 658, 657, 3, 2, 2, 2, 658, 659, 3, 2, 2, 2, 659, 660, 3, 2, 2, 2, 660, 661, 5, 205, 102, 2, 661, 204, 3, 2, 2, 2, 662, 664, 5, 181, 90, 2, 663, 662, 3, 2, 2, 2, 664, 665, 3, 2, 2, 2, 665, 663, 3, 2, 2, 2, 665, 666, 3, 2, 2, 2, 666, 206, 3, 2, 2, 2, 667, 668, 9, 14, 2, 2, 668, 208, 3, 2, 2, 2, 669, 671, 5, 211, 105, 2, 670, 669, 3, 2, 2, 2, 671, 672, 3, 2, 2, 2, 672, 670, 3, 2, 2, 2, 672, 673, 3, 2, 2, 2, 673, 210, 3, 2, 2, 2, 674, 677, 10, 15, 2, 2, 675, 677, 5, 213, 106, 2, 676, 674, 3, 2, 2, 2, 676, 675, 3, 2, 2, 2, 677, 212, 3, 2, 2, 2, 678, 682, 5, 215, 107, 2, 679, 682, 5, 217, 108, 2, 680, 682, 5, 219, 109, 2, 681, 678, 3, 2, 2, 2, 681, 679, 3, 2, 2, 2, 681, 680, 3, 2, 2, 2, 682, 214, 3, 2, 2, 2, 683, 684, 7, 94, 2, 2, 684, 685, 9, 16, 2, 2, 685, 216, 3, 2, 2, 2, 686, 687, 7, 94, 2, 2, 687, 689, 5, 195, 97, 2, 688, 690, 5, 195, 97, 2, 689, 688, 3, 2, 2, 2, 689, 690, 3, 2, 2, 2, 690, 692, 3, 2, 2, 2, 691, 693, 5, 195, 97, 2, 692, 691, 3, 2, 2, 2, 692, 693, 3, 2, 2, 2, 693, 218, 3, 2, 2, 2, 694, 695, 7, 94, 2, 2, 695, 696, 7, 122, 2, 2, 696, 698, 3, 2, 2, 2, 697, 699, 5, 197, 98, 2, 698, 697, 3, 2, 2, 2, 699, 700, 3, 2, 2, 2, 700, 698, 3, 2, 2, 2, 700, 701, 3, 2, 2, 2, 701, 220, 3, 2, 2, 2, 702, 704, 5, 223, 111, 2, 703, 702, 3, 2, 2, 2, 704, 705, 3, 2, 2, 2, 705, 703, 3, 2, 2, 2, 705, 706, 3, 2, 2, 2, 706, 222, 3, 2, 2, 2, 707, 710, 10, 17, 2, 2, 708, 710, 5, 213, 106, 2, 709, 707, 3, 2, 2, 2, 709, 708, 3, 2, 2, 2, 710, 224, 3, 2, 2, 2, 711, 713, 5, 227, 113, 2, 712, 711, 3, 2, 2, 2, 713, 714, 3, 2, 2, 2, 714, 712, 3, 2, 2, 2, 714, 715, 3, 2, 2, 2, 715, 226, 3, 2, 2, 2, 716, 719, 10, 18, 2, 2, 717, 719, 5, 213, 106, 2, 718, 716, 3, 2, 2, 2, 718, 717, 3, 2, 2, 2, 719, 228, 3, 2, 2, 2, 720, 722, 5, 231, 115, 2, 721, 720, 3, 2, 2, 2, 722, 723, 3, 2, 2, 2, 723, 721, 3, 2, 2, 2, 723, 724, 3, 2, 2, 2, 724, 230, 3, 2, 2, 2, 725, 728, 10, 15, 2, 2, 726, 728, 5, 213, 106, 2, 727, 725, 3, 2, 2, 2, 727, 726, 3, 2, 2, 2, 728, 232, 3, 2, 2, 2, 729, 731, 5, 235, 117, 2, 730, 729, 3, 2, 2, 2, 731, 732, 3, 2, 2, 2, 732, 730, 3, 2, 2, 2, 732, 733, 3, 2, 2, 2, 733, 234, 3, 2, 2, 2, 734, 737, 10, 19, 2, 2, 735, 737, 5, 213, 106, 2, 736, 734, 3, 2, 2, 2, 736, 735, 3, 2, 2, 2, 737, 236, 3, 2, 2, 2, 37, 2, 3, 4, 243, 257, 521, 523, 530, 534, 540, 549, 606, 613, 620, 627, 639, 644, 647, 654, 658, 665, 672, 676, 681, 689, 692, 700, 705, 709, 714, 718, 723, 727, 732, 736, 13, 2, 4, 2, 6, 2, 2, 2, 3, 2, 3, 80, 2, 7, 3, 2, 3, 81, 3, 7, 4, 2, 9, 3, 2, 7, 2, 2, 3, 83, 4, 3, 86, 5] \ No newline at end of file diff --git a/kipper/core/src/compiler/parser/antlr/KipperLexer.tokens b/kipper/core/src/compiler/parser/antlr/KipperLexer.tokens deleted file mode 100644 index 4784df64b..000000000 --- a/kipper/core/src/compiler/parser/antlr/KipperLexer.tokens +++ /dev/null @@ -1,153 +0,0 @@ -FStringExpStart=1 -BlockComment=2 -LineComment=3 -Const=4 -Var=5 -As=6 -Spread=7 -Switch=8 -Case=9 -Default=10 -Break=11 -Continue=12 -Do=13 -While=14 -If=15 -Else=16 -For=17 -Enum=18 -DefFunc=19 -Return=20 -CallFunc=21 -RetIndicator=22 -Class=23 -Interface=24 -True=25 -False=26 -Typeof=27 -Void=28 -Null=29 -Undefined=30 -Comma=31 -SemiColon=32 -QuestionMark=33 -Colon=34 -LeftParen=35 -RightParen=36 -LeftBracket=37 -RightBracket=38 -FStringExpEnd=39 -LeftBrace=40 -RightBrace=41 -Plus=42 -PlusPlus=43 -Minus=44 -MinusMinus=45 -Star=46 -Div=47 -Mod=48 -PowerTo=49 -AndAnd=50 -OrOr=51 -Not=52 -Assign=53 -PlusAssign=54 -MinusAssign=55 -StarAssign=56 -DivAssign=57 -ModAssign=58 -Equal=59 -NotEqual=60 -Less=61 -LessEqual=62 -Greater=63 -GreaterEqual=64 -BitwiseAnd=65 -BitwiseOr=66 -BitwiseXor=67 -BitwiseNot=68 -BitwiseZeroFillLeftShift=69 -BitwiseSignedRightShift=70 -BitwiseZeroFillRightShift=71 -Dot=72 -Identifier=73 -IntegerConstant=74 -SingleQuoteStringLiteral=75 -DoubleQuoteStringLiteral=76 -FloatingConstant=77 -Whitespace=78 -Newline=79 -FStringSingleQuoteStart=80 -FStringDoubleQuoteStart=81 -FStringSingleQuoteEnd=82 -FStringSingleQuoteAtom=83 -FStringDoubleQuoteEnd=84 -FStringDoubleQuoteAtom=85 -'const'=4 -'var'=5 -'as'=6 -'...'=7 -'switch'=8 -'case'=9 -'default'=10 -'break'=11 -'continue'=12 -'do'=13 -'while'=14 -'if'=15 -'else'=16 -'for'=17 -'enum'=18 -'def'=19 -'return'=20 -'call'=21 -'->'=22 -'class'=23 -'interface'=24 -'true'=25 -'false'=26 -'typeof'=27 -'void'=28 -'null'=29 -'undefined'=30 -','=31 -';'=32 -'?'=33 -':'=34 -'('=35 -')'=36 -'['=37 -']'=38 -'{'=40 -'}'=41 -'+'=42 -'++'=43 -'-'=44 -'--'=45 -'*'=46 -'/'=47 -'%'=48 -'**'=49 -'&&'=50 -'||'=51 -'!'=52 -'='=53 -'+='=54 -'-='=55 -'*='=56 -'/='=57 -'%='=58 -'=='=59 -'!='=60 -'<'=61 -'<='=62 -'>'=63 -'>='=64 -'&'=65 -'|'=66 -'^'=67 -'~'=68 -'<<'=69 -'>>'=70 -'>>>'=71 -'.'=72 diff --git a/kipper/core/src/compiler/parser/antlr/KipperLexer.ts b/kipper/core/src/compiler/parser/antlr/KipperLexer.ts deleted file mode 100644 index feb7f934b..000000000 --- a/kipper/core/src/compiler/parser/antlr/KipperLexer.ts +++ /dev/null @@ -1,882 +0,0 @@ -// Generated from ./KipperLexer.g4 by ANTLR 4.9.0-SNAPSHOT - -import KipperLexerBase from "./base/KipperLexerBase"; - -import { ATN } from "antlr4ts/atn/ATN"; -import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; -import { CharStream } from "antlr4ts/CharStream"; -import { LexerATNSimulator } from "antlr4ts/atn/LexerATNSimulator"; -import { RuleContext } from "antlr4ts/RuleContext"; -import { Vocabulary } from "antlr4ts/Vocabulary"; -import { VocabularyImpl } from "antlr4ts/VocabularyImpl"; - -import * as Utils from "antlr4ts/misc/Utils"; - -export class KipperLexer extends KipperLexerBase { - public static readonly FStringExpStart = 1; - public static readonly BlockComment = 2; - public static readonly LineComment = 3; - public static readonly Const = 4; - public static readonly Var = 5; - public static readonly As = 6; - public static readonly Spread = 7; - public static readonly Switch = 8; - public static readonly Case = 9; - public static readonly Default = 10; - public static readonly Break = 11; - public static readonly Continue = 12; - public static readonly Do = 13; - public static readonly While = 14; - public static readonly If = 15; - public static readonly Else = 16; - public static readonly For = 17; - public static readonly Enum = 18; - public static readonly DefFunc = 19; - public static readonly Return = 20; - public static readonly CallFunc = 21; - public static readonly RetIndicator = 22; - public static readonly Class = 23; - public static readonly Interface = 24; - public static readonly True = 25; - public static readonly False = 26; - public static readonly Typeof = 27; - public static readonly Void = 28; - public static readonly Null = 29; - public static readonly Undefined = 30; - public static readonly Comma = 31; - public static readonly SemiColon = 32; - public static readonly QuestionMark = 33; - public static readonly Colon = 34; - public static readonly LeftParen = 35; - public static readonly RightParen = 36; - public static readonly LeftBracket = 37; - public static readonly RightBracket = 38; - public static readonly FStringExpEnd = 39; - public static readonly LeftBrace = 40; - public static readonly RightBrace = 41; - public static readonly Plus = 42; - public static readonly PlusPlus = 43; - public static readonly Minus = 44; - public static readonly MinusMinus = 45; - public static readonly Star = 46; - public static readonly Div = 47; - public static readonly Mod = 48; - public static readonly PowerTo = 49; - public static readonly AndAnd = 50; - public static readonly OrOr = 51; - public static readonly Not = 52; - public static readonly Assign = 53; - public static readonly PlusAssign = 54; - public static readonly MinusAssign = 55; - public static readonly StarAssign = 56; - public static readonly DivAssign = 57; - public static readonly ModAssign = 58; - public static readonly Equal = 59; - public static readonly NotEqual = 60; - public static readonly Less = 61; - public static readonly LessEqual = 62; - public static readonly Greater = 63; - public static readonly GreaterEqual = 64; - public static readonly BitwiseAnd = 65; - public static readonly BitwiseOr = 66; - public static readonly BitwiseXor = 67; - public static readonly BitwiseNot = 68; - public static readonly BitwiseZeroFillLeftShift = 69; - public static readonly BitwiseSignedRightShift = 70; - public static readonly BitwiseZeroFillRightShift = 71; - public static readonly Dot = 72; - public static readonly Identifier = 73; - public static readonly IntegerConstant = 74; - public static readonly SingleQuoteStringLiteral = 75; - public static readonly DoubleQuoteStringLiteral = 76; - public static readonly FloatingConstant = 77; - public static readonly Whitespace = 78; - public static readonly Newline = 79; - public static readonly FStringSingleQuoteStart = 80; - public static readonly FStringDoubleQuoteStart = 81; - public static readonly FStringSingleQuoteEnd = 82; - public static readonly FStringSingleQuoteAtom = 83; - public static readonly FStringDoubleQuoteEnd = 84; - public static readonly FStringDoubleQuoteAtom = 85; - public static readonly COMMENT = 2; - public static readonly SINGLE_QUOTE_FSTRING = 1; - public static readonly DOUBLE_QUOTE_FSTRING = 2; - - // tslint:disable:no-trailing-whitespace - public static readonly channelNames: string[] = ["DEFAULT_TOKEN_CHANNEL", "HIDDEN", "COMMENT"]; - - // tslint:disable:no-trailing-whitespace - public static readonly modeNames: string[] = ["DEFAULT_MODE", "SINGLE_QUOTE_FSTRING", "DOUBLE_QUOTE_FSTRING"]; - - public static readonly ruleNames: string[] = [ - "BlockComment", - "LineComment", - "Const", - "Var", - "As", - "Spread", - "Switch", - "Case", - "Default", - "Break", - "Continue", - "Do", - "While", - "If", - "Else", - "For", - "Enum", - "DefFunc", - "Return", - "CallFunc", - "RetIndicator", - "Class", - "Interface", - "True", - "False", - "Typeof", - "Void", - "Null", - "Undefined", - "Comma", - "SemiColon", - "QuestionMark", - "Colon", - "LeftParen", - "RightParen", - "LeftBracket", - "RightBracket", - "FStringExpEnd", - "LeftBrace", - "RightBrace", - "Plus", - "PlusPlus", - "Minus", - "MinusMinus", - "Star", - "Div", - "Mod", - "PowerTo", - "AndAnd", - "OrOr", - "Not", - "Assign", - "PlusAssign", - "MinusAssign", - "StarAssign", - "DivAssign", - "ModAssign", - "Equal", - "NotEqual", - "Less", - "LessEqual", - "Greater", - "GreaterEqual", - "BitwiseAnd", - "BitwiseOr", - "BitwiseXor", - "BitwiseNot", - "BitwiseZeroFillLeftShift", - "BitwiseSignedRightShift", - "BitwiseZeroFillRightShift", - "Dot", - "Identifier", - "IntegerConstant", - "SingleQuoteStringLiteral", - "DoubleQuoteStringLiteral", - "FloatingConstant", - "Whitespace", - "Newline", - "FStringSingleQuoteStart", - "FStringDoubleQuoteStart", - "FStringSingleQuoteExpStart", - "FStringSingleQuoteEnd", - "FStringSingleQuoteAtom", - "FStringDoubleQuoteExpStart", - "FStringDoubleQuoteEnd", - "FStringDoubleQuoteAtom", - "IdentifierNondigit", - "Nondigit", - "Digit", - "DecimalConstant", - "BinaryConstant", - "OctalConstant", - "HexadecimalConstant", - "NonzeroDigit", - "BinaryDigit", - "OctalDigit", - "HexadecimalDigit", - "DecimalFloatingConstant", - "FractionalConstant", - "ExponentPart", - "DigitSequence", - "Sign", - "CCharSequence", - "CChar", - "EscapeSequence", - "SimpleEscapeSequence", - "OctalEscapeSequence", - "HexadecimalEscapeSequence", - "SingleQuoteFStringSCharSequence", - "SingleQuoteFStringSChar", - "DoubleQuoteFStringSCharSequence", - "DoubleQuoteFStringSChar", - "SingleQuoteSCharSequence", - "SingleQuoteSChar", - "DoubleQuoteSCharSequence", - "DoubleQuoteSChar", - ]; - - private static readonly _LITERAL_NAMES: Array = [ - undefined, - undefined, - undefined, - undefined, - "'const'", - "'var'", - "'as'", - "'...'", - "'switch'", - "'case'", - "'default'", - "'break'", - "'continue'", - "'do'", - "'while'", - "'if'", - "'else'", - "'for'", - "'enum'", - "'def'", - "'return'", - "'call'", - "'->'", - "'class'", - "'interface'", - "'true'", - "'false'", - "'typeof'", - "'void'", - "'null'", - "'undefined'", - "','", - "';'", - "'?'", - "':'", - "'('", - "')'", - "'['", - "']'", - undefined, - "'{'", - "'}'", - "'+'", - "'++'", - "'-'", - "'--'", - "'*'", - "'/'", - "'%'", - "'**'", - "'&&'", - "'||'", - "'!'", - "'='", - "'+='", - "'-='", - "'*='", - "'/='", - "'%='", - "'=='", - "'!='", - "'<'", - "'<='", - "'>'", - "'>='", - "'&'", - "'|'", - "'^'", - "'~'", - "'<<'", - "'>>'", - "'>>>'", - "'.'", - ]; - private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, - "FStringExpStart", - "BlockComment", - "LineComment", - "Const", - "Var", - "As", - "Spread", - "Switch", - "Case", - "Default", - "Break", - "Continue", - "Do", - "While", - "If", - "Else", - "For", - "Enum", - "DefFunc", - "Return", - "CallFunc", - "RetIndicator", - "Class", - "Interface", - "True", - "False", - "Typeof", - "Void", - "Null", - "Undefined", - "Comma", - "SemiColon", - "QuestionMark", - "Colon", - "LeftParen", - "RightParen", - "LeftBracket", - "RightBracket", - "FStringExpEnd", - "LeftBrace", - "RightBrace", - "Plus", - "PlusPlus", - "Minus", - "MinusMinus", - "Star", - "Div", - "Mod", - "PowerTo", - "AndAnd", - "OrOr", - "Not", - "Assign", - "PlusAssign", - "MinusAssign", - "StarAssign", - "DivAssign", - "ModAssign", - "Equal", - "NotEqual", - "Less", - "LessEqual", - "Greater", - "GreaterEqual", - "BitwiseAnd", - "BitwiseOr", - "BitwiseXor", - "BitwiseNot", - "BitwiseZeroFillLeftShift", - "BitwiseSignedRightShift", - "BitwiseZeroFillRightShift", - "Dot", - "Identifier", - "IntegerConstant", - "SingleQuoteStringLiteral", - "DoubleQuoteStringLiteral", - "FloatingConstant", - "Whitespace", - "Newline", - "FStringSingleQuoteStart", - "FStringDoubleQuoteStart", - "FStringSingleQuoteEnd", - "FStringSingleQuoteAtom", - "FStringDoubleQuoteEnd", - "FStringDoubleQuoteAtom", - ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( - KipperLexer._LITERAL_NAMES, - KipperLexer._SYMBOLIC_NAMES, - [], - ); - - // @Override - // @NotNull - public get vocabulary(): Vocabulary { - return KipperLexer.VOCABULARY; - } - // tslint:enable:no-trailing-whitespace - - constructor(input: CharStream) { - super(input); - this._interp = new LexerATNSimulator(KipperLexer._ATN, this); - } - - // @Override - public get grammarFileName(): string { - return "KipperLexer.g4"; - } - - // @Override - public get ruleNames(): string[] { - return KipperLexer.ruleNames; - } - - // @Override - public get serializedATN(): string { - return KipperLexer._serializedATN; - } - - // @Override - public get channelNames(): string[] { - return KipperLexer.channelNames; - } - - // @Override - public get modeNames(): string[] { - return KipperLexer.modeNames; - } - - // @Override - public action(_localctx: RuleContext, ruleIndex: number, actionIndex: number): void { - switch (ruleIndex) { - case 78: - this.FStringSingleQuoteStart_action(_localctx, actionIndex); - break; - - case 79: - this.FStringDoubleQuoteStart_action(_localctx, actionIndex); - break; - - case 81: - this.FStringSingleQuoteEnd_action(_localctx, actionIndex); - break; - - case 84: - this.FStringDoubleQuoteEnd_action(_localctx, actionIndex); - break; - } - } - private FStringSingleQuoteStart_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 0: - this.incrementFStringDepth(); - break; - } - } - private FStringDoubleQuoteStart_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 1: - this.incrementFStringDepth(); - break; - } - } - private FStringSingleQuoteEnd_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 2: - this.decrementFStringDepth(); - break; - } - } - private FStringDoubleQuoteEnd_action(_localctx: RuleContext, actionIndex: number): void { - switch (actionIndex) { - case 3: - this.decrementFStringDepth(); - break; - } - } - // @Override - public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { - switch (ruleIndex) { - case 37: - return this.FStringExpEnd_sempred(_localctx, predIndex); - - case 80: - return this.FStringSingleQuoteExpStart_sempred(_localctx, predIndex); - - case 83: - return this.FStringDoubleQuoteExpStart_sempred(_localctx, predIndex); - } - return true; - } - private FStringExpEnd_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 0: - return this.insideFString(); - } - return true; - } - private FStringSingleQuoteExpStart_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 1: - return this.insideFString(); - } - return true; - } - private FStringDoubleQuoteExpStart_sempred(_localctx: RuleContext, predIndex: number): boolean { - switch (predIndex) { - case 2: - return this.insideFString(); - } - return true; - } - - private static readonly _serializedATNSegments: number = 2; - private static readonly _serializedATNSegment0: string = - "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x02W\u02E2\b\x01" + - "\b\x01\b\x01\x04\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04" + - "\x06\t\x06\x04\x07\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f" + - "\t\f\x04\r\t\r\x04\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11" + - "\x04\x12\t\x12\x04\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16" + - "\x04\x17\t\x17\x04\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B" + - "\x04\x1C\t\x1C\x04\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!" + - "\t!\x04\"\t\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04'\t'\x04(\t(\x04)\t" + - ")\x04*\t*\x04+\t+\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x040\t0\x041\t1\x04" + - "2\t2\x043\t3\x044\t4\x045\t5\x046\t6\x047\t7\x048\t8\x049\t9\x04:\t:\x04" + - ";\t;\x04<\t<\x04=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x04B\tB\x04C\tC\x04" + - "D\tD\x04E\tE\x04F\tF\x04G\tG\x04H\tH\x04I\tI\x04J\tJ\x04K\tK\x04L\tL\x04" + - "M\tM\x04N\tN\x04O\tO\x04P\tP\x04Q\tQ\x04R\tR\x04S\tS\x04T\tT\x04U\tU\x04" + - "V\tV\x04W\tW\x04X\tX\x04Y\tY\x04Z\tZ\x04[\t[\x04\\\t\\\x04]\t]\x04^\t" + - "^\x04_\t_\x04`\t`\x04a\ta\x04b\tb\x04c\tc\x04d\td\x04e\te\x04f\tf\x04" + - "g\tg\x04h\th\x04i\ti\x04j\tj\x04k\tk\x04l\tl\x04m\tm\x04n\tn\x04o\to\x04" + - "p\tp\x04q\tq\x04r\tr\x04s\ts\x04t\tt\x04u\tu\x03\x02\x03\x02\x03\x02\x03" + - "\x02\x07\x02\xF2\n\x02\f\x02\x0E\x02\xF5\v\x02\x03\x02\x03\x02\x03\x02" + - "\x03\x02\x03\x02\x03\x03\x03\x03\x03\x03\x03\x03\x07\x03\u0100\n\x03\f" + - "\x03\x0E\x03\u0103\v\x03\x03\x03\x03\x03\x03\x04\x03\x04\x03\x04\x03\x04" + - "\x03\x04\x03\x04\x03\x05\x03\x05\x03\x05\x03\x05\x03\x06\x03\x06\x03\x06" + - "\x03\x07\x03\x07\x03\x07\x03\x07\x03\b\x03\b\x03\b\x03\b\x03\b\x03\b\x03" + - "\b\x03\t\x03\t\x03\t\x03\t\x03\t\x03\n\x03\n\x03\n\x03\n\x03\n\x03\n\x03" + - "\n\x03\n\x03\v\x03\v\x03\v\x03\v\x03\v\x03\v\x03\f\x03\f\x03\f\x03\f\x03" + - "\f\x03\f\x03\f\x03\f\x03\f\x03\r\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0E\x03" + - "\x0E\x03\x0E\x03\x0E\x03\x0F\x03\x0F\x03\x0F\x03\x10\x03\x10\x03\x10\x03" + - "\x10\x03\x10\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\x14\x03\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\x17\x03\x17\x03\x17\x03\x17\x03\x17\x03\x17\x03" + - "\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03" + - "\x18\x03\x19\x03\x19\x03\x19\x03\x19\x03\x19\x03\x1A\x03\x1A\x03\x1A\x03" + - "\x1A\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03" + - "\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1D\x03\x1D\x03\x1D\x03" + - "\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03" + - '\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x03 \x03 \x03!\x03!\x03"\x03"\x03' + - "#\x03#\x03$\x03$\x03%\x03%\x03&\x03&\x03'\x03'\x03'\x03'\x03'\x03" + - "(\x03(\x03)\x03)\x03*\x03*\x03+\x03+\x03+\x03,\x03,\x03-\x03-\x03-\x03" + - ".\x03.\x03/\x03/\x030\x030\x031\x031\x031\x032\x032\x032\x033\x033\x03" + - "3\x034\x034\x035\x035\x036\x036\x036\x037\x037\x037\x038\x038\x038\x03" + - "9\x039\x039\x03:\x03:\x03:\x03;\x03;\x03;\x03<\x03<\x03<\x03=\x03=\x03" + - ">\x03>\x03>\x03?\x03?\x03@\x03@\x03@\x03A\x03A\x03B\x03B\x03C\x03C\x03" + - "D\x03D\x03E\x03E\x03E\x03F\x03F\x03F\x03G\x03G\x03G\x03G\x03H\x03H\x03" + - "I\x03I\x03I\x07I\u020A\nI\fI\x0EI\u020D\vI\x03J\x03J\x03J\x03J\x05J\u0213" + - "\nJ\x03K\x03K\x05K\u0217\nK\x03K\x03K\x03L\x03L\x05L\u021D\nL\x03L\x03" + - "L\x03M\x03M\x03N\x06N\u0224\nN\rN\x0EN\u0225\x03N\x03N\x03O\x03O\x03O" + - "\x03O\x03P\x03P\x03P\x03P\x03P\x03P\x03P\x03Q\x03Q\x03Q\x03Q\x03Q\x03" + - "Q\x03Q\x03R\x03R\x03R\x03R\x03R\x03R\x03S\x03S\x03S\x03S\x03S\x03T\x03" + - "T\x03U\x03U\x03U\x03U\x03U\x03U\x03V\x03V\x03V\x03V\x03V\x03W\x03W\x03" + - "X\x03X\x03Y\x03Y\x03Z\x03Z\x03[\x06[\u025D\n[\r[\x0E[\u025E\x03\\\x03" + - "\\\x03\\\x06\\\u0264\n\\\r\\\x0E\\\u0265\x03]\x03]\x03]\x06]\u026B\n]" + - "\r]\x0E]\u026C\x03^\x03^\x03^\x06^\u0272\n^\r^\x0E^\u0273\x03_\x03_\x03" + - "`\x03`\x03a\x03a\x03b\x03b\x03c\x03c\x05c\u0280\nc\x03c\x03c\x03c\x05" + - "c\u0285\nc\x03d\x05d\u0288\nd\x03d\x03d\x03d\x03d\x03d\x05d\u028F\nd\x03" + - "e\x03e\x05e\u0293\ne\x03e\x03e\x03f\x06f\u0298\nf\rf\x0Ef\u0299\x03g\x03" + - "g\x03h\x06h\u029F\nh\rh\x0Eh\u02A0\x03i\x03i\x05i\u02A5\ni\x03j\x03j\x03" + - "j\x05j\u02AA\nj\x03k\x03k\x03k\x03l\x03l\x03l\x05l\u02B2\nl\x03l\x05l" + - "\u02B5\nl\x03m\x03m\x03m\x03m\x06m\u02BB\nm\rm\x0Em\u02BC\x03n\x06n\u02C0" + - "\nn\rn\x0En\u02C1\x03o\x03o\x05o\u02C6\no\x03p\x06p\u02C9\np\rp\x0Ep\u02CA" + - "\x03q\x03q\x05q\u02CF\nq\x03r\x06r\u02D2\nr\rr\x0Er\u02D3\x03s\x03s\x05" + - "s\u02D8\ns\x03t\x06t\u02DB\nt\rt\x0Et\u02DC\x03u\x03u\x05u\u02E1\nu\x03" + - "\xF3\x02\x02v\x05\x02\x04\x07\x02\x05\t\x02\x06\v\x02\x07\r\x02\b\x0F" + - "\x02\t\x11\x02\n\x13\x02\v\x15\x02\f\x17\x02\r\x19\x02\x0E\x1B\x02\x0F" + - "\x1D\x02\x10\x1F\x02\x11!\x02\x12#\x02\x13%\x02\x14'\x02\x15)\x02\x16" + - "+\x02\x17-\x02\x18/\x02\x191\x02\x1A3\x02\x1B5\x02\x1C7\x02\x1D9\x02\x1E" + - ";\x02\x1F=\x02 ?\x02!A\x02\"C\x02#E\x02$G\x02%I\x02&K\x02'M\x02(O\x02" + - ")Q\x02*S\x02+U\x02,W\x02-Y\x02.[\x02/]\x020_\x021a\x022c\x023e\x024g\x02" + - "5i\x026k\x027m\x028o\x029q\x02:s\x02;u\x02{\x02?}\x02@\x7F" + - "\x02A\x81\x02B\x83\x02C\x85\x02D\x87\x02E\x89\x02F\x8B\x02G\x8D\x02H\x8F" + - "\x02I\x91\x02J\x93\x02K\x95\x02L\x97\x02M\x99\x02N\x9B\x02O\x9D\x02P\x9F" + - "\x02Q\xA1\x02R\xA3\x02S\xA5\x02\x02\xA7\x02T\xA9\x02U\xAB\x02\x02\xAD" + - "\x02V\xAF\x02W\xB1\x02\x02\xB3\x02\x02\xB5\x02\x02\xB7\x02\x02\xB9\x02" + - "\x02\xBB\x02\x02\xBD\x02\x02\xBF\x02\x02\xC1\x02\x02\xC3\x02\x02\xC5\x02" + - "\x02\xC7\x02\x02\xC9\x02\x02\xCB\x02\x02\xCD\x02\x02\xCF\x02\x02\xD1\x02" + - "\x02\xD3\x02\x02\xD5\x02\x02\xD7\x02\x02\xD9\x02\x02\xDB\x02\x02\xDD\x02" + - "\x02\xDF\x02\x02\xE1\x02\x02\xE3\x02\x02\xE5\x02\x02\xE7\x02\x02\xE9\x02" + - "\x02\xEB\x02\x02\x05\x02\x03\x04\x14\x05\x02\f\f\x0F\x0F\u202A\u202B\x06" + - '\x02\v\v\r\x0E""\xA2\xA2\x05\x02C\\aac|\x03\x022;\x04\x02DDdd\x04\x02' + - "QQqq\x04\x02ZZzz\x03\x023;\x03\x0223\x03\x0229\x05\x022;CHch\x04\x02G" + - "Ggg\x04\x02--//\x06\x02\f\f\x0F\x0F))^^\x0E\x02$$))AA^^cdhhppttvvxx}}" + - "\x7F\x7F\b\x02\f\f\x0F\x0F))^^}}\x7F\x7F\b\x02\f\f\x0F\x0F$$^^}}\x7F\x7F" + - "\x06\x02\f\f\x0F\x0F$$^^\x02\u02E4\x02\x05\x03\x02\x02\x02\x02\x07\x03" + - "\x02\x02\x02\x02\t\x03\x02\x02\x02\x02\v\x03\x02\x02\x02\x02\r\x03\x02" + - "\x02\x02\x02\x0F\x03\x02\x02\x02\x02\x11\x03\x02\x02\x02\x02\x13\x03\x02" + - "\x02\x02\x02\x15\x03\x02\x02\x02\x02\x17\x03\x02\x02\x02\x02\x19\x03\x02" + - "\x02\x02\x02\x1B\x03\x02\x02\x02\x02\x1D\x03\x02\x02\x02\x02\x1F\x03\x02" + - "\x02\x02\x02!\x03\x02\x02\x02\x02#\x03\x02\x02\x02\x02%\x03\x02\x02\x02" + - "\x02'\x03\x02\x02\x02\x02)\x03\x02\x02\x02\x02+\x03\x02\x02\x02\x02-" + - "\x03\x02\x02\x02\x02/\x03\x02\x02\x02\x021\x03\x02\x02\x02\x023\x03\x02" + - "\x02\x02\x025\x03\x02\x02\x02\x027\x03\x02\x02\x02\x029\x03\x02\x02\x02" + - "\x02;\x03\x02\x02\x02\x02=\x03\x02\x02\x02\x02?\x03\x02\x02\x02\x02A\x03" + - "\x02\x02\x02\x02C\x03\x02\x02\x02\x02E\x03\x02\x02\x02\x02G\x03\x02\x02" + - "\x02\x02I\x03\x02\x02\x02\x02K\x03\x02\x02\x02\x02M\x03\x02\x02\x02\x02" + - "O\x03\x02\x02\x02\x02Q\x03\x02\x02\x02\x02S\x03\x02\x02\x02\x02U\x03\x02" + - "\x02\x02\x02W\x03\x02\x02\x02\x02Y\x03\x02\x02\x02\x02[\x03\x02\x02\x02" + - "\x02]\x03\x02\x02\x02\x02_\x03\x02\x02\x02\x02a\x03\x02\x02\x02\x02c\x03" + - "\x02\x02\x02\x02e\x03\x02\x02\x02\x02g\x03\x02\x02\x02\x02i\x03\x02\x02" + - "\x02\x02k\x03\x02\x02\x02\x02m\x03\x02\x02\x02\x02o\x03\x02\x02\x02\x02" + - "q\x03\x02\x02\x02\x02s\x03\x02\x02\x02\x02u\x03\x02\x02\x02\x02w\x03\x02" + - "\x02\x02\x02y\x03\x02\x02\x02\x02{\x03\x02\x02\x02\x02}\x03\x02\x02\x02" + - "\x02\x7F\x03\x02\x02\x02\x02\x81\x03\x02\x02\x02\x02\x83\x03\x02\x02\x02" + - "\x02\x85\x03\x02\x02\x02\x02\x87\x03\x02\x02\x02\x02\x89\x03\x02\x02\x02" + - "\x02\x8B\x03\x02\x02\x02\x02\x8D\x03\x02\x02\x02\x02\x8F\x03\x02\x02\x02" + - "\x02\x91\x03\x02\x02\x02\x02\x93\x03\x02\x02\x02\x02\x95\x03\x02\x02\x02" + - "\x02\x97\x03\x02\x02\x02\x02\x99\x03\x02\x02\x02\x02\x9B\x03\x02\x02\x02" + - "\x02\x9D\x03\x02\x02\x02\x02\x9F\x03\x02\x02\x02\x02\xA1\x03\x02\x02\x02" + - "\x02\xA3\x03\x02\x02\x02\x03\xA5\x03\x02\x02\x02\x03\xA7\x03\x02\x02\x02" + - "\x03\xA9\x03\x02\x02\x02\x04\xAB\x03\x02\x02\x02\x04\xAD\x03\x02\x02\x02" + - "\x04\xAF\x03\x02\x02\x02\x05\xED\x03\x02\x02\x02\x07\xFB\x03\x02\x02\x02" + - "\t\u0106\x03\x02\x02\x02\v\u010C\x03\x02\x02\x02\r\u0110\x03\x02\x02\x02" + - "\x0F\u0113\x03\x02\x02\x02\x11\u0117\x03\x02\x02\x02\x13\u011E\x03\x02" + - "\x02\x02\x15\u0123\x03\x02\x02\x02\x17\u012B\x03\x02\x02\x02\x19\u0131" + - "\x03\x02\x02\x02\x1B\u013A\x03\x02\x02\x02\x1D\u013D\x03\x02\x02\x02\x1F" + - "\u0143\x03\x02\x02\x02!\u0146\x03\x02\x02\x02#\u014B\x03\x02\x02\x02%" + - "\u014F\x03\x02\x02\x02'\u0154\x03\x02\x02\x02)\u0158\x03\x02\x02\x02" + - "+\u015F\x03\x02\x02\x02-\u0164\x03\x02\x02\x02/\u0167\x03\x02\x02\x02" + - "1\u016D\x03\x02\x02\x023\u0177\x03\x02\x02\x025\u017C\x03\x02\x02\x02" + - "7\u0182\x03\x02\x02\x029\u0189\x03\x02\x02\x02;\u018E\x03\x02\x02\x02" + - "=\u0193\x03\x02\x02\x02?\u019D\x03\x02\x02\x02A\u019F\x03\x02\x02\x02" + - "C\u01A1\x03\x02\x02\x02E\u01A3\x03\x02\x02\x02G\u01A5\x03\x02\x02\x02" + - "I\u01A7\x03\x02\x02\x02K\u01A9\x03\x02\x02\x02M\u01AB\x03\x02\x02\x02" + - "O\u01AD\x03\x02\x02\x02Q\u01B2\x03\x02\x02\x02S\u01B4\x03\x02\x02\x02" + - "U\u01B6\x03\x02\x02\x02W\u01B8\x03\x02\x02\x02Y\u01BB\x03\x02\x02\x02" + - "[\u01BD\x03\x02\x02\x02]\u01C0\x03\x02\x02\x02_\u01C2\x03\x02\x02\x02" + - "a\u01C4\x03\x02\x02\x02c\u01C6\x03\x02\x02\x02e\u01C9\x03\x02\x02\x02" + - "g\u01CC\x03\x02\x02\x02i\u01CF\x03\x02\x02\x02k\u01D1\x03\x02\x02\x02" + - "m\u01D3\x03\x02\x02\x02o\u01D6\x03\x02\x02\x02q\u01D9\x03\x02\x02\x02" + - "s\u01DC\x03\x02\x02\x02u\u01DF\x03\x02\x02\x02w\u01E2\x03\x02\x02\x02" + - "y\u01E5\x03\x02\x02\x02{\u01E8\x03\x02\x02\x02}\u01EA\x03\x02\x02\x02" + - "\x7F\u01ED\x03\x02\x02\x02\x81\u01EF\x03\x02\x02\x02\x83\u01F2\x03\x02" + - "\x02\x02\x85\u01F4\x03\x02\x02\x02\x87\u01F6\x03\x02\x02\x02\x89\u01F8" + - "\x03\x02\x02\x02\x8B\u01FA\x03\x02\x02\x02\x8D\u01FD\x03\x02\x02\x02\x8F" + - "\u0200\x03\x02\x02\x02\x91\u0204\x03\x02\x02\x02\x93\u0206\x03\x02\x02" + - "\x02\x95\u0212\x03\x02\x02\x02\x97\u0214\x03\x02\x02\x02\x99\u021A\x03" + - "\x02\x02\x02\x9B\u0220\x03\x02\x02\x02\x9D\u0223\x03\x02\x02\x02\x9F\u0229" + - "\x03\x02\x02\x02\xA1\u022D\x03\x02\x02\x02\xA3\u0234\x03\x02\x02\x02\xA5" + - "\u023B\x03\x02\x02\x02\xA7\u0241\x03\x02\x02\x02\xA9\u0246\x03\x02\x02" + - "\x02\xAB\u0248\x03\x02\x02\x02\xAD\u024E\x03\x02\x02\x02\xAF\u0253\x03" + - "\x02\x02\x02\xB1\u0255\x03\x02\x02\x02\xB3\u0257\x03\x02\x02\x02\xB5\u0259" + - "\x03\x02\x02\x02\xB7\u025C\x03\x02\x02\x02\xB9\u0260\x03\x02\x02\x02\xBB" + - "\u0267\x03\x02\x02\x02\xBD\u026E\x03\x02\x02\x02\xBF\u0275\x03\x02\x02" + - "\x02\xC1\u0277\x03\x02\x02\x02\xC3\u0279\x03\x02\x02\x02\xC5\u027B\x03" + - "\x02\x02\x02\xC7\u0284\x03\x02\x02\x02\xC9\u028E\x03\x02\x02\x02\xCB\u0290" + - "\x03\x02\x02\x02\xCD\u0297\x03\x02\x02\x02\xCF\u029B\x03\x02\x02\x02\xD1" + - "\u029E\x03\x02\x02\x02\xD3\u02A4\x03\x02\x02\x02\xD5\u02A9\x03\x02\x02" + - "\x02\xD7\u02AB\x03\x02\x02\x02\xD9\u02AE\x03\x02\x02\x02\xDB\u02B6\x03" + - "\x02\x02\x02\xDD\u02BF\x03\x02\x02\x02\xDF\u02C5\x03\x02\x02\x02\xE1\u02C8" + - "\x03\x02\x02\x02\xE3\u02CE\x03\x02\x02\x02\xE5\u02D1\x03\x02\x02\x02\xE7" + - "\u02D7\x03\x02\x02\x02\xE9\u02DA\x03\x02\x02\x02\xEB\u02E0\x03\x02\x02" + - "\x02\xED\xEE\x071\x02\x02\xEE\xEF\x07,\x02\x02\xEF\xF3\x03\x02\x02\x02" + - "\xF0\xF2\v\x02\x02\x02\xF1\xF0\x03\x02\x02\x02\xF2\xF5\x03\x02\x02\x02" + - "\xF3\xF4\x03\x02\x02\x02\xF3\xF1\x03\x02\x02\x02\xF4\xF6\x03\x02\x02\x02" + - "\xF5\xF3\x03\x02\x02\x02\xF6\xF7\x07,\x02\x02\xF7\xF8\x071\x02\x02\xF8" + - "\xF9\x03\x02\x02\x02\xF9\xFA\b\x02\x02\x02\xFA\x06\x03\x02\x02\x02\xFB" + - "\xFC\x071\x02\x02\xFC\xFD\x071\x02\x02\xFD\u0101\x03\x02\x02\x02\xFE\u0100" + - "\n\x02\x02\x02\xFF\xFE\x03\x02\x02\x02\u0100\u0103\x03\x02\x02\x02\u0101" + - "\xFF\x03\x02\x02\x02\u0101\u0102\x03\x02\x02\x02\u0102\u0104\x03\x02\x02" + - "\x02\u0103\u0101\x03\x02\x02\x02\u0104\u0105\b\x03\x02\x02\u0105\b\x03" + - "\x02\x02\x02\u0106\u0107\x07e\x02\x02\u0107\u0108\x07q\x02\x02\u0108\u0109" + - "\x07p\x02\x02\u0109\u010A\x07u\x02\x02\u010A\u010B\x07v\x02\x02\u010B" + - "\n\x03\x02\x02\x02\u010C\u010D\x07x\x02\x02\u010D\u010E\x07c\x02\x02\u010E" + - "\u010F\x07t\x02\x02\u010F\f\x03\x02\x02\x02\u0110\u0111\x07c\x02\x02\u0111" + - "\u0112\x07u\x02\x02\u0112\x0E\x03\x02\x02\x02\u0113\u0114\x070\x02\x02" + - "\u0114\u0115\x070\x02\x02\u0115\u0116\x070\x02\x02\u0116\x10\x03\x02\x02" + - "\x02\u0117\u0118\x07u\x02\x02\u0118\u0119\x07y\x02\x02\u0119\u011A\x07" + - "k\x02\x02\u011A\u011B\x07v\x02\x02\u011B\u011C\x07e\x02\x02\u011C\u011D" + - "\x07j\x02\x02\u011D\x12\x03\x02\x02\x02\u011E\u011F\x07e\x02\x02\u011F" + - "\u0120\x07c\x02\x02\u0120\u0121\x07u\x02\x02\u0121\u0122\x07g\x02\x02" + - "\u0122\x14\x03\x02\x02\x02\u0123\u0124\x07f\x02\x02\u0124\u0125\x07g\x02" + - "\x02\u0125\u0126\x07h\x02\x02\u0126\u0127\x07c\x02\x02\u0127\u0128\x07" + - "w\x02\x02\u0128\u0129\x07n\x02\x02\u0129\u012A\x07v\x02\x02\u012A\x16" + - "\x03\x02\x02\x02\u012B\u012C\x07d\x02\x02\u012C\u012D\x07t\x02\x02\u012D" + - "\u012E\x07g\x02\x02\u012E\u012F\x07c\x02\x02\u012F\u0130\x07m\x02\x02" + - "\u0130\x18\x03\x02\x02\x02\u0131\u0132\x07e\x02\x02\u0132\u0133\x07q\x02" + - "\x02\u0133\u0134\x07p\x02\x02\u0134\u0135\x07v\x02\x02\u0135\u0136\x07" + - "k\x02\x02\u0136\u0137\x07p\x02\x02\u0137\u0138\x07w\x02\x02\u0138\u0139" + - "\x07g\x02\x02\u0139\x1A\x03\x02\x02\x02\u013A\u013B\x07f\x02\x02\u013B" + - "\u013C\x07q\x02\x02\u013C\x1C\x03\x02\x02\x02\u013D\u013E\x07y\x02\x02" + - "\u013E\u013F\x07j\x02\x02\u013F\u0140\x07k\x02\x02\u0140\u0141\x07n\x02" + - "\x02\u0141\u0142\x07g\x02\x02\u0142\x1E\x03\x02\x02\x02\u0143\u0144\x07" + - "k\x02\x02\u0144\u0145\x07h\x02\x02\u0145 \x03\x02\x02\x02\u0146\u0147" + - "\x07g\x02\x02\u0147\u0148\x07n\x02\x02\u0148\u0149\x07u\x02\x02\u0149" + - '\u014A\x07g\x02\x02\u014A"\x03\x02\x02\x02\u014B\u014C\x07h\x02\x02\u014C' + - "\u014D\x07q\x02\x02\u014D\u014E\x07t\x02\x02\u014E$\x03\x02\x02\x02\u014F" + - "\u0150\x07g\x02\x02\u0150\u0151\x07p\x02\x02\u0151\u0152\x07w\x02\x02" + - "\u0152\u0153\x07o\x02\x02\u0153&\x03\x02\x02\x02\u0154\u0155\x07f\x02" + - "\x02\u0155\u0156\x07g\x02\x02\u0156\u0157\x07h\x02\x02\u0157(\x03\x02" + - "\x02\x02\u0158\u0159\x07t\x02\x02\u0159\u015A\x07g\x02\x02\u015A\u015B" + - "\x07v\x02\x02\u015B\u015C\x07w\x02\x02\u015C\u015D\x07t\x02\x02\u015D" + - "\u015E\x07p\x02\x02\u015E*\x03\x02\x02\x02\u015F\u0160\x07e\x02\x02\u0160" + - "\u0161\x07c\x02\x02\u0161\u0162\x07n\x02\x02\u0162\u0163\x07n\x02\x02" + - "\u0163,\x03\x02\x02\x02\u0164\u0165\x07/\x02\x02\u0165\u0166\x07@\x02" + - "\x02\u0166.\x03\x02\x02\x02\u0167\u0168\x07e\x02\x02\u0168\u0169\x07n" + - "\x02\x02\u0169\u016A\x07c\x02\x02\u016A\u016B\x07u\x02\x02\u016B\u016C" + - "\x07u\x02\x02\u016C0\x03\x02\x02\x02\u016D\u016E\x07k\x02\x02\u016E\u016F" + - "\x07p\x02\x02\u016F\u0170\x07v\x02\x02\u0170\u0171\x07g\x02\x02\u0171" + - "\u0172\x07t\x02\x02\u0172\u0173\x07h\x02\x02\u0173\u0174\x07c\x02\x02" + - "\u0174\u0175\x07e\x02\x02\u0175\u0176\x07g\x02\x02\u01762\x03\x02\x02" + - "\x02\u0177\u0178\x07v\x02\x02\u0178\u0179\x07t\x02\x02\u0179\u017A\x07" + - "w\x02\x02\u017A\u017B\x07g\x02\x02\u017B4\x03\x02\x02\x02\u017C\u017D" + - "\x07h\x02\x02\u017D\u017E\x07c\x02\x02\u017E\u017F\x07n\x02\x02\u017F" + - "\u0180\x07u\x02\x02\u0180\u0181\x07g\x02\x02\u01816\x03\x02\x02\x02\u0182" + - "\u0183\x07v\x02\x02\u0183\u0184\x07{\x02\x02\u0184\u0185\x07r\x02\x02" + - "\u0185\u0186\x07g\x02\x02\u0186\u0187\x07q\x02\x02\u0187\u0188\x07h\x02" + - "\x02\u01888\x03\x02\x02\x02\u0189\u018A\x07x\x02\x02\u018A\u018B\x07q" + - "\x02\x02\u018B\u018C\x07k\x02\x02\u018C\u018D\x07f\x02\x02\u018D:\x03" + - "\x02\x02\x02\u018E\u018F\x07p\x02\x02\u018F\u0190\x07w\x02\x02\u0190\u0191" + - "\x07n\x02\x02\u0191\u0192\x07n\x02\x02\u0192<\x03\x02\x02\x02\u0193\u0194" + - "\x07w\x02\x02\u0194\u0195\x07p\x02\x02\u0195\u0196\x07f\x02\x02\u0196" + - "\u0197\x07g\x02\x02\u0197\u0198\x07h\x02\x02\u0198\u0199\x07k\x02\x02" + - "\u0199\u019A\x07p\x02\x02\u019A\u019B\x07g\x02\x02\u019B\u019C\x07f\x02" + - "\x02\u019C>\x03\x02\x02\x02\u019D\u019E\x07.\x02\x02\u019E@\x03\x02\x02" + - "\x02\u019F\u01A0\x07=\x02\x02\u01A0B\x03\x02\x02\x02\u01A1\u01A2\x07A" + - "\x02\x02\u01A2D\x03\x02\x02\x02\u01A3\u01A4\x07<\x02\x02\u01A4F\x03\x02" + - "\x02\x02\u01A5\u01A6\x07*\x02\x02\u01A6H\x03\x02\x02\x02\u01A7\u01A8\x07" + - "+\x02\x02\u01A8J\x03\x02\x02\x02\u01A9\u01AA\x07]\x02\x02\u01AAL\x03\x02" + - "\x02\x02\u01AB\u01AC\x07_\x02\x02\u01ACN\x03\x02\x02\x02\u01AD\u01AE\x06" + - "'\x02\x02\u01AE\u01AF\x07\x7F\x02\x02\u01AF\u01B0\x03\x02\x02\x02\u01B0" + - "\u01B1\b'\x03\x02\u01B1P\x03\x02\x02\x02\u01B2\u01B3\x07}\x02\x02\u01B3" + - "R\x03\x02\x02\x02\u01B4\u01B5\x07\x7F\x02\x02\u01B5T\x03\x02\x02\x02\u01B6" + - "\u01B7\x07-\x02\x02\u01B7V\x03\x02\x02\x02\u01B8\u01B9\x07-\x02\x02\u01B9" + - "\u01BA\x07-\x02\x02\u01BAX\x03\x02\x02\x02\u01BB\u01BC\x07/\x02\x02\u01BC" + - "Z\x03\x02\x02\x02\u01BD\u01BE\x07/\x02\x02\u01BE\u01BF\x07/\x02\x02\u01BF" + - "\\\x03\x02\x02\x02\u01C0\u01C1\x07,\x02\x02\u01C1^\x03\x02\x02\x02\u01C2" + - "\u01C3\x071\x02\x02\u01C3`\x03\x02\x02\x02\u01C4\u01C5\x07'\x02\x02\u01C5" + - "b\x03\x02\x02\x02\u01C6\u01C7\x07,\x02\x02\u01C7\u01C8\x07,\x02\x02\u01C8" + - "d\x03\x02\x02\x02\u01C9\u01CA\x07(\x02\x02\u01CA\u01CB\x07(\x02\x02\u01CB" + - "f\x03\x02\x02\x02\u01CC\u01CD\x07~\x02\x02\u01CD\u01CE\x07~\x02\x02\u01CE" + - "h\x03\x02\x02\x02\u01CF\u01D0\x07#\x02\x02\u01D0j\x03\x02\x02\x02\u01D1" + - "\u01D2\x07?\x02\x02\u01D2l\x03\x02\x02\x02\u01D3\u01D4\x07-\x02\x02\u01D4" + - "\u01D5\x07?\x02\x02\u01D5n\x03\x02\x02\x02\u01D6\u01D7\x07/\x02\x02\u01D7" + - "\u01D8\x07?\x02\x02\u01D8p\x03\x02\x02\x02\u01D9\u01DA\x07,\x02\x02\u01DA" + - "\u01DB\x07?\x02\x02\u01DBr\x03\x02\x02\x02\u01DC\u01DD\x071\x02\x02\u01DD" + - "\u01DE\x07?\x02\x02\u01DEt\x03\x02\x02\x02\u01DF\u01E0\x07'\x02\x02\u01E0" + - "\u01E1\x07?\x02\x02\u01E1v\x03\x02\x02\x02\u01E2\u01E3\x07?\x02\x02\u01E3" + - "\u01E4\x07?\x02\x02\u01E4x\x03\x02\x02\x02\u01E5\u01E6\x07#\x02\x02\u01E6" + - "\u01E7\x07?\x02\x02\u01E7z\x03\x02\x02\x02\u01E8\u01E9\x07>\x02\x02\u01E9" + - "|\x03\x02\x02\x02\u01EA\u01EB\x07>\x02\x02\u01EB\u01EC\x07?\x02\x02\u01EC" + - "~\x03\x02\x02\x02\u01ED\u01EE\x07@\x02\x02\u01EE\x80\x03\x02\x02\x02\u01EF" + - "\u01F0\x07@\x02\x02\u01F0\u01F1\x07?\x02\x02\u01F1\x82\x03\x02\x02\x02" + - "\u01F2\u01F3\x07(\x02\x02\u01F3\x84\x03\x02\x02\x02\u01F4\u01F5\x07~\x02" + - "\x02\u01F5\x86\x03\x02\x02\x02\u01F6\u01F7\x07`\x02\x02\u01F7\x88\x03" + - "\x02\x02\x02\u01F8\u01F9\x07\x80\x02\x02\u01F9\x8A\x03\x02\x02\x02\u01FA" + - "\u01FB\x07>\x02\x02\u01FB\u01FC\x07>\x02\x02\u01FC\x8C\x03\x02\x02\x02" + - "\u01FD\u01FE\x07@\x02\x02\u01FE\u01FF\x07@\x02\x02\u01FF\x8E\x03\x02\x02" + - "\x02\u0200\u0201\x07@\x02\x02\u0201\u0202\x07@\x02\x02\u0202\u0203\x07" + - "@\x02\x02\u0203\x90\x03\x02\x02\x02\u0204\u0205\x070\x02\x02\u0205\x92" + - "\x03\x02\x02\x02\u0206\u020B\x05\xB1X\x02\u0207\u020A\x05\xB1X\x02\u0208" + - "\u020A\x05\xB5Z\x02\u0209\u0207\x03\x02\x02\x02\u0209\u0208\x03\x02\x02" + - "\x02\u020A\u020D\x03\x02\x02\x02\u020B\u0209\x03\x02\x02\x02\u020B\u020C" + - "\x03\x02"; - private static readonly _serializedATNSegment1: string = - "\x02\x02\u020C\x94\x03\x02\x02\x02\u020D\u020B\x03\x02\x02\x02\u020E\u0213" + - "\x05\xB7[\x02\u020F\u0213\x05\xBB]\x02\u0210\u0213\x05\xBD^\x02\u0211" + - "\u0213\x05\xB9\\\x02\u0212\u020E\x03\x02\x02\x02\u0212\u020F\x03\x02\x02" + - "\x02\u0212\u0210\x03\x02\x02\x02\u0212\u0211\x03\x02\x02\x02\u0213\x96" + - "\x03\x02\x02\x02\u0214\u0216\x07)\x02\x02\u0215\u0217\x05\xE5r\x02\u0216" + - "\u0215\x03\x02\x02\x02\u0216\u0217\x03\x02\x02\x02\u0217\u0218\x03\x02" + - "\x02\x02\u0218\u0219\x07)\x02\x02\u0219\x98\x03\x02\x02\x02\u021A\u021C" + - "\x07$\x02\x02\u021B\u021D\x05\xE9t\x02\u021C\u021B\x03\x02\x02\x02\u021C" + - "\u021D\x03\x02\x02\x02\u021D\u021E\x03\x02\x02\x02\u021E\u021F\x07$\x02" + - "\x02\u021F\x9A\x03\x02\x02\x02\u0220\u0221\x05\xC7c\x02\u0221\x9C\x03" + - "\x02\x02\x02\u0222\u0224\t\x03\x02\x02\u0223\u0222\x03\x02\x02\x02\u0224" + - "\u0225\x03\x02\x02\x02\u0225\u0223\x03\x02\x02\x02\u0225\u0226\x03\x02" + - "\x02\x02\u0226\u0227\x03\x02\x02\x02\u0227\u0228\bN\x04\x02\u0228\x9E" + - "\x03\x02\x02\x02\u0229\u022A\t\x02\x02\x02\u022A\u022B\x03\x02\x02\x02" + - "\u022B\u022C\bO\x04\x02\u022C\xA0\x03\x02\x02\x02\u022D\u022E\x07h\x02" + - "\x02\u022E\u022F\x07)\x02\x02\u022F\u0230\x03\x02\x02\x02\u0230\u0231" + - "\bP\x05\x02\u0231\u0232\x03\x02\x02\x02\u0232\u0233\bP\x06\x02\u0233\xA2" + - "\x03\x02\x02\x02\u0234\u0235\x07h\x02\x02\u0235\u0236\x07$\x02\x02\u0236" + - "\u0237\x03\x02\x02\x02\u0237\u0238\bQ\x07\x02\u0238\u0239\x03\x02\x02" + - "\x02\u0239\u023A\bQ\b\x02\u023A\xA4\x03\x02\x02\x02\u023B\u023C\x06R\x03" + - "\x02\u023C\u023D\x07}\x02\x02\u023D\u023E\x03\x02\x02\x02\u023E\u023F" + - "\bR\t\x02\u023F\u0240\bR\n\x02\u0240\xA6\x03\x02\x02\x02\u0241\u0242\x07" + - ")\x02\x02\u0242\u0243\bS\v\x02\u0243\u0244\x03\x02\x02\x02\u0244\u0245" + - "\bS\x03\x02\u0245\xA8\x03\x02\x02\x02\u0246\u0247\x05\xDDn\x02\u0247\xAA" + - "\x03\x02\x02\x02\u0248\u0249\x06U\x04\x02\u0249\u024A\x07}\x02\x02\u024A" + - "\u024B\x03\x02\x02\x02\u024B\u024C\bU\t\x02\u024C\u024D\bU\n\x02\u024D" + - "\xAC\x03\x02\x02\x02\u024E\u024F\x07$\x02\x02\u024F\u0250\bV\f\x02\u0250" + - "\u0251\x03\x02\x02\x02\u0251\u0252\bV\x03\x02\u0252\xAE\x03\x02\x02\x02" + - "\u0253\u0254\x05\xE1p\x02\u0254\xB0\x03\x02\x02\x02\u0255\u0256\x05\xB3" + - "Y\x02\u0256\xB2\x03\x02\x02\x02\u0257\u0258\t\x04\x02\x02\u0258\xB4\x03" + - "\x02\x02\x02\u0259\u025A\t\x05\x02\x02\u025A\xB6\x03\x02\x02\x02\u025B" + - "\u025D\x05\xB5Z\x02\u025C\u025B\x03\x02\x02\x02\u025D\u025E\x03\x02\x02" + - "\x02\u025E\u025C\x03\x02\x02\x02\u025E\u025F\x03\x02\x02\x02\u025F\xB8" + - "\x03\x02\x02\x02\u0260\u0261\x072\x02\x02\u0261\u0263\t\x06\x02\x02\u0262" + - "\u0264\x05\xC1`\x02\u0263\u0262\x03\x02\x02\x02\u0264\u0265\x03\x02\x02" + - "\x02\u0265\u0263\x03\x02\x02\x02\u0265\u0266\x03\x02\x02\x02\u0266\xBA" + - "\x03\x02\x02\x02\u0267\u0268\x072\x02\x02\u0268\u026A\t\x07\x02\x02\u0269" + - "\u026B\x05\xC3a\x02\u026A\u0269\x03\x02\x02\x02\u026B\u026C\x03\x02\x02" + - "\x02\u026C\u026A\x03\x02\x02\x02\u026C\u026D\x03\x02\x02\x02\u026D\xBC" + - "\x03\x02\x02\x02\u026E\u026F\x072\x02\x02\u026F\u0271\t\b\x02\x02\u0270" + - "\u0272\x05\xC5b\x02\u0271\u0270\x03\x02\x02\x02\u0272\u0273\x03\x02\x02" + - "\x02\u0273\u0271\x03\x02\x02\x02\u0273\u0274\x03\x02\x02\x02\u0274\xBE" + - "\x03\x02\x02\x02\u0275\u0276\t\t\x02\x02\u0276\xC0\x03\x02\x02\x02\u0277" + - "\u0278\t\n\x02\x02\u0278\xC2\x03\x02\x02\x02\u0279\u027A\t\v\x02\x02\u027A" + - "\xC4\x03\x02\x02\x02\u027B\u027C\t\f\x02\x02\u027C\xC6\x03\x02\x02\x02" + - "\u027D\u027F\x05\xC9d\x02\u027E\u0280\x05\xCBe\x02\u027F\u027E\x03\x02" + - "\x02\x02\u027F\u0280\x03\x02\x02\x02\u0280\u0285\x03\x02\x02\x02\u0281" + - "\u0282\x05\xCDf\x02\u0282\u0283\x05\xCBe\x02\u0283\u0285\x03\x02\x02\x02" + - "\u0284\u027D\x03\x02\x02\x02\u0284\u0281\x03\x02\x02\x02\u0285\xC8\x03" + - "\x02\x02\x02\u0286\u0288\x05\xCDf\x02\u0287\u0286\x03\x02\x02\x02\u0287" + - "\u0288\x03\x02\x02\x02\u0288\u0289\x03\x02\x02\x02\u0289\u028A\x070\x02" + - "\x02\u028A\u028F\x05\xCDf\x02\u028B\u028C\x05\xCDf\x02\u028C\u028D\x07" + - "0\x02\x02\u028D\u028F\x03\x02\x02\x02\u028E\u0287\x03\x02\x02\x02\u028E" + - "\u028B\x03\x02\x02\x02\u028F\xCA\x03\x02\x02\x02\u0290\u0292\t\r\x02\x02" + - "\u0291\u0293\x05\xCFg\x02\u0292\u0291\x03\x02\x02\x02\u0292\u0293\x03" + - "\x02\x02\x02\u0293\u0294\x03\x02\x02\x02\u0294\u0295\x05\xCDf\x02\u0295" + - "\xCC\x03\x02\x02\x02\u0296\u0298\x05\xB5Z\x02\u0297\u0296\x03\x02\x02" + - "\x02\u0298\u0299\x03\x02\x02\x02\u0299\u0297\x03\x02\x02\x02\u0299\u029A" + - "\x03\x02\x02\x02\u029A\xCE\x03\x02\x02\x02\u029B\u029C\t\x0E\x02\x02\u029C" + - "\xD0\x03\x02\x02\x02\u029D\u029F\x05\xD3i\x02\u029E\u029D\x03\x02\x02" + - "\x02\u029F\u02A0\x03\x02\x02\x02\u02A0\u029E\x03\x02\x02\x02\u02A0\u02A1" + - "\x03\x02\x02\x02\u02A1\xD2\x03\x02\x02\x02\u02A2\u02A5\n\x0F\x02\x02\u02A3" + - "\u02A5\x05\xD5j\x02\u02A4\u02A2\x03\x02\x02\x02\u02A4\u02A3\x03\x02\x02" + - "\x02\u02A5\xD4\x03\x02\x02\x02\u02A6\u02AA\x05\xD7k\x02\u02A7\u02AA\x05" + - "\xD9l\x02\u02A8\u02AA\x05\xDBm\x02\u02A9\u02A6\x03\x02\x02\x02\u02A9\u02A7" + - "\x03\x02\x02\x02\u02A9\u02A8\x03\x02\x02\x02\u02AA\xD6\x03\x02\x02\x02" + - "\u02AB\u02AC\x07^\x02\x02\u02AC\u02AD\t\x10\x02\x02\u02AD\xD8\x03\x02" + - "\x02\x02\u02AE\u02AF\x07^\x02\x02\u02AF\u02B1\x05\xC3a\x02\u02B0\u02B2" + - "\x05\xC3a\x02\u02B1\u02B0\x03\x02\x02\x02\u02B1\u02B2\x03\x02\x02\x02" + - "\u02B2\u02B4\x03\x02\x02\x02\u02B3\u02B5\x05\xC3a\x02\u02B4\u02B3\x03" + - "\x02\x02\x02\u02B4\u02B5\x03\x02\x02\x02\u02B5\xDA\x03\x02\x02\x02\u02B6" + - "\u02B7\x07^\x02\x02\u02B7\u02B8\x07z\x02\x02\u02B8\u02BA\x03\x02\x02\x02" + - "\u02B9\u02BB\x05\xC5b\x02\u02BA\u02B9\x03\x02\x02\x02\u02BB\u02BC\x03" + - "\x02\x02\x02\u02BC\u02BA\x03\x02\x02\x02\u02BC\u02BD\x03\x02\x02\x02\u02BD" + - "\xDC\x03\x02\x02\x02\u02BE\u02C0\x05\xDFo\x02\u02BF\u02BE\x03\x02\x02" + - "\x02\u02C0\u02C1\x03\x02\x02\x02\u02C1\u02BF\x03\x02\x02\x02\u02C1\u02C2" + - "\x03\x02\x02\x02\u02C2\xDE\x03\x02\x02\x02\u02C3\u02C6\n\x11\x02\x02\u02C4" + - "\u02C6\x05\xD5j\x02\u02C5\u02C3\x03\x02\x02\x02\u02C5\u02C4\x03\x02\x02" + - "\x02\u02C6\xE0\x03\x02\x02\x02\u02C7\u02C9\x05\xE3q\x02\u02C8\u02C7\x03" + - "\x02\x02\x02\u02C9\u02CA\x03\x02\x02\x02\u02CA\u02C8\x03\x02\x02\x02\u02CA" + - "\u02CB\x03\x02\x02\x02\u02CB\xE2\x03\x02\x02\x02\u02CC\u02CF\n\x12\x02" + - "\x02\u02CD\u02CF\x05\xD5j\x02\u02CE\u02CC\x03\x02\x02\x02\u02CE\u02CD" + - "\x03\x02\x02\x02\u02CF\xE4\x03\x02\x02\x02\u02D0\u02D2\x05\xE7s\x02\u02D1" + - "\u02D0\x03\x02\x02\x02\u02D2\u02D3\x03\x02\x02\x02\u02D3\u02D1\x03\x02" + - "\x02\x02\u02D3\u02D4\x03\x02\x02\x02\u02D4\xE6\x03\x02\x02\x02\u02D5\u02D8" + - "\n\x0F\x02\x02\u02D6\u02D8\x05\xD5j\x02\u02D7\u02D5\x03\x02\x02\x02\u02D7" + - "\u02D6\x03\x02\x02\x02\u02D8\xE8\x03\x02\x02\x02\u02D9\u02DB\x05\xEBu" + - "\x02\u02DA\u02D9\x03\x02\x02\x02\u02DB\u02DC\x03\x02\x02\x02\u02DC\u02DA" + - "\x03\x02\x02\x02\u02DC\u02DD\x03\x02\x02\x02\u02DD\xEA\x03\x02\x02\x02" + - "\u02DE\u02E1\n\x13\x02\x02\u02DF\u02E1\x05\xD5j\x02\u02E0\u02DE\x03\x02" + - "\x02\x02\u02E0\u02DF\x03\x02\x02\x02\u02E1\xEC\x03\x02\x02\x02%\x02\x03" + - "\x04\xF3\u0101\u0209\u020B\u0212\u0216\u021C\u0225\u025E\u0265\u026C\u0273" + - "\u027F\u0284\u0287\u028E\u0292\u0299\u02A0\u02A4\u02A9\u02B1\u02B4\u02BC" + - "\u02C1\u02C5\u02CA\u02CE\u02D3\u02D7\u02DC\u02E0\r\x02\x04\x02\x06\x02" + - "\x02\x02\x03\x02\x03P\x02\x07\x03\x02\x03Q\x03\x07\x04\x02\t\x03\x02\x07" + - "\x02\x02\x03S\x04\x03V\x05"; - public static readonly _serializedATN: string = Utils.join( - [KipperLexer._serializedATNSegment0, KipperLexer._serializedATNSegment1], - "", - ); - public static __ATN: ATN; - public static get _ATN(): ATN { - if (!KipperLexer.__ATN) { - KipperLexer.__ATN = new ATNDeserializer().deserialize(Utils.toCharArray(KipperLexer._serializedATN)); - } - - return KipperLexer.__ATN; - } -} diff --git a/kipper/core/src/compiler/parser/antlr/KipperParser.tokens b/kipper/core/src/compiler/parser/antlr/KipperParser.tokens deleted file mode 100644 index 4784df64b..000000000 --- a/kipper/core/src/compiler/parser/antlr/KipperParser.tokens +++ /dev/null @@ -1,153 +0,0 @@ -FStringExpStart=1 -BlockComment=2 -LineComment=3 -Const=4 -Var=5 -As=6 -Spread=7 -Switch=8 -Case=9 -Default=10 -Break=11 -Continue=12 -Do=13 -While=14 -If=15 -Else=16 -For=17 -Enum=18 -DefFunc=19 -Return=20 -CallFunc=21 -RetIndicator=22 -Class=23 -Interface=24 -True=25 -False=26 -Typeof=27 -Void=28 -Null=29 -Undefined=30 -Comma=31 -SemiColon=32 -QuestionMark=33 -Colon=34 -LeftParen=35 -RightParen=36 -LeftBracket=37 -RightBracket=38 -FStringExpEnd=39 -LeftBrace=40 -RightBrace=41 -Plus=42 -PlusPlus=43 -Minus=44 -MinusMinus=45 -Star=46 -Div=47 -Mod=48 -PowerTo=49 -AndAnd=50 -OrOr=51 -Not=52 -Assign=53 -PlusAssign=54 -MinusAssign=55 -StarAssign=56 -DivAssign=57 -ModAssign=58 -Equal=59 -NotEqual=60 -Less=61 -LessEqual=62 -Greater=63 -GreaterEqual=64 -BitwiseAnd=65 -BitwiseOr=66 -BitwiseXor=67 -BitwiseNot=68 -BitwiseZeroFillLeftShift=69 -BitwiseSignedRightShift=70 -BitwiseZeroFillRightShift=71 -Dot=72 -Identifier=73 -IntegerConstant=74 -SingleQuoteStringLiteral=75 -DoubleQuoteStringLiteral=76 -FloatingConstant=77 -Whitespace=78 -Newline=79 -FStringSingleQuoteStart=80 -FStringDoubleQuoteStart=81 -FStringSingleQuoteEnd=82 -FStringSingleQuoteAtom=83 -FStringDoubleQuoteEnd=84 -FStringDoubleQuoteAtom=85 -'const'=4 -'var'=5 -'as'=6 -'...'=7 -'switch'=8 -'case'=9 -'default'=10 -'break'=11 -'continue'=12 -'do'=13 -'while'=14 -'if'=15 -'else'=16 -'for'=17 -'enum'=18 -'def'=19 -'return'=20 -'call'=21 -'->'=22 -'class'=23 -'interface'=24 -'true'=25 -'false'=26 -'typeof'=27 -'void'=28 -'null'=29 -'undefined'=30 -','=31 -';'=32 -'?'=33 -':'=34 -'('=35 -')'=36 -'['=37 -']'=38 -'{'=40 -'}'=41 -'+'=42 -'++'=43 -'-'=44 -'--'=45 -'*'=46 -'/'=47 -'%'=48 -'**'=49 -'&&'=50 -'||'=51 -'!'=52 -'='=53 -'+='=54 -'-='=55 -'*='=56 -'/='=57 -'%='=58 -'=='=59 -'!='=60 -'<'=61 -'<='=62 -'>'=63 -'>='=64 -'&'=65 -'|'=66 -'^'=67 -'~'=68 -'<<'=69 -'>>'=70 -'>>>'=71 -'.'=72 diff --git a/kipper/core/src/compiler/program-ctx.ts b/kipper/core/src/compiler/program-ctx.ts index 5f1e18da2..6d615e586 100644 --- a/kipper/core/src/compiler/program-ctx.ts +++ b/kipper/core/src/compiler/program-ctx.ts @@ -15,12 +15,12 @@ import type { } from "./lexer-parser"; import type { BuiltInFunction, BuiltInVariable, InternalFunction } from "./runtime-built-ins"; import type { KipperCompileTarget } from "./target-presets"; -import type { TranslatedCodeLine } from "./const"; +import {kipperBuiltInTypeLiterals, TranslatedCodeLine} from "./const"; import type { KipperWarning } from "../warnings"; -import type { CompilableASTNode, Expression, RootASTNode } from "./ast"; +import {CompilableASTNode, Expression, RootASTNode, TypeDeclaration} from "./ast"; import { KipperFileASTGenerator } from "./ast"; import type { EvaluatedCompileConfig } from "./compile-config"; -import type { InternalReference, Reference } from "./analysis"; +import {BuiltInType, BuiltInTypes, InternalReference, Reference, ScopeTypeDeclaration} from "./analysis"; import { GlobalScope, KipperSemanticChecker, KipperTypeChecker } from "./analysis"; import { KipperError, KipperInternalError, UndefinedSemanticsError } from "../errors"; import type { OptimisationOptions } from "./optimiser"; @@ -471,6 +471,19 @@ export class KipperProgramContext { return listener.rootNode; } + /** + * Sets up the built-ins for this program. This function should be called before the semantic analysis is run. + * + * TODO! For now this only registers the built-in types in the global scope so they can be use, but in the future + * this should also generate the built-in functions and variables. + * @since 0.11.0 + */ + public async setUpBuiltInsInGlobalScope(): Promise { + for (const [_, type] of Object.entries(BuiltInTypes)) { + this._globalScope.addType(type); + } + } + /** * Runs the semantic analysis for this {@link KipperProgramContext program}. This function will log debugging messages * and warnings using the {@link this.logger logger of this instance} and throw errors in case any logical issues are @@ -573,6 +586,8 @@ export class KipperProgramContext { this._abstractSyntaxTree = await this.generateAbstractSyntaxTree(); // Running the semantic analysis for the AST + this.logger.debug("Setting up built-ins in global scope."); + await this.setUpBuiltInsInGlobalScope(); this.logger.info(`Analysing semantics.`); await this.semanticAnalysis(); diff --git a/kipper/core/src/compiler/runtime-built-ins.ts b/kipper/core/src/compiler/runtime-built-ins.ts index bee9dec8f..3667478ff 100644 --- a/kipper/core/src/compiler/runtime-built-ins.ts +++ b/kipper/core/src/compiler/runtime-built-ins.ts @@ -2,7 +2,7 @@ * Built-Ins file, which provides the blueprints for the Kipper built-in functions and variables. * @since 0.1.0 */ -import type { KipperBuiltInType } from "./const"; +import type { KipperBuiltInTypeLiteral } from "./const"; /** * Interface representation of an argument of a {@link BuiltInFunction}. @@ -26,7 +26,7 @@ export interface BuiltInFunctionArgument { * // x is of type 'num' * // y is of type 'str' */ - valueType: KipperBuiltInType; + valueType: KipperBuiltInTypeLiteral; } /** @@ -54,7 +54,7 @@ export interface BuiltInFunction { * The expected return of the function. If the return type is {@link KipperVoidType void}, then the function will not * return anything. */ - returnType: KipperBuiltInType; + returnType: KipperBuiltInTypeLiteral; } /** @@ -80,7 +80,7 @@ export interface InternalFunctionArgument { * // x is of type 'num' * // y is of type 'str' */ - valueType: KipperBuiltInType | Array; + valueType: KipperBuiltInTypeLiteral | Array; } /** @@ -114,7 +114,7 @@ export interface InternalFunction { * union. * @since 0.8.0 */ - returnType: KipperBuiltInType; + returnType: KipperBuiltInTypeLiteral; } /** @@ -132,7 +132,7 @@ export interface BuiltInVariable { * The type of the variable. * @since 0.10.0 */ - valueType: KipperBuiltInType; + valueType: KipperBuiltInTypeLiteral; /** * If true then the variable is local to the current file. If false then the variable is global and can be accessed * from any file. diff --git a/kipper/core/src/errors.ts b/kipper/core/src/errors.ts index 4a5dcb9db..c7db65298 100644 --- a/kipper/core/src/errors.ts +++ b/kipper/core/src/errors.ts @@ -642,6 +642,16 @@ export class UnknownTypeError extends TypeError { } } +/** + * Error that is thrown whenever a type is used that is not a type. + * @since 0.11.0 + */ +export class ReferenceCanNotBeUsedAsTypeError extends TypeError { + constructor(identifier: string) { + super(`Reference '${identifier}' can not be used as a type.`); + } +} + /** * Error that is thrown whenever a relational comparison is used with types that are not comparable. * @since 0.9.0 diff --git a/kipper/target-ts/src/built-in-generator.ts b/kipper/target-ts/src/built-in-generator.ts index 5f611caee..bafdb7be3 100644 --- a/kipper/target-ts/src/built-in-generator.ts +++ b/kipper/target-ts/src/built-in-generator.ts @@ -6,7 +6,7 @@ import type { BuiltInFunction, InternalFunction, TranslatedCodeLine } from "@kipper/core"; import { JavaScriptTargetBuiltInGenerator } from "@kipper/target-js"; import { getTSFunctionSignature, createTSFunctionSignature } from "./tools"; -import type { BuiltInVariable, KipperBuiltInType, KipperProgramContext } from "@kipper/core"; +import type { BuiltInVariable, KipperBuiltInTypeLiteral, KipperProgramContext } from "@kipper/core"; import { TargetTS } from "./target"; /** @@ -19,8 +19,8 @@ import { TargetTS } from "./target"; export function genTSFunction( signature: { identifier: string; - params: Array<{ identifier: string; type: KipperBuiltInType | Array }>; - returnType: KipperBuiltInType | Array; + params: Array<{ identifier: string; type: KipperBuiltInTypeLiteral | Array }>; + returnType: KipperBuiltInTypeLiteral | Array; }, body: string, ignoreParams: boolean = false, diff --git a/kipper/target-ts/src/target.ts b/kipper/target-ts/src/target.ts index 77a1aaafd..3efa77f6a 100644 --- a/kipper/target-ts/src/target.ts +++ b/kipper/target-ts/src/target.ts @@ -2,19 +2,19 @@ * The TypeScript translation target for the Kipper language. * @since 0.10.0 */ -import type { BuiltInFunction, BuiltInVariable, KipperBuiltInType } from "@kipper/core"; +import type { BuiltInFunction, BuiltInVariable, KipperBuiltInTypeLiteral } from "@kipper/core"; import { - kipperBoolType, + kipperBoolTypeLiteral, KipperCompileTarget, - kipperFuncType, - kipperListType, - kipperMetaType, + kipperFuncTypeLiteral, + kipperListTypeLiteral, + kipperMetaTypeLiteral, KipperNotImplementedError, - kipperNullType, - kipperNumType, - kipperStrType, - kipperUndefinedType, - kipperVoidType, + kipperNullTypeLiteral, + kipperNumTypeLiteral, + kipperStrTypeLiteral, + kipperUndefinedTypeLiteral, + kipperVoidTypeLiteral, } from "@kipper/core"; import { TypeScriptTargetSemanticAnalyser } from "./semantic-analyser"; import { TypeScriptTargetCodeGenerator } from "./code-generator"; @@ -59,34 +59,34 @@ export class KipperTypeScriptTarget extends KipperCompileTarget { } /** - * Fetches the typescript equivalent for a {@link KipperBuiltInType}. + * Fetches the typescript equivalent for a {@link KipperBuiltInTypeLiteral}. * @param kipperType The type to get the equivalent for. * @since 0.8.0 */ - public static getTypeScriptType(kipperType: KipperBuiltInType | Array): string { + public static getTypeScriptType(kipperType: KipperBuiltInTypeLiteral | Array): string { if (Array.isArray(kipperType)) { // Recursively call this function for each type in the array return `${kipperType.map(this.getTypeScriptType).join(" | ")}`; } switch (kipperType) { - case kipperBoolType: + case kipperBoolTypeLiteral: return "boolean"; - case kipperFuncType: + case kipperFuncTypeLiteral: return "Function"; - case kipperListType: + case kipperListTypeLiteral: return "Array"; - case kipperMetaType: + case kipperMetaTypeLiteral: return "object"; - case kipperNullType: + case kipperNullTypeLiteral: return "null"; - case kipperNumType: + case kipperNumTypeLiteral: return "number"; - case kipperStrType: + case kipperStrTypeLiteral: return "string"; - case kipperUndefinedType: + case kipperUndefinedTypeLiteral: return "undefined"; - case kipperVoidType: + case kipperVoidTypeLiteral: return "void"; default: throw new KipperNotImplementedError(`TypeScript type for ${kipperType} not implemented.`); diff --git a/kipper/target-ts/src/tools.ts b/kipper/target-ts/src/tools.ts index f420e8a2f..11704bc79 100644 --- a/kipper/target-ts/src/tools.ts +++ b/kipper/target-ts/src/tools.ts @@ -6,7 +6,7 @@ import type { FunctionDeclaration, BuiltInFunction, BuiltInFunctionArgument, - KipperBuiltInType, + KipperBuiltInTypeLiteral, InternalFunction, InternalFunctionArgument, } from "@kipper/core"; @@ -19,8 +19,8 @@ import { TargetTS } from "./target"; */ export function getTSFunctionSignature(funcSpec: InternalFunction | BuiltInFunction | FunctionDeclaration): { identifier: string; - params: Array<{ identifier: string; type: KipperBuiltInType | Array }>; - returnType: KipperBuiltInType | Array; + params: Array<{ identifier: string; type: KipperBuiltInTypeLiteral | Array }>; + returnType: KipperBuiltInTypeLiteral | Array; } { if ("antlrRuleCtx" in funcSpec) { const semanticData = funcSpec.getSemanticData(); @@ -56,8 +56,8 @@ export function getTSFunctionSignature(funcSpec: InternalFunction | BuiltInFunct export function createTSFunctionSignature( signature: { identifier: string; - params: Array<{ identifier: string; type: KipperBuiltInType | Array }>; - returnType: KipperBuiltInType | Array; + params: Array<{ identifier: string; type: KipperBuiltInTypeLiteral | Array }>; + returnType: KipperBuiltInTypeLiteral | Array; }, ignoreParams: boolean = false, ): string { From d8b841eaeeea3b1f485cc6d8a9ac6cf42abe3b82 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Fri, 5 Jul 2024 14:05:32 +0200 Subject: [PATCH 14/57] other: Fixed pnpm-lock.yaml --- kipper/cli/pnpm-lock.yaml | 48 --------------------------------------- 1 file changed, 48 deletions(-) diff --git a/kipper/cli/pnpm-lock.yaml b/kipper/cli/pnpm-lock.yaml index 8d0b3f088..41dbd0207 100644 --- a/kipper/cli/pnpm-lock.yaml +++ b/kipper/cli/pnpm-lock.yaml @@ -169,7 +169,6 @@ packages: /@npmcli/arborist@4.3.1: resolution: {integrity: sha512-yMRgZVDpwWjplorzt9SFSaakWx6QIK248Nw4ZFgkrAy/GvJaFRaSZzE6nD7JBK5r8g/+PTxFq5Wj/sfciE7x+A==} engines: {node: ^12.13.0 || ^14.15.0 || >=16} - hasBin: true dependencies: '@isaacs/string-locale-compare': 1.1.0 '@npmcli/installed-package-contents': 1.0.7 @@ -264,7 +263,6 @@ packages: /@npmcli/installed-package-contents@1.0.7: resolution: {integrity: sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw==} engines: {node: '>= 10'} - hasBin: true dependencies: npm-bundled: 1.1.2 npm-normalize-package-bin: 1.0.1 @@ -273,7 +271,6 @@ packages: /@npmcli/installed-package-contents@2.1.0: resolution: {integrity: sha512-c8UuGLeZpm69BryRykLuKRyKFZYJsZSCT4aVY5ds4omyZqJ172ApzgfKJ5eV/r3HgLdUYgFVe54KSFVjKoe27w==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hasBin: true dependencies: npm-bundled: 3.0.1 npm-normalize-package-bin: 3.0.1 @@ -305,7 +302,6 @@ packages: /@npmcli/move-file@1.1.2: resolution: {integrity: sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==} engines: {node: '>=10'} - deprecated: This functionality has been moved to @npmcli/fs dependencies: mkdirp: 1.0.4 rimraf: 3.0.2 @@ -314,7 +310,6 @@ packages: /@npmcli/move-file@2.0.1: resolution: {integrity: sha512-mJd2Z5TjYWq/ttPLLGqArdtnC74J6bOzg4rMDnN+p1xTacZ2yPRCk2y0oSWQtygLR9YVQXgOcONrwtnk3JupxQ==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - deprecated: This functionality has been moved to @npmcli/fs dependencies: mkdirp: 1.0.4 rimraf: 3.0.2 @@ -692,7 +687,6 @@ packages: /@oclif/screen@3.0.8: resolution: {integrity: sha512-yx6KAqlt3TAHBduS2fMQtJDL2ufIHnDRArrJEOoTTuizxqmjLT+psGYOHpmMl3gvQpFJ11Hs76guUUktzAF9Bg==} engines: {node: '>=12.0.0'} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. dev: true /@octokit/auth-token@2.5.0: @@ -1047,7 +1041,6 @@ packages: /are-we-there-yet@2.0.0: resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} engines: {node: '>=10'} - deprecated: This package is no longer supported. dependencies: delegates: 1.0.0 readable-stream: 3.6.2 @@ -1056,7 +1049,6 @@ packages: /are-we-there-yet@3.0.1: resolution: {integrity: sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - deprecated: This package is no longer supported. dependencies: delegates: 1.0.0 readable-stream: 3.6.2 @@ -1454,7 +1446,6 @@ packages: /color-support@1.1.3: resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true dev: true /colors@1.0.3: @@ -1481,7 +1472,6 @@ packages: /concurrently@7.6.0: resolution: {integrity: sha512-BKtRgvcJGeZ4XttiDiNcFiRlxoAeZOseqUvyYRUp/Vtd+9p1ULmeoSqGsDA+2ivdeDFpqrJvGvmI+StKfKl5hw==} engines: {node: ^12.20.0 || ^14.13.0 || >=16.0.0} - hasBin: true dependencies: chalk: 4.1.2 date-fns: 2.30.0 @@ -1504,7 +1494,6 @@ packages: /copyfiles@2.4.1: resolution: {integrity: sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==} - hasBin: true dependencies: glob: 7.2.3 minimatch: 3.1.2 @@ -1571,7 +1560,6 @@ packages: /debuglog@1.0.1: resolution: {integrity: sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw==} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. dev: true /deep-extend@0.6.0: @@ -1913,7 +1901,6 @@ packages: /gauge@3.0.2: resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} engines: {node: '>=10'} - deprecated: This package is no longer supported. dependencies: aproba: 2.0.0 color-support: 1.1.3 @@ -1929,7 +1916,6 @@ packages: /gauge@4.0.4: resolution: {integrity: sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - deprecated: This package is no longer supported. dependencies: aproba: 2.0.0 color-support: 1.1.3 @@ -2005,7 +1991,6 @@ packages: /glob@10.4.2: resolution: {integrity: sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w==} engines: {node: '>=16 || 14 >=14.18'} - hasBin: true dependencies: foreground-child: 3.2.1 jackspeak: 3.4.0 @@ -2017,7 +2002,6 @@ packages: /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -2030,7 +2014,6 @@ packages: /glob@8.1.0: resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} engines: {node: '>=12'} - deprecated: Glob versions prior to v9 are no longer supported dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -2266,7 +2249,6 @@ packages: /inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. dependencies: once: 1.4.0 wrappy: 1.0.2 @@ -2894,7 +2876,6 @@ packages: /mkdirp@1.0.4: resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} engines: {node: '>=10'} - hasBin: true dev: true /ms@2.1.2: @@ -2940,7 +2921,6 @@ packages: /node-gyp@8.4.1: resolution: {integrity: sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==} engines: {node: '>= 10.12.0'} - hasBin: true dependencies: env-paths: 2.2.1 glob: 7.2.3 @@ -2960,7 +2940,6 @@ packages: /node-gyp@9.4.1: resolution: {integrity: sha512-OQkWKbjQKbGkMf/xqI1jjy3oCTgMKJac58G2+bjZb3fza6gW2YrCSdMQYaoTb70crvE//Gngr4f0AgVHmqHvBQ==} engines: {node: ^12.13 || ^14.13 || >=16} - hasBin: true dependencies: env-paths: 2.2.1 exponential-backoff: 3.1.1 @@ -2988,7 +2967,6 @@ packages: /nopt@5.0.0: resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} engines: {node: '>=6'} - hasBin: true dependencies: abbrev: 1.1.1 dev: true @@ -2996,7 +2974,6 @@ packages: /nopt@6.0.0: resolution: {integrity: sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - hasBin: true dependencies: abbrev: 1.1.1 dev: true @@ -3098,7 +3075,6 @@ packages: /npm-packlist@3.0.0: resolution: {integrity: sha512-L/cbzmutAwII5glUcf2DBRNY/d0TFd4e/FnaZigJV6JD85RHZXJFGwCndjMWiiViiWSsWt3tiOLpI3ByTnIdFQ==} engines: {node: '>=10'} - hasBin: true dependencies: glob: 7.2.3 ignore-walk: 4.0.1 @@ -3178,7 +3154,6 @@ packages: /npmlog@5.0.1: resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. dependencies: are-we-there-yet: 2.0.0 console-control-strings: 1.1.0 @@ -3189,7 +3164,6 @@ packages: /npmlog@6.0.2: resolution: {integrity: sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - deprecated: This package is no longer supported. dependencies: are-we-there-yet: 3.0.1 console-control-strings: 1.1.0 @@ -3214,7 +3188,6 @@ packages: /oclif@2.7.0(@types/node@18.16.16)(typescript@5.1.3): resolution: {integrity: sha512-nmgk/emtEth/0RYTMeovj22zpiT4P7KvIDc3OOT8VeAEDvdbnZfg3tV3YRnHK0zrSKETKqpHWFyNx2PLMl0eKQ==} engines: {node: '>=12.0.0'} - hasBin: true dependencies: '@oclif/core': 1.26.2 '@oclif/plugin-help': 5.2.20(@types/node@18.16.16)(typescript@5.1.3) @@ -3353,7 +3326,6 @@ packages: /pacote@12.0.3: resolution: {integrity: sha512-CdYEl03JDrRO3x18uHjBYA9TyoW8gy+ThVcypcDkxPtKlw76e4ejhYB6i9lJ+/cebbjpqPW/CijjqxwDTts8Ow==} engines: {node: ^12.13.0 || ^14.15.0 || >=16} - hasBin: true dependencies: '@npmcli/git': 2.1.0 '@npmcli/installed-package-contents': 1.0.7 @@ -3382,7 +3354,6 @@ packages: /pacote@15.2.0: resolution: {integrity: sha512-rJVZeIwHTUta23sIZgEIM62WYwbmGbThdbnkt81ravBplQv+HjyroqnLRNH2+sLJHcGZmLRmhPwACqhfTcOmnA==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hasBin: true dependencies: '@npmcli/git': 4.1.0 '@npmcli/installed-package-contents': 2.1.0 @@ -3606,7 +3577,6 @@ packages: /querystring@0.2.0: resolution: {integrity: sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==} engines: {node: '>=0.4.x'} - deprecated: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. dev: true /queue-microtask@1.2.3: @@ -3636,7 +3606,6 @@ packages: /read-package-json@6.0.4: resolution: {integrity: sha512-AEtWXYfopBj2z5N5PbkAOeNHRPUg5q+Nen7QLxV8M2zJq1ym6/lCz3fYNTCXe19puu2d06jfHhrP7v/S2PtMMw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - deprecated: This package is no longer supported. Please use @npmcli/package-json instead. dependencies: glob: 10.4.2 json-parse-even-better-errors: 3.0.2 @@ -3706,7 +3675,6 @@ packages: /readdir-scoped-modules@1.1.0: resolution: {integrity: sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==} - deprecated: This functionality has been moved to @npmcli/fs dependencies: debuglog: 1.0.1 dezalgo: 1.0.4 @@ -3746,7 +3714,6 @@ packages: /resolve@1.22.8: resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} - hasBin: true dependencies: is-core-module: 2.14.0 path-parse: 1.0.7 @@ -3771,16 +3738,12 @@ packages: /rimraf@2.7.1: resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true dependencies: glob: 7.2.3 dev: true /rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true dependencies: glob: 7.2.3 dev: true @@ -3788,7 +3751,6 @@ packages: /rimraf@5.0.7: resolution: {integrity: sha512-nV6YcJo5wbLW77m+8KjH8aB/7/rxQy9SZ0HY5shnwULfS+9nmTtVXAJET5NdZmCzA4fPI/Hm1wo/Po/4mopOdg==} engines: {node: '>=14.18'} - hasBin: true dependencies: glob: 10.4.2 dev: true @@ -3838,7 +3800,6 @@ packages: /semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true dev: true /semver@7.5.1: @@ -3898,7 +3859,6 @@ packages: /shelljs@0.8.5: resolution: {integrity: sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==} engines: {node: '>=4'} - hasBin: true dependencies: glob: 7.2.3 interpret: 1.4.0 @@ -3916,7 +3876,6 @@ packages: /sigstore@1.9.0: resolution: {integrity: sha512-0Zjz0oe37d08VeOtBIuB6cRriqXse2e8w+7yIy2XSXjshRKxbc2KkhXjL229jXSxEm7UbcjS76wcJDGQddVI9A==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hasBin: true dependencies: '@sigstore/bundle': 1.1.0 '@sigstore/protobuf-specs': 0.2.1 @@ -4286,7 +4245,6 @@ packages: /tree-kill@1.2.2: resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} - hasBin: true dev: true /treeverse@1.0.4: @@ -4295,7 +4253,6 @@ packages: /ts-node@10.9.2(@types/node@18.16.16)(typescript@5.1.3): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} - hasBin: true peerDependencies: '@swc/core': '>=1.2.50' '@swc/wasm': '>=1.2.50' @@ -4456,7 +4413,6 @@ packages: /uuid@8.0.0: resolution: {integrity: sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==} - hasBin: true dev: true /v8-compile-cache-lib@3.0.1: @@ -4551,7 +4507,6 @@ packages: /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} - hasBin: true dependencies: isexe: 2.0.0 dev: true @@ -4559,7 +4514,6 @@ packages: /which@3.0.1: resolution: {integrity: sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hasBin: true dependencies: isexe: 2.0.0 dev: true @@ -4710,7 +4664,6 @@ packages: /yeoman-environment@3.19.3: resolution: {integrity: sha512-/+ODrTUHtlDPRH9qIC0JREH8+7nsRcjDl3Bxn2Xo/rvAaVvixH5275jHwg0C85g4QsF4P6M2ojfScPPAl+pLAg==} engines: {node: '>=12.10.0'} - hasBin: true dependencies: '@npmcli/arborist': 4.3.1 are-we-there-yet: 2.0.0 @@ -4798,7 +4751,6 @@ packages: /yosay@2.0.2: resolution: {integrity: sha512-avX6nz2esp7IMXGag4gu6OyQBsMh/SEn+ZybGu3yKPlOTE6z9qJrzG/0X5vCq/e0rPFy0CUYCze0G5hL310ibA==} engines: {node: '>=4'} - hasBin: true dependencies: ansi-regex: 2.1.1 ansi-styles: 3.2.1 From 7a979142d42b23de9b8e62bbbc30014f0c709fb2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 7 Jul 2024 18:55:23 +0000 Subject: [PATCH 15/57] chore(deps): update dependency coverage-badge-creator to v1.0.19 --- package.json | 2 +- pnpm-lock.yaml | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b64e09011..91c41679a 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "antlr4ts": "0.5.0-alpha.4", "browserify": "17.0.0", "chai": "4.3.6", - "coverage-badge-creator": "1.0.17", + "coverage-badge-creator": "1.0.19", "eslint": "8.57.0", "json-parse-even-better-errors": "3.0.0", "minimist": "1.2.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a1e5db952..9320199d8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -59,8 +59,8 @@ devDependencies: specifier: 4.3.6 version: 4.3.6 coverage-badge-creator: - specifier: 1.0.17 - version: 1.0.17 + specifier: 1.0.19 + version: 1.0.19 eslint: specifier: 8.57.0 version: 8.57.0 @@ -1325,8 +1325,9 @@ packages: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} dev: true - /coverage-badge-creator@1.0.17: - resolution: {integrity: sha512-9agGAXGNafW9avCVg5eJF7rzpTRjTbSf3acNxEUQqxUn7WDrnEAlomHyPIosucZuChPxVPgW6Kg3W4nStj/jCg==} + /coverage-badge-creator@1.0.19: + resolution: {integrity: sha512-D49WcKmhusMp0KtdINdiDW4VzTAKWv3IHFr/jLwsKtvnFgXj+uuu6Td+XcrsXVUfThkueU1cZxWluJexcOaiXA==} + hasBin: true dev: true /create-ecdh@4.0.4: @@ -3435,6 +3436,7 @@ packages: /ts-mocha@10.0.0(mocha@10.6.0): resolution: {integrity: sha512-VRfgDO+iiuJFlNB18tzOfypJ21xn2xbuZyDvJvqpTbWgkAgD17ONGr8t+Tl8rcBtOBdjXp5e/Rk+d39f7XBHRw==} engines: {node: '>= 6.X.X'} + hasBin: true peerDependencies: mocha: ^3.X.X || ^4.X.X || ^5.X.X || ^6.X.X || ^7.X.X || ^8.X.X || ^9.X.X || ^10.X.X dependencies: @@ -3446,6 +3448,7 @@ packages: /ts-node@10.9.2(@types/node@18.16.16)(typescript@5.1.3): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true peerDependencies: '@swc/core': '>=1.2.50' '@swc/wasm': '>=1.2.50' @@ -3595,6 +3598,7 @@ packages: /update-browserslist-db@1.0.13(browserslist@4.23.0): resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} + hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: From 4c0b26ef9f8d287a2ef3162523b11fb36e20da4f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 7 Jul 2024 18:55:38 +0000 Subject: [PATCH 16/57] chore(deps): update dependency json-parse-even-better-errors to v3.0.2 --- package.json | 2 +- pnpm-lock.yaml | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b64e09011..87de3be05 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "chai": "4.3.6", "coverage-badge-creator": "1.0.17", "eslint": "8.57.0", - "json-parse-even-better-errors": "3.0.0", + "json-parse-even-better-errors": "3.0.2", "minimist": "1.2.8", "mkdirp": "3.0.1", "mocha": "10.6.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a1e5db952..c25960793 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -65,8 +65,8 @@ devDependencies: specifier: 8.57.0 version: 8.57.0 json-parse-even-better-errors: - specifier: 3.0.0 - version: 3.0.0 + specifier: 3.0.2 + version: 3.0.2 minimist: specifier: 1.2.8 version: 1.2.8 @@ -2356,8 +2356,8 @@ packages: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} dev: true - /json-parse-even-better-errors@3.0.0: - resolution: {integrity: sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==} + /json-parse-even-better-errors@3.0.2: + resolution: {integrity: sha512-fi0NG4bPjCHunUJffmLd0gxssIgkNmArMvis4iNah6Owg1MCJjWhEcDLmsK6iGkJq3tHwbDkTlce70/tmXN4cQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dev: true @@ -3435,6 +3435,7 @@ packages: /ts-mocha@10.0.0(mocha@10.6.0): resolution: {integrity: sha512-VRfgDO+iiuJFlNB18tzOfypJ21xn2xbuZyDvJvqpTbWgkAgD17ONGr8t+Tl8rcBtOBdjXp5e/Rk+d39f7XBHRw==} engines: {node: '>= 6.X.X'} + hasBin: true peerDependencies: mocha: ^3.X.X || ^4.X.X || ^5.X.X || ^6.X.X || ^7.X.X || ^8.X.X || ^9.X.X || ^10.X.X dependencies: @@ -3446,6 +3447,7 @@ packages: /ts-node@10.9.2(@types/node@18.16.16)(typescript@5.1.3): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true peerDependencies: '@swc/core': '>=1.2.50' '@swc/wasm': '>=1.2.50' @@ -3595,6 +3597,7 @@ packages: /update-browserslist-db@1.0.13(browserslist@4.23.0): resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} + hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: From edf4ffb795d737820eeb505cfd83fded88e89e20 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Mon, 8 Jul 2024 15:50:42 +0200 Subject: [PATCH 17/57] other: Updated pnpm-lock.yaml --- kipper/cli/pnpm-lock.yaml | 48 --------------------------------------- 1 file changed, 48 deletions(-) diff --git a/kipper/cli/pnpm-lock.yaml b/kipper/cli/pnpm-lock.yaml index 8d0b3f088..41dbd0207 100644 --- a/kipper/cli/pnpm-lock.yaml +++ b/kipper/cli/pnpm-lock.yaml @@ -169,7 +169,6 @@ packages: /@npmcli/arborist@4.3.1: resolution: {integrity: sha512-yMRgZVDpwWjplorzt9SFSaakWx6QIK248Nw4ZFgkrAy/GvJaFRaSZzE6nD7JBK5r8g/+PTxFq5Wj/sfciE7x+A==} engines: {node: ^12.13.0 || ^14.15.0 || >=16} - hasBin: true dependencies: '@isaacs/string-locale-compare': 1.1.0 '@npmcli/installed-package-contents': 1.0.7 @@ -264,7 +263,6 @@ packages: /@npmcli/installed-package-contents@1.0.7: resolution: {integrity: sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw==} engines: {node: '>= 10'} - hasBin: true dependencies: npm-bundled: 1.1.2 npm-normalize-package-bin: 1.0.1 @@ -273,7 +271,6 @@ packages: /@npmcli/installed-package-contents@2.1.0: resolution: {integrity: sha512-c8UuGLeZpm69BryRykLuKRyKFZYJsZSCT4aVY5ds4omyZqJ172ApzgfKJ5eV/r3HgLdUYgFVe54KSFVjKoe27w==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hasBin: true dependencies: npm-bundled: 3.0.1 npm-normalize-package-bin: 3.0.1 @@ -305,7 +302,6 @@ packages: /@npmcli/move-file@1.1.2: resolution: {integrity: sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==} engines: {node: '>=10'} - deprecated: This functionality has been moved to @npmcli/fs dependencies: mkdirp: 1.0.4 rimraf: 3.0.2 @@ -314,7 +310,6 @@ packages: /@npmcli/move-file@2.0.1: resolution: {integrity: sha512-mJd2Z5TjYWq/ttPLLGqArdtnC74J6bOzg4rMDnN+p1xTacZ2yPRCk2y0oSWQtygLR9YVQXgOcONrwtnk3JupxQ==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - deprecated: This functionality has been moved to @npmcli/fs dependencies: mkdirp: 1.0.4 rimraf: 3.0.2 @@ -692,7 +687,6 @@ packages: /@oclif/screen@3.0.8: resolution: {integrity: sha512-yx6KAqlt3TAHBduS2fMQtJDL2ufIHnDRArrJEOoTTuizxqmjLT+psGYOHpmMl3gvQpFJ11Hs76guUUktzAF9Bg==} engines: {node: '>=12.0.0'} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. dev: true /@octokit/auth-token@2.5.0: @@ -1047,7 +1041,6 @@ packages: /are-we-there-yet@2.0.0: resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} engines: {node: '>=10'} - deprecated: This package is no longer supported. dependencies: delegates: 1.0.0 readable-stream: 3.6.2 @@ -1056,7 +1049,6 @@ packages: /are-we-there-yet@3.0.1: resolution: {integrity: sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - deprecated: This package is no longer supported. dependencies: delegates: 1.0.0 readable-stream: 3.6.2 @@ -1454,7 +1446,6 @@ packages: /color-support@1.1.3: resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true dev: true /colors@1.0.3: @@ -1481,7 +1472,6 @@ packages: /concurrently@7.6.0: resolution: {integrity: sha512-BKtRgvcJGeZ4XttiDiNcFiRlxoAeZOseqUvyYRUp/Vtd+9p1ULmeoSqGsDA+2ivdeDFpqrJvGvmI+StKfKl5hw==} engines: {node: ^12.20.0 || ^14.13.0 || >=16.0.0} - hasBin: true dependencies: chalk: 4.1.2 date-fns: 2.30.0 @@ -1504,7 +1494,6 @@ packages: /copyfiles@2.4.1: resolution: {integrity: sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==} - hasBin: true dependencies: glob: 7.2.3 minimatch: 3.1.2 @@ -1571,7 +1560,6 @@ packages: /debuglog@1.0.1: resolution: {integrity: sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw==} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. dev: true /deep-extend@0.6.0: @@ -1913,7 +1901,6 @@ packages: /gauge@3.0.2: resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} engines: {node: '>=10'} - deprecated: This package is no longer supported. dependencies: aproba: 2.0.0 color-support: 1.1.3 @@ -1929,7 +1916,6 @@ packages: /gauge@4.0.4: resolution: {integrity: sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - deprecated: This package is no longer supported. dependencies: aproba: 2.0.0 color-support: 1.1.3 @@ -2005,7 +1991,6 @@ packages: /glob@10.4.2: resolution: {integrity: sha512-GwMlUF6PkPo3Gk21UxkCohOv0PLcIXVtKyLlpEI28R/cO/4eNOdmLk3CMW1wROV/WR/EsZOWAfBbBOqYvs88/w==} engines: {node: '>=16 || 14 >=14.18'} - hasBin: true dependencies: foreground-child: 3.2.1 jackspeak: 3.4.0 @@ -2017,7 +2002,6 @@ packages: /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -2030,7 +2014,6 @@ packages: /glob@8.1.0: resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} engines: {node: '>=12'} - deprecated: Glob versions prior to v9 are no longer supported dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -2266,7 +2249,6 @@ packages: /inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. dependencies: once: 1.4.0 wrappy: 1.0.2 @@ -2894,7 +2876,6 @@ packages: /mkdirp@1.0.4: resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} engines: {node: '>=10'} - hasBin: true dev: true /ms@2.1.2: @@ -2940,7 +2921,6 @@ packages: /node-gyp@8.4.1: resolution: {integrity: sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==} engines: {node: '>= 10.12.0'} - hasBin: true dependencies: env-paths: 2.2.1 glob: 7.2.3 @@ -2960,7 +2940,6 @@ packages: /node-gyp@9.4.1: resolution: {integrity: sha512-OQkWKbjQKbGkMf/xqI1jjy3oCTgMKJac58G2+bjZb3fza6gW2YrCSdMQYaoTb70crvE//Gngr4f0AgVHmqHvBQ==} engines: {node: ^12.13 || ^14.13 || >=16} - hasBin: true dependencies: env-paths: 2.2.1 exponential-backoff: 3.1.1 @@ -2988,7 +2967,6 @@ packages: /nopt@5.0.0: resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} engines: {node: '>=6'} - hasBin: true dependencies: abbrev: 1.1.1 dev: true @@ -2996,7 +2974,6 @@ packages: /nopt@6.0.0: resolution: {integrity: sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - hasBin: true dependencies: abbrev: 1.1.1 dev: true @@ -3098,7 +3075,6 @@ packages: /npm-packlist@3.0.0: resolution: {integrity: sha512-L/cbzmutAwII5glUcf2DBRNY/d0TFd4e/FnaZigJV6JD85RHZXJFGwCndjMWiiViiWSsWt3tiOLpI3ByTnIdFQ==} engines: {node: '>=10'} - hasBin: true dependencies: glob: 7.2.3 ignore-walk: 4.0.1 @@ -3178,7 +3154,6 @@ packages: /npmlog@5.0.1: resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. dependencies: are-we-there-yet: 2.0.0 console-control-strings: 1.1.0 @@ -3189,7 +3164,6 @@ packages: /npmlog@6.0.2: resolution: {integrity: sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - deprecated: This package is no longer supported. dependencies: are-we-there-yet: 3.0.1 console-control-strings: 1.1.0 @@ -3214,7 +3188,6 @@ packages: /oclif@2.7.0(@types/node@18.16.16)(typescript@5.1.3): resolution: {integrity: sha512-nmgk/emtEth/0RYTMeovj22zpiT4P7KvIDc3OOT8VeAEDvdbnZfg3tV3YRnHK0zrSKETKqpHWFyNx2PLMl0eKQ==} engines: {node: '>=12.0.0'} - hasBin: true dependencies: '@oclif/core': 1.26.2 '@oclif/plugin-help': 5.2.20(@types/node@18.16.16)(typescript@5.1.3) @@ -3353,7 +3326,6 @@ packages: /pacote@12.0.3: resolution: {integrity: sha512-CdYEl03JDrRO3x18uHjBYA9TyoW8gy+ThVcypcDkxPtKlw76e4ejhYB6i9lJ+/cebbjpqPW/CijjqxwDTts8Ow==} engines: {node: ^12.13.0 || ^14.15.0 || >=16} - hasBin: true dependencies: '@npmcli/git': 2.1.0 '@npmcli/installed-package-contents': 1.0.7 @@ -3382,7 +3354,6 @@ packages: /pacote@15.2.0: resolution: {integrity: sha512-rJVZeIwHTUta23sIZgEIM62WYwbmGbThdbnkt81ravBplQv+HjyroqnLRNH2+sLJHcGZmLRmhPwACqhfTcOmnA==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hasBin: true dependencies: '@npmcli/git': 4.1.0 '@npmcli/installed-package-contents': 2.1.0 @@ -3606,7 +3577,6 @@ packages: /querystring@0.2.0: resolution: {integrity: sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==} engines: {node: '>=0.4.x'} - deprecated: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. dev: true /queue-microtask@1.2.3: @@ -3636,7 +3606,6 @@ packages: /read-package-json@6.0.4: resolution: {integrity: sha512-AEtWXYfopBj2z5N5PbkAOeNHRPUg5q+Nen7QLxV8M2zJq1ym6/lCz3fYNTCXe19puu2d06jfHhrP7v/S2PtMMw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - deprecated: This package is no longer supported. Please use @npmcli/package-json instead. dependencies: glob: 10.4.2 json-parse-even-better-errors: 3.0.2 @@ -3706,7 +3675,6 @@ packages: /readdir-scoped-modules@1.1.0: resolution: {integrity: sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==} - deprecated: This functionality has been moved to @npmcli/fs dependencies: debuglog: 1.0.1 dezalgo: 1.0.4 @@ -3746,7 +3714,6 @@ packages: /resolve@1.22.8: resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} - hasBin: true dependencies: is-core-module: 2.14.0 path-parse: 1.0.7 @@ -3771,16 +3738,12 @@ packages: /rimraf@2.7.1: resolution: {integrity: sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true dependencies: glob: 7.2.3 dev: true /rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true dependencies: glob: 7.2.3 dev: true @@ -3788,7 +3751,6 @@ packages: /rimraf@5.0.7: resolution: {integrity: sha512-nV6YcJo5wbLW77m+8KjH8aB/7/rxQy9SZ0HY5shnwULfS+9nmTtVXAJET5NdZmCzA4fPI/Hm1wo/Po/4mopOdg==} engines: {node: '>=14.18'} - hasBin: true dependencies: glob: 10.4.2 dev: true @@ -3838,7 +3800,6 @@ packages: /semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} - hasBin: true dev: true /semver@7.5.1: @@ -3898,7 +3859,6 @@ packages: /shelljs@0.8.5: resolution: {integrity: sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==} engines: {node: '>=4'} - hasBin: true dependencies: glob: 7.2.3 interpret: 1.4.0 @@ -3916,7 +3876,6 @@ packages: /sigstore@1.9.0: resolution: {integrity: sha512-0Zjz0oe37d08VeOtBIuB6cRriqXse2e8w+7yIy2XSXjshRKxbc2KkhXjL229jXSxEm7UbcjS76wcJDGQddVI9A==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hasBin: true dependencies: '@sigstore/bundle': 1.1.0 '@sigstore/protobuf-specs': 0.2.1 @@ -4286,7 +4245,6 @@ packages: /tree-kill@1.2.2: resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} - hasBin: true dev: true /treeverse@1.0.4: @@ -4295,7 +4253,6 @@ packages: /ts-node@10.9.2(@types/node@18.16.16)(typescript@5.1.3): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} - hasBin: true peerDependencies: '@swc/core': '>=1.2.50' '@swc/wasm': '>=1.2.50' @@ -4456,7 +4413,6 @@ packages: /uuid@8.0.0: resolution: {integrity: sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==} - hasBin: true dev: true /v8-compile-cache-lib@3.0.1: @@ -4551,7 +4507,6 @@ packages: /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} - hasBin: true dependencies: isexe: 2.0.0 dev: true @@ -4559,7 +4514,6 @@ packages: /which@3.0.1: resolution: {integrity: sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hasBin: true dependencies: isexe: 2.0.0 dev: true @@ -4710,7 +4664,6 @@ packages: /yeoman-environment@3.19.3: resolution: {integrity: sha512-/+ODrTUHtlDPRH9qIC0JREH8+7nsRcjDl3Bxn2Xo/rvAaVvixH5275jHwg0C85g4QsF4P6M2ojfScPPAl+pLAg==} engines: {node: '>=12.10.0'} - hasBin: true dependencies: '@npmcli/arborist': 4.3.1 are-we-there-yet: 2.0.0 @@ -4798,7 +4751,6 @@ packages: /yosay@2.0.2: resolution: {integrity: sha512-avX6nz2esp7IMXGag4gu6OyQBsMh/SEn+ZybGu3yKPlOTE6z9qJrzG/0X5vCq/e0rPFy0CUYCze0G5hL310ibA==} engines: {node: '>=4'} - hasBin: true dependencies: ansi-regex: 2.1.1 ansi-styles: 3.2.1 From cda23f377fb5fbd5cb21ec22377ba722c840c0ba Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Mon, 8 Jul 2024 18:21:24 +0200 Subject: [PATCH 18/57] major (#524): Introduced universe scope and restructured built-ins and internals Still heavily WIP! --- .../src/compiler/ast/analysable-ast-node.ts | 2 +- .../src/compiler/ast/compilable-ast-node.ts | 19 +- .../ast/nodes/declarations/declaration.ts | 2 +- .../function-declaration-semantics.ts | 2 +- .../function-declaration-type-semantics.ts | 2 +- .../function-declaration.ts | 4 +- .../parameter-declaration-semantics.ts | 2 +- .../parameter-declaration-type-semantics.ts | 2 +- .../parameter-declaration.ts | 2 +- .../class-declaration/class-declaration.ts | 8 +- .../interface-declaration.ts | 6 +- .../type-declaration-semantics.ts | 2 +- .../type-declaration-type-semantics.ts | 2 +- .../type-declaration/type-declaration.ts | 2 +- .../variable-declaration-semantics.ts | 2 +- .../variable-declaration-type-semantics.ts | 2 +- .../variable-declaration.ts | 2 +- .../multiplicative-expression.ts | 2 +- .../assignment-expression-semantics.ts | 2 +- .../assignment-expression.ts | 2 +- .../bitwise-and-expression.ts | 2 +- .../bitwise-or-expression.ts | 2 +- .../bitwise-shift-expression.ts | 2 +- .../bitwise-xor-expression.ts | 2 +- .../cast-or-convert-expression-semantics.ts | 2 +- ...st-or-convert-expression-type-semantics.ts | 2 +- .../cast-or-convert-expression.ts | 4 +- .../equality-expression.ts | 2 +- .../relational-expression.ts | 2 +- .../expressions/expression-type-semantics.ts | 2 +- .../function-call-expression-semantics.ts | 2 +- .../function-call-expression.ts | 2 +- .../logical-and-expression.ts | 2 +- .../logical-or-expression.ts | 2 +- .../member-access-expression.ts | 2 +- ...crement-or-decrement-postfix-expression.ts | 2 +- .../array-primary-expression.ts | 2 +- .../bool-primary-expression.ts | 2 +- .../fstring-primary-expression.ts | 2 +- ...identifier-primary-expression-semantics.ts | 2 +- ...ifier-primary-expression-type-semantics.ts | 2 +- .../identifier-primary-expression.ts | 9 +- .../number-primary-expression.ts | 2 +- .../string-primary-expression.ts | 2 +- ...or-null-or-undefined-primary-expression.ts | 2 +- ...ier-type-specifier-expression-semantics.ts | 2 +- .../identifier-type-specifier-expression.ts | 2 +- ...ype-specifier-expression-type-semantics.ts | 2 +- ...increment-or-decrement-unary-expression.ts | 2 +- .../operator-modified-unary-expression.ts | 2 +- .../src/compiler/ast/nodes/root-ast-node.ts | 35 +- .../compound-statement/compound-statement.ts | 2 +- .../for-loop-iteration-statement.ts | 2 +- .../return-statement-type-semantics.ts | 2 +- .../return-statement/return-statement.ts | 2 +- kipper/core/src/compiler/ast/scope-node.ts | 20 +- kipper/core/src/compiler/compile-config.ts | 24 +- kipper/core/src/compiler/compiler.ts | 4 +- kipper/core/src/compiler/const.ts | 6 +- kipper/core/src/compiler/index.ts | 4 +- .../core/src/compiler/optimiser/optimiser.ts | 2 +- kipper/core/src/compiler/program-ctx.ts | 147 ++++---- kipper/core/src/compiler/runtime-built-ins.ts | 313 ------------------ .../analyser/err-handler/index.ts | 0 .../err-handler/semantics-asserter.ts | 0 .../err-handler/semantics-error-handler.ts | 0 .../{analysis => semantics}/analyser/index.ts | 0 .../analyser/semantic-checker.ts | 24 +- .../analyser/type-checker.ts | 61 ++-- .../analyser/warning-issuer.ts | 0 .../{analysis => semantics}/handle-error.ts | 0 .../compiler/{analysis => semantics}/index.ts | 2 + .../{analysis => semantics}/reference.ts | 2 +- .../built-in-function-argument.ts | 38 +++ .../runtime-built-ins/built-in-function.ts | 43 +++ .../runtime-built-ins/built-in-variable.ts | 43 +++ .../semantics/runtime-built-ins/index.ts | 7 + .../semantics/runtime-internals/index.ts | 7 + .../internal-function-argument.ts | 35 ++ .../runtime-internals/internal-function.ts | 46 +++ .../semantics/runtime-internals/internals.ts | 127 +++++++ .../semantics/symbol-table/base/index.ts | 6 + .../symbol-table/base}/scope.ts | 17 +- .../symbol-table/base}/symbol-table.ts | 2 +- .../symbol-table/class-scope.ts | 0 .../symbol-table/entry/index.ts | 0 .../symbol-table/entry/scope-declaration.ts | 0 .../entry/scope-function-declaration.ts | 53 ++- .../entry/scope-parameter-declaration.ts | 14 +- .../entry/scope-type-declaration.ts | 3 +- .../entry/scope-variable-declaration.ts | 58 +++- .../symbol-table/function-scope.ts | 2 +- .../symbol-table/global-scope.ts | 26 +- .../symbol-table/index.ts | 4 +- .../symbol-table/local-scope.ts | 8 +- .../semantics/symbol-table/universum-scope.ts | 144 ++++++++ .../types/base/compilable-type.ts | 0 .../types/base/index.ts | 0 .../types/base/processed-type.ts | 9 - .../types/base/type.ts | 0 .../types/built-in-type.ts | 15 - .../types/custom-type.ts | 0 .../{analysis => semantics}/types/index.ts | 0 .../{analysis => semantics}/types/raw-type.ts | 0 .../types/undefined-type.ts | 0 .../target-presets/semantic-analyser.ts | 2 +- .../translation/built-ins-generator.ts | 2 +- test/module/core/ast-node.test.ts | 26 +- test/module/core/compiler.test.ts | 32 +- test/module/core/errors/index.ts | 2 +- test/module/core/global-scope.test.ts | 14 +- 111 files changed, 896 insertions(+), 679 deletions(-) delete mode 100644 kipper/core/src/compiler/runtime-built-ins.ts rename kipper/core/src/compiler/{analysis => semantics}/analyser/err-handler/index.ts (100%) rename kipper/core/src/compiler/{analysis => semantics}/analyser/err-handler/semantics-asserter.ts (100%) rename kipper/core/src/compiler/{analysis => semantics}/analyser/err-handler/semantics-error-handler.ts (100%) rename kipper/core/src/compiler/{analysis => semantics}/analyser/index.ts (100%) rename kipper/core/src/compiler/{analysis => semantics}/analyser/semantic-checker.ts (89%) rename kipper/core/src/compiler/{analysis => semantics}/analyser/type-checker.ts (93%) rename kipper/core/src/compiler/{analysis => semantics}/analyser/warning-issuer.ts (100%) rename kipper/core/src/compiler/{analysis => semantics}/handle-error.ts (100%) rename kipper/core/src/compiler/{analysis => semantics}/index.ts (79%) rename kipper/core/src/compiler/{analysis => semantics}/reference.ts (95%) create mode 100644 kipper/core/src/compiler/semantics/runtime-built-ins/built-in-function-argument.ts create mode 100644 kipper/core/src/compiler/semantics/runtime-built-ins/built-in-function.ts create mode 100644 kipper/core/src/compiler/semantics/runtime-built-ins/built-in-variable.ts create mode 100644 kipper/core/src/compiler/semantics/runtime-built-ins/index.ts create mode 100644 kipper/core/src/compiler/semantics/runtime-internals/index.ts create mode 100644 kipper/core/src/compiler/semantics/runtime-internals/internal-function-argument.ts create mode 100644 kipper/core/src/compiler/semantics/runtime-internals/internal-function.ts create mode 100644 kipper/core/src/compiler/semantics/runtime-internals/internals.ts create mode 100644 kipper/core/src/compiler/semantics/symbol-table/base/index.ts rename kipper/core/src/compiler/{analysis/symbol-table => semantics/symbol-table/base}/scope.ts (86%) rename kipper/core/src/compiler/{analysis/symbol-table => semantics/symbol-table/base}/symbol-table.ts (87%) rename kipper/core/src/compiler/{analysis => semantics}/symbol-table/class-scope.ts (100%) rename kipper/core/src/compiler/{analysis => semantics}/symbol-table/entry/index.ts (100%) rename kipper/core/src/compiler/{analysis => semantics}/symbol-table/entry/scope-declaration.ts (100%) rename kipper/core/src/compiler/{analysis => semantics}/symbol-table/entry/scope-function-declaration.ts (54%) rename kipper/core/src/compiler/{analysis => semantics}/symbol-table/entry/scope-parameter-declaration.ts (86%) rename kipper/core/src/compiler/{analysis => semantics}/symbol-table/entry/scope-type-declaration.ts (96%) rename kipper/core/src/compiler/{analysis => semantics}/symbol-table/entry/scope-variable-declaration.ts (53%) rename kipper/core/src/compiler/{analysis => semantics}/symbol-table/function-scope.ts (96%) rename kipper/core/src/compiler/{analysis => semantics}/symbol-table/global-scope.ts (64%) rename kipper/core/src/compiler/{analysis => semantics}/symbol-table/index.ts (80%) rename kipper/core/src/compiler/{analysis => semantics}/symbol-table/local-scope.ts (87%) create mode 100644 kipper/core/src/compiler/semantics/symbol-table/universum-scope.ts rename kipper/core/src/compiler/{analysis => semantics}/types/base/compilable-type.ts (100%) rename kipper/core/src/compiler/{analysis => semantics}/types/base/index.ts (100%) rename kipper/core/src/compiler/{analysis => semantics}/types/base/processed-type.ts (87%) rename kipper/core/src/compiler/{analysis => semantics}/types/base/type.ts (100%) rename kipper/core/src/compiler/{analysis => semantics}/types/built-in-type.ts (70%) rename kipper/core/src/compiler/{analysis => semantics}/types/custom-type.ts (100%) rename kipper/core/src/compiler/{analysis => semantics}/types/index.ts (100%) rename kipper/core/src/compiler/{analysis => semantics}/types/raw-type.ts (100%) rename kipper/core/src/compiler/{analysis => semantics}/types/undefined-type.ts (100%) diff --git a/kipper/core/src/compiler/ast/analysable-ast-node.ts b/kipper/core/src/compiler/ast/analysable-ast-node.ts index b71a175ed..1c4bee21f 100644 --- a/kipper/core/src/compiler/ast/analysable-ast-node.ts +++ b/kipper/core/src/compiler/ast/analysable-ast-node.ts @@ -14,7 +14,7 @@ import { MissingRequiredSemanticDataError } from "../../errors"; import type { KipperProgramContext } from "../program-ctx"; import type { RootASTNode } from "./nodes/root-ast-node"; import type { EvaluatedCompileConfig } from "../compile-config"; -import { handleSemanticError } from "../analysis"; +import { handleSemanticError } from "../semantics"; /** * An eligible parent for an analysable AST node. diff --git a/kipper/core/src/compiler/ast/compilable-ast-node.ts b/kipper/core/src/compiler/ast/compilable-ast-node.ts index ecdace7c8..c32d5bf83 100644 --- a/kipper/core/src/compiler/ast/compilable-ast-node.ts +++ b/kipper/core/src/compiler/ast/compilable-ast-node.ts @@ -14,7 +14,7 @@ import type { TypeData } from "./ast-node"; import type { KipperProgramContext } from "../program-ctx"; import type { TokenStream } from "antlr4ts/TokenStream"; import type { RootASTNode, SemanticData } from "./index"; -import type { FunctionScope, GlobalScope, LocalScope } from "../analysis"; +import type { FunctionScope, GlobalScope, LocalScope } from "../semantics"; import type { ScopeNode } from "./scope-node"; import type { TargetCompilableNode } from "./target-node"; import { AnalysableASTNode } from "./analysable-ast-node"; @@ -42,7 +42,6 @@ export abstract class CompilableASTNode< extends AnalysableASTNode implements TargetCompilableNode { - protected _scopeCtx: ScopeNode | KipperProgramContext | undefined; protected override _parent: CompilableNodeParent; protected override _children: Array; @@ -117,22 +116,14 @@ export abstract class CompilableASTNode< * @since 0.8.0 */ public get scope(): LocalScope | GlobalScope { - if ("innerScope" in this.scopeCtx) { - return (>this.scopeCtx).innerScope; - } else { - return (this.scopeCtx).globalScope; - } + return this.scopeCtx.innerScope; } /** * The context / AST node of the {@link scope}. * @since 0.8.0 */ - public get scopeCtx(): ScopeNode | KipperProgramContext { - if (this._scopeCtx) { - return this._scopeCtx; - } - + public get scopeCtx(): ScopeNode { let parent: CompilableNodeParent = this.parent; while (parent.parent !== undefined && !("innerScope" in parent)) { parent = parent.parent; @@ -140,9 +131,9 @@ export abstract class CompilableASTNode< // If there is no parent -> root node, return the program context if (parent.parent === undefined) { - return (parent).programCtx; + return parent; } - return >parent; + return >parent; } /** diff --git a/kipper/core/src/compiler/ast/nodes/declarations/declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/declaration.ts index 45afea8bd..eb597a82e 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/declaration.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/declaration.ts @@ -14,7 +14,7 @@ import type { DeclarationTypeSemantics } from "./declaration-type-semantics"; import type { TranslatedCodeLine } from "../../../const"; import type { ASTDeclarationKind, ASTDeclarationRuleName, ParserDeclarationContext } from "../../common"; import type { TargetASTNodeCodeGenerator, TargetASTNodeSemanticAnalyser } from "../../../target-presets"; -import type { ScopeDeclaration } from "../../../analysis"; +import type { ScopeDeclaration } from "../../../semantics"; import { CompilableASTNode, type CompilableNodeParent } from "../../compilable-ast-node"; import { MissingRequiredSemanticDataError, UndefinedDeclarationCtxError } from "../../../../errors"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration-semantics.ts index d377f5031..9c49bc525 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration-semantics.ts @@ -2,7 +2,7 @@ * Semantics for AST Node {@link FunctionDeclaration}. * @since 0.3.0 */ -import type { RawType } from "../../../../analysis"; +import type { RawType } from "../../../../semantics"; import type { CompoundStatement, IdentifierTypeSpecifierExpression, ParameterDeclaration } from "../../../nodes"; import type { DeclarationSemantics } from "../declaration-semantics"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration-type-semantics.ts index d1521f055..3d7a6df54 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/function-declaration/function-declaration-type-semantics.ts @@ -2,7 +2,7 @@ * Type semantics for AST Node {@link FunctionDeclaration}. * @since 0.10.0 */ -import type { ProcessedType } from "../../../../analysis"; +import type { ProcessedType } from "../../../../semantics"; import type { DeclarationTypeSemantics } from "../declaration-type-semantics"; /** 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 34973e61f..2f7222a15 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 @@ -9,8 +9,8 @@ import type { FunctionDeclarationTypeSemantics } from "./function-declaration-ty import type { CompilableNodeParent } from "../../../compilable-ast-node"; import type { CompoundStatement, Statement } from "../../statements"; import type { IdentifierTypeSpecifierExpression } from "../../expressions"; -import type { RawType, ScopeFunctionDeclaration } from "../../../../analysis"; -import { FunctionScope } from "../../../../analysis"; +import type { RawType, ScopeFunctionDeclaration } from "../../../../semantics"; +import { FunctionScope } from "../../../../semantics"; import type { FunctionDeclarationContext } from "../../../../lexer-parser"; import { CompoundStatementContext, diff --git a/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-semantics.ts index 6c0b56c65..23a8d5bc7 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-semantics.ts @@ -2,7 +2,7 @@ * Semantics for AST Node {@link FunctionDeclaration}. * @since 0.3.0 */ -import type { RawType } from "../../../../analysis"; +import type { RawType } from "../../../../semantics"; import type { FunctionDeclaration, IdentifierTypeSpecifierExpression } from "../../../nodes"; import type { DeclarationSemantics } from "../declaration-semantics"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-type-semantics.ts index d36ad00e9..b4fc213d4 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-type-semantics.ts @@ -2,7 +2,7 @@ * Type semantics for AST Node {@link FunctionDeclaration}. * @since 0.10.0 */ -import type { ProcessedType } from "../../../../analysis"; +import type { ProcessedType } from "../../../../semantics"; import type { DeclarationTypeSemantics } from "../declaration-type-semantics"; /** 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 be494d3ed..0f39604b8 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 @@ -5,7 +5,7 @@ import type { ParameterDeclarationSemantics } from "./parameter-declaration-semantics"; import type { ParameterDeclarationTypeSemantics } from "./parameter-declaration-type-semantics"; import type { CompilableNodeParent } from "../../../compilable-ast-node"; -import type { FunctionScope, ScopeParameterDeclaration } from "../../../../analysis"; +import type { FunctionScope, ScopeParameterDeclaration } from "../../../../semantics"; import type { FunctionDeclaration } from "../function-declaration"; import type { IdentifierTypeSpecifierExpression } from "../../expressions"; import { Declaration } from "../declaration"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/class-declaration/class-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/class-declaration/class-declaration.ts index 6f15b9ed6..ce2558844 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/class-declaration/class-declaration.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/class-declaration/class-declaration.ts @@ -6,11 +6,11 @@ import type { ScopeNode } from "../../../../scope-node"; import type { ClassDeclarationSemantics } from "./class-declaration-semantics"; import type { ClassDeclarationTypeSemantics } from "./class-declaration-type-semantics"; import type { CompilableNodeParent } from "../../../../compilable-ast-node"; -import type { ScopeTypeDeclaration } from "../../../../../analysis"; -import type { ClassDeclarationContext } from "../../../../../parser"; -import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parser"; +import type { ScopeTypeDeclaration } from "../../../../../semantics"; +import type { ClassDeclarationContext } from "../../../../../lexer-parser"; +import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; import { KipperNotImplementedError } from "../../../../../../errors"; -import { ClassScope } from "../../../../../analysis/symbol-table/class-scope"; +import { ClassScope } from "../../../../../semantics/symbol-table/class-scope"; import { TypeDeclaration } from "../type-declaration"; /** 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 22c1b5ad7..caa0bb029 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 @@ -5,9 +5,9 @@ import type { InterfaceDeclarationSemantics } from "./interface-declaration-semantics"; import type { InterfaceDeclarationTypeSemantics } from "./interface-declaration-type-semantics"; import type { CompilableNodeParent } from "../../../../compilable-ast-node"; -import type { ScopeTypeDeclaration } from "../../../../../analysis"; -import type { InterfaceDeclarationContext } from "../../../../../parser"; -import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parser"; +import type { ScopeTypeDeclaration } from "../../../../../semantics"; +import type { InterfaceDeclarationContext } from "../../../../../lexer-parser"; +import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; import { KipperNotImplementedError } from "../../../../../../errors"; import { TypeDeclaration } from "../type-declaration"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts index b1bdf5ae3..7476f7f5f 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts @@ -1,5 +1,5 @@ import type { SemanticData } from "../../../ast-node"; -import {ProcessedType} from "../../../../analysis"; +import {ProcessedType} from "../../../../semantics"; /** * Semantics for a {@link TypeDeclaration}. 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 8c8db7b13..7c8f0b689 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,5 @@ import type { TypeData } from "../../../ast-node"; -import {CustomType} from "../../../../analysis"; +import {CustomType} from "../../../../semantics"; /** * Type semantics for a {@link TypeDeclaration}. 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 63863fe46..b0428f336 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 @@ -1,4 +1,4 @@ -import type { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../parser"; +import type { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../lexer-parser"; import type { ASTNodeMapper } from "../../../mapping"; import type { TypeDeclarationSemantics } from "./type-declaration-semantics"; import type { TypeDeclarationTypeSemantics } from "./type-declaration-type-semantics"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-semantics.ts index a5fac9081..ea38cad91 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-semantics.ts @@ -3,7 +3,7 @@ * @since 0.3.0 */ import type { KipperStorageType } from "../../../../const"; -import type { RawType, Scope } from "../../../../analysis"; +import type { RawType, Scope } from "../../../../semantics"; import type { Expression, IdentifierTypeSpecifierExpression } from "../../../nodes"; import type { DeclarationSemantics } from "../declaration-semantics"; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-type-semantics.ts index b81568297..dc8f80d12 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/variable-declaration/variable-declaration-type-semantics.ts @@ -2,7 +2,7 @@ * Type semantics for AST Node {@link FunctionDeclaration}. * @since 0.10.0 */ -import type { ProcessedType } from "../../../../analysis"; +import type { ProcessedType } from "../../../../semantics"; import type { DeclarationTypeSemantics } from "../declaration-type-semantics"; /** 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 564777794..29610210a 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 @@ -8,7 +8,7 @@ import type { VariableDeclarationSemantics } from "./variable-declaration-semantics"; import type { VariableDeclarationTypeSemantics } from "./variable-declaration-type-semantics"; import type { CompilableNodeParent } from "../../../compilable-ast-node"; -import type { RawType, ScopeVariableDeclaration } from "../../../../analysis"; +import type { RawType, ScopeVariableDeclaration } from "../../../../semantics"; import type { Expression, IdentifierTypeSpecifierExpression } from "../../expressions"; import type { ParseTree } from "antlr4ts/tree"; import type { KipperStorageType } from "../../../../const"; diff --git a/kipper/core/src/compiler/ast/nodes/expressions/arithmetic/multiplicative-expression/multiplicative-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/arithmetic/multiplicative-expression/multiplicative-expression.ts index e027b3e64..7dcc7bff2 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/arithmetic/multiplicative-expression/multiplicative-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/arithmetic/multiplicative-expression/multiplicative-expression.ts @@ -20,7 +20,7 @@ import { kipperMultiplicativeOperators } from "../../../../../const"; import { TerminalNode } from "antlr4ts/tree/TerminalNode"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; import { ArithmeticExpression } from "../arithmetic-expression"; -import { kipperInternalBuiltInFunctions } from "../../../../../runtime-built-ins"; +import { kipperInternalBuiltInFunctions } from "../../../../../semantics/runtime-built-ins"; /** * Multiplicative expression, which can be used to perform multiplicative operations on two expressions. diff --git a/kipper/core/src/compiler/ast/nodes/expressions/assignment-expression/assignment-expression-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/assignment-expression/assignment-expression-semantics.ts index eec8fbd28..ed7099329 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/assignment-expression/assignment-expression-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/assignment-expression/assignment-expression-semantics.ts @@ -2,7 +2,7 @@ * Semantics for AST Node {@link AssignmentExpression}. * @since 0.5.0 */ -import type { Reference } from "../../../../analysis"; +import type { Reference } from "../../../../semantics"; import type { KipperAssignOperator } from "../../../../const"; import type { Expression } from "../expression"; import type { ExpressionSemantics } from "../expression-semantics"; diff --git a/kipper/core/src/compiler/ast/nodes/expressions/assignment-expression/assignment-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/assignment-expression/assignment-expression.ts index b21108e4b..defa3c80f 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/assignment-expression/assignment-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/assignment-expression/assignment-expression.ts @@ -23,7 +23,7 @@ import { UnableToDetermineSemanticDataError } from "../../../../../errors"; import type { KipperAssignOperator } from "../../../../const"; import { kipperArithmeticAssignOperators } from "../../../../const"; import { getParseRuleSource } from "../../../../../tools"; -import { ScopeVariableDeclaration } from "../../../../analysis"; +import { ScopeVariableDeclaration } from "../../../../semantics"; /** * Assignment expression, which assigns an expression to a variable. This class only represents assigning a value to diff --git a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-and-expression/bitwise-and-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-and-expression/bitwise-and-expression.ts index c97d962f0..018e20443 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-and-expression/bitwise-and-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-and-expression/bitwise-and-expression.ts @@ -16,7 +16,7 @@ import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { Expression } from "../../expression"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { ProcessedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../semantics"; /** * Bitwise and expression AST node. diff --git a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-or-expression/bitwise-or-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-or-expression/bitwise-or-expression.ts index 4b643c7f4..b8d43fc78 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-or-expression/bitwise-or-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-or-expression/bitwise-or-expression.ts @@ -15,7 +15,7 @@ import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { Expression } from "../../expression"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { ProcessedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../semantics"; import type { BitwiseOrExpressionSemantics } from "./bitwise-or-expression-semantics"; import type { BitwiseOrExpressionTypeSemantics } from "./bitwise-or-expression-type-semantics"; diff --git a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-shift-expression/bitwise-shift-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-shift-expression/bitwise-shift-expression.ts index 1e766a20a..1a1ec6491 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-shift-expression/bitwise-shift-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-shift-expression/bitwise-shift-expression.ts @@ -16,7 +16,7 @@ import { BitwiseShiftOperatorsContext, KindParseRuleMapping, ParseRuleKindMappin import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { Expression } from "../../expression"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { ProcessedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../semantics"; import type { BitwiseShiftExpressionSemantics } from "./bitwise-shift-expression-semantics"; import type { BitwiseShiftExpressionTypeSemantics } from "./bitwise-shift-expression-type-semantics"; import type { KipperBitwiseShiftOperator } from "../../../../../const"; diff --git a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-xor-expression/bitwise-xor-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-xor-expression/bitwise-xor-expression.ts index 14346c0ef..355c3c25c 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-xor-expression/bitwise-xor-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-xor-expression/bitwise-xor-expression.ts @@ -13,7 +13,7 @@ import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { Expression } from "../../expression"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { ProcessedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../semantics"; import type { BitwiseXorExpressionSemantics } from "./bitwise-xor-expression-semantics"; import type { BitwiseXorExpressionTypeSemantics } from "./bitwise-xor-expression-type-semantics"; diff --git a/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression-semantics.ts index 92353ddf9..a394b47b6 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression-semantics.ts @@ -4,7 +4,7 @@ */ import type { ExpressionSemantics } from "../expression-semantics"; import type { Expression } from "../expression"; -import type { RawType } from "../../../../analysis"; +import type { RawType } from "../../../../semantics"; import type { IdentifierTypeSpecifierExpression } from "../type-specifier-expression"; /** diff --git a/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression-type-semantics.ts index 7d9502141..a5a65f8fd 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression-type-semantics.ts @@ -2,7 +2,7 @@ * Type semantics for AST Node {@link CastOrConvertExpression}. * @since 0.10.0 */ -import type { ProcessedType } from "../../../../analysis"; +import type { ProcessedType } from "../../../../semantics"; import type { ExpressionTypeSemantics } from "../expression-type-semantics"; /** diff --git a/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression.ts index 42bac0d10..97719010c 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression.ts @@ -14,10 +14,10 @@ import type { IdentifierTypeSpecifierExpression } from "../type-specifier-expres import { Expression } from "../expression"; import type { CastOrConvertExpressionContext } from "../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../lexer-parser"; -import type { RawType } from "../../../../analysis"; +import type { RawType } from "../../../../semantics"; import { UnableToDetermineSemanticDataError } from "../../../../../errors"; import { getConversionFunctionIdentifier } from "../../../../../tools"; -import { kipperInternalBuiltInFunctions } from "../../../../runtime-built-ins"; +import { kipperInternalBuiltInFunctions } from "../../../../semantics/runtime-built-ins"; /** * Convert expressions, which are used to convert a value to a different type. diff --git a/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/equality-expression/equality-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/equality-expression/equality-expression.ts index 542adec04..2ec40debf 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/equality-expression/equality-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/equality-expression/equality-expression.ts @@ -11,7 +11,7 @@ import type { EqualityExpressionSemantics } from "./equality-expression-semantic import type { EqualityExpressionTypeSemantics } from "./equality-expression-type-semantics"; import type { Expression } from "../../expression"; import { ComparativeExpression } from "../comparative-expression"; -import { ProcessedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../semantics"; import type { EqualityExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; diff --git a/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/relational-expression/relational-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/relational-expression/relational-expression.ts index 999855691..8a7118b67 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/relational-expression/relational-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/relational-expression/relational-expression.ts @@ -24,7 +24,7 @@ import type { KipperRelationalOperator } from "../../../../../const"; import { kipperRelationalOperators } from "../../../../../const"; import { TerminalNode } from "antlr4ts/tree/TerminalNode"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { ProcessedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../semantics"; /** * Relational expression, which can be used to compare two numeric expressions. diff --git a/kipper/core/src/compiler/ast/nodes/expressions/expression-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/expression-type-semantics.ts index 0ef1b7829..01a6fc932 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/expression-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/expression-type-semantics.ts @@ -2,7 +2,7 @@ * Type semantics for an expression class that must be evaluated during Type Checking. * @since 0.10.0 */ -import type { ProcessedType } from "../../../analysis"; +import type { ProcessedType } from "../../../semantics"; import type { TypeData } from "../../ast-node"; /** diff --git a/kipper/core/src/compiler/ast/nodes/expressions/function-call-expression/function-call-expression-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/function-call-expression/function-call-expression-semantics.ts index 498b27686..2b7009268 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/function-call-expression/function-call-expression-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/function-call-expression/function-call-expression-semantics.ts @@ -2,7 +2,7 @@ * Semantics for AST Node {@link FunctionCallExpression}. * @since 0.5.0 */ -import type { Reference } from "../../../../analysis"; +import type { Reference } from "../../../../semantics"; import type { KipperReferenceable } from "../../../../const"; import type { Expression } from "../expression"; import type { ExpressionSemantics } from "../expression-semantics"; 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 5f75bb366..910009298 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 @@ -15,7 +15,7 @@ import { Expression } from "../expression"; import type { FunctionCallExpressionContext } from "../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../lexer-parser"; import { UnableToDetermineSemanticDataError } from "../../../../../errors"; -import { ProcessedType } from "../../../../analysis"; +import { ProcessedType } from "../../../../semantics"; /** * Function call class, which represents a function call expression in the Kipper language. 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 5870d68d2..003d59212 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 @@ -16,7 +16,7 @@ import type { LogicalAndExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; import type { CompilableASTNode } from "../../../../compilable-ast-node"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { ProcessedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../semantics"; /** * Logical-and expression, representing an expression which can be used to combine multiple conditions. It will 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 662233998..3ebb2ff7a 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 @@ -17,7 +17,7 @@ import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer import type { CompilableASTNode } from "../../../../compilable-ast-node"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; import { kipperLogicalOrOperator } from "../../../../../const"; -import { ProcessedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../semantics"; /** * Logical-or expression, representing an expression which can be used to combine multiple conditions. It returns true 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 525aca377..f6dbc33e7 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 @@ -15,7 +15,7 @@ import { import type { CompilableASTNode } from "../../../compilable-ast-node"; import { Expression } from "../expression"; import { KipperNotImplementedError, UnableToDetermineSemanticDataError } from "../../../../../errors"; -import { kipperInternalBuiltInFunctions } from "../../../../runtime-built-ins"; +import { kipperInternalBuiltInFunctions } from "../../../../semantics/runtime-built-ins"; /** * A union of all possible {@link KipperParserRuleContext} rule contexts that {@link MemberAccessExpression} implements. 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 a19537bfe..493f9d2ee 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 @@ -14,7 +14,7 @@ import type { IncrementOrDecrementPostfixExpressionContext } from "../../../../. import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; import type { CompilableASTNode } from "../../../../compilable-ast-node"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { ProcessedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../semantics"; /** * Increment or Decrement expression, which represents a right-side -- or ++ expression modifying a numeric value. 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 c12c7b0a8..1fd4214b9 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 @@ -7,7 +7,7 @@ import type { ArrayPrimaryExpressionTypeSemantics } from "./array-primary-expres import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { ArrayPrimaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import { ProcessedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../semantics"; import { PrimaryExpression } from "../primary-expression"; /** 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 3221a752a..151a1c2d1 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 @@ -8,7 +8,7 @@ import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { KipperBoolTypeConstants } from "../../../../../const"; import type { BoolPrimaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import { ProcessedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../semantics"; import { PrimaryExpression } from "../primary-expression"; /** 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 ac729075e..552df5d99 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 @@ -14,7 +14,7 @@ import { ParseRuleKindMapping, } from "../../../../../lexer-parser"; import type { CompilableASTNode } from "../../../../compilable-ast-node"; -import { ProcessedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../semantics"; import { getParseRuleSource } from "../../../../../../tools"; /** diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/identifier-primary-expression/identifier-primary-expression-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/identifier-primary-expression/identifier-primary-expression-semantics.ts index 3d739a4c5..fda8c6b85 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/identifier-primary-expression/identifier-primary-expression-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/identifier-primary-expression/identifier-primary-expression-semantics.ts @@ -2,7 +2,7 @@ * Semantics for AST Node {@link IdentifierPrimaryExpression}. * @since 0.5.0 */ -import type { Reference } from "../../../../../analysis"; +import type { Reference } from "../../../../../semantics"; import type { PrimaryExpressionSemantics } from "../primary-expression-semantics"; /** diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/identifier-primary-expression/identifier-primary-expression-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/identifier-primary-expression/identifier-primary-expression-type-semantics.ts index c38dd1016..b0291921c 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/identifier-primary-expression/identifier-primary-expression-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/identifier-primary-expression/identifier-primary-expression-type-semantics.ts @@ -2,7 +2,7 @@ * Type semantics for AST Node {@link IdentifierPrimaryExpression}. * @since 0.10.0 */ -import type { ProcessedType } from "../../../../../analysis"; +import type { ProcessedType } from "../../../../../semantics"; import type { PrimaryExpressionTypeSemantics } from "../primary-expression-type-semantics"; /** 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 1fdce910b..a077f595d 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 @@ -9,7 +9,7 @@ import type { IdentifierPrimaryExpressionTypeSemantics } from "./identifier-prim import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { IdentifierPrimaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import { ProcessedType, ScopeDeclaration } from "../../../../../analysis"; +import {BuiltInTypes, ProcessedType, ScopeDeclaration} from "../../../../../semantics"; import { AssignmentExpression } from "../../assignment-expression/assignment-expression"; import { PrimaryExpression } from "../primary-expression"; @@ -84,7 +84,10 @@ export class IdentifierPrimaryExpression extends PrimaryExpression< // Make sure the referenced variable even exists! const ref = this.programCtx .semanticCheck(this) - .getExistingReference(identifier, "innerScope" in this.scopeCtx ? this.scopeCtx : undefined); + .getExistingReference( + identifier, + this.scope + ); // Once we have the identifier and ensured a reference exists, we are done with the primary semantic analysis. this.semanticData = { @@ -124,7 +127,7 @@ export class IdentifierPrimaryExpression extends PrimaryExpression< type = refTarget.type; } else { // Built-in function -> type is 'func' - type = ProcessedType.fromCompilableType("valueType" in refTarget ? refTarget.valueType : "func"); + type = "valueType" in refTarget ? refTarget.valueType : BuiltInTypes.func; } this.typeSemantics = { 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 837983a5c..4c5673d17 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 @@ -7,7 +7,7 @@ import type { NumberPrimaryExpressionTypeSemantics } from "./number-primary-expr import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { NumberPrimaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import { ProcessedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../semantics"; import { PrimaryExpression } from "../primary-expression"; /** diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/string-primary-expression/string-primary-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/string-primary-expression/string-primary-expression.ts index 56291591f..d4bb814b1 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/string-primary-expression/string-primary-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/string-primary-expression/string-primary-expression.ts @@ -7,7 +7,7 @@ import type { StringPrimaryExpressionTypeSemantics } from "./string-primary-expr import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { StringPrimaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import { ProcessedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../semantics"; import { PrimaryExpression } from "../primary-expression"; /** 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 192b70d02..824d1c482 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 @@ -8,7 +8,7 @@ import type { VoidOrNullOrUndefinedPrimaryExpressionSemantics } from "./void-or- import type { VoidOrNullOrUndefinedPrimaryExpressionTypeSemantics } from "./void-or-null-or-undefined-primary-expression-type-semantics"; import type { VoidOrNullOrUndefinedPrimaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import { ProcessedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../semantics"; import { PrimaryExpression } from "../primary-expression"; /** diff --git a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/identifier-type-specifier-expression/identifier-type-specifier-expression-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/identifier-type-specifier-expression/identifier-type-specifier-expression-semantics.ts index 078725f10..68b74b568 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/identifier-type-specifier-expression/identifier-type-specifier-expression-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/identifier-type-specifier-expression/identifier-type-specifier-expression-semantics.ts @@ -2,7 +2,7 @@ * Semantics for AST Node {@link IdentifierTypeSpecifierExpression}. * @since 0.8.0 */ -import type { RawType } from "../../../../../analysis"; +import type { RawType } from "../../../../../semantics"; import type { TypeSpecifierExpressionSemantics } from "../type-specifier-expression-semantics"; /** 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 baa8e6d04..02e44e2d3 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 @@ -13,7 +13,7 @@ import type { CompilableASTNode } from "../../../../compilable-ast-node"; import { TypeSpecifierExpression } from "../type-specifier-expression"; import type { IdentifierTypeSpecifierExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import { ProcessedType, RawType } from "../../../../../analysis"; +import { ProcessedType, RawType } from "../../../../../semantics"; /** * Type specifier expression, which represents a simple identifier type specifier. diff --git a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/type-specifier-expression-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/type-specifier-expression-type-semantics.ts index ee0b1f1fa..92536702f 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/type-specifier-expression-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/type-specifier-expression-type-semantics.ts @@ -2,7 +2,7 @@ * Type semantics for AST Node {@link TypeSpecifierExpression}. * @since 0.10.0 */ -import type { ProcessedType } from "../../../../analysis"; +import type { ProcessedType } from "../../../../semantics"; import type { ExpressionTypeSemantics } from "../expression-type-semantics"; /** 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 366192f3a..a4f862f9b 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 @@ -14,7 +14,7 @@ import { UnaryExpression } from "../unary-expression"; import type { IncrementOrDecrementUnaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { ProcessedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../semantics"; /** * Increment or decrement expression class, which represents a left-side -- or ++ expression modifying a numeric value. 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 103ebcbd7..c99254ffd 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 @@ -16,7 +16,7 @@ import { UnaryExpression } from "../unary-expression"; import type { OperatorModifiedUnaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping, UnaryOperatorContext } from "../../../../../lexer-parser"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { ProcessedType } from "../../../../../analysis"; +import { ProcessedType } from "../../../../../semantics"; /** * Operator modified expressions, which are used to modify the value of an expression based on an diff --git a/kipper/core/src/compiler/ast/nodes/root-ast-node.ts b/kipper/core/src/compiler/ast/nodes/root-ast-node.ts index 31eac1bce..07a9333f4 100644 --- a/kipper/core/src/compiler/ast/nodes/root-ast-node.ts +++ b/kipper/core/src/compiler/ast/nodes/root-ast-node.ts @@ -8,28 +8,34 @@ import type { KipperCompileTarget, KipperTargetCodeGenerator, KipperTargetSemanticAnalyser, + TargetASTNodeCodeGenerator, + TargetASTNodeSemanticAnalyser, TargetSetUpCodeGenerator, TargetWrapUpCodeGenerator, } from "../../target-presets"; -import type { EvaluatedCompileConfig } from "../../compile-config"; -import type { KipperProgramContext } from "../../program-ctx"; -import type { Declaration } from "./declarations"; -import type { Statement } from "./index"; -import type { TranslatedCodeLine } from "../../const"; -import type { KipperError } from "../../../errors"; -import type { CompilationUnitContext } from "../../lexer-parser"; -import { KindParseRuleMapping, ParseRuleKindMapping } from "../../lexer-parser"; -import { handleSemanticError } from "../../analysis"; +import type {EvaluatedCompileConfig} from "../../compile-config"; +import type {KipperProgramContext} from "../../program-ctx"; +import type {Declaration} from "./declarations"; +import type {Statement} from "./index"; +import type {TranslatedCodeLine} from "../../const"; +import type {KipperError} from "../../../errors"; +import type {CompilationUnitContext} from "../../lexer-parser"; +import {KindParseRuleMapping, ParseRuleKindMapping} from "../../lexer-parser"; +import {FunctionScope, GlobalScope, handleSemanticError} from "../../semantics"; +import {ScopeNode} from "../scope-node"; /** * The root node of an abstract syntax tree, which contains all AST nodes of a file. * @since 0.8.0 */ -export class RootASTNode extends ParserASTNode { +export class RootASTNode + extends ParserASTNode + implements ScopeNode { protected readonly _antlrRuleCtx: CompilationUnitContext; protected readonly _programCtx: KipperProgramContext; protected readonly _parent: undefined; protected readonly _children: Array; + protected readonly _innerScope: GlobalScope; /** * The static kind for this AST Node. @@ -73,6 +79,15 @@ export class RootASTNode extends ParserASTNode { this._programCtx = programCtx; this._children = []; this._parent = undefined; + this._innerScope = new GlobalScope(this); + } + + /** + * Gets the inner scope of this function, where also the {@link semanticData.params arguments} should be registered. + * @since 0.10.0 + */ + public get innerScope(): GlobalScope { + return this._innerScope; } /** 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 d8536f2b4..9c8f1f305 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 @@ -7,7 +7,7 @@ import type { CompilableNodeParent } from "../../../compilable-ast-node"; import type { CompoundStatementSemantics } from "./compound-statement-semantics"; import type { CompoundStatementTypeSemantics } from "./compound-statement-type-semantics"; import { Statement } from "../statement"; -import { LocalScope } from "../../../../analysis"; +import { LocalScope } from "../../../../semantics"; import type { CompoundStatementContext } from "../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../lexer-parser"; 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 bc096eac1..70e2a6ded 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 @@ -12,7 +12,7 @@ import { IterationStatement } from "../iteration-statement"; import type { ForLoopIterationStatementContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; import type { Expression } from "../../../expressions"; -import { LocalScope } from "../../../../../analysis"; +import { LocalScope } from "../../../../../semantics"; /** * For loop statement class, which represents a for loop statement in the Kipper language and is compilable diff --git a/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement-type-semantics.ts index 26a1508cf..7adaf481c 100644 --- a/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement-type-semantics.ts @@ -2,7 +2,7 @@ * Type semantics for a {@link ReturnStatement}. * @since 0.10.0 */ -import type { ProcessedType } from "../../../../analysis"; +import type { ProcessedType } from "../../../../semantics"; import type { StatementTypeSemantics } from "../statement-type-semantics"; /** diff --git a/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement.ts b/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement.ts index 54f1a9894..bbffe7331 100644 --- a/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement.ts +++ b/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement.ts @@ -7,7 +7,7 @@ import type { ReturnStatementSemantics } from "./return-statement-semantics"; import type { ReturnStatementTypeSemantics } from "./return-statement-type-semantics"; import type { Expression } from "../../expressions"; import { Statement } from "../statement"; -import { ProcessedType } from "../../../../analysis"; +import { ProcessedType } from "../../../../semantics"; import type { ReturnStatementContext } from "../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../lexer-parser"; diff --git a/kipper/core/src/compiler/ast/scope-node.ts b/kipper/core/src/compiler/ast/scope-node.ts index 466cc1ad7..2854db95b 100644 --- a/kipper/core/src/compiler/ast/scope-node.ts +++ b/kipper/core/src/compiler/ast/scope-node.ts @@ -4,19 +4,20 @@ * This means that the node will have the field {@link innerScope} set to the scope that is created for it. * @since 0.10.0 */ -import type { Scope } from "../analysis"; +import type { Scope } from "../semantics"; import type { CompilableASTNode } from "./compilable-ast-node"; import type { TargetASTNodeCodeGenerator, TargetASTNodeSemanticAnalyser } from "../target-presets"; import type { TranslatedCodeLine } from "../const"; +import {ParserASTNode, SemanticData, TypeData} from "./ast-node"; /** - * Scope-node interface, which represents an {@link CompilableASTNode} that supports being used as the parent of a + * Scope-node interface, which represents an {@link ParserASTNode} that supports being used as the parent of a * {@link Scope} (for example, this is used for compound statements and functions). * * This means that the node will have the field {@link innerScope} set to the scope that is created for it. * @since 0.10.0 */ -export interface ScopeNode extends CompilableASTNode { +export interface ScopeNode extends ParserASTNode { /** * The inner scope that is created for this node. * @@ -24,17 +25,4 @@ export interface ScopeNode extends CompilableASTNode { * @since 0.10.0 */ innerScope: T; - /** - * Semantic analyser function that is specific for the {@link KipperCompileTarget target}. - * - * This only should perform logical analysis and not interpret the code/modify - * the {@link semanticData} field. - * @since 0.10.0 - */ - readonly targetSemanticAnalysis: TargetASTNodeSemanticAnalyser | undefined; - /** - * Code generator function that is specific for the {@link KipperCompileTarget target}. - * @since 0.10.0 - */ - readonly targetCodeGenerator: TargetASTNodeCodeGenerator>; } diff --git a/kipper/core/src/compiler/compile-config.ts b/kipper/core/src/compiler/compile-config.ts index 7c35e0436..6cea3dafe 100644 --- a/kipper/core/src/compiler/compile-config.ts +++ b/kipper/core/src/compiler/compile-config.ts @@ -2,8 +2,7 @@ * Configuration for a Kipper program that can be passed to {@link KipperCompiler.compile}. * @since 0.10.0 */ -import type { BuiltInFunction, BuiltInVariable } from "./runtime-built-ins"; -import { kipperRuntimeBuiltInFunctions, kipperRuntimeBuiltInVariables } from "./runtime-built-ins"; +import type { BuiltInFunction, BuiltInVariable } from "./semantics/runtime-built-ins"; import type { KipperCompileTarget } from "./target-presets"; import type { OptimisationOptions } from "./optimiser"; import { defaultOptimisationOptions } from "./optimiser"; @@ -118,8 +117,6 @@ export class EvaluatedCompileConfig implements CompileConfig { * @since 0.2.0 */ public static readonly defaults = { - builtInFunctions: Object.values(kipperRuntimeBuiltInFunctions), // Default built-in global functions - builtInVariables: Object.values(kipperRuntimeBuiltInVariables), // Default built-in global variables extendBuiltInFunctions: >[], // Use no custom built-in functions per default extendBuiltInVariables: >[], // Use no custom built-in variables per default fileName: "anonymous-script", // Default name if no name is specified @@ -135,23 +132,6 @@ export class EvaluatedCompileConfig implements CompileConfig { */ public readonly target: KipperCompileTarget; - /** - * The built-in functions that will be available in a Kipper program. - * - * This will be extended by {@link extendBuiltInFunctions}. All built-in functions defined here must be implemented by - * the {@link target.builtInGenerator}. - */ - public readonly builtInFunctions: Array; - - /** - * The built-in variables that will be available in a Kipper program. This option overwrites the default built-ins, - * if you wish to only add new built-in variables write to {@link extendBuiltInVariables}. - * - * All built-in variables defined here must be implemented by the {@link target.builtInGenerator}. - * @since 0.10.0 - */ - public readonly builtInVariables: Array; - /** * Extensions to the global built-in functions that should not replace the primary {@link builtInFunctions}. * @@ -226,8 +206,6 @@ export class EvaluatedCompileConfig implements CompileConfig { // Evaluate all config options this.target = rawConfig.target; - this.builtInFunctions = this.getConfigOption("builtInFunctions", rawConfig); - this.builtInVariables = this.getConfigOption("builtInVariables", rawConfig); this.extendBuiltInFunctions = this.getConfigOption("extendBuiltInFunctions", rawConfig); this.extendBuiltInVariables = this.getConfigOption("extendBuiltInVariables", rawConfig); this.fileName = this.getConfigOption("fileName", rawConfig); diff --git a/kipper/core/src/compiler/compiler.ts b/kipper/core/src/compiler/compiler.ts index 56dd428c2..fc688a3db 100644 --- a/kipper/core/src/compiler/compiler.ts +++ b/kipper/core/src/compiler/compiler.ts @@ -2,8 +2,8 @@ * Main Compiler file for interacting with the entire Kipper Compiler * @since 0.0.1 */ -import type { InternalFunction } from "./runtime-built-ins"; -import { kipperInternalBuiltInFunctions } from "./runtime-built-ins"; +import type { InternalFunction } from "./semantics/runtime-built-ins"; +import { kipperInternalBuiltInFunctions } from "./semantics/runtime-built-ins"; import type { CodePointCharStream, Token } from "antlr4ts"; import { CommonTokenStream } from "antlr4ts"; import { KipperAntlrErrorListener } from "../antlr-error-listener"; diff --git a/kipper/core/src/compiler/const.ts b/kipper/core/src/compiler/const.ts index dde41b748..4e1665594 100644 --- a/kipper/core/src/compiler/const.ts +++ b/kipper/core/src/compiler/const.ts @@ -8,8 +8,8 @@ import type { ScopeParameterDeclaration, ScopeVariableDeclaration, UndefinedType, -} from "./analysis"; -import type { BuiltInFunction, BuiltInVariable, InternalFunction } from "./runtime-built-ins"; +} from "./semantics"; +import type { BuiltInFunction, BuiltInVariable, InternalFunction } from "./semantics/"; /** * If this variable is true, then this environment is assumed to be inside a browser and special browser support should @@ -223,7 +223,7 @@ export const kipperSupportedConversions: Array<[KipperBuiltInTypeLiteral, Kipper /** * All available storage types inside Kipper, which define how a variable is stored/can be accessed. */ -export type KipperStorageType = "var" | "const"; +export type KipperStorageType = "var" | "const" | "built-in"; /** * All available storage types inside Kipper, which define how a variable is stored/can be accessed. diff --git a/kipper/core/src/compiler/index.ts b/kipper/core/src/compiler/index.ts index 1ce75dda9..8d5333946 100644 --- a/kipper/core/src/compiler/index.ts +++ b/kipper/core/src/compiler/index.ts @@ -5,11 +5,11 @@ export * from "./const"; export * from "./lexer-parser/"; export * from "./ast/"; -export * from "./analysis/"; +export * from "./semantics/"; export * from "./target-presets/"; export * from "./optimiser/"; export * from "./compile-config"; export * from "./compile-result"; export * from "./compiler"; export * from "./program-ctx"; -export * from "./runtime-built-ins"; +export * from "./semantics/runtime-built-ins"; diff --git a/kipper/core/src/compiler/optimiser/optimiser.ts b/kipper/core/src/compiler/optimiser/optimiser.ts index 244a11f9e..0d3958187 100644 --- a/kipper/core/src/compiler/optimiser/optimiser.ts +++ b/kipper/core/src/compiler/optimiser/optimiser.ts @@ -4,7 +4,7 @@ */ import type { RootASTNode } from "../ast"; import type { KipperProgramContext } from "../program-ctx"; -import type { BuiltInFunction, BuiltInVariable, InternalFunction } from "../runtime-built-ins"; +import type { BuiltInFunction, BuiltInVariable, InternalFunction } from "../semantics/"; /** * The options available for an optimisation run in {@link KipperOptimiser.optimise}. diff --git a/kipper/core/src/compiler/program-ctx.ts b/kipper/core/src/compiler/program-ctx.ts index 6d615e586..1f2f1e524 100644 --- a/kipper/core/src/compiler/program-ctx.ts +++ b/kipper/core/src/compiler/program-ctx.ts @@ -5,30 +5,39 @@ * target language. * @since 0.0.3 */ -import type { ANTLRErrorListener, Token, TokenStream } from "antlr4ts"; +import type {ANTLRErrorListener, Token, TokenStream} from "antlr4ts"; import type { CompilationUnitContext, + KipperFileStream, KipperLexer, KipperParser, LexerParserData, - KipperFileStream, } from "./lexer-parser"; -import type { BuiltInFunction, BuiltInVariable, InternalFunction } from "./runtime-built-ins"; -import type { KipperCompileTarget } from "./target-presets"; -import {kipperBuiltInTypeLiterals, TranslatedCodeLine} from "./const"; -import type { KipperWarning } from "../warnings"; -import {CompilableASTNode, Expression, RootASTNode, TypeDeclaration} from "./ast"; -import { KipperFileASTGenerator } from "./ast"; -import type { EvaluatedCompileConfig } from "./compile-config"; -import {BuiltInType, BuiltInTypes, InternalReference, Reference, ScopeTypeDeclaration} from "./analysis"; -import { GlobalScope, KipperSemanticChecker, KipperTypeChecker } from "./analysis"; -import { KipperError, KipperInternalError, UndefinedSemanticsError } from "../errors"; -import type { OptimisationOptions } from "./optimiser"; -import { KipperOptimiser } from "./optimiser"; -import type { KipperLogger } from "../logger"; -import { LogLevel } from "../logger"; -import { KipperWarningIssuer } from "./analysis/analyser/warning-issuer"; -import { ParseTreeWalker } from "antlr4ts/tree"; +import type {KipperCompileTarget} from "./target-presets"; +import {TranslatedCodeLine} from "./const"; +import type {KipperWarning} from "../warnings"; +import {CompilableASTNode, Expression, KipperFileASTGenerator, RootASTNode} from "./ast"; +import type {EvaluatedCompileConfig} from "./compile-config"; +import { + BuiltInFunction, + BuiltInFunctions, + BuiltInTypes, + BuiltInVariable, + BuiltInVariables, + InternalFunction, + InternalReference, + KipperSemanticChecker, + KipperTypeChecker, + Reference, + UniverseScope +} from "./semantics"; +import {KipperError, KipperInternalError, UndefinedSemanticsError} from "../errors"; +import type {OptimisationOptions} from "./optimiser"; +import {KipperOptimiser} from "./optimiser"; +import type {KipperLogger} from "../logger"; +import {LogLevel} from "../logger"; +import {KipperWarningIssuer} from "./semantics/analyser/warning-issuer"; +import {ParseTreeWalker} from "antlr4ts/tree"; /** * The program context class used to represent a program for a compilation. @@ -60,7 +69,7 @@ export class KipperProgramContext { */ private readonly _channels: LexerParserData["channels"]; - private _abstractSyntaxTree: RootASTNode | undefined; + private _rootASTNode: RootASTNode | undefined; /** * The field compiledCode that will store the cached code, once 'compileProgram' has been called. This is @@ -69,12 +78,6 @@ export class KipperProgramContext { */ private _compiledCode: Array | undefined; - /** - * The global scope of this program, containing all variable and function declarations - * @private - */ - private readonly _globalScope: GlobalScope; - /** * Represents the compilation translation target for the program. This contains the: * - {@link KipperTargetSemanticAnalyser}, which performs semantic analysis specific for the target. @@ -164,6 +167,12 @@ export class KipperProgramContext { */ public readonly builtInVariables: Array; + /** + * The universe scope, which contains all built-in types and functions. + * @since 0.11.0 + */ + private readonly _universeScope: UniverseScope; + constructor( lexerParserData: LexerParserData, logger: KipperLogger, @@ -190,27 +199,14 @@ export class KipperProgramContext { this._stream = lexerParserData.fileStream; this._channels = lexerParserData.channels; this._antlrParseTree = lexerParserData.parseTree; - this._globalScope = new GlobalScope(this); - this._abstractSyntaxTree = undefined; + this._universeScope = new UniverseScope(this); + this._rootASTNode = undefined; this._builtInFunctionReferences = []; this._builtInVariableReferences = []; this._internalReferences = []; this._warnings = []; this._errors = []; - - // Register all built-in functions - const globalFunctions = [...compileConfig.builtInFunctions, ...compileConfig.extendBuiltInFunctions]; - this.registerBuiltInFunctions(globalFunctions); - this.logger.debug( - `Registered ${globalFunctions.length} global function${globalFunctions.length === 1 ? "" : "s"}.`, - ); - - // Register all built-in variables - const globalVariables = [...compileConfig.builtInVariables, ...compileConfig.extendBuiltInVariables]; - this.registerBuiltInVariables(globalVariables); - this.logger.debug( - `Registered ${globalVariables.length} global variable${globalVariables.length === 1 ? "" : "s"}.`, - ); + this._initUniversalReferencables(compileConfig); } // @ts-ignore @@ -302,8 +298,8 @@ export class KipperProgramContext { * The global scope of this file, which contains all {@link ScopeDeclaration} instances that are accessible in the * entire program. */ - public get globalScope(): GlobalScope { - return this._globalScope; + public get universeScope(): UniverseScope { + return this._universeScope; } /** @@ -357,8 +353,8 @@ export class KipperProgramContext { * * If the function {@link compileProgram} has not been called yet, this item will be {@link undefined}. */ - public get abstractSyntaxTree(): RootASTNode | undefined { - return this._abstractSyntaxTree; + public get rootASTNode(): RootASTNode | undefined { + return this._rootASTNode; } /** @@ -463,7 +459,7 @@ export class KipperProgramContext { } // Caching the result - this._abstractSyntaxTree = listener.rootNode; + this._rootASTNode = listener.rootNode; const countNodes: number = listener.rootNode.children.length; this.logger.debug(`Finished generation of Kipper AST.`); @@ -480,7 +476,7 @@ export class KipperProgramContext { */ public async setUpBuiltInsInGlobalScope(): Promise { for (const [_, type] of Object.entries(BuiltInTypes)) { - this._globalScope.addType(type); + this._universeScope.addType(type); } } @@ -496,11 +492,11 @@ export class KipperProgramContext { */ public async semanticAnalysis(): Promise { try { - if (!this._abstractSyntaxTree) { - this._abstractSyntaxTree = await this.generateAbstractSyntaxTree(); + if (!this._rootASTNode) { + this._rootASTNode = await this.generateAbstractSyntaxTree(); } - await this._abstractSyntaxTree.semanticAnalysis(); + await this._rootASTNode.semanticAnalysis(); } catch (e) { if (e instanceof KipperError) { // Log the Kipper error @@ -516,22 +512,22 @@ export class KipperProgramContext { } /** - * Processes the {@link abstractSyntaxTree} and generates a new optimised one based on the {@link options}. + * Processes the {@link rootASTNode} and generates a new optimised one based on the {@link options}. * @param options The options for the optimisation. If undefined, the {@link defaultOptimisationOptions} are used. * @since 0.8.0 * @see {@link compileProgram} */ public async optimise(options?: OptimisationOptions): Promise { - if (!this.abstractSyntaxTree) { + if (!this.rootASTNode) { // TODO! Change this error to a more fitting one throw new UndefinedSemanticsError(); } try { - const result = await this.optimiser.optimise(this.abstractSyntaxTree, options); + const result = await this.optimiser.optimise(this.rootASTNode, options); // Caching the result - this._abstractSyntaxTree = result; + this._rootASTNode = result; return result; } catch (e) { @@ -554,13 +550,13 @@ export class KipperProgramContext { * @see {@link compileProgram} */ public async translate(): Promise> { - if (!this.abstractSyntaxTree) { + if (!this.rootASTNode) { // TODO! Change this error to a more fitting one throw new UndefinedSemanticsError(); } try { - return await this.abstractSyntaxTree.translate(); + return await this.rootASTNode.translate(); } catch (e) { if (e instanceof KipperError) { // Log the Kipper error @@ -583,7 +579,7 @@ export class KipperProgramContext { */ public async compileProgram(): Promise | undefined> { // Getting the processed AST tree - this._abstractSyntaxTree = await this.generateAbstractSyntaxTree(); + this._rootASTNode = await this.generateAbstractSyntaxTree(); // Running the semantic analysis for the AST this.logger.debug("Setting up built-ins in global scope."); @@ -605,7 +601,7 @@ export class KipperProgramContext { let genCode: Array = await this.translate(); this.logger.debug(`Lines of generated code: ${genCode.length}.`); - this.logger.debug(`Number of processed root items: ${this._abstractSyntaxTree.children.length}.`); + this.logger.debug(`Number of processed root items: ${this._rootASTNode.children.length}.`); // Cache the result this._compiledCode = genCode; @@ -712,8 +708,8 @@ export class KipperProgramContext { builtInVariables = Array.isArray(builtInVariables) ? builtInVariables : [builtInVariables]; // Make sure the global is valid and doesn't interfere with other identifiers + // If an error occurs, line 1 and col 1 will be used, as the ctx is undefined. for (let g of builtInVariables) { - // If an error occurs, line 1 and col 1 will be used, as the ctx is undefined. this.semanticCheck(undefined).globalCanBeRegistered(g.identifier); } this.builtInVariables.push(...builtInVariables); @@ -766,4 +762,37 @@ export class KipperProgramContext { srcExpr: exp, }); } + + /** + * Initialises the universal referencables for the program context, by registering all built-in functions and + * variables as well as adding all the extension functions and variables. + * + * This will initialise {@link this._universeScope}. + * @param compileConfig The compile configuration for the program. + * @private + * @since 0.11.0 + */ + private _initUniversalReferencables(compileConfig: EvaluatedCompileConfig) { + // Register all built-in functions + const globalFunctions = [...Object.values(BuiltInFunctions), ...compileConfig.extendBuiltInFunctions]; + this.registerBuiltInFunctions(globalFunctions); + this.logger.debug( + `Registered ${globalFunctions.length} global function${globalFunctions.length === 1 ? "" : "s"}.`, + ); + + // Register all built-in variables + const globalVariables = [...Object.values(BuiltInVariables), ...compileConfig.extendBuiltInVariables]; + this.registerBuiltInVariables(globalVariables); + this.logger.debug( + `Registered ${globalVariables.length} global variable${globalVariables.length === 1 ? "" : "s"}.`, + ); + + this._universeScope.init(); + for (const extFunction of compileConfig.extendBuiltInFunctions) { + this._universeScope.addFunction(extFunction); + } + for (const extVariable of compileConfig.extendBuiltInVariables) { + this._universeScope.addVariable(extVariable); + } + } } diff --git a/kipper/core/src/compiler/runtime-built-ins.ts b/kipper/core/src/compiler/runtime-built-ins.ts deleted file mode 100644 index 3667478ff..000000000 --- a/kipper/core/src/compiler/runtime-built-ins.ts +++ /dev/null @@ -1,313 +0,0 @@ -/** - * Built-Ins file, which provides the blueprints for the Kipper built-in functions and variables. - * @since 0.1.0 - */ -import type { KipperBuiltInTypeLiteral } from "./const"; - -/** - * Interface representation of an argument of a {@link BuiltInFunction}. - * @since 0.1.0 - */ -export interface BuiltInFunctionArgument { - /** - * The identifier of the argument inside the function - * - * This value does not affect the behaviour of the language, as named-arguments are not implemented in Kipper. This - * only serves the purpose of readability and allowing easier differentiation. - * @since 0.6.0 - */ - identifier: string; - /** - * The type of the argument inside the function - * - * @example - * def func(x: num, y: str) -> void {} - * - * // x is of type 'num' - * // y is of type 'str' - */ - valueType: KipperBuiltInTypeLiteral; -} - -/** - * Interface representation of a {@link BuiltInFunction}, which is available inside a Kipper program using the specified - * metadata. - * @since 0.1.0 - */ -export interface BuiltInFunction { - /** - * The identifier of the global function that should be available inside the program. - * - * The identifier may only contain default numbers and alphabet characters! - * @example - * call print(); // 'print' is the global function identifier - */ - identifier: string; - /** - * The args that are accepted inside this function. These are represented using {@link BuiltInFunctionArgument}. - * - * The index in the array also represents the argument position inside the function. Meaning the first item in the - * array maps to the first argument inside the function. - */ - params: Array; - /** - * The expected return of the function. If the return type is {@link KipperVoidType void}, then the function will not - * return anything. - */ - returnType: KipperBuiltInTypeLiteral; -} - -/** - * Interface representation of an argument of a {@link InternalFunction}. - * @since 0.10.0 - */ -export interface InternalFunctionArgument { - /** - * The identifier of the argument inside the function - * - * This value does not affect the behaviour of the language, as named-arguments are not implemented in Kipper. This - * only serves the purpose of readability and allowing easier differentiation. - * @since 0.6.0 - */ - identifier: string; - /** - * The type of the argument inside the function - * - * Unlike {@link BuiltInFunction}, this can also be an array of types, which means that the value type may be a union. - * @example - * def func(x: num, y: str) -> void {} - * - * // x is of type 'num' - * // y is of type 'str' - */ - valueType: KipperBuiltInTypeLiteral | Array; -} - -/** - * Interface representation of a {@link InternalFunction}, which is used to provide functionality for Kipper specific - * keywords, internal logic and other implementation related handling that must be present for a program to work. - * @since 0.8.0 - */ -export interface InternalFunction { - /** - * The identifier of the internal function. - * - * The identifier may only contain default numbers and alphabet characters! - * @example - * "4" as num; // 'strAsNum' is the internal function used to perform this expression - * @since 0.8.0 - */ - identifier: string; - /** - * The args that are accepted inside this function. These are represented using {@link InternalFunctionArgument}. - * - * The index in the array also represents the argument position inside the function. Meaning the first item in the - * array maps to the first argument inside the function. - * @since 0.8.0 - */ - params: Array; - /** - * The expected return of the function. If the return type is {@link KipperVoidType void}, then the function will not - * return anything. - * - * Unlike {@link BuiltInFunction}, this can also be an array of types, which means that the function return may be a - * union. - * @since 0.8.0 - */ - returnType: KipperBuiltInTypeLiteral; -} - -/** - * Interface representation of a {@link BuiltInVariable}, which is available inside a Kipper program using the specified - * metadata. - * @since 0.10.0 - */ -export interface BuiltInVariable { - /** - * The identifier of the global variable that should be available inside the program. - * @since 0.10.0 - */ - identifier: string; - /** - * The type of the variable. - * @since 0.10.0 - */ - valueType: KipperBuiltInTypeLiteral; - /** - * If true then the variable is local to the current file. If false then the variable is global and can be accessed - * from any file. - * - * This is primarily used to differentiate between local and global variables during the code generation process, - * since local ones will usually be initialised like any other variables, while globals will be registered on a global - * object. - * @since 0.10.0 - */ - local: boolean; -} - -/** - * Contains all the built-in functions in Kipper that are available per default in every program. - * - * This contains *every* builtin that also must be implemented by every target in the {@link KipperTargetBuiltInGenerator}. - * @since 0.7.0 - */ -export const kipperRuntimeBuiltInFunctions: Record = { - print: { - identifier: "print", - params: [ - { - identifier: "msg", - valueType: "str", - }, - ], - returnType: "void", - }, - len: { - identifier: "len", - params: [ - { - identifier: "arrayLike", - valueType: "str", // TODO: Implement this for all arrayLike types (At the moment only strings are supported) - }, - ], - returnType: "num", - }, -}; - -/** - * Contains all the internal built-in functions, which are used by Kipper to provide internal functionality. These - * internal built-ins are commonly used to provide the functionality for keywords and other internal logic. - * - * This contains *every* builtin that also must be implemented by every target in the {@link KipperTargetBuiltInGenerator}. - * @since 0.8.0 - */ -export const kipperInternalBuiltInFunctions = { - numToStr: { - identifier: "numToStr", - params: [ - { - identifier: "value", - valueType: "num", - }, - ], - returnType: "str", - }, - boolToStr: { - identifier: "boolToStr", - params: [ - { - identifier: "value", - valueType: "bool", - }, - ], - returnType: "str", - }, - voidToStr: { - identifier: "voidToStr", - params: [ - { - identifier: "value", - valueType: "void", - }, - ], - returnType: "str", - }, - nullToStr: { - identifier: "nullToStr", - params: [ - { - identifier: "value", - valueType: "null", - }, - ], - returnType: "str", - }, - undefinedToStr: { - identifier: "undefinedToStr", - params: [ - { - identifier: "value", - valueType: "undefined", - }, - ], - returnType: "str", - }, - strToNum: { - identifier: "strToNum", - params: [ - { - identifier: "value", - valueType: "str", - }, - ], - returnType: "num", - }, - boolToNum: { - identifier: "boolToNum", - params: [ - { - identifier: "value", - valueType: "bool", - }, - ], - returnType: "num", - }, - slice: { - identifier: "slice", - params: [ - { - identifier: "objLike", - valueType: "str", // TODO: Implement this for all objLike types (At the moment only strings are supported) - }, - { - identifier: "start", - valueType: ["num", "undefined"], // Optional - }, - { - identifier: "end", - valueType: ["num", "undefined"], // Optional - }, - ], - returnType: "str", // TODO: Implement this for all objLike types (At the moment only strings are supported) - }, - index: { - identifier: "index", - params: [ - { - identifier: "arrayLike", - valueType: "str", // TODO: Implement this for all arrayLike types (At the moment only strings are supported) - }, - { - identifier: "indexOrKey", - valueType: "num", - }, - ], - returnType: "str", // TODO: Implement this for all arrayLike types (At the moment only strings are supported) - }, - repeatString: { - identifier: "repeatString", - params: [ - { - identifier: "toRepeat", - valueType: "str", - }, - { - identifier: "times", - valueType: "num", - }, - ], - returnType: "str", - }, -} satisfies Record; - -/** - * Contains all the built-in variables in Kipper that are available per default in every program. - * @since 0.10.0 - */ -export const kipperRuntimeBuiltInVariables: Record = { - __name__: { - identifier: "__name__", - valueType: "str", - local: true, - }, -}; diff --git a/kipper/core/src/compiler/analysis/analyser/err-handler/index.ts b/kipper/core/src/compiler/semantics/analyser/err-handler/index.ts similarity index 100% rename from kipper/core/src/compiler/analysis/analyser/err-handler/index.ts rename to kipper/core/src/compiler/semantics/analyser/err-handler/index.ts diff --git a/kipper/core/src/compiler/analysis/analyser/err-handler/semantics-asserter.ts b/kipper/core/src/compiler/semantics/analyser/err-handler/semantics-asserter.ts similarity index 100% rename from kipper/core/src/compiler/analysis/analyser/err-handler/semantics-asserter.ts rename to kipper/core/src/compiler/semantics/analyser/err-handler/semantics-asserter.ts diff --git a/kipper/core/src/compiler/analysis/analyser/err-handler/semantics-error-handler.ts b/kipper/core/src/compiler/semantics/analyser/err-handler/semantics-error-handler.ts similarity index 100% rename from kipper/core/src/compiler/analysis/analyser/err-handler/semantics-error-handler.ts rename to kipper/core/src/compiler/semantics/analyser/err-handler/semantics-error-handler.ts diff --git a/kipper/core/src/compiler/analysis/analyser/index.ts b/kipper/core/src/compiler/semantics/analyser/index.ts similarity index 100% rename from kipper/core/src/compiler/analysis/analyser/index.ts rename to kipper/core/src/compiler/semantics/analyser/index.ts diff --git a/kipper/core/src/compiler/analysis/analyser/semantic-checker.ts b/kipper/core/src/compiler/semantics/analyser/semantic-checker.ts similarity index 89% rename from kipper/core/src/compiler/analysis/analyser/semantic-checker.ts rename to kipper/core/src/compiler/semantics/analyser/semantic-checker.ts index 788c0c1fb..2ea6f6db2 100644 --- a/kipper/core/src/compiler/analysis/analyser/semantic-checker.ts +++ b/kipper/core/src/compiler/semantics/analyser/semantic-checker.ts @@ -47,28 +47,24 @@ export class KipperSemanticChecker extends KipperSemanticsAsserter { /** * Tries to find a reference for the given identifier and scope. * @param identifier The identifier to search for. - * @param scopeCtx The scopeCtx to search in. If undefined, the global scope is used. + * @param scope The scope to search in. * @since 0.8.0 */ - protected getReference(identifier: string, scopeCtx?: ScopeNode): KipperReferenceable | undefined { - return ( - (scopeCtx // First try to fetch from the local scope if it is defined - ? scopeCtx.innerScope.getEntryRecursively(identifier) - : this.programCtx.globalScope.getEntry(identifier)) ?? - this.programCtx.globalScope.getEntry(identifier) ?? // Fall back to looking globally - this.programCtx.getBuiltInFunction(identifier) ?? // Fall back to searching through built-in functions - this.programCtx.getBuiltInVariable(identifier) // Fall back to searching through built-in variables - ); + protected getReference(identifier: string, scope: Scope): KipperReferenceable | undefined { + return scope.getEntryRecursively(identifier) } /** * Tries to fetch the function, and if it fails it will throw an {@link UnknownReferenceError}. * @param identifier The identifier to fetch. - * @param localScopeNode The ctx of the local scope, which will be also checked if it is defined. + * @param scope The scope to search in. * @since 0.7.0 */ - public getExistingReference(identifier: string, localScopeNode?: ScopeNode): KipperReferenceable { - const ref = this.getReference(identifier, localScopeNode); + public getExistingReference( + identifier: string, + scope: Scope + ): KipperReferenceable { + const ref = this.getReference(identifier, scope); if (!ref) { throw this.assertError(new UnknownReferenceError(identifier)); } @@ -135,7 +131,7 @@ export class KipperSemanticChecker extends KipperSemanticsAsserter { * @since 0.7.0 */ public globalCanBeRegistered(identifier: string): void { - let identifierAlreadyExists: boolean = this.programCtx.globalScope.getEntry(identifier) !== undefined; + let identifierAlreadyExists: boolean = this.programCtx.universeScope.getEntry(identifier) !== undefined; let globalAlreadyExists: boolean = this.programCtx.getBuiltInFunction(identifier) !== undefined || this.programCtx.getBuiltInVariable(identifier) !== undefined; diff --git a/kipper/core/src/compiler/analysis/analyser/type-checker.ts b/kipper/core/src/compiler/semantics/analyser/type-checker.ts similarity index 93% rename from kipper/core/src/compiler/analysis/analyser/type-checker.ts rename to kipper/core/src/compiler/semantics/analyser/type-checker.ts index 1e08e33ea..02edc4caf 100644 --- a/kipper/core/src/compiler/analysis/analyser/type-checker.ts +++ b/kipper/core/src/compiler/semantics/analyser/type-checker.ts @@ -3,7 +3,7 @@ * invalid use of types and identifiers is detected. * @since 0.7.0 */ -import type { BuiltInFunctionArgument } from "../../runtime-built-ins"; +import type { BuiltInFunctionArgument } from "../runtime-built-ins"; import type { KipperProgramContext } from "../../program-ctx"; import type { AssignmentExpression, @@ -28,6 +28,7 @@ import { } from "../../ast"; import { KipperSemanticsAsserter } from "./err-handler"; import { + BuiltInTypes, Scope, ScopeDeclaration, ScopeParameterDeclaration, @@ -108,7 +109,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { public getCheckedType(rawType: RawType, scope: Scope): ProcessedType { try { const type = this.getTypeFromIdentifier(rawType.identifier, scope); - return + return type.type; } catch (e) { // If the error is not a KipperError, rethrow it (since it is not a rawType error, and we don't know what happened) if (!(e instanceof KipperError)) { @@ -121,7 +122,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { this.programCtx.reportError(e); // Recover from the error by wrapping the undefined rawType - return ProcessedType.fromKipperType(new UndefinedType(rawType.identifier)); + return new UndefinedType(rawType.identifier); } // If error recovery is not enabled, we shouldn't bother trying to handle invalid types @@ -176,23 +177,23 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { } // Get the compile-types for the left and right hand side - const varType = leftExpTypeData.evaluatedType.get(); - const valueType = rightExpTypeData.evaluatedType.get(); + const varType = leftExpTypeData.evaluatedType; + const valueType = rightExpTypeData.evaluatedType; - // If either one of the types is undefined, skip type checking (the types are invalid anyway) - if (varType === undefined || valueType === undefined) { + // If either one of the types can't be compiled or evaluated then we skip this step + if (!varType.isCompilable || !valueType.isCompilable) { return; } // Ensure that the types are matching - if not, throw an error - if (!this.checkMatchingTypes(varType, valueType)) { - throw this.assertError(new AssignmentTypeError(varType, valueType)); + if (!varType.isAssignableTo(valueType)) { + throw this.assertError(new AssignmentTypeError(varType.identifier, valueType.identifier)); } // Ensure that all arithmetic assignment operators except '+=' are only used on numbers - if (semanticData.operator !== "=" && valueType !== "num") { + if (semanticData.operator !== "=" && valueType !== BuiltInTypes.num) { // Strings may use the '+=' operator to concatenate (e.g. 'str += str') - if (!(semanticData.operator === "+=" && valueType === "str")) { + if (!(semanticData.operator === "+=" && valueType === BuiltInTypes.str)) { throw this.assertError(new ArithmeticOperationTypeError()); } } @@ -207,17 +208,17 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { */ public validVariableDefinition(scopeEntry: ScopeVariableDeclaration, value: Expression): void { // Get the compile-types for the left and right hand side - const leftExpType = scopeEntry.type.get(); - const rightExpType = value.getTypeSemanticData().evaluatedType.get(); + const leftExpType = scopeEntry.type; + const rightExpType = value.getTypeSemanticData().evaluatedType; - // If either one of the types is undefined, skip type checking (the types are invalid anyway) - if (leftExpType === undefined || rightExpType === undefined) { + // If either one of the types can't be compiled or evaluated then we skip this step + if (!leftExpType.isCompilable || !rightExpType.isCompilable) { return; } // Ensure the value of the definition match the definition type - if (!this.checkMatchingTypes(leftExpType, rightExpType)) { - throw this.assertError(new AssignmentTypeError(rightExpType, leftExpType)); + if (!rightExpType.isAssignableTo(leftExpType)) { + throw this.assertError(new AssignmentTypeError(rightExpType.identifier, leftExpType.identifier)); } } @@ -240,20 +241,16 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { argType = arg.getTypeSemanticData().valueType; } else { semanticData = arg; - argType = ProcessedType.fromCompilableType(arg.valueType); + argType = arg.valueType; } - // Get the compile-types for the parameter and argument (value provided) - const receivedCompileType = receivedType.get(); - const argCompileType = argType.get(); - - // If either one of the types is undefined, skip type checking (the types are invalid anyway) - if (receivedCompileType === undefined || argCompileType === undefined) { + // If either one of the types can't be compiled or evaluated then we skip this step + if (!receivedType.isCompilable || !argType.isCompilable) { return; } - if (!this.checkMatchingTypes(argCompileType, receivedCompileType)) { - throw this.assertError(new ArgumentTypeError(semanticData.identifier, argCompileType, receivedCompileType)); + if (!argType.isAssignableTo(receivedType)) { + throw this.assertError(new ArgumentTypeError(semanticData.identifier, argType.identifier, receivedType.identifier)); } } @@ -446,10 +443,14 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { const semanticData = returnStatement.getSemanticData(); // If the return statement has no return value, then the value is automatically 'void' - const statementValueType = semanticData.returnValue?.getTypeSemanticData().evaluatedType.get() ?? "void"; + const statementValueType = semanticData.returnValue?.getTypeSemanticData().evaluatedType ?? BuiltInTypes.void; // TODO! DON'T DO THIS. THIS IS PUTTING TYPE CHECKING OF A PARENT INTO A CHILD - const functionReturnType = this.getCheckedType(semanticData.function.getSemanticData().returnType).get(); + // TODO! REALLY WE NEED TO REMOVE THIS SOON + const functionReturnType = this.getCheckedType( + semanticData.function.getSemanticData().returnType, + semanticData.function.scope, + ); // If either one of the types is undefined, skip type checking (the types are invalid anyway) if (statementValueType === undefined || functionReturnType === undefined) { @@ -458,8 +459,8 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { // We need to check whether the types are matching, but *not* if the function return type is valid, since that // will be done later by the function itself during the type checking. - if (statementValueType && !this.checkMatchingTypes(statementValueType, functionReturnType)) { - throw this.assertError(new AssignmentTypeError(statementValueType, functionReturnType)); + if (statementValueType && !statementValueType.isAssignableTo(functionReturnType)) { + throw this.assertError(new AssignmentTypeError(statementValueType.identifier, functionReturnType.identifier)); } } diff --git a/kipper/core/src/compiler/analysis/analyser/warning-issuer.ts b/kipper/core/src/compiler/semantics/analyser/warning-issuer.ts similarity index 100% rename from kipper/core/src/compiler/analysis/analyser/warning-issuer.ts rename to kipper/core/src/compiler/semantics/analyser/warning-issuer.ts diff --git a/kipper/core/src/compiler/analysis/handle-error.ts b/kipper/core/src/compiler/semantics/handle-error.ts similarity index 100% rename from kipper/core/src/compiler/analysis/handle-error.ts rename to kipper/core/src/compiler/semantics/handle-error.ts diff --git a/kipper/core/src/compiler/analysis/index.ts b/kipper/core/src/compiler/semantics/index.ts similarity index 79% rename from kipper/core/src/compiler/analysis/index.ts rename to kipper/core/src/compiler/semantics/index.ts index 6b0ba22bf..5bddc3ffa 100644 --- a/kipper/core/src/compiler/analysis/index.ts +++ b/kipper/core/src/compiler/semantics/index.ts @@ -3,6 +3,8 @@ * @since 0.7.0 */ export * from "./handle-error"; +export * from "./runtime-internals"; +export * from "./runtime-built-ins"; export * from "./analyser/"; export * from "./symbol-table/"; export * from "./types"; diff --git a/kipper/core/src/compiler/analysis/reference.ts b/kipper/core/src/compiler/semantics/reference.ts similarity index 95% rename from kipper/core/src/compiler/analysis/reference.ts rename to kipper/core/src/compiler/semantics/reference.ts index 61a0c2575..8ad08b145 100644 --- a/kipper/core/src/compiler/analysis/reference.ts +++ b/kipper/core/src/compiler/semantics/reference.ts @@ -4,7 +4,7 @@ */ import type { Expression } from "../ast"; import type { KipperReferenceable } from "../const"; -import type { InternalFunction } from "../runtime-built-ins"; +import { InternalFunction } from "./runtime-internals"; /** * A {@link KipperReferenceable reference} to an identifier that stores a value or function. diff --git a/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-function-argument.ts b/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-function-argument.ts new file mode 100644 index 000000000..0509d8b6d --- /dev/null +++ b/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-function-argument.ts @@ -0,0 +1,38 @@ +import {KipperBuiltInTypeLiteral} from "../../const"; +import {ProcessedType} from "../types"; +import {UniverseScope} from "../symbol-table"; + +/** + * Interface representation of an argument of a {@link BuiltInFunction}. + * @since 0.1.0 + * @since 0.11.0 Became a class instead of an interface. + */ +export class BuiltInFunctionArgument { + /** + * The identifier of the argument inside the function + * + * This value does not affect the behaviour of the language, as named-arguments are not implemented in Kipper. This + * only serves the purpose of readability and allowing easier differentiation. + * @since 0.6.0 + */ + public readonly identifier: string; + + /** + * The type of the argument inside the function + * + * @example + * def func(x: num, y: str) -> void {} + * + * // x is of type 'num' + * // y is of type 'str' + */ + public readonly valueType: ProcessedType; + + public constructor( + identifier: string, + valueType: ProcessedType, + ) { + this.identifier = identifier; + this.valueType = valueType; + } +} diff --git a/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-function.ts b/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-function.ts new file mode 100644 index 000000000..848dc4299 --- /dev/null +++ b/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-function.ts @@ -0,0 +1,43 @@ +import {ProcessedType} from "../types"; +import {BuiltInFunctionArgument} from "./built-in-function-argument"; + +/** + * Interface representation of a {@link BuiltInFunction}, which is available inside a Kipper program using the specified + * metadata. + * @since 0.1.0 + * @since 0.11.0 Became a class instead of an interface. + */ +export class BuiltInFunction { + /** + * The identifier of the global function that should be available inside the program. + * + * The identifier may only contain default numbers and alphabet characters! + * @example + * print(); // 'print' is the global function identifier + */ + public readonly identifier: string; + + /** + * The args that are accepted inside this function. These are represented using {@link BuiltInFunctionArgument}. + * + * The index in the array also represents the argument position inside the function. Meaning the first item in the + * array maps to the first argument inside the function. + */ + public readonly params: Array; + + /** + * The expected return of the function. If the return type is {@link KipperVoidType void}, then the function will not + * return anything. + */ + public readonly returnType: ProcessedType; + + public constructor( + identifier: string, + params: Array, + returnType: ProcessedType, + ) { + this.identifier = identifier; + this.params = params; + this.returnType = returnType; + } +} diff --git a/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-variable.ts b/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-variable.ts new file mode 100644 index 000000000..56f285b0b --- /dev/null +++ b/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-variable.ts @@ -0,0 +1,43 @@ +import {KipperBuiltInTypeLiteral} from "../../const"; +import {ProcessedType} from "../types"; +import {UniverseScope} from "../symbol-table"; + +/** + * Interface representation of a {@link BuiltInVariable}, which is available inside a Kipper program using the specified + * metadata. + * @since 0.10.0 + */ +export class BuiltInVariable { + /** + * The identifier of the global variable that should be available inside the program. + * @since 0.10.0 + */ + public readonly identifier: string; + + /** + * The type of the variable. + * @since 0.10.0 + */ + public readonly valueType: ProcessedType; + + /** + * If true then the variable is local to the current file. If false then the variable is global and can be accessed + * from any file. + * + * This is primarily used to differentiate between local and global variables during the code generation process, + * since local ones will usually be initialised like any other variables, while globals will be registered on a global + * object. + * @since 0.10.0 + */ + public readonly local: boolean; + + public constructor( + identifier: string, + valueType: ProcessedType, + local: boolean, + ) { + this.identifier = identifier; + this.valueType = valueType; + this.local = local; + } +} diff --git a/kipper/core/src/compiler/semantics/runtime-built-ins/index.ts b/kipper/core/src/compiler/semantics/runtime-built-ins/index.ts new file mode 100644 index 000000000..23590e5fc --- /dev/null +++ b/kipper/core/src/compiler/semantics/runtime-built-ins/index.ts @@ -0,0 +1,7 @@ +/** + * Runtime built-ins are functions that are available to the user at runtime. + * @since 0.11.0 + */ +export * from "./built-in-function"; +export * from "./built-in-function-argument"; +export * from "./built-in-variable"; diff --git a/kipper/core/src/compiler/semantics/runtime-internals/index.ts b/kipper/core/src/compiler/semantics/runtime-internals/index.ts new file mode 100644 index 000000000..1547bde23 --- /dev/null +++ b/kipper/core/src/compiler/semantics/runtime-internals/index.ts @@ -0,0 +1,7 @@ +/** + * This file is used to export all the internal classes and functions that are used by the runtime. + * @since 0.11.0 + */ +export * from "./internal-function"; +export * from "./internal-function-argument"; +export * from "./internals"; diff --git a/kipper/core/src/compiler/semantics/runtime-internals/internal-function-argument.ts b/kipper/core/src/compiler/semantics/runtime-internals/internal-function-argument.ts new file mode 100644 index 000000000..7977c9393 --- /dev/null +++ b/kipper/core/src/compiler/semantics/runtime-internals/internal-function-argument.ts @@ -0,0 +1,35 @@ +import {KipperBuiltInTypeLiteral} from "../../const"; +import {ProcessedType} from "../types"; + +/** + * Interface representation of an argument of a {@link InternalFunction}. + * @since 0.10.0 + * @since 0.11.0 Became a class instead of an interface. + */ +export class InternalFunctionArgument { + /** + * The identifier of the argument inside the function + * + * This value does not affect the behaviour of the language, as named-arguments are not implemented in Kipper. This + * only serves the purpose of readability and allowing easier differentiation. + * @since 0.6.0 + */ + public readonly identifier: string; + + /** + * The type of the argument inside the function + * + * Unlike {@link BuiltInFunction}, this can also be an array of types, which means that the value type may be a union. + * @example + * def func(x: num, y: str) -> void {} + * + * // x is of type 'num' + * // y is of type 'str' + */ + public readonly valueType: ProcessedType | Array; + + public constructor(identifier: string, valueType: ProcessedType | Array) { + this.identifier = identifier; + this.valueType = valueType; + } +} diff --git a/kipper/core/src/compiler/semantics/runtime-internals/internal-function.ts b/kipper/core/src/compiler/semantics/runtime-internals/internal-function.ts new file mode 100644 index 000000000..09b7f22cd --- /dev/null +++ b/kipper/core/src/compiler/semantics/runtime-internals/internal-function.ts @@ -0,0 +1,46 @@ +import {InternalFunctionArgument} from "./internal-function-argument"; +import {KipperBuiltInTypeLiteral} from "../../const"; +import {ProcessedType} from "../types"; + +/** + * Interface representation of a {@link InternalFunction}, which is used to provide functionality for Kipper specific + * keywords, internal logic and other implementation related handling that must be present for a program to work. + * @since 0.8.0 + * @since 0.11.0 Became a class instead of an interface. + */ +export class InternalFunction { + /** + * The identifier of the internal function. + * + * The identifier may only contain default numbers and alphabet characters! + * @example + * "4" as num; // 'strAsNum' is the internal function used to perform this expression + * @since 0.8.0 + */ + public readonly identifier: string; + + /** + * The args that are accepted inside this function. These are represented using {@link InternalFunctionArgument}. + * + * The index in the array also represents the argument position inside the function. Meaning the first item in the + * array maps to the first argument inside the function. + * @since 0.8.0 + */ + public readonly params: Array; + + /** + * The expected return of the function. If the return type is {@link KipperVoidType void}, then the function will not + * return anything. + * + * Unlike {@link BuiltInFunction}, this can also be an array of types, which means that the function return may be a + * union. + * @since 0.8.0 + */ + public readonly returnType: ProcessedType; + + public constructor(identifier: string, params: Array, returnType: ProcessedType) { + this.identifier = identifier; + this.params = params; + this.returnType = returnType; + } +} diff --git a/kipper/core/src/compiler/semantics/runtime-internals/internals.ts b/kipper/core/src/compiler/semantics/runtime-internals/internals.ts new file mode 100644 index 000000000..8f04ae2dd --- /dev/null +++ b/kipper/core/src/compiler/semantics/runtime-internals/internals.ts @@ -0,0 +1,127 @@ +import { InternalFunction } from "./internal-function"; + +/** + * Contains all the internal built-in functions, which are used by Kipper to provide internal functionality. These + * internal built-ins are commonly used to provide the functionality for keywords and other internal logic. + * + * This contains *every* builtin that also must be implemented by every target in the {@link KipperTargetBuiltInGenerator}. + * @since 0.8.0 + */ +export const kipperInternalBuiltInFunctions = { + numToStr: { + identifier: "numToStr", + params: [ + { + identifier: "value", + valueType: "num", + }, + ], + returnType: "str", + }, + boolToStr: { + identifier: "boolToStr", + params: [ + { + identifier: "value", + valueType: "bool", + }, + ], + returnType: "str", + }, + voidToStr: { + identifier: "voidToStr", + params: [ + { + identifier: "value", + valueType: "void", + }, + ], + returnType: "str", + }, + nullToStr: { + identifier: "nullToStr", + params: [ + { + identifier: "value", + valueType: "null", + }, + ], + returnType: "str", + }, + undefinedToStr: { + identifier: "undefinedToStr", + params: [ + { + identifier: "value", + valueType: "undefined", + }, + ], + returnType: "str", + }, + strToNum: { + identifier: "strToNum", + params: [ + { + identifier: "value", + valueType: "str", + }, + ], + returnType: "num", + }, + boolToNum: { + identifier: "boolToNum", + params: [ + { + identifier: "value", + valueType: "bool", + }, + ], + returnType: "num", + }, + slice: { + identifier: "slice", + params: [ + { + identifier: "objLike", + valueType: "str", // TODO: Implement this for all objLike types (At the moment only strings are supported) + }, + { + identifier: "start", + valueType: ["num", "undefined"], // Optional + }, + { + identifier: "end", + valueType: ["num", "undefined"], // Optional + }, + ], + returnType: "str", // TODO: Implement this for all objLike types (At the moment only strings are supported) + }, + index: { + identifier: "index", + params: [ + { + identifier: "arrayLike", + valueType: "str", // TODO: Implement this for all arrayLike types (At the moment only strings are supported) + }, + { + identifier: "indexOrKey", + valueType: "num", + }, + ], + returnType: "str", // TODO: Implement this for all arrayLike types (At the moment only strings are supported) + }, + repeatString: { + identifier: "repeatString", + params: [ + { + identifier: "toRepeat", + valueType: "str", + }, + { + identifier: "times", + valueType: "num", + }, + ], + returnType: "str", + }, +} satisfies Record; diff --git a/kipper/core/src/compiler/semantics/symbol-table/base/index.ts b/kipper/core/src/compiler/semantics/symbol-table/base/index.ts new file mode 100644 index 000000000..f768dee46 --- /dev/null +++ b/kipper/core/src/compiler/semantics/symbol-table/base/index.ts @@ -0,0 +1,6 @@ +/** + * Symbol table base classes and interfaces. + * @since 0.11.0 + */ +export * from "./symbol-table"; +export * from "./scope"; diff --git a/kipper/core/src/compiler/analysis/symbol-table/scope.ts b/kipper/core/src/compiler/semantics/symbol-table/base/scope.ts similarity index 86% rename from kipper/core/src/compiler/analysis/symbol-table/scope.ts rename to kipper/core/src/compiler/semantics/symbol-table/base/scope.ts index 97bcb0597..425aa190a 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/scope.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/base/scope.ts @@ -2,14 +2,15 @@ * A symbol-table implementation in form of a scope that may contain both variables and functions. * @since 0.8.0 */ -import type { FunctionDeclaration, TypeDeclaration, VariableDeclaration } from "../../ast"; +import type { FunctionDeclaration, TypeDeclaration, VariableDeclaration } from "../../../ast"; import type { ScopeDeclaration, ScopeFunctionDeclaration, ScopeTypeDeclaration, ScopeVariableDeclaration, -} from "./entry"; +} from "../entry"; import type { SymbolTable } from "./symbol-table"; +import {BuiltInType} from "../../types"; /** * A scope in a Kipper program, which can contain {@link ScopeVariableDeclaration variables}, @@ -18,7 +19,11 @@ import type { SymbolTable } from "./symbol-table"; * A scope can be a child of another scope or the global scope of a {@link KipperProgramContext program}. * @since 0.8.0 */ -export abstract class Scope implements SymbolTable { +export abstract class Scope< + VarT = any, + FuncT = any, + TypeT = any, +> implements SymbolTable { protected readonly _entries: Map; protected constructor() { @@ -45,7 +50,7 @@ export abstract class Scope implements SymbolTable { * @returns The generated {@link ScopeVariableDeclaration scope declaration}. * @since 0.8.0 */ - public abstract addVariable(declaration: VariableDeclaration): ScopeVariableDeclaration; + public abstract addVariable(declaration: VarT): ScopeVariableDeclaration; /** * Adds a new function declaration to the {@link entries symbol table entries}. @@ -53,7 +58,7 @@ export abstract class Scope implements SymbolTable { * @returns The generated {@link ScopeFunctionDeclaration scope declaration}. * @since 0.8.0 */ - public abstract addFunction(declaration: FunctionDeclaration): ScopeFunctionDeclaration; + public abstract addFunction(declaration: FuncT): ScopeFunctionDeclaration; /** * Adds a new type declaration to the {@link entries symbol table entries}. @@ -61,7 +66,7 @@ export abstract class Scope implements SymbolTable { * @returns The generated {@link ScopeTypeDeclaration scope declaration}. * @since 0.11.0 */ - public abstract addType(declaration: TypeDeclaration): ScopeTypeDeclaration; + public abstract addType(declaration: TypeT): ScopeTypeDeclaration; /** * Searches for a reference/entry with the specific identifier in the local hash table entries (local scope). diff --git a/kipper/core/src/compiler/analysis/symbol-table/symbol-table.ts b/kipper/core/src/compiler/semantics/symbol-table/base/symbol-table.ts similarity index 87% rename from kipper/core/src/compiler/analysis/symbol-table/symbol-table.ts rename to kipper/core/src/compiler/semantics/symbol-table/base/symbol-table.ts index 8228ee664..1812e02fd 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/symbol-table.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/base/symbol-table.ts @@ -1,4 +1,4 @@ -import type { ScopeDeclaration } from "./entry"; +import type { ScopeDeclaration } from "../entry"; /** * A simple interface defining the basic functionality of a symbol table. diff --git a/kipper/core/src/compiler/analysis/symbol-table/class-scope.ts b/kipper/core/src/compiler/semantics/symbol-table/class-scope.ts similarity index 100% rename from kipper/core/src/compiler/analysis/symbol-table/class-scope.ts rename to kipper/core/src/compiler/semantics/symbol-table/class-scope.ts diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/index.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/index.ts similarity index 100% rename from kipper/core/src/compiler/analysis/symbol-table/entry/index.ts rename to kipper/core/src/compiler/semantics/symbol-table/entry/index.ts diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-declaration.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-declaration.ts similarity index 100% rename from kipper/core/src/compiler/analysis/symbol-table/entry/scope-declaration.ts rename to kipper/core/src/compiler/semantics/symbol-table/entry/scope-declaration.ts diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-function-declaration.ts similarity index 54% rename from kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts rename to kipper/core/src/compiler/semantics/symbol-table/entry/scope-function-declaration.ts index d9df2c774..11abd676c 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-function-declaration.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-function-declaration.ts @@ -9,18 +9,41 @@ import type { ParameterDeclaration, } from "../../../ast"; import { ScopeDeclaration } from "./scope-declaration"; -import {BuiltInTypes, ProcessedType} from "../../types"; +import {ProcessedType} from "../../types"; +import {BuiltInFunction, BuiltInFunctionArgument} from "../../runtime-built-ins"; +import {BuiltInTypes} from "../universum-scope"; /** * Represents the definition of a function inside a {@link Scope}. * @since 0.1.2 */ export class ScopeFunctionDeclaration extends ScopeDeclaration { - private readonly _node: FunctionDeclaration; + private readonly _declaration?: FunctionDeclaration; + private readonly _builtInFunction?: BuiltInFunction; - public constructor(node: FunctionDeclaration) { + private constructor( + declaration?: FunctionDeclaration, + builtInFunction?: BuiltInFunction, + ) { super(); - this._node = node; + this._declaration = declaration; + this._builtInFunction = builtInFunction; + } + + /** + * Creates a new scope function declaration from a function declaration. + * @param declaration The function declaration node. + */ + public static fromFunctionDeclaration(declaration: FunctionDeclaration): ScopeFunctionDeclaration { + return new ScopeFunctionDeclaration(declaration); + } + + /** + * Creates a new scope function declaration from a function declaration. + * @param declaration The function declaration node. + */ + static fromBuiltInFunction(declaration: BuiltInFunction): ScopeFunctionDeclaration { + return new ScopeFunctionDeclaration(undefined, declaration); } /** @@ -28,8 +51,8 @@ export class ScopeFunctionDeclaration extends ScopeDeclaration { * @throws UndefinedSemanticsError If this is accessed, before semantic analysis was performed. * @private */ - private get semanticData(): FunctionDeclarationSemantics { - return this._node.getSemanticData(); + private get semanticData(): FunctionDeclarationSemantics | undefined { + return this._declaration?.getSemanticData(); } /** @@ -37,22 +60,22 @@ export class ScopeFunctionDeclaration extends ScopeDeclaration { * @throws UndefinedSemanticsError If this is accessed, before type checking was performed. * @private */ - private get typeData(): FunctionDeclarationTypeSemantics { - return this._node.getTypeSemanticData(); + private get typeData(): FunctionDeclarationTypeSemantics | undefined { + return this._declaration?.getTypeSemanticData(); } /** * Returns the {@link FunctionDeclaration AST node} this scope function declaration bases on. */ - public get node(): FunctionDeclaration { - return this._node; + public get node(): FunctionDeclaration | undefined { + return this._declaration; } /** * The identifier of this function. */ public get identifier(): string { - return this.semanticData.identifier; + return this.semanticData?.identifier ?? this._builtInFunction!!.identifier; } /** @@ -67,7 +90,7 @@ export class ScopeFunctionDeclaration extends ScopeDeclaration { * The return type of this function. This can be every {@link KipperType} except {@link KipperFuncType}. */ public get returnType(): ProcessedType { - return this.typeData.returnType; + return this.typeData?.returnType ?? BuiltInTypes.void; } /** @@ -77,8 +100,8 @@ export class ScopeFunctionDeclaration extends ScopeDeclaration { * The index in the array represents the position inside the function. Meaning the first item in the array maps to * the first parameter inside the function. */ - public get params(): Array { - return this.semanticData.params; + public get params(): Array | Array { + return this.semanticData?.params ?? this._builtInFunction?.params!!; } /** @@ -86,7 +109,7 @@ export class ScopeFunctionDeclaration extends ScopeDeclaration { * @since 0.3.0 */ public get isDefined(): boolean { - return this.semanticData.isDefined; + return this.semanticData?.isDefined ?? true; } /** diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-parameter-declaration.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts similarity index 86% rename from kipper/core/src/compiler/analysis/symbol-table/entry/scope-parameter-declaration.ts rename to kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts index 67485a2e0..101b3a701 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-parameter-declaration.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts @@ -9,8 +9,8 @@ import type { ParameterDeclarationSemantics, ParameterDeclarationTypeSemantics, } from "../../../ast"; -import type { LocalScope } from "../index"; -import {BuiltInTypes, ProcessedType} from "../../types"; +import {BuiltInTypes, LocalScope} from "../index"; +import {ProcessedType} from "../../types"; /** * Represents the definition of a parameter inside a {@link FunctionDeclaration function}. @@ -19,11 +19,19 @@ import {BuiltInTypes, ProcessedType} from "../../types"; export class ScopeParameterDeclaration extends ScopeDeclaration { private readonly _node: ParameterDeclaration; - public constructor(node: ParameterDeclaration) { + private constructor(node: ParameterDeclaration) { super(); this._node = node; } + /** + * Creates a new scope parameter declaration from a parameter declaration. + * @param node The parameter declaration node. + */ + public static fromParameterDeclaration(node: ParameterDeclaration): ScopeParameterDeclaration { + return new ScopeParameterDeclaration(node); + } + /** * The semantic data of this declaration. * @throws UndefinedSemanticsError If this is accessed, before semantic analysis was performed. diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts similarity index 96% rename from kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts rename to kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts index 9522ca267..67f4ea044 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-type-declaration.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts @@ -4,8 +4,9 @@ */ import { ScopeDeclaration } from "./scope-declaration"; import { TypeDeclaration, TypeDeclarationSemantics } from "../../../ast"; -import {BuiltInType, BuiltInTypes, CustomType, ProcessedType, Type} from "../../types"; +import {BuiltInType, CustomType, ProcessedType, Type} from "../../types" import { KipperNotImplementedError } from "../../../../errors"; +import {BuiltInTypes} from "../universum-scope"; /** * Represents the definition of a type such as a class or interface in a scope. diff --git a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts similarity index 53% rename from kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts rename to kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts index 3ce58f095..bd0ce594d 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/entry/scope-variable-declaration.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts @@ -4,16 +4,18 @@ */ import type { VariableDeclaration, VariableDeclarationSemantics, VariableDeclarationTypeSemantics } from "../../../ast"; import type { KipperStorageType } from "../../../const"; -import type { Scope } from "../index"; -import {BuiltInTypes, ProcessedType} from "../../types"; +import {BuiltInTypes} from "../index"; +import { ProcessedType} from "../../types"; import { ScopeDeclaration } from "./scope-declaration"; +import {BuiltInVariable} from "../../runtime-built-ins"; /** * Represents a variable scope entry that may be a child of the global scope or local scope. * @since 0.1.0 */ export class ScopeVariableDeclaration extends ScopeDeclaration { - private readonly _node: VariableDeclaration; + private readonly _declaration?: VariableDeclaration; + private readonly _builtInVariable?: BuiltInVariable; /** * Returns whether the variable has been updated after its initial declaration. @@ -21,9 +23,29 @@ export class ScopeVariableDeclaration extends ScopeDeclaration { */ public valueWasUpdated: boolean = false; - public constructor(node: VariableDeclaration) { + public constructor( + declaration?: VariableDeclaration, + builtInVariable?: BuiltInVariable, + ) { super(); - this._node = node; + this._declaration = declaration; + this._builtInVariable = builtInVariable; + } + + /** + * Creates a new scope variable declaration from a variable declaration. + * @param declaration The variable declaration node. + */ + public static fromVariableDeclaration(declaration: VariableDeclaration): ScopeVariableDeclaration { + return new ScopeVariableDeclaration(declaration); + } + + /** + * Creates a new scope variable declaration from a built-in variable. + * @param builtInVariable The built-in variable. + */ + public static fromBuiltInVariable(builtInVariable: BuiltInVariable): ScopeVariableDeclaration { + return new ScopeVariableDeclaration(undefined, builtInVariable); } /** @@ -31,8 +53,8 @@ export class ScopeVariableDeclaration extends ScopeDeclaration { * @throws UndefinedSemanticsError If this is accessed, before semantic analysis was performed. * @private */ - private get semanticData(): VariableDeclarationSemantics { - return this._node.getSemanticData(); + private get semanticData(): VariableDeclarationSemantics | undefined { + return this._declaration?.getSemanticData(); } /** @@ -40,50 +62,50 @@ export class ScopeVariableDeclaration extends ScopeDeclaration { * @throws UndefinedSemanticsError If this is accessed, before type checking was performed. * @private */ - private get typeData(): VariableDeclarationTypeSemantics { - return this._node.getTypeSemanticData(); + private get typeData(): VariableDeclarationTypeSemantics | undefined { + return this._declaration?.getTypeSemanticData(); } /** * Returns the {@link VariableDeclaration AST node} this scope declaration bases on. */ - public get node(): VariableDeclaration { - return this._node; + public get node(): VariableDeclaration | undefined { + return this._declaration; } /** * The identifier of this variable. */ public get identifier(): string { - return this.semanticData.identifier; + return this.semanticData?.identifier ?? this._builtInVariable!!.identifier; } /** * The value type of this variable. */ public get type(): ProcessedType { - return this.typeData.valueType; + return this.typeData?.valueType ?? this._builtInVariable!!.valueType; } /** * The storage type of this variable. */ public get storageType(): KipperStorageType { - return this.semanticData.storageType; + return this.semanticData?.storageType ?? "built-in"; } /** * Returns the scope associated with this {@link ScopeDeclaration}. */ - public get scope(): Scope { - return this.semanticData.scope; + public get scope() { + return this.semanticData?.scope ?? this._builtInVariable!!.scope; } /** * Returns whether the variable declaration is defined and has a value set during declaration. */ public get isDefined(): boolean { - return this.semanticData.isDefined; + return this.semanticData?.isDefined ?? true; } /** @@ -94,7 +116,7 @@ export class ScopeVariableDeclaration extends ScopeDeclaration { * @since 0.10.0 */ public get hasValue(): boolean { - return this.isDefined || this.valueWasUpdated; + return this.isDefined ?? this.valueWasUpdated; } /** diff --git a/kipper/core/src/compiler/analysis/symbol-table/function-scope.ts b/kipper/core/src/compiler/semantics/symbol-table/function-scope.ts similarity index 96% rename from kipper/core/src/compiler/analysis/symbol-table/function-scope.ts rename to kipper/core/src/compiler/semantics/symbol-table/function-scope.ts index f68b89a9a..ba46d067e 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/function-scope.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/function-scope.ts @@ -42,7 +42,7 @@ export class FunctionScope extends LocalScope { // Ensuring that the declaration does not overwrite other declarations this.ctx.programCtx.semanticCheck(declaration).identifierNotUsed(identifier, this); - const scopeDeclaration = new ScopeParameterDeclaration(declaration); + const scopeDeclaration = ScopeParameterDeclaration.fromParameterDeclaration(declaration); this.arguments.set(scopeDeclaration.identifier, scopeDeclaration); return scopeDeclaration; } diff --git a/kipper/core/src/compiler/analysis/symbol-table/global-scope.ts b/kipper/core/src/compiler/semantics/symbol-table/global-scope.ts similarity index 64% rename from kipper/core/src/compiler/analysis/symbol-table/global-scope.ts rename to kipper/core/src/compiler/semantics/symbol-table/global-scope.ts index 452f47647..0d83d32f4 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/global-scope.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/global-scope.ts @@ -5,19 +5,19 @@ */ import type { KipperProgramContext } from "../../program-ctx"; import type { ScopeDeclaration } from "./entry"; -import { FunctionDeclaration, TypeDeclaration, VariableDeclaration } from "../../ast"; +import {FunctionDeclaration, RootASTNode, TypeDeclaration, VariableDeclaration} from "../../ast"; import { ScopeFunctionDeclaration, ScopeTypeDeclaration, ScopeVariableDeclaration } from "./entry"; -import {KipperBuiltInTypeLiteral} from "../../const"; -import { Scope } from "./scope"; -import {BuiltInType} from "../types"; +import { Scope } from "./base/scope"; /** * The global scope of a {@link KipperProgramContext}, which contains the global variables and functions of a * Kipper program. * @since 0.8.0 */ -export class GlobalScope extends Scope { - constructor(public programCtx: KipperProgramContext) { +export class GlobalScope extends Scope { + constructor( + public ctx: RootASTNode + ) { super(); } @@ -31,9 +31,9 @@ export class GlobalScope extends Scope { const identifier = declaration.getSemanticData().identifier; // Ensuring that the declaration does not overwrite other declarations - this.programCtx.semanticCheck(declaration).identifierNotUsed(identifier, this.programCtx.globalScope); + this.ctx.programCtx.semanticCheck(declaration).identifierNotUsed(identifier, this); - const scopeDeclaration = new ScopeFunctionDeclaration(declaration); + const scopeDeclaration = ScopeFunctionDeclaration.fromFunctionDeclaration(declaration); this.entries.set(identifier, scopeDeclaration); return scopeDeclaration; } @@ -42,20 +42,16 @@ export class GlobalScope extends Scope { const identifier = declaration.getSemanticData().identifier; // Ensuring that the declaration does not overwrite other declarations - this.programCtx.semanticCheck(declaration).identifierNotUsed(identifier, this.programCtx.globalScope); + this.ctx.programCtx.semanticCheck(declaration).identifierNotUsed(identifier, this); const scopeDeclaration = new ScopeVariableDeclaration(declaration); this.entries.set(identifier, scopeDeclaration); return scopeDeclaration; } - public addType(declaration: TypeDeclaration): ScopeTypeDeclaration; - public addType(identifier: BuiltInType): ScopeTypeDeclaration; - public addType(declarationOrIdentifier: BuiltInType | TypeDeclaration): ScopeTypeDeclaration { + public addType(declarationOrIdentifier: TypeDeclaration): ScopeTypeDeclaration { // Depending on the type of the argument, create either a built-in type or a custom type - const scopeDeclaration = declarationOrIdentifier instanceof TypeDeclaration ? - ScopeTypeDeclaration.fromTypeDeclaration(declarationOrIdentifier) : - ScopeTypeDeclaration.fromBuiltInType(declarationOrIdentifier); + const scopeDeclaration = ScopeTypeDeclaration.fromTypeDeclaration(declarationOrIdentifier) this.entries.set(scopeDeclaration.identifier, scopeDeclaration); return scopeDeclaration; diff --git a/kipper/core/src/compiler/analysis/symbol-table/index.ts b/kipper/core/src/compiler/semantics/symbol-table/index.ts similarity index 80% rename from kipper/core/src/compiler/analysis/symbol-table/index.ts rename to kipper/core/src/compiler/semantics/symbol-table/index.ts index 33d24b650..d730b9d44 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/index.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/index.ts @@ -2,9 +2,9 @@ * Symbol table, which store the information about variables, functions and other declarations. * @since 0.10.0 */ +export * from "./base/"; export * from "./entry/"; -export * from "./scope"; export * from "./global-scope"; export * from "./local-scope"; export * from "./function-scope"; -export * from "./symbol-table"; +export * from "./universum-scope"; diff --git a/kipper/core/src/compiler/analysis/symbol-table/local-scope.ts b/kipper/core/src/compiler/semantics/symbol-table/local-scope.ts similarity index 87% rename from kipper/core/src/compiler/analysis/symbol-table/local-scope.ts rename to kipper/core/src/compiler/semantics/symbol-table/local-scope.ts index dba57d4d6..a52a75852 100644 --- a/kipper/core/src/compiler/analysis/symbol-table/local-scope.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/local-scope.ts @@ -3,19 +3,19 @@ * namespace. * @since 0.8.0 */ -import type { FunctionDeclaration, ScopeNode, TypeDeclaration, VariableDeclaration } from "../../ast/"; +import {CompilableASTNode, FunctionDeclaration, ScopeNode, TypeDeclaration, VariableDeclaration} from "../../ast/"; import type { GlobalScope } from "./global-scope"; import { KipperNotImplementedError } from "../../../errors"; import type { ScopeDeclaration, ScopeFunctionDeclaration, ScopeTypeDeclaration } from "./entry"; import { ScopeVariableDeclaration } from "./entry"; -import { Scope } from "./scope"; +import { Scope } from "./base/scope"; /** * A scope that is bound to a {@link CompoundStatement} and not the global namespace. * @since 0.8.0 */ -export class LocalScope extends Scope { - constructor(public ctx: ScopeNode) { +export class LocalScope extends Scope { + constructor(public ctx: ScopeNode & CompilableASTNode) { super(); } diff --git a/kipper/core/src/compiler/semantics/symbol-table/universum-scope.ts b/kipper/core/src/compiler/semantics/symbol-table/universum-scope.ts new file mode 100644 index 000000000..e15aff8e3 --- /dev/null +++ b/kipper/core/src/compiler/semantics/symbol-table/universum-scope.ts @@ -0,0 +1,144 @@ +import {Scope} from "./base"; +import {ScopeDeclaration, ScopeFunctionDeclaration, ScopeTypeDeclaration, ScopeVariableDeclaration} from "./entry"; +import {BuiltInType} from "../types"; +import {KipperProgramContext} from "../../program-ctx"; +import {BuiltInFunction, BuiltInVariable} from "../runtime-built-ins"; +import {KipperBuiltInTypeLiteral} from "../../const"; + +/** + * Contains all the built-in types that are used in the type analysis phase. + * @since 0.11.0 + */ +export const BuiltInTypes = { + type: new BuiltInType("type"), + undefined: new BuiltInType("undefined"), + void: new BuiltInType("void"), + null: new BuiltInType("null"), + bool: new BuiltInType("bool"), + num: new BuiltInType("num"), + str: new BuiltInType("str"), + func: new BuiltInType("func"), + list: new BuiltInType("list"), +} satisfies Record; + +/** + * Contains all the built-in functions in Kipper that are available per default in every program. + */ +export const BuiltInFunctions = { + print: new BuiltInFunction( + "print", + [ + { + identifier: "msg", + valueType: BuiltInTypes.str, + }, + ], + BuiltInTypes.void + ), + len: new BuiltInFunction( + "len", + [ + { + identifier: "arrayLike", + // TODO: Implement this for all arrayLike types (At the moment only strings are supported) + valueType: BuiltInTypes.str, + }, + ], + BuiltInTypes.num + ), +} satisfies Record; + +/** + * Contains all the built-in variables in Kipper that are available per default in every program. + * @since 0.10.0 + */ +export const BuiltInVariables = { + __name__: new BuiltInVariable( + "__name__", + BuiltInTypes.str, + true + ), +} satisfies Record; + +/** + * The universal scope which only defines built-ins and is not bound to any specific context. + * @since 0.11.0 + */ +export class UniverseScope extends Scope { + public readonly parent: undefined; + public constructor(public ctx: KipperProgramContext) { + super(); + } + + /** + * Initializes the universal scope by adding all built-in types, functions and variables. + * @since 0.11.0 + */ + public init(): void { + for (const type of Object.values(BuiltInTypes)) { + this.addType(type); + } + for (const variable of Object.values(BuiltInVariables)) { + this.addVariable(variable); + } + for (const func of Object.values(BuiltInFunctions)) { + this.addFunction(func); + } + } + + /** + * Adds a built-in variable to the universal scope. + * @param declaration The built-in variable to add. + * @returns The scope declaration of the added variable. + * @since 0.11.0 + */ + public addVariable(declaration: BuiltInVariable): ScopeVariableDeclaration { + const scopeDeclaration = ScopeVariableDeclaration.fromBuiltInVariable(declaration) + this.entries.set(scopeDeclaration.identifier, scopeDeclaration); + return scopeDeclaration; + } + + /** + * Adds a built-in function to the universal scope. + * @param declaration The built-in function to add. + * @returns The scope declaration of the added function. + * @since 0.11.0 + */ + public addFunction(declaration: BuiltInFunction): ScopeFunctionDeclaration { + const scopeDeclaration = ScopeFunctionDeclaration.fromBuiltInFunction(declaration) + this.entries.set(scopeDeclaration.identifier, scopeDeclaration); + return scopeDeclaration; + } + + /** + * Adds a built-in type to the universal scope. + * @param declarationOrIdentifier The built-in type to add. + * @returns The scope declaration of the added type. + * @since 0.11.0 + */ + public addType(declarationOrIdentifier: BuiltInType): ScopeTypeDeclaration { + const scopeDeclaration = ScopeTypeDeclaration.fromBuiltInType(declarationOrIdentifier) + this.entries.set(scopeDeclaration.identifier, scopeDeclaration); + return scopeDeclaration; + } + + /** + * Retrieves a scope declaration from the universal scope. + * @param identifier The identifier of the declaration to retrieve. + * @returns The scope declaration if it exists, otherwise `undefined`. + * @since 0.11.0 + */ + getEntry(identifier: string): ScopeDeclaration | undefined { + return this.entries.get(identifier); + } + + /** + * Retrieves a scope declaration from the universal scope recursively. + * @param identifier The identifier of the declaration to retrieve. + * @returns The scope declaration if it exists, otherwise `undefined`. + * @since 0.11.0 + */ + getEntryRecursively(identifier: string): ScopeDeclaration | undefined { + return this.getEntry(identifier); + } +} diff --git a/kipper/core/src/compiler/analysis/types/base/compilable-type.ts b/kipper/core/src/compiler/semantics/types/base/compilable-type.ts similarity index 100% rename from kipper/core/src/compiler/analysis/types/base/compilable-type.ts rename to kipper/core/src/compiler/semantics/types/base/compilable-type.ts diff --git a/kipper/core/src/compiler/analysis/types/base/index.ts b/kipper/core/src/compiler/semantics/types/base/index.ts similarity index 100% rename from kipper/core/src/compiler/analysis/types/base/index.ts rename to kipper/core/src/compiler/semantics/types/base/index.ts diff --git a/kipper/core/src/compiler/analysis/types/base/processed-type.ts b/kipper/core/src/compiler/semantics/types/base/processed-type.ts similarity index 87% rename from kipper/core/src/compiler/analysis/types/base/processed-type.ts rename to kipper/core/src/compiler/semantics/types/base/processed-type.ts index b45598b52..7bb384ef7 100644 --- a/kipper/core/src/compiler/analysis/types/base/processed-type.ts +++ b/kipper/core/src/compiler/semantics/types/base/processed-type.ts @@ -15,15 +15,6 @@ export abstract class ProcessedType extends Type { this._isCompilable = isCompilable; } - /** - * Gets the actual type stored in this class, which may be undefined if the type doesn't exist ({@link isCompilable} - * is false). - * @since 0.11.0 - */ - public get(): string | undefined { - return this.isCompilable ? this.identifier : undefined; - } - /** * The identifier of this type. */ diff --git a/kipper/core/src/compiler/analysis/types/base/type.ts b/kipper/core/src/compiler/semantics/types/base/type.ts similarity index 100% rename from kipper/core/src/compiler/analysis/types/base/type.ts rename to kipper/core/src/compiler/semantics/types/base/type.ts diff --git a/kipper/core/src/compiler/analysis/types/built-in-type.ts b/kipper/core/src/compiler/semantics/types/built-in-type.ts similarity index 70% rename from kipper/core/src/compiler/analysis/types/built-in-type.ts rename to kipper/core/src/compiler/semantics/types/built-in-type.ts index bbb959c13..98cb53164 100644 --- a/kipper/core/src/compiler/analysis/types/built-in-type.ts +++ b/kipper/core/src/compiler/semantics/types/built-in-type.ts @@ -37,18 +37,3 @@ export class BuiltInType extends ProcessedType implements CompilableType { } } -/** - * A map of all built-in types that are used in the type analysis phase. - * @since 0.11.0 - */ -export const BuiltInTypes = { - type: new BuiltInType("type"), - undefined: new BuiltInType("undefined"), - void: new BuiltInType("void"), - null: new BuiltInType("null"), - bool: new BuiltInType("bool"), - num: new BuiltInType("num"), - str: new BuiltInType("str"), - func: new BuiltInType("func"), - list: new BuiltInType("list"), -} satisfies Record; diff --git a/kipper/core/src/compiler/analysis/types/custom-type.ts b/kipper/core/src/compiler/semantics/types/custom-type.ts similarity index 100% rename from kipper/core/src/compiler/analysis/types/custom-type.ts rename to kipper/core/src/compiler/semantics/types/custom-type.ts diff --git a/kipper/core/src/compiler/analysis/types/index.ts b/kipper/core/src/compiler/semantics/types/index.ts similarity index 100% rename from kipper/core/src/compiler/analysis/types/index.ts rename to kipper/core/src/compiler/semantics/types/index.ts diff --git a/kipper/core/src/compiler/analysis/types/raw-type.ts b/kipper/core/src/compiler/semantics/types/raw-type.ts similarity index 100% rename from kipper/core/src/compiler/analysis/types/raw-type.ts rename to kipper/core/src/compiler/semantics/types/raw-type.ts diff --git a/kipper/core/src/compiler/analysis/types/undefined-type.ts b/kipper/core/src/compiler/semantics/types/undefined-type.ts similarity index 100% rename from kipper/core/src/compiler/analysis/types/undefined-type.ts rename to kipper/core/src/compiler/semantics/types/undefined-type.ts diff --git a/kipper/core/src/compiler/target-presets/semantic-analyser.ts b/kipper/core/src/compiler/target-presets/semantic-analyser.ts index 395dbe7f7..a5ca1b0dd 100644 --- a/kipper/core/src/compiler/target-presets/semantic-analyser.ts +++ b/kipper/core/src/compiler/target-presets/semantic-analyser.ts @@ -52,7 +52,7 @@ import type { VoidOrNullOrUndefinedPrimaryExpression, WhileLoopIterationStatement, } from "../ast"; -import { KipperSemanticErrorHandler } from "../analysis"; +import { KipperSemanticErrorHandler } from "../semantics"; import type { ObjectProperty } from "../ast/nodes/expressions/primary-expression/object-primary-expression/object-property/object-property"; /** diff --git a/kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts b/kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts index cc5f13170..1a3274c86 100644 --- a/kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts +++ b/kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts @@ -3,7 +3,7 @@ * @since 0.10.0 */ import type { TranslatedCodeLine } from "../../const"; -import type { BuiltInFunction, BuiltInVariable, InternalFunction } from "../../runtime-built-ins"; +import type { BuiltInFunction, BuiltInVariable, InternalFunction } from "../../semantics/runtime-built-ins"; import type { KipperProgramContext } from "../../program-ctx"; /** diff --git a/test/module/core/ast-node.test.ts b/test/module/core/ast-node.test.ts index 670a40095..1fd46e0a7 100644 --- a/test/module/core/ast-node.test.ts +++ b/test/module/core/ast-node.test.ts @@ -77,7 +77,7 @@ describe("AST Nodes", () => { const result = await new KipperCompiler().compile("var valid: str = '1';", { target: defaultTarget }); assert.isDefined(result.programCtx); - const ast = result.programCtx!!.abstractSyntaxTree; + const ast = result.programCtx!!.rootASTNode; assert.notEqual(ast, undefined, "Expected AST to be present"); assert.equal(ast.children.length, 1, "Expected 1 child for RootASTNode"); @@ -88,7 +88,7 @@ describe("AST Nodes", () => { const result = await new KipperCompiler().compile("var invalid: str = 1;", { target: defaultTarget }); assert.isDefined(result.programCtx); - const ast = result.programCtx!!.abstractSyntaxTree; + const ast = result.programCtx!!.rootASTNode; assert.notEqual(ast, undefined, "Expected AST to be present"); assert.equal(ast.children.length, 1, "Expected 1 child for RootASTNode"); @@ -103,7 +103,7 @@ describe("AST Nodes", () => { const result = await new KipperCompiler().compile("", { target: defaultTarget }); assert.isDefined(result.programCtx); - const ast = result.programCtx!!.abstractSyntaxTree; + const ast = result.programCtx!!.rootASTNode; assert.notEqual(ast, undefined, "Expected AST to be present"); assert.equal(ast.sourceCode, "", "Expected source code to be empty"); @@ -114,7 +114,7 @@ describe("AST Nodes", () => { const result = await new KipperCompiler().compile(sourceCode, { target: defaultTarget }); assert.isDefined(result.programCtx); - const ast = result.programCtx!!.abstractSyntaxTree; + const ast = result.programCtx!!.rootASTNode; assert.notEqual(ast, undefined, "Expected AST to be present"); assert.equal(ast.sourceCode, sourceCode, "Expected source code to match"); @@ -126,7 +126,7 @@ describe("AST Nodes", () => { const result = await new KipperCompiler().compile("var valid: str = '1';", { target: defaultTarget }); assert.isDefined(result.programCtx); - const ast = result.programCtx!!.abstractSyntaxTree; + const ast = result.programCtx!!.rootASTNode; assert.notEqual(ast, undefined, "Expected AST to be present"); assert.equal(ast.hasFailed, false, "Expected 'hasFailed' to be false"); @@ -136,7 +136,7 @@ describe("AST Nodes", () => { const result = await new KipperCompiler().compile("var invalid: str = 1;", { target: defaultTarget }); assert.isDefined(result.programCtx); - const ast = result.programCtx!!.abstractSyntaxTree; + const ast = result.programCtx!!.rootASTNode; assert.notEqual(ast, undefined, "Expected AST to be present"); assert.isTrue(ast.hasFailed, "Expected 'hasFailed' to be false"); @@ -148,7 +148,7 @@ describe("AST Nodes", () => { const result = await new KipperCompiler().compile("", { target: defaultTarget }); assert.isDefined(result.programCtx); - const ast = result.programCtx!!.abstractSyntaxTree; + const ast = result.programCtx!!.rootASTNode; assert.notEqual(ast, undefined, "Expected AST to be present"); assert.equal(ast.children.length, 0, "Expected 0 children"); @@ -161,7 +161,7 @@ describe("AST Nodes", () => { { target: defaultTarget }, ); assert.isDefined(result.programCtx); - const ast = result.programCtx!!.abstractSyntaxTree; + const ast = result.programCtx!!.rootASTNode; assert.notEqual(ast, undefined, "Expected AST to be present"); assert.equal(ast.children.length, 1, "Expected 1 child"); @@ -174,7 +174,7 @@ describe("AST Nodes", () => { { target: defaultTarget }, ); assert.isDefined(result.programCtx); - const ast = result.programCtx!!.abstractSyntaxTree; + const ast = result.programCtx!!.rootASTNode; assert.notEqual(ast, undefined, "Expected AST to be present"); assert.equal(ast.children.length, 3, "Expected 2 children"); @@ -191,10 +191,10 @@ describe("AST Nodes", () => { // Generate the AST by compiling the program (as 'generateAbstractSyntaxTree' is private) await programCtx.compileProgram(); - const ast = programCtx.abstractSyntaxTree; + const ast = programCtx.rootASTNode; assert.notEqual(programCtx, undefined, "Expected programCtx to be present"); - assert.notEqual(programCtx.abstractSyntaxTree, undefined, "Expected AST to be present"); + assert.notEqual(programCtx.rootASTNode, undefined, "Expected AST to be present"); assert.equal(ast.programCtx, programCtx, "Expected programCtx to match"); }); @@ -208,10 +208,10 @@ describe("AST Nodes", () => { // Generate the AST by compiling the program (as 'generateAbstractSyntaxTree' is private) await programCtx.compileProgram(); - const ast = programCtx.abstractSyntaxTree; + const ast = programCtx.rootASTNode; assert.notEqual(programCtx, undefined, "Expected programCtx to be present"); - assert.notEqual(programCtx.abstractSyntaxTree, undefined, "Expected AST to be present"); + assert.notEqual(programCtx.rootASTNode, undefined, "Expected AST to be present"); assert.equal(ast.parent, undefined, "Expected parent to be undefined"); }); }); diff --git a/test/module/core/compiler.test.ts b/test/module/core/compiler.test.ts index 4a140d13a..78b39c1f2 100644 --- a/test/module/core/compiler.test.ts +++ b/test/module/core/compiler.test.ts @@ -294,7 +294,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.globalScope.entries.size, 4, "Expected four global scope entries"); + assert.equal(result.programCtx!!.universeScope.entries.size, 4, "Expected four global scope entries"); }); it(`Arithmetics [${target.fileExtension}]`, async () => { @@ -304,7 +304,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.globalScope.entries.size, 0, "Expected no global scope entries"); + assert.equal(result.programCtx!!.universeScope.entries.size, 0, "Expected no global scope entries"); assert.include(result.write(), fileContent, "Expected compiled code to not change"); }); @@ -315,7 +315,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.globalScope.entries.size, 1, "Expected one global scope entry"); + assert.equal(result.programCtx!!.universeScope.entries.size, 1, "Expected one global scope entry"); }); it(`Nested scopes [${target.fileExtension}]`, async () => { @@ -325,7 +325,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.globalScope.entries.size, 4, "Expected four global scope entries"); + assert.equal(result.programCtx!!.universeScope.entries.size, 4, "Expected four global scope entries"); }); it(`Single Function call [${target.fileExtension}]`, async () => { @@ -335,7 +335,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.globalScope.entries.size, 0, "Expected no global scope entries"); + assert.equal(result.programCtx!!.universeScope.entries.size, 0, "Expected no global scope entries"); // Compile the program to JavaScript and evaluate it const jsCode = ts.transpile(result.write()); @@ -360,7 +360,7 @@ describe("KipperCompiler", () => { assert(result.programCtx); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.globalScope.entries.size, 0, "Expected no global scope entries"); + assert.equal(result.programCtx!!.universeScope.entries.size, 0, "Expected no global scope entries"); // Compile the program to JavaScript and evaluate it const jsCode = ts.transpile(result.write()); @@ -377,7 +377,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.globalScope.entries.size, 1, "Expected one global scope entry"); + assert.equal(result.programCtx!!.universeScope.entries.size, 1, "Expected one global scope entry"); }); it(`Multi Function definition [${target.fileExtension}]`, async () => { @@ -387,7 +387,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.globalScope.entries.size, 3, "Expected three global scope entries"); + assert.equal(result.programCtx!!.universeScope.entries.size, 3, "Expected three global scope entries"); }); it(`Function call argument [${target.fileExtension}]`, async () => { @@ -397,7 +397,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.globalScope.entries.size, 0, "Expected no global scope entries"); + assert.equal(result.programCtx!!.universeScope.entries.size, 0, "Expected no global scope entries"); // Compile the program to JavaScript and evaluate it const jsCode = ts.transpile(result.write()); @@ -414,7 +414,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.globalScope.entries.size, 1, "Expected one global scope entry"); + assert.equal(result.programCtx!!.universeScope.entries.size, 1, "Expected one global scope entry"); // Compile the program to JavaScript and evaluate it const jsCode = ts.transpile(result.write()); @@ -430,7 +430,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.globalScope.entries.size, 1, "Expected one global scope entry"); + assert.equal(result.programCtx!!.universeScope.entries.size, 1, "Expected one global scope entry"); }); it(`Bool [${target.fileExtension}]`, async () => { @@ -440,7 +440,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.globalScope.entries.size, 2, "Expected two global scope entries"); + assert.equal(result.programCtx!!.universeScope.entries.size, 2, "Expected two global scope entries"); }); it(`Type conversion [${target.fileExtension}]`, async () => { @@ -450,7 +450,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.globalScope.entries.size, 4, "Expected four global scope entries"); + assert.equal(result.programCtx!!.universeScope.entries.size, 4, "Expected four global scope entries"); const code = result.write(); assert(code); @@ -467,7 +467,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.globalScope.entries.size, 3, "Expected three global scope entries"); + assert.equal(result.programCtx!!.universeScope.entries.size, 3, "Expected three global scope entries"); const code = result.write(); assert(code); @@ -482,7 +482,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.globalScope.entries.size, 0, "Expected no global scope entries"); + assert.equal(result.programCtx!!.universeScope.entries.size, 0, "Expected no global scope entries"); // Compile the program to JavaScript and evaluate it const jsCode = ts.transpile(result.write()); @@ -498,7 +498,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.globalScope.entries.size, 0, "Expected no global scope entries"); + assert.equal(result.programCtx!!.universeScope.entries.size, 0, "Expected no global scope entries"); const code = result.write(); assert(code); diff --git a/test/module/core/errors/index.ts b/test/module/core/errors/index.ts index 3ab5336a6..7c9ef95ee 100644 --- a/test/module/core/errors/index.ts +++ b/test/module/core/errors/index.ts @@ -19,7 +19,7 @@ export function ensureTracebackDataExists(e: KipperError): void { export function ensureErrorWasReported(programCtx?: KipperProgramContext): void { if (programCtx) { assert(programCtx.hasFailed, "Expected program to have failed"); - assert(programCtx.abstractSyntaxTree?.hasFailed, "Expected AST root-node to have failed"); + assert(programCtx.rootASTNode?.hasFailed, "Expected AST root-node to have failed"); } } diff --git a/test/module/core/global-scope.test.ts b/test/module/core/global-scope.test.ts index bae4f6bd0..9d1dfd554 100644 --- a/test/module/core/global-scope.test.ts +++ b/test/module/core/global-scope.test.ts @@ -10,7 +10,7 @@ describe("GlobalScope", () => { it("should have an empty hash map", async () => { const compileResult = await new KipperCompiler().compile("", { target: defaultTarget }); assert.isDefined(compileResult.programCtx); - const scope = compileResult.programCtx!!.globalScope; + const scope = compileResult.programCtx!!.universeScope; assert.equal(scope.entries.size, 0); }); }); @@ -19,7 +19,7 @@ describe("GlobalScope", () => { it("one", async () => { const compileResult = await new KipperCompiler().compile("var test: num = 5;", { target: defaultTarget }); assert.isDefined(compileResult.programCtx); - const scope = compileResult.programCtx!!.globalScope; + const scope = compileResult.programCtx!!.universeScope; // Should have one variable assert.equal(scope.entries.size, 1); @@ -42,7 +42,7 @@ describe("GlobalScope", () => { target: defaultTarget, }); assert.isDefined(compileResult.programCtx); - const scope = compileResult.programCtx!!.globalScope; + const scope = compileResult.programCtx!!.universeScope; // Should have two variables assert.equal(scope.entries.size, 2); @@ -78,7 +78,7 @@ describe("GlobalScope", () => { { target: defaultTarget }, ); assert.isDefined(compileResult.programCtx); - const scope = compileResult.programCtx!!.globalScope; + const scope = compileResult.programCtx!!.universeScope; // Should have three variables assert.equal(scope.entries.size, 3); @@ -126,7 +126,7 @@ describe("GlobalScope", () => { target: defaultTarget, }); assert.isDefined(compileResult.programCtx); - const scope = compileResult.programCtx!!.globalScope; + const scope = compileResult.programCtx!!.universeScope; // Should have one function assert.equal(scope.entries.size, 1); @@ -151,7 +151,7 @@ describe("GlobalScope", () => { { target: defaultTarget }, ); assert.isDefined(compileResult.programCtx); - const scope = compileResult.programCtx!!.globalScope; + const scope = compileResult.programCtx!!.universeScope; // Should have two functions assert.equal(scope.entries.size, 2); @@ -189,7 +189,7 @@ describe("GlobalScope", () => { { target: defaultTarget }, ); assert.isDefined(compileResult.programCtx); - const scope = compileResult.programCtx!!.globalScope; + const scope = compileResult.programCtx!!.universeScope; // Should have three functions assert.equal(scope.entries.size, 3); From e921e100ceb84f2217bc15d4e1cd97b3b0124cd4 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Mon, 8 Jul 2024 18:22:26 +0200 Subject: [PATCH 19/57] other: Prettified project --- CHANGELOG.md | 4 +- .../type-declaration-semantics.ts | 2 +- .../type-declaration-type-semantics.ts | 2 +- .../identifier-primary-expression.ts | 10 +- .../src/compiler/ast/nodes/root-ast-node.ts | 24 +- kipper/core/src/compiler/ast/scope-node.ts | 2 +- kipper/core/src/compiler/const.ts | 6 +- .../lexer-parser/antlr/KipperLexer.ts | 469 +- .../lexer-parser/antlr/KipperParser.ts | 5551 ++++++++++------- .../antlr/KipperParserListener.ts | 12 +- .../lexer-parser/antlr/KipperParserVisitor.ts | 12 +- kipper/core/src/compiler/program-ctx.ts | 35 +- .../semantics/analyser/semantic-checker.ts | 7 +- .../semantics/analyser/type-checker.ts | 16 +- .../core/src/compiler/semantics/reference.ts | 2 +- .../built-in-function-argument.ts | 11 +- .../runtime-built-ins/built-in-function.ts | 10 +- .../runtime-built-ins/built-in-variable.ts | 12 +- .../internal-function-argument.ts | 4 +- .../runtime-internals/internal-function.ts | 6 +- .../semantics/runtime-internals/internals.ts | 2 +- .../semantics/symbol-table/base/scope.ts | 8 +- .../entry/scope-function-declaration.ts | 11 +- .../entry/scope-parameter-declaration.ts | 5 +- .../entry/scope-type-declaration.ts | 12 +- .../entry/scope-variable-declaration.ts | 11 +- .../semantics/symbol-table/global-scope.ts | 8 +- .../semantics/symbol-table/local-scope.ts | 8 +- .../semantics/symbol-table/universum-scope.ts | 29 +- .../compiler/semantics/types/built-in-type.ts | 10 +- .../compiler/semantics/types/custom-type.ts | 7 +- test/module/core/pragma.test.ts | 4 +- 32 files changed, 3668 insertions(+), 2644 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 807e0b190..d17bf9edb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,9 +65,9 @@ To use development versions of Kipper download the - `ClassDeclaration`, which represents an AST class declaration. - `BuiltInType`, which represents a built-in type. - `CustomType`, which represents a user defined type. - - `PragmaProcessor` which handles the processing of all possible Pragmas. + - `PragmaProcessor` which handles the processing of all possible Pragmas. - New errors: - - `TypeCanNotBeUsedForTypeCheckingError`, which is thrown when a type is used for type checking, but is not a valid + - `TypeCanNotBeUsedForTypeCheckingError`, which is thrown when a type is used for type checking, but is not a valid type. This is an error indicating an invalid logic that should be fixed. - New interfaces: - `PrimaryExpressionSemantics`, which represents the semantics of a primary expression. diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts index 7476f7f5f..a57d7ed5f 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts @@ -1,5 +1,5 @@ import type { SemanticData } from "../../../ast-node"; -import {ProcessedType} from "../../../../semantics"; +import { ProcessedType } from "../../../../semantics"; /** * Semantics for a {@link TypeDeclaration}. 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 7c8f0b689..928e1899d 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,5 @@ import type { TypeData } from "../../../ast-node"; -import {CustomType} from "../../../../semantics"; +import type { CustomType } from "../../../../semantics"; /** * Type semantics for a {@link TypeDeclaration}. 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 a077f595d..f8b22b80c 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 @@ -9,7 +9,8 @@ import type { IdentifierPrimaryExpressionTypeSemantics } from "./identifier-prim import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { IdentifierPrimaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import {BuiltInTypes, ProcessedType, ScopeDeclaration} from "../../../../../semantics"; +import type { ProcessedType } from "../../../../../semantics"; +import { BuiltInTypes, ScopeDeclaration } from "../../../../../semantics"; import { AssignmentExpression } from "../../assignment-expression/assignment-expression"; import { PrimaryExpression } from "../primary-expression"; @@ -82,12 +83,7 @@ export class IdentifierPrimaryExpression extends PrimaryExpression< const identifier = this.sourceCode; // Make sure the referenced variable even exists! - const ref = this.programCtx - .semanticCheck(this) - .getExistingReference( - identifier, - this.scope - ); + const ref = this.programCtx.semanticCheck(this).getExistingReference(identifier, this.scope); // Once we have the identifier and ensured a reference exists, we are done with the primary semantic analysis. this.semanticData = { diff --git a/kipper/core/src/compiler/ast/nodes/root-ast-node.ts b/kipper/core/src/compiler/ast/nodes/root-ast-node.ts index 07a9333f4..7b030e2ac 100644 --- a/kipper/core/src/compiler/ast/nodes/root-ast-node.ts +++ b/kipper/core/src/compiler/ast/nodes/root-ast-node.ts @@ -13,24 +13,22 @@ import type { TargetSetUpCodeGenerator, TargetWrapUpCodeGenerator, } from "../../target-presets"; -import type {EvaluatedCompileConfig} from "../../compile-config"; -import type {KipperProgramContext} from "../../program-ctx"; -import type {Declaration} from "./declarations"; -import type {Statement} from "./index"; -import type {TranslatedCodeLine} from "../../const"; -import type {KipperError} from "../../../errors"; -import type {CompilationUnitContext} from "../../lexer-parser"; -import {KindParseRuleMapping, ParseRuleKindMapping} from "../../lexer-parser"; -import {FunctionScope, GlobalScope, handleSemanticError} from "../../semantics"; -import {ScopeNode} from "../scope-node"; +import type { EvaluatedCompileConfig } from "../../compile-config"; +import type { KipperProgramContext } from "../../program-ctx"; +import type { Declaration } from "./declarations"; +import type { Statement } from "./index"; +import type { TranslatedCodeLine } from "../../const"; +import type { KipperError } from "../../../errors"; +import type { CompilationUnitContext } from "../../lexer-parser"; +import { KindParseRuleMapping, ParseRuleKindMapping } from "../../lexer-parser"; +import { FunctionScope, GlobalScope, handleSemanticError } from "../../semantics"; +import type { ScopeNode } from "../scope-node"; /** * The root node of an abstract syntax tree, which contains all AST nodes of a file. * @since 0.8.0 */ -export class RootASTNode - extends ParserASTNode - implements ScopeNode { +export class RootASTNode extends ParserASTNode implements ScopeNode { protected readonly _antlrRuleCtx: CompilationUnitContext; protected readonly _programCtx: KipperProgramContext; protected readonly _parent: undefined; diff --git a/kipper/core/src/compiler/ast/scope-node.ts b/kipper/core/src/compiler/ast/scope-node.ts index 2854db95b..7326d93b6 100644 --- a/kipper/core/src/compiler/ast/scope-node.ts +++ b/kipper/core/src/compiler/ast/scope-node.ts @@ -8,7 +8,7 @@ import type { Scope } from "../semantics"; import type { CompilableASTNode } from "./compilable-ast-node"; import type { TargetASTNodeCodeGenerator, TargetASTNodeSemanticAnalyser } from "../target-presets"; import type { TranslatedCodeLine } from "../const"; -import {ParserASTNode, SemanticData, TypeData} from "./ast-node"; +import type { ParserASTNode, SemanticData, TypeData } from "./ast-node"; /** * Scope-node interface, which represents an {@link ParserASTNode} that supports being used as the parent of a diff --git a/kipper/core/src/compiler/const.ts b/kipper/core/src/compiler/const.ts index 4e1665594..8eb65e889 100644 --- a/kipper/core/src/compiler/const.ts +++ b/kipper/core/src/compiler/const.ts @@ -190,7 +190,11 @@ export const kipperPrimitiveTypeLiterals: Array = [ * only used for error handling/recovery and skips type checking altogether. * @since 0.10.0 */ -export type KipperBuiltInTypeLiteral = KipperMetaTypeLiteral | KipperPrimitiveTypeLiteral | KipperFuncTypeLiteral | KipperListTypeLiteral; +export type KipperBuiltInTypeLiteral = + | KipperMetaTypeLiteral + | KipperPrimitiveTypeLiteral + | KipperFuncTypeLiteral + | KipperListTypeLiteral; /** * All compilable and valid base types inside Kipper. diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperLexer.ts b/kipper/core/src/compiler/lexer-parser/antlr/KipperLexer.ts index dceb3a35c..23ebd64be 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperLexer.ts +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperLexer.ts @@ -1,8 +1,6 @@ // Generated from ./KipperLexer.g4 by ANTLR 4.9.0-SNAPSHOT - - import KipperLexerBase from "./base/KipperLexerBase"; - +import KipperLexerBase from "./base/KipperLexerBase"; import { ATN } from "antlr4ts/atn/ATN"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; @@ -17,7 +15,6 @@ import { VocabularyImpl } from "antlr4ts/VocabularyImpl"; import * as Utils from "antlr4ts/misc/Utils"; - export class KipperLexer extends KipperLexerBase { public static readonly FStringExpStart = 1; public static readonly BlockComment = 2; @@ -111,70 +108,302 @@ export class KipperLexer extends KipperLexerBase { public static readonly DOUBLE_QUOTE_FSTRING = 2; // tslint:disable:no-trailing-whitespace - public static readonly channelNames: string[] = [ - "DEFAULT_TOKEN_CHANNEL", "HIDDEN", "COMMENT", "PRAGMA", - ]; + public static readonly channelNames: string[] = ["DEFAULT_TOKEN_CHANNEL", "HIDDEN", "COMMENT", "PRAGMA"]; // tslint:disable:no-trailing-whitespace - public static readonly modeNames: string[] = [ - "DEFAULT_MODE", "SINGLE_QUOTE_FSTRING", "DOUBLE_QUOTE_FSTRING", - ]; + public static readonly modeNames: string[] = ["DEFAULT_MODE", "SINGLE_QUOTE_FSTRING", "DOUBLE_QUOTE_FSTRING"]; public static readonly ruleNames: string[] = [ - "BlockComment", "LineComment", "Pragma", "Const", "Var", "As", "Spread", - "Switch", "Case", "Default", "Break", "Continue", "Do", "While", "If", - "Else", "For", "Enum", "DefFunc", "Return", "CallFunc", "RetIndicator", - "Class", "Interface", "True", "False", "Typeof", "Void", "Null", "Undefined", - "Comma", "SemiColon", "QuestionMark", "Colon", "LeftParen", "RightParen", - "LeftBracket", "RightBracket", "FStringExpEnd", "LeftBrace", "RightBrace", - "Plus", "PlusPlus", "Minus", "MinusMinus", "Star", "Div", "Mod", "PowerTo", - "AndAnd", "OrOr", "Not", "Assign", "PlusAssign", "MinusAssign", "StarAssign", - "DivAssign", "ModAssign", "Equal", "NotEqual", "Less", "LessEqual", "Greater", - "GreaterEqual", "BitwiseAnd", "BitwiseOr", "BitwiseXor", "BitwiseNot", - "BitwiseZeroFillLeftShift", "BitwiseSignedRightShift", "BitwiseZeroFillRightShift", - "Dot", "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", "DoubleQuoteStringLiteral", - "FloatingConstant", "Whitespace", "Newline", "FStringSingleQuoteStart", - "FStringDoubleQuoteStart", "FStringSingleQuoteExpStart", "FStringSingleQuoteEnd", - "FStringSingleQuoteAtom", "FStringDoubleQuoteExpStart", "FStringDoubleQuoteEnd", - "FStringDoubleQuoteAtom", "IdentifierNondigit", "Nondigit", "Digit", "DecimalConstant", - "BinaryConstant", "OctalConstant", "HexadecimalConstant", "NonzeroDigit", - "BinaryDigit", "OctalDigit", "HexadecimalDigit", "DecimalFloatingConstant", - "FractionalConstant", "ExponentPart", "DigitSequence", "Sign", "CCharSequence", - "CChar", "EscapeSequence", "SimpleEscapeSequence", "OctalEscapeSequence", - "HexadecimalEscapeSequence", "SingleQuoteFStringSCharSequence", "SingleQuoteFStringSChar", - "DoubleQuoteFStringSCharSequence", "DoubleQuoteFStringSChar", "SingleQuoteSCharSequence", - "SingleQuoteSChar", "DoubleQuoteSCharSequence", "DoubleQuoteSChar", "CommentContent", + "BlockComment", + "LineComment", + "Pragma", + "Const", + "Var", + "As", + "Spread", + "Switch", + "Case", + "Default", + "Break", + "Continue", + "Do", + "While", + "If", + "Else", + "For", + "Enum", + "DefFunc", + "Return", + "CallFunc", + "RetIndicator", + "Class", + "Interface", + "True", + "False", + "Typeof", + "Void", + "Null", + "Undefined", + "Comma", + "SemiColon", + "QuestionMark", + "Colon", + "LeftParen", + "RightParen", + "LeftBracket", + "RightBracket", + "FStringExpEnd", + "LeftBrace", + "RightBrace", + "Plus", + "PlusPlus", + "Minus", + "MinusMinus", + "Star", + "Div", + "Mod", + "PowerTo", + "AndAnd", + "OrOr", + "Not", + "Assign", + "PlusAssign", + "MinusAssign", + "StarAssign", + "DivAssign", + "ModAssign", + "Equal", + "NotEqual", + "Less", + "LessEqual", + "Greater", + "GreaterEqual", + "BitwiseAnd", + "BitwiseOr", + "BitwiseXor", + "BitwiseNot", + "BitwiseZeroFillLeftShift", + "BitwiseSignedRightShift", + "BitwiseZeroFillRightShift", + "Dot", + "Identifier", + "IntegerConstant", + "SingleQuoteStringLiteral", + "DoubleQuoteStringLiteral", + "FloatingConstant", + "Whitespace", + "Newline", + "FStringSingleQuoteStart", + "FStringDoubleQuoteStart", + "FStringSingleQuoteExpStart", + "FStringSingleQuoteEnd", + "FStringSingleQuoteAtom", + "FStringDoubleQuoteExpStart", + "FStringDoubleQuoteEnd", + "FStringDoubleQuoteAtom", + "IdentifierNondigit", + "Nondigit", + "Digit", + "DecimalConstant", + "BinaryConstant", + "OctalConstant", + "HexadecimalConstant", + "NonzeroDigit", + "BinaryDigit", + "OctalDigit", + "HexadecimalDigit", + "DecimalFloatingConstant", + "FractionalConstant", + "ExponentPart", + "DigitSequence", + "Sign", + "CCharSequence", + "CChar", + "EscapeSequence", + "SimpleEscapeSequence", + "OctalEscapeSequence", + "HexadecimalEscapeSequence", + "SingleQuoteFStringSCharSequence", + "SingleQuoteFStringSChar", + "DoubleQuoteFStringSCharSequence", + "DoubleQuoteFStringSChar", + "SingleQuoteSCharSequence", + "SingleQuoteSChar", + "DoubleQuoteSCharSequence", + "DoubleQuoteSChar", + "CommentContent", ]; private static readonly _LITERAL_NAMES: Array = [ - undefined, undefined, undefined, undefined, undefined, "'const'", "'var'", - "'as'", "'...'", "'switch'", "'case'", "'default'", "'break'", "'continue'", - "'do'", "'while'", "'if'", "'else'", "'for'", "'enum'", "'def'", "'return'", - "'call'", "'->'", "'class'", "'interface'", "'true'", "'false'", "'typeof'", - "'void'", "'null'", "'undefined'", "','", "';'", "'?'", "':'", "'('", - "')'", "'['", "']'", undefined, "'{'", "'}'", "'+'", "'++'", "'-'", "'--'", - "'*'", "'/'", "'%'", "'**'", "'&&'", "'||'", "'!'", "'='", "'+='", "'-='", - "'*='", "'/='", "'%='", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", - "'&'", "'|'", "'^'", "'~'", "'<<'", "'>>'", "'>>>'", "'.'", + undefined, + undefined, + undefined, + undefined, + undefined, + "'const'", + "'var'", + "'as'", + "'...'", + "'switch'", + "'case'", + "'default'", + "'break'", + "'continue'", + "'do'", + "'while'", + "'if'", + "'else'", + "'for'", + "'enum'", + "'def'", + "'return'", + "'call'", + "'->'", + "'class'", + "'interface'", + "'true'", + "'false'", + "'typeof'", + "'void'", + "'null'", + "'undefined'", + "','", + "';'", + "'?'", + "':'", + "'('", + "')'", + "'['", + "']'", + undefined, + "'{'", + "'}'", + "'+'", + "'++'", + "'-'", + "'--'", + "'*'", + "'/'", + "'%'", + "'**'", + "'&&'", + "'||'", + "'!'", + "'='", + "'+='", + "'-='", + "'*='", + "'/='", + "'%='", + "'=='", + "'!='", + "'<'", + "'<='", + "'>'", + "'>='", + "'&'", + "'|'", + "'^'", + "'~'", + "'<<'", + "'>>'", + "'>>>'", + "'.'", ]; private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, "FStringExpStart", "BlockComment", "LineComment", "Pragma", - "Const", "Var", "As", "Spread", "Switch", "Case", "Default", "Break", - "Continue", "Do", "While", "If", "Else", "For", "Enum", "DefFunc", "Return", - "CallFunc", "RetIndicator", "Class", "Interface", "True", "False", "Typeof", - "Void", "Null", "Undefined", "Comma", "SemiColon", "QuestionMark", "Colon", - "LeftParen", "RightParen", "LeftBracket", "RightBracket", "FStringExpEnd", - "LeftBrace", "RightBrace", "Plus", "PlusPlus", "Minus", "MinusMinus", - "Star", "Div", "Mod", "PowerTo", "AndAnd", "OrOr", "Not", "Assign", "PlusAssign", - "MinusAssign", "StarAssign", "DivAssign", "ModAssign", "Equal", "NotEqual", - "Less", "LessEqual", "Greater", "GreaterEqual", "BitwiseAnd", "BitwiseOr", - "BitwiseXor", "BitwiseNot", "BitwiseZeroFillLeftShift", "BitwiseSignedRightShift", - "BitwiseZeroFillRightShift", "Dot", "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", - "DoubleQuoteStringLiteral", "FloatingConstant", "Whitespace", "Newline", - "FStringSingleQuoteStart", "FStringDoubleQuoteStart", "FStringSingleQuoteEnd", - "FStringSingleQuoteAtom", "FStringDoubleQuoteEnd", "FStringDoubleQuoteAtom", + undefined, + "FStringExpStart", + "BlockComment", + "LineComment", + "Pragma", + "Const", + "Var", + "As", + "Spread", + "Switch", + "Case", + "Default", + "Break", + "Continue", + "Do", + "While", + "If", + "Else", + "For", + "Enum", + "DefFunc", + "Return", + "CallFunc", + "RetIndicator", + "Class", + "Interface", + "True", + "False", + "Typeof", + "Void", + "Null", + "Undefined", + "Comma", + "SemiColon", + "QuestionMark", + "Colon", + "LeftParen", + "RightParen", + "LeftBracket", + "RightBracket", + "FStringExpEnd", + "LeftBrace", + "RightBrace", + "Plus", + "PlusPlus", + "Minus", + "MinusMinus", + "Star", + "Div", + "Mod", + "PowerTo", + "AndAnd", + "OrOr", + "Not", + "Assign", + "PlusAssign", + "MinusAssign", + "StarAssign", + "DivAssign", + "ModAssign", + "Equal", + "NotEqual", + "Less", + "LessEqual", + "Greater", + "GreaterEqual", + "BitwiseAnd", + "BitwiseOr", + "BitwiseXor", + "BitwiseNot", + "BitwiseZeroFillLeftShift", + "BitwiseSignedRightShift", + "BitwiseZeroFillRightShift", + "Dot", + "Identifier", + "IntegerConstant", + "SingleQuoteStringLiteral", + "DoubleQuoteStringLiteral", + "FloatingConstant", + "Whitespace", + "Newline", + "FStringSingleQuoteStart", + "FStringDoubleQuoteStart", + "FStringSingleQuoteEnd", + "FStringSingleQuoteAtom", + "FStringDoubleQuoteEnd", + "FStringDoubleQuoteAtom", ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(KipperLexer._LITERAL_NAMES, KipperLexer._SYMBOLIC_NAMES, []); + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( + KipperLexer._LITERAL_NAMES, + KipperLexer._SYMBOLIC_NAMES, + [], + ); // @Override // @NotNull @@ -183,107 +412,116 @@ export class KipperLexer extends KipperLexerBase { } // tslint:enable:no-trailing-whitespace - constructor(input: CharStream) { super(input); this._interp = new LexerATNSimulator(KipperLexer._ATN, this); } // @Override - public get grammarFileName(): string { return "KipperLexer.g4"; } + public get grammarFileName(): string { + return "KipperLexer.g4"; + } // @Override - public get ruleNames(): string[] { return KipperLexer.ruleNames; } + public get ruleNames(): string[] { + return KipperLexer.ruleNames; + } // @Override - public get serializedATN(): string { return KipperLexer._serializedATN; } + public get serializedATN(): string { + return KipperLexer._serializedATN; + } // @Override - public get channelNames(): string[] { return KipperLexer.channelNames; } + public get channelNames(): string[] { + return KipperLexer.channelNames; + } // @Override - public get modeNames(): string[] { return KipperLexer.modeNames; } + public get modeNames(): string[] { + return KipperLexer.modeNames; + } // @Override public action(_localctx: RuleContext, ruleIndex: number, actionIndex: number): void { switch (ruleIndex) { - case 79: - this.FStringSingleQuoteStart_action(_localctx, actionIndex); - break; + case 79: + this.FStringSingleQuoteStart_action(_localctx, actionIndex); + break; - case 80: - this.FStringDoubleQuoteStart_action(_localctx, actionIndex); - break; + case 80: + this.FStringDoubleQuoteStart_action(_localctx, actionIndex); + break; - case 82: - this.FStringSingleQuoteEnd_action(_localctx, actionIndex); - break; + case 82: + this.FStringSingleQuoteEnd_action(_localctx, actionIndex); + break; - case 85: - this.FStringDoubleQuoteEnd_action(_localctx, actionIndex); - break; + case 85: + this.FStringDoubleQuoteEnd_action(_localctx, actionIndex); + break; } } private FStringSingleQuoteStart_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 0: - this.incrementFStringDepth() - break; + case 0: + this.incrementFStringDepth(); + break; } } private FStringDoubleQuoteStart_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 1: - this.incrementFStringDepth() - break; + case 1: + this.incrementFStringDepth(); + break; } } private FStringSingleQuoteEnd_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 2: - this.decrementFStringDepth() - break; + case 2: + this.decrementFStringDepth(); + break; } } private FStringDoubleQuoteEnd_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 3: - this.decrementFStringDepth() - break; + case 3: + this.decrementFStringDepth(); + break; } } // @Override public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { switch (ruleIndex) { - case 38: - return this.FStringExpEnd_sempred(_localctx, predIndex); + case 38: + return this.FStringExpEnd_sempred(_localctx, predIndex); - case 81: - return this.FStringSingleQuoteExpStart_sempred(_localctx, predIndex); + case 81: + return this.FStringSingleQuoteExpStart_sempred(_localctx, predIndex); - case 84: - return this.FStringDoubleQuoteExpStart_sempred(_localctx, predIndex); + case 84: + return this.FStringDoubleQuoteExpStart_sempred(_localctx, predIndex); } return true; } private FStringExpEnd_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 0: - return this.insideFString(); + case 0: + return this.insideFString(); } return true; } private FStringSingleQuoteExpStart_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 1: - return this.insideFString(); + case 1: + return this.insideFString(); } return true; } private FStringDoubleQuoteExpStart_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 2: - return this.insideFString(); + case 2: + return this.insideFString(); } return true; } @@ -297,7 +535,7 @@ export class KipperLexer extends KipperLexerBase { "\x04\x12\t\x12\x04\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16" + "\x04\x17\t\x17\x04\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B" + "\x04\x1C\t\x1C\x04\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!" + - "\t!\x04\"\t\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(\x04)\t" + + "\t!\x04\"\t\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04'\t'\x04(\t(\x04)\t" + ")\x04*\t*\x04+\t+\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x040\t0\x041\t1\x04" + "2\t2\x043\t3\x044\t4\x045\t5\x046\t6\x047\t7\x048\t8\x049\t9\x04:\t:\x04" + ";\t;\x04<\t<\x04=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x04B\tB\x04C\tC\x04" + @@ -326,8 +564,8 @@ export class KipperLexer extends KipperLexerBase { "\x1B\x03\x1B\x03\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03" + "\x1C\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1E\x03" + "\x1E\x03\x1E\x03\x1F\x03\x1F\x03\x1F\x03\x1F\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&\x03&\x03\'\x03\'\x03(\x03(\x03(\x03(\x03(\x03)\x03)\x03" + + '\x1F\x03\x1F\x03\x1F\x03 \x03 \x03!\x03!\x03"\x03"\x03#\x03#\x03$\x03' + + "$\x03%\x03%\x03&\x03&\x03'\x03'\x03(\x03(\x03(\x03(\x03(\x03)\x03)\x03" + "*\x03*\x03+\x03+\x03,\x03,\x03,\x03-\x03-\x03.\x03.\x03.\x03/\x03/\x03" + "0\x030\x031\x031\x032\x032\x032\x033\x033\x033\x034\x034\x034\x035\x03" + "5\x036\x036\x037\x037\x037\x038\x038\x038\x039\x039\x039\x03:\x03:\x03" + @@ -355,9 +593,9 @@ export class KipperLexer extends KipperLexerBase { "w\u02F0\nw\fw\x0Ew\u02F3\vw\x03\xF7\x02\x02x\x05\x02\x04\x07\x02\x05\t" + "\x02\x06\v\x02\x07\r\x02\b\x0F\x02\t\x11\x02\n\x13\x02\v\x15\x02\f\x17" + "\x02\r\x19\x02\x0E\x1B\x02\x0F\x1D\x02\x10\x1F\x02\x11!\x02\x12#\x02\x13" + - "%\x02\x14\'\x02\x15)\x02\x16+\x02\x17-\x02\x18/\x02\x191\x02\x1A3\x02" + - "\x1B5\x02\x1C7\x02\x1D9\x02\x1E;\x02\x1F=\x02 ?\x02!A\x02\"C\x02#E\x02" + - "$G\x02%I\x02&K\x02\'M\x02(O\x02)Q\x02*S\x02+U\x02,W\x02-Y\x02.[\x02/]" + + "%\x02\x14'\x02\x15)\x02\x16+\x02\x17-\x02\x18/\x02\x191\x02\x1A3\x02" + + '\x1B5\x02\x1C7\x02\x1D9\x02\x1E;\x02\x1F=\x02 ?\x02!A\x02"C\x02#E\x02' + + "$G\x02%I\x02&K\x02'M\x02(O\x02)Q\x02*S\x02+U\x02,W\x02-Y\x02.[\x02/]" + "\x020_\x021a\x022c\x023e\x024g\x025i\x026k\x027m\x028o\x029q\x02:s\x02" + ";u\x02{\x02?}\x02@\x7F\x02A\x81\x02B\x83\x02C\x85\x02D\x87" + "\x02E\x89\x02F\x8B\x02G\x8D\x02H\x8F\x02I\x91\x02J\x93\x02K\x95\x02L\x97" + @@ -368,7 +606,7 @@ export class KipperLexer extends KipperLexerBase { "\x02\x02\xCF\x02\x02\xD1\x02\x02\xD3\x02\x02\xD5\x02\x02\xD7\x02\x02\xD9" + "\x02\x02\xDB\x02\x02\xDD\x02\x02\xDF\x02\x02\xE1\x02\x02\xE3\x02\x02\xE5" + "\x02\x02\xE7\x02\x02\xE9\x02\x02\xEB\x02\x02\xED\x02\x02\xEF\x02\x02\x05" + - "\x02\x03\x04\x14\x06\x02\v\v\r\x0E\"\"\xA2\xA2\x05\x02\f\f\x0F\x0F\u202A" + + '\x02\x03\x04\x14\x06\x02\v\v\r\x0E""\xA2\xA2\x05\x02\f\f\x0F\x0F\u202A' + "\u202B\x05\x02C\\aac|\x03\x022;\x04\x02DDdd\x04\x02QQqq\x04\x02ZZzz\x03" + "\x023;\x03\x0223\x03\x0229\x05\x022;CHch\x04\x02GGgg\x04\x02--//\x06\x02" + "\f\f\x0F\x0F))^^\x0E\x02$$))AA^^cdhhppttvvxx}}\x7F\x7F\b\x02\f\f\x0F\x0F" + @@ -378,7 +616,7 @@ export class KipperLexer extends KipperLexerBase { "\x02\x02\x02\x11\x03\x02\x02\x02\x02\x13\x03\x02\x02\x02\x02\x15\x03\x02" + "\x02\x02\x02\x17\x03\x02\x02\x02\x02\x19\x03\x02\x02\x02\x02\x1B\x03\x02" + "\x02\x02\x02\x1D\x03\x02\x02\x02\x02\x1F\x03\x02\x02\x02\x02!\x03\x02" + - "\x02\x02\x02#\x03\x02\x02\x02\x02%\x03\x02\x02\x02\x02\'\x03\x02\x02\x02" + + "\x02\x02\x02#\x03\x02\x02\x02\x02%\x03\x02\x02\x02\x02'\x03\x02\x02\x02" + "\x02)\x03\x02\x02\x02\x02+\x03\x02\x02\x02\x02-\x03\x02\x02\x02\x02/\x03" + "\x02\x02\x02\x021\x03\x02\x02\x02\x023\x03\x02\x02\x02\x025\x03\x02\x02" + "\x02\x027\x03\x02\x02\x02\x029\x03\x02\x02\x02\x02;\x03\x02\x02\x02\x02" + @@ -406,7 +644,7 @@ export class KipperLexer extends KipperLexerBase { "\x02\x02\x15\u012A\x03\x02\x02\x02\x17\u012F\x03\x02\x02\x02\x19\u0137" + "\x03\x02\x02\x02\x1B\u013D\x03\x02\x02\x02\x1D\u0146\x03\x02\x02\x02\x1F" + "\u0149\x03\x02\x02\x02!\u014F\x03\x02\x02\x02#\u0152\x03\x02\x02\x02%" + - "\u0157\x03\x02\x02\x02\'\u015B\x03\x02\x02\x02)\u0160\x03\x02\x02\x02" + + "\u0157\x03\x02\x02\x02'\u015B\x03\x02\x02\x02)\u0160\x03\x02\x02\x02" + "+\u0164\x03\x02\x02\x02-\u016B\x03\x02\x02\x02/\u0170\x03\x02\x02\x02" + "1\u0173\x03\x02\x02\x023\u0179\x03\x02\x02\x025\u0183\x03\x02\x02\x02" + "7\u0188\x03\x02\x02\x029\u018E\x03\x02\x02\x02;\u0195\x03\x02\x02\x02" + @@ -476,7 +714,7 @@ export class KipperLexer extends KipperLexerBase { "\x02\x02\u0149\u014A\x07y\x02\x02\u014A\u014B\x07j\x02\x02\u014B\u014C" + "\x07k\x02\x02\u014C\u014D\x07n\x02\x02\u014D\u014E\x07g\x02\x02\u014E" + " \x03\x02\x02\x02\u014F\u0150\x07k\x02\x02\u0150\u0151\x07h\x02\x02\u0151" + - "\"\x03\x02\x02\x02\u0152\u0153\x07g\x02\x02\u0153\u0154\x07n\x02\x02\u0154" + + '"\x03\x02\x02\x02\u0152\u0153\x07g\x02\x02\u0153\u0154\x07n\x02\x02\u0154' + "\u0155\x07u\x02\x02\u0155\u0156\x07g\x02\x02\u0156$\x03\x02\x02\x02\u0157" + "\u0158\x07h\x02\x02\u0158\u0159\x07q\x02\x02\u0159\u015A\x07t\x02\x02" + "\u015A&\x03\x02\x02\x02\u015B\u015C\x07g\x02\x02\u015C\u015D\x07p\x02" + @@ -520,7 +758,7 @@ export class KipperLexer extends KipperLexerBase { "\u01C8\x07/\x02\x02\u01C8\\\x03\x02\x02\x02\u01C9\u01CA\x07/\x02\x02\u01CA" + "\u01CB\x07/\x02\x02\u01CB^\x03\x02\x02\x02\u01CC\u01CD\x07,\x02\x02\u01CD" + "`\x03\x02\x02\x02\u01CE\u01CF\x071\x02\x02\u01CFb\x03\x02\x02\x02\u01D0" + - "\u01D1\x07\'\x02\x02\u01D1d\x03\x02\x02\x02\u01D2\u01D3\x07,\x02\x02\u01D3" + + "\u01D1\x07'\x02\x02\u01D1d\x03\x02\x02\x02\u01D2\u01D3\x07,\x02\x02\u01D3" + "\u01D4\x07,\x02\x02\u01D4f\x03\x02\x02\x02\u01D5\u01D6\x07(\x02\x02\u01D6" + "\u01D7\x07(\x02\x02\u01D7h\x03\x02\x02\x02\u01D8\u01D9\x07~\x02\x02\u01D9" + "\u01DA\x07~\x02\x02\u01DAj\x03\x02\x02\x02\u01DB\u01DC\x07#\x02\x02\u01DC" + @@ -529,7 +767,7 @@ export class KipperLexer extends KipperLexerBase { "\u01E3\x07/\x02\x02\u01E3\u01E4\x07?\x02\x02\u01E4r\x03\x02\x02\x02\u01E5" + "\u01E6\x07,\x02\x02\u01E6\u01E7\x07?\x02\x02\u01E7t\x03\x02\x02\x02\u01E8" + "\u01E9\x071\x02\x02\u01E9\u01EA\x07?\x02\x02\u01EAv\x03\x02\x02\x02\u01EB" + - "\u01EC\x07\'\x02\x02\u01EC\u01ED\x07?\x02\x02\u01EDx\x03\x02\x02\x02\u01EE" + + "\u01EC\x07'\x02\x02\u01EC\u01ED\x07?\x02\x02\u01EDx\x03\x02\x02\x02\u01EE" + "\u01EF\x07?\x02\x02\u01EF\u01F0\x07?\x02\x02\u01F0z\x03\x02\x02\x02\u01F1" + "\u01F2\x07#\x02\x02\u01F2\u01F3\x07?\x02\x02\u01F3|\x03\x02\x02\x02\u01F4" + "\u01F5\x07>\x02\x02\u01F5~\x03\x02\x02\x02\u01F6\u01F7\x07>\x02\x02\u01F7" + @@ -647,10 +885,7 @@ export class KipperLexer extends KipperLexerBase { "\x02\x03\x02\x03Q\x02\x07\x03\x02\x03R\x03\x07\x04\x02\t\x03\x02\x07\x02" + "\x02\x03T\x04\x03W\x05"; public static readonly _serializedATN: string = Utils.join( - [ - KipperLexer._serializedATNSegment0, - KipperLexer._serializedATNSegment1, - ], + [KipperLexer._serializedATNSegment0, KipperLexer._serializedATNSegment1], "", ); public static __ATN: ATN; @@ -661,6 +896,4 @@ export class KipperLexer extends KipperLexerBase { return KipperLexer.__ATN; } - } - diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts index e26588813..7e0876a1d 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts @@ -1,11 +1,9 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT - - // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax - // kind values. - import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; - import KipperParserBase from "./base/KipperParserBase"; - +// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax +// kind values. +import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; +import KipperParserBase from "./base/KipperParserBase"; import { ATN } from "antlr4ts/atn/ATN"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; @@ -32,7 +30,6 @@ import * as Utils from "antlr4ts/misc/Utils"; import { KipperParserListener } from "./KipperParserListener"; import { KipperParserVisitor } from "./KipperParserVisitor"; - export class KipperParser extends KipperParserBase { public static readonly FStringExpStart = 1; public static readonly BlockComment = 2; @@ -199,61 +196,254 @@ export class KipperParser extends KipperParserBase { public static readonly RULE_typeSpecifierIdentifier = 77; // tslint:disable:no-trailing-whitespace public static readonly ruleNames: string[] = [ - "compilationUnit", "translationUnit", "externalItem", "blockItemList", - "blockItem", "declaration", "variableDeclaration", "storageTypeSpecifier", - "initDeclarator", "initializer", "declarator", "directDeclarator", "functionDeclaration", - "parameterList", "parameterDeclaration", "interfaceDeclaration", "classDeclaration", - "statement", "compoundStatement", "expressionStatement", "selectionStatement", - "ifStatement", "switchStatement", "switchLabeledStatement", "iterationStatement", - "forLoopIterationStatement", "whileLoopIterationStatement", "doWhileLoopIterationStatement", - "jumpStatement", "returnStatement", "primaryExpression", "tangledPrimaryExpression", - "boolPrimaryExpression", "identifierPrimaryExpression", "identifier", - "identifierOrStringPrimaryExpression", "stringPrimaryExpression", "fStringPrimaryExpression", - "fStringSingleQuoteAtom", "fStringDoubleQuoteAtom", "numberPrimaryExpression", - "arrayPrimaryExpression", "objectPrimaryExpression", "objectProperty", - "voidOrNullOrUndefinedPrimaryExpression", "computedPrimaryExpression", - "argumentExpressionList", "dotNotation", "bracketNotation", "sliceNotation", - "postfixExpression", "incrementOrDecrementPostfixExpression", "unaryExpression", - "incrementOrDecrementUnaryExpression", "operatorModifiedUnaryExpression", - "incrementOrDecrementOperator", "unaryOperator", "castOrConvertExpression", - "multiplicativeExpression", "additiveExpression", "bitwiseShiftExpression", - "bitwiseShiftOperators", "relationalExpression", "equalityExpression", - "bitwiseAndExpression", "bitwiseXorExpression", "bitwiseOrExpression", - "logicalAndExpression", "logicalOrExpression", "conditionalExpression", - "assignmentExpression", "assignmentOperator", "expression", "typeSpecifierExpression", - "identifierTypeSpecifierExpression", "genericTypeSpecifierExpression", - "typeofTypeSpecifierExpression", "typeSpecifierIdentifier", + "compilationUnit", + "translationUnit", + "externalItem", + "blockItemList", + "blockItem", + "declaration", + "variableDeclaration", + "storageTypeSpecifier", + "initDeclarator", + "initializer", + "declarator", + "directDeclarator", + "functionDeclaration", + "parameterList", + "parameterDeclaration", + "interfaceDeclaration", + "classDeclaration", + "statement", + "compoundStatement", + "expressionStatement", + "selectionStatement", + "ifStatement", + "switchStatement", + "switchLabeledStatement", + "iterationStatement", + "forLoopIterationStatement", + "whileLoopIterationStatement", + "doWhileLoopIterationStatement", + "jumpStatement", + "returnStatement", + "primaryExpression", + "tangledPrimaryExpression", + "boolPrimaryExpression", + "identifierPrimaryExpression", + "identifier", + "identifierOrStringPrimaryExpression", + "stringPrimaryExpression", + "fStringPrimaryExpression", + "fStringSingleQuoteAtom", + "fStringDoubleQuoteAtom", + "numberPrimaryExpression", + "arrayPrimaryExpression", + "objectPrimaryExpression", + "objectProperty", + "voidOrNullOrUndefinedPrimaryExpression", + "computedPrimaryExpression", + "argumentExpressionList", + "dotNotation", + "bracketNotation", + "sliceNotation", + "postfixExpression", + "incrementOrDecrementPostfixExpression", + "unaryExpression", + "incrementOrDecrementUnaryExpression", + "operatorModifiedUnaryExpression", + "incrementOrDecrementOperator", + "unaryOperator", + "castOrConvertExpression", + "multiplicativeExpression", + "additiveExpression", + "bitwiseShiftExpression", + "bitwiseShiftOperators", + "relationalExpression", + "equalityExpression", + "bitwiseAndExpression", + "bitwiseXorExpression", + "bitwiseOrExpression", + "logicalAndExpression", + "logicalOrExpression", + "conditionalExpression", + "assignmentExpression", + "assignmentOperator", + "expression", + "typeSpecifierExpression", + "identifierTypeSpecifierExpression", + "genericTypeSpecifierExpression", + "typeofTypeSpecifierExpression", + "typeSpecifierIdentifier", ]; private static readonly _LITERAL_NAMES: Array = [ - undefined, undefined, undefined, undefined, "'const'", "'var'", "'as'", - "'...'", "'switch'", "'case'", "'default'", "'break'", "'continue'", "'do'", - "'while'", "'if'", "'else'", "'for'", "'enum'", "'def'", "'return'", "'call'", - "'->'", "'class'", "'interface'", "'true'", "'false'", "'typeof'", "'void'", - "'null'", "'undefined'", "','", "';'", "'?'", "':'", "'('", "')'", "'['", - "']'", undefined, "'{'", "'}'", "'+'", "'++'", "'-'", "'--'", "'*'", "'/'", - "'%'", "'**'", "'&&'", "'||'", "'!'", "'='", "'+='", "'-='", "'*='", "'/='", - "'%='", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'&'", "'|'", "'^'", - "'~'", "'<<'", "'>>'", "'>>>'", "'.'", + undefined, + undefined, + undefined, + undefined, + "'const'", + "'var'", + "'as'", + "'...'", + "'switch'", + "'case'", + "'default'", + "'break'", + "'continue'", + "'do'", + "'while'", + "'if'", + "'else'", + "'for'", + "'enum'", + "'def'", + "'return'", + "'call'", + "'->'", + "'class'", + "'interface'", + "'true'", + "'false'", + "'typeof'", + "'void'", + "'null'", + "'undefined'", + "','", + "';'", + "'?'", + "':'", + "'('", + "')'", + "'['", + "']'", + undefined, + "'{'", + "'}'", + "'+'", + "'++'", + "'-'", + "'--'", + "'*'", + "'/'", + "'%'", + "'**'", + "'&&'", + "'||'", + "'!'", + "'='", + "'+='", + "'-='", + "'*='", + "'/='", + "'%='", + "'=='", + "'!='", + "'<'", + "'<='", + "'>'", + "'>='", + "'&'", + "'|'", + "'^'", + "'~'", + "'<<'", + "'>>'", + "'>>>'", + "'.'", ]; private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, "FStringExpStart", "BlockComment", "LineComment", "Const", - "Var", "As", "Spread", "Switch", "Case", "Default", "Break", "Continue", - "Do", "While", "If", "Else", "For", "Enum", "DefFunc", "Return", "CallFunc", - "RetIndicator", "Class", "Interface", "True", "False", "Typeof", "Void", - "Null", "Undefined", "Comma", "SemiColon", "QuestionMark", "Colon", "LeftParen", - "RightParen", "LeftBracket", "RightBracket", "FStringExpEnd", "LeftBrace", - "RightBrace", "Plus", "PlusPlus", "Minus", "MinusMinus", "Star", "Div", - "Mod", "PowerTo", "AndAnd", "OrOr", "Not", "Assign", "PlusAssign", "MinusAssign", - "StarAssign", "DivAssign", "ModAssign", "Equal", "NotEqual", "Less", "LessEqual", - "Greater", "GreaterEqual", "BitwiseAnd", "BitwiseOr", "BitwiseXor", "BitwiseNot", - "BitwiseZeroFillLeftShift", "BitwiseSignedRightShift", "BitwiseZeroFillRightShift", - "Dot", "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", "DoubleQuoteStringLiteral", - "FloatingConstant", "Whitespace", "Newline", "FStringSingleQuoteStart", - "FStringDoubleQuoteStart", "FStringSingleQuoteEnd", "FStringSingleQuoteAtom", - "FStringDoubleQuoteEnd", "FStringDoubleQuoteAtom", + undefined, + "FStringExpStart", + "BlockComment", + "LineComment", + "Const", + "Var", + "As", + "Spread", + "Switch", + "Case", + "Default", + "Break", + "Continue", + "Do", + "While", + "If", + "Else", + "For", + "Enum", + "DefFunc", + "Return", + "CallFunc", + "RetIndicator", + "Class", + "Interface", + "True", + "False", + "Typeof", + "Void", + "Null", + "Undefined", + "Comma", + "SemiColon", + "QuestionMark", + "Colon", + "LeftParen", + "RightParen", + "LeftBracket", + "RightBracket", + "FStringExpEnd", + "LeftBrace", + "RightBrace", + "Plus", + "PlusPlus", + "Minus", + "MinusMinus", + "Star", + "Div", + "Mod", + "PowerTo", + "AndAnd", + "OrOr", + "Not", + "Assign", + "PlusAssign", + "MinusAssign", + "StarAssign", + "DivAssign", + "ModAssign", + "Equal", + "NotEqual", + "Less", + "LessEqual", + "Greater", + "GreaterEqual", + "BitwiseAnd", + "BitwiseOr", + "BitwiseXor", + "BitwiseNot", + "BitwiseZeroFillLeftShift", + "BitwiseSignedRightShift", + "BitwiseZeroFillRightShift", + "Dot", + "Identifier", + "IntegerConstant", + "SingleQuoteStringLiteral", + "DoubleQuoteStringLiteral", + "FloatingConstant", + "Whitespace", + "Newline", + "FStringSingleQuoteStart", + "FStringDoubleQuoteStart", + "FStringSingleQuoteEnd", + "FStringSingleQuoteAtom", + "FStringDoubleQuoteEnd", + "FStringDoubleQuoteAtom", ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(KipperParser._LITERAL_NAMES, KipperParser._SYMBOLIC_NAMES, []); + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( + KipperParser._LITERAL_NAMES, + KipperParser._SYMBOLIC_NAMES, + [], + ); // @Override // @NotNull @@ -263,13 +453,19 @@ export class KipperParser extends KipperParserBase { // tslint:enable:no-trailing-whitespace // @Override - public get grammarFileName(): string { return "KipperParser.g4"; } + public get grammarFileName(): string { + return "KipperParser.g4"; + } // @Override - public get ruleNames(): string[] { return KipperParser.ruleNames; } + public get ruleNames(): string[] { + return KipperParser.ruleNames; + } // @Override - public get serializedATN(): string { return KipperParser._serializedATN; } + public get serializedATN(): string { + return KipperParser._serializedATN; + } protected createFailedPredicateException(predicate?: string, message?: string): FailedPredicateException { return new FailedPredicateException(this, predicate, message); @@ -286,21 +482,20 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 157; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 0, this._ctx) ) { - case 1: - { - this.state = 156; - this.translationUnit(); + this.state = 157; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 0, this._ctx)) { + case 1: + { + this.state = 156; + this.translationUnit(); + } + break; } - break; - } - this.state = 159; - this.match(KipperParser.EOF); + this.state = 159; + this.match(KipperParser.EOF); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -308,8 +503,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -322,29 +516,28 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 162; - this._errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - this.state = 161; - this.externalItem(); - } - } - break; - default: - throw new NoViableAltException(this); - } - this.state = 164; + this.state = 162; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx); - } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 161; + this.externalItem(); + } + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 164; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -352,8 +545,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -366,11 +558,10 @@ export class KipperParser extends KipperParserBase { _localctx = new ExternalBlockItemContext(_localctx); this.enterOuterAlt(_localctx, 1); { - this.state = 166; - this.blockItemList(); + this.state = 166; + this.blockItemList(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -378,8 +569,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -392,29 +582,28 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 169; - this._errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - this.state = 168; - this.blockItem(); - } - } - break; - default: - throw new NoViableAltException(this); - } - this.state = 171; + this.state = 169; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); - } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 168; + this.blockItem(); + } + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 171; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -422,8 +611,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -435,33 +623,32 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 176; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 3, this._ctx) ) { - case 1: - { - this.state = 173; - this.statement(); - } - break; + this.state = 176; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 3, this._ctx)) { + case 1: + { + this.state = 173; + this.statement(); + } + break; - case 2: - { - this.state = 174; - this.declaration(); - } - break; + case 2: + { + this.state = 174; + this.declaration(); + } + break; - case 3: - { - this.state = 175; - this.match(KipperParser.SemiColon); + case 3: + { + this.state = 175; + this.match(KipperParser.SemiColon); + } + break; } - break; - } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -469,8 +656,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -483,42 +669,41 @@ export class KipperParser extends KipperParserBase { this.state = 184; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Const: - case KipperParser.Var: - this.enterOuterAlt(_localctx, 1); - { - this.state = 178; - this.variableDeclaration(); - this.state = 179; - this.match(KipperParser.SemiColon); - } - break; - case KipperParser.DefFunc: - this.enterOuterAlt(_localctx, 2); - { - this.state = 181; - this.functionDeclaration(); - } - break; - case KipperParser.Interface: - this.enterOuterAlt(_localctx, 3); - { - this.state = 182; - this.interfaceDeclaration(); - } - break; - case KipperParser.Class: - this.enterOuterAlt(_localctx, 4); - { - this.state = 183; - this.classDeclaration(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Const: + case KipperParser.Var: + this.enterOuterAlt(_localctx, 1); + { + this.state = 178; + this.variableDeclaration(); + this.state = 179; + this.match(KipperParser.SemiColon); + } + break; + case KipperParser.DefFunc: + this.enterOuterAlt(_localctx, 2); + { + this.state = 181; + this.functionDeclaration(); + } + break; + case KipperParser.Interface: + this.enterOuterAlt(_localctx, 3); + { + this.state = 182; + this.interfaceDeclaration(); + } + break; + case KipperParser.Class: + this.enterOuterAlt(_localctx, 4); + { + this.state = 183; + this.classDeclaration(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -526,8 +711,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -539,13 +723,12 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 186; - this.storageTypeSpecifier(); - this.state = 187; - this.initDeclarator(); + this.state = 186; + this.storageTypeSpecifier(); + this.state = 187; + this.initDeclarator(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -553,8 +736,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -567,21 +749,20 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 189; - _la = this._input.LA(1); - if (!(_la === KipperParser.Const || _la === KipperParser.Var)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 189; + _la = this._input.LA(1); + if (!(_la === KipperParser.Const || _la === KipperParser.Var)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -589,8 +770,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -603,27 +783,25 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 191; - this.declarator(); - this.state = 192; - this.match(KipperParser.Colon); - this.state = 193; - this.typeSpecifierExpression(); - this.state = 196; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Assign) { - { - this.state = 194; - this.match(KipperParser.Assign); - this.state = 195; - this.initializer(); + this.state = 191; + this.declarator(); + this.state = 192; + this.match(KipperParser.Colon); + this.state = 193; + this.typeSpecifierExpression(); + this.state = 196; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Assign) { + { + this.state = 194; + this.match(KipperParser.Assign); + this.state = 195; + this.initializer(); + } } } - - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -631,8 +809,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -644,11 +821,10 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 198; - this.assignmentExpression(); + this.state = 198; + this.assignmentExpression(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -656,8 +832,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -669,11 +844,10 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 200; - this.directDeclarator(); + this.state = 200; + this.directDeclarator(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -681,8 +855,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -694,11 +867,10 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 202; - this.match(KipperParser.Identifier); + this.state = 202; + this.match(KipperParser.Identifier); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -706,8 +878,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -720,41 +891,40 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 204; - this.match(KipperParser.DefFunc); - this.state = 205; - this.declarator(); - this.state = 206; - this.match(KipperParser.LeftParen); - this.state = 208; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Identifier) { - { - this.state = 207; - this.parameterList(); + this.state = 204; + this.match(KipperParser.DefFunc); + this.state = 205; + this.declarator(); + this.state = 206; + this.match(KipperParser.LeftParen); + this.state = 208; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Identifier) { + { + this.state = 207; + this.parameterList(); + } } - } - this.state = 210; - this.match(KipperParser.RightParen); - this.state = 211; - this.match(KipperParser.RetIndicator); - this.state = 212; - this.typeSpecifierExpression(); - this.state = 214; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 7, this._ctx) ) { - case 1: - { - this.state = 213; - this.compoundStatement(); + this.state = 210; + this.match(KipperParser.RightParen); + this.state = 211; + this.match(KipperParser.RetIndicator); + this.state = 212; + this.typeSpecifierExpression(); + this.state = 214; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 7, this._ctx)) { + case 1: + { + this.state = 213; + this.compoundStatement(); + } + break; } - break; - } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -762,8 +932,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -776,27 +945,26 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 216; - this.parameterDeclaration(); - this.state = 221; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.Comma) { - { - { - this.state = 217; - this.match(KipperParser.Comma); - this.state = 218; + this.state = 216; this.parameterDeclaration(); - } - } - this.state = 223; + this.state = 221; this._errHandler.sync(this); _la = this._input.LA(1); + while (_la === KipperParser.Comma) { + { + { + this.state = 217; + this.match(KipperParser.Comma); + this.state = 218; + this.parameterDeclaration(); + } + } + this.state = 223; + this._errHandler.sync(this); + _la = this._input.LA(1); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -804,8 +972,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -817,15 +984,14 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 224; - this.declarator(); - this.state = 225; - this.match(KipperParser.Colon); - this.state = 226; - this.typeSpecifierExpression(); + this.state = 224; + this.declarator(); + this.state = 225; + this.match(KipperParser.Colon); + this.state = 226; + this.typeSpecifierExpression(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -833,8 +999,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -846,17 +1011,16 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 228; - this.match(KipperParser.Interface); - this.state = 229; - this.match(KipperParser.Identifier); - this.state = 230; - this.match(KipperParser.LeftBrace); - this.state = 231; - this.match(KipperParser.RightBrace); - } - } - catch (re) { + this.state = 228; + this.match(KipperParser.Interface); + this.state = 229; + this.match(KipperParser.Identifier); + this.state = 230; + this.match(KipperParser.LeftBrace); + this.state = 231; + this.match(KipperParser.RightBrace); + } + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -864,8 +1028,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -877,17 +1040,16 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 233; - this.match(KipperParser.Class); - this.state = 234; - this.match(KipperParser.Identifier); - this.state = 235; - this.match(KipperParser.LeftBrace); - this.state = 236; - this.match(KipperParser.RightBrace); - } - } - catch (re) { + this.state = 233; + this.match(KipperParser.Class); + this.state = 234; + this.match(KipperParser.Identifier); + this.state = 235; + this.match(KipperParser.LeftBrace); + this.state = 236; + this.match(KipperParser.RightBrace); + } + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -895,8 +1057,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -908,57 +1069,56 @@ export class KipperParser extends KipperParserBase { try { this.state = 244; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 9, this._ctx) ) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 238; - this.expressionStatement(); - } - break; + switch (this.interpreter.adaptivePredict(this._input, 9, this._ctx)) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 238; + this.expressionStatement(); + } + break; - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 239; - this.selectionStatement(); - } - break; + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 239; + this.selectionStatement(); + } + break; - case 3: - this.enterOuterAlt(_localctx, 3); - { - this.state = 240; - this.iterationStatement(); - } - break; + case 3: + this.enterOuterAlt(_localctx, 3); + { + this.state = 240; + this.iterationStatement(); + } + break; - case 4: - this.enterOuterAlt(_localctx, 4); - { - this.state = 241; - this.jumpStatement(); - } - break; + case 4: + this.enterOuterAlt(_localctx, 4); + { + this.state = 241; + this.jumpStatement(); + } + break; - case 5: - this.enterOuterAlt(_localctx, 5); - { - this.state = 242; - this.returnStatement(); - } - break; + case 5: + this.enterOuterAlt(_localctx, 5); + { + this.state = 242; + this.returnStatement(); + } + break; - case 6: - this.enterOuterAlt(_localctx, 6); - { - this.state = 243; - this.compoundStatement(); - } - break; + case 6: + this.enterOuterAlt(_localctx, 6); + { + this.state = 243; + this.compoundStatement(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -966,8 +1126,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -979,27 +1138,26 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 246; - if (!(this.notInsideExpressionStatement())) { - throw this.createFailedPredicateException("this.notInsideExpressionStatement()"); - } - this.state = 247; - this.match(KipperParser.LeftBrace); - this.state = 249; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 10, this._ctx) ) { - case 1: - { - this.state = 248; - this.blockItemList(); + this.state = 246; + if (!this.notInsideExpressionStatement()) { + throw this.createFailedPredicateException("this.notInsideExpressionStatement()"); } - break; - } - this.state = 251; - this.match(KipperParser.RightBrace); + this.state = 247; + this.match(KipperParser.LeftBrace); + this.state = 249; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 10, this._ctx)) { + case 1: + { + this.state = 248; + this.blockItemList(); + } + break; + } + this.state = 251; + this.match(KipperParser.RightBrace); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1007,8 +1165,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1020,15 +1177,14 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.enterExpressionStatement() - this.state = 254; - this.expression(); - this.state = 255; - this.match(KipperParser.SemiColon); - this.exitExpressionStatement() + this.enterExpressionStatement(); + this.state = 254; + this.expression(); + this.state = 255; + this.match(KipperParser.SemiColon); + this.exitExpressionStatement(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1036,8 +1192,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1050,25 +1205,24 @@ export class KipperParser extends KipperParserBase { this.state = 260; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.If: - this.enterOuterAlt(_localctx, 1); - { - this.state = 258; - this.ifStatement(); - } - break; - case KipperParser.Switch: - this.enterOuterAlt(_localctx, 2); - { - this.state = 259; - this.switchStatement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.If: + this.enterOuterAlt(_localctx, 1); + { + this.state = 258; + this.ifStatement(); + } + break; + case KipperParser.Switch: + this.enterOuterAlt(_localctx, 2); + { + this.state = 259; + this.switchStatement(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1076,8 +1230,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1089,31 +1242,30 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 262; - this.match(KipperParser.If); - this.state = 263; - this.match(KipperParser.LeftParen); - this.state = 264; - this.expression(); - this.state = 265; - this.match(KipperParser.RightParen); - this.state = 266; - this.statement(); - this.state = 269; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 12, this._ctx) ) { - case 1: - { - this.state = 267; - this.match(KipperParser.Else); - this.state = 268; + this.state = 262; + this.match(KipperParser.If); + this.state = 263; + this.match(KipperParser.LeftParen); + this.state = 264; + this.expression(); + this.state = 265; + this.match(KipperParser.RightParen); + this.state = 266; this.statement(); + this.state = 269; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 12, this._ctx)) { + case 1: + { + this.state = 267; + this.match(KipperParser.Else); + this.state = 268; + this.statement(); + } + break; } - break; } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1121,8 +1273,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1135,35 +1286,34 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 271; - this.match(KipperParser.Switch); - this.state = 272; - this.match(KipperParser.LeftParen); - this.state = 273; - this.expression(); - this.state = 274; - this.match(KipperParser.RightParen); - this.state = 275; - this.match(KipperParser.LeftBrace); - this.state = 279; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.Case || _la === KipperParser.Default) { - { - { - this.state = 276; - this.switchLabeledStatement(); - } - } - this.state = 281; + this.state = 271; + this.match(KipperParser.Switch); + this.state = 272; + this.match(KipperParser.LeftParen); + this.state = 273; + this.expression(); + this.state = 274; + this.match(KipperParser.RightParen); + this.state = 275; + this.match(KipperParser.LeftBrace); + this.state = 279; this._errHandler.sync(this); _la = this._input.LA(1); + while (_la === KipperParser.Case || _la === KipperParser.Default) { + { + { + this.state = 276; + this.switchLabeledStatement(); + } + } + this.state = 281; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 282; + this.match(KipperParser.RightBrace); } - this.state = 282; - this.match(KipperParser.RightBrace); - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1171,8 +1321,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1185,35 +1334,34 @@ export class KipperParser extends KipperParserBase { this.state = 292; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Case: - this.enterOuterAlt(_localctx, 1); - { - this.state = 284; - this.match(KipperParser.Case); - this.state = 285; - this.expression(); - this.state = 286; - this.match(KipperParser.Colon); - this.state = 287; - this.statement(); - } - break; - case KipperParser.Default: - this.enterOuterAlt(_localctx, 2); - { - this.state = 289; - this.match(KipperParser.Default); - this.state = 290; - this.match(KipperParser.Colon); - this.state = 291; - this.statement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Case: + this.enterOuterAlt(_localctx, 1); + { + this.state = 284; + this.match(KipperParser.Case); + this.state = 285; + this.expression(); + this.state = 286; + this.match(KipperParser.Colon); + this.state = 287; + this.statement(); + } + break; + case KipperParser.Default: + this.enterOuterAlt(_localctx, 2); + { + this.state = 289; + this.match(KipperParser.Default); + this.state = 290; + this.match(KipperParser.Colon); + this.state = 291; + this.statement(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1221,8 +1369,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1235,32 +1382,31 @@ export class KipperParser extends KipperParserBase { this.state = 297; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.For: - this.enterOuterAlt(_localctx, 1); - { - this.state = 294; - this.forLoopIterationStatement(); - } - break; - case KipperParser.While: - this.enterOuterAlt(_localctx, 2); - { - this.state = 295; - this.whileLoopIterationStatement(); - } - break; - case KipperParser.Do: - this.enterOuterAlt(_localctx, 3); - { - this.state = 296; - this.doWhileLoopIterationStatement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.For: + this.enterOuterAlt(_localctx, 1); + { + this.state = 294; + this.forLoopIterationStatement(); + } + break; + case KipperParser.While: + this.enterOuterAlt(_localctx, 2); + { + this.state = 295; + this.whileLoopIterationStatement(); + } + break; + case KipperParser.Do: + this.enterOuterAlt(_localctx, 3); + { + this.state = 296; + this.doWhileLoopIterationStatement(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1268,8 +1414,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1282,92 +1427,183 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 299; - this.match(KipperParser.For); - this.state = 300; - this.match(KipperParser.LeftParen); - this.state = 307; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Const) | (1 << KipperParser.Var) | (1 << KipperParser.CallFunc) | (1 << KipperParser.True) | (1 << KipperParser.False) | (1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0) || ((((_la - 35)) & ~0x1F) === 0 && ((1 << (_la - 35)) & ((1 << (KipperParser.LeftParen - 35)) | (1 << (KipperParser.LeftBracket - 35)) | (1 << (KipperParser.LeftBrace - 35)) | (1 << (KipperParser.Plus - 35)) | (1 << (KipperParser.PlusPlus - 35)) | (1 << (KipperParser.Minus - 35)) | (1 << (KipperParser.MinusMinus - 35)) | (1 << (KipperParser.Not - 35)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { - this.state = 303; + this.state = 299; + this.match(KipperParser.For); + this.state = 300; + this.match(KipperParser.LeftParen); + this.state = 307; this._errHandler.sync(this); - switch (this._input.LA(1)) { - case KipperParser.Const: - case KipperParser.Var: - { - this.state = 301; - this.variableDeclaration(); - } - break; - case KipperParser.CallFunc: - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Plus: - case KipperParser.PlusPlus: - case KipperParser.Minus: - case KipperParser.MinusMinus: - case KipperParser.Not: - case KipperParser.BitwiseNot: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: + _la = this._input.LA(1); + if ( + ((_la & ~0x1f) === 0 && + ((1 << _la) & + ((1 << KipperParser.Const) | + (1 << KipperParser.Var) | + (1 << KipperParser.CallFunc) | + (1 << KipperParser.True) | + (1 << KipperParser.False) | + (1 << KipperParser.Void) | + (1 << KipperParser.Null) | + (1 << KipperParser.Undefined))) !== + 0) || + (((_la - 35) & ~0x1f) === 0 && + ((1 << (_la - 35)) & + ((1 << (KipperParser.LeftParen - 35)) | + (1 << (KipperParser.LeftBracket - 35)) | + (1 << (KipperParser.LeftBrace - 35)) | + (1 << (KipperParser.Plus - 35)) | + (1 << (KipperParser.PlusPlus - 35)) | + (1 << (KipperParser.Minus - 35)) | + (1 << (KipperParser.MinusMinus - 35)) | + (1 << (KipperParser.Not - 35)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { { - this.state = 302; - this.expression(); + this.state = 303; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case KipperParser.Const: + case KipperParser.Var: + { + this.state = 301; + this.variableDeclaration(); + } + break; + case KipperParser.CallFunc: + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Plus: + case KipperParser.PlusPlus: + case KipperParser.Minus: + case KipperParser.MinusMinus: + case KipperParser.Not: + case KipperParser.BitwiseNot: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + { + this.state = 302; + this.expression(); + } + break; + default: + throw new NoViableAltException(this); + } + _localctx._forDeclaration = true; } - break; - default: - throw new NoViableAltException(this); - } - _localctx._forDeclaration = true } - } - this.state = 309; - this.match(KipperParser.SemiColon); - this.state = 313; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { - this.state = 310; - this.expression(); - _localctx._forCondition = true + this.state = 309; + this.match(KipperParser.SemiColon); + this.state = 313; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 310; + this.expression(); + _localctx._forCondition = true; + } } - } - this.state = 315; - this.match(KipperParser.SemiColon); - this.state = 319; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { - this.state = 316; - this.expression(); - _localctx._forIterationExp = true + this.state = 315; + this.match(KipperParser.SemiColon); + this.state = 319; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 316; + this.expression(); + _localctx._forIterationExp = true; + } } - } - this.state = 321; - this.match(KipperParser.RightParen); - this.state = 322; - this.statement(); + this.state = 321; + this.match(KipperParser.RightParen); + this.state = 322; + this.statement(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1375,8 +1611,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1388,19 +1623,18 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 324; - this.match(KipperParser.While); - this.state = 325; - this.match(KipperParser.LeftParen); - this.state = 326; - this.expression(); - this.state = 327; - this.match(KipperParser.RightParen); - this.state = 328; - this.statement(); - } - } - catch (re) { + this.state = 324; + this.match(KipperParser.While); + this.state = 325; + this.match(KipperParser.LeftParen); + this.state = 326; + this.expression(); + this.state = 327; + this.match(KipperParser.RightParen); + this.state = 328; + this.statement(); + } + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1408,36 +1642,37 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public doWhileLoopIterationStatement(): DoWhileLoopIterationStatementContext { - let _localctx: DoWhileLoopIterationStatementContext = new DoWhileLoopIterationStatementContext(this._ctx, this.state); + let _localctx: DoWhileLoopIterationStatementContext = new DoWhileLoopIterationStatementContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 54, KipperParser.RULE_doWhileLoopIterationStatement); try { this.enterOuterAlt(_localctx, 1); { - this.state = 330; - this.match(KipperParser.Do); - this.state = 331; - this.statement(); - this.state = 332; - this.match(KipperParser.While); - this.state = 333; - this.match(KipperParser.LeftParen); - this.state = 334; - this.expression(); - this.state = 335; - this.match(KipperParser.RightParen); - this.state = 336; - this.match(KipperParser.SemiColon); - } - } - catch (re) { + this.state = 330; + this.match(KipperParser.Do); + this.state = 331; + this.statement(); + this.state = 332; + this.match(KipperParser.While); + this.state = 333; + this.match(KipperParser.LeftParen); + this.state = 334; + this.expression(); + this.state = 335; + this.match(KipperParser.RightParen); + this.state = 336; + this.match(KipperParser.SemiColon); + } + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1445,8 +1680,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1459,23 +1693,22 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 338; - _la = this._input.LA(1); - if (!(_la === KipperParser.Break || _la === KipperParser.Continue)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 338; + _la = this._input.LA(1); + if (!(_la === KipperParser.Break || _la === KipperParser.Continue)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 339; - this.match(KipperParser.SemiColon); + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 339; + this.match(KipperParser.SemiColon); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1483,8 +1716,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1497,23 +1729,51 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 341; - this.match(KipperParser.Return); - this.state = 343; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { - this.state = 342; - this.expression(); + this.state = 341; + this.match(KipperParser.Return); + this.state = 343; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 342; + this.expression(); + } } - } - this.state = 345; - this.match(KipperParser.SemiColon); + this.state = 345; + this.match(KipperParser.SemiColon); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1521,8 +1781,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1535,80 +1794,79 @@ export class KipperParser extends KipperParserBase { this.state = 356; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.LeftParen: - this.enterOuterAlt(_localctx, 1); - { - this.state = 347; - this.tangledPrimaryExpression(); - } - break; - case KipperParser.LeftBracket: - this.enterOuterAlt(_localctx, 2); - { - this.state = 348; - this.arrayPrimaryExpression(); - } - break; - case KipperParser.LeftBrace: - this.enterOuterAlt(_localctx, 3); - { - this.state = 349; - this.objectPrimaryExpression(); - } - break; - case KipperParser.True: - case KipperParser.False: - this.enterOuterAlt(_localctx, 4); - { - this.state = 350; - this.boolPrimaryExpression(); - } - break; - case KipperParser.Identifier: - this.enterOuterAlt(_localctx, 5); - { - this.state = 351; - this.identifierPrimaryExpression(); - } - break; - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - this.enterOuterAlt(_localctx, 6); - { - this.state = 352; - this.stringPrimaryExpression(); - } - break; - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 7); - { - this.state = 353; - this.fStringPrimaryExpression(); - } - break; - case KipperParser.IntegerConstant: - case KipperParser.FloatingConstant: - this.enterOuterAlt(_localctx, 8); - { - this.state = 354; - this.numberPrimaryExpression(); - } - break; - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - this.enterOuterAlt(_localctx, 9); - { - this.state = 355; - this.voidOrNullOrUndefinedPrimaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.LeftParen: + this.enterOuterAlt(_localctx, 1); + { + this.state = 347; + this.tangledPrimaryExpression(); + } + break; + case KipperParser.LeftBracket: + this.enterOuterAlt(_localctx, 2); + { + this.state = 348; + this.arrayPrimaryExpression(); + } + break; + case KipperParser.LeftBrace: + this.enterOuterAlt(_localctx, 3); + { + this.state = 349; + this.objectPrimaryExpression(); + } + break; + case KipperParser.True: + case KipperParser.False: + this.enterOuterAlt(_localctx, 4); + { + this.state = 350; + this.boolPrimaryExpression(); + } + break; + case KipperParser.Identifier: + this.enterOuterAlt(_localctx, 5); + { + this.state = 351; + this.identifierPrimaryExpression(); + } + break; + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + this.enterOuterAlt(_localctx, 6); + { + this.state = 352; + this.stringPrimaryExpression(); + } + break; + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 7); + { + this.state = 353; + this.fStringPrimaryExpression(); + } + break; + case KipperParser.IntegerConstant: + case KipperParser.FloatingConstant: + this.enterOuterAlt(_localctx, 8); + { + this.state = 354; + this.numberPrimaryExpression(); + } + break; + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + this.enterOuterAlt(_localctx, 9); + { + this.state = 355; + this.voidOrNullOrUndefinedPrimaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1616,8 +1874,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1629,15 +1886,14 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 358; - this.match(KipperParser.LeftParen); - this.state = 359; - this.expression(); - this.state = 360; - this.match(KipperParser.RightParen); + this.state = 358; + this.match(KipperParser.LeftParen); + this.state = 359; + this.expression(); + this.state = 360; + this.match(KipperParser.RightParen); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1645,8 +1901,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1659,21 +1914,20 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 362; - _la = this._input.LA(1); - if (!(_la === KipperParser.True || _la === KipperParser.False)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 362; + _la = this._input.LA(1); + if (!(_la === KipperParser.True || _la === KipperParser.False)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1681,8 +1935,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1694,11 +1947,10 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 364; - this.identifier(); + this.state = 364; + this.identifier(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1706,8 +1958,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1719,11 +1970,10 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 366; - this.match(KipperParser.Identifier); + this.state = 366; + this.match(KipperParser.Identifier); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1731,40 +1981,41 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public identifierOrStringPrimaryExpression(): IdentifierOrStringPrimaryExpressionContext { - let _localctx: IdentifierOrStringPrimaryExpressionContext = new IdentifierOrStringPrimaryExpressionContext(this._ctx, this.state); + let _localctx: IdentifierOrStringPrimaryExpressionContext = new IdentifierOrStringPrimaryExpressionContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 70, KipperParser.RULE_identifierOrStringPrimaryExpression); try { this.state = 370; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Identifier: - this.enterOuterAlt(_localctx, 1); - { - this.state = 368; - this.identifier(); - } - break; - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - this.enterOuterAlt(_localctx, 2); - { - this.state = 369; - this.stringPrimaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Identifier: + this.enterOuterAlt(_localctx, 1); + { + this.state = 368; + this.identifier(); + } + break; + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + this.enterOuterAlt(_localctx, 2); + { + this.state = 369; + this.stringPrimaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1772,8 +2023,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1786,21 +2036,20 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 372; - _la = this._input.LA(1); - if (!(_la === KipperParser.SingleQuoteStringLiteral || _la === KipperParser.DoubleQuoteStringLiteral)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 372; + _la = this._input.LA(1); + if (!(_la === KipperParser.SingleQuoteStringLiteral || _la === KipperParser.DoubleQuoteStringLiteral)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1808,8 +2057,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1823,57 +2071,56 @@ export class KipperParser extends KipperParserBase { this.state = 390; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringSingleQuoteStart: - this.enterOuterAlt(_localctx, 1); - { - this.state = 374; - this.match(KipperParser.FStringSingleQuoteStart); - this.state = 378; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringSingleQuoteAtom) { - { + case KipperParser.FStringSingleQuoteStart: + this.enterOuterAlt(_localctx, 1); { - this.state = 375; - this.fStringSingleQuoteAtom(); - } + this.state = 374; + this.match(KipperParser.FStringSingleQuoteStart); + this.state = 378; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringSingleQuoteAtom) { + { + { + this.state = 375; + this.fStringSingleQuoteAtom(); + } + } + this.state = 380; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 381; + this.match(KipperParser.FStringSingleQuoteEnd); } - this.state = 380; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 381; - this.match(KipperParser.FStringSingleQuoteEnd); - } - break; - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 2); - { - this.state = 382; - this.match(KipperParser.FStringDoubleQuoteStart); - this.state = 386; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringDoubleQuoteAtom) { - { + break; + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 2); { - this.state = 383; - this.fStringDoubleQuoteAtom(); - } + this.state = 382; + this.match(KipperParser.FStringDoubleQuoteStart); + this.state = 386; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringDoubleQuoteAtom) { + { + { + this.state = 383; + this.fStringDoubleQuoteAtom(); + } + } + this.state = 388; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 389; + this.match(KipperParser.FStringDoubleQuoteEnd); } - this.state = 388; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 389; - this.match(KipperParser.FStringDoubleQuoteEnd); - } - break; - default: - throw new NoViableAltException(this); + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1881,8 +2128,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1896,37 +2142,65 @@ export class KipperParser extends KipperParserBase { this.state = 398; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringSingleQuoteAtom: - this.enterOuterAlt(_localctx, 1); - { - this.state = 392; - this.match(KipperParser.FStringSingleQuoteAtom); - } - break; - case KipperParser.FStringExpStart: - this.enterOuterAlt(_localctx, 2); - { - this.state = 393; - this.match(KipperParser.FStringExpStart); - this.state = 395; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + case KipperParser.FStringSingleQuoteAtom: + this.enterOuterAlt(_localctx, 1); { - this.state = 394; - this.expression(); + this.state = 392; + this.match(KipperParser.FStringSingleQuoteAtom); } - } + break; + case KipperParser.FStringExpStart: + this.enterOuterAlt(_localctx, 2); + { + this.state = 393; + this.match(KipperParser.FStringExpStart); + this.state = 395; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 394; + this.expression(); + } + } - this.state = 397; - this.match(KipperParser.FStringExpEnd); - } - break; - default: - throw new NoViableAltException(this); + this.state = 397; + this.match(KipperParser.FStringExpEnd); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1934,8 +2208,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1949,37 +2222,65 @@ export class KipperParser extends KipperParserBase { this.state = 406; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringDoubleQuoteAtom: - this.enterOuterAlt(_localctx, 1); - { - this.state = 400; - this.match(KipperParser.FStringDoubleQuoteAtom); - } - break; - case KipperParser.FStringExpStart: - this.enterOuterAlt(_localctx, 2); - { - this.state = 401; - this.match(KipperParser.FStringExpStart); - this.state = 403; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + case KipperParser.FStringDoubleQuoteAtom: + this.enterOuterAlt(_localctx, 1); { - this.state = 402; - this.expression(); + this.state = 400; + this.match(KipperParser.FStringDoubleQuoteAtom); } - } + break; + case KipperParser.FStringExpStart: + this.enterOuterAlt(_localctx, 2); + { + this.state = 401; + this.match(KipperParser.FStringExpStart); + this.state = 403; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 402; + this.expression(); + } + } - this.state = 405; - this.match(KipperParser.FStringExpEnd); - } - break; - default: - throw new NoViableAltException(this); + this.state = 405; + this.match(KipperParser.FStringExpEnd); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1987,8 +2288,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2001,21 +2301,20 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 408; - _la = this._input.LA(1); - if (!(_la === KipperParser.IntegerConstant || _la === KipperParser.FloatingConstant)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 408; + _la = this._input.LA(1); + if (!(_la === KipperParser.IntegerConstant || _la === KipperParser.FloatingConstant)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2023,8 +2322,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2038,51 +2336,79 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 410; - this.match(KipperParser.LeftBracket); - this.state = 419; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { - this.state = 411; - this.expression(); - this.state = 416; + this.state = 410; + this.match(KipperParser.LeftBracket); + this.state = 419; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 412; - this.match(KipperParser.Comma); - this.state = 413; + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 411; this.expression(); - } + this.state = 416; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 412; + this.match(KipperParser.Comma); + this.state = 413; + this.expression(); + } + } + } + this.state = 418; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); } } - this.state = 418; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 30, this._ctx); } - } - } - this.state = 422; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Comma) { - { - this.state = 421; - this.match(KipperParser.Comma); + this.state = 422; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Comma) { + { + this.state = 421; + this.match(KipperParser.Comma); + } } - } - this.state = 424; - this.match(KipperParser.RightBracket); + this.state = 424; + this.match(KipperParser.RightBracket); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2090,8 +2416,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2105,51 +2430,57 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 426; - this.match(KipperParser.LeftBrace); - this.state = 435; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 73)) & ~0x1F) === 0 && ((1 << (_la - 73)) & ((1 << (KipperParser.Identifier - 73)) | (1 << (KipperParser.SingleQuoteStringLiteral - 73)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 73)))) !== 0)) { - { - this.state = 427; - this.objectProperty(); - this.state = 432; + this.state = 426; + this.match(KipperParser.LeftBrace); + this.state = 435; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 428; - this.match(KipperParser.Comma); - this.state = 429; + _la = this._input.LA(1); + if ( + ((_la - 73) & ~0x1f) === 0 && + ((1 << (_la - 73)) & + ((1 << (KipperParser.Identifier - 73)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 73)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 73)))) !== + 0 + ) { + { + this.state = 427; this.objectProperty(); - } + this.state = 432; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 428; + this.match(KipperParser.Comma); + this.state = 429; + this.objectProperty(); + } + } + } + this.state = 434; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); } } - this.state = 434; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); - } } - } - this.state = 438; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Comma) { - { - this.state = 437; - this.match(KipperParser.Comma); + this.state = 438; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Comma) { + { + this.state = 437; + this.match(KipperParser.Comma); + } } - } - this.state = 440; - this.match(KipperParser.RightBrace); + this.state = 440; + this.match(KipperParser.RightBrace); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2157,8 +2488,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2170,15 +2500,14 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 442; - this.identifierOrStringPrimaryExpression(); - this.state = 443; - this.match(KipperParser.Colon); - this.state = 444; - this.expression(); + this.state = 442; + this.identifierOrStringPrimaryExpression(); + this.state = 443; + this.match(KipperParser.Colon); + this.state = 444; + this.expression(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2186,35 +2515,41 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public voidOrNullOrUndefinedPrimaryExpression(): VoidOrNullOrUndefinedPrimaryExpressionContext { - let _localctx: VoidOrNullOrUndefinedPrimaryExpressionContext = new VoidOrNullOrUndefinedPrimaryExpressionContext(this._ctx, this.state); + let _localctx: VoidOrNullOrUndefinedPrimaryExpressionContext = new VoidOrNullOrUndefinedPrimaryExpressionContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 88, KipperParser.RULE_voidOrNullOrUndefinedPrimaryExpression); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 446; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 446; + _la = this._input.LA(1); + if ( + !( + (_la & ~0x1f) === 0 && + ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0 + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2222,8 +2557,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2248,153 +2582,218 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 459; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - { - _localctx = new PassOncomputedPrimaryExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 449; - this.primaryExpression(); - } - break; - case KipperParser.CallFunc: - { - _localctx = new ExplicitCallFunctionCallExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 450; - this.match(KipperParser.CallFunc); - this.state = 451; - this.computedPrimaryExpression(0); - this.state = 452; - this.match(KipperParser.LeftParen); - this.state = 454; + this.state = 459; this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { - this.state = 453; - this.argumentExpressionList(); - } - } - - this.state = 456; - this.match(KipperParser.RightParen); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression - } - break; - default: - throw new NoViableAltException(this); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 482; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - this.state = 480; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 39, this._ctx) ) { - case 1: + switch (this._input.LA(1)) { + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: { - _localctx = new FunctionCallExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 461; - if (!(this.precpred(this._ctx, 5))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 5)"); - } - this.state = 462; - this.match(KipperParser.LeftParen); - this.state = 464; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { - this.state = 463; - this.argumentExpressionList(); - } - } + _localctx = new PassOncomputedPrimaryExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 466; - this.match(KipperParser.RightParen); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression + this.state = 449; + this.primaryExpression(); } break; - - case 2: + case KipperParser.CallFunc: { - _localctx = new DotNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 468; - if (!(this.precpred(this._ctx, 3))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 3)"); - } - this.state = 469; - this.dotNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression - } - break; + _localctx = new ExplicitCallFunctionCallExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 450; + this.match(KipperParser.CallFunc); + this.state = 451; + this.computedPrimaryExpression(0); + this.state = 452; + this.match(KipperParser.LeftParen); + this.state = 454; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 453; + this.argumentExpressionList(); + } + } - case 3: - { - _localctx = new BracketNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 472; - if (!(this.precpred(this._ctx, 2))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 2)"); - } - this.state = 473; - this.bracketNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression + this.state = 456; + this.match(KipperParser.RightParen); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression; } break; - - case 4: - { - _localctx = new SliceNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 476; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + default: + throw new NoViableAltException(this); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 482; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); } - this.state = 477; - this.sliceNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression + _prevctx = _localctx; + { + this.state = 480; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 39, this._ctx)) { + case 1: + { + _localctx = new FunctionCallExpressionContext( + new ComputedPrimaryExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 461; + if (!this.precpred(this._ctx, 5)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 5)"); + } + this.state = 462; + this.match(KipperParser.LeftParen); + this.state = 464; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 463; + this.argumentExpressionList(); + } + } + + this.state = 466; + this.match(KipperParser.RightParen); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression; + } + break; + + case 2: + { + _localctx = new DotNotationMemberAccessExpressionContext( + new ComputedPrimaryExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 468; + if (!this.precpred(this._ctx, 3)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 3)"); + } + this.state = 469; + this.dotNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; + } + break; + + case 3: + { + _localctx = new BracketNotationMemberAccessExpressionContext( + new ComputedPrimaryExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 472; + if (!this.precpred(this._ctx, 2)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 2)"); + } + this.state = 473; + this.bracketNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; + } + break; + + case 4: + { + _localctx = new SliceNotationMemberAccessExpressionContext( + new ComputedPrimaryExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 476; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 477; + this.sliceNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; + } + break; + } } - break; - } } + this.state = 484; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); } - this.state = 484; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 40, this._ctx); } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2402,8 +2801,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -2416,27 +2814,26 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 485; - this.assignmentExpression(); - this.state = 490; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.Comma) { - { - { - this.state = 486; - this.match(KipperParser.Comma); - this.state = 487; + this.state = 485; this.assignmentExpression(); - } - } - this.state = 492; + this.state = 490; this._errHandler.sync(this); _la = this._input.LA(1); + while (_la === KipperParser.Comma) { + { + { + this.state = 486; + this.match(KipperParser.Comma); + this.state = 487; + this.assignmentExpression(); + } + } + this.state = 492; + this._errHandler.sync(this); + _la = this._input.LA(1); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2444,8 +2841,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2457,13 +2853,12 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 493; - this.match(KipperParser.Dot); - this.state = 494; - this.identifier(); + this.state = 493; + this.match(KipperParser.Dot); + this.state = 494; + this.identifier(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2471,8 +2866,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2484,15 +2878,14 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 496; - this.match(KipperParser.LeftBracket); - this.state = 497; - this.expression(); - this.state = 498; - this.match(KipperParser.RightBracket); + this.state = 496; + this.match(KipperParser.LeftBracket); + this.state = 497; + this.expression(); + this.state = 498; + this.match(KipperParser.RightBracket); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2500,8 +2893,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2514,37 +2906,94 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 500; - this.match(KipperParser.LeftBracket); - this.state = 504; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { - this.state = 501; - this.expression(); - _localctx.sliceStart = true + this.state = 500; + this.match(KipperParser.LeftBracket); + this.state = 504; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 501; + this.expression(); + _localctx.sliceStart = true; + } } - } - this.state = 506; - this.match(KipperParser.Colon); - this.state = 510; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { - this.state = 507; - this.expression(); - _localctx.sliceEnd = true + this.state = 506; + this.match(KipperParser.Colon); + this.state = 510; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 507; + this.expression(); + _localctx.sliceEnd = true; + } } - } - this.state = 512; - this.match(KipperParser.RightBracket); + this.state = 512; + this.match(KipperParser.RightBracket); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2552,8 +3001,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2565,25 +3013,24 @@ export class KipperParser extends KipperParserBase { try { this.state = 516; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 44, this._ctx) ) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 514; - this.computedPrimaryExpression(0); - } - break; + switch (this.interpreter.adaptivePredict(this._input, 44, this._ctx)) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 514; + this.computedPrimaryExpression(0); + } + break; - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 515; - this.incrementOrDecrementPostfixExpression(); - } - break; + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 515; + this.incrementOrDecrementPostfixExpression(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2591,26 +3038,27 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public incrementOrDecrementPostfixExpression(): IncrementOrDecrementPostfixExpressionContext { - let _localctx: IncrementOrDecrementPostfixExpressionContext = new IncrementOrDecrementPostfixExpressionContext(this._ctx, this.state); + let _localctx: IncrementOrDecrementPostfixExpressionContext = new IncrementOrDecrementPostfixExpressionContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 102, KipperParser.RULE_incrementOrDecrementPostfixExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 518; - this.computedPrimaryExpression(0); - this.state = 519; - this.incrementOrDecrementOperator(); + this.state = 518; + this.computedPrimaryExpression(0); + this.state = 519; + this.incrementOrDecrementOperator(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2618,8 +3066,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2632,51 +3079,50 @@ export class KipperParser extends KipperParserBase { this.state = 524; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.CallFunc: - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 1); - { - this.state = 521; - this.postfixExpression(); - } - break; - case KipperParser.PlusPlus: - case KipperParser.MinusMinus: - this.enterOuterAlt(_localctx, 2); - { - this.state = 522; - this.incrementOrDecrementUnaryExpression(); - } - break; - case KipperParser.Plus: - case KipperParser.Minus: - case KipperParser.Not: - case KipperParser.BitwiseNot: - this.enterOuterAlt(_localctx, 3); - { - this.state = 523; - this.operatorModifiedUnaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.CallFunc: + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 1); + { + this.state = 521; + this.postfixExpression(); + } + break; + case KipperParser.PlusPlus: + case KipperParser.MinusMinus: + this.enterOuterAlt(_localctx, 2); + { + this.state = 522; + this.incrementOrDecrementUnaryExpression(); + } + break; + case KipperParser.Plus: + case KipperParser.Minus: + case KipperParser.Not: + case KipperParser.BitwiseNot: + this.enterOuterAlt(_localctx, 3); + { + this.state = 523; + this.operatorModifiedUnaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2684,26 +3130,27 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public incrementOrDecrementUnaryExpression(): IncrementOrDecrementUnaryExpressionContext { - let _localctx: IncrementOrDecrementUnaryExpressionContext = new IncrementOrDecrementUnaryExpressionContext(this._ctx, this.state); + let _localctx: IncrementOrDecrementUnaryExpressionContext = new IncrementOrDecrementUnaryExpressionContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 106, KipperParser.RULE_incrementOrDecrementUnaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 526; - this.incrementOrDecrementOperator(); - this.state = 527; - this.postfixExpression(); + this.state = 526; + this.incrementOrDecrementOperator(); + this.state = 527; + this.postfixExpression(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2711,26 +3158,27 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public operatorModifiedUnaryExpression(): OperatorModifiedUnaryExpressionContext { - let _localctx: OperatorModifiedUnaryExpressionContext = new OperatorModifiedUnaryExpressionContext(this._ctx, this.state); + let _localctx: OperatorModifiedUnaryExpressionContext = new OperatorModifiedUnaryExpressionContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 108, KipperParser.RULE_operatorModifiedUnaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 529; - this.unaryOperator(); - this.state = 530; - this.postfixExpression(); + this.state = 529; + this.unaryOperator(); + this.state = 530; + this.postfixExpression(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2738,8 +3186,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2752,21 +3199,20 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 532; - _la = this._input.LA(1); - if (!(_la === KipperParser.PlusPlus || _la === KipperParser.MinusMinus)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 532; + _la = this._input.LA(1); + if (!(_la === KipperParser.PlusPlus || _la === KipperParser.MinusMinus)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2774,8 +3220,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2788,21 +3233,30 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 534; - _la = this._input.LA(1); - if (!(((((_la - 42)) & ~0x1F) === 0 && ((1 << (_la - 42)) & ((1 << (KipperParser.Plus - 42)) | (1 << (KipperParser.Minus - 42)) | (1 << (KipperParser.Not - 42)) | (1 << (KipperParser.BitwiseNot - 42)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 534; + _la = this._input.LA(1); + if ( + !( + ((_la - 42) & ~0x1f) === 0 && + ((1 << (_la - 42)) & + ((1 << (KipperParser.Plus - 42)) | + (1 << (KipperParser.Minus - 42)) | + (1 << (KipperParser.Not - 42)) | + (1 << (KipperParser.BitwiseNot - 42)))) !== + 0 + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2810,8 +3264,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2823,31 +3276,30 @@ export class KipperParser extends KipperParserBase { try { this.state = 541; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 46, this._ctx) ) { - case 1: - _localctx = new PassOnCastOrConvertExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 536; - this.unaryExpression(); - } - break; + switch (this.interpreter.adaptivePredict(this._input, 46, this._ctx)) { + case 1: + _localctx = new PassOnCastOrConvertExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 536; + this.unaryExpression(); + } + break; - case 2: - _localctx = new ActualCastOrConvertExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 537; - this.unaryExpression(); - this.state = 538; - this.match(KipperParser.As); - this.state = 539; - this.typeSpecifierExpression(); - } - break; + case 2: + _localctx = new ActualCastOrConvertExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 537; + this.unaryExpression(); + this.state = 538; + this.match(KipperParser.As); + this.state = 539; + this.typeSpecifierExpression(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2855,8 +3307,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2881,56 +3332,67 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnMultiplicativeExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 544; - this.castOrConvertExpression(); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 551; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 47, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnMultiplicativeExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualMultiplicativeExpressionContext(new MultiplicativeExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_multiplicativeExpression); - this.state = 546; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 547; - _la = this._input.LA(1); - if (!(((((_la - 46)) & ~0x1F) === 0 && ((1 << (_la - 46)) & ((1 << (KipperParser.Star - 46)) | (1 << (KipperParser.Div - 46)) | (1 << (KipperParser.Mod - 46)) | (1 << (KipperParser.PowerTo - 46)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 548; + this.state = 544; this.castOrConvertExpression(); - } - } } - this.state = 553; + this._ctx._stop = this._input.tryLT(-1); + this.state = 551; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 47, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualMultiplicativeExpressionContext( + new MultiplicativeExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_multiplicativeExpression); + this.state = 546; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 547; + _la = this._input.LA(1); + if ( + !( + ((_la - 46) & ~0x1f) === 0 && + ((1 << (_la - 46)) & + ((1 << (KipperParser.Star - 46)) | + (1 << (KipperParser.Div - 46)) | + (1 << (KipperParser.Mod - 46)) | + (1 << (KipperParser.PowerTo - 46)))) !== + 0 + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 548; + this.castOrConvertExpression(); + } + } + } + this.state = 553; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 47, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2938,8 +3400,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -2964,56 +3425,57 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnAdditiveExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 555; - this.multiplicativeExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 562; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 48, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnAdditiveExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualAdditiveExpressionContext(new AdditiveExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_additiveExpression); - this.state = 557; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 558; - _la = this._input.LA(1); - if (!(_la === KipperParser.Plus || _la === KipperParser.Minus)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 559; + this.state = 555; this.multiplicativeExpression(0); - } - } } - this.state = 564; + this._ctx._stop = this._input.tryLT(-1); + this.state = 562; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 48, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualAdditiveExpressionContext( + new AdditiveExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_additiveExpression); + this.state = 557; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 558; + _la = this._input.LA(1); + if (!(_la === KipperParser.Plus || _la === KipperParser.Minus)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 559; + this.multiplicativeExpression(0); + } + } + } + this.state = 564; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 48, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3021,8 +3483,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3046,46 +3507,47 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnBitwiseShiftExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 566; - this.additiveExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 574; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 49, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnBitwiseShiftExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualBitwiseShiftExpressionContext(new BitwiseShiftExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseShiftExpression); - this.state = 568; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 569; - this.bitwiseShiftOperators(); - this.state = 570; - this.bitwiseAndExpression(0); - } - } + + this.state = 566; + this.additiveExpression(0); } - this.state = 576; + this._ctx._stop = this._input.tryLT(-1); + this.state = 574; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 49, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualBitwiseShiftExpressionContext( + new BitwiseShiftExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseShiftExpression); + this.state = 568; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 569; + this.bitwiseShiftOperators(); + this.state = 570; + this.bitwiseAndExpression(0); + } + } + } + this.state = 576; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 49, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3093,8 +3555,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3107,21 +3568,29 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 577; - _la = this._input.LA(1); - if (!(((((_la - 69)) & ~0x1F) === 0 && ((1 << (_la - 69)) & ((1 << (KipperParser.BitwiseZeroFillLeftShift - 69)) | (1 << (KipperParser.BitwiseSignedRightShift - 69)) | (1 << (KipperParser.BitwiseZeroFillRightShift - 69)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 577; + _la = this._input.LA(1); + if ( + !( + ((_la - 69) & ~0x1f) === 0 && + ((1 << (_la - 69)) & + ((1 << (KipperParser.BitwiseZeroFillLeftShift - 69)) | + (1 << (KipperParser.BitwiseSignedRightShift - 69)) | + (1 << (KipperParser.BitwiseZeroFillRightShift - 69)))) !== + 0 + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3129,8 +3598,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -3155,56 +3623,67 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnRelationalExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 580; - this.bitwiseShiftExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 587; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 50, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnRelationalExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualRelationalExpressionContext(new RelationalExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_relationalExpression); - this.state = 582; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 583; - _la = this._input.LA(1); - if (!(((((_la - 61)) & ~0x1F) === 0 && ((1 << (_la - 61)) & ((1 << (KipperParser.Less - 61)) | (1 << (KipperParser.LessEqual - 61)) | (1 << (KipperParser.Greater - 61)) | (1 << (KipperParser.GreaterEqual - 61)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 584; + this.state = 580; this.bitwiseShiftExpression(0); - } - } } - this.state = 589; + this._ctx._stop = this._input.tryLT(-1); + this.state = 587; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 50, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualRelationalExpressionContext( + new RelationalExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_relationalExpression); + this.state = 582; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 583; + _la = this._input.LA(1); + if ( + !( + ((_la - 61) & ~0x1f) === 0 && + ((1 << (_la - 61)) & + ((1 << (KipperParser.Less - 61)) | + (1 << (KipperParser.LessEqual - 61)) | + (1 << (KipperParser.Greater - 61)) | + (1 << (KipperParser.GreaterEqual - 61)))) !== + 0 + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 584; + this.bitwiseShiftExpression(0); + } + } + } + this.state = 589; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 50, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3212,8 +3691,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3238,56 +3716,57 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnEqualityExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 591; - this.relationalExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 598; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnEqualityExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualEqualityExpressionContext(new EqualityExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_equalityExpression); - this.state = 593; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 594; - _la = this._input.LA(1); - if (!(_la === KipperParser.Equal || _la === KipperParser.NotEqual)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 595; + this.state = 591; this.relationalExpression(0); - } - } } - this.state = 600; + this._ctx._stop = this._input.tryLT(-1); + this.state = 598; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualEqualityExpressionContext( + new EqualityExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_equalityExpression); + this.state = 593; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 594; + _la = this._input.LA(1); + if (!(_la === KipperParser.Equal || _la === KipperParser.NotEqual)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 595; + this.relationalExpression(0); + } + } + } + this.state = 600; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3295,8 +3774,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3320,46 +3798,47 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnBitwiseAndExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 602; - this.equalityExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 609; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnBitwiseAndExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualBitwiseAndExpressionContext(new BitwiseAndExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseAndExpression); - this.state = 604; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 605; - this.match(KipperParser.BitwiseAnd); - this.state = 606; - this.equalityExpression(0); - } - } + + this.state = 602; + this.equalityExpression(0); } - this.state = 611; + this._ctx._stop = this._input.tryLT(-1); + this.state = 609; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualBitwiseAndExpressionContext( + new BitwiseAndExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseAndExpression); + this.state = 604; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 605; + this.match(KipperParser.BitwiseAnd); + this.state = 606; + this.equalityExpression(0); + } + } + } + this.state = 611; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3367,8 +3846,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3392,46 +3870,47 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnBitwiseXorExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 613; - this.bitwiseAndExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 620; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 53, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnBitwiseXorExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualBitwiseXorExpressionContext(new BitwiseXorExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseXorExpression); - this.state = 615; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 616; - this.match(KipperParser.BitwiseXor); - this.state = 617; + + this.state = 613; this.bitwiseAndExpression(0); - } - } } - this.state = 622; + this._ctx._stop = this._input.tryLT(-1); + this.state = 620; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 53, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualBitwiseXorExpressionContext( + new BitwiseXorExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseXorExpression); + this.state = 615; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 616; + this.match(KipperParser.BitwiseXor); + this.state = 617; + this.bitwiseAndExpression(0); + } + } + } + this.state = 622; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 53, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3439,8 +3918,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3464,46 +3942,47 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnBitwiseOrExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 624; - this.bitwiseXorExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 631; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 54, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnBitwiseOrExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualBitwiseOrExpressionContext(new BitwiseOrExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseOrExpression); - this.state = 626; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 627; - this.match(KipperParser.BitwiseOr); - this.state = 628; + + this.state = 624; this.bitwiseXorExpression(0); - } - } } - this.state = 633; + this._ctx._stop = this._input.tryLT(-1); + this.state = 631; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 54, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualBitwiseOrExpressionContext( + new BitwiseOrExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseOrExpression); + this.state = 626; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 627; + this.match(KipperParser.BitwiseOr); + this.state = 628; + this.bitwiseXorExpression(0); + } + } + } + this.state = 633; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 54, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3511,8 +3990,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3536,46 +4014,47 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnLogicalAndExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 635; - this.bitwiseOrExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 642; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnLogicalAndExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualLogicalAndExpressionContext(new LogicalAndExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalAndExpression); - this.state = 637; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 638; - this.match(KipperParser.AndAnd); - this.state = 639; + + this.state = 635; this.bitwiseOrExpression(0); - } - } } - this.state = 644; + this._ctx._stop = this._input.tryLT(-1); + this.state = 642; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualLogicalAndExpressionContext( + new LogicalAndExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalAndExpression); + this.state = 637; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 638; + this.match(KipperParser.AndAnd); + this.state = 639; + this.bitwiseOrExpression(0); + } + } + } + this.state = 644; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3583,8 +4062,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3608,46 +4086,47 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnLogicalOrExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 646; - this.logicalAndExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 653; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 56, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnLogicalOrExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualLogicalOrExpressionContext(new LogicalOrExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalOrExpression); - this.state = 648; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 649; - this.match(KipperParser.OrOr); - this.state = 650; + + this.state = 646; this.logicalAndExpression(0); - } - } } - this.state = 655; + this._ctx._stop = this._input.tryLT(-1); + this.state = 653; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 56, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualLogicalOrExpressionContext( + new LogicalOrExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalOrExpression); + this.state = 648; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 649; + this.match(KipperParser.OrOr); + this.state = 650; + this.logicalAndExpression(0); + } + } + } + this.state = 655; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 56, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3655,8 +4134,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3668,35 +4146,34 @@ export class KipperParser extends KipperParserBase { try { this.state = 663; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 57, this._ctx) ) { - case 1: - _localctx = new PassOnConditionalExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 656; - this.logicalOrExpression(0); - } - break; + switch (this.interpreter.adaptivePredict(this._input, 57, this._ctx)) { + case 1: + _localctx = new PassOnConditionalExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 656; + this.logicalOrExpression(0); + } + break; - case 2: - _localctx = new ActualConditionalExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 657; - this.logicalOrExpression(0); - this.state = 658; - this.match(KipperParser.QuestionMark); - this.state = 659; - this.conditionalExpression(); - this.state = 660; - this.match(KipperParser.Colon); - this.state = 661; - this.conditionalExpression(); - } - break; + case 2: + _localctx = new ActualConditionalExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 657; + this.logicalOrExpression(0); + this.state = 658; + this.match(KipperParser.QuestionMark); + this.state = 659; + this.conditionalExpression(); + this.state = 660; + this.match(KipperParser.Colon); + this.state = 661; + this.conditionalExpression(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3704,8 +4181,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -3717,31 +4193,30 @@ export class KipperParser extends KipperParserBase { try { this.state = 670; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 58, this._ctx) ) { - case 1: - _localctx = new PassOnAssignmentExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 665; - this.conditionalExpression(); - } - break; + switch (this.interpreter.adaptivePredict(this._input, 58, this._ctx)) { + case 1: + _localctx = new PassOnAssignmentExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 665; + this.conditionalExpression(); + } + break; - case 2: - _localctx = new ActualAssignmentExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 666; - this.computedPrimaryExpression(0); - this.state = 667; - this.assignmentOperator(); - this.state = 668; - this.assignmentExpression(); - } - break; + case 2: + _localctx = new ActualAssignmentExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 666; + this.computedPrimaryExpression(0); + this.state = 667; + this.assignmentOperator(); + this.state = 668; + this.assignmentExpression(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3749,8 +4224,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -3763,21 +4237,32 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 672; - _la = this._input.LA(1); - if (!(((((_la - 53)) & ~0x1F) === 0 && ((1 << (_la - 53)) & ((1 << (KipperParser.Assign - 53)) | (1 << (KipperParser.PlusAssign - 53)) | (1 << (KipperParser.MinusAssign - 53)) | (1 << (KipperParser.StarAssign - 53)) | (1 << (KipperParser.DivAssign - 53)) | (1 << (KipperParser.ModAssign - 53)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 672; + _la = this._input.LA(1); + if ( + !( + ((_la - 53) & ~0x1f) === 0 && + ((1 << (_la - 53)) & + ((1 << (KipperParser.Assign - 53)) | + (1 << (KipperParser.PlusAssign - 53)) | + (1 << (KipperParser.MinusAssign - 53)) | + (1 << (KipperParser.StarAssign - 53)) | + (1 << (KipperParser.DivAssign - 53)) | + (1 << (KipperParser.ModAssign - 53)))) !== + 0 + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3785,8 +4270,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -3799,29 +4283,28 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 674; - this.assignmentExpression(); - this.state = 679; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 59, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 675; - this.match(KipperParser.Comma); - this.state = 676; - this.assignmentExpression(); - } - } - } - this.state = 681; + this.state = 674; + this.assignmentExpression(); + this.state = 679; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 59, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 675; + this.match(KipperParser.Comma); + this.state = 676; + this.assignmentExpression(); + } + } + } + this.state = 681; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 59, this._ctx); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3829,8 +4312,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -3842,33 +4324,32 @@ export class KipperParser extends KipperParserBase { try { this.state = 685; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 60, this._ctx) ) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 682; - this.identifierTypeSpecifierExpression(); - } - break; + switch (this.interpreter.adaptivePredict(this._input, 60, this._ctx)) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 682; + this.identifierTypeSpecifierExpression(); + } + break; - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 683; - this.genericTypeSpecifierExpression(); - } - break; + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 683; + this.genericTypeSpecifierExpression(); + } + break; - case 3: - this.enterOuterAlt(_localctx, 3); - { - this.state = 684; - this.typeofTypeSpecifierExpression(); - } - break; + case 3: + this.enterOuterAlt(_localctx, 3); + { + this.state = 684; + this.typeofTypeSpecifierExpression(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3876,24 +4357,25 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public identifierTypeSpecifierExpression(): IdentifierTypeSpecifierExpressionContext { - let _localctx: IdentifierTypeSpecifierExpressionContext = new IdentifierTypeSpecifierExpressionContext(this._ctx, this.state); + let _localctx: IdentifierTypeSpecifierExpressionContext = new IdentifierTypeSpecifierExpressionContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 148, KipperParser.RULE_identifierTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 687; - this.typeSpecifierIdentifier(); + this.state = 687; + this.typeSpecifierIdentifier(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3901,30 +4383,31 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public genericTypeSpecifierExpression(): GenericTypeSpecifierExpressionContext { - let _localctx: GenericTypeSpecifierExpressionContext = new GenericTypeSpecifierExpressionContext(this._ctx, this.state); + let _localctx: GenericTypeSpecifierExpressionContext = new GenericTypeSpecifierExpressionContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 150, KipperParser.RULE_genericTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 689; - this.typeSpecifierIdentifier(); - this.state = 690; - this.match(KipperParser.Less); - this.state = 691; - this.typeSpecifierIdentifier(); - this.state = 692; - this.match(KipperParser.Greater); - } - } - catch (re) { + this.state = 689; + this.typeSpecifierIdentifier(); + this.state = 690; + this.match(KipperParser.Less); + this.state = 691; + this.typeSpecifierIdentifier(); + this.state = 692; + this.match(KipperParser.Greater); + } + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3932,30 +4415,31 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public typeofTypeSpecifierExpression(): TypeofTypeSpecifierExpressionContext { - let _localctx: TypeofTypeSpecifierExpressionContext = new TypeofTypeSpecifierExpressionContext(this._ctx, this.state); + let _localctx: TypeofTypeSpecifierExpressionContext = new TypeofTypeSpecifierExpressionContext( + this._ctx, + this.state, + ); this.enterRule(_localctx, 152, KipperParser.RULE_typeofTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 694; - this.match(KipperParser.Typeof); - this.state = 695; - this.match(KipperParser.LeftParen); - this.state = 696; - this.typeSpecifierIdentifier(); - this.state = 697; - this.match(KipperParser.RightParen); + this.state = 694; + this.match(KipperParser.Typeof); + this.state = 695; + this.match(KipperParser.LeftParen); + this.state = 696; + this.typeSpecifierIdentifier(); + this.state = 697; + this.match(KipperParser.RightParen); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3963,8 +4447,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -3977,21 +4460,27 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 699; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0) || _la === KipperParser.Identifier)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 699; + _la = this._input.LA(1); + if ( + !( + ((_la & ~0x1f) === 0 && + ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== + 0) || + _la === KipperParser.Identifier + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3999,8 +4488,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -4008,134 +4496,134 @@ export class KipperParser extends KipperParserBase { public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { switch (ruleIndex) { - case 18: - return this.compoundStatement_sempred(_localctx as CompoundStatementContext, predIndex); + case 18: + return this.compoundStatement_sempred(_localctx as CompoundStatementContext, predIndex); - case 45: - return this.computedPrimaryExpression_sempred(_localctx as ComputedPrimaryExpressionContext, predIndex); + case 45: + return this.computedPrimaryExpression_sempred(_localctx as ComputedPrimaryExpressionContext, predIndex); - case 58: - return this.multiplicativeExpression_sempred(_localctx as MultiplicativeExpressionContext, predIndex); + case 58: + return this.multiplicativeExpression_sempred(_localctx as MultiplicativeExpressionContext, predIndex); - case 59: - return this.additiveExpression_sempred(_localctx as AdditiveExpressionContext, predIndex); + case 59: + return this.additiveExpression_sempred(_localctx as AdditiveExpressionContext, predIndex); - case 60: - return this.bitwiseShiftExpression_sempred(_localctx as BitwiseShiftExpressionContext, predIndex); + case 60: + return this.bitwiseShiftExpression_sempred(_localctx as BitwiseShiftExpressionContext, predIndex); - case 62: - return this.relationalExpression_sempred(_localctx as RelationalExpressionContext, predIndex); + case 62: + return this.relationalExpression_sempred(_localctx as RelationalExpressionContext, predIndex); - case 63: - return this.equalityExpression_sempred(_localctx as EqualityExpressionContext, predIndex); + case 63: + return this.equalityExpression_sempred(_localctx as EqualityExpressionContext, predIndex); - case 64: - return this.bitwiseAndExpression_sempred(_localctx as BitwiseAndExpressionContext, predIndex); + case 64: + return this.bitwiseAndExpression_sempred(_localctx as BitwiseAndExpressionContext, predIndex); - case 65: - return this.bitwiseXorExpression_sempred(_localctx as BitwiseXorExpressionContext, predIndex); + case 65: + return this.bitwiseXorExpression_sempred(_localctx as BitwiseXorExpressionContext, predIndex); - case 66: - return this.bitwiseOrExpression_sempred(_localctx as BitwiseOrExpressionContext, predIndex); + case 66: + return this.bitwiseOrExpression_sempred(_localctx as BitwiseOrExpressionContext, predIndex); - case 67: - return this.logicalAndExpression_sempred(_localctx as LogicalAndExpressionContext, predIndex); + case 67: + return this.logicalAndExpression_sempred(_localctx as LogicalAndExpressionContext, predIndex); - case 68: - return this.logicalOrExpression_sempred(_localctx as LogicalOrExpressionContext, predIndex); + case 68: + return this.logicalOrExpression_sempred(_localctx as LogicalOrExpressionContext, predIndex); } return true; } private compoundStatement_sempred(_localctx: CompoundStatementContext, predIndex: number): boolean { switch (predIndex) { - case 0: - return this.notInsideExpressionStatement(); + case 0: + return this.notInsideExpressionStatement(); } return true; } private computedPrimaryExpression_sempred(_localctx: ComputedPrimaryExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 1: - return this.precpred(this._ctx, 5); + case 1: + return this.precpred(this._ctx, 5); - case 2: - return this.precpred(this._ctx, 3); + case 2: + return this.precpred(this._ctx, 3); - case 3: - return this.precpred(this._ctx, 2); + case 3: + return this.precpred(this._ctx, 2); - case 4: - return this.precpred(this._ctx, 1); + case 4: + return this.precpred(this._ctx, 1); } return true; } private multiplicativeExpression_sempred(_localctx: MultiplicativeExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 5: - return this.precpred(this._ctx, 1); + case 5: + return this.precpred(this._ctx, 1); } return true; } private additiveExpression_sempred(_localctx: AdditiveExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 6: - return this.precpred(this._ctx, 1); + case 6: + return this.precpred(this._ctx, 1); } return true; } private bitwiseShiftExpression_sempred(_localctx: BitwiseShiftExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 7: - return this.precpred(this._ctx, 1); + case 7: + return this.precpred(this._ctx, 1); } return true; } private relationalExpression_sempred(_localctx: RelationalExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 8: - return this.precpred(this._ctx, 1); + case 8: + return this.precpred(this._ctx, 1); } return true; } private equalityExpression_sempred(_localctx: EqualityExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 9: - return this.precpred(this._ctx, 1); + case 9: + return this.precpred(this._ctx, 1); } return true; } private bitwiseAndExpression_sempred(_localctx: BitwiseAndExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 10: - return this.precpred(this._ctx, 1); + case 10: + return this.precpred(this._ctx, 1); } return true; } private bitwiseXorExpression_sempred(_localctx: BitwiseXorExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 11: - return this.precpred(this._ctx, 1); + case 11: + return this.precpred(this._ctx, 1); } return true; } private bitwiseOrExpression_sempred(_localctx: BitwiseOrExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 12: - return this.precpred(this._ctx, 1); + case 12: + return this.precpred(this._ctx, 1); } return true; } private logicalAndExpression_sempred(_localctx: LogicalAndExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 13: - return this.precpred(this._ctx, 1); + case 13: + return this.precpred(this._ctx, 1); } return true; } private logicalOrExpression_sempred(_localctx: LogicalOrExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 14: - return this.precpred(this._ctx, 1); + case 14: + return this.precpred(this._ctx, 1); } return true; } @@ -4148,8 +4636,8 @@ export class KipperParser extends KipperParserBase { "\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t\x12\x04" + "\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17\t\x17\x04" + "\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B\x04\x1C\t\x1C\x04" + - "\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04\"\t\"\x04#" + - "\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(\x04)\t)\x04*\t*\x04+\t+" + + '\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04"\t"\x04#' + + "\t#\x04$\t$\x04%\t%\x04&\t&\x04'\t'\x04(\t(\x04)\t)\x04*\t*\x04+\t+" + "\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x040\t0\x041\t1\x042\t2\x043\t3\x044" + "\t4\x045\t5\x046\t6\x047\t7\x048\t8\x049\t9\x04:\t:\x04;\t;\x04<\t<\x04" + "=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x04B\tB\x04C\tC\x04D\tD\x04E\tE\x04" + @@ -4177,9 +4665,9 @@ export class KipperParser extends KipperParserBase { "\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\u015A\n\x1F\x03\x1F\x03" + "\x1F\x03 \x03 \x03 \x03 \x03 \x03 \x03 \x03 \x03 \x05 \u0167\n \x03!\x03" + - "!\x03!\x03!\x03\"\x03\"\x03#\x03#\x03$\x03$\x03%\x03%\x05%\u0175\n%\x03" + - "&\x03&\x03\'\x03\'\x07\'\u017B\n\'\f\'\x0E\'\u017E\v\'\x03\'\x03\'\x03" + - "\'\x07\'\u0183\n\'\f\'\x0E\'\u0186\v\'\x03\'\x05\'\u0189\n\'\x03(\x03" + + '!\x03!\x03!\x03"\x03"\x03#\x03#\x03$\x03$\x03%\x03%\x05%\u0175\n%\x03' + + "&\x03&\x03'\x03'\x07'\u017B\n'\f'\x0E'\u017E\v'\x03'\x03'\x03" + + "'\x07'\u0183\n'\f'\x0E'\u0186\v'\x03'\x05'\u0189\n'\x03(\x03" + "(\x03(\x05(\u018E\n(\x03(\x05(\u0191\n(\x03)\x03)\x03)\x05)\u0196\n)\x03" + ")\x05)\u0199\n)\x03*\x03*\x03+\x03+\x03+\x03+\x07+\u01A1\n+\f+\x0E+\u01A4" + "\v+\x05+\u01A6\n+\x03+\x05+\u01A9\n+\x03+\x03+\x03,\x03,\x03,\x03,\x07" + @@ -4206,7 +4694,7 @@ export class KipperParser extends KipperParserBase { "K\x05K\u02B0\nK\x03L\x03L\x03M\x03M\x03M\x03M\x03M\x03N\x03N\x03N\x03" + "N\x03N\x03O\x03O\x03O\x02\x02\r\\vxz~\x80\x82\x84\x86\x88\x8AP\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" + + '\x02\x18\x02\x1A\x02\x1C\x02\x1E\x02 \x02"\x02$\x02&\x02(\x02*\x02,\x02' + ".\x020\x022\x024\x026\x028\x02:\x02<\x02>\x02@\x02B\x02D\x02F\x02H\x02" + "J\x02L\x02N\x02P\x02R\x02T\x02V\x02X\x02Z\x02\\\x02^\x02`\x02b\x02d\x02" + "f\x02h\x02j\x02l\x02n\x02p\x02r\x02t\x02v\x02x\x02z\x02|\x02~\x02\x80" + @@ -4219,7 +4707,7 @@ export class KipperParser extends KipperParserBase { "\x02\x02\x02\f\xBA\x03\x02\x02\x02\x0E\xBC\x03\x02\x02\x02\x10\xBF\x03" + "\x02\x02\x02\x12\xC1\x03\x02\x02\x02\x14\xC8\x03\x02\x02\x02\x16\xCA\x03" + "\x02\x02\x02\x18\xCC\x03\x02\x02\x02\x1A\xCE\x03\x02\x02\x02\x1C\xDA\x03" + - "\x02\x02\x02\x1E\xE2\x03\x02\x02\x02 \xE6\x03\x02\x02\x02\"\xEB\x03\x02" + + '\x02\x02\x02\x1E\xE2\x03\x02\x02\x02 \xE6\x03\x02\x02\x02"\xEB\x03\x02' + "\x02\x02$\xF6\x03\x02\x02\x02&\xF8\x03\x02\x02\x02(\xFF\x03\x02\x02\x02" + "*\u0106\x03\x02\x02\x02,\u0108\x03\x02\x02\x02.\u0111\x03\x02\x02\x02" + "0\u0126\x03\x02\x02\x022\u012B\x03\x02\x02\x024\u012D\x03\x02\x02\x02" + @@ -4248,10 +4736,10 @@ export class KipperParser extends KipperParserBase { "\x05\x02\xA9\x07\x03\x02\x02\x02\xAA\xAC\x05\n\x06\x02\xAB\xAA\x03\x02" + "\x02\x02\xAC\xAD\x03\x02\x02\x02\xAD\xAB\x03\x02\x02\x02\xAD\xAE\x03\x02" + "\x02\x02\xAE\t\x03\x02\x02\x02\xAF\xB3\x05$\x13\x02\xB0\xB3\x05\f\x07" + - "\x02\xB1\xB3\x07\"\x02\x02\xB2\xAF\x03\x02\x02\x02\xB2\xB0\x03\x02\x02" + + '\x02\xB1\xB3\x07"\x02\x02\xB2\xAF\x03\x02\x02\x02\xB2\xB0\x03\x02\x02' + "\x02\xB2\xB1\x03\x02\x02\x02\xB3\v\x03\x02\x02\x02\xB4\xB5\x05\x0E\b\x02" + - "\xB5\xB6\x07\"\x02\x02\xB6\xBB\x03\x02\x02\x02\xB7\xBB\x05\x1A\x0E\x02" + - "\xB8\xBB\x05 \x11\x02\xB9\xBB\x05\"\x12\x02\xBA\xB4\x03\x02\x02\x02\xBA" + + '\xB5\xB6\x07"\x02\x02\xB6\xBB\x03\x02\x02\x02\xB7\xBB\x05\x1A\x0E\x02' + + '\xB8\xBB\x05 \x11\x02\xB9\xBB\x05"\x12\x02\xBA\xB4\x03\x02\x02\x02\xBA' + "\xB7\x03\x02\x02\x02\xBA\xB8\x03\x02\x02\x02\xBA\xB9\x03\x02\x02\x02\xBB" + "\r\x03\x02\x02\x02\xBC\xBD\x05\x10\t\x02\xBD\xBE\x05\x12\n\x02\xBE\x0F" + "\x03\x02\x02\x02\xBF\xC0\t\x02\x02\x02\xC0\x11\x03\x02\x02\x02\xC1\xC2" + @@ -4277,8 +4765,8 @@ export class KipperParser extends KipperParserBase { "\x02\xF6\xF3\x03\x02\x02\x02\xF6\xF4\x03\x02\x02\x02\xF6\xF5\x03\x02\x02" + "\x02\xF7%\x03\x02\x02\x02\xF8\xF9\x06\x14\x02\x02\xF9\xFB\x07*\x02\x02" + "\xFA\xFC\x05\b\x05\x02\xFB\xFA\x03\x02\x02\x02\xFB\xFC\x03\x02\x02\x02" + - "\xFC\xFD\x03\x02\x02\x02\xFD\xFE\x07+\x02\x02\xFE\'\x03\x02\x02\x02\xFF" + - "\u0100\b\x15\x01\x02\u0100\u0101\x05\x92J\x02\u0101\u0102\x07\"\x02\x02" + + "\xFC\xFD\x03\x02\x02\x02\xFD\xFE\x07+\x02\x02\xFE'\x03\x02\x02\x02\xFF" + + '\u0100\b\x15\x01\x02\u0100\u0101\x05\x92J\x02\u0101\u0102\x07"\x02\x02' + "\u0102\u0103\b\x15\x01\x02\u0103)\x03\x02\x02\x02\u0104\u0107\x05,\x17" + "\x02\u0105\u0107\x05.\x18\x02\u0106\u0104\x03\x02\x02\x02\u0106\u0105" + "\x03\x02\x02\x02\u0107+\x03\x02\x02\x02\u0108\u0109\x07\x11\x02\x02\u0109" + @@ -4301,10 +4789,10 @@ export class KipperParser extends KipperParserBase { "\x02\u0130\u0132\x05\x92J\x02\u0131\u012F\x03\x02\x02\x02\u0131\u0130" + "\x03\x02\x02\x02\u0132\u0133\x03\x02\x02\x02\u0133\u0134\b\x1B\x01\x02" + "\u0134\u0136\x03\x02\x02\x02\u0135\u0131\x03\x02\x02\x02\u0135\u0136\x03" + - "\x02\x02\x02\u0136\u0137\x03\x02\x02\x02\u0137\u013B\x07\"\x02\x02\u0138" + + '\x02\x02\x02\u0136\u0137\x03\x02\x02\x02\u0137\u013B\x07"\x02\x02\u0138' + "\u0139\x05\x92J\x02\u0139\u013A\b\x1B\x01\x02\u013A\u013C\x03\x02\x02" + "\x02\u013B\u0138\x03\x02\x02\x02\u013B\u013C\x03\x02\x02\x02\u013C\u013D" + - "\x03\x02\x02\x02\u013D\u0141\x07\"\x02\x02\u013E\u013F\x05\x92J\x02\u013F" + + '\x03\x02\x02\x02\u013D\u0141\x07"\x02\x02\u013E\u013F\x05\x92J\x02\u013F' + "\u0140\b\x1B\x01\x02\u0140\u0142\x03\x02\x02\x02\u0141\u013E\x03\x02\x02" + "\x02\u0141\u0142\x03\x02\x02\x02\u0142\u0143\x03\x02\x02\x02\u0143\u0144" + "\x07&\x02\x02\u0144\u0145\x05$\x13\x02\u01455\x03\x02\x02\x02\u0146\u0147" + @@ -4312,13 +4800,13 @@ export class KipperParser extends KipperParserBase { "\u014A\x07&\x02\x02\u014A\u014B\x05$\x13\x02\u014B7\x03\x02\x02\x02\u014C" + "\u014D\x07\x0F\x02\x02\u014D\u014E\x05$\x13\x02\u014E\u014F\x07\x10\x02" + "\x02\u014F\u0150\x07%\x02\x02\u0150\u0151\x05\x92J\x02\u0151\u0152\x07" + - "&\x02\x02\u0152\u0153\x07\"\x02\x02\u01539\x03\x02\x02\x02\u0154\u0155" + - "\t\x03\x02\x02\u0155\u0156\x07\"\x02\x02\u0156;\x03\x02\x02\x02\u0157" + + '&\x02\x02\u0152\u0153\x07"\x02\x02\u01539\x03\x02\x02\x02\u0154\u0155' + + '\t\x03\x02\x02\u0155\u0156\x07"\x02\x02\u0156;\x03\x02\x02\x02\u0157' + "\u0159\x07\x16\x02\x02\u0158\u015A\x05\x92J\x02\u0159\u0158\x03\x02\x02" + "\x02\u0159\u015A\x03\x02\x02\x02\u015A\u015B\x03\x02\x02\x02\u015B\u015C" + - "\x07\"\x02\x02\u015C=\x03\x02\x02\x02\u015D\u0167\x05@!\x02\u015E\u0167" + - "\x05T+\x02\u015F\u0167\x05V,\x02\u0160\u0167\x05B\"\x02\u0161\u0167\x05" + - "D#\x02\u0162\u0167\x05J&\x02\u0163\u0167\x05L\'\x02\u0164\u0167\x05R*" + + '\x07"\x02\x02\u015C=\x03\x02\x02\x02\u015D\u0167\x05@!\x02\u015E\u0167' + + '\x05T+\x02\u015F\u0167\x05V,\x02\u0160\u0167\x05B"\x02\u0161\u0167\x05' + + "D#\x02\u0162\u0167\x05J&\x02\u0163\u0167\x05L'\x02\u0164\u0167\x05R*" + "\x02\u0165\u0167\x05Z.\x02\u0166\u015D\x03\x02\x02\x02\u0166\u015E\x03" + "\x02\x02\x02\u0166\u015F\x03\x02\x02\x02\u0166\u0160\x03\x02\x02\x02\u0166" + "\u0161\x03\x02\x02\x02\u0166\u0162\x03\x02\x02\x02\u0166\u0163\x03\x02" + @@ -4345,7 +4833,7 @@ export class KipperParser extends KipperParserBase { "\u0195\u0196\x03\x02\x02\x02\u0196\u0197\x03\x02\x02\x02\u0197\u0199\x07" + ")\x02\x02\u0198\u0192\x03\x02\x02\x02\u0198\u0193\x03\x02\x02\x02\u0199" + "Q\x03\x02\x02\x02\u019A\u019B\t\x06\x02\x02\u019BS\x03\x02\x02\x02\u019C" + - "\u01A5\x07\'\x02\x02\u019D\u01A2\x05\x92J\x02\u019E\u019F\x07!\x02\x02" + + "\u01A5\x07'\x02\x02\u019D\u01A2\x05\x92J\x02\u019E\u019F\x07!\x02\x02" + "\u019F\u01A1\x05\x92J\x02\u01A0\u019E\x03\x02\x02\x02\u01A1\u01A4\x03" + "\x02\x02\x02\u01A2\u01A0\x03\x02\x02\x02\u01A2\u01A3\x03\x02\x02\x02\u01A3" + "\u01A6\x03\x02\x02\x02\u01A4\u01A2\x03\x02\x02\x02\u01A5\u019D\x03\x02" + @@ -4381,9 +4869,9 @@ export class KipperParser extends KipperParserBase { "\x05\x8EH\x02\u01EA\u01E8\x03\x02\x02\x02\u01EB\u01EE\x03\x02\x02\x02" + "\u01EC\u01EA\x03\x02\x02\x02\u01EC\u01ED\x03\x02\x02\x02\u01ED_\x03\x02" + "\x02\x02\u01EE\u01EC\x03\x02\x02\x02\u01EF\u01F0\x07J\x02\x02\u01F0\u01F1" + - "\x05F$\x02\u01F1a\x03\x02\x02\x02\u01F2\u01F3\x07\'\x02\x02\u01F3\u01F4" + + "\x05F$\x02\u01F1a\x03\x02\x02\x02\u01F2\u01F3\x07'\x02\x02\u01F3\u01F4" + "\x05\x92J\x02\u01F4\u01F5\x07(\x02\x02\u01F5c\x03\x02\x02\x02\u01F6\u01FA" + - "\x07\'\x02\x02\u01F7\u01F8\x05\x92J\x02\u01F8\u01F9\b3\x01\x02\u01F9\u01FB" + + "\x07'\x02\x02\u01F7\u01F8\x05\x92J\x02\u01F8\u01F9\b3\x01\x02\u01F9\u01FB" + "\x03\x02\x02\x02\u01FA\u01F7\x03\x02\x02\x02\u01FA\u01FB\x03\x02\x02\x02" + "\u01FB\u01FC\x03\x02\x02\x02\u01FC\u0200\x07$\x02\x02\u01FD\u01FE\x05" + "\x92J\x02\u01FE\u01FF\b3\x01\x02\u01FF\u0201\x03\x02\x02\x02\u0200\u01FD" + @@ -4472,10 +4960,7 @@ export class KipperParser extends KipperParserBase { "\u0234\u0240\u024D\u0258\u0263\u026E\u0279\u0284\u028F\u0299\u02A0\u02A9" + "\u02AF"; public static readonly _serializedATN: string = Utils.join( - [ - KipperParser._serializedATNSegment0, - KipperParser._serializedATNSegment1, - ], + [KipperParser._serializedATNSegment0, KipperParser._serializedATNSegment1], "", ); public static __ATN: ATN; @@ -4486,11 +4971,12 @@ export class KipperParser extends KipperParserBase { return KipperParser.__ATN; } - } export class CompilationUnitContext extends KipperParserRuleContext { - public EOF(): TerminalNode { return this.getToken(KipperParser.EOF, 0); } + public EOF(): TerminalNode { + return this.getToken(KipperParser.EOF, 0); + } public translationUnit(): TranslationUnitContext | undefined { return this.tryGetRuleContext(0, TranslationUnitContext); } @@ -4498,7 +4984,9 @@ export class CompilationUnitContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_compilationUnit; } + public get ruleIndex(): number { + return KipperParser.RULE_compilationUnit; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterCompilationUnit) { @@ -4521,7 +5009,6 @@ export class CompilationUnitContext extends KipperParserRuleContext { } } - export class TranslationUnitContext extends KipperParserRuleContext { public externalItem(): ExternalItemContext[]; public externalItem(i: number): ExternalItemContext; @@ -4536,7 +5023,9 @@ export class TranslationUnitContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_translationUnit; } + public get ruleIndex(): number { + return KipperParser.RULE_translationUnit; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTranslationUnit) { @@ -4559,13 +5048,14 @@ export class TranslationUnitContext extends KipperParserRuleContext { } } - export class ExternalItemContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_externalItem; } + public get ruleIndex(): number { + return KipperParser.RULE_externalItem; + } public copyFrom(ctx: ExternalItemContext): void { super.copyFrom(ctx); } @@ -4600,7 +5090,6 @@ export class ExternalBlockItemContext extends ExternalItemContext { } } - export class BlockItemListContext extends KipperParserRuleContext { public blockItem(): BlockItemContext[]; public blockItem(i: number): BlockItemContext; @@ -4615,7 +5104,9 @@ export class BlockItemListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_blockItemList; } + public get ruleIndex(): number { + return KipperParser.RULE_blockItemList; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBlockItemList) { @@ -4638,7 +5129,6 @@ export class BlockItemListContext extends KipperParserRuleContext { } } - export class BlockItemContext extends KipperParserRuleContext { public statement(): StatementContext | undefined { return this.tryGetRuleContext(0, StatementContext); @@ -4646,12 +5136,16 @@ export class BlockItemContext extends KipperParserRuleContext { public declaration(): DeclarationContext | undefined { return this.tryGetRuleContext(0, DeclarationContext); } - public SemiColon(): TerminalNode | undefined { return this.tryGetToken(KipperParser.SemiColon, 0); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_blockItem; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBlockItem) { @@ -4674,12 +5168,13 @@ export class BlockItemContext extends KipperParserRuleContext { } } - 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 SemiColon(): TerminalNode | undefined { + return this.tryGetToken(KipperParser.SemiColon, 0); + } public functionDeclaration(): FunctionDeclarationContext | undefined { return this.tryGetRuleContext(0, FunctionDeclarationContext); } @@ -4693,7 +5188,9 @@ export class DeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_declaration; } + public get ruleIndex(): number { + return KipperParser.RULE_declaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDeclaration) { @@ -4716,7 +5213,6 @@ export class DeclarationContext extends KipperParserRuleContext { } } - export class VariableDeclarationContext extends KipperParserRuleContext { public storageTypeSpecifier(): StorageTypeSpecifierContext { return this.getRuleContext(0, StorageTypeSpecifierContext); @@ -4728,7 +5224,9 @@ export class VariableDeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_variableDeclaration; } + public get ruleIndex(): number { + return KipperParser.RULE_variableDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterVariableDeclaration) { @@ -4751,15 +5249,20 @@ export class VariableDeclarationContext extends KipperParserRuleContext { } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_storageTypeSpecifier; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStorageTypeSpecifier) { @@ -4782,16 +5285,19 @@ export class StorageTypeSpecifierContext extends KipperParserRuleContext { } } - export class InitDeclaratorContext extends KipperParserRuleContext { public declarator(): DeclaratorContext { return this.getRuleContext(0, DeclaratorContext); } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } + 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 Assign(): TerminalNode | undefined { + return this.tryGetToken(KipperParser.Assign, 0); + } public initializer(): InitializerContext | undefined { return this.tryGetRuleContext(0, InitializerContext); } @@ -4799,7 +5305,9 @@ export class InitDeclaratorContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_initDeclarator; } + public get ruleIndex(): number { + return KipperParser.RULE_initDeclarator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterInitDeclarator) { @@ -4822,7 +5330,6 @@ export class InitDeclaratorContext extends KipperParserRuleContext { } } - export class InitializerContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext { return this.getRuleContext(0, AssignmentExpressionContext); @@ -4831,7 +5338,9 @@ export class InitializerContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_initializer; } + public get ruleIndex(): number { + return KipperParser.RULE_initializer; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterInitializer) { @@ -4854,7 +5363,6 @@ export class InitializerContext extends KipperParserRuleContext { } } - export class DeclaratorContext extends KipperParserRuleContext { public directDeclarator(): DirectDeclaratorContext { return this.getRuleContext(0, DirectDeclaratorContext); @@ -4863,7 +5371,9 @@ export class DeclaratorContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_declarator; } + public get ruleIndex(): number { + return KipperParser.RULE_declarator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDeclarator) { @@ -4886,14 +5396,17 @@ export class DeclaratorContext extends KipperParserRuleContext { } } - export class DirectDeclaratorContext extends KipperParserRuleContext { - public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_directDeclarator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDirectDeclarator) { @@ -4916,15 +5429,22 @@ export class DirectDeclaratorContext extends KipperParserRuleContext { } } - export class FunctionDeclarationContext extends KipperParserRuleContext { - public DefFunc(): TerminalNode { return this.getToken(KipperParser.DefFunc, 0); } + 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 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); } @@ -4938,7 +5458,9 @@ export class FunctionDeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_functionDeclaration; } + public get ruleIndex(): number { + return KipperParser.RULE_functionDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFunctionDeclaration) { @@ -4961,7 +5483,6 @@ export class FunctionDeclarationContext extends KipperParserRuleContext { } } - export class ParameterListContext extends KipperParserRuleContext { public parameterDeclaration(): ParameterDeclarationContext[]; public parameterDeclaration(i: number): ParameterDeclarationContext; @@ -4985,7 +5506,9 @@ export class ParameterListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_parameterList; } + public get ruleIndex(): number { + return KipperParser.RULE_parameterList; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterParameterList) { @@ -5008,12 +5531,13 @@ export class ParameterListContext extends KipperParserRuleContext { } } - export class ParameterDeclarationContext extends KipperParserRuleContext { public declarator(): DeclaratorContext { return this.getRuleContext(0, DeclaratorContext); } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } + public Colon(): TerminalNode { + return this.getToken(KipperParser.Colon, 0); + } public typeSpecifierExpression(): TypeSpecifierExpressionContext { return this.getRuleContext(0, TypeSpecifierExpressionContext); } @@ -5021,7 +5545,9 @@ export class ParameterDeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_parameterDeclaration; } + public get ruleIndex(): number { + return KipperParser.RULE_parameterDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterParameterDeclaration) { @@ -5044,17 +5570,26 @@ export class ParameterDeclarationContext extends KipperParserRuleContext { } } - export class InterfaceDeclarationContext extends KipperParserRuleContext { - public Interface(): TerminalNode { return this.getToken(KipperParser.Interface, 0); } - public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } - public LeftBrace(): TerminalNode { return this.getToken(KipperParser.LeftBrace, 0); } - public RightBrace(): TerminalNode { return this.getToken(KipperParser.RightBrace, 0); } + public Interface(): TerminalNode { + return this.getToken(KipperParser.Interface, 0); + } + public Identifier(): TerminalNode { + return this.getToken(KipperParser.Identifier, 0); + } + 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_interfaceDeclaration; } + public get ruleIndex(): number { + return KipperParser.RULE_interfaceDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterInterfaceDeclaration) { @@ -5077,17 +5612,26 @@ 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); } - public LeftBrace(): TerminalNode { return this.getToken(KipperParser.LeftBrace, 0); } - public RightBrace(): TerminalNode { return this.getToken(KipperParser.RightBrace, 0); } + public Class(): TerminalNode { + return this.getToken(KipperParser.Class, 0); + } + public Identifier(): TerminalNode { + return this.getToken(KipperParser.Identifier, 0); + } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_classDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterClassDeclaration) { @@ -5110,7 +5654,6 @@ export class ClassDeclarationContext extends KipperParserRuleContext { } } - export class StatementContext extends KipperParserRuleContext { public expressionStatement(): ExpressionStatementContext | undefined { return this.tryGetRuleContext(0, ExpressionStatementContext); @@ -5134,7 +5677,9 @@ export class StatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_statement; } + public get ruleIndex(): number { + return KipperParser.RULE_statement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStatement) { @@ -5157,10 +5702,13 @@ export class StatementContext extends KipperParserRuleContext { } } - export class CompoundStatementContext extends KipperParserRuleContext { - public LeftBrace(): TerminalNode { return this.getToken(KipperParser.LeftBrace, 0); } - public RightBrace(): TerminalNode { return this.getToken(KipperParser.RightBrace, 0); } + 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); } @@ -5168,7 +5716,9 @@ export class CompoundStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_compoundStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_compoundStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterCompoundStatement) { @@ -5191,17 +5741,20 @@ export class CompoundStatementContext extends KipperParserRuleContext { } } - export class ExpressionStatementContext extends KipperParserRuleContext { public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } - public SemiColon(): TerminalNode { return this.getToken(KipperParser.SemiColon, 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_expressionStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_expressionStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterExpressionStatement) { @@ -5224,7 +5777,6 @@ export class ExpressionStatementContext extends KipperParserRuleContext { } } - export class SelectionStatementContext extends KipperParserRuleContext { public ifStatement(): IfStatementContext | undefined { return this.tryGetRuleContext(0, IfStatementContext); @@ -5236,7 +5788,9 @@ export class SelectionStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_selectionStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_selectionStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSelectionStatement) { @@ -5259,14 +5813,19 @@ export class SelectionStatementContext extends KipperParserRuleContext { } } - export class IfStatementContext extends KipperParserRuleContext { - public If(): TerminalNode { return this.getToken(KipperParser.If, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } + 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 RightParen(): TerminalNode { + return this.getToken(KipperParser.RightParen, 0); + } public statement(): StatementContext[]; public statement(i: number): StatementContext; public statement(i?: number): StatementContext | StatementContext[] { @@ -5276,12 +5835,16 @@ export class IfStatementContext extends KipperParserRuleContext { return this.getRuleContext(i, StatementContext); } } - public Else(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Else, 0); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_ifStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIfStatement) { @@ -5304,16 +5867,25 @@ export class IfStatementContext extends KipperParserRuleContext { } } - export class SwitchStatementContext extends KipperParserRuleContext { - public Switch(): TerminalNode { return this.getToken(KipperParser.Switch, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } + 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 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[] { @@ -5327,7 +5899,9 @@ export class SwitchStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_switchStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_switchStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSwitchStatement) { @@ -5350,22 +5924,29 @@ export class SwitchStatementContext extends KipperParserRuleContext { } } - export class SwitchLabeledStatementContext extends KipperParserRuleContext { - public Case(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Case, 0); } + 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 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_switchLabeledStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSwitchLabeledStatement) { @@ -5388,7 +5969,6 @@ export class SwitchLabeledStatementContext extends KipperParserRuleContext { } } - export class IterationStatementContext extends KipperParserRuleContext { public forLoopIterationStatement(): ForLoopIterationStatementContext | undefined { return this.tryGetRuleContext(0, ForLoopIterationStatementContext); @@ -5403,7 +5983,9 @@ export class IterationStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_iterationStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_iterationStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIterationStatement) { @@ -5426,13 +6008,16 @@ export class IterationStatementContext extends KipperParserRuleContext { } } - 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 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[] { @@ -5442,7 +6027,9 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { return this.getToken(KipperParser.SemiColon, i); } } - public RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } + public RightParen(): TerminalNode { + return this.getToken(KipperParser.RightParen, 0); + } public statement(): StatementContext { return this.getRuleContext(0, StatementContext); } @@ -5462,7 +6049,9 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_forLoopIterationStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_forLoopIterationStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterForLoopIterationStatement) { @@ -5485,14 +6074,19 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { } } - export class WhileLoopIterationStatementContext extends KipperParserRuleContext { - public While(): TerminalNode { return this.getToken(KipperParser.While, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } + 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 RightParen(): TerminalNode { + return this.getToken(KipperParser.RightParen, 0); + } public statement(): StatementContext { return this.getRuleContext(0, StatementContext); } @@ -5500,7 +6094,9 @@ export class WhileLoopIterationStatementContext extends KipperParserRuleContext super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_whileLoopIterationStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_whileLoopIterationStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterWhileLoopIterationStatement) { @@ -5523,24 +6119,35 @@ export class WhileLoopIterationStatementContext extends KipperParserRuleContext } } - export class DoWhileLoopIterationStatementContext extends KipperParserRuleContext { - public Do(): TerminalNode { return this.getToken(KipperParser.Do, 0); } + 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 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_doWhileLoopIterationStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDoWhileLoopIterationStatement) { @@ -5563,16 +6170,23 @@ export class DoWhileLoopIterationStatementContext extends KipperParserRuleContex } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_jumpStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterJumpStatement) { @@ -5595,10 +6209,13 @@ export class JumpStatementContext extends KipperParserRuleContext { } } - export class ReturnStatementContext extends KipperParserRuleContext { - public Return(): TerminalNode { return this.getToken(KipperParser.Return, 0); } - public SemiColon(): TerminalNode { return this.getToken(KipperParser.SemiColon, 0); } + 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); } @@ -5606,7 +6223,9 @@ export class ReturnStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_returnStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_returnStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterReturnStatement) { @@ -5629,7 +6248,6 @@ export class ReturnStatementContext extends KipperParserRuleContext { } } - export class PrimaryExpressionContext extends KipperParserRuleContext { public tangledPrimaryExpression(): TangledPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, TangledPrimaryExpressionContext); @@ -5662,7 +6280,9 @@ export class PrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_primaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_primaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPrimaryExpression) { @@ -5685,18 +6305,23 @@ export class PrimaryExpressionContext extends KipperParserRuleContext { } } - export class TangledPrimaryExpressionContext extends KipperParserRuleContext { - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 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 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; } + public get ruleIndex(): number { + return KipperParser.RULE_tangledPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTangledPrimaryExpression) { @@ -5719,15 +6344,20 @@ export class TangledPrimaryExpressionContext extends KipperParserRuleContext { } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_boolPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBoolPrimaryExpression) { @@ -5750,7 +6380,6 @@ export class BoolPrimaryExpressionContext extends KipperParserRuleContext { } } - export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext { public identifier(): IdentifierContext { return this.getRuleContext(0, IdentifierContext); @@ -5759,7 +6388,9 @@ export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_identifierPrimaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_identifierPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierPrimaryExpression) { @@ -5782,14 +6413,17 @@ export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext } } - export class IdentifierContext extends KipperParserRuleContext { - public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_identifier; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifier) { @@ -5812,7 +6446,6 @@ export class IdentifierContext extends KipperParserRuleContext { } } - export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRuleContext { public identifier(): IdentifierContext | undefined { return this.tryGetRuleContext(0, IdentifierContext); @@ -5824,7 +6457,9 @@ export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRule super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_identifierOrStringPrimaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_identifierOrStringPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierOrStringPrimaryExpression) { @@ -5847,15 +6482,20 @@ export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRule } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_stringPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStringPrimaryExpression) { @@ -5878,10 +6518,13 @@ export class StringPrimaryExpressionContext extends KipperParserRuleContext { } } - 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 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[] { @@ -5891,8 +6534,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 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[] { @@ -5906,7 +6553,9 @@ export class FStringPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_fStringPrimaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_fStringPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringPrimaryExpression) { @@ -5929,11 +6578,16 @@ export class FStringPrimaryExpressionContext extends KipperParserRuleContext { } } - 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 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); } @@ -5941,7 +6595,9 @@ export class FStringSingleQuoteAtomContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_fStringSingleQuoteAtom; } + public get ruleIndex(): number { + return KipperParser.RULE_fStringSingleQuoteAtom; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringSingleQuoteAtom) { @@ -5964,11 +6620,16 @@ export class FStringSingleQuoteAtomContext extends KipperParserRuleContext { } } - 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 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); } @@ -5976,7 +6637,9 @@ export class FStringDoubleQuoteAtomContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_fStringDoubleQuoteAtom; } + public get ruleIndex(): number { + return KipperParser.RULE_fStringDoubleQuoteAtom; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringDoubleQuoteAtom) { @@ -5999,15 +6662,20 @@ export class FStringDoubleQuoteAtomContext extends KipperParserRuleContext { } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_numberPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterNumberPrimaryExpression) { @@ -6030,10 +6698,13 @@ export class NumberPrimaryExpressionContext extends KipperParserRuleContext { } } - export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { - public LeftBracket(): TerminalNode { return this.getToken(KipperParser.LeftBracket, 0); } - public RightBracket(): TerminalNode { return this.getToken(KipperParser.RightBracket, 0); } + 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[] { @@ -6056,7 +6727,9 @@ export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_arrayPrimaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_arrayPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterArrayPrimaryExpression) { @@ -6079,10 +6752,13 @@ export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { } } - export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { - public LeftBrace(): TerminalNode { return this.getToken(KipperParser.LeftBrace, 0); } - public RightBrace(): TerminalNode { return this.getToken(KipperParser.RightBrace, 0); } + 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[] { @@ -6105,7 +6781,9 @@ export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_objectPrimaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_objectPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterObjectPrimaryExpression) { @@ -6128,12 +6806,13 @@ export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { } } - export class ObjectPropertyContext extends KipperParserRuleContext { public identifierOrStringPrimaryExpression(): IdentifierOrStringPrimaryExpressionContext { return this.getRuleContext(0, IdentifierOrStringPrimaryExpressionContext); } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } + public Colon(): TerminalNode { + return this.getToken(KipperParser.Colon, 0); + } public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } @@ -6141,7 +6820,9 @@ export class ObjectPropertyContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_objectProperty; } + public get ruleIndex(): number { + return KipperParser.RULE_objectProperty; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterObjectProperty) { @@ -6164,16 +6845,23 @@ export class ObjectPropertyContext extends KipperParserRuleContext { } } - export class VoidOrNullOrUndefinedPrimaryExpressionContext extends KipperParserRuleContext { - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_voidOrNullOrUndefinedPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterVoidOrNullOrUndefinedPrimaryExpression) { @@ -6196,14 +6884,15 @@ 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 get ruleIndex(): number { + return KipperParser.RULE_computedPrimaryExpression; + } public copyFrom(ctx: ComputedPrimaryExpressionContext): void { super.copyFrom(ctx); this._labelASTKind = ctx._labelASTKind; @@ -6242,8 +6931,12 @@ export class FunctionCallExpressionContext extends ComputedPrimaryExpressionCont 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 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); } @@ -6273,12 +6966,18 @@ export class FunctionCallExpressionContext extends ComputedPrimaryExpressionCont } } export class ExplicitCallFunctionCallExpressionContext extends ComputedPrimaryExpressionContext { - public CallFunc(): TerminalNode { return this.getToken(KipperParser.CallFunc, 0); } + 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 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); } @@ -6404,7 +7103,6 @@ export class SliceNotationMemberAccessExpressionContext extends ComputedPrimaryE } } - export class ArgumentExpressionListContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext[]; public assignmentExpression(i: number): AssignmentExpressionContext; @@ -6428,7 +7126,9 @@ export class ArgumentExpressionListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_argumentExpressionList; } + public get ruleIndex(): number { + return KipperParser.RULE_argumentExpressionList; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterArgumentExpressionList) { @@ -6451,9 +7151,10 @@ export class ArgumentExpressionListContext extends KipperParserRuleContext { } } - export class DotNotationContext extends KipperParserRuleContext { - public Dot(): TerminalNode { return this.getToken(KipperParser.Dot, 0); } + public Dot(): TerminalNode { + return this.getToken(KipperParser.Dot, 0); + } public identifier(): IdentifierContext { return this.getRuleContext(0, IdentifierContext); } @@ -6461,7 +7162,9 @@ export class DotNotationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_dotNotation; } + public get ruleIndex(): number { + return KipperParser.RULE_dotNotation; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDotNotation) { @@ -6484,18 +7187,23 @@ export class DotNotationContext extends KipperParserRuleContext { } } - export class BracketNotationContext extends KipperParserRuleContext { - public LeftBracket(): TerminalNode { return this.getToken(KipperParser.LeftBracket, 0); } + 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_bracketNotation; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBracketNotation) { @@ -6518,13 +7226,18 @@ 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 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[] { @@ -6538,7 +7251,9 @@ export class SliceNotationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_sliceNotation; } + public get ruleIndex(): number { + return KipperParser.RULE_sliceNotation; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSliceNotation) { @@ -6561,7 +7276,6 @@ export class SliceNotationContext extends KipperParserRuleContext { } } - export class PostfixExpressionContext extends KipperParserRuleContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, ComputedPrimaryExpressionContext); @@ -6573,7 +7287,9 @@ export class PostfixExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_postfixExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_postfixExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPostfixExpression) { @@ -6596,7 +7312,6 @@ export class PostfixExpressionContext extends KipperParserRuleContext { } } - export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRuleContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext { return this.getRuleContext(0, ComputedPrimaryExpressionContext); @@ -6608,7 +7323,9 @@ export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRu super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementPostfixExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_incrementOrDecrementPostfixExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementPostfixExpression) { @@ -6631,7 +7348,6 @@ export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRu } } - export class UnaryExpressionContext extends KipperParserRuleContext { public postfixExpression(): PostfixExpressionContext | undefined { return this.tryGetRuleContext(0, PostfixExpressionContext); @@ -6646,7 +7362,9 @@ export class UnaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_unaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_unaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterUnaryExpression) { @@ -6669,7 +7387,6 @@ export class UnaryExpressionContext extends KipperParserRuleContext { } } - export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRuleContext { public incrementOrDecrementOperator(): IncrementOrDecrementOperatorContext { return this.getRuleContext(0, IncrementOrDecrementOperatorContext); @@ -6681,7 +7398,9 @@ export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRule super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementUnaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_incrementOrDecrementUnaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementUnaryExpression) { @@ -6704,7 +7423,6 @@ export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRule } } - export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleContext { public unaryOperator(): UnaryOperatorContext { return this.getRuleContext(0, UnaryOperatorContext); @@ -6716,7 +7434,9 @@ export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleCont super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_operatorModifiedUnaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_operatorModifiedUnaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterOperatorModifiedUnaryExpression) { @@ -6739,15 +7459,20 @@ export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleCont } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_incrementOrDecrementOperator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementOperator) { @@ -6770,17 +7495,26 @@ export class IncrementOrDecrementOperatorContext extends KipperParserRuleContext } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_unaryOperator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterUnaryOperator) { @@ -6803,13 +7537,14 @@ export class UnaryOperatorContext extends KipperParserRuleContext { } } - export class CastOrConvertExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_castOrConvertExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_castOrConvertExpression; + } public copyFrom(ctx: CastOrConvertExpressionContext): void { super.copyFrom(ctx); } @@ -6847,7 +7582,9 @@ export class ActualCastOrConvertExpressionContext extends CastOrConvertExpressio public unaryExpression(): UnaryExpressionContext { return this.getRuleContext(0, UnaryExpressionContext); } - public As(): TerminalNode { return this.getToken(KipperParser.As, 0); } + public As(): TerminalNode { + return this.getToken(KipperParser.As, 0); + } public typeSpecifierExpression(): TypeSpecifierExpressionContext { return this.getRuleContext(0, TypeSpecifierExpressionContext); } @@ -6877,13 +7614,14 @@ export class ActualCastOrConvertExpressionContext extends CastOrConvertExpressio } } - export class MultiplicativeExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_multiplicativeExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_multiplicativeExpression; + } public copyFrom(ctx: MultiplicativeExpressionContext): void { super.copyFrom(ctx); } @@ -6924,10 +7662,18 @@ export class ActualMultiplicativeExpressionContext extends MultiplicativeExpress 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); } + 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); @@ -6954,13 +7700,14 @@ export class ActualMultiplicativeExpressionContext extends MultiplicativeExpress } } - export class AdditiveExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_additiveExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_additiveExpression; + } public copyFrom(ctx: AdditiveExpressionContext): void { super.copyFrom(ctx); } @@ -7001,8 +7748,12 @@ export class ActualAdditiveExpressionContext extends 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); } + 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); @@ -7029,13 +7780,14 @@ export class ActualAdditiveExpressionContext extends AdditiveExpressionContext { } } - export class BitwiseShiftExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_bitwiseShiftExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_bitwiseShiftExpression; + } public copyFrom(ctx: BitwiseShiftExpressionContext): void { super.copyFrom(ctx); } @@ -7105,16 +7857,23 @@ export class ActualBitwiseShiftExpressionContext extends BitwiseShiftExpressionC } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_bitwiseShiftOperators; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBitwiseShiftOperators) { @@ -7137,13 +7896,14 @@ export class BitwiseShiftOperatorsContext extends KipperParserRuleContext { } } - export class RelationalExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_relationalExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_relationalExpression; + } public copyFrom(ctx: RelationalExpressionContext): void { super.copyFrom(ctx); } @@ -7184,10 +7944,18 @@ export class ActualRelationalExpressionContext extends RelationalExpressionConte 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); } + 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); @@ -7214,13 +7982,14 @@ export class ActualRelationalExpressionContext extends RelationalExpressionConte } } - export class EqualityExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_equalityExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_equalityExpression; + } public copyFrom(ctx: EqualityExpressionContext): void { super.copyFrom(ctx); } @@ -7261,8 +8030,12 @@ export class ActualEqualityExpressionContext extends 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); } + 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); @@ -7289,13 +8062,14 @@ export class ActualEqualityExpressionContext extends EqualityExpressionContext { } } - export class BitwiseAndExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_bitwiseAndExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_bitwiseAndExpression; + } public copyFrom(ctx: BitwiseAndExpressionContext): void { super.copyFrom(ctx); } @@ -7333,7 +8107,9 @@ export class ActualBitwiseAndExpressionContext extends BitwiseAndExpressionConte public bitwiseAndExpression(): BitwiseAndExpressionContext { return this.getRuleContext(0, BitwiseAndExpressionContext); } - public BitwiseAnd(): TerminalNode { return this.getToken(KipperParser.BitwiseAnd, 0); } + public BitwiseAnd(): TerminalNode { + return this.getToken(KipperParser.BitwiseAnd, 0); + } public equalityExpression(): EqualityExpressionContext { return this.getRuleContext(0, EqualityExpressionContext); } @@ -7363,13 +8139,14 @@ export class ActualBitwiseAndExpressionContext extends BitwiseAndExpressionConte } } - export class BitwiseXorExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_bitwiseXorExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_bitwiseXorExpression; + } public copyFrom(ctx: BitwiseXorExpressionContext): void { super.copyFrom(ctx); } @@ -7407,7 +8184,9 @@ export class ActualBitwiseXorExpressionContext extends BitwiseXorExpressionConte public bitwiseXorExpression(): BitwiseXorExpressionContext { return this.getRuleContext(0, BitwiseXorExpressionContext); } - public BitwiseXor(): TerminalNode { return this.getToken(KipperParser.BitwiseXor, 0); } + public BitwiseXor(): TerminalNode { + return this.getToken(KipperParser.BitwiseXor, 0); + } public bitwiseAndExpression(): BitwiseAndExpressionContext { return this.getRuleContext(0, BitwiseAndExpressionContext); } @@ -7437,13 +8216,14 @@ export class ActualBitwiseXorExpressionContext extends BitwiseXorExpressionConte } } - export class BitwiseOrExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_bitwiseOrExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_bitwiseOrExpression; + } public copyFrom(ctx: BitwiseOrExpressionContext): void { super.copyFrom(ctx); } @@ -7481,7 +8261,9 @@ export class ActualBitwiseOrExpressionContext extends BitwiseOrExpressionContext public bitwiseOrExpression(): BitwiseOrExpressionContext { return this.getRuleContext(0, BitwiseOrExpressionContext); } - public BitwiseOr(): TerminalNode { return this.getToken(KipperParser.BitwiseOr, 0); } + public BitwiseOr(): TerminalNode { + return this.getToken(KipperParser.BitwiseOr, 0); + } public bitwiseXorExpression(): BitwiseXorExpressionContext { return this.getRuleContext(0, BitwiseXorExpressionContext); } @@ -7511,13 +8293,14 @@ export class ActualBitwiseOrExpressionContext extends BitwiseOrExpressionContext } } - export class LogicalAndExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_logicalAndExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_logicalAndExpression; + } public copyFrom(ctx: LogicalAndExpressionContext): void { super.copyFrom(ctx); } @@ -7555,7 +8338,9 @@ export class ActualLogicalAndExpressionContext extends LogicalAndExpressionConte public logicalAndExpression(): LogicalAndExpressionContext { return this.getRuleContext(0, LogicalAndExpressionContext); } - public AndAnd(): TerminalNode { return this.getToken(KipperParser.AndAnd, 0); } + public AndAnd(): TerminalNode { + return this.getToken(KipperParser.AndAnd, 0); + } public bitwiseOrExpression(): BitwiseOrExpressionContext { return this.getRuleContext(0, BitwiseOrExpressionContext); } @@ -7585,13 +8370,14 @@ export class ActualLogicalAndExpressionContext extends LogicalAndExpressionConte } } - export class LogicalOrExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_logicalOrExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_logicalOrExpression; + } public copyFrom(ctx: LogicalOrExpressionContext): void { super.copyFrom(ctx); } @@ -7629,7 +8415,9 @@ export class ActualLogicalOrExpressionContext extends LogicalOrExpressionContext public logicalOrExpression(): LogicalOrExpressionContext { return this.getRuleContext(0, LogicalOrExpressionContext); } - public OrOr(): TerminalNode { return this.getToken(KipperParser.OrOr, 0); } + public OrOr(): TerminalNode { + return this.getToken(KipperParser.OrOr, 0); + } public logicalAndExpression(): LogicalAndExpressionContext { return this.getRuleContext(0, LogicalAndExpressionContext); } @@ -7659,13 +8447,14 @@ export class ActualLogicalOrExpressionContext extends LogicalOrExpressionContext } } - export class ConditionalExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_conditionalExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_conditionalExpression; + } public copyFrom(ctx: ConditionalExpressionContext): void { super.copyFrom(ctx); } @@ -7703,7 +8492,9 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon public logicalOrExpression(): LogicalOrExpressionContext { return this.getRuleContext(0, LogicalOrExpressionContext); } - public QuestionMark(): TerminalNode { return this.getToken(KipperParser.QuestionMark, 0); } + public QuestionMark(): TerminalNode { + return this.getToken(KipperParser.QuestionMark, 0); + } public conditionalExpression(): ConditionalExpressionContext[]; public conditionalExpression(i: number): ConditionalExpressionContext; public conditionalExpression(i?: number): ConditionalExpressionContext | ConditionalExpressionContext[] { @@ -7713,7 +8504,9 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon return this.getRuleContext(i, ConditionalExpressionContext); } } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } + public Colon(): TerminalNode { + return this.getToken(KipperParser.Colon, 0); + } constructor(ctx: ConditionalExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); @@ -7740,13 +8533,14 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon } } - export class AssignmentExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_assignmentExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_assignmentExpression; + } public copyFrom(ctx: AssignmentExpressionContext): void { super.copyFrom(ctx); } @@ -7816,19 +8610,32 @@ export class ActualAssignmentExpressionContext extends AssignmentExpressionConte } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_assignmentOperator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterAssignmentOperator) { @@ -7851,7 +8658,6 @@ export class AssignmentOperatorContext extends KipperParserRuleContext { } } - export class ExpressionContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext[]; public assignmentExpression(i: number): AssignmentExpressionContext; @@ -7875,7 +8681,9 @@ export class ExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_expression; } + public get ruleIndex(): number { + return KipperParser.RULE_expression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterExpression) { @@ -7898,7 +8706,6 @@ export class ExpressionContext extends KipperParserRuleContext { } } - export class TypeSpecifierExpressionContext extends KipperParserRuleContext { public identifierTypeSpecifierExpression(): IdentifierTypeSpecifierExpressionContext | undefined { return this.tryGetRuleContext(0, IdentifierTypeSpecifierExpressionContext); @@ -7913,7 +8720,9 @@ export class TypeSpecifierExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_typeSpecifierExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_typeSpecifierExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeSpecifierExpression) { @@ -7936,7 +8745,6 @@ export class TypeSpecifierExpressionContext extends KipperParserRuleContext { } } - export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleContext { public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext { return this.getRuleContext(0, TypeSpecifierIdentifierContext); @@ -7945,7 +8753,9 @@ export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleCo super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_identifierTypeSpecifierExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_identifierTypeSpecifierExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierTypeSpecifierExpression) { @@ -7968,7 +8778,6 @@ export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleCo } } - export class GenericTypeSpecifierExpressionContext extends KipperParserRuleContext { public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext[]; public typeSpecifierIdentifier(i: number): TypeSpecifierIdentifierContext; @@ -7979,13 +8788,19 @@ 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_genericTypeSpecifierExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterGenericTypeSpecifierExpression) { @@ -8008,19 +8823,26 @@ export class GenericTypeSpecifierExpressionContext extends KipperParserRuleConte } } - export class TypeofTypeSpecifierExpressionContext extends KipperParserRuleContext { - public Typeof(): TerminalNode { return this.getToken(KipperParser.Typeof, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } + 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_typeofTypeSpecifierExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeofTypeSpecifierExpression) { @@ -8043,17 +8865,26 @@ export class TypeofTypeSpecifierExpressionContext extends KipperParserRuleContex } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_typeSpecifierIdentifier; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeSpecifierIdentifier) { @@ -8075,5 +8906,3 @@ export class TypeSpecifierIdentifierContext extends KipperParserRuleContext { } } } - - diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParserListener.ts b/kipper/core/src/compiler/lexer-parser/antlr/KipperParserListener.ts index 2ff067774..a5943ecb0 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParserListener.ts +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParserListener.ts @@ -1,11 +1,9 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT - - // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax - // kind values. - import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; - import KipperParserBase from "./base/KipperParserBase"; - +// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax +// kind values. +import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; +import KipperParserBase from "./base/KipperParserBase"; import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; @@ -121,7 +119,6 @@ import { GenericTypeSpecifierExpressionContext } from "./KipperParser"; import { TypeofTypeSpecifierExpressionContext } from "./KipperParser"; import { TypeSpecifierIdentifierContext } from "./KipperParser"; - /** * This interface defines a complete listener for a parse tree produced by * `KipperParser`. @@ -1414,4 +1411,3 @@ export interface KipperParserListener extends ParseTreeListener { */ exitTypeSpecifierIdentifier?: (ctx: TypeSpecifierIdentifierContext) => void; } - diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParserVisitor.ts b/kipper/core/src/compiler/lexer-parser/antlr/KipperParserVisitor.ts index a8273d0fb..cd5cc8c1e 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParserVisitor.ts +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParserVisitor.ts @@ -1,11 +1,9 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT - - // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax - // kind values. - import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; - import KipperParserBase from "./base/KipperParserBase"; - +// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax +// kind values. +import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; +import KipperParserBase from "./base/KipperParserBase"; import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; @@ -121,7 +119,6 @@ import { GenericTypeSpecifierExpressionContext } from "./KipperParser"; import { TypeofTypeSpecifierExpressionContext } from "./KipperParser"; import { TypeSpecifierIdentifierContext } from "./KipperParser"; - /** * This interface defines a complete generic visitor for a parse tree produced * by `KipperParser`. @@ -940,4 +937,3 @@ export interface KipperParserVisitor extends ParseTreeVisitor { */ visitTypeSpecifierIdentifier?: (ctx: TypeSpecifierIdentifierContext) => Result; } - diff --git a/kipper/core/src/compiler/program-ctx.ts b/kipper/core/src/compiler/program-ctx.ts index 1f2f1e524..1a6352a58 100644 --- a/kipper/core/src/compiler/program-ctx.ts +++ b/kipper/core/src/compiler/program-ctx.ts @@ -5,7 +5,7 @@ * target language. * @since 0.0.3 */ -import type {ANTLRErrorListener, Token, TokenStream} from "antlr4ts"; +import type { ANTLRErrorListener, Token, TokenStream } from "antlr4ts"; import type { CompilationUnitContext, KipperFileStream, @@ -13,31 +13,28 @@ import type { KipperParser, LexerParserData, } from "./lexer-parser"; -import type {KipperCompileTarget} from "./target-presets"; -import {TranslatedCodeLine} from "./const"; -import type {KipperWarning} from "../warnings"; -import {CompilableASTNode, Expression, KipperFileASTGenerator, RootASTNode} from "./ast"; -import type {EvaluatedCompileConfig} from "./compile-config"; +import type { KipperCompileTarget } from "./target-presets"; +import type { TranslatedCodeLine } from "./const"; +import type { KipperWarning } from "../warnings"; +import type { CompilableASTNode, Expression, RootASTNode } from "./ast"; +import { KipperFileASTGenerator } from "./ast"; +import type { EvaluatedCompileConfig } from "./compile-config"; +import type { BuiltInFunction, BuiltInVariable, InternalFunction, InternalReference, Reference } from "./semantics"; import { - BuiltInFunction, BuiltInFunctions, BuiltInTypes, - BuiltInVariable, BuiltInVariables, - InternalFunction, - InternalReference, KipperSemanticChecker, KipperTypeChecker, - Reference, - UniverseScope + UniverseScope, } from "./semantics"; -import {KipperError, KipperInternalError, UndefinedSemanticsError} from "../errors"; -import type {OptimisationOptions} from "./optimiser"; -import {KipperOptimiser} from "./optimiser"; -import type {KipperLogger} from "../logger"; -import {LogLevel} from "../logger"; -import {KipperWarningIssuer} from "./semantics/analyser/warning-issuer"; -import {ParseTreeWalker} from "antlr4ts/tree"; +import { KipperError, KipperInternalError, UndefinedSemanticsError } from "../errors"; +import type { OptimisationOptions } from "./optimiser"; +import { KipperOptimiser } from "./optimiser"; +import type { KipperLogger } from "../logger"; +import { LogLevel } from "../logger"; +import { KipperWarningIssuer } from "./semantics/analyser/warning-issuer"; +import { ParseTreeWalker } from "antlr4ts/tree"; /** * The program context class used to represent a program for a compilation. diff --git a/kipper/core/src/compiler/semantics/analyser/semantic-checker.ts b/kipper/core/src/compiler/semantics/analyser/semantic-checker.ts index 2ea6f6db2..99b24da46 100644 --- a/kipper/core/src/compiler/semantics/analyser/semantic-checker.ts +++ b/kipper/core/src/compiler/semantics/analyser/semantic-checker.ts @@ -51,7 +51,7 @@ export class KipperSemanticChecker extends KipperSemanticsAsserter { * @since 0.8.0 */ protected getReference(identifier: string, scope: Scope): KipperReferenceable | undefined { - return scope.getEntryRecursively(identifier) + return scope.getEntryRecursively(identifier); } /** @@ -60,10 +60,7 @@ export class KipperSemanticChecker extends KipperSemanticsAsserter { * @param scope The scope to search in. * @since 0.7.0 */ - public getExistingReference( - identifier: string, - scope: Scope - ): KipperReferenceable { + public getExistingReference(identifier: string, scope: Scope): KipperReferenceable { const ref = this.getReference(identifier, scope); if (!ref) { throw this.assertError(new UnknownReferenceError(identifier)); diff --git a/kipper/core/src/compiler/semantics/analyser/type-checker.ts b/kipper/core/src/compiler/semantics/analyser/type-checker.ts index 02edc4caf..479ff686a 100644 --- a/kipper/core/src/compiler/semantics/analyser/type-checker.ts +++ b/kipper/core/src/compiler/semantics/analyser/type-checker.ts @@ -27,13 +27,13 @@ import { TangledPrimaryExpression, } from "../../ast"; import { KipperSemanticsAsserter } from "./err-handler"; +import type { Scope } from "../symbol-table"; import { BuiltInTypes, - Scope, ScopeDeclaration, ScopeParameterDeclaration, ScopeTypeDeclaration, - ScopeVariableDeclaration + ScopeVariableDeclaration, } from "../symbol-table"; import type { KipperArithmeticOperator, @@ -65,7 +65,8 @@ import { InvalidUnaryExpressionTypeError, KipperError, KipperNotImplementedError, - ReadOnlyWriteTypeError, ReferenceCanNotBeUsedAsTypeError, + ReadOnlyWriteTypeError, + ReferenceCanNotBeUsedAsTypeError, UnknownTypeError, ValueNotIndexableTypeError, } from "../../../errors"; @@ -250,7 +251,9 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { } if (!argType.isAssignableTo(receivedType)) { - throw this.assertError(new ArgumentTypeError(semanticData.identifier, argType.identifier, receivedType.identifier)); + throw this.assertError( + new ArgumentTypeError(semanticData.identifier, argType.identifier, receivedType.identifier), + ); } } @@ -312,7 +315,8 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { */ public validUnaryExpression(operand: UnaryExpression | IncrementOrDecrementPostfixExpression): void { const semanticData = operand.getSemanticData() as - UnaryExpressionSemantics | IncrementOrDecrementPostfixExpressionSemantics; + | UnaryExpressionSemantics + | IncrementOrDecrementPostfixExpressionSemantics; const expTypeSemantics = semanticData.operand.getTypeSemanticData(); const expType = expTypeSemantics.evaluatedType.get(); @@ -326,7 +330,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { throw this.assertError(new InvalidUnaryExpressionTypeError(semanticData.operator, expType)); } - // Ensure that the operand of an '++' and '--' modifier expression is a reference + // Ensure that the operand of an '++' and '--' modifier expression is a reference let isReference = semanticData.operand instanceof IdentifierPrimaryExpression; if ((>kipperIncrementOrDecrementOperators).includes(semanticData.operator) && !isReference) { // Edge-case: If the operand is a tangled expression, it should still work if the child is an identifier diff --git a/kipper/core/src/compiler/semantics/reference.ts b/kipper/core/src/compiler/semantics/reference.ts index 8ad08b145..06f761ad6 100644 --- a/kipper/core/src/compiler/semantics/reference.ts +++ b/kipper/core/src/compiler/semantics/reference.ts @@ -4,7 +4,7 @@ */ import type { Expression } from "../ast"; import type { KipperReferenceable } from "../const"; -import { InternalFunction } from "./runtime-internals"; +import type { InternalFunction } from "./runtime-internals"; /** * A {@link KipperReferenceable reference} to an identifier that stores a value or function. diff --git a/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-function-argument.ts b/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-function-argument.ts index 0509d8b6d..fd711bbdd 100644 --- a/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-function-argument.ts +++ b/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-function-argument.ts @@ -1,6 +1,6 @@ -import {KipperBuiltInTypeLiteral} from "../../const"; -import {ProcessedType} from "../types"; -import {UniverseScope} from "../symbol-table"; +import { KipperBuiltInTypeLiteral } from "../../const"; +import type { ProcessedType } from "../types"; +import { UniverseScope } from "../symbol-table"; /** * Interface representation of an argument of a {@link BuiltInFunction}. @@ -28,10 +28,7 @@ export class BuiltInFunctionArgument { */ public readonly valueType: ProcessedType; - public constructor( - identifier: string, - valueType: ProcessedType, - ) { + public constructor(identifier: string, valueType: ProcessedType) { this.identifier = identifier; this.valueType = valueType; } diff --git a/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-function.ts b/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-function.ts index 848dc4299..9dc0326b3 100644 --- a/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-function.ts +++ b/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-function.ts @@ -1,5 +1,5 @@ -import {ProcessedType} from "../types"; -import {BuiltInFunctionArgument} from "./built-in-function-argument"; +import type { ProcessedType } from "../types"; +import type { BuiltInFunctionArgument } from "./built-in-function-argument"; /** * Interface representation of a {@link BuiltInFunction}, which is available inside a Kipper program using the specified @@ -31,11 +31,7 @@ export class BuiltInFunction { */ public readonly returnType: ProcessedType; - public constructor( - identifier: string, - params: Array, - returnType: ProcessedType, - ) { + public constructor(identifier: string, params: Array, returnType: ProcessedType) { this.identifier = identifier; this.params = params; this.returnType = returnType; diff --git a/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-variable.ts b/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-variable.ts index 56f285b0b..2ac55430a 100644 --- a/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-variable.ts +++ b/kipper/core/src/compiler/semantics/runtime-built-ins/built-in-variable.ts @@ -1,6 +1,6 @@ -import {KipperBuiltInTypeLiteral} from "../../const"; -import {ProcessedType} from "../types"; -import {UniverseScope} from "../symbol-table"; +import { KipperBuiltInTypeLiteral } from "../../const"; +import type { ProcessedType } from "../types"; +import { UniverseScope } from "../symbol-table"; /** * Interface representation of a {@link BuiltInVariable}, which is available inside a Kipper program using the specified @@ -31,11 +31,7 @@ export class BuiltInVariable { */ public readonly local: boolean; - public constructor( - identifier: string, - valueType: ProcessedType, - local: boolean, - ) { + public constructor(identifier: string, valueType: ProcessedType, local: boolean) { this.identifier = identifier; this.valueType = valueType; this.local = local; diff --git a/kipper/core/src/compiler/semantics/runtime-internals/internal-function-argument.ts b/kipper/core/src/compiler/semantics/runtime-internals/internal-function-argument.ts index 7977c9393..72b79588d 100644 --- a/kipper/core/src/compiler/semantics/runtime-internals/internal-function-argument.ts +++ b/kipper/core/src/compiler/semantics/runtime-internals/internal-function-argument.ts @@ -1,5 +1,5 @@ -import {KipperBuiltInTypeLiteral} from "../../const"; -import {ProcessedType} from "../types"; +import { KipperBuiltInTypeLiteral } from "../../const"; +import type { ProcessedType } from "../types"; /** * Interface representation of an argument of a {@link InternalFunction}. diff --git a/kipper/core/src/compiler/semantics/runtime-internals/internal-function.ts b/kipper/core/src/compiler/semantics/runtime-internals/internal-function.ts index 09b7f22cd..f99f6d5a6 100644 --- a/kipper/core/src/compiler/semantics/runtime-internals/internal-function.ts +++ b/kipper/core/src/compiler/semantics/runtime-internals/internal-function.ts @@ -1,6 +1,6 @@ -import {InternalFunctionArgument} from "./internal-function-argument"; -import {KipperBuiltInTypeLiteral} from "../../const"; -import {ProcessedType} from "../types"; +import type { InternalFunctionArgument } from "./internal-function-argument"; +import { KipperBuiltInTypeLiteral } from "../../const"; +import type { ProcessedType } from "../types"; /** * Interface representation of a {@link InternalFunction}, which is used to provide functionality for Kipper specific diff --git a/kipper/core/src/compiler/semantics/runtime-internals/internals.ts b/kipper/core/src/compiler/semantics/runtime-internals/internals.ts index 8f04ae2dd..3f0ecf0b8 100644 --- a/kipper/core/src/compiler/semantics/runtime-internals/internals.ts +++ b/kipper/core/src/compiler/semantics/runtime-internals/internals.ts @@ -1,4 +1,4 @@ -import { InternalFunction } from "./internal-function"; +import type { InternalFunction } from "./internal-function"; /** * Contains all the internal built-in functions, which are used by Kipper to provide internal functionality. These diff --git a/kipper/core/src/compiler/semantics/symbol-table/base/scope.ts b/kipper/core/src/compiler/semantics/symbol-table/base/scope.ts index 425aa190a..4ec11d4e7 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/base/scope.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/base/scope.ts @@ -10,7 +10,7 @@ import type { ScopeVariableDeclaration, } from "../entry"; import type { SymbolTable } from "./symbol-table"; -import {BuiltInType} from "../../types"; +import { BuiltInType } from "../../types"; /** * A scope in a Kipper program, which can contain {@link ScopeVariableDeclaration variables}, @@ -19,11 +19,7 @@ import {BuiltInType} from "../../types"; * A scope can be a child of another scope or the global scope of a {@link KipperProgramContext program}. * @since 0.8.0 */ -export abstract class Scope< - VarT = any, - FuncT = any, - TypeT = any, -> implements SymbolTable { +export abstract class Scope implements SymbolTable { protected readonly _entries: Map; protected constructor() { diff --git a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-function-declaration.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-function-declaration.ts index 11abd676c..bcbb5fdd0 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-function-declaration.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-function-declaration.ts @@ -9,9 +9,9 @@ import type { ParameterDeclaration, } from "../../../ast"; import { ScopeDeclaration } from "./scope-declaration"; -import {ProcessedType} from "../../types"; -import {BuiltInFunction, BuiltInFunctionArgument} from "../../runtime-built-ins"; -import {BuiltInTypes} from "../universum-scope"; +import type { ProcessedType } from "../../types"; +import type { BuiltInFunction, BuiltInFunctionArgument } from "../../runtime-built-ins"; +import { BuiltInTypes } from "../universum-scope"; /** * Represents the definition of a function inside a {@link Scope}. @@ -21,10 +21,7 @@ export class ScopeFunctionDeclaration extends ScopeDeclaration { private readonly _declaration?: FunctionDeclaration; private readonly _builtInFunction?: BuiltInFunction; - private constructor( - declaration?: FunctionDeclaration, - builtInFunction?: BuiltInFunction, - ) { + private constructor(declaration?: FunctionDeclaration, builtInFunction?: BuiltInFunction) { super(); this._declaration = declaration; this._builtInFunction = builtInFunction; diff --git a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts index 101b3a701..4877083cd 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts @@ -9,8 +9,9 @@ import type { ParameterDeclarationSemantics, ParameterDeclarationTypeSemantics, } from "../../../ast"; -import {BuiltInTypes, LocalScope} from "../index"; -import {ProcessedType} from "../../types"; +import type { LocalScope } from "../index"; +import { BuiltInTypes } from "../index"; +import type { ProcessedType } from "../../types"; /** * Represents the definition of a parameter inside a {@link FunctionDeclaration function}. diff --git a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts index 67f4ea044..75bde1996 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts @@ -3,10 +3,11 @@ * @since 0.11.0 */ import { ScopeDeclaration } from "./scope-declaration"; -import { TypeDeclaration, TypeDeclarationSemantics } from "../../../ast"; -import {BuiltInType, CustomType, ProcessedType, Type} from "../../types" +import type { TypeDeclaration, TypeDeclarationSemantics } from "../../../ast"; +import type { BuiltInType, CustomType, ProcessedType } from "../../types"; +import { Type } from "../../types"; import { KipperNotImplementedError } from "../../../../errors"; -import {BuiltInTypes} from "../universum-scope"; +import { BuiltInTypes } from "../universum-scope"; /** * Represents the definition of a type such as a class or interface in a scope. @@ -16,10 +17,7 @@ export class ScopeTypeDeclaration extends ScopeDeclaration { private readonly _node?: TypeDeclaration; private readonly _builtInType?: ProcessedType; - private constructor( - declaration?: TypeDeclaration, - builtInType?: BuiltInType, - ) { + private constructor(declaration?: TypeDeclaration, builtInType?: BuiltInType) { super(); this._node = declaration; diff --git a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts index bd0ce594d..28c30b045 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts @@ -4,10 +4,10 @@ */ import type { VariableDeclaration, VariableDeclarationSemantics, VariableDeclarationTypeSemantics } from "../../../ast"; import type { KipperStorageType } from "../../../const"; -import {BuiltInTypes} from "../index"; -import { ProcessedType} from "../../types"; +import { BuiltInTypes } from "../index"; +import type { ProcessedType } from "../../types"; import { ScopeDeclaration } from "./scope-declaration"; -import {BuiltInVariable} from "../../runtime-built-ins"; +import type { BuiltInVariable } from "../../runtime-built-ins"; /** * Represents a variable scope entry that may be a child of the global scope or local scope. @@ -23,10 +23,7 @@ export class ScopeVariableDeclaration extends ScopeDeclaration { */ public valueWasUpdated: boolean = false; - public constructor( - declaration?: VariableDeclaration, - builtInVariable?: BuiltInVariable, - ) { + public constructor(declaration?: VariableDeclaration, builtInVariable?: BuiltInVariable) { super(); this._declaration = declaration; this._builtInVariable = builtInVariable; diff --git a/kipper/core/src/compiler/semantics/symbol-table/global-scope.ts b/kipper/core/src/compiler/semantics/symbol-table/global-scope.ts index 0d83d32f4..1d273a05b 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/global-scope.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/global-scope.ts @@ -5,7 +5,7 @@ */ import type { KipperProgramContext } from "../../program-ctx"; import type { ScopeDeclaration } from "./entry"; -import {FunctionDeclaration, RootASTNode, TypeDeclaration, VariableDeclaration} from "../../ast"; +import type { FunctionDeclaration, RootASTNode, TypeDeclaration, VariableDeclaration } from "../../ast"; import { ScopeFunctionDeclaration, ScopeTypeDeclaration, ScopeVariableDeclaration } from "./entry"; import { Scope } from "./base/scope"; @@ -15,9 +15,7 @@ import { Scope } from "./base/scope"; * @since 0.8.0 */ export class GlobalScope extends Scope { - constructor( - public ctx: RootASTNode - ) { + constructor(public ctx: RootASTNode) { super(); } @@ -51,7 +49,7 @@ export class GlobalScope extends Scope; @@ -53,11 +54,7 @@ export const BuiltInFunctions = { * @since 0.10.0 */ export const BuiltInVariables = { - __name__: new BuiltInVariable( - "__name__", - BuiltInTypes.str, - true - ), + __name__: new BuiltInVariable("__name__", BuiltInTypes.str, true), } satisfies Record; /** @@ -93,7 +90,7 @@ export class UniverseScope extends Scope { * @since 0.11.0 */ public addVariable(declaration: BuiltInVariable): ScopeVariableDeclaration { - const scopeDeclaration = ScopeVariableDeclaration.fromBuiltInVariable(declaration) + const scopeDeclaration = ScopeVariableDeclaration.fromBuiltInVariable(declaration); this.entries.set(scopeDeclaration.identifier, scopeDeclaration); return scopeDeclaration; } @@ -105,7 +102,7 @@ export class UniverseScope extends Scope { * @since 0.11.0 */ public addFunction(declaration: BuiltInFunction): ScopeFunctionDeclaration { - const scopeDeclaration = ScopeFunctionDeclaration.fromBuiltInFunction(declaration) + const scopeDeclaration = ScopeFunctionDeclaration.fromBuiltInFunction(declaration); this.entries.set(scopeDeclaration.identifier, scopeDeclaration); return scopeDeclaration; } @@ -117,7 +114,7 @@ export class UniverseScope extends Scope { * @since 0.11.0 */ public addType(declarationOrIdentifier: BuiltInType): ScopeTypeDeclaration { - const scopeDeclaration = ScopeTypeDeclaration.fromBuiltInType(declarationOrIdentifier) + const scopeDeclaration = ScopeTypeDeclaration.fromBuiltInType(declarationOrIdentifier); this.entries.set(scopeDeclaration.identifier, scopeDeclaration); return scopeDeclaration; } diff --git a/kipper/core/src/compiler/semantics/types/built-in-type.ts b/kipper/core/src/compiler/semantics/types/built-in-type.ts index 98cb53164..9a3553eef 100644 --- a/kipper/core/src/compiler/semantics/types/built-in-type.ts +++ b/kipper/core/src/compiler/semantics/types/built-in-type.ts @@ -1,5 +1,6 @@ import { ProcessedType } from "./base/processed-type"; -import {KipperBuiltInTypeLiteral, kipperBuiltInTypeLiterals} from "../../const"; +import type { KipperBuiltInTypeLiteral } from "../../const"; +import { kipperBuiltInTypeLiterals } from "../../const"; import { KipperNotImplementedError } from "../../../errors"; import type { CompilableType } from "./base/compilable-type"; @@ -26,14 +27,13 @@ export class BuiltInType extends ProcessedType implements CompilableType { */ public isAssignableTo(type: ProcessedType): boolean { if (this === type) { - return true + return true; } else if ( - BuiltInType.interchangeableTypes.includes(this.identifier) - && BuiltInType.interchangeableTypes.includes(type.identifier) + BuiltInType.interchangeableTypes.includes(this.identifier) && + BuiltInType.interchangeableTypes.includes(type.identifier) ) { return true; } return false; } } - diff --git a/kipper/core/src/compiler/semantics/types/custom-type.ts b/kipper/core/src/compiler/semantics/types/custom-type.ts index fd8c94965..e460b518a 100644 --- a/kipper/core/src/compiler/semantics/types/custom-type.ts +++ b/kipper/core/src/compiler/semantics/types/custom-type.ts @@ -19,12 +19,7 @@ export class CustomType extends ProcessedType { */ public readonly kind: CustomTypeKind; - public constructor( - identifier: string, - isCompilable: boolean, - kind: CustomTypeKind, - fields: CustomTypeFields, - ) { + public constructor(identifier: string, isCompilable: boolean, kind: CustomTypeKind, fields: CustomTypeFields) { super(identifier, isCompilable); this._fields = fields; this.kind = kind; diff --git a/test/module/core/pragma.test.ts b/test/module/core/pragma.test.ts index f4b55c301..276eba2b9 100644 --- a/test/module/core/pragma.test.ts +++ b/test/module/core/pragma.test.ts @@ -17,7 +17,7 @@ describe("no-optimise", () => { 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\"; };"); + assert.include(instance.write(), '__kipper.voidToStr = function voidToStr(): string { return "void"; };'); }); it("should not be optimised", async () => { @@ -26,6 +26,6 @@ describe("no-optimise", () => { 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\"; };"); + assert.notInclude(instance.write(), '__kipper.voidToStr = function voidToStr(): string { return "void"; };'); }); }); From 057d19372c046cc521344e7fc782618d1fe4cf5b Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Tue, 9 Jul 2024 16:45:16 +0200 Subject: [PATCH 20/57] major (#524): Finished migration to new type system --- kipper/cli/src/commands/compile.ts | 4 - .../src/evaluated-kipper-config-file.ts | 2 +- kipper/core/KipperParser.tokens | 301 ++--- .../src/compiler/ast/compilable-ast-node.ts | 3 +- .../function-declaration.ts | 4 +- .../type-declaration-semantics.ts | 1 - .../multiplicative-expression.ts | 6 +- .../assignment-expression.ts | 2 +- .../bitwise-and-expression.ts | 5 +- .../bitwise-or-expression.ts | 5 +- .../bitwise-shift-expression.ts | 5 +- .../bitwise-xor-expression.ts | 4 +- .../cast-or-convert-expression.ts | 2 +- .../equality-expression.ts | 4 +- .../relational-expression.ts | 4 +- .../function-call-expression-semantics.ts | 5 +- ...function-call-expression-type-semantics.ts | 4 +- .../function-call-expression.ts | 18 +- .../logical-and-expression.ts | 4 +- .../logical-or-expression.ts | 4 +- .../member-access-expression.ts | 2 +- ...crement-or-decrement-postfix-expression.ts | 4 +- .../array-primary-expression.ts | 4 +- .../bool-primary-expression.ts | 4 +- .../fstring-primary-expression.ts | 4 +- .../identifier-primary-expression.ts | 14 +- .../number-primary-expression.ts | 4 +- .../string-primary-expression.ts | 4 +- ...or-null-or-undefined-primary-expression.ts | 4 +- .../identifier-type-specifier-expression.ts | 6 +- ...increment-or-decrement-unary-expression.ts | 4 +- .../operator-modified-unary-expression.ts | 4 +- .../src/compiler/ast/nodes/root-ast-node.ts | 6 +- .../return-statement/return-statement.ts | 5 +- kipper/core/src/compiler/ast/scope-node.ts | 2 - kipper/core/src/compiler/compiler.ts | 4 +- kipper/core/src/compiler/const.ts | 40 +- .../lexer-parser/antlr/KipperParser.interp | 4 +- .../lexer-parser/antlr/KipperParser.tokens | 301 ++--- .../lexer-parser/antlr/KipperParser.ts | 1051 +++++++++-------- .../core/src/compiler/optimiser/optimiser.ts | 24 +- kipper/core/src/compiler/program-ctx.ts | 42 +- .../semantics/analyser/semantic-checker.ts | 7 +- .../semantics/analyser/type-checker.ts | 143 +-- .../semantics/runtime-internals/internals.ts | 49 +- .../semantics/symbol-table/base/scope.ts | 2 - .../symbol-table/entry/scope-declaration.ts | 16 +- .../entry/scope-function-declaration.ts | 41 +- .../entry/scope-parameter-declaration.ts | 25 +- .../entry/scope-type-declaration.ts | 47 +- .../entry/scope-variable-declaration.ts | 64 +- .../semantics/symbol-table/function-scope.ts | 14 - .../semantics/symbol-table/global-scope.ts | 8 +- .../semantics/symbol-table/local-scope.ts | 8 +- .../semantics/symbol-table/universum-scope.ts | 26 +- .../compiler/semantics/types/built-in-type.ts | 2 - .../compiler/semantics/types/custom-type.ts | 1 - .../translation/built-ins-generator.ts | 3 +- kipper/target-js/src/code-generator.ts | 34 +- kipper/target-js/src/target.ts | 9 +- kipper/target-ts/src/built-in-generator.ts | 6 +- kipper/target-ts/src/code-generator.ts | 2 +- kipper/target-ts/src/target.ts | 2 +- kipper/target-ts/src/tools.ts | 19 +- test/kipper-files/main.kip | 4 +- test/kipper-files/nested-scopes.kip | 2 +- .../single-function-definition.kip | 2 +- test/module/core/compiler.test.ts | 32 +- .../semantic-errors/builtin-overwrite.ts | 3 +- .../errors/semantic-errors/invalid-global.ts | 5 +- test/module/core/global-scope.test.ts | 29 +- test/module/core/program-ctx.test.ts | 51 +- test/module/core/universe-scope.test.ts | 21 + 73 files changed, 1354 insertions(+), 1247 deletions(-) create mode 100644 test/module/core/universe-scope.test.ts diff --git a/kipper/cli/src/commands/compile.ts b/kipper/cli/src/commands/compile.ts index f56911857..ec5ae567d 100644 --- a/kipper/cli/src/commands/compile.ts +++ b/kipper/cli/src/commands/compile.ts @@ -150,10 +150,6 @@ export default class Compile extends Command { defaultOptimisationOptions.optimiseBuiltIns, }, recover: flags["recover"] ?? preExistingCompileConfig?.recover ?? EvaluatedCompileConfig.defaults.recover, - abortOnFirstError: - flags["abort-on-first-error"] ?? - preExistingCompileConfig?.abortOnFirstError ?? - EvaluatedCompileConfig.defaults.abortOnFirstError, } as CompileConfig, }, }; 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.tokens b/kipper/core/KipperParser.tokens index 4784df64b..a380f4448 100644 --- a/kipper/core/KipperParser.tokens +++ b/kipper/core/KipperParser.tokens @@ -1,153 +1,154 @@ FStringExpStart=1 BlockComment=2 LineComment=3 -Const=4 -Var=5 -As=6 -Spread=7 -Switch=8 -Case=9 -Default=10 -Break=11 -Continue=12 -Do=13 -While=14 -If=15 -Else=16 -For=17 -Enum=18 -DefFunc=19 -Return=20 -CallFunc=21 -RetIndicator=22 -Class=23 -Interface=24 -True=25 -False=26 -Typeof=27 -Void=28 -Null=29 -Undefined=30 -Comma=31 -SemiColon=32 -QuestionMark=33 -Colon=34 -LeftParen=35 -RightParen=36 -LeftBracket=37 -RightBracket=38 -FStringExpEnd=39 -LeftBrace=40 -RightBrace=41 -Plus=42 -PlusPlus=43 -Minus=44 -MinusMinus=45 -Star=46 -Div=47 -Mod=48 -PowerTo=49 -AndAnd=50 -OrOr=51 -Not=52 -Assign=53 -PlusAssign=54 -MinusAssign=55 -StarAssign=56 -DivAssign=57 -ModAssign=58 -Equal=59 -NotEqual=60 -Less=61 -LessEqual=62 -Greater=63 -GreaterEqual=64 -BitwiseAnd=65 -BitwiseOr=66 -BitwiseXor=67 -BitwiseNot=68 -BitwiseZeroFillLeftShift=69 -BitwiseSignedRightShift=70 -BitwiseZeroFillRightShift=71 -Dot=72 -Identifier=73 -IntegerConstant=74 -SingleQuoteStringLiteral=75 -DoubleQuoteStringLiteral=76 -FloatingConstant=77 -Whitespace=78 -Newline=79 -FStringSingleQuoteStart=80 -FStringDoubleQuoteStart=81 -FStringSingleQuoteEnd=82 -FStringSingleQuoteAtom=83 -FStringDoubleQuoteEnd=84 -FStringDoubleQuoteAtom=85 -'const'=4 -'var'=5 -'as'=6 -'...'=7 -'switch'=8 -'case'=9 -'default'=10 -'break'=11 -'continue'=12 -'do'=13 -'while'=14 -'if'=15 -'else'=16 -'for'=17 -'enum'=18 -'def'=19 -'return'=20 -'call'=21 -'->'=22 -'class'=23 -'interface'=24 -'true'=25 -'false'=26 -'typeof'=27 -'void'=28 -'null'=29 -'undefined'=30 -','=31 -';'=32 -'?'=33 -':'=34 -'('=35 -')'=36 -'['=37 -']'=38 -'{'=40 -'}'=41 -'+'=42 -'++'=43 -'-'=44 -'--'=45 -'*'=46 -'/'=47 -'%'=48 -'**'=49 -'&&'=50 -'||'=51 -'!'=52 -'='=53 -'+='=54 -'-='=55 -'*='=56 -'/='=57 -'%='=58 -'=='=59 -'!='=60 -'<'=61 -'<='=62 -'>'=63 -'>='=64 -'&'=65 -'|'=66 -'^'=67 -'~'=68 -'<<'=69 -'>>'=70 -'>>>'=71 -'.'=72 +Pragma=4 +Const=5 +Var=6 +As=7 +Spread=8 +Switch=9 +Case=10 +Default=11 +Break=12 +Continue=13 +Do=14 +While=15 +If=16 +Else=17 +For=18 +Enum=19 +DefFunc=20 +Return=21 +CallFunc=22 +RetIndicator=23 +Class=24 +Interface=25 +True=26 +False=27 +Typeof=28 +Void=29 +Null=30 +Undefined=31 +Comma=32 +SemiColon=33 +QuestionMark=34 +Colon=35 +LeftParen=36 +RightParen=37 +LeftBracket=38 +RightBracket=39 +FStringExpEnd=40 +LeftBrace=41 +RightBrace=42 +Plus=43 +PlusPlus=44 +Minus=45 +MinusMinus=46 +Star=47 +Div=48 +Mod=49 +PowerTo=50 +AndAnd=51 +OrOr=52 +Not=53 +Assign=54 +PlusAssign=55 +MinusAssign=56 +StarAssign=57 +DivAssign=58 +ModAssign=59 +Equal=60 +NotEqual=61 +Less=62 +LessEqual=63 +Greater=64 +GreaterEqual=65 +BitwiseAnd=66 +BitwiseOr=67 +BitwiseXor=68 +BitwiseNot=69 +BitwiseZeroFillLeftShift=70 +BitwiseSignedRightShift=71 +BitwiseZeroFillRightShift=72 +Dot=73 +Identifier=74 +IntegerConstant=75 +SingleQuoteStringLiteral=76 +DoubleQuoteStringLiteral=77 +FloatingConstant=78 +Whitespace=79 +Newline=80 +FStringSingleQuoteStart=81 +FStringDoubleQuoteStart=82 +FStringSingleQuoteEnd=83 +FStringSingleQuoteAtom=84 +FStringDoubleQuoteEnd=85 +FStringDoubleQuoteAtom=86 +'const'=5 +'var'=6 +'as'=7 +'...'=8 +'switch'=9 +'case'=10 +'default'=11 +'break'=12 +'continue'=13 +'do'=14 +'while'=15 +'if'=16 +'else'=17 +'for'=18 +'enum'=19 +'def'=20 +'return'=21 +'call'=22 +'->'=23 +'class'=24 +'interface'=25 +'true'=26 +'false'=27 +'typeof'=28 +'void'=29 +'null'=30 +'undefined'=31 +','=32 +';'=33 +'?'=34 +':'=35 +'('=36 +')'=37 +'['=38 +']'=39 +'{'=41 +'}'=42 +'+'=43 +'++'=44 +'-'=45 +'--'=46 +'*'=47 +'/'=48 +'%'=49 +'**'=50 +'&&'=51 +'||'=52 +'!'=53 +'='=54 +'+='=55 +'-='=56 +'*='=57 +'/='=58 +'%='=59 +'=='=60 +'!='=61 +'<'=62 +'<='=63 +'>'=64 +'>='=65 +'&'=66 +'|'=67 +'^'=68 +'~'=69 +'<<'=70 +'>>'=71 +'>>>'=72 +'.'=73 diff --git a/kipper/core/src/compiler/ast/compilable-ast-node.ts b/kipper/core/src/compiler/ast/compilable-ast-node.ts index c32d5bf83..48f3414d0 100644 --- a/kipper/core/src/compiler/ast/compilable-ast-node.ts +++ b/kipper/core/src/compiler/ast/compilable-ast-node.ts @@ -11,10 +11,9 @@ import type { } from "../target-presets"; import type { KipperParser, KipperParserRuleContext } from "../lexer-parser"; import type { TypeData } from "./ast-node"; -import type { KipperProgramContext } from "../program-ctx"; import type { TokenStream } from "antlr4ts/TokenStream"; import type { RootASTNode, SemanticData } from "./index"; -import type { FunctionScope, GlobalScope, LocalScope } from "../semantics"; +import type { GlobalScope, LocalScope } from "../semantics"; import type { ScopeNode } from "./scope-node"; import type { TargetCompilableNode } from "./target-node"; import { AnalysableASTNode } from "./analysable-ast-node"; 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 2f7222a15..fc4923ffb 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 @@ -174,13 +174,13 @@ export class FunctionDeclaration this.programCtx.semanticCheck(this).validFunctionBody(body); const identifier = this.tokenStream.getText(declaratorCtx.sourceInterval); - const type: RawType = retTypeSpecifier.getSemanticData().typeIdentifier; + const returnType: RawType = retTypeSpecifier.getSemanticData().typeIdentifier; this.semanticData = { isDefined: parseTreeChildren.find((val) => val instanceof CompoundStatementContext) !== undefined, identifier: identifier, returnTypeSpecifier: retTypeSpecifier, - returnType: type, + returnType: returnType, params: params, functionBody: body, // Will always syntactically be a compound statement }; diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts index a57d7ed5f..6f1e836a1 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/type-declaration-semantics.ts @@ -1,5 +1,4 @@ import type { SemanticData } from "../../../ast-node"; -import { ProcessedType } from "../../../../semantics"; /** * Semantics for a {@link TypeDeclaration}. diff --git a/kipper/core/src/compiler/ast/nodes/expressions/arithmetic/multiplicative-expression/multiplicative-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/arithmetic/multiplicative-expression/multiplicative-expression.ts index 7dcc7bff2..16de92878 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/arithmetic/multiplicative-expression/multiplicative-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/arithmetic/multiplicative-expression/multiplicative-expression.ts @@ -20,7 +20,7 @@ import { kipperMultiplicativeOperators } from "../../../../../const"; import { TerminalNode } from "antlr4ts/tree/TerminalNode"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; import { ArithmeticExpression } from "../arithmetic-expression"; -import { kipperInternalBuiltInFunctions } from "../../../../../semantics/runtime-built-ins"; +import { BuiltInTypes, kipperInternalBuiltInFunctions } from "../../../../../semantics"; /** * Multiplicative expression, which can be used to perform multiplicative operations on two expressions. @@ -141,8 +141,8 @@ export class MultiplicativeExpression extends ArithmeticExpression< }; if ( - semanticData.leftOp.getTypeSemanticData().evaluatedType.getCompilableType() === "str" && - semanticData.rightOp.getTypeSemanticData().evaluatedType.getCompilableType() === "num" + semanticData.leftOp.getTypeSemanticData().evaluatedType === BuiltInTypes.str && + semanticData.rightOp.getTypeSemanticData().evaluatedType === BuiltInTypes.num ) { this.programCtx.addInternalReference(this, kipperInternalBuiltInFunctions["repeatString"]); } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/assignment-expression/assignment-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/assignment-expression/assignment-expression.ts index defa3c80f..435784aed 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/assignment-expression/assignment-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/assignment-expression/assignment-expression.ts @@ -137,7 +137,7 @@ export class AssignmentExpression extends Expression> 1 // 1 * 2 >>> 1 // 1 */ - import { BitwiseExpression } from "../bitwise-expression"; import type { BitwiseOrExpressionContext, BitwiseShiftExpressionContext } from "../../../../../lexer-parser"; import { BitwiseShiftOperatorsContext, KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { Expression } from "../../expression"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { ProcessedType } from "../../../../../semantics"; +import { BuiltInTypes } from "../../../../../semantics"; import type { BitwiseShiftExpressionSemantics } from "./bitwise-shift-expression-semantics"; import type { BitwiseShiftExpressionTypeSemantics } from "./bitwise-shift-expression-type-semantics"; import type { KipperBitwiseShiftOperator } from "../../../../../const"; @@ -134,7 +133,7 @@ export class BitwiseShiftExpression extends BitwiseExpression< .validBitwiseExpression(semanticData.leftOp, semanticData.rightOp, semanticData.operator); this.typeSemantics = { - evaluatedType: ProcessedType.fromCompilableType("num"), + evaluatedType: BuiltInTypes.num, }; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-xor-expression/bitwise-xor-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-xor-expression/bitwise-xor-expression.ts index 355c3c25c..e83178136 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-xor-expression/bitwise-xor-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/bitwise-expression/bitwise-xor-expression/bitwise-xor-expression.ts @@ -13,7 +13,7 @@ import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { Expression } from "../../expression"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { ProcessedType } from "../../../../../semantics"; +import { BuiltInTypes } from "../../../../../semantics"; import type { BitwiseXorExpressionSemantics } from "./bitwise-xor-expression-semantics"; import type { BitwiseXorExpressionTypeSemantics } from "./bitwise-xor-expression-type-semantics"; @@ -114,7 +114,7 @@ export class BitwiseXorExpression extends BitwiseExpression< .validBitwiseExpression(semanticData.leftOp, semanticData.rightOp, semanticData.operator); this.typeSemantics = { - evaluatedType: ProcessedType.fromCompilableType("num"), + evaluatedType: BuiltInTypes.num, }; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression.ts index 97719010c..83b7645a7 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression.ts @@ -15,9 +15,9 @@ import { Expression } from "../expression"; import type { CastOrConvertExpressionContext } from "../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../lexer-parser"; import type { RawType } from "../../../../semantics"; +import { kipperInternalBuiltInFunctions } from "../../../../semantics"; import { UnableToDetermineSemanticDataError } from "../../../../../errors"; import { getConversionFunctionIdentifier } from "../../../../../tools"; -import { kipperInternalBuiltInFunctions } from "../../../../semantics/runtime-built-ins"; /** * Convert expressions, which are used to convert a value to a different type. diff --git a/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/equality-expression/equality-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/equality-expression/equality-expression.ts index 2ec40debf..b3cbc64f3 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/equality-expression/equality-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/equality-expression/equality-expression.ts @@ -11,7 +11,7 @@ import type { EqualityExpressionSemantics } from "./equality-expression-semantic import type { EqualityExpressionTypeSemantics } from "./equality-expression-type-semantics"; import type { Expression } from "../../expression"; import { ComparativeExpression } from "../comparative-expression"; -import { ProcessedType } from "../../../../../semantics"; +import { BuiltInTypes } from "../../../../../semantics"; import type { EqualityExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; @@ -122,7 +122,7 @@ export class EqualityExpression extends ComparativeExpression< public async primarySemanticTypeChecking(): Promise { // Equality expressions always return 'bool' this.typeSemantics = { - evaluatedType: ProcessedType.fromCompilableType("bool"), + evaluatedType: BuiltInTypes.bool, }; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/relational-expression/relational-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/relational-expression/relational-expression.ts index 8a7118b67..aa31c49a8 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/relational-expression/relational-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/comparative-expression/relational-expression/relational-expression.ts @@ -24,7 +24,7 @@ import type { KipperRelationalOperator } from "../../../../../const"; import { kipperRelationalOperators } from "../../../../../const"; import { TerminalNode } from "antlr4ts/tree/TerminalNode"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { ProcessedType } from "../../../../../semantics"; +import { BuiltInTypes } from "../../../../../semantics"; /** * Relational expression, which can be used to compare two numeric expressions. @@ -134,7 +134,7 @@ export class RelationalExpression extends ComparativeExpression< public async primarySemanticTypeChecking(): Promise { // Relational expressions always return 'bool' this.typeSemantics = { - evaluatedType: ProcessedType.fromCompilableType("bool"), + evaluatedType: BuiltInTypes.bool, }; // Type check the relational expression and ensure its operands are of type 'num' diff --git a/kipper/core/src/compiler/ast/nodes/expressions/function-call-expression/function-call-expression-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/function-call-expression/function-call-expression-semantics.ts index 2b7009268..1a486dae7 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/function-call-expression/function-call-expression-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/function-call-expression/function-call-expression-semantics.ts @@ -2,8 +2,7 @@ * Semantics for AST Node {@link FunctionCallExpression}. * @since 0.5.0 */ -import type { Reference } from "../../../../semantics"; -import type { KipperReferenceable } from "../../../../const"; +import type { Reference, ScopeFunctionDeclaration } from "../../../../semantics"; import type { Expression } from "../expression"; import type { ExpressionSemantics } from "../expression-semantics"; @@ -21,7 +20,7 @@ export interface FunctionCallExpressionSemantics extends ExpressionSemantics { * The function that is called by this expression. * @since 0.5.0 */ - callTarget: Reference; + callTarget: Reference; /** * The arguments that were passed to this function. * @since 0.6.0 diff --git a/kipper/core/src/compiler/ast/nodes/expressions/function-call-expression/function-call-expression-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/function-call-expression/function-call-expression-type-semantics.ts index ef16b155b..b70381a5a 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/function-call-expression/function-call-expression-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/function-call-expression/function-call-expression-type-semantics.ts @@ -2,8 +2,8 @@ * Type semantics for AST Node {@link FunctionCallExpression}. * @since 0.5.0 */ -import type { KipperFunction } from "../../../../const"; import type { ExpressionTypeSemantics } from "../expression-type-semantics"; +import type { ScopeFunctionDeclaration } from "../../../../semantics"; /** * Type semantics for AST Node {@link FunctionCallExpression}. @@ -15,5 +15,5 @@ export interface FunctionCallExpressionTypeSemantics extends ExpressionTypeSeman * a {@link ScopeVariableDeclaration function in a variable}. * @since 0.10.0 */ - func: KipperFunction; + func: ScopeFunctionDeclaration; } 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 910009298..f3a3583c5 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 @@ -9,13 +9,12 @@ import type { FunctionCallExpressionSemantics } from "./function-call-expression-semantics"; import type { FunctionCallExpressionTypeSemantics } from "./function-call-expression-type-semantics"; import type { CompilableASTNode } from "../../../compilable-ast-node"; -import type { KipperReferenceableFunction } from "../../../../const"; import type { IdentifierPrimaryExpressionSemantics } from "../primary-expression"; import { Expression } from "../expression"; import type { FunctionCallExpressionContext } from "../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../lexer-parser"; import { UnableToDetermineSemanticDataError } from "../../../../../errors"; -import { ProcessedType } from "../../../../semantics"; +import type { Reference, ScopeFunctionDeclaration } from "../../../../semantics"; /** * Function call class, which represents a function call expression in the Kipper language. @@ -111,7 +110,8 @@ export class FunctionCallExpression extends Expression< this.semanticData = { identifier: identifierSemantics.identifier, args: args, - callTarget: identifierSemantics.ref, + // TODO! Fix this as we need to check its type instead of force casting + callTarget: >identifierSemantics.ref, }; } @@ -128,22 +128,14 @@ export class FunctionCallExpression extends Expression< // Ensure that the reference is a callable function this.programCtx.typeCheck(this).refTargetCallable(semanticData.callTarget.refTarget); - const calledFunc = semanticData.callTarget.refTarget; + const calledFunc = semanticData.callTarget.refTarget; // Ensure valid arguments are passed this.programCtx.typeCheck(this).validFunctionCallArguments(calledFunc, semanticData.args); - // Get the type that the function call will evaluate to - let evaluatedType: ProcessedType; - if (calledFunc.returnType instanceof ProcessedType) { - evaluatedType = calledFunc.returnType; - } else { - evaluatedType = ProcessedType.fromCompilableType(calledFunc.returnType); - } - // The evaluated type is always equal to the return of the function this.typeSemantics = { - evaluatedType: evaluatedType, + evaluatedType: calledFunc.returnType, func: calledFunc, }; } 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 003d59212..a477abc4c 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 @@ -16,7 +16,7 @@ import type { LogicalAndExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; import type { CompilableASTNode } from "../../../../compilable-ast-node"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { ProcessedType } from "../../../../../semantics"; +import { BuiltInTypes } from "../../../../../semantics"; /** * Logical-and expression, representing an expression which can be used to combine multiple conditions. It will @@ -115,7 +115,7 @@ export class LogicalAndExpression extends LogicalExpression< public async primarySemanticTypeChecking(): Promise { // Logical expressions always return 'bool' this.typeSemantics = { - evaluatedType: ProcessedType.fromCompilableType("bool"), + evaluatedType: BuiltInTypes.bool, }; } 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 3ebb2ff7a..e0908f81c 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 @@ -17,7 +17,7 @@ import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer import type { CompilableASTNode } from "../../../../compilable-ast-node"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; import { kipperLogicalOrOperator } from "../../../../../const"; -import { ProcessedType } from "../../../../../semantics"; +import { BuiltInTypes } from "../../../../../semantics"; /** * Logical-or expression, representing an expression which can be used to combine multiple conditions. It returns true @@ -116,7 +116,7 @@ export class LogicalOrExpression extends LogicalExpression< public async primarySemanticTypeChecking(): Promise { // Logical expressions always return 'bool' this.typeSemantics = { - evaluatedType: ProcessedType.fromCompilableType("bool"), + evaluatedType: BuiltInTypes.bool, }; } 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 f6dbc33e7..d6d74199c 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 @@ -15,7 +15,7 @@ import { import type { CompilableASTNode } from "../../../compilable-ast-node"; import { Expression } from "../expression"; import { KipperNotImplementedError, UnableToDetermineSemanticDataError } from "../../../../../errors"; -import { kipperInternalBuiltInFunctions } from "../../../../semantics/runtime-built-ins"; +import { kipperInternalBuiltInFunctions } from "../../../../semantics"; /** * A union of all possible {@link KipperParserRuleContext} rule contexts that {@link MemberAccessExpression} implements. 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 493f9d2ee..1f2de20e7 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 @@ -14,7 +14,7 @@ import type { IncrementOrDecrementPostfixExpressionContext } from "../../../../. import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; import type { CompilableASTNode } from "../../../../compilable-ast-node"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { ProcessedType } from "../../../../../semantics"; +import { BuiltInTypes } from "../../../../../semantics"; /** * Increment or Decrement expression, which represents a right-side -- or ++ expression modifying a numeric value. @@ -112,7 +112,7 @@ export class IncrementOrDecrementPostfixExpression extends PostfixExpression< public async primarySemanticTypeChecking(): Promise { this.typeSemantics = { // This will always be a number - evaluatedType: ProcessedType.fromKipperType("num"), + evaluatedType: BuiltInTypes.num, }; // Ensure that this expression is valid (e.g. the operand is a number) 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 1fd4214b9..5108145e3 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 @@ -7,7 +7,7 @@ import type { ArrayPrimaryExpressionTypeSemantics } from "./array-primary-expres import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { ArrayPrimaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import { ProcessedType } from "../../../../../semantics"; +import { BuiltInTypes } from "../../../../../semantics"; import { PrimaryExpression } from "../primary-expression"; /** @@ -90,7 +90,7 @@ export class ArrayPrimaryExpression extends PrimaryExpression< public async primarySemanticTypeChecking(): Promise { // This will always be of type 'list' this.typeSemantics = { - evaluatedType: ProcessedType.fromCompilableType("list"), + evaluatedType: BuiltInTypes.list, }; } 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 151a1c2d1..a83650c36 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 @@ -8,7 +8,7 @@ import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { KipperBoolTypeConstants } from "../../../../../const"; import type { BoolPrimaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import { ProcessedType } from "../../../../../semantics"; +import { BuiltInTypes } from "../../../../../semantics"; import { PrimaryExpression } from "../primary-expression"; /** @@ -91,7 +91,7 @@ export class BoolPrimaryExpression extends PrimaryExpression< public async primarySemanticTypeChecking(): Promise { // This will always be of type 'bool' this.typeSemantics = { - evaluatedType: ProcessedType.fromCompilableType("bool"), + evaluatedType: BuiltInTypes.bool, }; } 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 552df5d99..deaf6f050 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 @@ -14,7 +14,7 @@ import { ParseRuleKindMapping, } from "../../../../../lexer-parser"; import type { CompilableASTNode } from "../../../../compilable-ast-node"; -import { ProcessedType } from "../../../../../semantics"; +import { BuiltInTypes, ProcessedType } from "../../../../../semantics"; import { getParseRuleSource } from "../../../../../../tools"; /** @@ -116,7 +116,7 @@ export class FStringPrimaryExpression extends Expression< public async primarySemanticTypeChecking(): Promise { // This will always be of type 'str' this.typeSemantics = { - evaluatedType: ProcessedType.fromCompilableType("str"), + evaluatedType: BuiltInTypes.str, }; } 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 f8b22b80c..727c138eb 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 @@ -9,7 +9,7 @@ import type { IdentifierPrimaryExpressionTypeSemantics } from "./identifier-prim import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { IdentifierPrimaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import type { ProcessedType } from "../../../../../semantics"; +import { ProcessedType, ScopeFunctionDeclaration, ScopeVariableDeclaration } from "../../../../../semantics"; import { BuiltInTypes, ScopeDeclaration } from "../../../../../semantics"; import { AssignmentExpression } from "../../assignment-expression/assignment-expression"; import { PrimaryExpression } from "../primary-expression"; @@ -94,7 +94,7 @@ export class IdentifierPrimaryExpression extends PrimaryExpression< }, }; - if (!(ref instanceof ScopeDeclaration)) { + if (ref.isBuiltIn && (ref instanceof ScopeVariableDeclaration || ref instanceof ScopeFunctionDeclaration)) { this.programCtx.addBuiltInReference(this, ref); } else { // If the reference is not used inside an assignment expression, ensure that the reference is defined @@ -118,16 +118,8 @@ export class IdentifierPrimaryExpression extends PrimaryExpression< const semanticData = this.getSemanticData(); const refTarget = semanticData.ref.refTarget; - let type: ProcessedType; - if (refTarget instanceof ScopeDeclaration) { - type = refTarget.type; - } else { - // Built-in function -> type is 'func' - type = "valueType" in refTarget ? refTarget.valueType : BuiltInTypes.func; - } - this.typeSemantics = { - evaluatedType: type, + evaluatedType: refTarget.type, }; } 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 4c5673d17..01cfcacfc 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 @@ -7,7 +7,7 @@ import type { NumberPrimaryExpressionTypeSemantics } from "./number-primary-expr import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { NumberPrimaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import { ProcessedType } from "../../../../../semantics"; +import { BuiltInTypes } from "../../../../../semantics"; import { PrimaryExpression } from "../primary-expression"; /** @@ -92,7 +92,7 @@ export class NumberPrimaryExpression extends PrimaryExpression< public async primarySemanticTypeChecking(): Promise { // This will always be of type 'number' this.typeSemantics = { - evaluatedType: ProcessedType.fromCompilableType("num"), + evaluatedType: BuiltInTypes.num, }; } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/string-primary-expression/string-primary-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/string-primary-expression/string-primary-expression.ts index d4bb814b1..7cb9b4060 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/string-primary-expression/string-primary-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/string-primary-expression/string-primary-expression.ts @@ -7,7 +7,7 @@ import type { StringPrimaryExpressionTypeSemantics } from "./string-primary-expr import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { StringPrimaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import { ProcessedType } from "../../../../../semantics"; +import { BuiltInTypes, ProcessedType } from "../../../../../semantics"; import { PrimaryExpression } from "../primary-expression"; /** @@ -91,7 +91,7 @@ export class StringPrimaryExpression extends PrimaryExpression< public async primarySemanticTypeChecking(): Promise { // This will always be of type 'str' this.typeSemantics = { - evaluatedType: ProcessedType.fromCompilableType("str"), + evaluatedType: BuiltInTypes.str, }; } 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 824d1c482..96891d90b 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 @@ -8,7 +8,7 @@ import type { VoidOrNullOrUndefinedPrimaryExpressionSemantics } from "./void-or- import type { VoidOrNullOrUndefinedPrimaryExpressionTypeSemantics } from "./void-or-null-or-undefined-primary-expression-type-semantics"; import type { VoidOrNullOrUndefinedPrimaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import { ProcessedType } from "../../../../../semantics"; +import { BuiltInTypes } from "../../../../../semantics"; import { PrimaryExpression } from "../primary-expression"; /** @@ -93,7 +93,7 @@ export class VoidOrNullOrUndefinedPrimaryExpression extends PrimaryExpression< // The evaluated type of this expression will always be equal to the constant identifier that this expression // contains e.g. either 'void', 'null' or 'undefined'. this.typeSemantics = { - evaluatedType: ProcessedType.fromCompilableType(semanticData.constantIdentifier), + evaluatedType: BuiltInTypes[semanticData.constantIdentifier], }; } 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 02e44e2d3..e0a9acf5c 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 @@ -13,7 +13,7 @@ import type { CompilableASTNode } from "../../../../compilable-ast-node"; import { TypeSpecifierExpression } from "../type-specifier-expression"; import type { IdentifierTypeSpecifierExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import { ProcessedType, RawType } from "../../../../../semantics"; +import { BuiltInTypes, RawType } from "../../../../../semantics"; /** * Type specifier expression, which represents a simple identifier type specifier. @@ -98,10 +98,10 @@ export class IdentifierTypeSpecifierExpression extends TypeSpecifierExpression< const semanticData = this.getSemanticData(); // Create a checked type instance (this function handles error recovery and invalid types) - const valueType = this.programCtx.typeCheck(this).getCheckedType(semanticData.typeIdentifier); + const valueType = this.programCtx.typeCheck(this).getCheckedType(semanticData.typeIdentifier, this.scope); this.typeSemantics = { // A type specifier will always evaluate to be of type 'type' - evaluatedType: ProcessedType.fromCompilableType("type"), + evaluatedType: BuiltInTypes.type, storedType: valueType, }; } 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 a4f862f9b..de82d6f0e 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 @@ -14,7 +14,7 @@ import { UnaryExpression } from "../unary-expression"; import type { IncrementOrDecrementUnaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { ProcessedType } from "../../../../../semantics"; +import { BuiltInTypes } from "../../../../../semantics"; /** * Increment or decrement expression class, which represents a left-side -- or ++ expression modifying a numeric value. @@ -112,7 +112,7 @@ export class IncrementOrDecrementUnaryExpression extends UnaryExpression< public async primarySemanticTypeChecking(): Promise { this.typeSemantics = { // This will always be a number - evaluatedType: ProcessedType.fromKipperType("num"), + evaluatedType: BuiltInTypes.num, }; // Ensure that this expression is valid (e.g. the operand is a number) 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 c99254ffd..68ae8ded5 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 @@ -16,7 +16,7 @@ import { UnaryExpression } from "../unary-expression"; import type { OperatorModifiedUnaryExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping, UnaryOperatorContext } from "../../../../../lexer-parser"; import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; -import { ProcessedType } from "../../../../../semantics"; +import { BuiltInTypes } from "../../../../../semantics"; /** * Operator modified expressions, which are used to modify the value of an expression based on an @@ -125,7 +125,7 @@ export class OperatorModifiedUnaryExpression extends UnaryExpression< const semanticData = this.getSemanticData(); this.typeSemantics = { - evaluatedType: ProcessedType.fromCompilableType(semanticData.operator === "!" ? "bool" : "num"), + evaluatedType: semanticData.operator === "!" ? BuiltInTypes.bool : BuiltInTypes.num, }; // Ensure the operator is compatible with the type of the operand diff --git a/kipper/core/src/compiler/ast/nodes/root-ast-node.ts b/kipper/core/src/compiler/ast/nodes/root-ast-node.ts index 7b030e2ac..30632aa22 100644 --- a/kipper/core/src/compiler/ast/nodes/root-ast-node.ts +++ b/kipper/core/src/compiler/ast/nodes/root-ast-node.ts @@ -8,8 +8,6 @@ import type { KipperCompileTarget, KipperTargetCodeGenerator, KipperTargetSemanticAnalyser, - TargetASTNodeCodeGenerator, - TargetASTNodeSemanticAnalyser, TargetSetUpCodeGenerator, TargetWrapUpCodeGenerator, } from "../../target-presets"; @@ -21,7 +19,7 @@ import type { TranslatedCodeLine } from "../../const"; import type { KipperError } from "../../../errors"; import type { CompilationUnitContext } from "../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../lexer-parser"; -import { FunctionScope, GlobalScope, handleSemanticError } from "../../semantics"; +import { GlobalScope, handleSemanticError } from "../../semantics"; import type { ScopeNode } from "../scope-node"; /** @@ -77,7 +75,7 @@ export class RootASTNode extends ParserASTNode imp this._programCtx = programCtx; this._children = []; this._parent = undefined; - this._innerScope = new GlobalScope(this); + this._innerScope = new GlobalScope(this, this.programCtx.universeScope); } /** diff --git a/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement.ts b/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement.ts index bbffe7331..46d104872 100644 --- a/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement.ts +++ b/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement.ts @@ -7,7 +7,7 @@ import type { ReturnStatementSemantics } from "./return-statement-semantics"; import type { ReturnStatementTypeSemantics } from "./return-statement-type-semantics"; import type { Expression } from "../../expressions"; import { Statement } from "../statement"; -import { ProcessedType } from "../../../../semantics"; +import { BuiltInTypes } from "../../../../semantics"; import type { ReturnStatementContext } from "../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../lexer-parser"; @@ -115,8 +115,7 @@ export class ReturnStatement extends Statement; */ export type TranslatedCodeLine = Array; -/** - * Represents all referencable functions that a user can use inside Kipper. This does not include internal functions. - * @since 0.10.0 - */ -export type KipperReferenceableFunction = BuiltInFunction | ScopeFunctionDeclaration; - -/** - * Represents a Kipper function that can be either declared or defined. - * @since 0.6.0 - */ -export type KipperFunction = InternalFunction | KipperReferenceableFunction; - -/** - * Represents a Kipper variable that can be either declared or defined. - * @since 0.6.0 - */ -export type KipperVariable = BuiltInVariable | ScopeVariableDeclaration; - -/** - * Represents a Kipper parameter inside a custom user-defined {@link FunctionDeclaration ScopeFunctionDeclaration}. - * @since 0.10.0 - */ -export type KipperParam = ScopeParameterDeclaration; - -/** - * Represents a Kipper argument inside a custom user-defined {@link FunctionDeclaration ScopeFunctionDeclaration}. - * - * @alias KipperParam - * @since 0.10.0 - */ -export type KipperArg = KipperParam; - /** * Represents a runtime variable or function that can be referenced. * @since 0.6.0 */ -export type KipperReferenceable = KipperReferenceableFunction | KipperVariable | KipperParam | ScopeDeclaration; +export type KipperReferenceable = ScopeDeclaration; /** * Represents all possible jump statements inside Kipper. diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.interp b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.interp index c4b1e6cca..17e337f2a 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.interp +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.interp @@ -3,6 +3,7 @@ null null null null +null 'const' 'var' 'as' @@ -91,6 +92,7 @@ null FStringExpStart BlockComment LineComment +Pragma Const Var As @@ -256,4 +258,4 @@ typeSpecifierIdentifier atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 87, 704, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 3, 2, 5, 2, 160, 10, 2, 3, 2, 3, 2, 3, 3, 6, 3, 165, 10, 3, 13, 3, 14, 3, 166, 3, 4, 3, 4, 3, 5, 6, 5, 172, 10, 5, 13, 5, 14, 5, 173, 3, 6, 3, 6, 3, 6, 5, 6, 179, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 187, 10, 7, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 199, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 211, 10, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 217, 10, 14, 3, 15, 3, 15, 3, 15, 7, 15, 222, 10, 15, 12, 15, 14, 15, 225, 11, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 247, 10, 19, 3, 20, 3, 20, 3, 20, 5, 20, 252, 10, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 5, 22, 263, 10, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 272, 10, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 280, 10, 24, 12, 24, 14, 24, 283, 11, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 5, 25, 295, 10, 25, 3, 26, 3, 26, 3, 26, 5, 26, 300, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 306, 10, 27, 3, 27, 3, 27, 5, 27, 310, 10, 27, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 316, 10, 27, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 322, 10, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 5, 31, 346, 10, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 5, 32, 359, 10, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 5, 37, 373, 10, 37, 3, 38, 3, 38, 3, 39, 3, 39, 7, 39, 379, 10, 39, 12, 39, 14, 39, 382, 11, 39, 3, 39, 3, 39, 3, 39, 7, 39, 387, 10, 39, 12, 39, 14, 39, 390, 11, 39, 3, 39, 5, 39, 393, 10, 39, 3, 40, 3, 40, 3, 40, 5, 40, 398, 10, 40, 3, 40, 5, 40, 401, 10, 40, 3, 41, 3, 41, 3, 41, 5, 41, 406, 10, 41, 3, 41, 5, 41, 409, 10, 41, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 7, 43, 417, 10, 43, 12, 43, 14, 43, 420, 11, 43, 5, 43, 422, 10, 43, 3, 43, 5, 43, 425, 10, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 7, 44, 433, 10, 44, 12, 44, 14, 44, 436, 11, 44, 5, 44, 438, 10, 44, 3, 44, 5, 44, 441, 10, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 5, 47, 457, 10, 47, 3, 47, 3, 47, 3, 47, 5, 47, 462, 10, 47, 3, 47, 3, 47, 3, 47, 5, 47, 467, 10, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 7, 47, 483, 10, 47, 12, 47, 14, 47, 486, 11, 47, 3, 48, 3, 48, 3, 48, 7, 48, 491, 10, 48, 12, 48, 14, 48, 494, 11, 48, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 507, 10, 51, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 513, 10, 51, 3, 51, 3, 51, 3, 52, 3, 52, 5, 52, 519, 10, 52, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 5, 54, 527, 10, 54, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 5, 59, 544, 10, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 7, 60, 552, 10, 60, 12, 60, 14, 60, 555, 11, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 7, 61, 563, 10, 61, 12, 61, 14, 61, 566, 11, 61, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 7, 62, 575, 10, 62, 12, 62, 14, 62, 578, 11, 62, 3, 63, 3, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 7, 64, 588, 10, 64, 12, 64, 14, 64, 591, 11, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 7, 65, 599, 10, 65, 12, 65, 14, 65, 602, 11, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 7, 66, 610, 10, 66, 12, 66, 14, 66, 613, 11, 66, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 7, 67, 621, 10, 67, 12, 67, 14, 67, 624, 11, 67, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 7, 68, 632, 10, 68, 12, 68, 14, 68, 635, 11, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 7, 69, 643, 10, 69, 12, 69, 14, 69, 646, 11, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 7, 70, 654, 10, 70, 12, 70, 14, 70, 657, 11, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 5, 71, 666, 10, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 5, 72, 673, 10, 72, 3, 73, 3, 73, 3, 74, 3, 74, 3, 74, 7, 74, 680, 10, 74, 12, 74, 14, 74, 683, 11, 74, 3, 75, 3, 75, 3, 75, 5, 75, 688, 10, 75, 3, 76, 3, 76, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 79, 3, 79, 3, 79, 2, 2, 13, 92, 118, 120, 122, 126, 128, 130, 132, 134, 136, 138, 80, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 70, 2, 72, 2, 74, 2, 76, 2, 78, 2, 80, 2, 82, 2, 84, 2, 86, 2, 88, 2, 90, 2, 92, 2, 94, 2, 96, 2, 98, 2, 100, 2, 102, 2, 104, 2, 106, 2, 108, 2, 110, 2, 112, 2, 114, 2, 116, 2, 118, 2, 120, 2, 122, 2, 124, 2, 126, 2, 128, 2, 130, 2, 132, 2, 134, 2, 136, 2, 138, 2, 140, 2, 142, 2, 144, 2, 146, 2, 148, 2, 150, 2, 152, 2, 154, 2, 156, 2, 2, 17, 3, 2, 6, 7, 3, 2, 13, 14, 3, 2, 27, 28, 3, 2, 77, 78, 4, 2, 76, 76, 79, 79, 3, 2, 30, 32, 4, 2, 45, 45, 47, 47, 6, 2, 44, 44, 46, 46, 54, 54, 70, 70, 3, 2, 48, 51, 4, 2, 44, 44, 46, 46, 3, 2, 71, 73, 3, 2, 63, 66, 3, 2, 61, 62, 3, 2, 55, 60, 4, 2, 30, 32, 75, 75, 2, 705, 2, 159, 3, 2, 2, 2, 4, 164, 3, 2, 2, 2, 6, 168, 3, 2, 2, 2, 8, 171, 3, 2, 2, 2, 10, 178, 3, 2, 2, 2, 12, 186, 3, 2, 2, 2, 14, 188, 3, 2, 2, 2, 16, 191, 3, 2, 2, 2, 18, 193, 3, 2, 2, 2, 20, 200, 3, 2, 2, 2, 22, 202, 3, 2, 2, 2, 24, 204, 3, 2, 2, 2, 26, 206, 3, 2, 2, 2, 28, 218, 3, 2, 2, 2, 30, 226, 3, 2, 2, 2, 32, 230, 3, 2, 2, 2, 34, 235, 3, 2, 2, 2, 36, 246, 3, 2, 2, 2, 38, 248, 3, 2, 2, 2, 40, 255, 3, 2, 2, 2, 42, 262, 3, 2, 2, 2, 44, 264, 3, 2, 2, 2, 46, 273, 3, 2, 2, 2, 48, 294, 3, 2, 2, 2, 50, 299, 3, 2, 2, 2, 52, 301, 3, 2, 2, 2, 54, 326, 3, 2, 2, 2, 56, 332, 3, 2, 2, 2, 58, 340, 3, 2, 2, 2, 60, 343, 3, 2, 2, 2, 62, 358, 3, 2, 2, 2, 64, 360, 3, 2, 2, 2, 66, 364, 3, 2, 2, 2, 68, 366, 3, 2, 2, 2, 70, 368, 3, 2, 2, 2, 72, 372, 3, 2, 2, 2, 74, 374, 3, 2, 2, 2, 76, 392, 3, 2, 2, 2, 78, 400, 3, 2, 2, 2, 80, 408, 3, 2, 2, 2, 82, 410, 3, 2, 2, 2, 84, 412, 3, 2, 2, 2, 86, 428, 3, 2, 2, 2, 88, 444, 3, 2, 2, 2, 90, 448, 3, 2, 2, 2, 92, 461, 3, 2, 2, 2, 94, 487, 3, 2, 2, 2, 96, 495, 3, 2, 2, 2, 98, 498, 3, 2, 2, 2, 100, 502, 3, 2, 2, 2, 102, 518, 3, 2, 2, 2, 104, 520, 3, 2, 2, 2, 106, 526, 3, 2, 2, 2, 108, 528, 3, 2, 2, 2, 110, 531, 3, 2, 2, 2, 112, 534, 3, 2, 2, 2, 114, 536, 3, 2, 2, 2, 116, 543, 3, 2, 2, 2, 118, 545, 3, 2, 2, 2, 120, 556, 3, 2, 2, 2, 122, 567, 3, 2, 2, 2, 124, 579, 3, 2, 2, 2, 126, 581, 3, 2, 2, 2, 128, 592, 3, 2, 2, 2, 130, 603, 3, 2, 2, 2, 132, 614, 3, 2, 2, 2, 134, 625, 3, 2, 2, 2, 136, 636, 3, 2, 2, 2, 138, 647, 3, 2, 2, 2, 140, 665, 3, 2, 2, 2, 142, 672, 3, 2, 2, 2, 144, 674, 3, 2, 2, 2, 146, 676, 3, 2, 2, 2, 148, 687, 3, 2, 2, 2, 150, 689, 3, 2, 2, 2, 152, 691, 3, 2, 2, 2, 154, 696, 3, 2, 2, 2, 156, 701, 3, 2, 2, 2, 158, 160, 5, 4, 3, 2, 159, 158, 3, 2, 2, 2, 159, 160, 3, 2, 2, 2, 160, 161, 3, 2, 2, 2, 161, 162, 7, 2, 2, 3, 162, 3, 3, 2, 2, 2, 163, 165, 5, 6, 4, 2, 164, 163, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 164, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 5, 3, 2, 2, 2, 168, 169, 5, 8, 5, 2, 169, 7, 3, 2, 2, 2, 170, 172, 5, 10, 6, 2, 171, 170, 3, 2, 2, 2, 172, 173, 3, 2, 2, 2, 173, 171, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 174, 9, 3, 2, 2, 2, 175, 179, 5, 36, 19, 2, 176, 179, 5, 12, 7, 2, 177, 179, 7, 34, 2, 2, 178, 175, 3, 2, 2, 2, 178, 176, 3, 2, 2, 2, 178, 177, 3, 2, 2, 2, 179, 11, 3, 2, 2, 2, 180, 181, 5, 14, 8, 2, 181, 182, 7, 34, 2, 2, 182, 187, 3, 2, 2, 2, 183, 187, 5, 26, 14, 2, 184, 187, 5, 32, 17, 2, 185, 187, 5, 34, 18, 2, 186, 180, 3, 2, 2, 2, 186, 183, 3, 2, 2, 2, 186, 184, 3, 2, 2, 2, 186, 185, 3, 2, 2, 2, 187, 13, 3, 2, 2, 2, 188, 189, 5, 16, 9, 2, 189, 190, 5, 18, 10, 2, 190, 15, 3, 2, 2, 2, 191, 192, 9, 2, 2, 2, 192, 17, 3, 2, 2, 2, 193, 194, 5, 22, 12, 2, 194, 195, 7, 36, 2, 2, 195, 198, 5, 148, 75, 2, 196, 197, 7, 55, 2, 2, 197, 199, 5, 20, 11, 2, 198, 196, 3, 2, 2, 2, 198, 199, 3, 2, 2, 2, 199, 19, 3, 2, 2, 2, 200, 201, 5, 142, 72, 2, 201, 21, 3, 2, 2, 2, 202, 203, 5, 24, 13, 2, 203, 23, 3, 2, 2, 2, 204, 205, 7, 75, 2, 2, 205, 25, 3, 2, 2, 2, 206, 207, 7, 21, 2, 2, 207, 208, 5, 22, 12, 2, 208, 210, 7, 37, 2, 2, 209, 211, 5, 28, 15, 2, 210, 209, 3, 2, 2, 2, 210, 211, 3, 2, 2, 2, 211, 212, 3, 2, 2, 2, 212, 213, 7, 38, 2, 2, 213, 214, 7, 24, 2, 2, 214, 216, 5, 148, 75, 2, 215, 217, 5, 38, 20, 2, 216, 215, 3, 2, 2, 2, 216, 217, 3, 2, 2, 2, 217, 27, 3, 2, 2, 2, 218, 223, 5, 30, 16, 2, 219, 220, 7, 33, 2, 2, 220, 222, 5, 30, 16, 2, 221, 219, 3, 2, 2, 2, 222, 225, 3, 2, 2, 2, 223, 221, 3, 2, 2, 2, 223, 224, 3, 2, 2, 2, 224, 29, 3, 2, 2, 2, 225, 223, 3, 2, 2, 2, 226, 227, 5, 22, 12, 2, 227, 228, 7, 36, 2, 2, 228, 229, 5, 148, 75, 2, 229, 31, 3, 2, 2, 2, 230, 231, 7, 26, 2, 2, 231, 232, 7, 75, 2, 2, 232, 233, 7, 42, 2, 2, 233, 234, 7, 43, 2, 2, 234, 33, 3, 2, 2, 2, 235, 236, 7, 25, 2, 2, 236, 237, 7, 75, 2, 2, 237, 238, 7, 42, 2, 2, 238, 239, 7, 43, 2, 2, 239, 35, 3, 2, 2, 2, 240, 247, 5, 40, 21, 2, 241, 247, 5, 42, 22, 2, 242, 247, 5, 50, 26, 2, 243, 247, 5, 58, 30, 2, 244, 247, 5, 60, 31, 2, 245, 247, 5, 38, 20, 2, 246, 240, 3, 2, 2, 2, 246, 241, 3, 2, 2, 2, 246, 242, 3, 2, 2, 2, 246, 243, 3, 2, 2, 2, 246, 244, 3, 2, 2, 2, 246, 245, 3, 2, 2, 2, 247, 37, 3, 2, 2, 2, 248, 249, 6, 20, 2, 2, 249, 251, 7, 42, 2, 2, 250, 252, 5, 8, 5, 2, 251, 250, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 254, 7, 43, 2, 2, 254, 39, 3, 2, 2, 2, 255, 256, 8, 21, 1, 2, 256, 257, 5, 146, 74, 2, 257, 258, 7, 34, 2, 2, 258, 259, 8, 21, 1, 2, 259, 41, 3, 2, 2, 2, 260, 263, 5, 44, 23, 2, 261, 263, 5, 46, 24, 2, 262, 260, 3, 2, 2, 2, 262, 261, 3, 2, 2, 2, 263, 43, 3, 2, 2, 2, 264, 265, 7, 17, 2, 2, 265, 266, 7, 37, 2, 2, 266, 267, 5, 146, 74, 2, 267, 268, 7, 38, 2, 2, 268, 271, 5, 36, 19, 2, 269, 270, 7, 18, 2, 2, 270, 272, 5, 36, 19, 2, 271, 269, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 45, 3, 2, 2, 2, 273, 274, 7, 10, 2, 2, 274, 275, 7, 37, 2, 2, 275, 276, 5, 146, 74, 2, 276, 277, 7, 38, 2, 2, 277, 281, 7, 42, 2, 2, 278, 280, 5, 48, 25, 2, 279, 278, 3, 2, 2, 2, 280, 283, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 284, 3, 2, 2, 2, 283, 281, 3, 2, 2, 2, 284, 285, 7, 43, 2, 2, 285, 47, 3, 2, 2, 2, 286, 287, 7, 11, 2, 2, 287, 288, 5, 146, 74, 2, 288, 289, 7, 36, 2, 2, 289, 290, 5, 36, 19, 2, 290, 295, 3, 2, 2, 2, 291, 292, 7, 12, 2, 2, 292, 293, 7, 36, 2, 2, 293, 295, 5, 36, 19, 2, 294, 286, 3, 2, 2, 2, 294, 291, 3, 2, 2, 2, 295, 49, 3, 2, 2, 2, 296, 300, 5, 52, 27, 2, 297, 300, 5, 54, 28, 2, 298, 300, 5, 56, 29, 2, 299, 296, 3, 2, 2, 2, 299, 297, 3, 2, 2, 2, 299, 298, 3, 2, 2, 2, 300, 51, 3, 2, 2, 2, 301, 302, 7, 19, 2, 2, 302, 309, 7, 37, 2, 2, 303, 306, 5, 14, 8, 2, 304, 306, 5, 146, 74, 2, 305, 303, 3, 2, 2, 2, 305, 304, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 308, 8, 27, 1, 2, 308, 310, 3, 2, 2, 2, 309, 305, 3, 2, 2, 2, 309, 310, 3, 2, 2, 2, 310, 311, 3, 2, 2, 2, 311, 315, 7, 34, 2, 2, 312, 313, 5, 146, 74, 2, 313, 314, 8, 27, 1, 2, 314, 316, 3, 2, 2, 2, 315, 312, 3, 2, 2, 2, 315, 316, 3, 2, 2, 2, 316, 317, 3, 2, 2, 2, 317, 321, 7, 34, 2, 2, 318, 319, 5, 146, 74, 2, 319, 320, 8, 27, 1, 2, 320, 322, 3, 2, 2, 2, 321, 318, 3, 2, 2, 2, 321, 322, 3, 2, 2, 2, 322, 323, 3, 2, 2, 2, 323, 324, 7, 38, 2, 2, 324, 325, 5, 36, 19, 2, 325, 53, 3, 2, 2, 2, 326, 327, 7, 16, 2, 2, 327, 328, 7, 37, 2, 2, 328, 329, 5, 146, 74, 2, 329, 330, 7, 38, 2, 2, 330, 331, 5, 36, 19, 2, 331, 55, 3, 2, 2, 2, 332, 333, 7, 15, 2, 2, 333, 334, 5, 36, 19, 2, 334, 335, 7, 16, 2, 2, 335, 336, 7, 37, 2, 2, 336, 337, 5, 146, 74, 2, 337, 338, 7, 38, 2, 2, 338, 339, 7, 34, 2, 2, 339, 57, 3, 2, 2, 2, 340, 341, 9, 3, 2, 2, 341, 342, 7, 34, 2, 2, 342, 59, 3, 2, 2, 2, 343, 345, 7, 22, 2, 2, 344, 346, 5, 146, 74, 2, 345, 344, 3, 2, 2, 2, 345, 346, 3, 2, 2, 2, 346, 347, 3, 2, 2, 2, 347, 348, 7, 34, 2, 2, 348, 61, 3, 2, 2, 2, 349, 359, 5, 64, 33, 2, 350, 359, 5, 84, 43, 2, 351, 359, 5, 86, 44, 2, 352, 359, 5, 66, 34, 2, 353, 359, 5, 68, 35, 2, 354, 359, 5, 74, 38, 2, 355, 359, 5, 76, 39, 2, 356, 359, 5, 82, 42, 2, 357, 359, 5, 90, 46, 2, 358, 349, 3, 2, 2, 2, 358, 350, 3, 2, 2, 2, 358, 351, 3, 2, 2, 2, 358, 352, 3, 2, 2, 2, 358, 353, 3, 2, 2, 2, 358, 354, 3, 2, 2, 2, 358, 355, 3, 2, 2, 2, 358, 356, 3, 2, 2, 2, 358, 357, 3, 2, 2, 2, 359, 63, 3, 2, 2, 2, 360, 361, 7, 37, 2, 2, 361, 362, 5, 146, 74, 2, 362, 363, 7, 38, 2, 2, 363, 65, 3, 2, 2, 2, 364, 365, 9, 4, 2, 2, 365, 67, 3, 2, 2, 2, 366, 367, 5, 70, 36, 2, 367, 69, 3, 2, 2, 2, 368, 369, 7, 75, 2, 2, 369, 71, 3, 2, 2, 2, 370, 373, 5, 70, 36, 2, 371, 373, 5, 74, 38, 2, 372, 370, 3, 2, 2, 2, 372, 371, 3, 2, 2, 2, 373, 73, 3, 2, 2, 2, 374, 375, 9, 5, 2, 2, 375, 75, 3, 2, 2, 2, 376, 380, 7, 82, 2, 2, 377, 379, 5, 78, 40, 2, 378, 377, 3, 2, 2, 2, 379, 382, 3, 2, 2, 2, 380, 378, 3, 2, 2, 2, 380, 381, 3, 2, 2, 2, 381, 383, 3, 2, 2, 2, 382, 380, 3, 2, 2, 2, 383, 393, 7, 84, 2, 2, 384, 388, 7, 83, 2, 2, 385, 387, 5, 80, 41, 2, 386, 385, 3, 2, 2, 2, 387, 390, 3, 2, 2, 2, 388, 386, 3, 2, 2, 2, 388, 389, 3, 2, 2, 2, 389, 391, 3, 2, 2, 2, 390, 388, 3, 2, 2, 2, 391, 393, 7, 86, 2, 2, 392, 376, 3, 2, 2, 2, 392, 384, 3, 2, 2, 2, 393, 77, 3, 2, 2, 2, 394, 401, 7, 85, 2, 2, 395, 397, 7, 3, 2, 2, 396, 398, 5, 146, 74, 2, 397, 396, 3, 2, 2, 2, 397, 398, 3, 2, 2, 2, 398, 399, 3, 2, 2, 2, 399, 401, 7, 41, 2, 2, 400, 394, 3, 2, 2, 2, 400, 395, 3, 2, 2, 2, 401, 79, 3, 2, 2, 2, 402, 409, 7, 87, 2, 2, 403, 405, 7, 3, 2, 2, 404, 406, 5, 146, 74, 2, 405, 404, 3, 2, 2, 2, 405, 406, 3, 2, 2, 2, 406, 407, 3, 2, 2, 2, 407, 409, 7, 41, 2, 2, 408, 402, 3, 2, 2, 2, 408, 403, 3, 2, 2, 2, 409, 81, 3, 2, 2, 2, 410, 411, 9, 6, 2, 2, 411, 83, 3, 2, 2, 2, 412, 421, 7, 39, 2, 2, 413, 418, 5, 146, 74, 2, 414, 415, 7, 33, 2, 2, 415, 417, 5, 146, 74, 2, 416, 414, 3, 2, 2, 2, 417, 420, 3, 2, 2, 2, 418, 416, 3, 2, 2, 2, 418, 419, 3, 2, 2, 2, 419, 422, 3, 2, 2, 2, 420, 418, 3, 2, 2, 2, 421, 413, 3, 2, 2, 2, 421, 422, 3, 2, 2, 2, 422, 424, 3, 2, 2, 2, 423, 425, 7, 33, 2, 2, 424, 423, 3, 2, 2, 2, 424, 425, 3, 2, 2, 2, 425, 426, 3, 2, 2, 2, 426, 427, 7, 40, 2, 2, 427, 85, 3, 2, 2, 2, 428, 437, 7, 42, 2, 2, 429, 434, 5, 88, 45, 2, 430, 431, 7, 33, 2, 2, 431, 433, 5, 88, 45, 2, 432, 430, 3, 2, 2, 2, 433, 436, 3, 2, 2, 2, 434, 432, 3, 2, 2, 2, 434, 435, 3, 2, 2, 2, 435, 438, 3, 2, 2, 2, 436, 434, 3, 2, 2, 2, 437, 429, 3, 2, 2, 2, 437, 438, 3, 2, 2, 2, 438, 440, 3, 2, 2, 2, 439, 441, 7, 33, 2, 2, 440, 439, 3, 2, 2, 2, 440, 441, 3, 2, 2, 2, 441, 442, 3, 2, 2, 2, 442, 443, 7, 43, 2, 2, 443, 87, 3, 2, 2, 2, 444, 445, 5, 72, 37, 2, 445, 446, 7, 36, 2, 2, 446, 447, 5, 146, 74, 2, 447, 89, 3, 2, 2, 2, 448, 449, 9, 7, 2, 2, 449, 91, 3, 2, 2, 2, 450, 451, 8, 47, 1, 2, 451, 462, 5, 62, 32, 2, 452, 453, 7, 23, 2, 2, 453, 454, 5, 92, 47, 2, 454, 456, 7, 37, 2, 2, 455, 457, 5, 94, 48, 2, 456, 455, 3, 2, 2, 2, 456, 457, 3, 2, 2, 2, 457, 458, 3, 2, 2, 2, 458, 459, 7, 38, 2, 2, 459, 460, 8, 47, 1, 2, 460, 462, 3, 2, 2, 2, 461, 450, 3, 2, 2, 2, 461, 452, 3, 2, 2, 2, 462, 484, 3, 2, 2, 2, 463, 464, 12, 7, 2, 2, 464, 466, 7, 37, 2, 2, 465, 467, 5, 94, 48, 2, 466, 465, 3, 2, 2, 2, 466, 467, 3, 2, 2, 2, 467, 468, 3, 2, 2, 2, 468, 469, 7, 38, 2, 2, 469, 483, 8, 47, 1, 2, 470, 471, 12, 5, 2, 2, 471, 472, 5, 96, 49, 2, 472, 473, 8, 47, 1, 2, 473, 483, 3, 2, 2, 2, 474, 475, 12, 4, 2, 2, 475, 476, 5, 98, 50, 2, 476, 477, 8, 47, 1, 2, 477, 483, 3, 2, 2, 2, 478, 479, 12, 3, 2, 2, 479, 480, 5, 100, 51, 2, 480, 481, 8, 47, 1, 2, 481, 483, 3, 2, 2, 2, 482, 463, 3, 2, 2, 2, 482, 470, 3, 2, 2, 2, 482, 474, 3, 2, 2, 2, 482, 478, 3, 2, 2, 2, 483, 486, 3, 2, 2, 2, 484, 482, 3, 2, 2, 2, 484, 485, 3, 2, 2, 2, 485, 93, 3, 2, 2, 2, 486, 484, 3, 2, 2, 2, 487, 492, 5, 142, 72, 2, 488, 489, 7, 33, 2, 2, 489, 491, 5, 142, 72, 2, 490, 488, 3, 2, 2, 2, 491, 494, 3, 2, 2, 2, 492, 490, 3, 2, 2, 2, 492, 493, 3, 2, 2, 2, 493, 95, 3, 2, 2, 2, 494, 492, 3, 2, 2, 2, 495, 496, 7, 74, 2, 2, 496, 497, 5, 70, 36, 2, 497, 97, 3, 2, 2, 2, 498, 499, 7, 39, 2, 2, 499, 500, 5, 146, 74, 2, 500, 501, 7, 40, 2, 2, 501, 99, 3, 2, 2, 2, 502, 506, 7, 39, 2, 2, 503, 504, 5, 146, 74, 2, 504, 505, 8, 51, 1, 2, 505, 507, 3, 2, 2, 2, 506, 503, 3, 2, 2, 2, 506, 507, 3, 2, 2, 2, 507, 508, 3, 2, 2, 2, 508, 512, 7, 36, 2, 2, 509, 510, 5, 146, 74, 2, 510, 511, 8, 51, 1, 2, 511, 513, 3, 2, 2, 2, 512, 509, 3, 2, 2, 2, 512, 513, 3, 2, 2, 2, 513, 514, 3, 2, 2, 2, 514, 515, 7, 40, 2, 2, 515, 101, 3, 2, 2, 2, 516, 519, 5, 92, 47, 2, 517, 519, 5, 104, 53, 2, 518, 516, 3, 2, 2, 2, 518, 517, 3, 2, 2, 2, 519, 103, 3, 2, 2, 2, 520, 521, 5, 92, 47, 2, 521, 522, 5, 112, 57, 2, 522, 105, 3, 2, 2, 2, 523, 527, 5, 102, 52, 2, 524, 527, 5, 108, 55, 2, 525, 527, 5, 110, 56, 2, 526, 523, 3, 2, 2, 2, 526, 524, 3, 2, 2, 2, 526, 525, 3, 2, 2, 2, 527, 107, 3, 2, 2, 2, 528, 529, 5, 112, 57, 2, 529, 530, 5, 102, 52, 2, 530, 109, 3, 2, 2, 2, 531, 532, 5, 114, 58, 2, 532, 533, 5, 102, 52, 2, 533, 111, 3, 2, 2, 2, 534, 535, 9, 8, 2, 2, 535, 113, 3, 2, 2, 2, 536, 537, 9, 9, 2, 2, 537, 115, 3, 2, 2, 2, 538, 544, 5, 106, 54, 2, 539, 540, 5, 106, 54, 2, 540, 541, 7, 8, 2, 2, 541, 542, 5, 148, 75, 2, 542, 544, 3, 2, 2, 2, 543, 538, 3, 2, 2, 2, 543, 539, 3, 2, 2, 2, 544, 117, 3, 2, 2, 2, 545, 546, 8, 60, 1, 2, 546, 547, 5, 116, 59, 2, 547, 553, 3, 2, 2, 2, 548, 549, 12, 3, 2, 2, 549, 550, 9, 10, 2, 2, 550, 552, 5, 116, 59, 2, 551, 548, 3, 2, 2, 2, 552, 555, 3, 2, 2, 2, 553, 551, 3, 2, 2, 2, 553, 554, 3, 2, 2, 2, 554, 119, 3, 2, 2, 2, 555, 553, 3, 2, 2, 2, 556, 557, 8, 61, 1, 2, 557, 558, 5, 118, 60, 2, 558, 564, 3, 2, 2, 2, 559, 560, 12, 3, 2, 2, 560, 561, 9, 11, 2, 2, 561, 563, 5, 118, 60, 2, 562, 559, 3, 2, 2, 2, 563, 566, 3, 2, 2, 2, 564, 562, 3, 2, 2, 2, 564, 565, 3, 2, 2, 2, 565, 121, 3, 2, 2, 2, 566, 564, 3, 2, 2, 2, 567, 568, 8, 62, 1, 2, 568, 569, 5, 120, 61, 2, 569, 576, 3, 2, 2, 2, 570, 571, 12, 3, 2, 2, 571, 572, 5, 124, 63, 2, 572, 573, 5, 130, 66, 2, 573, 575, 3, 2, 2, 2, 574, 570, 3, 2, 2, 2, 575, 578, 3, 2, 2, 2, 576, 574, 3, 2, 2, 2, 576, 577, 3, 2, 2, 2, 577, 123, 3, 2, 2, 2, 578, 576, 3, 2, 2, 2, 579, 580, 9, 12, 2, 2, 580, 125, 3, 2, 2, 2, 581, 582, 8, 64, 1, 2, 582, 583, 5, 122, 62, 2, 583, 589, 3, 2, 2, 2, 584, 585, 12, 3, 2, 2, 585, 586, 9, 13, 2, 2, 586, 588, 5, 122, 62, 2, 587, 584, 3, 2, 2, 2, 588, 591, 3, 2, 2, 2, 589, 587, 3, 2, 2, 2, 589, 590, 3, 2, 2, 2, 590, 127, 3, 2, 2, 2, 591, 589, 3, 2, 2, 2, 592, 593, 8, 65, 1, 2, 593, 594, 5, 126, 64, 2, 594, 600, 3, 2, 2, 2, 595, 596, 12, 3, 2, 2, 596, 597, 9, 14, 2, 2, 597, 599, 5, 126, 64, 2, 598, 595, 3, 2, 2, 2, 599, 602, 3, 2, 2, 2, 600, 598, 3, 2, 2, 2, 600, 601, 3, 2, 2, 2, 601, 129, 3, 2, 2, 2, 602, 600, 3, 2, 2, 2, 603, 604, 8, 66, 1, 2, 604, 605, 5, 128, 65, 2, 605, 611, 3, 2, 2, 2, 606, 607, 12, 3, 2, 2, 607, 608, 7, 67, 2, 2, 608, 610, 5, 128, 65, 2, 609, 606, 3, 2, 2, 2, 610, 613, 3, 2, 2, 2, 611, 609, 3, 2, 2, 2, 611, 612, 3, 2, 2, 2, 612, 131, 3, 2, 2, 2, 613, 611, 3, 2, 2, 2, 614, 615, 8, 67, 1, 2, 615, 616, 5, 130, 66, 2, 616, 622, 3, 2, 2, 2, 617, 618, 12, 3, 2, 2, 618, 619, 7, 69, 2, 2, 619, 621, 5, 130, 66, 2, 620, 617, 3, 2, 2, 2, 621, 624, 3, 2, 2, 2, 622, 620, 3, 2, 2, 2, 622, 623, 3, 2, 2, 2, 623, 133, 3, 2, 2, 2, 624, 622, 3, 2, 2, 2, 625, 626, 8, 68, 1, 2, 626, 627, 5, 132, 67, 2, 627, 633, 3, 2, 2, 2, 628, 629, 12, 3, 2, 2, 629, 630, 7, 68, 2, 2, 630, 632, 5, 132, 67, 2, 631, 628, 3, 2, 2, 2, 632, 635, 3, 2, 2, 2, 633, 631, 3, 2, 2, 2, 633, 634, 3, 2, 2, 2, 634, 135, 3, 2, 2, 2, 635, 633, 3, 2, 2, 2, 636, 637, 8, 69, 1, 2, 637, 638, 5, 134, 68, 2, 638, 644, 3, 2, 2, 2, 639, 640, 12, 3, 2, 2, 640, 641, 7, 52, 2, 2, 641, 643, 5, 134, 68, 2, 642, 639, 3, 2, 2, 2, 643, 646, 3, 2, 2, 2, 644, 642, 3, 2, 2, 2, 644, 645, 3, 2, 2, 2, 645, 137, 3, 2, 2, 2, 646, 644, 3, 2, 2, 2, 647, 648, 8, 70, 1, 2, 648, 649, 5, 136, 69, 2, 649, 655, 3, 2, 2, 2, 650, 651, 12, 3, 2, 2, 651, 652, 7, 53, 2, 2, 652, 654, 5, 136, 69, 2, 653, 650, 3, 2, 2, 2, 654, 657, 3, 2, 2, 2, 655, 653, 3, 2, 2, 2, 655, 656, 3, 2, 2, 2, 656, 139, 3, 2, 2, 2, 657, 655, 3, 2, 2, 2, 658, 666, 5, 138, 70, 2, 659, 660, 5, 138, 70, 2, 660, 661, 7, 35, 2, 2, 661, 662, 5, 140, 71, 2, 662, 663, 7, 36, 2, 2, 663, 664, 5, 140, 71, 2, 664, 666, 3, 2, 2, 2, 665, 658, 3, 2, 2, 2, 665, 659, 3, 2, 2, 2, 666, 141, 3, 2, 2, 2, 667, 673, 5, 140, 71, 2, 668, 669, 5, 92, 47, 2, 669, 670, 5, 144, 73, 2, 670, 671, 5, 142, 72, 2, 671, 673, 3, 2, 2, 2, 672, 667, 3, 2, 2, 2, 672, 668, 3, 2, 2, 2, 673, 143, 3, 2, 2, 2, 674, 675, 9, 15, 2, 2, 675, 145, 3, 2, 2, 2, 676, 681, 5, 142, 72, 2, 677, 678, 7, 33, 2, 2, 678, 680, 5, 142, 72, 2, 679, 677, 3, 2, 2, 2, 680, 683, 3, 2, 2, 2, 681, 679, 3, 2, 2, 2, 681, 682, 3, 2, 2, 2, 682, 147, 3, 2, 2, 2, 683, 681, 3, 2, 2, 2, 684, 688, 5, 150, 76, 2, 685, 688, 5, 152, 77, 2, 686, 688, 5, 154, 78, 2, 687, 684, 3, 2, 2, 2, 687, 685, 3, 2, 2, 2, 687, 686, 3, 2, 2, 2, 688, 149, 3, 2, 2, 2, 689, 690, 5, 156, 79, 2, 690, 151, 3, 2, 2, 2, 691, 692, 5, 156, 79, 2, 692, 693, 7, 63, 2, 2, 693, 694, 5, 156, 79, 2, 694, 695, 7, 65, 2, 2, 695, 153, 3, 2, 2, 2, 696, 697, 7, 29, 2, 2, 697, 698, 7, 37, 2, 2, 698, 699, 5, 156, 79, 2, 699, 700, 7, 38, 2, 2, 700, 155, 3, 2, 2, 2, 701, 702, 9, 16, 2, 2, 702, 157, 3, 2, 2, 2, 63, 159, 166, 173, 178, 186, 198, 210, 216, 223, 246, 251, 262, 271, 281, 294, 299, 305, 309, 315, 321, 345, 358, 372, 380, 388, 392, 397, 400, 405, 408, 418, 421, 424, 434, 437, 440, 456, 461, 466, 482, 484, 492, 506, 512, 518, 526, 543, 553, 564, 576, 589, 600, 611, 622, 633, 644, 655, 665, 672, 681, 687] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 88, 704, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 3, 2, 5, 2, 160, 10, 2, 3, 2, 3, 2, 3, 3, 6, 3, 165, 10, 3, 13, 3, 14, 3, 166, 3, 4, 3, 4, 3, 5, 6, 5, 172, 10, 5, 13, 5, 14, 5, 173, 3, 6, 3, 6, 3, 6, 5, 6, 179, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 187, 10, 7, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 199, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 211, 10, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 217, 10, 14, 3, 15, 3, 15, 3, 15, 7, 15, 222, 10, 15, 12, 15, 14, 15, 225, 11, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 5, 19, 247, 10, 19, 3, 20, 3, 20, 3, 20, 5, 20, 252, 10, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 5, 22, 263, 10, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 272, 10, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 7, 24, 280, 10, 24, 12, 24, 14, 24, 283, 11, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 5, 25, 295, 10, 25, 3, 26, 3, 26, 3, 26, 5, 26, 300, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 306, 10, 27, 3, 27, 3, 27, 5, 27, 310, 10, 27, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 316, 10, 27, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 322, 10, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 5, 31, 346, 10, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 5, 32, 359, 10, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 5, 37, 373, 10, 37, 3, 38, 3, 38, 3, 39, 3, 39, 7, 39, 379, 10, 39, 12, 39, 14, 39, 382, 11, 39, 3, 39, 3, 39, 3, 39, 7, 39, 387, 10, 39, 12, 39, 14, 39, 390, 11, 39, 3, 39, 5, 39, 393, 10, 39, 3, 40, 3, 40, 3, 40, 5, 40, 398, 10, 40, 3, 40, 5, 40, 401, 10, 40, 3, 41, 3, 41, 3, 41, 5, 41, 406, 10, 41, 3, 41, 5, 41, 409, 10, 41, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 43, 7, 43, 417, 10, 43, 12, 43, 14, 43, 420, 11, 43, 5, 43, 422, 10, 43, 3, 43, 5, 43, 425, 10, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 44, 7, 44, 433, 10, 44, 12, 44, 14, 44, 436, 11, 44, 5, 44, 438, 10, 44, 3, 44, 5, 44, 441, 10, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 5, 47, 457, 10, 47, 3, 47, 3, 47, 3, 47, 5, 47, 462, 10, 47, 3, 47, 3, 47, 3, 47, 5, 47, 467, 10, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 7, 47, 483, 10, 47, 12, 47, 14, 47, 486, 11, 47, 3, 48, 3, 48, 3, 48, 7, 48, 491, 10, 48, 12, 48, 14, 48, 494, 11, 48, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 507, 10, 51, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 513, 10, 51, 3, 51, 3, 51, 3, 52, 3, 52, 5, 52, 519, 10, 52, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 5, 54, 527, 10, 54, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 59, 3, 59, 5, 59, 544, 10, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 7, 60, 552, 10, 60, 12, 60, 14, 60, 555, 11, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 3, 61, 7, 61, 563, 10, 61, 12, 61, 14, 61, 566, 11, 61, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 7, 62, 575, 10, 62, 12, 62, 14, 62, 578, 11, 62, 3, 63, 3, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 7, 64, 588, 10, 64, 12, 64, 14, 64, 591, 11, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 7, 65, 599, 10, 65, 12, 65, 14, 65, 602, 11, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 7, 66, 610, 10, 66, 12, 66, 14, 66, 613, 11, 66, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 7, 67, 621, 10, 67, 12, 67, 14, 67, 624, 11, 67, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 7, 68, 632, 10, 68, 12, 68, 14, 68, 635, 11, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 7, 69, 643, 10, 69, 12, 69, 14, 69, 646, 11, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 7, 70, 654, 10, 70, 12, 70, 14, 70, 657, 11, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 5, 71, 666, 10, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 5, 72, 673, 10, 72, 3, 73, 3, 73, 3, 74, 3, 74, 3, 74, 7, 74, 680, 10, 74, 12, 74, 14, 74, 683, 11, 74, 3, 75, 3, 75, 3, 75, 5, 75, 688, 10, 75, 3, 76, 3, 76, 3, 77, 3, 77, 3, 77, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 3, 78, 3, 78, 3, 79, 3, 79, 3, 79, 2, 2, 13, 92, 118, 120, 122, 126, 128, 130, 132, 134, 136, 138, 80, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 70, 2, 72, 2, 74, 2, 76, 2, 78, 2, 80, 2, 82, 2, 84, 2, 86, 2, 88, 2, 90, 2, 92, 2, 94, 2, 96, 2, 98, 2, 100, 2, 102, 2, 104, 2, 106, 2, 108, 2, 110, 2, 112, 2, 114, 2, 116, 2, 118, 2, 120, 2, 122, 2, 124, 2, 126, 2, 128, 2, 130, 2, 132, 2, 134, 2, 136, 2, 138, 2, 140, 2, 142, 2, 144, 2, 146, 2, 148, 2, 150, 2, 152, 2, 154, 2, 156, 2, 2, 17, 3, 2, 7, 8, 3, 2, 14, 15, 3, 2, 28, 29, 3, 2, 78, 79, 4, 2, 77, 77, 80, 80, 3, 2, 31, 33, 4, 2, 46, 46, 48, 48, 6, 2, 45, 45, 47, 47, 55, 55, 71, 71, 3, 2, 49, 52, 4, 2, 45, 45, 47, 47, 3, 2, 72, 74, 3, 2, 64, 67, 3, 2, 62, 63, 3, 2, 56, 61, 4, 2, 31, 33, 76, 76, 2, 705, 2, 159, 3, 2, 2, 2, 4, 164, 3, 2, 2, 2, 6, 168, 3, 2, 2, 2, 8, 171, 3, 2, 2, 2, 10, 178, 3, 2, 2, 2, 12, 186, 3, 2, 2, 2, 14, 188, 3, 2, 2, 2, 16, 191, 3, 2, 2, 2, 18, 193, 3, 2, 2, 2, 20, 200, 3, 2, 2, 2, 22, 202, 3, 2, 2, 2, 24, 204, 3, 2, 2, 2, 26, 206, 3, 2, 2, 2, 28, 218, 3, 2, 2, 2, 30, 226, 3, 2, 2, 2, 32, 230, 3, 2, 2, 2, 34, 235, 3, 2, 2, 2, 36, 246, 3, 2, 2, 2, 38, 248, 3, 2, 2, 2, 40, 255, 3, 2, 2, 2, 42, 262, 3, 2, 2, 2, 44, 264, 3, 2, 2, 2, 46, 273, 3, 2, 2, 2, 48, 294, 3, 2, 2, 2, 50, 299, 3, 2, 2, 2, 52, 301, 3, 2, 2, 2, 54, 326, 3, 2, 2, 2, 56, 332, 3, 2, 2, 2, 58, 340, 3, 2, 2, 2, 60, 343, 3, 2, 2, 2, 62, 358, 3, 2, 2, 2, 64, 360, 3, 2, 2, 2, 66, 364, 3, 2, 2, 2, 68, 366, 3, 2, 2, 2, 70, 368, 3, 2, 2, 2, 72, 372, 3, 2, 2, 2, 74, 374, 3, 2, 2, 2, 76, 392, 3, 2, 2, 2, 78, 400, 3, 2, 2, 2, 80, 408, 3, 2, 2, 2, 82, 410, 3, 2, 2, 2, 84, 412, 3, 2, 2, 2, 86, 428, 3, 2, 2, 2, 88, 444, 3, 2, 2, 2, 90, 448, 3, 2, 2, 2, 92, 461, 3, 2, 2, 2, 94, 487, 3, 2, 2, 2, 96, 495, 3, 2, 2, 2, 98, 498, 3, 2, 2, 2, 100, 502, 3, 2, 2, 2, 102, 518, 3, 2, 2, 2, 104, 520, 3, 2, 2, 2, 106, 526, 3, 2, 2, 2, 108, 528, 3, 2, 2, 2, 110, 531, 3, 2, 2, 2, 112, 534, 3, 2, 2, 2, 114, 536, 3, 2, 2, 2, 116, 543, 3, 2, 2, 2, 118, 545, 3, 2, 2, 2, 120, 556, 3, 2, 2, 2, 122, 567, 3, 2, 2, 2, 124, 579, 3, 2, 2, 2, 126, 581, 3, 2, 2, 2, 128, 592, 3, 2, 2, 2, 130, 603, 3, 2, 2, 2, 132, 614, 3, 2, 2, 2, 134, 625, 3, 2, 2, 2, 136, 636, 3, 2, 2, 2, 138, 647, 3, 2, 2, 2, 140, 665, 3, 2, 2, 2, 142, 672, 3, 2, 2, 2, 144, 674, 3, 2, 2, 2, 146, 676, 3, 2, 2, 2, 148, 687, 3, 2, 2, 2, 150, 689, 3, 2, 2, 2, 152, 691, 3, 2, 2, 2, 154, 696, 3, 2, 2, 2, 156, 701, 3, 2, 2, 2, 158, 160, 5, 4, 3, 2, 159, 158, 3, 2, 2, 2, 159, 160, 3, 2, 2, 2, 160, 161, 3, 2, 2, 2, 161, 162, 7, 2, 2, 3, 162, 3, 3, 2, 2, 2, 163, 165, 5, 6, 4, 2, 164, 163, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 164, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 5, 3, 2, 2, 2, 168, 169, 5, 8, 5, 2, 169, 7, 3, 2, 2, 2, 170, 172, 5, 10, 6, 2, 171, 170, 3, 2, 2, 2, 172, 173, 3, 2, 2, 2, 173, 171, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 174, 9, 3, 2, 2, 2, 175, 179, 5, 36, 19, 2, 176, 179, 5, 12, 7, 2, 177, 179, 7, 35, 2, 2, 178, 175, 3, 2, 2, 2, 178, 176, 3, 2, 2, 2, 178, 177, 3, 2, 2, 2, 179, 11, 3, 2, 2, 2, 180, 181, 5, 14, 8, 2, 181, 182, 7, 35, 2, 2, 182, 187, 3, 2, 2, 2, 183, 187, 5, 26, 14, 2, 184, 187, 5, 32, 17, 2, 185, 187, 5, 34, 18, 2, 186, 180, 3, 2, 2, 2, 186, 183, 3, 2, 2, 2, 186, 184, 3, 2, 2, 2, 186, 185, 3, 2, 2, 2, 187, 13, 3, 2, 2, 2, 188, 189, 5, 16, 9, 2, 189, 190, 5, 18, 10, 2, 190, 15, 3, 2, 2, 2, 191, 192, 9, 2, 2, 2, 192, 17, 3, 2, 2, 2, 193, 194, 5, 22, 12, 2, 194, 195, 7, 37, 2, 2, 195, 198, 5, 148, 75, 2, 196, 197, 7, 56, 2, 2, 197, 199, 5, 20, 11, 2, 198, 196, 3, 2, 2, 2, 198, 199, 3, 2, 2, 2, 199, 19, 3, 2, 2, 2, 200, 201, 5, 142, 72, 2, 201, 21, 3, 2, 2, 2, 202, 203, 5, 24, 13, 2, 203, 23, 3, 2, 2, 2, 204, 205, 7, 76, 2, 2, 205, 25, 3, 2, 2, 2, 206, 207, 7, 22, 2, 2, 207, 208, 5, 22, 12, 2, 208, 210, 7, 38, 2, 2, 209, 211, 5, 28, 15, 2, 210, 209, 3, 2, 2, 2, 210, 211, 3, 2, 2, 2, 211, 212, 3, 2, 2, 2, 212, 213, 7, 39, 2, 2, 213, 214, 7, 25, 2, 2, 214, 216, 5, 148, 75, 2, 215, 217, 5, 38, 20, 2, 216, 215, 3, 2, 2, 2, 216, 217, 3, 2, 2, 2, 217, 27, 3, 2, 2, 2, 218, 223, 5, 30, 16, 2, 219, 220, 7, 34, 2, 2, 220, 222, 5, 30, 16, 2, 221, 219, 3, 2, 2, 2, 222, 225, 3, 2, 2, 2, 223, 221, 3, 2, 2, 2, 223, 224, 3, 2, 2, 2, 224, 29, 3, 2, 2, 2, 225, 223, 3, 2, 2, 2, 226, 227, 5, 22, 12, 2, 227, 228, 7, 37, 2, 2, 228, 229, 5, 148, 75, 2, 229, 31, 3, 2, 2, 2, 230, 231, 7, 27, 2, 2, 231, 232, 7, 76, 2, 2, 232, 233, 7, 43, 2, 2, 233, 234, 7, 44, 2, 2, 234, 33, 3, 2, 2, 2, 235, 236, 7, 26, 2, 2, 236, 237, 7, 76, 2, 2, 237, 238, 7, 43, 2, 2, 238, 239, 7, 44, 2, 2, 239, 35, 3, 2, 2, 2, 240, 247, 5, 40, 21, 2, 241, 247, 5, 42, 22, 2, 242, 247, 5, 50, 26, 2, 243, 247, 5, 58, 30, 2, 244, 247, 5, 60, 31, 2, 245, 247, 5, 38, 20, 2, 246, 240, 3, 2, 2, 2, 246, 241, 3, 2, 2, 2, 246, 242, 3, 2, 2, 2, 246, 243, 3, 2, 2, 2, 246, 244, 3, 2, 2, 2, 246, 245, 3, 2, 2, 2, 247, 37, 3, 2, 2, 2, 248, 249, 6, 20, 2, 2, 249, 251, 7, 43, 2, 2, 250, 252, 5, 8, 5, 2, 251, 250, 3, 2, 2, 2, 251, 252, 3, 2, 2, 2, 252, 253, 3, 2, 2, 2, 253, 254, 7, 44, 2, 2, 254, 39, 3, 2, 2, 2, 255, 256, 8, 21, 1, 2, 256, 257, 5, 146, 74, 2, 257, 258, 7, 35, 2, 2, 258, 259, 8, 21, 1, 2, 259, 41, 3, 2, 2, 2, 260, 263, 5, 44, 23, 2, 261, 263, 5, 46, 24, 2, 262, 260, 3, 2, 2, 2, 262, 261, 3, 2, 2, 2, 263, 43, 3, 2, 2, 2, 264, 265, 7, 18, 2, 2, 265, 266, 7, 38, 2, 2, 266, 267, 5, 146, 74, 2, 267, 268, 7, 39, 2, 2, 268, 271, 5, 36, 19, 2, 269, 270, 7, 19, 2, 2, 270, 272, 5, 36, 19, 2, 271, 269, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 45, 3, 2, 2, 2, 273, 274, 7, 11, 2, 2, 274, 275, 7, 38, 2, 2, 275, 276, 5, 146, 74, 2, 276, 277, 7, 39, 2, 2, 277, 281, 7, 43, 2, 2, 278, 280, 5, 48, 25, 2, 279, 278, 3, 2, 2, 2, 280, 283, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 281, 282, 3, 2, 2, 2, 282, 284, 3, 2, 2, 2, 283, 281, 3, 2, 2, 2, 284, 285, 7, 44, 2, 2, 285, 47, 3, 2, 2, 2, 286, 287, 7, 12, 2, 2, 287, 288, 5, 146, 74, 2, 288, 289, 7, 37, 2, 2, 289, 290, 5, 36, 19, 2, 290, 295, 3, 2, 2, 2, 291, 292, 7, 13, 2, 2, 292, 293, 7, 37, 2, 2, 293, 295, 5, 36, 19, 2, 294, 286, 3, 2, 2, 2, 294, 291, 3, 2, 2, 2, 295, 49, 3, 2, 2, 2, 296, 300, 5, 52, 27, 2, 297, 300, 5, 54, 28, 2, 298, 300, 5, 56, 29, 2, 299, 296, 3, 2, 2, 2, 299, 297, 3, 2, 2, 2, 299, 298, 3, 2, 2, 2, 300, 51, 3, 2, 2, 2, 301, 302, 7, 20, 2, 2, 302, 309, 7, 38, 2, 2, 303, 306, 5, 14, 8, 2, 304, 306, 5, 146, 74, 2, 305, 303, 3, 2, 2, 2, 305, 304, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 308, 8, 27, 1, 2, 308, 310, 3, 2, 2, 2, 309, 305, 3, 2, 2, 2, 309, 310, 3, 2, 2, 2, 310, 311, 3, 2, 2, 2, 311, 315, 7, 35, 2, 2, 312, 313, 5, 146, 74, 2, 313, 314, 8, 27, 1, 2, 314, 316, 3, 2, 2, 2, 315, 312, 3, 2, 2, 2, 315, 316, 3, 2, 2, 2, 316, 317, 3, 2, 2, 2, 317, 321, 7, 35, 2, 2, 318, 319, 5, 146, 74, 2, 319, 320, 8, 27, 1, 2, 320, 322, 3, 2, 2, 2, 321, 318, 3, 2, 2, 2, 321, 322, 3, 2, 2, 2, 322, 323, 3, 2, 2, 2, 323, 324, 7, 39, 2, 2, 324, 325, 5, 36, 19, 2, 325, 53, 3, 2, 2, 2, 326, 327, 7, 17, 2, 2, 327, 328, 7, 38, 2, 2, 328, 329, 5, 146, 74, 2, 329, 330, 7, 39, 2, 2, 330, 331, 5, 36, 19, 2, 331, 55, 3, 2, 2, 2, 332, 333, 7, 16, 2, 2, 333, 334, 5, 36, 19, 2, 334, 335, 7, 17, 2, 2, 335, 336, 7, 38, 2, 2, 336, 337, 5, 146, 74, 2, 337, 338, 7, 39, 2, 2, 338, 339, 7, 35, 2, 2, 339, 57, 3, 2, 2, 2, 340, 341, 9, 3, 2, 2, 341, 342, 7, 35, 2, 2, 342, 59, 3, 2, 2, 2, 343, 345, 7, 23, 2, 2, 344, 346, 5, 146, 74, 2, 345, 344, 3, 2, 2, 2, 345, 346, 3, 2, 2, 2, 346, 347, 3, 2, 2, 2, 347, 348, 7, 35, 2, 2, 348, 61, 3, 2, 2, 2, 349, 359, 5, 64, 33, 2, 350, 359, 5, 84, 43, 2, 351, 359, 5, 86, 44, 2, 352, 359, 5, 66, 34, 2, 353, 359, 5, 68, 35, 2, 354, 359, 5, 74, 38, 2, 355, 359, 5, 76, 39, 2, 356, 359, 5, 82, 42, 2, 357, 359, 5, 90, 46, 2, 358, 349, 3, 2, 2, 2, 358, 350, 3, 2, 2, 2, 358, 351, 3, 2, 2, 2, 358, 352, 3, 2, 2, 2, 358, 353, 3, 2, 2, 2, 358, 354, 3, 2, 2, 2, 358, 355, 3, 2, 2, 2, 358, 356, 3, 2, 2, 2, 358, 357, 3, 2, 2, 2, 359, 63, 3, 2, 2, 2, 360, 361, 7, 38, 2, 2, 361, 362, 5, 146, 74, 2, 362, 363, 7, 39, 2, 2, 363, 65, 3, 2, 2, 2, 364, 365, 9, 4, 2, 2, 365, 67, 3, 2, 2, 2, 366, 367, 5, 70, 36, 2, 367, 69, 3, 2, 2, 2, 368, 369, 7, 76, 2, 2, 369, 71, 3, 2, 2, 2, 370, 373, 5, 70, 36, 2, 371, 373, 5, 74, 38, 2, 372, 370, 3, 2, 2, 2, 372, 371, 3, 2, 2, 2, 373, 73, 3, 2, 2, 2, 374, 375, 9, 5, 2, 2, 375, 75, 3, 2, 2, 2, 376, 380, 7, 83, 2, 2, 377, 379, 5, 78, 40, 2, 378, 377, 3, 2, 2, 2, 379, 382, 3, 2, 2, 2, 380, 378, 3, 2, 2, 2, 380, 381, 3, 2, 2, 2, 381, 383, 3, 2, 2, 2, 382, 380, 3, 2, 2, 2, 383, 393, 7, 85, 2, 2, 384, 388, 7, 84, 2, 2, 385, 387, 5, 80, 41, 2, 386, 385, 3, 2, 2, 2, 387, 390, 3, 2, 2, 2, 388, 386, 3, 2, 2, 2, 388, 389, 3, 2, 2, 2, 389, 391, 3, 2, 2, 2, 390, 388, 3, 2, 2, 2, 391, 393, 7, 87, 2, 2, 392, 376, 3, 2, 2, 2, 392, 384, 3, 2, 2, 2, 393, 77, 3, 2, 2, 2, 394, 401, 7, 86, 2, 2, 395, 397, 7, 3, 2, 2, 396, 398, 5, 146, 74, 2, 397, 396, 3, 2, 2, 2, 397, 398, 3, 2, 2, 2, 398, 399, 3, 2, 2, 2, 399, 401, 7, 42, 2, 2, 400, 394, 3, 2, 2, 2, 400, 395, 3, 2, 2, 2, 401, 79, 3, 2, 2, 2, 402, 409, 7, 88, 2, 2, 403, 405, 7, 3, 2, 2, 404, 406, 5, 146, 74, 2, 405, 404, 3, 2, 2, 2, 405, 406, 3, 2, 2, 2, 406, 407, 3, 2, 2, 2, 407, 409, 7, 42, 2, 2, 408, 402, 3, 2, 2, 2, 408, 403, 3, 2, 2, 2, 409, 81, 3, 2, 2, 2, 410, 411, 9, 6, 2, 2, 411, 83, 3, 2, 2, 2, 412, 421, 7, 40, 2, 2, 413, 418, 5, 146, 74, 2, 414, 415, 7, 34, 2, 2, 415, 417, 5, 146, 74, 2, 416, 414, 3, 2, 2, 2, 417, 420, 3, 2, 2, 2, 418, 416, 3, 2, 2, 2, 418, 419, 3, 2, 2, 2, 419, 422, 3, 2, 2, 2, 420, 418, 3, 2, 2, 2, 421, 413, 3, 2, 2, 2, 421, 422, 3, 2, 2, 2, 422, 424, 3, 2, 2, 2, 423, 425, 7, 34, 2, 2, 424, 423, 3, 2, 2, 2, 424, 425, 3, 2, 2, 2, 425, 426, 3, 2, 2, 2, 426, 427, 7, 41, 2, 2, 427, 85, 3, 2, 2, 2, 428, 437, 7, 43, 2, 2, 429, 434, 5, 88, 45, 2, 430, 431, 7, 34, 2, 2, 431, 433, 5, 88, 45, 2, 432, 430, 3, 2, 2, 2, 433, 436, 3, 2, 2, 2, 434, 432, 3, 2, 2, 2, 434, 435, 3, 2, 2, 2, 435, 438, 3, 2, 2, 2, 436, 434, 3, 2, 2, 2, 437, 429, 3, 2, 2, 2, 437, 438, 3, 2, 2, 2, 438, 440, 3, 2, 2, 2, 439, 441, 7, 34, 2, 2, 440, 439, 3, 2, 2, 2, 440, 441, 3, 2, 2, 2, 441, 442, 3, 2, 2, 2, 442, 443, 7, 44, 2, 2, 443, 87, 3, 2, 2, 2, 444, 445, 5, 72, 37, 2, 445, 446, 7, 37, 2, 2, 446, 447, 5, 146, 74, 2, 447, 89, 3, 2, 2, 2, 448, 449, 9, 7, 2, 2, 449, 91, 3, 2, 2, 2, 450, 451, 8, 47, 1, 2, 451, 462, 5, 62, 32, 2, 452, 453, 7, 24, 2, 2, 453, 454, 5, 92, 47, 2, 454, 456, 7, 38, 2, 2, 455, 457, 5, 94, 48, 2, 456, 455, 3, 2, 2, 2, 456, 457, 3, 2, 2, 2, 457, 458, 3, 2, 2, 2, 458, 459, 7, 39, 2, 2, 459, 460, 8, 47, 1, 2, 460, 462, 3, 2, 2, 2, 461, 450, 3, 2, 2, 2, 461, 452, 3, 2, 2, 2, 462, 484, 3, 2, 2, 2, 463, 464, 12, 7, 2, 2, 464, 466, 7, 38, 2, 2, 465, 467, 5, 94, 48, 2, 466, 465, 3, 2, 2, 2, 466, 467, 3, 2, 2, 2, 467, 468, 3, 2, 2, 2, 468, 469, 7, 39, 2, 2, 469, 483, 8, 47, 1, 2, 470, 471, 12, 5, 2, 2, 471, 472, 5, 96, 49, 2, 472, 473, 8, 47, 1, 2, 473, 483, 3, 2, 2, 2, 474, 475, 12, 4, 2, 2, 475, 476, 5, 98, 50, 2, 476, 477, 8, 47, 1, 2, 477, 483, 3, 2, 2, 2, 478, 479, 12, 3, 2, 2, 479, 480, 5, 100, 51, 2, 480, 481, 8, 47, 1, 2, 481, 483, 3, 2, 2, 2, 482, 463, 3, 2, 2, 2, 482, 470, 3, 2, 2, 2, 482, 474, 3, 2, 2, 2, 482, 478, 3, 2, 2, 2, 483, 486, 3, 2, 2, 2, 484, 482, 3, 2, 2, 2, 484, 485, 3, 2, 2, 2, 485, 93, 3, 2, 2, 2, 486, 484, 3, 2, 2, 2, 487, 492, 5, 142, 72, 2, 488, 489, 7, 34, 2, 2, 489, 491, 5, 142, 72, 2, 490, 488, 3, 2, 2, 2, 491, 494, 3, 2, 2, 2, 492, 490, 3, 2, 2, 2, 492, 493, 3, 2, 2, 2, 493, 95, 3, 2, 2, 2, 494, 492, 3, 2, 2, 2, 495, 496, 7, 75, 2, 2, 496, 497, 5, 70, 36, 2, 497, 97, 3, 2, 2, 2, 498, 499, 7, 40, 2, 2, 499, 500, 5, 146, 74, 2, 500, 501, 7, 41, 2, 2, 501, 99, 3, 2, 2, 2, 502, 506, 7, 40, 2, 2, 503, 504, 5, 146, 74, 2, 504, 505, 8, 51, 1, 2, 505, 507, 3, 2, 2, 2, 506, 503, 3, 2, 2, 2, 506, 507, 3, 2, 2, 2, 507, 508, 3, 2, 2, 2, 508, 512, 7, 37, 2, 2, 509, 510, 5, 146, 74, 2, 510, 511, 8, 51, 1, 2, 511, 513, 3, 2, 2, 2, 512, 509, 3, 2, 2, 2, 512, 513, 3, 2, 2, 2, 513, 514, 3, 2, 2, 2, 514, 515, 7, 41, 2, 2, 515, 101, 3, 2, 2, 2, 516, 519, 5, 92, 47, 2, 517, 519, 5, 104, 53, 2, 518, 516, 3, 2, 2, 2, 518, 517, 3, 2, 2, 2, 519, 103, 3, 2, 2, 2, 520, 521, 5, 92, 47, 2, 521, 522, 5, 112, 57, 2, 522, 105, 3, 2, 2, 2, 523, 527, 5, 102, 52, 2, 524, 527, 5, 108, 55, 2, 525, 527, 5, 110, 56, 2, 526, 523, 3, 2, 2, 2, 526, 524, 3, 2, 2, 2, 526, 525, 3, 2, 2, 2, 527, 107, 3, 2, 2, 2, 528, 529, 5, 112, 57, 2, 529, 530, 5, 102, 52, 2, 530, 109, 3, 2, 2, 2, 531, 532, 5, 114, 58, 2, 532, 533, 5, 102, 52, 2, 533, 111, 3, 2, 2, 2, 534, 535, 9, 8, 2, 2, 535, 113, 3, 2, 2, 2, 536, 537, 9, 9, 2, 2, 537, 115, 3, 2, 2, 2, 538, 544, 5, 106, 54, 2, 539, 540, 5, 106, 54, 2, 540, 541, 7, 9, 2, 2, 541, 542, 5, 148, 75, 2, 542, 544, 3, 2, 2, 2, 543, 538, 3, 2, 2, 2, 543, 539, 3, 2, 2, 2, 544, 117, 3, 2, 2, 2, 545, 546, 8, 60, 1, 2, 546, 547, 5, 116, 59, 2, 547, 553, 3, 2, 2, 2, 548, 549, 12, 3, 2, 2, 549, 550, 9, 10, 2, 2, 550, 552, 5, 116, 59, 2, 551, 548, 3, 2, 2, 2, 552, 555, 3, 2, 2, 2, 553, 551, 3, 2, 2, 2, 553, 554, 3, 2, 2, 2, 554, 119, 3, 2, 2, 2, 555, 553, 3, 2, 2, 2, 556, 557, 8, 61, 1, 2, 557, 558, 5, 118, 60, 2, 558, 564, 3, 2, 2, 2, 559, 560, 12, 3, 2, 2, 560, 561, 9, 11, 2, 2, 561, 563, 5, 118, 60, 2, 562, 559, 3, 2, 2, 2, 563, 566, 3, 2, 2, 2, 564, 562, 3, 2, 2, 2, 564, 565, 3, 2, 2, 2, 565, 121, 3, 2, 2, 2, 566, 564, 3, 2, 2, 2, 567, 568, 8, 62, 1, 2, 568, 569, 5, 120, 61, 2, 569, 576, 3, 2, 2, 2, 570, 571, 12, 3, 2, 2, 571, 572, 5, 124, 63, 2, 572, 573, 5, 130, 66, 2, 573, 575, 3, 2, 2, 2, 574, 570, 3, 2, 2, 2, 575, 578, 3, 2, 2, 2, 576, 574, 3, 2, 2, 2, 576, 577, 3, 2, 2, 2, 577, 123, 3, 2, 2, 2, 578, 576, 3, 2, 2, 2, 579, 580, 9, 12, 2, 2, 580, 125, 3, 2, 2, 2, 581, 582, 8, 64, 1, 2, 582, 583, 5, 122, 62, 2, 583, 589, 3, 2, 2, 2, 584, 585, 12, 3, 2, 2, 585, 586, 9, 13, 2, 2, 586, 588, 5, 122, 62, 2, 587, 584, 3, 2, 2, 2, 588, 591, 3, 2, 2, 2, 589, 587, 3, 2, 2, 2, 589, 590, 3, 2, 2, 2, 590, 127, 3, 2, 2, 2, 591, 589, 3, 2, 2, 2, 592, 593, 8, 65, 1, 2, 593, 594, 5, 126, 64, 2, 594, 600, 3, 2, 2, 2, 595, 596, 12, 3, 2, 2, 596, 597, 9, 14, 2, 2, 597, 599, 5, 126, 64, 2, 598, 595, 3, 2, 2, 2, 599, 602, 3, 2, 2, 2, 600, 598, 3, 2, 2, 2, 600, 601, 3, 2, 2, 2, 601, 129, 3, 2, 2, 2, 602, 600, 3, 2, 2, 2, 603, 604, 8, 66, 1, 2, 604, 605, 5, 128, 65, 2, 605, 611, 3, 2, 2, 2, 606, 607, 12, 3, 2, 2, 607, 608, 7, 68, 2, 2, 608, 610, 5, 128, 65, 2, 609, 606, 3, 2, 2, 2, 610, 613, 3, 2, 2, 2, 611, 609, 3, 2, 2, 2, 611, 612, 3, 2, 2, 2, 612, 131, 3, 2, 2, 2, 613, 611, 3, 2, 2, 2, 614, 615, 8, 67, 1, 2, 615, 616, 5, 130, 66, 2, 616, 622, 3, 2, 2, 2, 617, 618, 12, 3, 2, 2, 618, 619, 7, 70, 2, 2, 619, 621, 5, 130, 66, 2, 620, 617, 3, 2, 2, 2, 621, 624, 3, 2, 2, 2, 622, 620, 3, 2, 2, 2, 622, 623, 3, 2, 2, 2, 623, 133, 3, 2, 2, 2, 624, 622, 3, 2, 2, 2, 625, 626, 8, 68, 1, 2, 626, 627, 5, 132, 67, 2, 627, 633, 3, 2, 2, 2, 628, 629, 12, 3, 2, 2, 629, 630, 7, 69, 2, 2, 630, 632, 5, 132, 67, 2, 631, 628, 3, 2, 2, 2, 632, 635, 3, 2, 2, 2, 633, 631, 3, 2, 2, 2, 633, 634, 3, 2, 2, 2, 634, 135, 3, 2, 2, 2, 635, 633, 3, 2, 2, 2, 636, 637, 8, 69, 1, 2, 637, 638, 5, 134, 68, 2, 638, 644, 3, 2, 2, 2, 639, 640, 12, 3, 2, 2, 640, 641, 7, 53, 2, 2, 641, 643, 5, 134, 68, 2, 642, 639, 3, 2, 2, 2, 643, 646, 3, 2, 2, 2, 644, 642, 3, 2, 2, 2, 644, 645, 3, 2, 2, 2, 645, 137, 3, 2, 2, 2, 646, 644, 3, 2, 2, 2, 647, 648, 8, 70, 1, 2, 648, 649, 5, 136, 69, 2, 649, 655, 3, 2, 2, 2, 650, 651, 12, 3, 2, 2, 651, 652, 7, 54, 2, 2, 652, 654, 5, 136, 69, 2, 653, 650, 3, 2, 2, 2, 654, 657, 3, 2, 2, 2, 655, 653, 3, 2, 2, 2, 655, 656, 3, 2, 2, 2, 656, 139, 3, 2, 2, 2, 657, 655, 3, 2, 2, 2, 658, 666, 5, 138, 70, 2, 659, 660, 5, 138, 70, 2, 660, 661, 7, 36, 2, 2, 661, 662, 5, 140, 71, 2, 662, 663, 7, 37, 2, 2, 663, 664, 5, 140, 71, 2, 664, 666, 3, 2, 2, 2, 665, 658, 3, 2, 2, 2, 665, 659, 3, 2, 2, 2, 666, 141, 3, 2, 2, 2, 667, 673, 5, 140, 71, 2, 668, 669, 5, 92, 47, 2, 669, 670, 5, 144, 73, 2, 670, 671, 5, 142, 72, 2, 671, 673, 3, 2, 2, 2, 672, 667, 3, 2, 2, 2, 672, 668, 3, 2, 2, 2, 673, 143, 3, 2, 2, 2, 674, 675, 9, 15, 2, 2, 675, 145, 3, 2, 2, 2, 676, 681, 5, 142, 72, 2, 677, 678, 7, 34, 2, 2, 678, 680, 5, 142, 72, 2, 679, 677, 3, 2, 2, 2, 680, 683, 3, 2, 2, 2, 681, 679, 3, 2, 2, 2, 681, 682, 3, 2, 2, 2, 682, 147, 3, 2, 2, 2, 683, 681, 3, 2, 2, 2, 684, 688, 5, 150, 76, 2, 685, 688, 5, 152, 77, 2, 686, 688, 5, 154, 78, 2, 687, 684, 3, 2, 2, 2, 687, 685, 3, 2, 2, 2, 687, 686, 3, 2, 2, 2, 688, 149, 3, 2, 2, 2, 689, 690, 5, 156, 79, 2, 690, 151, 3, 2, 2, 2, 691, 692, 5, 156, 79, 2, 692, 693, 7, 64, 2, 2, 693, 694, 5, 156, 79, 2, 694, 695, 7, 66, 2, 2, 695, 153, 3, 2, 2, 2, 696, 697, 7, 30, 2, 2, 697, 698, 7, 38, 2, 2, 698, 699, 5, 156, 79, 2, 699, 700, 7, 39, 2, 2, 700, 155, 3, 2, 2, 2, 701, 702, 9, 16, 2, 2, 702, 157, 3, 2, 2, 2, 63, 159, 166, 173, 178, 186, 198, 210, 216, 223, 246, 251, 262, 271, 281, 294, 299, 305, 309, 315, 321, 345, 358, 372, 380, 388, 392, 397, 400, 405, 408, 418, 421, 424, 434, 437, 440, 456, 461, 466, 482, 484, 492, 506, 512, 518, 526, 543, 553, 564, 576, 589, 600, 611, 622, 633, 644, 655, 665, 672, 681, 687] \ No newline at end of file diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.tokens b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.tokens index 4784df64b..a380f4448 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.tokens +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.tokens @@ -1,153 +1,154 @@ FStringExpStart=1 BlockComment=2 LineComment=3 -Const=4 -Var=5 -As=6 -Spread=7 -Switch=8 -Case=9 -Default=10 -Break=11 -Continue=12 -Do=13 -While=14 -If=15 -Else=16 -For=17 -Enum=18 -DefFunc=19 -Return=20 -CallFunc=21 -RetIndicator=22 -Class=23 -Interface=24 -True=25 -False=26 -Typeof=27 -Void=28 -Null=29 -Undefined=30 -Comma=31 -SemiColon=32 -QuestionMark=33 -Colon=34 -LeftParen=35 -RightParen=36 -LeftBracket=37 -RightBracket=38 -FStringExpEnd=39 -LeftBrace=40 -RightBrace=41 -Plus=42 -PlusPlus=43 -Minus=44 -MinusMinus=45 -Star=46 -Div=47 -Mod=48 -PowerTo=49 -AndAnd=50 -OrOr=51 -Not=52 -Assign=53 -PlusAssign=54 -MinusAssign=55 -StarAssign=56 -DivAssign=57 -ModAssign=58 -Equal=59 -NotEqual=60 -Less=61 -LessEqual=62 -Greater=63 -GreaterEqual=64 -BitwiseAnd=65 -BitwiseOr=66 -BitwiseXor=67 -BitwiseNot=68 -BitwiseZeroFillLeftShift=69 -BitwiseSignedRightShift=70 -BitwiseZeroFillRightShift=71 -Dot=72 -Identifier=73 -IntegerConstant=74 -SingleQuoteStringLiteral=75 -DoubleQuoteStringLiteral=76 -FloatingConstant=77 -Whitespace=78 -Newline=79 -FStringSingleQuoteStart=80 -FStringDoubleQuoteStart=81 -FStringSingleQuoteEnd=82 -FStringSingleQuoteAtom=83 -FStringDoubleQuoteEnd=84 -FStringDoubleQuoteAtom=85 -'const'=4 -'var'=5 -'as'=6 -'...'=7 -'switch'=8 -'case'=9 -'default'=10 -'break'=11 -'continue'=12 -'do'=13 -'while'=14 -'if'=15 -'else'=16 -'for'=17 -'enum'=18 -'def'=19 -'return'=20 -'call'=21 -'->'=22 -'class'=23 -'interface'=24 -'true'=25 -'false'=26 -'typeof'=27 -'void'=28 -'null'=29 -'undefined'=30 -','=31 -';'=32 -'?'=33 -':'=34 -'('=35 -')'=36 -'['=37 -']'=38 -'{'=40 -'}'=41 -'+'=42 -'++'=43 -'-'=44 -'--'=45 -'*'=46 -'/'=47 -'%'=48 -'**'=49 -'&&'=50 -'||'=51 -'!'=52 -'='=53 -'+='=54 -'-='=55 -'*='=56 -'/='=57 -'%='=58 -'=='=59 -'!='=60 -'<'=61 -'<='=62 -'>'=63 -'>='=64 -'&'=65 -'|'=66 -'^'=67 -'~'=68 -'<<'=69 -'>>'=70 -'>>>'=71 -'.'=72 +Pragma=4 +Const=5 +Var=6 +As=7 +Spread=8 +Switch=9 +Case=10 +Default=11 +Break=12 +Continue=13 +Do=14 +While=15 +If=16 +Else=17 +For=18 +Enum=19 +DefFunc=20 +Return=21 +CallFunc=22 +RetIndicator=23 +Class=24 +Interface=25 +True=26 +False=27 +Typeof=28 +Void=29 +Null=30 +Undefined=31 +Comma=32 +SemiColon=33 +QuestionMark=34 +Colon=35 +LeftParen=36 +RightParen=37 +LeftBracket=38 +RightBracket=39 +FStringExpEnd=40 +LeftBrace=41 +RightBrace=42 +Plus=43 +PlusPlus=44 +Minus=45 +MinusMinus=46 +Star=47 +Div=48 +Mod=49 +PowerTo=50 +AndAnd=51 +OrOr=52 +Not=53 +Assign=54 +PlusAssign=55 +MinusAssign=56 +StarAssign=57 +DivAssign=58 +ModAssign=59 +Equal=60 +NotEqual=61 +Less=62 +LessEqual=63 +Greater=64 +GreaterEqual=65 +BitwiseAnd=66 +BitwiseOr=67 +BitwiseXor=68 +BitwiseNot=69 +BitwiseZeroFillLeftShift=70 +BitwiseSignedRightShift=71 +BitwiseZeroFillRightShift=72 +Dot=73 +Identifier=74 +IntegerConstant=75 +SingleQuoteStringLiteral=76 +DoubleQuoteStringLiteral=77 +FloatingConstant=78 +Whitespace=79 +Newline=80 +FStringSingleQuoteStart=81 +FStringDoubleQuoteStart=82 +FStringSingleQuoteEnd=83 +FStringSingleQuoteAtom=84 +FStringDoubleQuoteEnd=85 +FStringDoubleQuoteAtom=86 +'const'=5 +'var'=6 +'as'=7 +'...'=8 +'switch'=9 +'case'=10 +'default'=11 +'break'=12 +'continue'=13 +'do'=14 +'while'=15 +'if'=16 +'else'=17 +'for'=18 +'enum'=19 +'def'=20 +'return'=21 +'call'=22 +'->'=23 +'class'=24 +'interface'=25 +'true'=26 +'false'=27 +'typeof'=28 +'void'=29 +'null'=30 +'undefined'=31 +','=32 +';'=33 +'?'=34 +':'=35 +'('=36 +')'=37 +'['=38 +']'=39 +'{'=41 +'}'=42 +'+'=43 +'++'=44 +'-'=45 +'--'=46 +'*'=47 +'/'=48 +'%'=49 +'**'=50 +'&&'=51 +'||'=52 +'!'=53 +'='=54 +'+='=55 +'-='=56 +'*='=57 +'/='=58 +'%='=59 +'=='=60 +'!='=61 +'<'=62 +'<='=63 +'>'=64 +'>='=65 +'&'=66 +'|'=67 +'^'=68 +'~'=69 +'<<'=70 +'>>'=71 +'>>>'=72 +'.'=73 diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts index 7e0876a1d..7d20feedd 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts @@ -34,88 +34,89 @@ export class KipperParser extends KipperParserBase { public static readonly FStringExpStart = 1; public static readonly BlockComment = 2; public static readonly LineComment = 3; - public static readonly Const = 4; - public static readonly Var = 5; - public static readonly As = 6; - public static readonly Spread = 7; - public static readonly Switch = 8; - public static readonly Case = 9; - public static readonly Default = 10; - public static readonly Break = 11; - public static readonly Continue = 12; - public static readonly Do = 13; - public static readonly While = 14; - public static readonly If = 15; - public static readonly Else = 16; - public static readonly For = 17; - public static readonly Enum = 18; - public static readonly DefFunc = 19; - public static readonly Return = 20; - public static readonly CallFunc = 21; - public static readonly RetIndicator = 22; - public static readonly Class = 23; - public static readonly Interface = 24; - public static readonly True = 25; - public static readonly False = 26; - public static readonly Typeof = 27; - public static readonly Void = 28; - public static readonly Null = 29; - public static readonly Undefined = 30; - public static readonly Comma = 31; - public static readonly SemiColon = 32; - public static readonly QuestionMark = 33; - public static readonly Colon = 34; - public static readonly LeftParen = 35; - public static readonly RightParen = 36; - public static readonly LeftBracket = 37; - public static readonly RightBracket = 38; - public static readonly FStringExpEnd = 39; - public static readonly LeftBrace = 40; - public static readonly RightBrace = 41; - public static readonly Plus = 42; - public static readonly PlusPlus = 43; - public static readonly Minus = 44; - public static readonly MinusMinus = 45; - public static readonly Star = 46; - public static readonly Div = 47; - public static readonly Mod = 48; - public static readonly PowerTo = 49; - public static readonly AndAnd = 50; - public static readonly OrOr = 51; - public static readonly Not = 52; - public static readonly Assign = 53; - public static readonly PlusAssign = 54; - public static readonly MinusAssign = 55; - public static readonly StarAssign = 56; - public static readonly DivAssign = 57; - public static readonly ModAssign = 58; - public static readonly Equal = 59; - public static readonly NotEqual = 60; - public static readonly Less = 61; - public static readonly LessEqual = 62; - public static readonly Greater = 63; - public static readonly GreaterEqual = 64; - public static readonly BitwiseAnd = 65; - public static readonly BitwiseOr = 66; - public static readonly BitwiseXor = 67; - public static readonly BitwiseNot = 68; - public static readonly BitwiseZeroFillLeftShift = 69; - public static readonly BitwiseSignedRightShift = 70; - public static readonly BitwiseZeroFillRightShift = 71; - public static readonly Dot = 72; - public static readonly Identifier = 73; - public static readonly IntegerConstant = 74; - public static readonly SingleQuoteStringLiteral = 75; - public static readonly DoubleQuoteStringLiteral = 76; - public static readonly FloatingConstant = 77; - public static readonly Whitespace = 78; - public static readonly Newline = 79; - public static readonly FStringSingleQuoteStart = 80; - public static readonly FStringDoubleQuoteStart = 81; - public static readonly FStringSingleQuoteEnd = 82; - public static readonly FStringSingleQuoteAtom = 83; - public static readonly FStringDoubleQuoteEnd = 84; - public static readonly FStringDoubleQuoteAtom = 85; + public static readonly Pragma = 4; + public static readonly Const = 5; + public static readonly Var = 6; + public static readonly As = 7; + public static readonly Spread = 8; + public static readonly Switch = 9; + public static readonly Case = 10; + public static readonly Default = 11; + public static readonly Break = 12; + public static readonly Continue = 13; + public static readonly Do = 14; + public static readonly While = 15; + public static readonly If = 16; + public static readonly Else = 17; + public static readonly For = 18; + public static readonly Enum = 19; + public static readonly DefFunc = 20; + public static readonly Return = 21; + public static readonly CallFunc = 22; + public static readonly RetIndicator = 23; + public static readonly Class = 24; + public static readonly Interface = 25; + public static readonly True = 26; + public static readonly False = 27; + public static readonly Typeof = 28; + public static readonly Void = 29; + public static readonly Null = 30; + public static readonly Undefined = 31; + public static readonly Comma = 32; + public static readonly SemiColon = 33; + public static readonly QuestionMark = 34; + public static readonly Colon = 35; + public static readonly LeftParen = 36; + public static readonly RightParen = 37; + public static readonly LeftBracket = 38; + public static readonly RightBracket = 39; + public static readonly FStringExpEnd = 40; + public static readonly LeftBrace = 41; + public static readonly RightBrace = 42; + public static readonly Plus = 43; + public static readonly PlusPlus = 44; + public static readonly Minus = 45; + public static readonly MinusMinus = 46; + public static readonly Star = 47; + public static readonly Div = 48; + public static readonly Mod = 49; + public static readonly PowerTo = 50; + public static readonly AndAnd = 51; + public static readonly OrOr = 52; + public static readonly Not = 53; + public static readonly Assign = 54; + public static readonly PlusAssign = 55; + public static readonly MinusAssign = 56; + public static readonly StarAssign = 57; + public static readonly DivAssign = 58; + public static readonly ModAssign = 59; + public static readonly Equal = 60; + public static readonly NotEqual = 61; + public static readonly Less = 62; + public static readonly LessEqual = 63; + public static readonly Greater = 64; + public static readonly GreaterEqual = 65; + public static readonly BitwiseAnd = 66; + public static readonly BitwiseOr = 67; + public static readonly BitwiseXor = 68; + public static readonly BitwiseNot = 69; + public static readonly BitwiseZeroFillLeftShift = 70; + public static readonly BitwiseSignedRightShift = 71; + public static readonly BitwiseZeroFillRightShift = 72; + public static readonly Dot = 73; + public static readonly Identifier = 74; + public static readonly IntegerConstant = 75; + public static readonly SingleQuoteStringLiteral = 76; + public static readonly DoubleQuoteStringLiteral = 77; + public static readonly FloatingConstant = 78; + public static readonly Whitespace = 79; + public static readonly Newline = 80; + public static readonly FStringSingleQuoteStart = 81; + public static readonly FStringDoubleQuoteStart = 82; + public static readonly FStringSingleQuoteEnd = 83; + public static readonly FStringSingleQuoteAtom = 84; + public static readonly FStringDoubleQuoteEnd = 85; + public static readonly FStringDoubleQuoteAtom = 86; public static readonly RULE_compilationUnit = 0; public static readonly RULE_translationUnit = 1; public static readonly RULE_externalItem = 2; @@ -281,6 +282,7 @@ export class KipperParser extends KipperParserBase { undefined, undefined, undefined, + undefined, "'const'", "'var'", "'as'", @@ -356,6 +358,7 @@ export class KipperParser extends KipperParserBase { "FStringExpStart", "BlockComment", "LineComment", + "Pragma", "Const", "Var", "As", @@ -1446,27 +1449,27 @@ export class KipperParser extends KipperParserBase { (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0) || - (((_la - 35) & ~0x1f) === 0 && - ((1 << (_la - 35)) & - ((1 << (KipperParser.LeftParen - 35)) | - (1 << (KipperParser.LeftBracket - 35)) | - (1 << (KipperParser.LeftBrace - 35)) | - (1 << (KipperParser.Plus - 35)) | - (1 << (KipperParser.PlusPlus - 35)) | - (1 << (KipperParser.Minus - 35)) | - (1 << (KipperParser.MinusMinus - 35)) | - (1 << (KipperParser.Not - 35)))) !== + (((_la - 36) & ~0x1f) === 0 && + ((1 << (_la - 36)) & + ((1 << (KipperParser.LeftParen - 36)) | + (1 << (KipperParser.LeftBracket - 36)) | + (1 << (KipperParser.LeftBrace - 36)) | + (1 << (KipperParser.Plus - 36)) | + (1 << (KipperParser.PlusPlus - 36)) | + (1 << (KipperParser.Minus - 36)) | + (1 << (KipperParser.MinusMinus - 36)) | + (1 << (KipperParser.Not - 36)))) !== 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + (((_la - 69) & ~0x1f) === 0 && + ((1 << (_la - 69)) & + ((1 << (KipperParser.BitwiseNot - 69)) | + (1 << (KipperParser.Identifier - 69)) | + (1 << (KipperParser.IntegerConstant - 69)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 69)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 69)) | + (1 << (KipperParser.FloatingConstant - 69)) | + (1 << (KipperParser.FStringSingleQuoteStart - 69)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 69)))) !== 0) ) { { @@ -1520,33 +1523,33 @@ export class KipperParser extends KipperParserBase { this._errHandler.sync(this); _la = this._input.LA(1); if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== + (((_la - 22) & ~0x1f) === 0 && + ((1 << (_la - 22)) & + ((1 << (KipperParser.CallFunc - 22)) | + (1 << (KipperParser.True - 22)) | + (1 << (KipperParser.False - 22)) | + (1 << (KipperParser.Void - 22)) | + (1 << (KipperParser.Null - 22)) | + (1 << (KipperParser.Undefined - 22)) | + (1 << (KipperParser.LeftParen - 22)) | + (1 << (KipperParser.LeftBracket - 22)) | + (1 << (KipperParser.LeftBrace - 22)) | + (1 << (KipperParser.Plus - 22)) | + (1 << (KipperParser.PlusPlus - 22)) | + (1 << (KipperParser.Minus - 22)) | + (1 << (KipperParser.MinusMinus - 22)) | + (1 << (KipperParser.Not - 22)))) !== 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + (((_la - 69) & ~0x1f) === 0 && + ((1 << (_la - 69)) & + ((1 << (KipperParser.BitwiseNot - 69)) | + (1 << (KipperParser.Identifier - 69)) | + (1 << (KipperParser.IntegerConstant - 69)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 69)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 69)) | + (1 << (KipperParser.FloatingConstant - 69)) | + (1 << (KipperParser.FStringSingleQuoteStart - 69)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 69)))) !== 0) ) { { @@ -1562,33 +1565,33 @@ export class KipperParser extends KipperParserBase { this._errHandler.sync(this); _la = this._input.LA(1); if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== + (((_la - 22) & ~0x1f) === 0 && + ((1 << (_la - 22)) & + ((1 << (KipperParser.CallFunc - 22)) | + (1 << (KipperParser.True - 22)) | + (1 << (KipperParser.False - 22)) | + (1 << (KipperParser.Void - 22)) | + (1 << (KipperParser.Null - 22)) | + (1 << (KipperParser.Undefined - 22)) | + (1 << (KipperParser.LeftParen - 22)) | + (1 << (KipperParser.LeftBracket - 22)) | + (1 << (KipperParser.LeftBrace - 22)) | + (1 << (KipperParser.Plus - 22)) | + (1 << (KipperParser.PlusPlus - 22)) | + (1 << (KipperParser.Minus - 22)) | + (1 << (KipperParser.MinusMinus - 22)) | + (1 << (KipperParser.Not - 22)))) !== 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + (((_la - 69) & ~0x1f) === 0 && + ((1 << (_la - 69)) & + ((1 << (KipperParser.BitwiseNot - 69)) | + (1 << (KipperParser.Identifier - 69)) | + (1 << (KipperParser.IntegerConstant - 69)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 69)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 69)) | + (1 << (KipperParser.FloatingConstant - 69)) | + (1 << (KipperParser.FStringSingleQuoteStart - 69)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 69)))) !== 0) ) { { @@ -1735,33 +1738,33 @@ export class KipperParser extends KipperParserBase { this._errHandler.sync(this); _la = this._input.LA(1); if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== + (((_la - 22) & ~0x1f) === 0 && + ((1 << (_la - 22)) & + ((1 << (KipperParser.CallFunc - 22)) | + (1 << (KipperParser.True - 22)) | + (1 << (KipperParser.False - 22)) | + (1 << (KipperParser.Void - 22)) | + (1 << (KipperParser.Null - 22)) | + (1 << (KipperParser.Undefined - 22)) | + (1 << (KipperParser.LeftParen - 22)) | + (1 << (KipperParser.LeftBracket - 22)) | + (1 << (KipperParser.LeftBrace - 22)) | + (1 << (KipperParser.Plus - 22)) | + (1 << (KipperParser.PlusPlus - 22)) | + (1 << (KipperParser.Minus - 22)) | + (1 << (KipperParser.MinusMinus - 22)) | + (1 << (KipperParser.Not - 22)))) !== 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + (((_la - 69) & ~0x1f) === 0 && + ((1 << (_la - 69)) & + ((1 << (KipperParser.BitwiseNot - 69)) | + (1 << (KipperParser.Identifier - 69)) | + (1 << (KipperParser.IntegerConstant - 69)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 69)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 69)) | + (1 << (KipperParser.FloatingConstant - 69)) | + (1 << (KipperParser.FStringSingleQuoteStart - 69)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 69)))) !== 0) ) { { @@ -2158,33 +2161,33 @@ export class KipperParser extends KipperParserBase { this._errHandler.sync(this); _la = this._input.LA(1); if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== + (((_la - 22) & ~0x1f) === 0 && + ((1 << (_la - 22)) & + ((1 << (KipperParser.CallFunc - 22)) | + (1 << (KipperParser.True - 22)) | + (1 << (KipperParser.False - 22)) | + (1 << (KipperParser.Void - 22)) | + (1 << (KipperParser.Null - 22)) | + (1 << (KipperParser.Undefined - 22)) | + (1 << (KipperParser.LeftParen - 22)) | + (1 << (KipperParser.LeftBracket - 22)) | + (1 << (KipperParser.LeftBrace - 22)) | + (1 << (KipperParser.Plus - 22)) | + (1 << (KipperParser.PlusPlus - 22)) | + (1 << (KipperParser.Minus - 22)) | + (1 << (KipperParser.MinusMinus - 22)) | + (1 << (KipperParser.Not - 22)))) !== 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + (((_la - 69) & ~0x1f) === 0 && + ((1 << (_la - 69)) & + ((1 << (KipperParser.BitwiseNot - 69)) | + (1 << (KipperParser.Identifier - 69)) | + (1 << (KipperParser.IntegerConstant - 69)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 69)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 69)) | + (1 << (KipperParser.FloatingConstant - 69)) | + (1 << (KipperParser.FStringSingleQuoteStart - 69)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 69)))) !== 0) ) { { @@ -2238,33 +2241,33 @@ export class KipperParser extends KipperParserBase { this._errHandler.sync(this); _la = this._input.LA(1); if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== + (((_la - 22) & ~0x1f) === 0 && + ((1 << (_la - 22)) & + ((1 << (KipperParser.CallFunc - 22)) | + (1 << (KipperParser.True - 22)) | + (1 << (KipperParser.False - 22)) | + (1 << (KipperParser.Void - 22)) | + (1 << (KipperParser.Null - 22)) | + (1 << (KipperParser.Undefined - 22)) | + (1 << (KipperParser.LeftParen - 22)) | + (1 << (KipperParser.LeftBracket - 22)) | + (1 << (KipperParser.LeftBrace - 22)) | + (1 << (KipperParser.Plus - 22)) | + (1 << (KipperParser.PlusPlus - 22)) | + (1 << (KipperParser.Minus - 22)) | + (1 << (KipperParser.MinusMinus - 22)) | + (1 << (KipperParser.Not - 22)))) !== 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + (((_la - 69) & ~0x1f) === 0 && + ((1 << (_la - 69)) & + ((1 << (KipperParser.BitwiseNot - 69)) | + (1 << (KipperParser.Identifier - 69)) | + (1 << (KipperParser.IntegerConstant - 69)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 69)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 69)) | + (1 << (KipperParser.FloatingConstant - 69)) | + (1 << (KipperParser.FStringSingleQuoteStart - 69)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 69)))) !== 0) ) { { @@ -2342,33 +2345,33 @@ export class KipperParser extends KipperParserBase { this._errHandler.sync(this); _la = this._input.LA(1); if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== + (((_la - 22) & ~0x1f) === 0 && + ((1 << (_la - 22)) & + ((1 << (KipperParser.CallFunc - 22)) | + (1 << (KipperParser.True - 22)) | + (1 << (KipperParser.False - 22)) | + (1 << (KipperParser.Void - 22)) | + (1 << (KipperParser.Null - 22)) | + (1 << (KipperParser.Undefined - 22)) | + (1 << (KipperParser.LeftParen - 22)) | + (1 << (KipperParser.LeftBracket - 22)) | + (1 << (KipperParser.LeftBrace - 22)) | + (1 << (KipperParser.Plus - 22)) | + (1 << (KipperParser.PlusPlus - 22)) | + (1 << (KipperParser.Minus - 22)) | + (1 << (KipperParser.MinusMinus - 22)) | + (1 << (KipperParser.Not - 22)))) !== 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + (((_la - 69) & ~0x1f) === 0 && + ((1 << (_la - 69)) & + ((1 << (KipperParser.BitwiseNot - 69)) | + (1 << (KipperParser.Identifier - 69)) | + (1 << (KipperParser.IntegerConstant - 69)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 69)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 69)) | + (1 << (KipperParser.FloatingConstant - 69)) | + (1 << (KipperParser.FStringSingleQuoteStart - 69)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 69)))) !== 0) ) { { @@ -2436,11 +2439,11 @@ export class KipperParser extends KipperParserBase { this._errHandler.sync(this); _la = this._input.LA(1); if ( - ((_la - 73) & ~0x1f) === 0 && - ((1 << (_la - 73)) & - ((1 << (KipperParser.Identifier - 73)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 73)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 73)))) !== + ((_la - 74) & ~0x1f) === 0 && + ((1 << (_la - 74)) & + ((1 << (KipperParser.Identifier - 74)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 74)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 74)))) !== 0 ) { { @@ -2624,33 +2627,33 @@ export class KipperParser extends KipperParserBase { this._errHandler.sync(this); _la = this._input.LA(1); if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== + (((_la - 22) & ~0x1f) === 0 && + ((1 << (_la - 22)) & + ((1 << (KipperParser.CallFunc - 22)) | + (1 << (KipperParser.True - 22)) | + (1 << (KipperParser.False - 22)) | + (1 << (KipperParser.Void - 22)) | + (1 << (KipperParser.Null - 22)) | + (1 << (KipperParser.Undefined - 22)) | + (1 << (KipperParser.LeftParen - 22)) | + (1 << (KipperParser.LeftBracket - 22)) | + (1 << (KipperParser.LeftBrace - 22)) | + (1 << (KipperParser.Plus - 22)) | + (1 << (KipperParser.PlusPlus - 22)) | + (1 << (KipperParser.Minus - 22)) | + (1 << (KipperParser.MinusMinus - 22)) | + (1 << (KipperParser.Not - 22)))) !== 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + (((_la - 69) & ~0x1f) === 0 && + ((1 << (_la - 69)) & + ((1 << (KipperParser.BitwiseNot - 69)) | + (1 << (KipperParser.Identifier - 69)) | + (1 << (KipperParser.IntegerConstant - 69)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 69)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 69)) | + (1 << (KipperParser.FloatingConstant - 69)) | + (1 << (KipperParser.FStringSingleQuoteStart - 69)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 69)))) !== 0) ) { { @@ -2697,33 +2700,33 @@ export class KipperParser extends KipperParserBase { this._errHandler.sync(this); _la = this._input.LA(1); if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== + (((_la - 22) & ~0x1f) === 0 && + ((1 << (_la - 22)) & + ((1 << (KipperParser.CallFunc - 22)) | + (1 << (KipperParser.True - 22)) | + (1 << (KipperParser.False - 22)) | + (1 << (KipperParser.Void - 22)) | + (1 << (KipperParser.Null - 22)) | + (1 << (KipperParser.Undefined - 22)) | + (1 << (KipperParser.LeftParen - 22)) | + (1 << (KipperParser.LeftBracket - 22)) | + (1 << (KipperParser.LeftBrace - 22)) | + (1 << (KipperParser.Plus - 22)) | + (1 << (KipperParser.PlusPlus - 22)) | + (1 << (KipperParser.Minus - 22)) | + (1 << (KipperParser.MinusMinus - 22)) | + (1 << (KipperParser.Not - 22)))) !== 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + (((_la - 69) & ~0x1f) === 0 && + ((1 << (_la - 69)) & + ((1 << (KipperParser.BitwiseNot - 69)) | + (1 << (KipperParser.Identifier - 69)) | + (1 << (KipperParser.IntegerConstant - 69)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 69)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 69)) | + (1 << (KipperParser.FloatingConstant - 69)) | + (1 << (KipperParser.FStringSingleQuoteStart - 69)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 69)))) !== 0) ) { { @@ -2912,33 +2915,33 @@ export class KipperParser extends KipperParserBase { this._errHandler.sync(this); _la = this._input.LA(1); if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== + (((_la - 22) & ~0x1f) === 0 && + ((1 << (_la - 22)) & + ((1 << (KipperParser.CallFunc - 22)) | + (1 << (KipperParser.True - 22)) | + (1 << (KipperParser.False - 22)) | + (1 << (KipperParser.Void - 22)) | + (1 << (KipperParser.Null - 22)) | + (1 << (KipperParser.Undefined - 22)) | + (1 << (KipperParser.LeftParen - 22)) | + (1 << (KipperParser.LeftBracket - 22)) | + (1 << (KipperParser.LeftBrace - 22)) | + (1 << (KipperParser.Plus - 22)) | + (1 << (KipperParser.PlusPlus - 22)) | + (1 << (KipperParser.Minus - 22)) | + (1 << (KipperParser.MinusMinus - 22)) | + (1 << (KipperParser.Not - 22)))) !== 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + (((_la - 69) & ~0x1f) === 0 && + ((1 << (_la - 69)) & + ((1 << (KipperParser.BitwiseNot - 69)) | + (1 << (KipperParser.Identifier - 69)) | + (1 << (KipperParser.IntegerConstant - 69)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 69)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 69)) | + (1 << (KipperParser.FloatingConstant - 69)) | + (1 << (KipperParser.FStringSingleQuoteStart - 69)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 69)))) !== 0) ) { { @@ -2954,33 +2957,33 @@ export class KipperParser extends KipperParserBase { this._errHandler.sync(this); _la = this._input.LA(1); if ( - (((_la - 21) & ~0x1f) === 0 && - ((1 << (_la - 21)) & - ((1 << (KipperParser.CallFunc - 21)) | - (1 << (KipperParser.True - 21)) | - (1 << (KipperParser.False - 21)) | - (1 << (KipperParser.Void - 21)) | - (1 << (KipperParser.Null - 21)) | - (1 << (KipperParser.Undefined - 21)) | - (1 << (KipperParser.LeftParen - 21)) | - (1 << (KipperParser.LeftBracket - 21)) | - (1 << (KipperParser.LeftBrace - 21)) | - (1 << (KipperParser.Plus - 21)) | - (1 << (KipperParser.PlusPlus - 21)) | - (1 << (KipperParser.Minus - 21)) | - (1 << (KipperParser.MinusMinus - 21)) | - (1 << (KipperParser.Not - 21)))) !== + (((_la - 22) & ~0x1f) === 0 && + ((1 << (_la - 22)) & + ((1 << (KipperParser.CallFunc - 22)) | + (1 << (KipperParser.True - 22)) | + (1 << (KipperParser.False - 22)) | + (1 << (KipperParser.Void - 22)) | + (1 << (KipperParser.Null - 22)) | + (1 << (KipperParser.Undefined - 22)) | + (1 << (KipperParser.LeftParen - 22)) | + (1 << (KipperParser.LeftBracket - 22)) | + (1 << (KipperParser.LeftBrace - 22)) | + (1 << (KipperParser.Plus - 22)) | + (1 << (KipperParser.PlusPlus - 22)) | + (1 << (KipperParser.Minus - 22)) | + (1 << (KipperParser.MinusMinus - 22)) | + (1 << (KipperParser.Not - 22)))) !== 0) || - (((_la - 68) & ~0x1f) === 0 && - ((1 << (_la - 68)) & - ((1 << (KipperParser.BitwiseNot - 68)) | - (1 << (KipperParser.Identifier - 68)) | - (1 << (KipperParser.IntegerConstant - 68)) | - (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | - (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | - (1 << (KipperParser.FloatingConstant - 68)) | - (1 << (KipperParser.FStringSingleQuoteStart - 68)) | - (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + (((_la - 69) & ~0x1f) === 0 && + ((1 << (_la - 69)) & + ((1 << (KipperParser.BitwiseNot - 69)) | + (1 << (KipperParser.Identifier - 69)) | + (1 << (KipperParser.IntegerConstant - 69)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 69)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 69)) | + (1 << (KipperParser.FloatingConstant - 69)) | + (1 << (KipperParser.FStringSingleQuoteStart - 69)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 69)))) !== 0) ) { { @@ -3237,12 +3240,12 @@ export class KipperParser extends KipperParserBase { _la = this._input.LA(1); if ( !( - ((_la - 42) & ~0x1f) === 0 && - ((1 << (_la - 42)) & - ((1 << (KipperParser.Plus - 42)) | - (1 << (KipperParser.Minus - 42)) | - (1 << (KipperParser.Not - 42)) | - (1 << (KipperParser.BitwiseNot - 42)))) !== + ((_la - 43) & ~0x1f) === 0 && + ((1 << (_la - 43)) & + ((1 << (KipperParser.Plus - 43)) | + (1 << (KipperParser.Minus - 43)) | + (1 << (KipperParser.Not - 43)) | + (1 << (KipperParser.BitwiseNot - 43)))) !== 0 ) ) { @@ -3364,12 +3367,12 @@ export class KipperParser extends KipperParserBase { _la = this._input.LA(1); if ( !( - ((_la - 46) & ~0x1f) === 0 && - ((1 << (_la - 46)) & - ((1 << (KipperParser.Star - 46)) | - (1 << (KipperParser.Div - 46)) | - (1 << (KipperParser.Mod - 46)) | - (1 << (KipperParser.PowerTo - 46)))) !== + ((_la - 47) & ~0x1f) === 0 && + ((1 << (_la - 47)) & + ((1 << (KipperParser.Star - 47)) | + (1 << (KipperParser.Div - 47)) | + (1 << (KipperParser.Mod - 47)) | + (1 << (KipperParser.PowerTo - 47)))) !== 0 ) ) { @@ -3572,11 +3575,11 @@ export class KipperParser extends KipperParserBase { _la = this._input.LA(1); if ( !( - ((_la - 69) & ~0x1f) === 0 && - ((1 << (_la - 69)) & - ((1 << (KipperParser.BitwiseZeroFillLeftShift - 69)) | - (1 << (KipperParser.BitwiseSignedRightShift - 69)) | - (1 << (KipperParser.BitwiseZeroFillRightShift - 69)))) !== + ((_la - 70) & ~0x1f) === 0 && + ((1 << (_la - 70)) & + ((1 << (KipperParser.BitwiseZeroFillLeftShift - 70)) | + (1 << (KipperParser.BitwiseSignedRightShift - 70)) | + (1 << (KipperParser.BitwiseZeroFillRightShift - 70)))) !== 0 ) ) { @@ -3655,12 +3658,12 @@ export class KipperParser extends KipperParserBase { _la = this._input.LA(1); if ( !( - ((_la - 61) & ~0x1f) === 0 && - ((1 << (_la - 61)) & - ((1 << (KipperParser.Less - 61)) | - (1 << (KipperParser.LessEqual - 61)) | - (1 << (KipperParser.Greater - 61)) | - (1 << (KipperParser.GreaterEqual - 61)))) !== + ((_la - 62) & ~0x1f) === 0 && + ((1 << (_la - 62)) & + ((1 << (KipperParser.Less - 62)) | + (1 << (KipperParser.LessEqual - 62)) | + (1 << (KipperParser.Greater - 62)) | + (1 << (KipperParser.GreaterEqual - 62)))) !== 0 ) ) { @@ -4241,14 +4244,14 @@ export class KipperParser extends KipperParserBase { _la = this._input.LA(1); if ( !( - ((_la - 53) & ~0x1f) === 0 && - ((1 << (_la - 53)) & - ((1 << (KipperParser.Assign - 53)) | - (1 << (KipperParser.PlusAssign - 53)) | - (1 << (KipperParser.MinusAssign - 53)) | - (1 << (KipperParser.StarAssign - 53)) | - (1 << (KipperParser.DivAssign - 53)) | - (1 << (KipperParser.ModAssign - 53)))) !== + ((_la - 54) & ~0x1f) === 0 && + ((1 << (_la - 54)) & + ((1 << (KipperParser.Assign - 54)) | + (1 << (KipperParser.PlusAssign - 54)) | + (1 << (KipperParser.MinusAssign - 54)) | + (1 << (KipperParser.StarAssign - 54)) | + (1 << (KipperParser.DivAssign - 54)) | + (1 << (KipperParser.ModAssign - 54)))) !== 0 ) ) { @@ -4630,7 +4633,7 @@ export class KipperParser extends KipperParserBase { private static readonly _serializedATNSegments: number = 2; private static readonly _serializedATNSegment0: string = - "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03W\u02C0\x04\x02" + + "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03X\u02C0\x04\x02" + "\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07" + "\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r\t\r\x04" + "\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t\x12\x04" + @@ -4699,10 +4702,10 @@ export class KipperParser extends KipperParserBase { "J\x02L\x02N\x02P\x02R\x02T\x02V\x02X\x02Z\x02\\\x02^\x02`\x02b\x02d\x02" + "f\x02h\x02j\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\x02\x11\x03\x02\x06\x07\x03" + - "\x02\r\x0E\x03\x02\x1B\x1C\x03\x02MN\x04\x02LLOO\x03\x02\x1E \x04\x02" + - "--//\x06\x02,,..66FF\x03\x0203\x04\x02,,..\x03\x02GI\x03\x02?B\x03\x02" + - "=>\x03\x027<\x04\x02\x1E KK\x02\u02C1\x02\x9F\x03\x02\x02\x02\x04\xA4" + + "\x02\x94\x02\x96\x02\x98\x02\x9A\x02\x9C\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\u02C1\x02\x9F\x03\x02\x02\x02\x04\xA4" + "\x03\x02\x02\x02\x06\xA8\x03\x02\x02\x02\b\xAB\x03\x02\x02\x02\n\xB2\x03" + "\x02\x02\x02\f\xBA\x03\x02\x02\x02\x0E\xBC\x03\x02\x02\x02\x10\xBF\x03" + "\x02\x02\x02\x12\xC1\x03\x02\x02\x02\x14\xC8\x03\x02\x02\x02\x16\xCA\x03" + @@ -4736,163 +4739,163 @@ export class KipperParser extends KipperParserBase { "\x05\x02\xA9\x07\x03\x02\x02\x02\xAA\xAC\x05\n\x06\x02\xAB\xAA\x03\x02" + "\x02\x02\xAC\xAD\x03\x02\x02\x02\xAD\xAB\x03\x02\x02\x02\xAD\xAE\x03\x02" + "\x02\x02\xAE\t\x03\x02\x02\x02\xAF\xB3\x05$\x13\x02\xB0\xB3\x05\f\x07" + - '\x02\xB1\xB3\x07"\x02\x02\xB2\xAF\x03\x02\x02\x02\xB2\xB0\x03\x02\x02' + + "\x02\xB1\xB3\x07#\x02\x02\xB2\xAF\x03\x02\x02\x02\xB2\xB0\x03\x02\x02" + "\x02\xB2\xB1\x03\x02\x02\x02\xB3\v\x03\x02\x02\x02\xB4\xB5\x05\x0E\b\x02" + - '\xB5\xB6\x07"\x02\x02\xB6\xBB\x03\x02\x02\x02\xB7\xBB\x05\x1A\x0E\x02' + + "\xB5\xB6\x07#\x02\x02\xB6\xBB\x03\x02\x02\x02\xB7\xBB\x05\x1A\x0E\x02" + '\xB8\xBB\x05 \x11\x02\xB9\xBB\x05"\x12\x02\xBA\xB4\x03\x02\x02\x02\xBA' + "\xB7\x03\x02\x02\x02\xBA\xB8\x03\x02\x02\x02\xBA\xB9\x03\x02\x02\x02\xBB" + "\r\x03\x02\x02\x02\xBC\xBD\x05\x10\t\x02\xBD\xBE\x05\x12\n\x02\xBE\x0F" + "\x03\x02\x02\x02\xBF\xC0\t\x02\x02\x02\xC0\x11\x03\x02\x02\x02\xC1\xC2" + - "\x05\x16\f\x02\xC2\xC3\x07$\x02\x02\xC3\xC6\x05\x94K\x02\xC4\xC5\x077" + + "\x05\x16\f\x02\xC2\xC3\x07%\x02\x02\xC3\xC6\x05\x94K\x02\xC4\xC5\x078" + "\x02\x02\xC5\xC7\x05\x14\v\x02\xC6\xC4\x03\x02\x02\x02\xC6\xC7\x03\x02" + "\x02\x02\xC7\x13\x03\x02\x02\x02\xC8\xC9\x05\x8EH\x02\xC9\x15\x03\x02" + - "\x02\x02\xCA\xCB\x05\x18\r\x02\xCB\x17\x03\x02\x02\x02\xCC\xCD\x07K\x02" + - "\x02\xCD\x19\x03\x02\x02\x02\xCE\xCF\x07\x15\x02\x02\xCF\xD0\x05\x16\f" + - "\x02\xD0\xD2\x07%\x02\x02\xD1\xD3\x05\x1C\x0F\x02\xD2\xD1\x03\x02\x02" + - "\x02\xD2\xD3\x03\x02\x02\x02\xD3\xD4\x03\x02\x02\x02\xD4\xD5\x07&\x02" + - "\x02\xD5\xD6\x07\x18\x02\x02\xD6\xD8\x05\x94K\x02\xD7\xD9\x05&\x14\x02" + + "\x02\x02\xCA\xCB\x05\x18\r\x02\xCB\x17\x03\x02\x02\x02\xCC\xCD\x07L\x02" + + "\x02\xCD\x19\x03\x02\x02\x02\xCE\xCF\x07\x16\x02\x02\xCF\xD0\x05\x16\f" + + "\x02\xD0\xD2\x07&\x02\x02\xD1\xD3\x05\x1C\x0F\x02\xD2\xD1\x03\x02\x02" + + "\x02\xD2\xD3\x03\x02\x02\x02\xD3\xD4\x03\x02\x02\x02\xD4\xD5\x07'\x02" + + "\x02\xD5\xD6\x07\x19\x02\x02\xD6\xD8\x05\x94K\x02\xD7\xD9\x05&\x14\x02" + "\xD8\xD7\x03\x02\x02\x02\xD8\xD9\x03\x02\x02\x02\xD9\x1B\x03\x02\x02\x02" + - "\xDA\xDF\x05\x1E\x10\x02\xDB\xDC\x07!\x02\x02\xDC\xDE\x05\x1E\x10\x02" + + '\xDA\xDF\x05\x1E\x10\x02\xDB\xDC\x07"\x02\x02\xDC\xDE\x05\x1E\x10\x02' + "\xDD\xDB\x03\x02\x02\x02\xDE\xE1\x03\x02\x02\x02\xDF\xDD\x03\x02\x02\x02" + "\xDF\xE0\x03\x02\x02\x02\xE0\x1D\x03\x02\x02\x02\xE1\xDF\x03\x02\x02\x02" + - "\xE2\xE3\x05\x16\f\x02\xE3\xE4\x07$\x02\x02\xE4\xE5\x05\x94K\x02\xE5\x1F" + - "\x03\x02\x02\x02\xE6\xE7\x07\x1A\x02\x02\xE7\xE8\x07K\x02\x02\xE8\xE9" + - "\x07*\x02\x02\xE9\xEA\x07+\x02\x02\xEA!\x03\x02\x02\x02\xEB\xEC\x07\x19" + - "\x02\x02\xEC\xED\x07K\x02\x02\xED\xEE\x07*\x02\x02\xEE\xEF\x07+\x02\x02" + + "\xE2\xE3\x05\x16\f\x02\xE3\xE4\x07%\x02\x02\xE4\xE5\x05\x94K\x02\xE5\x1F" + + "\x03\x02\x02\x02\xE6\xE7\x07\x1B\x02\x02\xE7\xE8\x07L\x02\x02\xE8\xE9" + + "\x07+\x02\x02\xE9\xEA\x07,\x02\x02\xEA!\x03\x02\x02\x02\xEB\xEC\x07\x1A" + + "\x02\x02\xEC\xED\x07L\x02\x02\xED\xEE\x07+\x02\x02\xEE\xEF\x07,\x02\x02" + "\xEF#\x03\x02\x02\x02\xF0\xF7\x05(\x15\x02\xF1\xF7\x05*\x16\x02\xF2\xF7" + "\x052\x1A\x02\xF3\xF7\x05:\x1E\x02\xF4\xF7\x05<\x1F\x02\xF5\xF7\x05&\x14" + "\x02\xF6\xF0\x03\x02\x02\x02\xF6\xF1\x03\x02\x02\x02\xF6\xF2\x03\x02\x02" + "\x02\xF6\xF3\x03\x02\x02\x02\xF6\xF4\x03\x02\x02\x02\xF6\xF5\x03\x02\x02" + - "\x02\xF7%\x03\x02\x02\x02\xF8\xF9\x06\x14\x02\x02\xF9\xFB\x07*\x02\x02" + + "\x02\xF7%\x03\x02\x02\x02\xF8\xF9\x06\x14\x02\x02\xF9\xFB\x07+\x02\x02" + "\xFA\xFC\x05\b\x05\x02\xFB\xFA\x03\x02\x02\x02\xFB\xFC\x03\x02\x02\x02" + - "\xFC\xFD\x03\x02\x02\x02\xFD\xFE\x07+\x02\x02\xFE'\x03\x02\x02\x02\xFF" + - '\u0100\b\x15\x01\x02\u0100\u0101\x05\x92J\x02\u0101\u0102\x07"\x02\x02' + + "\xFC\xFD\x03\x02\x02\x02\xFD\xFE\x07,\x02\x02\xFE'\x03\x02\x02\x02\xFF" + + "\u0100\b\x15\x01\x02\u0100\u0101\x05\x92J\x02\u0101\u0102\x07#\x02\x02" + "\u0102\u0103\b\x15\x01\x02\u0103)\x03\x02\x02\x02\u0104\u0107\x05,\x17" + "\x02\u0105\u0107\x05.\x18\x02\u0106\u0104\x03\x02\x02\x02\u0106\u0105" + - "\x03\x02\x02\x02\u0107+\x03\x02\x02\x02\u0108\u0109\x07\x11\x02\x02\u0109" + - "\u010A\x07%\x02\x02\u010A\u010B\x05\x92J\x02\u010B\u010C\x07&\x02\x02" + - "\u010C\u010F\x05$\x13\x02\u010D\u010E\x07\x12\x02\x02\u010E\u0110\x05" + + "\x03\x02\x02\x02\u0107+\x03\x02\x02\x02\u0108\u0109\x07\x12\x02\x02\u0109" + + "\u010A\x07&\x02\x02\u010A\u010B\x05\x92J\x02\u010B\u010C\x07'\x02\x02" + + "\u010C\u010F\x05$\x13\x02\u010D\u010E\x07\x13\x02\x02\u010E\u0110\x05" + "$\x13\x02\u010F\u010D\x03\x02\x02\x02\u010F\u0110\x03\x02\x02\x02\u0110" + - "-\x03\x02\x02\x02\u0111\u0112\x07\n\x02\x02\u0112\u0113\x07%\x02\x02\u0113" + - "\u0114\x05\x92J\x02\u0114\u0115\x07&\x02\x02\u0115\u0119\x07*\x02\x02" + + "-\x03\x02\x02\x02\u0111\u0112\x07\v\x02\x02\u0112\u0113\x07&\x02\x02\u0113" + + "\u0114\x05\x92J\x02\u0114\u0115\x07'\x02\x02\u0115\u0119\x07+\x02\x02" + "\u0116\u0118\x050\x19\x02\u0117\u0116\x03\x02\x02\x02\u0118\u011B\x03" + "\x02\x02\x02\u0119\u0117\x03\x02\x02\x02\u0119\u011A\x03\x02\x02\x02\u011A" + - "\u011C\x03\x02\x02\x02\u011B\u0119\x03\x02\x02\x02\u011C\u011D\x07+\x02" + - "\x02\u011D/\x03\x02\x02\x02\u011E\u011F\x07\v\x02\x02\u011F\u0120\x05" + - "\x92J\x02\u0120\u0121\x07$\x02\x02\u0121\u0122\x05$\x13\x02\u0122\u0127" + - "\x03\x02\x02\x02\u0123\u0124\x07\f\x02\x02\u0124\u0125\x07$\x02\x02\u0125" + + "\u011C\x03\x02\x02\x02\u011B\u0119\x03\x02\x02\x02\u011C\u011D\x07,\x02" + + "\x02\u011D/\x03\x02\x02\x02\u011E\u011F\x07\f\x02\x02\u011F\u0120\x05" + + "\x92J\x02\u0120\u0121\x07%\x02\x02\u0121\u0122\x05$\x13\x02\u0122\u0127" + + "\x03\x02\x02\x02\u0123\u0124\x07\r\x02\x02\u0124\u0125\x07%\x02\x02\u0125" + "\u0127\x05$\x13\x02\u0126\u011E\x03\x02\x02\x02\u0126\u0123\x03\x02\x02" + "\x02\u01271\x03\x02\x02\x02\u0128\u012C\x054\x1B\x02\u0129\u012C\x056" + "\x1C\x02\u012A\u012C\x058\x1D\x02\u012B\u0128\x03\x02\x02\x02\u012B\u0129" + "\x03\x02\x02\x02\u012B\u012A\x03\x02\x02\x02\u012C3\x03\x02\x02\x02\u012D" + - "\u012E\x07\x13\x02\x02\u012E\u0135\x07%\x02\x02\u012F\u0132\x05\x0E\b" + + "\u012E\x07\x14\x02\x02\u012E\u0135\x07&\x02\x02\u012F\u0132\x05\x0E\b" + "\x02\u0130\u0132\x05\x92J\x02\u0131\u012F\x03\x02\x02\x02\u0131\u0130" + "\x03\x02\x02\x02\u0132\u0133\x03\x02\x02\x02\u0133\u0134\b\x1B\x01\x02" + "\u0134\u0136\x03\x02\x02\x02\u0135\u0131\x03\x02\x02\x02\u0135\u0136\x03" + - '\x02\x02\x02\u0136\u0137\x03\x02\x02\x02\u0137\u013B\x07"\x02\x02\u0138' + + "\x02\x02\x02\u0136\u0137\x03\x02\x02\x02\u0137\u013B\x07#\x02\x02\u0138" + "\u0139\x05\x92J\x02\u0139\u013A\b\x1B\x01\x02\u013A\u013C\x03\x02\x02" + "\x02\u013B\u0138\x03\x02\x02\x02\u013B\u013C\x03\x02\x02\x02\u013C\u013D" + - '\x03\x02\x02\x02\u013D\u0141\x07"\x02\x02\u013E\u013F\x05\x92J\x02\u013F' + + "\x03\x02\x02\x02\u013D\u0141\x07#\x02\x02\u013E\u013F\x05\x92J\x02\u013F" + "\u0140\b\x1B\x01\x02\u0140\u0142\x03\x02\x02\x02\u0141\u013E\x03\x02\x02" + "\x02\u0141\u0142\x03\x02\x02\x02\u0142\u0143\x03\x02\x02\x02\u0143\u0144" + - "\x07&\x02\x02\u0144\u0145\x05$\x13\x02\u01455\x03\x02\x02\x02\u0146\u0147" + - "\x07\x10\x02\x02\u0147\u0148\x07%\x02\x02\u0148\u0149\x05\x92J\x02\u0149" + - "\u014A\x07&\x02\x02\u014A\u014B\x05$\x13\x02\u014B7\x03\x02\x02\x02\u014C" + - "\u014D\x07\x0F\x02\x02\u014D\u014E\x05$\x13\x02\u014E\u014F\x07\x10\x02" + - "\x02\u014F\u0150\x07%\x02\x02\u0150\u0151\x05\x92J\x02\u0151\u0152\x07" + - '&\x02\x02\u0152\u0153\x07"\x02\x02\u01539\x03\x02\x02\x02\u0154\u0155' + - '\t\x03\x02\x02\u0155\u0156\x07"\x02\x02\u0156;\x03\x02\x02\x02\u0157' + - "\u0159\x07\x16\x02\x02\u0158\u015A\x05\x92J\x02\u0159\u0158\x03\x02\x02" + - "\x02\u0159\u015A\x03\x02\x02\x02\u015A\u015B\x03\x02\x02\x02\u015B\u015C" + - '\x07"\x02\x02\u015C=\x03\x02\x02\x02\u015D\u0167\x05@!\x02\u015E\u0167' + - '\x05T+\x02\u015F\u0167\x05V,\x02\u0160\u0167\x05B"\x02\u0161\u0167\x05' + - "D#\x02\u0162\u0167\x05J&\x02\u0163\u0167\x05L'\x02\u0164\u0167\x05R*" + - "\x02\u0165\u0167\x05Z.\x02\u0166\u015D\x03\x02\x02\x02\u0166\u015E\x03" + - "\x02\x02\x02\u0166\u015F\x03\x02\x02\x02\u0166\u0160\x03\x02\x02\x02\u0166" + + "\x07'\x02\x02\u0144\u0145\x05$\x13\x02\u01455\x03\x02\x02\x02\u0146\u0147" + + "\x07\x11\x02\x02\u0147\u0148\x07&\x02\x02\u0148\u0149\x05\x92J\x02\u0149" + + "\u014A\x07'\x02\x02\u014A\u014B\x05$\x13\x02\u014B7\x03\x02\x02\x02\u014C" + + "\u014D\x07\x10\x02\x02\u014D\u014E\x05$\x13\x02\u014E\u014F\x07\x11\x02" + + "\x02\u014F\u0150\x07&\x02\x02\u0150\u0151\x05\x92J\x02\u0151\u0152\x07" + + "'\x02\x02\u0152\u0153\x07#\x02\x02\u01539\x03\x02\x02\x02\u0154\u0155" + + "\t\x03\x02\x02\u0155\u0156\x07#\x02\x02\u0156;\x03\x02\x02\x02\u0157\u0159" + + "\x07\x17\x02\x02\u0158\u015A\x05\x92J\x02\u0159\u0158\x03\x02\x02\x02" + + "\u0159\u015A\x03\x02\x02\x02\u015A\u015B\x03\x02\x02\x02\u015B\u015C\x07" + + "#\x02\x02\u015C=\x03\x02\x02\x02\u015D\u0167\x05@!\x02\u015E\u0167\x05" + + 'T+\x02\u015F\u0167\x05V,\x02\u0160\u0167\x05B"\x02\u0161\u0167\x05D#' + + "\x02\u0162\u0167\x05J&\x02\u0163\u0167\x05L'\x02\u0164\u0167\x05R*\x02" + + "\u0165\u0167\x05Z.\x02\u0166\u015D\x03\x02\x02\x02\u0166\u015E\x03\x02" + + "\x02\x02\u0166\u015F\x03\x02\x02\x02\u0166\u0160\x03\x02\x02\x02\u0166" + "\u0161\x03\x02\x02\x02\u0166\u0162\x03\x02\x02\x02\u0166\u0163\x03\x02" + "\x02\x02\u0166\u0164\x03\x02\x02\x02\u0166\u0165\x03\x02\x02\x02\u0167" + - "?\x03\x02\x02\x02\u0168\u0169\x07%\x02\x02\u0169\u016A\x05\x92J\x02\u016A" + - "\u016B\x07&\x02\x02\u016BA\x03\x02\x02\x02\u016C\u016D\t\x04\x02\x02\u016D" + - "C\x03\x02\x02\x02\u016E\u016F\x05F$\x02\u016FE\x03\x02\x02\x02\u0170\u0171" + - "\x07K\x02\x02\u0171G\x03\x02\x02\x02\u0172\u0175\x05F$\x02\u0173\u0175" + - "\x05J&\x02\u0174\u0172\x03\x02\x02\x02\u0174\u0173\x03\x02\x02\x02\u0175" + - "I\x03\x02\x02\x02\u0176\u0177\t\x05\x02\x02\u0177K\x03\x02\x02\x02\u0178" + - "\u017C\x07R\x02\x02\u0179\u017B\x05N(\x02\u017A\u0179\x03\x02\x02\x02" + - "\u017B\u017E\x03\x02\x02\x02\u017C\u017A\x03\x02\x02\x02\u017C\u017D\x03" + - "\x02\x02\x02\u017D\u017F\x03\x02\x02\x02\u017E\u017C\x03\x02\x02\x02\u017F" + - "\u0189\x07T\x02\x02\u0180\u0184\x07S\x02\x02\u0181\u0183\x05P)\x02\u0182" + - "\u0181\x03\x02\x02\x02\u0183\u0186\x03\x02\x02\x02\u0184\u0182\x03\x02" + - "\x02\x02\u0184\u0185\x03\x02\x02\x02\u0185\u0187\x03\x02\x02\x02\u0186" + - "\u0184\x03\x02\x02\x02\u0187\u0189\x07V\x02\x02\u0188\u0178\x03\x02\x02" + + "?\x03\x02\x02\x02\u0168\u0169\x07&\x02\x02\u0169\u016A\x05\x92J\x02\u016A" + + "\u016B\x07'\x02\x02\u016BA\x03\x02\x02\x02\u016C\u016D\t\x04\x02\x02" + + "\u016DC\x03\x02\x02\x02\u016E\u016F\x05F$\x02\u016FE\x03\x02\x02\x02\u0170" + + "\u0171\x07L\x02\x02\u0171G\x03\x02\x02\x02\u0172\u0175\x05F$\x02\u0173" + + "\u0175\x05J&\x02\u0174\u0172\x03\x02\x02\x02\u0174\u0173\x03\x02\x02\x02" + + "\u0175I\x03\x02\x02\x02\u0176\u0177\t\x05\x02\x02\u0177K\x03\x02\x02\x02" + + "\u0178\u017C\x07S\x02\x02\u0179\u017B\x05N(\x02\u017A\u0179\x03\x02\x02" + + "\x02\u017B\u017E\x03\x02\x02\x02\u017C\u017A\x03\x02\x02\x02\u017C\u017D" + + "\x03\x02\x02\x02\u017D\u017F\x03\x02\x02\x02\u017E\u017C\x03\x02\x02\x02" + + "\u017F\u0189\x07U\x02\x02\u0180\u0184\x07T\x02\x02\u0181\u0183\x05P)\x02" + + "\u0182\u0181\x03\x02\x02\x02\u0183\u0186\x03\x02\x02\x02\u0184\u0182\x03" + + "\x02\x02\x02\u0184\u0185\x03\x02\x02\x02\u0185\u0187\x03\x02\x02\x02\u0186" + + "\u0184\x03\x02\x02\x02\u0187\u0189\x07W\x02\x02\u0188\u0178\x03\x02\x02" + "\x02\u0188\u0180\x03\x02\x02\x02\u0189M\x03\x02\x02\x02\u018A\u0191\x07" + - "U\x02\x02\u018B\u018D\x07\x03\x02\x02\u018C\u018E\x05\x92J\x02\u018D\u018C" + + "V\x02\x02\u018B\u018D\x07\x03\x02\x02\u018C\u018E\x05\x92J\x02\u018D\u018C" + "\x03\x02\x02\x02\u018D\u018E\x03\x02\x02\x02\u018E\u018F\x03\x02\x02\x02" + - "\u018F\u0191\x07)\x02\x02\u0190\u018A\x03\x02\x02\x02\u0190\u018B\x03" + - "\x02\x02\x02\u0191O\x03\x02\x02\x02\u0192\u0199\x07W\x02\x02\u0193\u0195" + + "\u018F\u0191\x07*\x02\x02\u0190\u018A\x03\x02\x02\x02\u0190\u018B\x03" + + "\x02\x02\x02\u0191O\x03\x02\x02\x02\u0192\u0199\x07X\x02\x02\u0193\u0195" + "\x07\x03\x02\x02\u0194\u0196\x05\x92J\x02\u0195\u0194\x03\x02\x02\x02" + "\u0195\u0196\x03\x02\x02\x02\u0196\u0197\x03\x02\x02\x02\u0197\u0199\x07" + - ")\x02\x02\u0198\u0192\x03\x02\x02\x02\u0198\u0193\x03\x02\x02\x02\u0199" + + "*\x02\x02\u0198\u0192\x03\x02\x02\x02\u0198\u0193\x03\x02\x02\x02\u0199" + "Q\x03\x02\x02\x02\u019A\u019B\t\x06\x02\x02\u019BS\x03\x02\x02\x02\u019C" + - "\u01A5\x07'\x02\x02\u019D\u01A2\x05\x92J\x02\u019E\u019F\x07!\x02\x02" + + '\u01A5\x07(\x02\x02\u019D\u01A2\x05\x92J\x02\u019E\u019F\x07"\x02\x02' + "\u019F\u01A1\x05\x92J\x02\u01A0\u019E\x03\x02\x02\x02\u01A1\u01A4\x03" + "\x02\x02\x02\u01A2\u01A0\x03\x02\x02\x02\u01A2\u01A3\x03\x02\x02\x02\u01A3" + "\u01A6\x03\x02\x02\x02\u01A4\u01A2\x03\x02\x02\x02\u01A5\u019D\x03\x02" + "\x02\x02\u01A5\u01A6\x03\x02\x02\x02\u01A6\u01A8\x03\x02\x02\x02\u01A7" + - "\u01A9\x07!\x02\x02\u01A8\u01A7\x03\x02\x02\x02\u01A8\u01A9\x03\x02\x02" + - "\x02\u01A9\u01AA\x03\x02\x02\x02\u01AA\u01AB\x07(\x02\x02\u01ABU\x03\x02" + - "\x02\x02\u01AC\u01B5\x07*\x02\x02\u01AD\u01B2\x05X-\x02\u01AE\u01AF\x07" + - "!\x02\x02\u01AF\u01B1\x05X-\x02\u01B0\u01AE\x03\x02\x02\x02\u01B1\u01B4" + + '\u01A9\x07"\x02\x02\u01A8\u01A7\x03\x02\x02\x02\u01A8\u01A9\x03\x02\x02' + + "\x02\u01A9\u01AA\x03\x02\x02\x02\u01AA\u01AB\x07)\x02\x02\u01ABU\x03\x02" + + "\x02\x02\u01AC\u01B5\x07+\x02\x02\u01AD\u01B2\x05X-\x02\u01AE\u01AF\x07" + + '"\x02\x02\u01AF\u01B1\x05X-\x02\u01B0\u01AE\x03\x02\x02\x02\u01B1\u01B4' + "\x03\x02\x02\x02\u01B2\u01B0\x03\x02\x02\x02\u01B2\u01B3\x03\x02\x02\x02" + "\u01B3\u01B6\x03\x02\x02\x02\u01B4\u01B2\x03\x02\x02\x02\u01B5\u01AD\x03" + "\x02\x02\x02\u01B5\u01B6\x03\x02\x02\x02\u01B6\u01B8\x03\x02\x02\x02\u01B7" + - "\u01B9\x07!\x02\x02\u01B8\u01B7\x03\x02\x02\x02\u01B8\u01B9\x03\x02\x02" + - "\x02\u01B9\u01BA\x03\x02\x02\x02\u01BA\u01BB\x07+\x02\x02\u01BBW\x03\x02" + - "\x02\x02\u01BC\u01BD\x05H%\x02\u01BD\u01BE\x07$\x02\x02\u01BE\u01BF\x05" + + '\u01B9\x07"\x02\x02\u01B8\u01B7\x03\x02\x02\x02\u01B8\u01B9\x03\x02\x02' + + "\x02\u01B9\u01BA\x03\x02\x02\x02\u01BA\u01BB\x07,\x02\x02\u01BBW\x03\x02" + + "\x02\x02\u01BC\u01BD\x05H%\x02\u01BD\u01BE\x07%\x02\x02\u01BE\u01BF\x05" + "\x92J\x02\u01BFY\x03\x02\x02\x02\u01C0\u01C1\t\x07\x02\x02\u01C1[\x03" + "\x02\x02\x02\u01C2\u01C3\b/\x01\x02\u01C3\u01CE\x05> \x02\u01C4\u01C5" + - "\x07\x17\x02\x02\u01C5\u01C6\x05\\/\x02\u01C6\u01C8\x07%\x02\x02\u01C7" + + "\x07\x18\x02\x02\u01C5\u01C6\x05\\/\x02\u01C6\u01C8\x07&\x02\x02\u01C7" + "\u01C9\x05^0\x02\u01C8\u01C7\x03\x02\x02\x02\u01C8\u01C9\x03\x02\x02\x02" + - "\u01C9\u01CA\x03\x02\x02\x02\u01CA\u01CB\x07&\x02\x02\u01CB\u01CC\b/\x01" + - "\x02\u01CC\u01CE\x03\x02\x02\x02\u01CD\u01C2\x03\x02\x02\x02\u01CD\u01C4" + - "\x03\x02\x02\x02\u01CE\u01E4\x03\x02\x02\x02\u01CF\u01D0\f\x07\x02\x02" + - "\u01D0\u01D2\x07%\x02\x02\u01D1\u01D3\x05^0\x02\u01D2\u01D1\x03\x02\x02" + - "\x02\u01D2\u01D3\x03\x02\x02\x02\u01D3\u01D4\x03\x02\x02\x02\u01D4\u01D5" + - "\x07&\x02\x02\u01D5\u01E3\b/\x01\x02\u01D6\u01D7\f\x05\x02\x02\u01D7\u01D8" + - "\x05`1\x02\u01D8\u01D9\b/\x01\x02\u01D9\u01E3\x03\x02\x02\x02\u01DA\u01DB" + - "\f\x04\x02\x02\u01DB\u01DC\x05b2\x02\u01DC\u01DD\b/\x01\x02\u01DD\u01E3" + - "\x03\x02\x02\x02\u01DE\u01DF\f\x03\x02\x02\u01DF\u01E0\x05d3\x02\u01E0" + - "\u01E1\b/\x01\x02\u01E1\u01E3\x03\x02\x02\x02\u01E2\u01CF\x03\x02\x02" + - "\x02\u01E2\u01D6\x03\x02\x02\x02\u01E2\u01DA\x03\x02\x02\x02\u01E2\u01DE" + - "\x03\x02\x02\x02\u01E3\u01E6\x03\x02\x02\x02\u01E4\u01E2\x03\x02\x02\x02" + - "\u01E4\u01E5\x03\x02\x02\x02\u01E5]\x03\x02\x02\x02\u01E6\u01E4\x03\x02" + - "\x02\x02\u01E7\u01EC\x05\x8EH\x02\u01E8\u01E9\x07!\x02\x02\u01E9\u01EB" + - "\x05\x8EH\x02\u01EA\u01E8\x03\x02\x02\x02\u01EB\u01EE\x03\x02\x02\x02" + - "\u01EC\u01EA\x03\x02\x02\x02\u01EC\u01ED\x03\x02\x02\x02\u01ED_\x03\x02" + - "\x02\x02\u01EE\u01EC\x03\x02\x02\x02\u01EF\u01F0\x07J\x02\x02\u01F0\u01F1" + - "\x05F$\x02\u01F1a\x03\x02\x02\x02\u01F2\u01F3\x07'\x02\x02\u01F3\u01F4" + - "\x05\x92J\x02\u01F4\u01F5\x07(\x02\x02\u01F5c\x03\x02\x02\x02\u01F6\u01FA" + - "\x07'\x02\x02\u01F7\u01F8\x05\x92J\x02\u01F8\u01F9\b3\x01\x02\u01F9\u01FB" + - "\x03\x02\x02\x02\u01FA\u01F7\x03\x02\x02\x02\u01FA\u01FB\x03\x02\x02\x02" + - "\u01FB\u01FC\x03\x02\x02\x02\u01FC\u0200\x07$\x02\x02\u01FD\u01FE\x05" + - "\x92J\x02\u01FE\u01FF\b3\x01\x02\u01FF\u0201\x03\x02\x02\x02\u0200\u01FD" + - "\x03\x02\x02\x02\u0200\u0201\x03\x02\x02\x02\u0201\u0202\x03\x02\x02\x02" + - "\u0202\u0203\x07(\x02\x02\u0203e\x03\x02\x02\x02\u0204\u0207\x05\\/\x02" + - "\u0205\u0207\x05h5\x02\u0206\u0204\x03\x02\x02\x02\u0206\u0205\x03\x02" + - "\x02\x02\u0207g\x03\x02\x02\x02\u0208\u0209\x05\\/\x02\u0209\u020A\x05" + - "p9\x02\u020Ai\x03\x02\x02\x02\u020B\u020F\x05f4\x02\u020C\u020F\x05l7" + - "\x02\u020D\u020F\x05n8\x02\u020E\u020B\x03\x02\x02\x02\u020E\u020C\x03" + - "\x02\x02\x02\u020E\u020D\x03\x02\x02\x02\u020Fk\x03\x02\x02\x02\u0210" + - "\u0211\x05p9\x02\u0211\u0212\x05f4\x02\u0212m\x03\x02\x02\x02\u0213\u0214" + - "\x05r:\x02\u0214\u0215\x05f4\x02\u0215o\x03\x02\x02\x02\u0216\u0217\t" + - "\b\x02\x02\u0217q\x03\x02\x02\x02\u0218\u0219\t\t\x02\x02\u0219s\x03\x02" + - "\x02\x02\u021A\u0220\x05j6\x02\u021B\u021C\x05j6\x02\u021C\u021D\x07\b" + - "\x02\x02\u021D\u021E\x05\x94K\x02\u021E\u0220\x03\x02\x02\x02\u021F\u021A" + - "\x03\x02\x02\x02\u021F\u021B\x03\x02\x02\x02\u0220u\x03\x02\x02\x02\u0221" + - "\u0222\b<\x01\x02\u0222\u0223\x05t;\x02\u0223\u0229\x03\x02\x02\x02\u0224" + - "\u0225\f\x03\x02\x02\u0225\u0226\t\n\x02\x02\u0226\u0228\x05t;\x02\u0227" + - "\u0224\x03\x02\x02\x02\u0228\u022B\x03\x02\x02\x02\u0229\u0227\x03\x02" + - "\x02\x02\u0229\u022A\x03\x02\x02\x02\u022Aw\x03\x02\x02\x02\u022B\u0229" + - "\x03\x02\x02\x02\u022C\u022D"; + "\u01C9\u01CA\x03\x02\x02\x02\u01CA\u01CB\x07'\x02\x02\u01CB\u01CC\b/" + + "\x01\x02\u01CC\u01CE\x03\x02\x02\x02\u01CD\u01C2\x03\x02\x02\x02\u01CD" + + "\u01C4\x03\x02\x02\x02\u01CE\u01E4\x03\x02\x02\x02\u01CF\u01D0\f\x07\x02" + + "\x02\u01D0\u01D2\x07&\x02\x02\u01D1\u01D3\x05^0\x02\u01D2\u01D1\x03\x02" + + "\x02\x02\u01D2\u01D3\x03\x02\x02\x02\u01D3\u01D4\x03\x02\x02\x02\u01D4" + + "\u01D5\x07'\x02\x02\u01D5\u01E3\b/\x01\x02\u01D6\u01D7\f\x05\x02\x02" + + "\u01D7\u01D8\x05`1\x02\u01D8\u01D9\b/\x01\x02\u01D9\u01E3\x03\x02\x02" + + "\x02\u01DA\u01DB\f\x04\x02\x02\u01DB\u01DC\x05b2\x02\u01DC\u01DD\b/\x01" + + "\x02\u01DD\u01E3\x03\x02\x02\x02\u01DE\u01DF\f\x03\x02\x02\u01DF\u01E0" + + "\x05d3\x02\u01E0\u01E1\b/\x01\x02\u01E1\u01E3\x03\x02\x02\x02\u01E2\u01CF" + + "\x03\x02\x02\x02\u01E2\u01D6\x03\x02\x02\x02\u01E2\u01DA\x03\x02\x02\x02" + + "\u01E2\u01DE\x03\x02\x02\x02\u01E3\u01E6\x03\x02\x02\x02\u01E4\u01E2\x03" + + "\x02\x02\x02\u01E4\u01E5\x03\x02\x02\x02\u01E5]\x03\x02\x02\x02\u01E6" + + '\u01E4\x03\x02\x02\x02\u01E7\u01EC\x05\x8EH\x02\u01E8\u01E9\x07"\x02' + + "\x02\u01E9\u01EB\x05\x8EH\x02\u01EA\u01E8\x03\x02\x02\x02\u01EB\u01EE" + + "\x03\x02\x02\x02\u01EC\u01EA\x03\x02\x02\x02\u01EC\u01ED\x03\x02\x02\x02" + + "\u01ED_\x03\x02\x02\x02\u01EE\u01EC\x03\x02\x02\x02\u01EF\u01F0\x07K\x02" + + "\x02\u01F0\u01F1\x05F$\x02\u01F1a\x03\x02\x02\x02\u01F2\u01F3\x07(\x02" + + "\x02\u01F3\u01F4\x05\x92J\x02\u01F4\u01F5\x07)\x02\x02\u01F5c\x03\x02" + + "\x02\x02\u01F6\u01FA\x07(\x02\x02\u01F7\u01F8\x05\x92J\x02\u01F8\u01F9" + + "\b3\x01\x02\u01F9\u01FB\x03\x02\x02\x02\u01FA\u01F7\x03\x02\x02\x02\u01FA" + + "\u01FB\x03\x02\x02\x02\u01FB\u01FC\x03\x02\x02\x02\u01FC\u0200\x07%\x02" + + "\x02\u01FD\u01FE\x05\x92J\x02\u01FE\u01FF\b3\x01\x02\u01FF\u0201\x03\x02" + + "\x02\x02\u0200\u01FD\x03\x02\x02\x02\u0200\u0201\x03\x02\x02\x02\u0201" + + "\u0202\x03\x02\x02\x02\u0202\u0203\x07)\x02\x02\u0203e\x03\x02\x02\x02" + + "\u0204\u0207\x05\\/\x02\u0205\u0207\x05h5\x02\u0206\u0204\x03\x02\x02" + + "\x02\u0206\u0205\x03\x02\x02\x02\u0207g\x03\x02\x02\x02\u0208\u0209\x05" + + "\\/\x02\u0209\u020A\x05p9\x02\u020Ai\x03\x02\x02\x02\u020B\u020F\x05f" + + "4\x02\u020C\u020F\x05l7\x02\u020D\u020F\x05n8\x02\u020E\u020B\x03\x02" + + "\x02\x02\u020E\u020C\x03\x02\x02\x02\u020E\u020D\x03\x02\x02\x02\u020F" + + "k\x03\x02\x02\x02\u0210\u0211\x05p9\x02\u0211\u0212\x05f4\x02\u0212m\x03" + + "\x02\x02\x02\u0213\u0214\x05r:\x02\u0214\u0215\x05f4\x02\u0215o\x03\x02" + + "\x02\x02\u0216\u0217\t\b\x02\x02\u0217q\x03\x02\x02\x02\u0218\u0219\t" + + "\t\x02\x02\u0219s\x03\x02\x02\x02\u021A\u0220\x05j6\x02\u021B\u021C\x05" + + "j6\x02\u021C\u021D\x07\t\x02\x02\u021D\u021E\x05\x94K\x02\u021E\u0220" + + "\x03\x02\x02\x02\u021F\u021A\x03\x02\x02\x02\u021F\u021B\x03\x02\x02\x02" + + "\u0220u\x03\x02\x02\x02\u0221\u0222\b<\x01\x02\u0222\u0223\x05t;\x02\u0223" + + "\u0229\x03\x02\x02\x02\u0224\u0225\f\x03\x02\x02\u0225\u0226\t\n\x02\x02" + + "\u0226\u0228\x05t;\x02\u0227\u0224\x03\x02\x02\x02\u0228\u022B\x03\x02" + + "\x02\x02\u0229\u0227\x03\x02\x02\x02\u0229\u022A\x03\x02\x02\x02\u022A" + + "w\x03\x02\x02\x02\u022B\u0229\x03\x02\x02\x02\u022C\u022D"; private static readonly _serializedATNSegment1: string = "\b=\x01\x02\u022D\u022E\x05v<\x02\u022E\u0234\x03\x02\x02\x02\u022F\u0230" + "\f\x03\x02\x02\u0230\u0231\t\v\x02\x02\u0231\u0233\x05v<\x02\u0232\u022F" + @@ -4914,45 +4917,45 @@ export class KipperParser extends KipperParserBase { "\x03\x02\x02\x02\u0258\u0259\x03\x02\x02\x02\u0259\x81\x03\x02\x02\x02" + "\u025A\u0258\x03\x02\x02\x02\u025B\u025C\bB\x01\x02\u025C\u025D\x05\x80" + "A\x02\u025D\u0263\x03\x02\x02\x02\u025E\u025F\f\x03\x02\x02\u025F\u0260" + - "\x07C\x02\x02\u0260\u0262\x05\x80A\x02\u0261\u025E\x03\x02\x02\x02\u0262" + + "\x07D\x02\x02\u0260\u0262\x05\x80A\x02\u0261\u025E\x03\x02\x02\x02\u0262" + "\u0265\x03\x02\x02\x02\u0263\u0261\x03\x02\x02\x02\u0263\u0264\x03\x02" + "\x02\x02\u0264\x83\x03\x02\x02\x02\u0265\u0263\x03\x02\x02\x02\u0266\u0267" + "\bC\x01\x02\u0267\u0268\x05\x82B\x02\u0268\u026E\x03\x02\x02\x02\u0269" + - "\u026A\f\x03\x02\x02\u026A\u026B\x07E\x02\x02\u026B\u026D\x05\x82B\x02" + + "\u026A\f\x03\x02\x02\u026A\u026B\x07F\x02\x02\u026B\u026D\x05\x82B\x02" + "\u026C\u0269\x03\x02\x02\x02\u026D\u0270\x03\x02\x02\x02\u026E\u026C\x03" + "\x02\x02\x02\u026E\u026F\x03\x02\x02\x02\u026F\x85\x03\x02\x02\x02\u0270" + "\u026E\x03\x02\x02\x02\u0271\u0272\bD\x01\x02\u0272\u0273\x05\x84C\x02" + "\u0273\u0279\x03\x02\x02\x02\u0274\u0275\f\x03\x02\x02\u0275\u0276\x07" + - "D\x02\x02\u0276\u0278\x05\x84C\x02\u0277\u0274\x03\x02\x02\x02\u0278\u027B" + + "E\x02\x02\u0276\u0278\x05\x84C\x02\u0277\u0274\x03\x02\x02\x02\u0278\u027B" + "\x03\x02\x02\x02\u0279\u0277\x03\x02\x02\x02\u0279\u027A\x03\x02\x02\x02" + "\u027A\x87\x03\x02\x02\x02\u027B\u0279\x03\x02\x02\x02\u027C\u027D\bE" + "\x01\x02\u027D\u027E\x05\x86D\x02\u027E\u0284\x03\x02\x02\x02\u027F\u0280" + - "\f\x03\x02\x02\u0280\u0281\x074\x02\x02\u0281\u0283\x05\x86D\x02\u0282" + + "\f\x03\x02\x02\u0280\u0281\x075\x02\x02\u0281\u0283\x05\x86D\x02\u0282" + "\u027F\x03\x02\x02\x02\u0283\u0286\x03\x02\x02\x02\u0284\u0282\x03\x02" + "\x02\x02\u0284\u0285\x03\x02\x02\x02\u0285\x89\x03\x02\x02\x02\u0286\u0284" + "\x03\x02\x02\x02\u0287\u0288\bF\x01\x02\u0288\u0289\x05\x88E\x02\u0289" + - "\u028F\x03\x02\x02\x02\u028A\u028B\f\x03\x02\x02\u028B\u028C\x075\x02" + + "\u028F\x03\x02\x02\x02\u028A\u028B\f\x03\x02\x02\u028B\u028C\x076\x02" + "\x02\u028C\u028E\x05\x88E\x02\u028D\u028A\x03\x02\x02\x02\u028E\u0291" + "\x03\x02\x02\x02\u028F\u028D\x03\x02\x02\x02\u028F\u0290\x03\x02\x02\x02" + "\u0290\x8B\x03\x02\x02\x02\u0291\u028F\x03\x02\x02\x02\u0292\u029A\x05" + - "\x8AF\x02\u0293\u0294\x05\x8AF\x02\u0294\u0295\x07#\x02\x02\u0295\u0296" + - "\x05\x8CG\x02\u0296\u0297\x07$\x02\x02\u0297\u0298\x05\x8CG\x02\u0298" + + "\x8AF\x02\u0293\u0294\x05\x8AF\x02\u0294\u0295\x07$\x02\x02\u0295\u0296" + + "\x05\x8CG\x02\u0296\u0297\x07%\x02\x02\u0297\u0298\x05\x8CG\x02\u0298" + "\u029A\x03\x02\x02\x02\u0299\u0292\x03\x02\x02\x02\u0299\u0293\x03\x02" + "\x02\x02\u029A\x8D\x03\x02\x02\x02\u029B\u02A1\x05\x8CG\x02\u029C\u029D" + "\x05\\/\x02\u029D\u029E\x05\x90I\x02\u029E\u029F\x05\x8EH\x02\u029F\u02A1" + "\x03\x02\x02\x02\u02A0\u029B\x03\x02\x02\x02\u02A0\u029C\x03\x02\x02\x02" + "\u02A1\x8F\x03\x02\x02\x02\u02A2\u02A3\t\x0F\x02\x02\u02A3\x91\x03\x02" + - "\x02\x02\u02A4\u02A9\x05\x8EH\x02\u02A5\u02A6\x07!\x02\x02\u02A6\u02A8" + + '\x02\x02\u02A4\u02A9\x05\x8EH\x02\u02A5\u02A6\x07"\x02\x02\u02A6\u02A8' + "\x05\x8EH\x02\u02A7\u02A5\x03\x02\x02\x02\u02A8\u02AB\x03\x02\x02\x02" + "\u02A9\u02A7\x03\x02\x02\x02\u02A9\u02AA\x03\x02\x02\x02\u02AA\x93\x03" + "\x02\x02\x02\u02AB\u02A9\x03\x02\x02\x02\u02AC\u02B0\x05\x96L\x02\u02AD" + "\u02B0\x05\x98M\x02\u02AE\u02B0\x05\x9AN\x02\u02AF\u02AC\x03\x02\x02\x02" + "\u02AF\u02AD\x03\x02\x02\x02\u02AF\u02AE\x03\x02\x02\x02\u02B0\x95\x03" + "\x02\x02\x02\u02B1\u02B2\x05\x9CO\x02\u02B2\x97\x03\x02\x02\x02\u02B3" + - "\u02B4\x05\x9CO\x02\u02B4\u02B5\x07?\x02\x02\u02B5\u02B6\x05\x9CO\x02" + - "\u02B6\u02B7\x07A\x02\x02\u02B7\x99\x03\x02\x02\x02\u02B8\u02B9\x07\x1D" + - "\x02\x02\u02B9\u02BA\x07%\x02\x02\u02BA\u02BB\x05\x9CO\x02\u02BB\u02BC" + - "\x07&\x02\x02\u02BC\x9B\x03\x02\x02\x02\u02BD\u02BE\t\x10\x02\x02\u02BE" + + "\u02B4\x05\x9CO\x02\u02B4\u02B5\x07@\x02\x02\u02B5\u02B6\x05\x9CO\x02" + + "\u02B6\u02B7\x07B\x02\x02\u02B7\x99\x03\x02\x02\x02\u02B8\u02B9\x07\x1E" + + "\x02\x02\u02B9\u02BA\x07&\x02\x02\u02BA\u02BB\x05\x9CO\x02\u02BB\u02BC" + + "\x07'\x02\x02\u02BC\x9B\x03\x02\x02\x02\u02BD\u02BE\t\x10\x02\x02\u02BE" + "\x9D\x03\x02\x02\x02?\x9F\xA6\xAD\xB2\xBA\xC6\xD2\xD8\xDF\xF6\xFB\u0106" + "\u010F\u0119\u0126\u012B\u0131\u0135\u013B\u0141\u0159\u0166\u0174\u017C" + "\u0184\u0188\u018D\u0190\u0195\u0198\u01A2\u01A5\u01A8\u01B2\u01B5\u01B8" + diff --git a/kipper/core/src/compiler/optimiser/optimiser.ts b/kipper/core/src/compiler/optimiser/optimiser.ts index 0d3958187..e20db488e 100644 --- a/kipper/core/src/compiler/optimiser/optimiser.ts +++ b/kipper/core/src/compiler/optimiser/optimiser.ts @@ -4,7 +4,8 @@ */ import type { RootASTNode } from "../ast"; import type { KipperProgramContext } from "../program-ctx"; -import type { BuiltInFunction, BuiltInVariable, InternalFunction } from "../semantics/"; +import type { InternalFunction, Reference, ScopeFunctionDeclaration, ScopeVariableDeclaration } from "../semantics/"; +import { BuiltInFunction, BuiltInVariable } from "../semantics/"; /** * The options available for an optimisation run in {@link KipperOptimiser.optimise}. @@ -54,27 +55,28 @@ export class KipperOptimiser { * @since 0.8.0 */ private async optimiseBuiltIns(): Promise { - // Optimise the registered built-in variables by optimising them using the stored references. - const newBuiltInVariables: Array = []; + const strippedBuiltInVariables: Array> = []; for (const ref of this.programCtx.builtInVariableReferences) { - const alreadyIncluded: boolean = newBuiltInVariables.find((r) => r === ref.refTarget) !== undefined; - if (!alreadyIncluded) { - newBuiltInVariables.push(ref.refTarget); + const included: boolean = + strippedBuiltInVariables.find((includedRef) => includedRef.refTarget === ref.refTarget) !== undefined; + if (!included) { + strippedBuiltInVariables.push(ref); } } this.programCtx.clearBuiltInVariables(); - this.programCtx.registerBuiltInVariables(newBuiltInVariables); + this.programCtx.registerBuiltInVariables(strippedBuiltInVariables.map((v) => v.refTarget.builtInStructure!!)); // Optimise the registered built-in functions by optimising them using the stored references. - const newBuiltInFunctions: Array = []; + const strippedBuiltInFunctions: Array> = []; for (const ref of this.programCtx.builtInFunctionReferences) { - const alreadyIncluded: boolean = newBuiltInFunctions.find((r) => r === ref.refTarget) !== undefined; + const alreadyIncluded: boolean = + strippedBuiltInFunctions.find((includedRef) => includedRef.refTarget === ref.refTarget) !== undefined; if (!alreadyIncluded) { - newBuiltInFunctions.push(ref.refTarget); + strippedBuiltInFunctions.push(ref); } } this.programCtx.clearBuiltInFunctions(); - this.programCtx.registerBuiltInFunctions(newBuiltInFunctions); + this.programCtx.registerBuiltInFunctions(strippedBuiltInFunctions.map((v) => v.refTarget.builtInStructure!!)); } /** diff --git a/kipper/core/src/compiler/program-ctx.ts b/kipper/core/src/compiler/program-ctx.ts index 1a6352a58..13910739f 100644 --- a/kipper/core/src/compiler/program-ctx.ts +++ b/kipper/core/src/compiler/program-ctx.ts @@ -19,7 +19,16 @@ import type { KipperWarning } from "../warnings"; import type { CompilableASTNode, Expression, RootASTNode } from "./ast"; import { KipperFileASTGenerator } from "./ast"; import type { EvaluatedCompileConfig } from "./compile-config"; -import type { BuiltInFunction, BuiltInVariable, InternalFunction, InternalReference, Reference } from "./semantics"; +import type { + BuiltInFunction, + BuiltInVariable, + GlobalScope, + InternalFunction, + InternalReference, + Reference, + ScopeFunctionDeclaration, +} from "./semantics"; +import { ScopeVariableDeclaration } from "./semantics"; import { BuiltInFunctions, BuiltInTypes, @@ -52,9 +61,9 @@ export class KipperProgramContext { private readonly _warnings: Array; - private readonly _builtInFunctionReferences: Array>; + private readonly _builtInFunctionReferences: Array>; - private readonly _builtInVariableReferences: Array>; + private readonly _builtInVariableReferences: Array>; private readonly _internalReferences: Array>; @@ -294,11 +303,22 @@ export class KipperProgramContext { /** * The global scope of this file, which contains all {@link ScopeDeclaration} instances that are accessible in the * entire program. + * @since 0.11.0 */ public get universeScope(): UniverseScope { return this._universeScope; } + /** + * The global scope of this file, which contains all {@link ScopeDeclaration} instances that are accessible in the + * entire program. + * + * May be undefined if {@link generateAbstractSyntaxTree} has not been called yet. + */ + public get globalScope(): GlobalScope | undefined { + return this._rootASTNode?.innerScope; + } + /** * Returns the cached compiled code. * @@ -328,7 +348,7 @@ export class KipperProgramContext { * so they will not be generated. * @since 0.10.0 */ - public get builtInFunctionReferences(): Array> { + public get builtInFunctionReferences(): Array> { return this._builtInFunctionReferences; } @@ -340,7 +360,7 @@ export class KipperProgramContext { * so they will not be generated. * @since 0.10.0 */ - public get builtInVariableReferences(): Array> { + public get builtInVariableReferences(): Array> { return this._builtInVariableReferences; } @@ -718,6 +738,7 @@ export class KipperProgramContext { */ public clearBuiltInFunctions() { this.builtInFunctions.splice(0); + this.universeScope.clearUniversalFunctions(); } /** @@ -726,6 +747,7 @@ export class KipperProgramContext { */ public clearBuiltInVariables() { this.builtInVariables.splice(0); + this.universeScope.clearUniversalVariables(); } /** @@ -734,16 +756,16 @@ export class KipperProgramContext { * @param refTarget The built-in identifier referenced. * @since 0.8.0 */ - public addBuiltInReference(exp: Expression, refTarget: BuiltInFunction | BuiltInVariable) { + public addBuiltInReference(exp: Expression, refTarget: ScopeVariableDeclaration | ScopeFunctionDeclaration) { const ref = { refTarget: refTarget, srcExpr: exp, - } satisfies Reference; + } satisfies Reference; - if ("valueType" in ref.refTarget) { - this._builtInVariableReferences.push(>ref); + if (ref.refTarget instanceof ScopeVariableDeclaration) { + this._builtInVariableReferences.push(>ref); } else { - this._builtInFunctionReferences.push(>ref); + this._builtInFunctionReferences.push(>ref); } } diff --git a/kipper/core/src/compiler/semantics/analyser/semantic-checker.ts b/kipper/core/src/compiler/semantics/analyser/semantic-checker.ts index 99b24da46..4e77b5ddb 100644 --- a/kipper/core/src/compiler/semantics/analyser/semantic-checker.ts +++ b/kipper/core/src/compiler/semantics/analyser/semantic-checker.ts @@ -11,12 +11,11 @@ import type { Expression, JumpStatement, ReturnStatement, - ScopeNode, VariableDeclaration, } from "../../ast"; import { CompoundStatement, FunctionDeclaration, IdentifierPrimaryExpression, IterationStatement } from "../../ast"; import { KipperSemanticsAsserter } from "./err-handler"; -import type { LocalScope, Scope } from "../symbol-table"; +import type { Scope } from "../symbol-table"; import { ScopeDeclaration, ScopeFunctionDeclaration, ScopeVariableDeclaration } from "../symbol-table"; import { BuiltInOrInternalGeneratorFunctionNotFoundError, @@ -75,7 +74,7 @@ export class KipperSemanticChecker extends KipperSemanticsAsserter { * @since 0.10.0 */ public refTargetDefined(ref: KipperReferenceable): void { - if (ref instanceof ScopeDeclaration && !ref.hasValue) { + if (!ref.hasValue) { throw this.assertError(new UndefinedReferenceError(ref.identifier)); } } @@ -116,7 +115,7 @@ export class KipperSemanticChecker extends KipperSemanticsAsserter { * @since 0.7.0 */ public builtInNotDefined(identifier: string): void { - if (this.programCtx.getBuiltInFunction(identifier)) { + if (this.programCtx.universeScope.getEntry(identifier) !== undefined) { throw this.assertError(new BuiltInOverwriteError(identifier)); } } diff --git a/kipper/core/src/compiler/semantics/analyser/type-checker.ts b/kipper/core/src/compiler/semantics/analyser/type-checker.ts index 479ff686a..0fa3161dd 100644 --- a/kipper/core/src/compiler/semantics/analyser/type-checker.ts +++ b/kipper/core/src/compiler/semantics/analyser/type-checker.ts @@ -27,7 +27,7 @@ import { TangledPrimaryExpression, } from "../../ast"; import { KipperSemanticsAsserter } from "./err-handler"; -import type { Scope } from "../symbol-table"; +import type { Scope, ScopeFunctionDeclaration } from "../symbol-table"; import { BuiltInTypes, ScopeDeclaration, @@ -35,19 +35,11 @@ import { ScopeTypeDeclaration, ScopeVariableDeclaration, } from "../symbol-table"; -import type { - KipperArithmeticOperator, - KipperBitwiseOperator, - KipperBuiltInTypeLiteral, - KipperReferenceable, - KipperReferenceableFunction, -} from "../../const"; +import type { KipperArithmeticOperator, KipperBitwiseOperator, KipperReferenceable } from "../../const"; import { - kipperBuiltInTypeLiterals, kipperIncrementOrDecrementOperators, kipperMultiplicativeOperators, kipperPlusOperator, - kipperStrTypeLiteral, kipperSupportedConversions, } from "../../const"; import { @@ -70,8 +62,8 @@ import { UnknownTypeError, ValueNotIndexableTypeError, } from "../../../errors"; -import type { RawType } from "../types"; -import { ProcessedType, UndefinedType } from "../types"; +import type { RawType, ProcessedType } from "../types"; +import { UndefinedType } from "../types"; /** * Kipper Type Checker, which asserts that type logic and cohesion is valid and throws errors in case that an @@ -110,7 +102,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { public getCheckedType(rawType: RawType, scope: Scope): ProcessedType { try { const type = this.getTypeFromIdentifier(rawType.identifier, scope); - return type.type; + return type.typeValue; } catch (e) { // If the error is not a KipperError, rethrow it (since it is not a rawType error, and we don't know what happened) if (!(e instanceof KipperError)) { @@ -140,14 +132,14 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { */ public refTargetCallable(ref: KipperReferenceable): void { if (ref instanceof ScopeDeclaration) { - const refType = ref.type.get(); - if (refType === undefined) { + const refType = ref.type; + if (!refType.isCompilable) { return; // Ignore undefined types - Skip type checking (the type is invalid anyway) } // If the reference is not callable, throw an error if (!ref.isCallable) { - throw this.assertError(new ExpressionNotCallableError(refType)); + throw this.assertError(new ExpressionNotCallableError(refType.identifier)); } else if (ref instanceof ScopeParameterDeclaration || ref instanceof ScopeVariableDeclaration) { // Calling a function stored in a variable or parameter is not implemented yet throw this.notImplementedError( @@ -265,7 +257,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @throws {ArgumentTypeError} If any given argument type does not match the required parameter type. * @since 0.7.0 */ - public validFunctionCallArguments(func: KipperReferenceableFunction, args: Array): void { + public validFunctionCallArguments(func: ScopeFunctionDeclaration, args: Array): void { if (func.params.length != args.length) { throw this.assertError(new InvalidAmountOfArgumentsError(func.identifier, func.params.length, args.length)); } @@ -291,17 +283,17 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { const rightOpTypeData = semanticData.rightOp.getTypeSemanticData(); // Get the compile-types for the operands - const leftOpType = leftOpTypeData.evaluatedType.get(); - const rightOpType = rightOpTypeData.evaluatedType.get(); + const leftOpType = leftOpTypeData.evaluatedType; + const rightOpType = rightOpTypeData.evaluatedType; - // If either one of the types is undefined, skip type checking (the types are invalid anyway) - if (leftOpType === undefined || rightOpType === undefined) { + // If either one of the types can't be compiled or evaluated then we skip this step + if (!leftOpType.isCompilable || !rightOpType.isCompilable) { return; } // Ensure that both expressions are of type 'num' - if (leftOpType !== "num" || rightOpType !== "num") { - throw this.assertError(new InvalidRelationalComparisonTypeError(leftOpType, rightOpType)); + if (leftOpType !== BuiltInTypes.num || rightOpType !== BuiltInTypes.num) { + throw this.assertError(new InvalidRelationalComparisonTypeError(leftOpType.identifier, rightOpType.identifier)); } } @@ -318,16 +310,16 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { | UnaryExpressionSemantics | IncrementOrDecrementPostfixExpressionSemantics; const expTypeSemantics = semanticData.operand.getTypeSemanticData(); - const expType = expTypeSemantics.evaluatedType.get(); + const expType = expTypeSemantics.evaluatedType; - // If the expression type is undefined, skip type checking (the type is invalid anyway) - if (expType === undefined) { + // If the type is undefined, skip type checking (the type is invalid anyway) + if (!expType.isCompilable) { return; } // Ensure that the operator '+', '-', '++' and '--' are only used on numbers - if (semanticData.operator !== "!" && expType !== "num") { - throw this.assertError(new InvalidUnaryExpressionTypeError(semanticData.operator, expType)); + if (semanticData.operator !== "!" && expType !== BuiltInTypes.num) { + throw this.assertError(new InvalidUnaryExpressionTypeError(semanticData.operator, expType.identifier)); } // Ensure that the operand of an '++' and '--' modifier expression is a reference @@ -360,8 +352,8 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { */ public validArithmeticExpression(leftOp: Expression, rightOp: Expression, op: KipperArithmeticOperator): void { // Get the compile-types for both operands - const leftOpType = leftOp.getTypeSemanticData().evaluatedType.get(); - const rightOpType = rightOp.getTypeSemanticData().evaluatedType.get(); + const leftOpType = leftOp.getTypeSemanticData().evaluatedType; + const rightOpType = rightOp.getTypeSemanticData().evaluatedType; // If either one of the types is undefined, skip type checking (the types are invalid anyway) if (leftOpType === undefined || rightOpType === undefined) { @@ -369,19 +361,23 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { } // Numbers may use all arithmetic operators - if (leftOpType !== "num" || rightOpType !== "num") { + if (leftOpType !== BuiltInTypes.num || rightOpType !== BuiltInTypes.num) { // Strings can use '+' to concat strings - if (op === kipperPlusOperator && leftOpType == kipperStrTypeLiteral && rightOpType == kipperStrTypeLiteral) { + if (op === kipperPlusOperator && leftOpType == BuiltInTypes.str && rightOpType == BuiltInTypes.str) { return; } // Strings can use * to repeat a string n times - if (op === kipperMultiplicativeOperators[0] && leftOpType == kipperStrTypeLiteral && rightOpType == "num") { + if ( + op === kipperMultiplicativeOperators[0] && + leftOpType == BuiltInTypes.str && + rightOpType == BuiltInTypes.num + ) { return; } // If types are not matching, not numeric, and they are not of string-like types, throw an error - throw this.assertError(new ArithmeticOperationTypeError(leftOpType, rightOpType)); + throw this.assertError(new ArithmeticOperationTypeError(leftOpType.identifier, rightOpType.identifier)); } } @@ -394,17 +390,17 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @since 0.11.0 */ public validBitwiseExpression(leftOp: Expression, rightOp: Expression, op: KipperBitwiseOperator): void { - const leftOpType = leftOp.getTypeSemanticData().evaluatedType.get(); - const rightOpType = rightOp.getTypeSemanticData().evaluatedType.get(); + const leftOpType = leftOp.getTypeSemanticData().evaluatedType; + const rightOpType = rightOp.getTypeSemanticData().evaluatedType; // If either one of the types is undefined, skip type checking (the types are invalid anyway) - if (leftOpType === undefined || rightOpType === undefined) { + if (!leftOpType.isCompilable || !rightOpType.isCompilable) { return; } // Ensure that both expressions are of type 'num' - if (leftOpType !== "num" || rightOpType !== "num") { - throw this.assertError(new BitwiseOperationTypeError(leftOpType, rightOpType)); + if (leftOpType !== BuiltInTypes.num || rightOpType !== BuiltInTypes.num) { + throw this.assertError(new BitwiseOperationTypeError(leftOpType.identifier, rightOpType.identifier)); } } @@ -417,23 +413,28 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { */ public validConversion(operand: Expression, targetType: ProcessedType): void { // Get the compile-types for the specified conversion types - const originalCompileType = operand.getTypeSemanticData().evaluatedType.get(); - const targetCompileType = targetType.get(); + const originalCompileType = operand.getTypeSemanticData().evaluatedType; + const targetCompileType = targetType; // If either one of the types is undefined, skip type checking (the types are invalid anyway) - if (originalCompileType === undefined || targetCompileType === undefined) { + if (!originalCompileType.isCompilable || !targetCompileType.isCompilable) { return; } - // Check whether a supported pair of types exist. + // Return early if the types are the same + if (originalCompileType === targetCompileType) { + return; + } + + // Check whether a supported pair of types exist const viableConversion = kipperSupportedConversions.find( - (types) => types[0] === originalCompileType && types[1] === targetType.rawType, + (types) => BuiltInTypes[types[0]] === originalCompileType && BuiltInTypes[types[1]] === targetType, ) !== undefined; - - // In case that the targetType are not the same and no conversion is possible, throw an error! - if (originalCompileType !== targetCompileType && !viableConversion) { - throw this.assertError(new InvalidConversionTypeError(originalCompileType, targetCompileType)); + if (!viableConversion) { + throw this.assertError( + new InvalidConversionTypeError(originalCompileType.identifier, targetCompileType.identifier), + ); } } @@ -479,7 +480,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { public validReturnCodePathsInFunctionBody(func: FunctionDeclaration): void { const semanticData = func.getSemanticData(); const typeData = func.getTypeSemanticData(); - const returnType = typeData.returnType.get(); + const returnType = typeData.returnType; // If the return type is undefined, skip type checking (the type is invalid anyway) if (returnType === undefined) { @@ -489,7 +490,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { // If the function return type is not 'void' then there must be a return statement in all code paths // Note: We will ignore types here, since the return statements themselves with check later if they have the proper // return type. - if (returnType !== "void") { + if (returnType !== BuiltInTypes.void) { // Recursively check all code paths to ensure all return a value. const checkChildrenCodePaths = (parent: Statement): boolean => { let returnPathsCovered = false; @@ -560,7 +561,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @since 0.10.0 */ public objectLikeIsIndexableOrAccessible(objLike: Expression): void { - const objType = objLike.getTypeSemanticData().evaluatedType.get(); + const objType = objLike.getTypeSemanticData().evaluatedType; // If the obj type is undefined, skip type checking (the type is invalid anyway) if (objType === undefined) { @@ -568,8 +569,8 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { } // TODO! Add support for 'object' types once they are implemented - if (objType !== "str" && objType !== "list") { - throw this.assertError(new ValueNotIndexableTypeError(objType)); + if (objType !== BuiltInTypes.str && objType !== BuiltInTypes.list) { + throw this.assertError(new ValueNotIndexableTypeError(objType.identifier)); } } @@ -581,8 +582,8 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @since 0.10.0 */ public validBracketNotationKey(objLike: Expression, key: Expression): void { - const objType = objLike.getTypeSemanticData().evaluatedType.get(); - const keyType = key.getTypeSemanticData().evaluatedType.get(); + const objType = objLike.getTypeSemanticData().evaluatedType; + const keyType = key.getTypeSemanticData().evaluatedType; // If the obj or key type are undefined, skip type checking (the types are invalid anyway) if (objType === undefined || keyType === undefined) { @@ -590,8 +591,8 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { } // As currently only strings and lists are indexable, for now we only need to check for numeric indexes - if (keyType !== "num") { - throw this.assertError(new InvalidKeyTypeError(objType, keyType)); + if (keyType !== BuiltInTypes.num) { + throw this.assertError(new InvalidKeyTypeError(objType.identifier, keyType.identifier)); } } @@ -603,9 +604,9 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @since 0.10.0 */ public validSliceNotationKey(objLike: Expression, key: { start?: Expression; end?: Expression }): void { - const objType = objLike.getTypeSemanticData().evaluatedType.get(); - const startType = key.start ? key.start.getTypeSemanticData().evaluatedType.get() : undefined; - const endType = key.end ? key.end.getTypeSemanticData().evaluatedType.get() : undefined; + const objType = objLike.getTypeSemanticData().evaluatedType; + const startType = key.start ? key.start.getTypeSemanticData().evaluatedType : undefined; + const endType = key.end ? key.end.getTypeSemanticData().evaluatedType : undefined; // If the obj type is undefined, skip type checking (the type is invalid anyway) if (objType === undefined) { @@ -613,10 +614,10 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { } // As currently only strings and lists are indexable, for now we only need to check for numeric indexes - if (startType !== undefined && startType !== "num") { - throw this.assertError(new InvalidKeyTypeError(objType, startType), key.start); - } else if (endType !== undefined && endType !== "num") { - throw this.assertError(new InvalidKeyTypeError(objType, endType), key.end); + if (startType !== undefined && startType !== BuiltInTypes.num) { + throw this.assertError(new InvalidKeyTypeError(objType.identifier, startType.identifier), key.start); + } else if (endType !== undefined && endType !== BuiltInTypes.num) { + throw this.assertError(new InvalidKeyTypeError(objType.identifier, endType.identifier), key.end); } } @@ -632,7 +633,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { this.objectLikeIsIndexableOrAccessible(semanticData.objectLike); const preAnalysisType = semanticData.objectLike.getTypeSemanticData().evaluatedType; - const objType = preAnalysisType.get(); + const objType = preAnalysisType; // If the obj type is undefined, skip type checking (the type is invalid anyway) if (objType === undefined) { @@ -645,11 +646,11 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { new KipperNotImplementedError("Member access expression using dot notation is not implemented yet"), ); case "bracket": { - if (objType === "str") { + if (objType === BuiltInTypes.str) { // Also ensure the key is valid this.validBracketNotationKey(semanticData.objectLike, semanticData.propertyIndexOrKeyOrSlice); - return ProcessedType.fromCompilableType("str"); + return BuiltInTypes.str; } else { // Must be a list -> Not implemented yet throw this.notImplementedError( @@ -658,14 +659,14 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { } } case "slice": { - if (objType === "str") { + if (objType === BuiltInTypes.str) { // Also ensure the key is valid this.validSliceNotationKey( semanticData.objectLike, <{ start?: Expression; end?: Expression }>semanticData.propertyIndexOrKeyOrSlice, ); - return ProcessedType.fromCompilableType("str"); + return BuiltInTypes.str; } else { // Must be a list -> Not implemented yet throw this.notImplementedError( @@ -684,8 +685,8 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @since 0.11.0 */ validConditionalExpression(trueBranch: Expression, falseBranch: Expression) { - const trueBranchType = trueBranch.getTypeSemanticData().evaluatedType.get(); - const falseBranchType = falseBranch.getTypeSemanticData().evaluatedType.get(); + const trueBranchType = trueBranch.getTypeSemanticData().evaluatedType; + const falseBranchType = falseBranch.getTypeSemanticData().evaluatedType; // If the branch types are undefined, skip type checking (the types are invalid anyway) if (trueBranchType === undefined || falseBranchType === undefined) { diff --git a/kipper/core/src/compiler/semantics/runtime-internals/internals.ts b/kipper/core/src/compiler/semantics/runtime-internals/internals.ts index 3f0ecf0b8..c11082c68 100644 --- a/kipper/core/src/compiler/semantics/runtime-internals/internals.ts +++ b/kipper/core/src/compiler/semantics/runtime-internals/internals.ts @@ -1,4 +1,5 @@ import type { InternalFunction } from "./internal-function"; +import { BuiltInTypes } from "../symbol-table"; /** * Contains all the internal built-in functions, which are used by Kipper to provide internal functionality. These @@ -13,115 +14,115 @@ export const kipperInternalBuiltInFunctions = { params: [ { identifier: "value", - valueType: "num", + valueType: BuiltInTypes.num, }, ], - returnType: "str", + returnType: BuiltInTypes.str, }, boolToStr: { identifier: "boolToStr", params: [ { identifier: "value", - valueType: "bool", + valueType: BuiltInTypes.bool, }, ], - returnType: "str", + returnType: BuiltInTypes.str, }, voidToStr: { identifier: "voidToStr", params: [ { identifier: "value", - valueType: "void", + valueType: BuiltInTypes.void, }, ], - returnType: "str", + returnType: BuiltInTypes.str, }, nullToStr: { identifier: "nullToStr", params: [ { identifier: "value", - valueType: "null", + valueType: BuiltInTypes.null, }, ], - returnType: "str", + returnType: BuiltInTypes.str, }, undefinedToStr: { identifier: "undefinedToStr", params: [ { identifier: "value", - valueType: "undefined", + valueType: BuiltInTypes.undefined, }, ], - returnType: "str", + returnType: BuiltInTypes.str, }, strToNum: { identifier: "strToNum", params: [ { identifier: "value", - valueType: "str", + valueType: BuiltInTypes.str, }, ], - returnType: "num", + returnType: BuiltInTypes.num, }, boolToNum: { identifier: "boolToNum", params: [ { identifier: "value", - valueType: "bool", + valueType: BuiltInTypes.bool, }, ], - returnType: "num", + returnType: BuiltInTypes.num, }, slice: { identifier: "slice", params: [ { identifier: "objLike", - valueType: "str", // TODO: Implement this for all objLike types (At the moment only strings are supported) + valueType: BuiltInTypes.str, // TODO: Implement this for all objLike types (At the moment only strings are supported) }, { identifier: "start", - valueType: ["num", "undefined"], // Optional + valueType: [BuiltInTypes.num, BuiltInTypes.undefined], // Optional }, { identifier: "end", - valueType: ["num", "undefined"], // Optional + valueType: [BuiltInTypes.num, BuiltInTypes.undefined], // Optional }, ], - returnType: "str", // TODO: Implement this for all objLike types (At the moment only strings are supported) + returnType: BuiltInTypes.str, // TODO: Implement this for all objLike types (At the moment only strings are supported) }, index: { identifier: "index", params: [ { identifier: "arrayLike", - valueType: "str", // TODO: Implement this for all arrayLike types (At the moment only strings are supported) + valueType: BuiltInTypes.str, // TODO: Implement this for all arrayLike types (At the moment only strings are supported) }, { identifier: "indexOrKey", - valueType: "num", + valueType: BuiltInTypes.num, }, ], - returnType: "str", // TODO: Implement this for all arrayLike types (At the moment only strings are supported) + returnType: BuiltInTypes.str, // TODO: Implement this for all arrayLike types (At the moment only strings are supported) }, repeatString: { identifier: "repeatString", params: [ { identifier: "toRepeat", - valueType: "str", + valueType: BuiltInTypes.str, }, { identifier: "times", - valueType: "num", + valueType: BuiltInTypes.num, }, ], - returnType: "str", + returnType: BuiltInTypes.str, }, } satisfies Record; diff --git a/kipper/core/src/compiler/semantics/symbol-table/base/scope.ts b/kipper/core/src/compiler/semantics/symbol-table/base/scope.ts index 4ec11d4e7..21d83158e 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/base/scope.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/base/scope.ts @@ -2,7 +2,6 @@ * A symbol-table implementation in form of a scope that may contain both variables and functions. * @since 0.8.0 */ -import type { FunctionDeclaration, TypeDeclaration, VariableDeclaration } from "../../../ast"; import type { ScopeDeclaration, ScopeFunctionDeclaration, @@ -10,7 +9,6 @@ import type { ScopeVariableDeclaration, } from "../entry"; import type { SymbolTable } from "./symbol-table"; -import { BuiltInType } from "../../types"; /** * A scope in a Kipper program, which can contain {@link ScopeVariableDeclaration variables}, diff --git a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-declaration.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-declaration.ts index 197fc08bb..3b4635df7 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-declaration.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-declaration.ts @@ -4,7 +4,8 @@ */ import type { Declaration } from "../../../ast"; import type { KipperProgramContext } from "../../../program-ctx"; -import type { ProcessedType } from "../../types"; +import type { BuiltInType, ProcessedType } from "../../types"; +import type { BuiltInFunction, BuiltInVariable } from "../../runtime-built-ins"; /** * An symbol table entry of a variable, parameter or function declaration inside a Kipper scope. @@ -16,7 +17,6 @@ import type { ProcessedType } from "../../types"; */ export abstract class ScopeDeclaration { public abstract get node(): Declaration | undefined; - public abstract get identifier(): string; /** @@ -26,6 +26,18 @@ export abstract class ScopeDeclaration { return this.node?.programCtx; } + /** + * Returns whether this declaration is a built-in declaration. + * @since 0.11.0 + */ + public abstract get isBuiltIn(): boolean; + + /** + * Returns the built-in structure of this declaration, if this declaration is based on one. + * @since 0.11.0 + */ + public abstract get builtInStructure(): BuiltInVariable | BuiltInFunction | BuiltInType | undefined; + /** * The value type of this declaration. * @since 0.10.0 diff --git a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-function-declaration.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-function-declaration.ts index bcbb5fdd0..b9ffbd055 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-function-declaration.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-function-declaration.ts @@ -11,6 +11,7 @@ import type { import { ScopeDeclaration } from "./scope-declaration"; import type { ProcessedType } from "../../types"; import type { BuiltInFunction, BuiltInFunctionArgument } from "../../runtime-built-ins"; +import type { UniverseScope } from "../universum-scope"; import { BuiltInTypes } from "../universum-scope"; /** @@ -18,13 +19,12 @@ import { BuiltInTypes } from "../universum-scope"; * @since 0.1.2 */ export class ScopeFunctionDeclaration extends ScopeDeclaration { - private readonly _declaration?: FunctionDeclaration; - private readonly _builtInFunction?: BuiltInFunction; - - private constructor(declaration?: FunctionDeclaration, builtInFunction?: BuiltInFunction) { + private constructor( + private readonly _declaration?: FunctionDeclaration, + private readonly _builtInFunction?: BuiltInFunction, + private readonly _universeScope?: UniverseScope, + ) { super(); - this._declaration = declaration; - this._builtInFunction = builtInFunction; } /** @@ -39,8 +39,24 @@ export class ScopeFunctionDeclaration extends ScopeDeclaration { * Creates a new scope function declaration from a function declaration. * @param declaration The function declaration node. */ - static fromBuiltInFunction(declaration: BuiltInFunction): ScopeFunctionDeclaration { - return new ScopeFunctionDeclaration(undefined, declaration); + static fromBuiltInFunction(declaration: BuiltInFunction, universeScope: UniverseScope): ScopeFunctionDeclaration { + return new ScopeFunctionDeclaration(undefined, declaration, universeScope); + } + + /** + * Returns whether this function declaration is a built-in function. + * @since 0.11.0 + */ + public override get isBuiltIn(): boolean { + return this._builtInFunction !== undefined; + } + + /** + * Returns the built-in structure of this declaration, if this declaration is based on one. + * @since 0.11.0 + */ + public override get builtInStructure(): BuiltInFunction | undefined { + return this._builtInFunction; } /** @@ -87,7 +103,14 @@ export class ScopeFunctionDeclaration extends ScopeDeclaration { * The return type of this function. This can be every {@link KipperType} except {@link KipperFuncType}. */ public get returnType(): ProcessedType { - return this.typeData?.returnType ?? BuiltInTypes.void; + return this.typeData?.returnType ?? this._builtInFunction?.returnType!!; + } + + /** + * Returns the scope associated with this {@link ScopeDeclaration}. + */ + public get scope() { + return this._declaration?.scope ?? this._universeScope!!; } /** diff --git a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts index 4877083cd..ca38b649c 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts @@ -9,7 +9,8 @@ import type { ParameterDeclarationSemantics, ParameterDeclarationTypeSemantics, } from "../../../ast"; -import type { LocalScope } from "../index"; +import type { FunctionScope } from "../index"; +import { LocalScope } from "../index"; import { BuiltInTypes } from "../index"; import type { ProcessedType } from "../../types"; @@ -33,6 +34,26 @@ export class ScopeParameterDeclaration extends ScopeDeclaration { return new ScopeParameterDeclaration(node); } + /** + * Returns whether this parameter declaration is a built-in declaration. + * + * This will always be false, since a parameter declaration is never a built-in declaration. + * @since 0.11.0 + */ + public override get isBuiltIn(): false { + return false; + } + + /** + * Returns the built-in structure of this declaration, if this declaration is based on one. + * + * This will always be undefined, since a parameter declaration is never a built-in declaration. + * @since 0.11.0 + */ + public override get builtInStructure(): undefined { + return undefined; + } + /** * The semantic data of this declaration. * @throws UndefinedSemanticsError If this is accessed, before semantic analysis was performed. @@ -81,7 +102,7 @@ export class ScopeParameterDeclaration extends ScopeDeclaration { * Returns the scope associated with this {@link ScopeDeclaration}. * @since 0.10.0 */ - public get scope(): LocalScope { + public get scope(): FunctionScope { return this.func.innerScope; } diff --git a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts index 75bde1996..80d4b6a46 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-type-declaration.ts @@ -5,8 +5,7 @@ import { ScopeDeclaration } from "./scope-declaration"; import type { TypeDeclaration, TypeDeclarationSemantics } from "../../../ast"; import type { BuiltInType, CustomType, ProcessedType } from "../../types"; -import { Type } from "../../types"; -import { KipperNotImplementedError } from "../../../../errors"; +import type { UniverseScope } from "../universum-scope"; import { BuiltInTypes } from "../universum-scope"; /** @@ -14,14 +13,12 @@ import { BuiltInTypes } from "../universum-scope"; * @since 0.11.0 */ export class ScopeTypeDeclaration extends ScopeDeclaration { - private readonly _node?: TypeDeclaration; - private readonly _builtInType?: ProcessedType; - - private constructor(declaration?: TypeDeclaration, builtInType?: BuiltInType) { + private constructor( + private readonly _declaration?: TypeDeclaration, + private readonly _builtInType?: BuiltInType, + private readonly _universeScope?: UniverseScope, + ) { super(); - - this._node = declaration; - this._builtInType = builtInType; } /** @@ -36,10 +33,27 @@ export class ScopeTypeDeclaration extends ScopeDeclaration { /** * Creates a new scope type declaration from a built-in type. * @param identifier The identifier of the built-in type. + * @param universeScope The universe scope this type is associated with. + * @since 0.11.0 + */ + public static fromBuiltInType(type: BuiltInType, universeScope: UniverseScope): ScopeTypeDeclaration { + return new ScopeTypeDeclaration(undefined, type, universeScope); + } + + /** + * Returns whether this type declaration is a built-in type. + * @since 0.11.0 + */ + public override get isBuiltIn(): boolean { + return this._builtInType !== undefined; + } + + /** + * Returns the built-in structure of this declaration, if this declaration is based on one. * @since 0.11.0 */ - public static fromBuiltInType(type: BuiltInType): ScopeTypeDeclaration { - return new ScopeTypeDeclaration(undefined, type); + public override get builtInStructure(): BuiltInType | undefined { + return this._builtInType; } /** @@ -48,14 +62,14 @@ export class ScopeTypeDeclaration extends ScopeDeclaration { * @private */ private get semanticData(): TypeDeclarationSemantics | undefined { - return this._node?.getSemanticData(); + return this._declaration?.getSemanticData(); } /** * Returns the {@link InterfaceDeclaration} or {@link ClassDeclaration AST node} this scope type declaration bases on. */ public get node(): TypeDeclaration | undefined { - return this._node; + return this._declaration; } /** @@ -92,6 +106,13 @@ export class ScopeTypeDeclaration extends ScopeDeclaration { return false; } + /** + * Returns the scope associated with this {@link ScopeDeclaration}. + */ + public get scope() { + return this._declaration?.scope ?? this._universeScope!!; + } + /** * Returns whether the declaration has a value. * diff --git a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts index 28c30b045..ccffe7131 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts @@ -4,6 +4,7 @@ */ import type { VariableDeclaration, VariableDeclarationSemantics, VariableDeclarationTypeSemantics } from "../../../ast"; import type { KipperStorageType } from "../../../const"; +import type { UniverseScope } from "../index"; import { BuiltInTypes } from "../index"; import type { ProcessedType } from "../../types"; import { ScopeDeclaration } from "./scope-declaration"; @@ -14,19 +15,14 @@ import type { BuiltInVariable } from "../../runtime-built-ins"; * @since 0.1.0 */ export class ScopeVariableDeclaration extends ScopeDeclaration { - private readonly _declaration?: VariableDeclaration; - private readonly _builtInVariable?: BuiltInVariable; + private _valueWasUpdated: boolean = false; - /** - * Returns whether the variable has been updated after its initial declaration. - * @since 0.10.0 - */ - public valueWasUpdated: boolean = false; - - public constructor(declaration?: VariableDeclaration, builtInVariable?: BuiltInVariable) { + public constructor( + private readonly _declaration?: VariableDeclaration, + private readonly _builtInVariable?: BuiltInVariable, + private readonly _universeScope?: UniverseScope, + ) { super(); - this._declaration = declaration; - this._builtInVariable = builtInVariable; } /** @@ -40,9 +36,29 @@ export class ScopeVariableDeclaration extends ScopeDeclaration { /** * Creates a new scope variable declaration from a built-in variable. * @param builtInVariable The built-in variable. + * @param universeScope The universe scope this variable is associated with. + */ + public static fromBuiltInVariable( + builtInVariable: BuiltInVariable, + universeScope: UniverseScope, + ): ScopeVariableDeclaration { + return new ScopeVariableDeclaration(undefined, builtInVariable, universeScope); + } + + /** + * Returns whether this variable declaration is a built-in declaration. + * @since 0.11.0 + */ + public override get isBuiltIn(): boolean { + return this._builtInVariable !== undefined; + } + + /** + * Returns the built-in structure of this declaration, if this declaration is based on one. + * @since 0.11.0 */ - public static fromBuiltInVariable(builtInVariable: BuiltInVariable): ScopeVariableDeclaration { - return new ScopeVariableDeclaration(undefined, builtInVariable); + public override get builtInStructure(): BuiltInVariable | undefined { + return this._builtInVariable; } /** @@ -95,7 +111,7 @@ export class ScopeVariableDeclaration extends ScopeDeclaration { * Returns the scope associated with this {@link ScopeDeclaration}. */ public get scope() { - return this.semanticData?.scope ?? this._builtInVariable!!.scope; + return this._declaration?.scope ?? this._universeScope!!; } /** @@ -105,6 +121,24 @@ export class ScopeVariableDeclaration extends ScopeDeclaration { return this.semanticData?.isDefined ?? true; } + /** + * Returns whether the value of the variable was updated after the initial declaration. + * @since 0.10.0 + */ + public get valueWasUpdated(): boolean { + return this._valueWasUpdated; + } + + /** + * Notifies the declaration that the value was updated. + * + * Sets the {@link valueWasUpdated} property to true. + * @since 0.11.0 + */ + public notifyOfUpdate() { + this._valueWasUpdated = true; + } + /** * Returns whether the variable declaration has a value. * @@ -113,7 +147,7 @@ export class ScopeVariableDeclaration extends ScopeDeclaration { * @since 0.10.0 */ public get hasValue(): boolean { - return this.isDefined ?? this.valueWasUpdated; + return this.isDefined || this.valueWasUpdated; } /** diff --git a/kipper/core/src/compiler/semantics/symbol-table/function-scope.ts b/kipper/core/src/compiler/semantics/symbol-table/function-scope.ts index ba46d067e..d4e009ff6 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/function-scope.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/function-scope.ts @@ -59,18 +59,4 @@ export class FunctionScope extends LocalScope { public override getEntry(identifier: string): ScopeDeclaration | undefined { return this.getArgument(identifier) ?? this.entries.get(identifier); } - - public override getEntryRecursively(identifier: string): ScopeDeclaration | undefined { - const localRef = this.getEntry(identifier); - if (!localRef) { - // If the scope of the ctx (Compound statement) is another local scope, then go upwards recursively again. - if (this.ctx.scope instanceof LocalScope) { - return this.ctx.scope.getEntryRecursively(identifier); - } else { - // Fetching from the global scope - return this.ctx.scope.getEntry(identifier); - } - } - return localRef; - } } diff --git a/kipper/core/src/compiler/semantics/symbol-table/global-scope.ts b/kipper/core/src/compiler/semantics/symbol-table/global-scope.ts index 1d273a05b..913df1ca1 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/global-scope.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/global-scope.ts @@ -8,6 +8,7 @@ import type { ScopeDeclaration } from "./entry"; import type { FunctionDeclaration, RootASTNode, TypeDeclaration, VariableDeclaration } from "../../ast"; import { ScopeFunctionDeclaration, ScopeTypeDeclaration, ScopeVariableDeclaration } from "./entry"; import { Scope } from "./base/scope"; +import type { UniverseScope } from "./universum-scope"; /** * The global scope of a {@link KipperProgramContext}, which contains the global variables and functions of a @@ -15,7 +16,7 @@ import { Scope } from "./base/scope"; * @since 0.8.0 */ export class GlobalScope extends Scope { - constructor(public ctx: RootASTNode) { + constructor(public readonly ctx: RootASTNode, public readonly universe: UniverseScope) { super(); } @@ -23,7 +24,7 @@ export class GlobalScope extends Scope { * @since 0.11.0 */ public addVariable(declaration: BuiltInVariable): ScopeVariableDeclaration { - const scopeDeclaration = ScopeVariableDeclaration.fromBuiltInVariable(declaration); + const scopeDeclaration = ScopeVariableDeclaration.fromBuiltInVariable(declaration, this); this.entries.set(scopeDeclaration.identifier, scopeDeclaration); return scopeDeclaration; } @@ -102,7 +102,7 @@ export class UniverseScope extends Scope { * @since 0.11.0 */ public addFunction(declaration: BuiltInFunction): ScopeFunctionDeclaration { - const scopeDeclaration = ScopeFunctionDeclaration.fromBuiltInFunction(declaration); + const scopeDeclaration = ScopeFunctionDeclaration.fromBuiltInFunction(declaration, this); this.entries.set(scopeDeclaration.identifier, scopeDeclaration); return scopeDeclaration; } @@ -114,7 +114,7 @@ export class UniverseScope extends Scope { * @since 0.11.0 */ public addType(declarationOrIdentifier: BuiltInType): ScopeTypeDeclaration { - const scopeDeclaration = ScopeTypeDeclaration.fromBuiltInType(declarationOrIdentifier); + const scopeDeclaration = ScopeTypeDeclaration.fromBuiltInType(declarationOrIdentifier, this); this.entries.set(scopeDeclaration.identifier, scopeDeclaration); return scopeDeclaration; } @@ -125,7 +125,7 @@ export class UniverseScope extends Scope { * @returns The scope declaration if it exists, otherwise `undefined`. * @since 0.11.0 */ - getEntry(identifier: string): ScopeDeclaration | undefined { + public getEntry(identifier: string): ScopeDeclaration | undefined { return this.entries.get(identifier); } @@ -135,7 +135,23 @@ export class UniverseScope extends Scope { * @returns The scope declaration if it exists, otherwise `undefined`. * @since 0.11.0 */ - getEntryRecursively(identifier: string): ScopeDeclaration | undefined { + public getEntryRecursively(identifier: string): ScopeDeclaration | undefined { return this.getEntry(identifier); } + + /** + * DANGEROUS METHOD! Clears all the universal functions and create dangling references. + * @since 0.11.0 + */ + public clearUniversalFunctions(): void { + this.entries.clear(); + } + + /** + * DANGEROUS METHOD! Clears all the universal variables and create dangling references. + * @since 0.11.0 + */ + public clearUniversalVariables(): void { + this.entries.clear(); + } } diff --git a/kipper/core/src/compiler/semantics/types/built-in-type.ts b/kipper/core/src/compiler/semantics/types/built-in-type.ts index 9a3553eef..aa22989f7 100644 --- a/kipper/core/src/compiler/semantics/types/built-in-type.ts +++ b/kipper/core/src/compiler/semantics/types/built-in-type.ts @@ -1,6 +1,5 @@ import { ProcessedType } from "./base/processed-type"; import type { KipperBuiltInTypeLiteral } from "../../const"; -import { kipperBuiltInTypeLiterals } from "../../const"; import { KipperNotImplementedError } from "../../../errors"; import type { CompilableType } from "./base/compilable-type"; @@ -13,7 +12,6 @@ export class BuiltInType extends ProcessedType implements CompilableType { public constructor(identifier: KipperBuiltInTypeLiteral) { super(identifier, true); - throw new KipperNotImplementedError("Built-in type wrapper classes are not implement yet"); } public get isCompilable(): true { diff --git a/kipper/core/src/compiler/semantics/types/custom-type.ts b/kipper/core/src/compiler/semantics/types/custom-type.ts index e460b518a..b7469c7f2 100644 --- a/kipper/core/src/compiler/semantics/types/custom-type.ts +++ b/kipper/core/src/compiler/semantics/types/custom-type.ts @@ -1,4 +1,3 @@ -import type { KipperBuiltInTypeLiteral } from "../../const"; import { ProcessedType } from "./base"; export type CustomTypeKind = "interface" | "class"; diff --git a/kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts b/kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts index 1a3274c86..da9b95b59 100644 --- a/kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts +++ b/kipper/core/src/compiler/target-presets/translation/built-ins-generator.ts @@ -3,8 +3,9 @@ * @since 0.10.0 */ import type { TranslatedCodeLine } from "../../const"; -import type { BuiltInFunction, BuiltInVariable, InternalFunction } from "../../semantics/runtime-built-ins"; +import type { BuiltInFunction, BuiltInVariable } from "../../semantics"; import type { KipperProgramContext } from "../../program-ctx"; +import type { InternalFunction } from "../../semantics"; /** * Generator for the Kipper built-ins that are specific for a target. diff --git a/kipper/target-js/src/code-generator.ts b/kipper/target-js/src/code-generator.ts index 18f9e2e9c..17cf7f2c6 100644 --- a/kipper/target-js/src/code-generator.ts +++ b/kipper/target-js/src/code-generator.ts @@ -57,6 +57,7 @@ import type { InterfaceDeclaration, ClassDeclaration, } from "@kipper/core"; +import { BuiltInTypes } from "@kipper/core"; import { VariableDeclaration, CompoundStatement, @@ -437,14 +438,11 @@ export class JavaScriptTargetCodeGenerator extends KipperTargetCodeGenerator { * Translates a {@link IdentifierPrimaryExpression} into the JavaScript language. */ identifierPrimaryExpression = async (node: IdentifierPrimaryExpression): Promise => { - const semanticData = node.getSemanticData(); - let identifier: string = semanticData.identifier; + const refTarget = node.getSemanticData().ref.refTarget; + let identifier: string = refTarget.isBuiltIn + ? TargetJS.getBuiltInIdentifier(refTarget.builtInStructure!!) + : refTarget.identifier; - // If the identifier is not declared by the user, assume it's a built-in function and format the identifier - // accordingly. - if (!(semanticData.ref.refTarget instanceof ScopeDeclaration)) { - identifier = TargetJS.getBuiltInIdentifier(semanticData.ref.refTarget); - } return [identifier]; }; @@ -580,8 +578,7 @@ export class JavaScriptTargetCodeGenerator extends KipperTargetCodeGenerator { const func = node.getTypeSemanticData().func; // Get the proper identifier for the function - const identifier = - func instanceof ScopeFunctionDeclaration ? func.identifier : TargetJS.getBuiltInIdentifier(func.identifier); + const identifier = func.isBuiltIn ? TargetJS.getBuiltInIdentifier(func.builtInStructure!!) : func.identifier; // Generate the arguments let args: TranslatedExpression = []; @@ -637,7 +634,9 @@ export class JavaScriptTargetCodeGenerator extends KipperTargetCodeGenerator { // If both types are the same we will only return the translated expression to avoid useless conversions. return exp; } else { - const func: string = TargetJS.getBuiltInIdentifier(getConversionFunctionIdentifier(originalType, destType)); + const func: string = TargetJS.getBuiltInIdentifier( + getConversionFunctionIdentifier(originalType.identifier, destType.identifier), + ); return [func, "(", ...exp, ")"]; } }; @@ -654,7 +653,7 @@ export class JavaScriptTargetCodeGenerator extends KipperTargetCodeGenerator { const exp2: TranslatedExpression = await semanticData.rightOp.translateCtxAndChildren(); // In this case it should be a string multiplication - if (semanticData.leftOp.getTypeSemanticData().evaluatedType.getCompilableType() === "str") { + if (semanticData.leftOp.getTypeSemanticData().evaluatedType === BuiltInTypes.str) { return [stringRepeatFunction, "(", ...exp1, ", ", ...exp2, ")"]; } @@ -773,15 +772,10 @@ export class JavaScriptTargetCodeGenerator extends KipperTargetCodeGenerator { */ assignmentExpression = async (node: AssignmentExpression): Promise => { const semanticData = node.getSemanticData(); - let identifier = semanticData.identifier; - - // If the identifier is not found in the global scope, assume it's a built-in function and format the identifier - // accordingly. - if (!(semanticData.assignTarget.refTarget instanceof ScopeDeclaration)) { - identifier = TargetJS.getBuiltInIdentifier(identifier); - } - - // The expression that is assigned to the reference + const refTarget = semanticData.assignTarget.refTarget; + const identifier = refTarget.isBuiltIn + ? TargetJS.getBuiltInIdentifier(refTarget.builtInStructure!!) + : refTarget.identifier; const assignExp = await semanticData.value.translateCtxAndChildren(); return [identifier, " ", semanticData.operator, " ", ...assignExp]; diff --git a/kipper/target-js/src/target.ts b/kipper/target-js/src/target.ts index 64f9a617c..5bddeedb1 100644 --- a/kipper/target-js/src/target.ts +++ b/kipper/target-js/src/target.ts @@ -4,7 +4,8 @@ * @copyright 2021-2022 Luna Klatzer * @since 0.10.0 */ -import type { BuiltInFunction, BuiltInVariable } from "@kipper/core"; +import type { BuiltInFunction, BuiltInType } from "@kipper/core"; +import { BuiltInVariable } from "@kipper/core"; import { KipperCompileTarget } from "@kipper/core"; import { JavaScriptTargetSemanticAnalyser } from "./semantic-analyser"; import { JavaScriptTargetCodeGenerator } from "./code-generator"; @@ -99,16 +100,16 @@ export class KipperJavaScriptTarget extends KipperCompileTarget { /** * Fetches the reserved identifier for the translated code. * - * This will also ensure that {@link BuiltInVariable.local local variables} are not registered onto the global object. + * This will also ensure that {@link BuiltInVariable local variables} are not registered onto the global object. * Those will simply stay as local variables with the same identifier. * @param signature The identifier or signature object to translate to its JavaScript form. * @since 0.10.0 */ - public static getBuiltInIdentifier(signature: string | BuiltInVariable | BuiltInFunction): string { + public static getBuiltInIdentifier(signature: string | BuiltInVariable | BuiltInFunction | BuiltInType): string { if (typeof signature === "string") { return `${this.internalObjectIdentifier}.${signature}`; } - return "local" in signature && signature.local + return signature instanceof BuiltInVariable && signature.local ? signature.identifier : this.getBuiltInIdentifier(signature.identifier); } diff --git a/kipper/target-ts/src/built-in-generator.ts b/kipper/target-ts/src/built-in-generator.ts index bafdb7be3..d5b3f8c57 100644 --- a/kipper/target-ts/src/built-in-generator.ts +++ b/kipper/target-ts/src/built-in-generator.ts @@ -19,8 +19,8 @@ import { TargetTS } from "./target"; export function genTSFunction( signature: { identifier: string; - params: Array<{ identifier: string; type: KipperBuiltInTypeLiteral | Array }>; - returnType: KipperBuiltInTypeLiteral | Array; + params: Array<{ identifier: string; type: string | Array }>; + returnType: string | Array; }, body: string, ignoreParams: boolean = false, @@ -50,7 +50,7 @@ export function genTSVariable(varSpec: BuiltInVariable, value: string): Translat TargetTS.getBuiltInIdentifier(varSpec), ":", " ", - TargetTS.getTypeScriptType(varSpec.valueType), + TargetTS.getTypeScriptType(varSpec.valueType.identifier), " ", "=", " ", diff --git a/kipper/target-ts/src/code-generator.ts b/kipper/target-ts/src/code-generator.ts index 49283d8ad..57bc71f8c 100644 --- a/kipper/target-ts/src/code-generator.ts +++ b/kipper/target-ts/src/code-generator.ts @@ -35,7 +35,7 @@ export class TypeScriptTargetCodeGenerator extends JavaScriptTargetCodeGenerator const typeData = node.getTypeSemanticData(); const storage = semanticData.storageType === "const" ? "const" : "let"; - const tsType = TargetTS.getTypeScriptType(typeData.valueType.getCompilableType()); + const tsType = TargetTS.getTypeScriptType(typeData.valueType.identifier); const assign = semanticData.value ? await semanticData.value.translateCtxAndChildren() : []; // Only add ' = EXP' if assignValue is defined diff --git a/kipper/target-ts/src/target.ts b/kipper/target-ts/src/target.ts index 3efa77f6a..2e41465f6 100644 --- a/kipper/target-ts/src/target.ts +++ b/kipper/target-ts/src/target.ts @@ -63,7 +63,7 @@ export class KipperTypeScriptTarget extends KipperCompileTarget { * @param kipperType The type to get the equivalent for. * @since 0.8.0 */ - public static getTypeScriptType(kipperType: KipperBuiltInTypeLiteral | Array): string { + public static getTypeScriptType(kipperType: T | Array): string { if (Array.isArray(kipperType)) { // Recursively call this function for each type in the array return `${kipperType.map(this.getTypeScriptType).join(" | ")}`; diff --git a/kipper/target-ts/src/tools.ts b/kipper/target-ts/src/tools.ts index 11704bc79..0fcc89918 100644 --- a/kipper/target-ts/src/tools.ts +++ b/kipper/target-ts/src/tools.ts @@ -19,8 +19,8 @@ import { TargetTS } from "./target"; */ export function getTSFunctionSignature(funcSpec: InternalFunction | BuiltInFunction | FunctionDeclaration): { identifier: string; - params: Array<{ identifier: string; type: KipperBuiltInTypeLiteral | Array }>; - returnType: KipperBuiltInTypeLiteral | Array; + params: Array<{ identifier: string; type: string | Array }>; + returnType: string | Array; } { if ("antlrRuleCtx" in funcSpec) { const semanticData = funcSpec.getSemanticData(); @@ -31,18 +31,21 @@ export function getTSFunctionSignature(funcSpec: InternalFunction | BuiltInFunct params: semanticData.params.map((param) => { return { identifier: param.getSemanticData().identifier, - type: param.getTypeSemanticData().valueType.getCompilableType(), + type: param.getTypeSemanticData().valueType.identifier, }; }), - returnType: typeData.returnType.getCompilableType(), + returnType: typeData.returnType.identifier, }; } else { return { identifier: funcSpec.identifier, params: funcSpec.params.map((arg: BuiltInFunctionArgument | InternalFunctionArgument) => { - return { identifier: arg.identifier, type: arg.valueType }; + return { + identifier: arg.identifier, + type: Array.isArray(arg.valueType) ? arg.valueType.map((t) => t.identifier) : arg.valueType.identifier, + }; }), - returnType: funcSpec.returnType, + returnType: funcSpec.returnType.identifier, }; } } @@ -56,8 +59,8 @@ export function getTSFunctionSignature(funcSpec: InternalFunction | BuiltInFunct export function createTSFunctionSignature( signature: { identifier: string; - params: Array<{ identifier: string; type: KipperBuiltInTypeLiteral | Array }>; - returnType: KipperBuiltInTypeLiteral | Array; + params: Array<{ identifier: string; type: string | Array }>; + returnType: string | Array; }, ignoreParams: boolean = false, ): string { diff --git a/test/kipper-files/main.kip b/test/kipper-files/main.kip index 81461db02..a6b34cf37 100644 --- a/test/kipper-files/main.kip +++ b/test/kipper-files/main.kip @@ -2,7 +2,7 @@ var y: num = 4; var x: num = 4; const z: num = 3333 + x + y; -def func() -> num { +def fun() -> num { // Basic definitions of variables var localX: str = "string"; var localY: str = localX + localX; @@ -14,4 +14,4 @@ def func() -> num { return 1; } -call func(); +call fun(); diff --git a/test/kipper-files/nested-scopes.kip b/test/kipper-files/nested-scopes.kip index 97d1e1871..40bba978f 100644 --- a/test/kipper-files/nested-scopes.kip +++ b/test/kipper-files/nested-scopes.kip @@ -2,7 +2,7 @@ var x: bool; var y: num = 4; const z: str = "1"; -def func() -> void { +def fun() -> void { { var rx: bool; var ry: num = 5 * y; diff --git a/test/kipper-files/single-function-definition.kip b/test/kipper-files/single-function-definition.kip index 1582912f0..dea586b70 100644 --- a/test/kipper-files/single-function-definition.kip +++ b/test/kipper-files/single-function-definition.kip @@ -1,4 +1,4 @@ -def func() -> void { +def fun() -> void { { { var lx: bool; diff --git a/test/module/core/compiler.test.ts b/test/module/core/compiler.test.ts index 78b39c1f2..f41d8712d 100644 --- a/test/module/core/compiler.test.ts +++ b/test/module/core/compiler.test.ts @@ -294,7 +294,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.universeScope.entries.size, 4, "Expected four global scope entries"); + assert.equal(result.programCtx!!.globalScope!!.entries.size, 4, "Expected four global scope entries"); }); it(`Arithmetics [${target.fileExtension}]`, async () => { @@ -304,7 +304,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.universeScope.entries.size, 0, "Expected no global scope entries"); + assert.equal(result.programCtx!!.globalScope!!.entries.size, 0, "Expected no global scope entries"); assert.include(result.write(), fileContent, "Expected compiled code to not change"); }); @@ -315,7 +315,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.universeScope.entries.size, 1, "Expected one global scope entry"); + assert.equal(result.programCtx!!.globalScope!!.entries.size, 1, "Expected one global scope entry"); }); it(`Nested scopes [${target.fileExtension}]`, async () => { @@ -325,7 +325,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.universeScope.entries.size, 4, "Expected four global scope entries"); + assert.equal(result.programCtx!!.globalScope!!.entries.size, 4, "Expected four global scope entries"); }); it(`Single Function call [${target.fileExtension}]`, async () => { @@ -335,7 +335,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.universeScope.entries.size, 0, "Expected no global scope entries"); + assert.equal(result.programCtx!!.globalScope!!.entries.size, 0, "Expected no global scope entries"); // Compile the program to JavaScript and evaluate it const jsCode = ts.transpile(result.write()); @@ -360,7 +360,7 @@ describe("KipperCompiler", () => { assert(result.programCtx); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.universeScope.entries.size, 0, "Expected no global scope entries"); + assert.equal(result.programCtx!!.globalScope!!.entries.size, 0, "Expected no global scope entries"); // Compile the program to JavaScript and evaluate it const jsCode = ts.transpile(result.write()); @@ -377,7 +377,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.universeScope.entries.size, 1, "Expected one global scope entry"); + assert.equal(result.programCtx!!.globalScope!!.entries.size, 1, "Expected one global scope entry"); }); it(`Multi Function definition [${target.fileExtension}]`, async () => { @@ -387,7 +387,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.universeScope.entries.size, 3, "Expected three global scope entries"); + assert.equal(result.programCtx!!.globalScope!!.entries.size, 3, "Expected three global scope entries"); }); it(`Function call argument [${target.fileExtension}]`, async () => { @@ -397,7 +397,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.universeScope.entries.size, 0, "Expected no global scope entries"); + assert.equal(result.programCtx!!.globalScope!!.entries.size, 0, "Expected no global scope entries"); // Compile the program to JavaScript and evaluate it const jsCode = ts.transpile(result.write()); @@ -414,7 +414,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.universeScope.entries.size, 1, "Expected one global scope entry"); + assert.equal(result.programCtx!!.globalScope!!.entries.size, 1, "Expected one global scope entry"); // Compile the program to JavaScript and evaluate it const jsCode = ts.transpile(result.write()); @@ -430,7 +430,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.universeScope.entries.size, 1, "Expected one global scope entry"); + assert.equal(result.programCtx!!.globalScope!!.entries.size, 1, "Expected one global scope entry"); }); it(`Bool [${target.fileExtension}]`, async () => { @@ -440,7 +440,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.universeScope.entries.size, 2, "Expected two global scope entries"); + assert.equal(result.programCtx!!.globalScope!!.entries.size, 2, "Expected two global scope entries"); }); it(`Type conversion [${target.fileExtension}]`, async () => { @@ -450,7 +450,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.universeScope.entries.size, 4, "Expected four global scope entries"); + assert.equal(result.programCtx!!.globalScope!!.entries.size, 4, "Expected four global scope entries"); const code = result.write(); assert(code); @@ -467,7 +467,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.universeScope.entries.size, 3, "Expected three global scope entries"); + assert.equal(result.programCtx!!.globalScope!!.entries.size, 3, "Expected three global scope entries"); const code = result.write(); assert(code); @@ -482,7 +482,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.universeScope.entries.size, 0, "Expected no global scope entries"); + assert.equal(result.programCtx!!.globalScope!!.entries.size, 0, "Expected no global scope entries"); // Compile the program to JavaScript and evaluate it const jsCode = ts.transpile(result.write()); @@ -498,7 +498,7 @@ describe("KipperCompiler", () => { assert.isDefined(result.programCtx); assert.isDefined(result.programCtx!!.internals); assert.equal(result.programCtx!!.errors.length, 0, "Expected no compilation errors"); - assert.equal(result.programCtx!!.universeScope.entries.size, 0, "Expected no global scope entries"); + assert.equal(result.programCtx!!.globalScope!!.entries.size, 0, "Expected no global scope entries"); const code = result.write(); assert(code); diff --git a/test/module/core/errors/semantic-errors/builtin-overwrite.ts b/test/module/core/errors/semantic-errors/builtin-overwrite.ts index d6c612a87..f0fa4230b 100644 --- a/test/module/core/errors/semantic-errors/builtin-overwrite.ts +++ b/test/module/core/errors/semantic-errors/builtin-overwrite.ts @@ -1,4 +1,5 @@ import type { CompileConfig, KipperError } from "@kipper/core"; +import { BuiltInTypes } from "@kipper/core"; import { KipperCompiler } from "@kipper/core"; import { defaultConfig, ensureTracebackDataExists } from "../index"; import { assert } from "chai"; @@ -11,7 +12,7 @@ describe("BuiltInOverwriteError", () => { const config: CompileConfig = { ...defaultConfig, // prettier-ignore - extendBuiltInFunctions: test.i !== "print" ? [{ identifier: test.i, params: [], returnType: "void", }, ] : [], + extendBuiltInFunctions: test.i !== "print" ? [{ identifier: test.i, params: [], returnType: BuiltInTypes.void, }, ] : [], }; describe(`Global Scope - Overwrite [${test.t}]`, () => { diff --git a/test/module/core/errors/semantic-errors/invalid-global.ts b/test/module/core/errors/semantic-errors/invalid-global.ts index 8accd1d4d..05840b46f 100644 --- a/test/module/core/errors/semantic-errors/invalid-global.ts +++ b/test/module/core/errors/semantic-errors/invalid-global.ts @@ -1,4 +1,5 @@ import type { KipperError, KipperProgramContext, LexerParserData } from "@kipper/core"; +import { BuiltInTypes } from "@kipper/core"; import { KipperCompiler, KipperFileStream } from "@kipper/core"; import { defaultConfig } from "../index"; import { assert } from "chai"; @@ -14,8 +15,8 @@ describe("InvalidGlobalError", () => { const programCtx: KipperProgramContext = await compiler.getProgramCtx(parseData, defaultConfig); // Duplicate identifier - programCtx.registerBuiltInFunctions({ identifier: globalName, params: [], returnType: "void" }); - programCtx.registerBuiltInFunctions({ identifier: globalName, params: [], returnType: "void" }); + programCtx.registerBuiltInFunctions({ identifier: globalName, params: [], returnType: BuiltInTypes.void }); + programCtx.registerBuiltInFunctions({ identifier: globalName, params: [], returnType: BuiltInTypes.void }); } catch (e) { assert.equal((e).constructor.name, "InvalidGlobalError", "Expected different error"); assert((e).line !== undefined, "Expected existing 'line' meta field"); diff --git a/test/module/core/global-scope.test.ts b/test/module/core/global-scope.test.ts index 9d1dfd554..087b0d49c 100644 --- a/test/module/core/global-scope.test.ts +++ b/test/module/core/global-scope.test.ts @@ -1,25 +1,24 @@ import type { ScopeFunctionDeclaration } from "@kipper/core"; +import { BuiltInTypes } from "@kipper/core"; import { KipperCompiler, ScopeVariableDeclaration } from "@kipper/core"; import { KipperTypeScriptTarget } from "@kipper/target-ts"; import { assert } from "chai"; -describe("GlobalScope", () => { +describe("Global scope", () => { const defaultTarget = new KipperTypeScriptTarget(); - describe("constructor", () => { - it("should have an empty hash map", async () => { - const compileResult = await new KipperCompiler().compile("", { target: defaultTarget }); - assert.isDefined(compileResult.programCtx); - const scope = compileResult.programCtx!!.universeScope; - assert.equal(scope.entries.size, 0); - }); + it("created on ctx creation", async () => { + const compileResult = await new KipperCompiler().compile("", { target: defaultTarget }); + assert.isDefined(compileResult.programCtx); + const scope = compileResult.programCtx!!.globalScope!!; + assert.equal(scope.entries.size, 0); }); describe("addVariable", () => { it("one", async () => { const compileResult = await new KipperCompiler().compile("var test: num = 5;", { target: defaultTarget }); assert.isDefined(compileResult.programCtx); - const scope = compileResult.programCtx!!.universeScope; + const scope = compileResult.programCtx!!.globalScope!!; // Should have one variable assert.equal(scope.entries.size, 1); @@ -28,7 +27,7 @@ describe("GlobalScope", () => { let entry = scope.entries.get(iter.next().value); assert.instanceOf(entry, ScopeVariableDeclaration); assert.equal(entry.identifier, "test"); - assert.equal(entry.type.getCompilableType(), "num"); + assert.equal(entry.type.getCompilableType(), BuiltInTypes.num); assert.equal(entry.storageType, "var"); assert.equal(entry.hasValue, true); assert.equal(entry.isDefined, true); @@ -42,7 +41,7 @@ describe("GlobalScope", () => { target: defaultTarget, }); assert.isDefined(compileResult.programCtx); - const scope = compileResult.programCtx!!.universeScope; + const scope = compileResult.programCtx!!.globalScope!!; // Should have two variables assert.equal(scope.entries.size, 2); @@ -78,7 +77,7 @@ describe("GlobalScope", () => { { target: defaultTarget }, ); assert.isDefined(compileResult.programCtx); - const scope = compileResult.programCtx!!.universeScope; + const scope = compileResult.programCtx!!.globalScope!!; // Should have three variables assert.equal(scope.entries.size, 3); @@ -126,7 +125,7 @@ describe("GlobalScope", () => { target: defaultTarget, }); assert.isDefined(compileResult.programCtx); - const scope = compileResult.programCtx!!.universeScope; + const scope = compileResult.programCtx!!.globalScope!!; // Should have one function assert.equal(scope.entries.size, 1); @@ -151,7 +150,7 @@ describe("GlobalScope", () => { { target: defaultTarget }, ); assert.isDefined(compileResult.programCtx); - const scope = compileResult.programCtx!!.universeScope; + const scope = compileResult.programCtx!!.globalScope!!; // Should have two functions assert.equal(scope.entries.size, 2); @@ -189,7 +188,7 @@ describe("GlobalScope", () => { { target: defaultTarget }, ); assert.isDefined(compileResult.programCtx); - const scope = compileResult.programCtx!!.universeScope; + const scope = compileResult.programCtx!!.globalScope!!; // Should have three functions assert.equal(scope.entries.size, 3); diff --git a/test/module/core/program-ctx.test.ts b/test/module/core/program-ctx.test.ts index 451676ef4..5f2c9df32 100644 --- a/test/module/core/program-ctx.test.ts +++ b/test/module/core/program-ctx.test.ts @@ -1,5 +1,6 @@ import { assert } from "chai"; import type { BuiltInFunction } from "@kipper/core"; +import { BuiltInFunctions, BuiltInTypes, BuiltInVariables } from "@kipper/core"; import { EvaluatedCompileConfig, InvalidGlobalError, KipperCompiler, KipperFileStream } from "@kipper/core"; import { promises as fs } from "fs"; import { KipperTypeScriptTarget } from "@kipper/target-ts"; @@ -22,8 +23,10 @@ describe("KipperProgramContext", async () => { assert.equal( programCtx.builtIns.length, Object.values([ - ...EvaluatedCompileConfig.defaults.builtInFunctions, - ...EvaluatedCompileConfig.defaults.builtInVariables, + ...Object.values(BuiltInFunctions), + ...Object.values(BuiltInVariables), + ...EvaluatedCompileConfig.defaults.extendBuiltInFunctions, + ...EvaluatedCompileConfig.defaults.extendBuiltInVariables, ]).length, "Expected the program ctx built-ins to match the default built-ins", ); @@ -38,8 +41,10 @@ describe("KipperProgramContext", async () => { assert.equal( programCtx.builtIns.length, Object.values([ - ...EvaluatedCompileConfig.defaults.builtInFunctions, - ...EvaluatedCompileConfig.defaults.builtInVariables, + ...Object.values(BuiltInFunctions), + ...Object.values(BuiltInVariables), + ...EvaluatedCompileConfig.defaults.extendBuiltInFunctions, + ...EvaluatedCompileConfig.defaults.extendBuiltInVariables, ]).length, "Expected the program ctx built-ins to match the default built-ins", ); @@ -48,15 +53,17 @@ describe("KipperProgramContext", async () => { let func: BuiltInFunction = { identifier: "test", params: [], - returnType: "void", + returnType: BuiltInTypes.void, }; programCtx.registerBuiltInFunctions(func); assert.equal( programCtx.builtIns.length, Object.values([ - ...EvaluatedCompileConfig.defaults.builtInFunctions, - ...EvaluatedCompileConfig.defaults.builtInVariables, + ...Object.values(BuiltInFunctions), + ...Object.values(BuiltInVariables), + ...EvaluatedCompileConfig.defaults.extendBuiltInFunctions, + ...EvaluatedCompileConfig.defaults.extendBuiltInVariables, ]).length + 1, "Expected the program ctx built-ins to match the default built-ins", ); @@ -71,8 +78,10 @@ describe("KipperProgramContext", async () => { assert.equal( programCtx.builtIns.length, Object.values([ - ...EvaluatedCompileConfig.defaults.builtInFunctions, - ...EvaluatedCompileConfig.defaults.builtInVariables, + ...Object.values(BuiltInFunctions), + ...Object.values(BuiltInVariables), + ...EvaluatedCompileConfig.defaults.extendBuiltInFunctions, + ...EvaluatedCompileConfig.defaults.extendBuiltInVariables, ]).length, "Expected the program ctx built-ins to match the default built-ins", ); @@ -81,15 +90,17 @@ describe("KipperProgramContext", async () => { let func: BuiltInFunction = { identifier: "test", params: [], - returnType: "void", + returnType: BuiltInTypes.void, }; programCtx.registerBuiltInFunctions(func); assert.equal( programCtx.builtIns.length, Object.values([ - ...EvaluatedCompileConfig.defaults.builtInFunctions, - ...EvaluatedCompileConfig.defaults.builtInVariables, + ...Object.values(BuiltInFunctions), + ...Object.values(BuiltInVariables), + ...EvaluatedCompileConfig.defaults.extendBuiltInFunctions, + ...EvaluatedCompileConfig.defaults.extendBuiltInVariables, ]).length + 1, "Expected the program ctx built-ins to match the default built-ins", ); @@ -118,8 +129,10 @@ describe("KipperProgramContext", async () => { assert.equal( programCtx.builtIns.length, Object.values([ - ...EvaluatedCompileConfig.defaults.builtInFunctions, - ...EvaluatedCompileConfig.defaults.builtInVariables, + ...Object.values(BuiltInFunctions), + ...Object.values(BuiltInVariables), + ...EvaluatedCompileConfig.defaults.extendBuiltInFunctions, + ...EvaluatedCompileConfig.defaults.extendBuiltInVariables, ]).length, "Expected the program ctx built-ins to match the default built-ins", ); @@ -130,7 +143,7 @@ describe("KipperProgramContext", async () => { let func: BuiltInFunction = { identifier: "test", params: [], - returnType: "void", + returnType: BuiltInTypes.void, }; programCtx.registerBuiltInFunctions(func); @@ -147,15 +160,17 @@ describe("KipperProgramContext", async () => { let func: BuiltInFunction = { identifier: "test", params: [], - returnType: "void", + returnType: BuiltInTypes.void, }; programCtx.registerBuiltInFunctions(func); assert.equal( programCtx.builtIns.length, Object.values([ - ...EvaluatedCompileConfig.defaults.builtInFunctions, - ...EvaluatedCompileConfig.defaults.builtInVariables, + ...Object.values(BuiltInFunctions), + ...Object.values(BuiltInVariables), + ...EvaluatedCompileConfig.defaults.extendBuiltInFunctions, + ...EvaluatedCompileConfig.defaults.extendBuiltInVariables, ]).length + 1, "Expected one additional built-in function after registration", ); diff --git a/test/module/core/universe-scope.test.ts b/test/module/core/universe-scope.test.ts new file mode 100644 index 000000000..3facd5697 --- /dev/null +++ b/test/module/core/universe-scope.test.ts @@ -0,0 +1,21 @@ +import { BuiltInFunctions, BuiltInVariables, ScopeFunctionDeclaration } from "@kipper/core"; +import { BuiltInTypes } from "@kipper/core"; +import { KipperCompiler } from "@kipper/core"; +import { KipperTypeScriptTarget } from "@kipper/target-ts"; +import { assert } from "chai"; + +const DEFAULT_BUILTIN_COUNT = + Object.values(BuiltInVariables).length + Object.values(BuiltInFunctions).length + Object.values(BuiltInTypes).length; + +describe("UniverseScope", () => { + const defaultTarget = new KipperTypeScriptTarget(); + + describe("constructor", () => { + it("should have an empty hash map", async () => { + const compileResult = await new KipperCompiler().compile("", { target: defaultTarget }); + assert.isDefined(compileResult.programCtx); + const scope = compileResult.programCtx!!.universeScope; + assert.equal(scope.entries.size, DEFAULT_BUILTIN_COUNT); + }); + }); +}); From 81b65c5c8905d53c524f77293e0bb660594281e4 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Thu, 11 Jul 2024 11:33:06 +0200 Subject: [PATCH 21/57] minor (#524): Implemented object type checking and recursive errors --- CHANGELOG.md | 26 +++--- .../semantics/analyser/type-checker.ts | 33 ++++---- .../semantics/types/base/processed-type.ts | 16 ++-- .../compiler/semantics/types/built-in-type.ts | 27 +++++-- .../compiler/semantics/types/custom-type.ts | 80 +++++++++++++++++-- .../semantics/types/undefined-type.ts | 14 +++- kipper/core/src/errors.ts | 39 +++++++-- kipper/core/src/tools/functions/indent.ts | 12 +++ kipper/core/src/tools/functions/index.ts | 1 + test/module/core/built-ins.test.ts | 4 +- .../errors/type-errors/argument-type-error.ts | 14 ++-- test/module/core/universe-scope.test.ts | 2 +- 12 files changed, 199 insertions(+), 69 deletions(-) create mode 100644 kipper/core/src/tools/functions/indent.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 88aad9894..da9468daa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,21 +19,21 @@ To use development versions of Kipper download the ### Added - New classes: - - `InterfaceDeclaration`, which represents an AST interface declaration. - - `ClassDeclaration`, which represents an AST class declaration. - - `BuiltInType`, which represents a built-in type. - - `CustomType`, which represents a user defined type. + - `InterfaceDeclaration`, which represents an AST interface declaration. + - `ClassDeclaration`, which represents an AST class declaration. + - `BuiltInType`, which represents a built-in type. + - `CustomType`, which represents a user defined type. - New errors: - - `TypeCanNotBeUsedForTypeCheckingError`, which is thrown when a type is used for type checking, but is not a valid - type. This is an error indicating an invalid logic that should be fixed. + - `TypeCanNotBeUsedForTypeCheckingError`, which is thrown when a type is used for type checking, but is not a valid + type. This is an error indicating an invalid logic that should be fixed. - New interfaces: - - `InterfaceDeclarationSemantics`, which represents the semantics of an interface declaration. - - `InterfaceDeclarationTypeSemantics`, which represents the type semantics of an interface declaration. - - `ClassDeclarationSemantics`, which represents the semantics of a class declaration. - - `ClassDeclarationTypeSemantics`, which represents the type semantics of a class declaration. - - `TypeDeclaration`, which represents a type declaration. This is an abstract base class for all type declarations. - - `TypeDeclarationSemantics`, which represents the semantics of a type declaration. - - `TypeDeclarationTypeSemantics`, which represents the type semantics of a type declaration. + - `InterfaceDeclarationSemantics`, which represents the semantics of an interface declaration. + - `InterfaceDeclarationTypeSemantics`, which represents the type semantics of an interface declaration. + - `ClassDeclarationSemantics`, which represents the semantics of a class declaration. + - `ClassDeclarationTypeSemantics`, which represents the type semantics of a class declaration. + - `TypeDeclaration`, which represents a type declaration. This is an abstract base class for all type declarations. + - `TypeDeclarationSemantics`, which represents the semantics of a type declaration. + - `TypeDeclarationTypeSemantics`, which represents the type semantics of a type declaration. ### Changed diff --git a/kipper/core/src/compiler/semantics/analyser/type-checker.ts b/kipper/core/src/compiler/semantics/analyser/type-checker.ts index dc95b93bc..cf3b44a27 100644 --- a/kipper/core/src/compiler/semantics/analyser/type-checker.ts +++ b/kipper/core/src/compiler/semantics/analyser/type-checker.ts @@ -43,10 +43,9 @@ import { kipperPlusOperator, kipperSupportedConversions, } from "../../const"; +import type { TypeError } from "../../../errors"; import { - ArgumentTypeError, ArithmeticOperationTypeError, - AssignmentTypeError, BitwiseOperationTypeError, ExpressionNotCallableError, IncompleteReturnsInCodePathsError, @@ -186,8 +185,10 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { } // Ensure that the types are matching - if not, throw an error - if (!varType.isAssignableTo(valueType)) { - throw this.assertError(new AssignmentTypeError(varType.identifier, valueType.identifier)); + try { + valueType.assertAssignableTo(varType); + } catch (e) { + throw this.assertError(e); } // Ensure that all arithmetic assignment operators except '+=' are only used on numbers @@ -217,8 +218,10 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { } // Ensure the value of the definition match the definition type - if (!rightExpType.isAssignableTo(leftExpType)) { - throw this.assertError(new AssignmentTypeError(rightExpType.identifier, leftExpType.identifier)); + try { + rightExpType.assertAssignableTo(leftExpType); + } catch (e) { + throw this.assertError(e); } } @@ -228,7 +231,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @param receivedType The type that was received. * @example * call print("x"); // <-- Parameter type 'str' must match type of argument "x" - * @throws {ArgumentTypeError} If the given argument type does not match the parameter type. + * @throws {ArgumentAssignmentTypeError} If the given argument type does not match the parameter type. * @since 0.7.0 */ public validArgumentValue(arg: ParameterDeclaration | BuiltInFunctionArgument, receivedType: ProcessedType): void { @@ -249,10 +252,10 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { return; } - if (!argType.isAssignableTo(receivedType)) { - throw this.assertError( - new ArgumentTypeError(semanticData.identifier, argType.identifier, receivedType.identifier), - ); + try { + receivedType.assertAssignableTo(argType, undefined, semanticData.identifier); + } catch (e) { + throw this.assertError(e); } } @@ -261,7 +264,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @param func The function that is called. * @param args The arguments for the call expression. * @throws {InvalidAmountOfArgumentsError} If the amount of arguments is invalid e.g. too many or too few. - * @throws {ArgumentTypeError} If any given argument type does not match the required parameter type. + * @throws {ArgumentAssignmentTypeError} If any given argument type does not match the required parameter type. * @since 0.7.0 */ public validFunctionCallArguments(func: ScopeFunctionDeclaration, args: Array): void { @@ -471,8 +474,10 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { // We need to check whether the types are matching, but *not* if the function return type is valid, since that // will be done later by the function itself during the type checking. - if (statementValueType && !statementValueType.isAssignableTo(functionReturnType)) { - throw this.assertError(new AssignmentTypeError(statementValueType.identifier, functionReturnType.identifier)); + try { + statementValueType.assertAssignableTo(functionReturnType); + } catch (e) { + throw this.assertError(e); } } diff --git a/kipper/core/src/compiler/semantics/types/base/processed-type.ts b/kipper/core/src/compiler/semantics/types/base/processed-type.ts index 7bb384ef7..ac8d54145 100644 --- a/kipper/core/src/compiler/semantics/types/base/processed-type.ts +++ b/kipper/core/src/compiler/semantics/types/base/processed-type.ts @@ -1,5 +1,5 @@ import type { CompilableType } from "./compilable-type"; -import { TypeNotCompilableError } from "../../../../errors"; +import { TypeNotCompilableError, type TypeError } from "../../../../errors"; import { Type } from "./type"; /** @@ -8,11 +8,8 @@ import { Type } from "./type"; * @since 0.10.0 */ export abstract class ProcessedType extends Type { - protected readonly _isCompilable: boolean; - - protected constructor(identifier: string, isCompilable: boolean) { + protected constructor(identifier: string) { super(identifier); - this._isCompilable = isCompilable; } /** @@ -29,9 +26,7 @@ export abstract class ProcessedType extends Type { * be stored using this class though (but NOT compiled!). * @since 0.10.0 */ - public get isCompilable(): boolean { - return this._isCompilable; - } + public abstract get isCompilable(): boolean; /** * Gets the compilable type for this type. @@ -53,7 +48,10 @@ export abstract class ProcessedType extends Type { /** * Returns whether this type is assignable to the given {@link type}. * @param type The type to check against. + * @param propertyName The name of the property that is being assigned. This is used for error messages. + * @param argumentName The name of the argument that is being assigned to. This is used for error messages. + * @throws TypeError If the types are not assignable. * @since 0.11.0 */ - public abstract isAssignableTo(type: ProcessedType): boolean; + public abstract assertAssignableTo(type: ProcessedType, propertyName?: string, argumentName?: string): void; } diff --git a/kipper/core/src/compiler/semantics/types/built-in-type.ts b/kipper/core/src/compiler/semantics/types/built-in-type.ts index 4c126c377..1a4a2b0e1 100644 --- a/kipper/core/src/compiler/semantics/types/built-in-type.ts +++ b/kipper/core/src/compiler/semantics/types/built-in-type.ts @@ -1,6 +1,7 @@ import { ProcessedType } from "./base/processed-type"; import type { KipperBuiltInTypeLiteral } from "../../const"; import type { CompilableType } from "./base/compilable-type"; +import { ArgumentAssignmentTypeError, AssignmentTypeError, PropertyAssignmentTypeError } from "../../../errors"; /** * Represents a built-in type that is used in the type analysis phase. @@ -10,9 +11,15 @@ export class BuiltInType extends ProcessedType implements CompilableType { public static readonly interchangeableTypes = ["void", "undefined"]; public constructor(identifier: KipperBuiltInTypeLiteral) { - super(identifier, true); + super(identifier); } + /** + * Returns whether the type is compilable. + * + * This is ALWAYS true, since built-in types are always compilable. + * @since 0.11.0 + */ public get isCompilable(): true { return true; } @@ -20,17 +27,27 @@ export class BuiltInType extends ProcessedType implements CompilableType { /** * Returns whether this type is assignable to another type. * @param type The type to check against. + * @param propertyName The name of the property that is being assigned. This is used for error messages. + * @param argumentName The name of the argument that is being assigned to. This is used for error messages. + * @throws AssignmentTypeError If the types are not assignable. + * @throws PropertyAssignmentTypeError If a property is not assignable. + * @throws ArgumentAssignmentTypeError If an argument is not assignable. * @since 0.11.0 */ - public isAssignableTo(type: ProcessedType): boolean { + public assertAssignableTo(type: ProcessedType, propertyName?: string, argumentName?: string): void { if (this === type) { - return true; + return; } else if ( BuiltInType.interchangeableTypes.includes(this.identifier) && BuiltInType.interchangeableTypes.includes(type.identifier) ) { - return true; + return; + } else if (propertyName) { + throw new PropertyAssignmentTypeError(propertyName, type.identifier, this.identifier); + } else if (argumentName) { + throw new ArgumentAssignmentTypeError(argumentName, type.identifier, this.identifier); + } else { + throw new AssignmentTypeError(type.identifier, this.identifier); } - return false; } } diff --git a/kipper/core/src/compiler/semantics/types/custom-type.ts b/kipper/core/src/compiler/semantics/types/custom-type.ts index b27d56134..fd4324178 100644 --- a/kipper/core/src/compiler/semantics/types/custom-type.ts +++ b/kipper/core/src/compiler/semantics/types/custom-type.ts @@ -1,7 +1,29 @@ import { ProcessedType } from "./base"; +import type { TypeError } from "../../../errors"; +import { + ArgumentAssignmentTypeError, + AssignmentTypeError, + PropertyAssignmentTypeError, + PropertyNotFoundError, +} from "../../../errors"; +/** + * Represents the kind of a custom type. + * @since 0.11.0 + */ export type CustomTypeKind = "interface" | "class"; -export type CustomTypeFields = Map; + +/** + * Represents a field of a custom type. This is simply another type. + * @since 0.11.0 + */ +export type CustomTypeField = ProcessedType; + +/** + * Represents a map of field names to their types. + * @since 0.11.0 + */ +export type CustomTypeFields = Map; /** * Represents a custom type which is not a built-in type. @@ -17,12 +39,23 @@ export class CustomType extends ProcessedType { public readonly kind: CustomTypeKind; private readonly _fields: CustomTypeFields; - public constructor(identifier: string, isCompilable: boolean, kind: CustomTypeKind, fields: CustomTypeFields) { - super(identifier, isCompilable); + public constructor(identifier: string, kind: CustomTypeKind, fields: CustomTypeFields) { + super(identifier); this._fields = fields; this.kind = kind; } + /** + * Returns whether the type is compilable. + * + * This runs through all fields and checks if they are compilable. As such this is an expensive operation and should + * only be used once during type checking. + * @since 0.11.0 + */ + public override get isCompilable(): boolean { + return Object.values(this._fields).every((field) => field.isCompilable); + } + /** * The fields of this type. * @since 0.11.0 @@ -33,15 +66,46 @@ export class CustomType extends ProcessedType { /** * Checks whether this type is assignable to another type. + * + * This assumes that {@link this} is being assigned to {@link type}. * @param type The type to check against. + * @param propertyName The name of the property that is being assigned to. This is used for error messages. + * @param argumentName The name of the argument that is being assigned to. This is used for error messages. + * @throws AssignmentTypeError If the types are not assignable. + * @throws PropertyAssignmentTypeError If a property is not assignable. + * @throws ArgumentAssignmentTypeError If an argument is not assignable. + * @throws PropertyNotFoundError If a property is not found. * @since 0.11.0 */ - isAssignableTo(type: ProcessedType): boolean { + assertAssignableTo(type: ProcessedType, propertyName?: string, argumentName?: string): void { if (type === this) { - return true; - } + return; + } else if (type instanceof CustomType) { + for (const [fieldName, fieldType] of this.fields) { + const targetTypeField = type.fields.get(fieldName); + if (!targetTypeField) { + throw new PropertyNotFoundError(type.identifier, fieldName); + } - // TODO! Implement this once custom types are implemented - return false; + try { + fieldType.assertAssignableTo(targetTypeField, fieldName); + } catch (error) { + if (propertyName) { + throw new PropertyAssignmentTypeError(propertyName, type.identifier, this.identifier, error); + } else if (argumentName) { + throw new ArgumentAssignmentTypeError(argumentName, type.identifier, this.identifier, error); + } else { + throw new AssignmentTypeError(type.identifier, this.identifier, error); + } + } + } + return; + } else if (propertyName) { + throw new PropertyAssignmentTypeError(propertyName, type.identifier, this.identifier); + } else if (argumentName) { + throw new ArgumentAssignmentTypeError(argumentName, type.identifier, this.identifier); + } else { + throw new AssignmentTypeError(type.identifier, this.identifier); + } } } diff --git a/kipper/core/src/compiler/semantics/types/undefined-type.ts b/kipper/core/src/compiler/semantics/types/undefined-type.ts index a4f4014c0..73f724471 100644 --- a/kipper/core/src/compiler/semantics/types/undefined-type.ts +++ b/kipper/core/src/compiler/semantics/types/undefined-type.ts @@ -10,7 +10,17 @@ import { TypeCanNotBeUsedForTypeCheckingError } from "../../../errors"; */ export class UndefinedType extends ProcessedType { constructor(identifier: string) { - super(identifier, false); + super(identifier); + } + + /** + * Returns whether the type is compilable. + * + * This is ALWAYS false, since this type can not be used for type checking. + * @since 0.10.0 + */ + public get isCompilable(): false { + return false; } /** @@ -18,7 +28,7 @@ export class UndefinedType extends ProcessedType { * @param type The type to check against. * @since 0.10.0 */ - isAssignableTo(type: ProcessedType): boolean { + assertAssignableTo(type: ProcessedType): boolean { throw new TypeCanNotBeUsedForTypeCheckingError(); } } diff --git a/kipper/core/src/errors.ts b/kipper/core/src/errors.ts index c7db65298..832edc3a5 100644 --- a/kipper/core/src/errors.ts +++ b/kipper/core/src/errors.ts @@ -8,7 +8,7 @@ import type { FailedPredicateException } from "antlr4ts/FailedPredicateException import type { RecognitionException } from "antlr4ts/RecognitionException"; import type { Recognizer } from "antlr4ts/Recognizer"; import type { CompilableASTNode, KipperFileStream, KipperProgramContext } from "./compiler"; -import { getParseRuleSource } from "./tools"; +import { addLeftIndent, getParseRuleSource } from "./tools"; /** * The interface representing the traceback data for a {@link KipperError}. @@ -559,8 +559,8 @@ export class ReservedIdentifierOverwriteError extends IdentifierError { * @since 0.7.0 */ export class TypeError extends KipperError { - constructor(msg: string) { - super(msg); + constructor(msg: string, cause?: TypeError) { + super(msg + (cause?.message ? `\n${addLeftIndent(cause.message)}` : "")); this.name = "TypeError"; } } @@ -595,9 +595,12 @@ export class BitwiseOperationTypeError extends TypeError { /** * Error that is thrown whenever an argument is not assignable to the parameter's type. */ -export class ArgumentTypeError extends TypeError { - constructor(paramIdentifier: string, expectedType: string, receivedType: string) { - super(`Type '${receivedType}' is not assignable to parameter '${paramIdentifier}' of type '${expectedType}'.`); +export class ArgumentAssignmentTypeError extends TypeError { + constructor(paramIdentifier: string, expectedType: string, receivedType: string, cause?: TypeError) { + super( + `Type '${receivedType}' is not assignable to parameter '${paramIdentifier}' of type '${expectedType}'.`, + cause, + ); } } @@ -608,8 +611,28 @@ export class ArgumentTypeError extends TypeError { * @since 0.8.3 */ export class AssignmentTypeError extends TypeError { - constructor(leftExpType: string, rightExpType: string) { - super(`Type '${rightExpType}' is not assignable to type '${leftExpType}'.`); + constructor(leftExpType: string, rightExpType: string, cause?: TypeError) { + super(`Type '${rightExpType}' is not assignable to type '${leftExpType}'.`, cause); + } +} + +/** + * Error that is thrown whenever a property is assigned to that is not defined in the object. + * @since 0.11.0 + */ +export class PropertyAssignmentTypeError extends TypeError { + constructor(identifier: string, propertyType: string, valueType: string, cause?: TypeError) { + super(`Type '${valueType}' is not assignable to property '${identifier}' of type '${propertyType}'.`, cause); + } +} + +/** + * Error that is thrown whenever a property can not be found in the object. + * @since 0.11.0 + */ +export class PropertyNotFoundError extends TypeError { + constructor(objType: string, identifier: string) { + super(`Property '${identifier}' not found in object of type '${objType}'.`); } } diff --git a/kipper/core/src/tools/functions/indent.ts b/kipper/core/src/tools/functions/indent.ts new file mode 100644 index 000000000..7f94b394b --- /dev/null +++ b/kipper/core/src/tools/functions/indent.ts @@ -0,0 +1,12 @@ +/** + * Adds a left indentation to the message with the specified amount of spaces. + * @param msg The message to indent. + * @param spaces The amount of spaces to indent the message with. + * @since 0.11.0 + */ +export function addLeftIndent(msg: string, spaces: number = 2): string { + return msg + .split("\n") + .map((line: string): string => `${" ".repeat(spaces)}${line}`) + .join("\n"); +} diff --git a/kipper/core/src/tools/functions/index.ts b/kipper/core/src/tools/functions/index.ts index ff4aaa92f..ca2545621 100644 --- a/kipper/core/src/tools/functions/index.ts +++ b/kipper/core/src/tools/functions/index.ts @@ -6,3 +6,4 @@ export * from "./parser-rules"; export * from "./inverse-map"; export * from "./replace-obj-keys"; export * from "./other"; +export * from "./indent"; diff --git a/test/module/core/built-ins.test.ts b/test/module/core/built-ins.test.ts index 65b89c6c3..4e52bfdab 100644 --- a/test/module/core/built-ins.test.ts +++ b/test/module/core/built-ins.test.ts @@ -70,7 +70,7 @@ describe("Built-ins", () => { try { await compiler.compile(fileContent, config); } catch (e) { - assert.equal((e).constructor.name, "ArgumentTypeError", "Expected different error"); + assert.equal((e).constructor.name, "ArgumentAssignmentTypeError", "Expected different error"); assert((e).name === "TypeError", "Expected different error"); return; } @@ -124,7 +124,7 @@ describe("Built-ins", () => { try { await compiler.compile(fileContent, config); } catch (e) { - assert.equal((e).constructor.name, "ArgumentTypeError", "Expected different error"); + assert.equal((e).constructor.name, "ArgumentAssignmentTypeError", "Expected different error"); assert((e).name === "TypeError", "Expected different error"); return; } diff --git a/test/module/core/errors/type-errors/argument-type-error.ts b/test/module/core/errors/type-errors/argument-type-error.ts index 5e91d674f..57d4e4695 100644 --- a/test/module/core/errors/type-errors/argument-type-error.ts +++ b/test/module/core/errors/type-errors/argument-type-error.ts @@ -3,30 +3,30 @@ import { KipperCompiler } from "@kipper/core"; import { assert } from "chai"; import { defaultConfig, ensureTracebackDataExists } from "../index"; -describe("ArgumentTypeError", () => { +describe("ArgumentAssignmentTypeError", () => { describe("Error", () => { it("Single argument (One invalid)", async () => { try { await new KipperCompiler().compile(`print(1);`, defaultConfig); } catch (e) { - assert.equal((e).constructor.name, "ArgumentTypeError", "Expected different error"); + assert.equal((e).constructor.name, "ArgumentAssignmentTypeError", "Expected different error"); assert((e).name === "TypeError", "Expected different error"); ensureTracebackDataExists(e); return; } - assert.fail("Expected 'ArgumentTypeError'"); + assert.fail("Expected 'ArgumentAssignmentTypeError'"); }); it("Two arguments (One invalid)", async () => { try { await new KipperCompiler().compile(`def test(p1: str, p2: str) -> void {}; test("Hello", 1);`, defaultConfig); } catch (e) { - assert.equal((e).constructor.name, "ArgumentTypeError", "Expected different error"); + assert.equal((e).constructor.name, "ArgumentAssignmentTypeError", "Expected different error"); assert((e).name === "TypeError", "Expected different error"); ensureTracebackDataExists(e); return; } - assert.fail("Expected 'ArgumentTypeError'"); + assert.fail("Expected 'ArgumentAssignmentTypeError'"); }); it("Three arguments (One invalid)", async () => { @@ -36,12 +36,12 @@ describe("ArgumentTypeError", () => { defaultConfig, ); } catch (e) { - assert.equal((e).constructor.name, "ArgumentTypeError", "Expected different error"); + assert.equal((e).constructor.name, "ArgumentAssignmentTypeError", "Expected different error"); assert((e).name === "TypeError", "Expected different error"); ensureTracebackDataExists(e); return; } - assert.fail("Expected 'ArgumentTypeError'"); + assert.fail("Expected 'ArgumentAssignmentTypeError'"); }); }); diff --git a/test/module/core/universe-scope.test.ts b/test/module/core/universe-scope.test.ts index 3facd5697..ab1120b6e 100644 --- a/test/module/core/universe-scope.test.ts +++ b/test/module/core/universe-scope.test.ts @@ -1,4 +1,4 @@ -import { BuiltInFunctions, BuiltInVariables, ScopeFunctionDeclaration } from "@kipper/core"; +import { BuiltInFunctions, BuiltInVariables } from "@kipper/core"; import { BuiltInTypes } from "@kipper/core"; import { KipperCompiler } from "@kipper/core"; import { KipperTypeScriptTarget } from "@kipper/target-ts"; From 94383162b77ee118cdf2d782ed0571e8b90db337 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Thu, 11 Jul 2024 13:23:05 +0200 Subject: [PATCH 22/57] other: Updated CHANGELOG.md --- CHANGELOG.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index da9468daa..01bc753be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,11 +18,20 @@ To use development versions of Kipper download the ### Added +- Implemented internal representation for custom types such as objects, interfaces and classes. This change means that the entire core type system has been reworked and adjusted to also support custom types as well as complex types (objects, arrays etc.). This does not inheritely add functionality but serves as the stepping stone for the implementation of all custom types in the future. ([#524](https://github.com/Kipper-Lang/Kipper/issues/524)) +- New module: + - `semantics/runtime-built-ins`, which contains runtime built-in functions, variables and types. + - `semantics/runtime-internals`, which contains the runtime internal functions. + - `semantics/types`, which contains the runtime types. - New classes: - `InterfaceDeclaration`, which represents an AST interface declaration. - `ClassDeclaration`, which represents an AST class declaration. - `BuiltInType`, which represents a built-in type. - `CustomType`, which represents a user defined type. + - `ScopeTypeDeclaration`, which represents a scope type declaration. + - `UniverseTypeDeclaration`, which represents the universe, where all built-in types, functions and variables are + declared. This serves as the parent of the global scope. + - `CustomType`, which is a class extending from `ProcessedType` and implementing the functionality for a custom type such as a interface or class. - New errors: - `TypeCanNotBeUsedForTypeCheckingError`, which is thrown when a type is used for type checking, but is not a valid type. This is an error indicating an invalid logic that should be fixed. @@ -34,9 +43,21 @@ To use development versions of Kipper download the - `TypeDeclaration`, which represents a type declaration. This is an abstract base class for all type declarations. - `TypeDeclarationSemantics`, which represents the semantics of a type declaration. - `TypeDeclarationTypeSemantics`, which represents the type semantics of a type declaration. + - `CompilableType`, which represents a type that can be compiled. ### Changed +- Changed type from interface to class: + - `InternalFunction`, which represents an internal function. + - `BuiltInFunction`, which represents a built-in function. + - `InternalFunctionArgument`, which represents an internal function argument. + - `BuiltInVariable`, which represents a built-in variable. +- Renamed: + - Module `analysis` to `semantics`. + - Class `UncheckedType` to `RawType`. + - Class `CheckedType` to `ProcessedType`. + - Class `UndefinedCustomType` to `UndefinedType`. + ### Fixed ### Deprecated From 95e8c041f790074578e013f216c460e2459a6f0e Mon Sep 17 00:00:00 2001 From: Fabian Date: Thu, 11 Jul 2024 14:37:38 +0200 Subject: [PATCH 23/57] major (#525): Implemented interface syntax, AST nodes and basic code generation Even if the syntax is implemented and basic code generation is present proper type checking will have to wait until #524 --- kipper/core/KipperParser.g4 | 21 +- kipper/core/src/compiler/ast/ast-generator.ts | 23 +- .../core/src/compiler/ast/common/ast-types.ts | 12 +- .../compiler/ast/mapping/ast-node-mapper.ts | 21 +- .../interface-declaration/index.ts | 3 + .../interface-declaration-semantics.ts | 8 + .../interface-declaration.ts | 16 +- .../interface-member-declaration/index.ts | 3 + .../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 | 7 + .../interface-method-declaration.ts | 181 + .../interface-property-declaration/index.ts | 3 + ...nterface-property-declaration-semantics.ts | 27 + ...ace-property-declaration-type-semantics.ts | 14 + .../interface-property-declaration.ts | 156 + ...rface-member-list-declaration-semantics.ts | 7 - ...-member-list-declaration-type-semantics.ts | 5 - .../interface-member-list-declaration.ts | 30 - ...nterface-property-declaration-semantics.ts | 25 - ...ace-property-declaration-type-semantics.ts | 3 - .../interface-property-declaration.ts | 29 - .../type-declaration/type-declaration.ts | 11 +- .../src/compiler/parser/antlr/KipperLexer.ts | 465 +- .../compiler/parser/antlr/KipperParser.interp | 7 +- .../src/compiler/parser/antlr/KipperParser.ts | 6823 +++++++++-------- .../parser/antlr/KipperParserListener.ts | 44 +- .../parser/antlr/KipperParserVisitor.ts | 32 +- .../parser/parse-rule-kind-mapping.ts | 3 +- .../target-presets/semantic-analyser.ts | 12 + .../translation/code-generator.ts | 19 + kipper/target-js/src/code-generator.ts | 20 +- kipper/target-js/src/semantic-analyser.ts | 23 + kipper/target-ts/src/code-generator.ts | 80 +- 37 files changed, 4891 insertions(+), 3336 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 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration-semantics.ts delete mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration-type-semantics.ts delete mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration.ts delete mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration-semantics.ts delete mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration-type-semantics.ts delete mode 100644 kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration.ts diff --git a/kipper/core/KipperParser.g4 b/kipper/core/KipperParser.g4 index b9d6e4ce2..6e44cd48f 100644 --- a/kipper/core/KipperParser.g4 +++ b/kipper/core/KipperParser.g4 @@ -85,28 +85,25 @@ parameterDeclaration ; interfaceDeclaration - : 'interface' Identifier '{' interfaceMemberList? '}' - ; - -interfaceMemberList - : interfaceMemberDeclaration+ + : 'interface' declarator '{' interfaceMemberDeclaration* '}' ; interfaceMemberDeclaration - : propertySignature - | methodSignature + : interfacePropertyDeclaration + | interfaceMethodDeclaration ; -propertySignature - : Identifier ':' typeSpecifierExpression SemiColon +interfacePropertyDeclaration + : declarator ':' typeSpecifierExpression SemiColon ; -methodSignature - : Identifier '(' parameterList? ')' '->' typeSpecifierExpression SemiColon +interfaceMethodDeclaration + : declarator '(' parameterList? ')' ':' typeSpecifierExpression SemiColon ; + classDeclaration - : 'class' Identifier '{' '}' + : 'class' declarator '{' '}' ; // -- Statements diff --git a/kipper/core/src/compiler/ast/ast-generator.ts b/kipper/core/src/compiler/ast/ast-generator.ts index 30060a0ec..ca9f72078 100644 --- a/kipper/core/src/compiler/ast/ast-generator.ts +++ b/kipper/core/src/compiler/ast/ast-generator.ts @@ -9,7 +9,7 @@ import type { ParserStatementContext, } from "./common"; import type { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; -import { +import type { ActualAdditiveExpressionContext, ActualAssignmentExpressionContext, ActualBitwiseAndExpressionContext, @@ -25,7 +25,8 @@ import { ActualRelationalExpressionContext, ArrayPrimaryExpressionContext, BoolPrimaryExpressionContext, - BracketNotationMemberAccessExpressionContext, ClassDeclarationContext, + BracketNotationMemberAccessExpressionContext, + ClassDeclarationContext, CompilationUnitContext, CompoundStatementContext, DeclarationContext, @@ -48,7 +49,10 @@ import { IncrementOrDecrementPostfixExpressionContext, IncrementOrDecrementUnaryExpressionContext, InitDeclaratorContext, - InitializerContext, InterfaceDeclarationContext, InterfaceMemberDeclarationContext, + InitializerContext, + InterfaceDeclarationContext, + InterfaceMethodDeclarationContext, + InterfacePropertyDeclarationContext, JumpStatementContext, KipperParserListener, KipperParserRuleContext, @@ -73,6 +77,7 @@ import { VoidOrNullOrUndefinedPrimaryExpressionContext, WhileLoopIterationStatementContext, } from "../parser"; +import { InterfaceMemberDeclarationContext } from "../parser"; import type { KipperProgramContext } from "../program-ctx"; import type { CompilableASTNode } from "./compilable-ast-node"; import type { ParserRuleContext } from "antlr4ts/ParserRuleContext"; @@ -1075,8 +1080,16 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi */ public exitInterfaceDeclaration: (ctx: InterfaceDeclarationContext) => void = this.handleExitingTreeNode; - public enterInterfaceMemberDeclaration: (ctx: InterfaceMemberDeclarationContext) => void = this.handleEnteringTreeNode; - public exitInterfaceMemberDeclaration: (ctx: InterfaceMemberDeclarationContext) => void = this.handleExitingTreeNode; + public enterInterfacePropertyDeclaration: (ctx: InterfacePropertyDeclarationContext) => void = + this.handleEnteringTreeNode; + + public exitInterfacePropertyDeclaration: (ctx: InterfacePropertyDeclarationContext) => void = + this.handleExitingTreeNode; + + public enterInterfaceMethodDeclaration: (ctx: InterfaceMethodDeclarationContext) => void = + this.handleEnteringTreeNode; + + public exitInterfaceMethodDeclaration: (ctx: InterfaceMethodDeclarationContext) => void = this.handleExitingTreeNode; /** * Enter a parse tree produced by `KipperParser.classDeclaration`. diff --git a/kipper/core/src/compiler/ast/common/ast-types.ts b/kipper/core/src/compiler/ast/common/ast-types.ts index b7bff485c..9dba585cf 100644 --- a/kipper/core/src/compiler/ast/common/ast-types.ts +++ b/kipper/core/src/compiler/ast/common/ast-types.ts @@ -31,6 +31,8 @@ import type { IncrementOrDecrementPostfixExpressionContext, IncrementOrDecrementUnaryExpressionContext, InterfaceDeclarationContext, + InterfaceMethodDeclarationContext, + InterfacePropertyDeclarationContext, JumpStatementContext, KindParseRuleMapping, LogicalAndExpressionContext, @@ -50,6 +52,8 @@ import type { VoidOrNullOrUndefinedPrimaryExpressionContext, WhileLoopIterationStatementContext, } from "../../parser"; +import { InterfaceMemberDeclarationContext } from "../../parser"; +import { InterfaceMemberDeclaration } from "../nodes"; /** * Union type of all usable expression rule context classes implemented by the {@link ParseRuleKindMapping} for an @@ -111,6 +115,8 @@ export type ParserDeclarationContext = | ParameterDeclarationContext | VariableDeclarationContext | InterfaceDeclarationContext + | InterfacePropertyDeclarationContext + | InterfaceMethodDeclarationContext | ClassDeclarationContext; /** @@ -132,7 +138,8 @@ export type ASTDeclarationKind = | typeof ParseRuleKindMapping.RULE_parameterDeclaration | typeof ParseRuleKindMapping.RULE_variableDeclaration | typeof ParseRuleKindMapping.RULE_interfaceDeclaration - | typeof ParseRuleKindMapping.RULE_interfaceMemberList + | typeof ParseRuleKindMapping.RULE_interfacePropertyDeclaration + | typeof ParseRuleKindMapping.RULE_interfaceMethodDeclaration | typeof ParseRuleKindMapping.RULE_classDeclaration; /** @@ -210,7 +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_interfaceMemberList] + | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_interfacePropertyDeclaration] + | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_interfaceMethodDeclaration] | (typeof KindParseRuleMapping)[typeof ParseRuleKindMapping.RULE_classDeclaration]; /** 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 2277a55dd..db60e3d32 100644 --- a/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts +++ b/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts @@ -32,7 +32,10 @@ import { IfStatementContext, IncrementOrDecrementPostfixExpressionContext, IncrementOrDecrementUnaryExpressionContext, - InterfaceDeclarationContext, InterfaceMemberDeclarationContext, + InterfaceDeclarationContext, + InterfaceMemberDeclarationContext, + InterfaceMethodDeclarationContext, + InterfacePropertyDeclarationContext, JumpStatementContext, LogicalAndExpressionContext, LogicalOrExpressionContext, @@ -63,6 +66,7 @@ import type { ASTStatementRuleName, } from "../common"; import type { Declaration, Expression, Statement } from "../nodes"; +import { InterfaceMemberDeclaration, InterfaceMemberDeclarationSemantics } from "../nodes"; import { AdditiveExpression, ArrayPrimaryExpression, @@ -110,10 +114,8 @@ import { VoidOrNullOrUndefinedPrimaryExpression, WhileLoopIterationStatement, } from "../nodes"; -import { InterfacePropertyDeclaration } from "../nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration"; -import { - InterfaceMemberListDeclaration -} from "../nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration"; +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. @@ -132,7 +134,8 @@ export class ASTNodeMapper { [ParseRuleKindMapping.RULE_variableDeclaration]: VariableDeclaration, [ParseRuleKindMapping.RULE_parameterDeclaration]: ParameterDeclaration, [ParseRuleKindMapping.RULE_interfaceDeclaration]: InterfaceDeclaration, - [ParseRuleKindMapping.RULE_interfaceMemberList]: InterfaceMemberListDeclaration, + [ParseRuleKindMapping.RULE_interfacePropertyDeclaration]: InterfacePropertyDeclaration, + [ParseRuleKindMapping.RULE_interfaceMethodDeclaration]: InterfaceMethodDeclaration, [ParseRuleKindMapping.RULE_classDeclaration]: ClassDeclaration, } satisfies Record>; @@ -202,7 +205,8 @@ export class ASTNodeMapper { [ParseRuleKindMapping.RULE_variableDeclaration]: VariableDeclarationContext, [ParseRuleKindMapping.RULE_parameterDeclaration]: ParameterDeclarationContext, [ParseRuleKindMapping.RULE_interfaceDeclaration]: InterfaceDeclarationContext, - [ParseRuleKindMapping.RULE_interfaceMemberList]: InterfaceMemberDeclarationContext, + [ParseRuleKindMapping.RULE_interfacePropertyDeclaration]: InterfacePropertyDeclarationContext, + [ParseRuleKindMapping.RULE_interfaceMethodDeclaration]: InterfaceMethodDeclarationContext, [ParseRuleKindMapping.RULE_classDeclaration]: ClassDeclarationContext, } satisfies Record; @@ -277,7 +281,8 @@ export class ASTNodeMapper { RULE_variableDeclaration: VariableDeclaration, RULE_parameterDeclaration: ParameterDeclaration, RULE_interfaceDeclaration: InterfaceDeclaration, - RULE_interfaceMemberList: InterfaceMemberListDeclaration, + RULE_interfacePropertyDeclaration: InterfacePropertyDeclaration, + RULE_interfaceMethodDeclaration: InterfaceMethodDeclaration, RULE_classDeclaration: ClassDeclaration, } satisfies Record>; 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..6f7a19afa 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,6 @@ export * from "./interface-declaration"; export * from "./interface-declaration-semantics"; export * from "./interface-declaration-type-semantics"; + +export * from "./interface-member-declaration"; +export * from "./interface-member-declaration/interface-property-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 22c1b5ad7..35dbcf469 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 @@ -8,8 +8,9 @@ import type { CompilableNodeParent } from "../../../../compilable-ast-node"; import type { ScopeTypeDeclaration } from "../../../../../analysis"; import type { InterfaceDeclarationContext } from "../../../../../parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../parser"; -import { KipperNotImplementedError } from "../../../../../../errors"; +import { KipperNotImplementedError, UnableToDetermineSemanticDataError } from "../../../../../../errors"; import { TypeDeclaration } from "../type-declaration"; +import type { InterfaceMemberDeclaration } from "./interface-member-declaration"; /** * Represents an interface declaration in the Kipper language, which may contain methods and fields declarations. @@ -108,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, + }; } /** 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..368e753ef --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/index.ts @@ -0,0 +1,3 @@ +export * from "./interface-member-declaration-semantics"; +export * from "./interface-member-declaration-semantics"; +export * from "./interface-member-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..97045d241 --- /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.11.0 + */ +export interface InterfaceMemberDeclarationSemantics extends TypeDeclarationSemantics { + /** + * The identifier of the interface member. + * @since 0.11.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..a231830cf --- /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.11.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..e4d51662a --- /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 "../../../../../../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.11.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.11.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.11.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.11.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..a62bfff98 --- /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 "../../../../../../../analysis"; + +/** + * Semantics for AST Node {@link InterfacePropertyDeclaration}. + * @since 0.11.0 + */ +export interface InterfaceMethodDeclarationSemantics extends TypeDeclarationSemantics { + /** + * The identifier of this member property. + * @since 0.11.0 + */ + identifier: string; + + /** + * The return type of this method. + * @since 0.11.0 + */ + parameters: Array; + + /** + * The return type of this method. + * @since 0.11.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..c58af048f --- /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,7 @@ +import type { TypeDeclarationTypeSemantics } from "../../../type-declaration-type-semantics"; + +/** + * + * @since 0.11.0 + */ +export interface InterfaceMethodDeclarationTypeSemantics extends TypeDeclarationTypeSemantics {} 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..6ab7466ff --- /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,181 @@ +/** + * Represents a class declaration in the Kipper language, which may contain methods and fields. + * @since 0.11.0 + */ +import type { ScopeTypeDeclaration } from "../../../../../../../analysis"; +import { RawType } from "../../../../../../../analysis"; +import type { InterfaceMethodDeclarationContext } from "../../../../../../../parser"; +import { CompoundStatementContext, DeclaratorContext } from "../../../../../../../parser"; +import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../../../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.11.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.11.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.11.0 + */ + public override get kind() { + return InterfaceMethodDeclaration.kind; + } + + /** + * The static rule name for this AST Node. + * @since 0.11.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.11.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.11.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.11.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, + }; + } + + /** + * 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.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..51fbbab16 --- /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 "../../../../../../../analysis"; + +/** + * Semantics for AST Node {@link InterfacePropertyDeclaration}. + * @since 0.11.0 + */ +export interface InterfacePropertyDeclarationSemantics extends TypeDeclarationSemantics { + /** + * The identifier of this member property. + * @since 0.11.0 + */ + identifier: string; + /** + * The type of this member property. + * @since 0.11.0 + */ + typeSpecifier: IdentifierTypeSpecifierExpression; + /** + * The type of the value as a string. + * + * The identifier of the {@link typeSpecifier.semanticData.identifier typeSpecifier}. + * @since 0.11.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..dd32b67f3 --- /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,14 @@ +import type { TypeDeclarationTypeSemantics } from "../../../type-declaration-type-semantics"; +import type { ProcessedType } from "../../../../../../../analysis"; + +/** + * Type semantics for AST Node {@link InterfacePropertyDeclaration}. + * @since 0.11.0 + */ +export interface InterfacePropertyDeclarationTypeSemantics extends TypeDeclarationTypeSemantics { + /** + * The processed type of this member property. + * @since 0.11.0 + */ + valueType: 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..513bcbd4a --- /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.11.0 + */ +import type { ScopeTypeDeclaration } from "../../../../../../../analysis"; +import { RawType } from "../../../../../../../analysis"; +import type { InterfacePropertyDeclarationContext } from "../../../../../../../parser"; +import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../../../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.11.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.11.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.11.0 + */ + public override get kind() { + return InterfacePropertyDeclaration.kind; + } + + /** + * The static rule name for this AST Node. + * @since 0.11.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.11.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.11.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.11.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 = { + 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.11.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/interface-declaration/interface-member-list-declaration/interface-member-list-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration-semantics.ts deleted file mode 100644 index 5a8e62c3c..000000000 --- a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration-semantics.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { TypeDeclarationSemantics } from "../../type-declaration-semantics"; - -export interface InterfaceMemberListDeclarationSemantics extends TypeDeclarationSemantics { - identifier: string; - - //some array that holds Members -} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration-type-semantics.ts deleted file mode 100644 index d37f94157..000000000 --- a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration-type-semantics.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { TypeDeclarationTypeSemantics } from "../../type-declaration-type-semantics"; - -export interface InterfaceMemberListDeclarationTypeSemantics extends TypeDeclarationTypeSemantics { - -} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration.ts deleted file mode 100644 index 819daa75e..000000000 --- a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-list-declaration/interface-member-list-declaration.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { TranslatedCodeLine } from "../../../../../../const"; -import type { TargetASTNodeSemanticAnalyser, TargetASTNodeCodeGenerator } from "../../../../../../target-presets"; -import type { InterfaceMemberListDeclarationSemantics } from "./interface-member-list-declaration-semantics"; -import type { InterfaceMemberListDeclarationTypeSemantics } from "./interface-member-list-declaration-type-semantics"; -import { Declaration } from "../../../declaration"; -import type { ASTDeclarationKind, ASTDeclarationRuleName } from "../../../../../common"; - -export class InterfaceMemberListDeclaration extends Declaration - { - public get kind(): ASTDeclarationKind { - throw new Error("Method not implemented."); - } - public get ruleName(): ASTDeclarationRuleName { - throw new Error("Method not implemented."); - } - protected primarySemanticAnalysis?(): Promise { - throw new Error("Method not implemented."); - } - protected primarySemanticTypeChecking?(): Promise { - throw new Error("Method not implemented."); - } - protected checkForWarnings?(): Promise { - throw new Error("Method not implemented."); - } - - public targetSemanticAnalysis: TargetASTNodeSemanticAnalyser | undefined; - // @ts-ignore - public targetCodeGenerator: TargetASTNodeCodeGenerator; -} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration-semantics.ts deleted file mode 100644 index 27b15356a..000000000 --- a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration-semantics.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Semantics for AST Node {@link InterfaceMemberProperty}. - * @since 0.11.0 - */ - -import type { TypeDeclarationSemantics } from "../../type-declaration-semantics"; -import type { IdentifierTypeSpecifierExpression } from "../../../../expressions"; - -/** - * Semantics for AST Node {@link InterfaceMemberProperty}. - * @since 0.11.0 - */ -export interface InterfaceMemberSemantics extends TypeDeclarationSemantics { - /** - * The identifier of this member property. - * @since 0.11.0 - */ - identifier: string; - - /** - * The type of this member property. - * @since 0.11.0 - */ - type: IdentifierTypeSpecifierExpression; -} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration-type-semantics.ts deleted file mode 100644 index 6ac6ed963..000000000 --- a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration-type-semantics.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TypeDeclarationTypeSemantics } from "../../type-declaration-type-semantics"; - -export interface InterfacePropertyDeclarationTypeSemantics extends TypeDeclarationTypeSemantics {} diff --git a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration.ts b/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration.ts deleted file mode 100644 index bc2a0d957..000000000 --- a/kipper/core/src/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-property-declaration/interface-property-declaration.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { TranslatedCodeLine } from "../../../../../../const"; -import type { TargetASTNodeSemanticAnalyser, TargetASTNodeCodeGenerator } from "../../../../../../target-presets"; -import type { ASTDeclarationKind, ASTDeclarationRuleName } from "../../../../../common"; -import { Declaration } from "../../../declaration"; -import type { InterfacePropertyDeclarationTypeSemantics } from "./interface-property-declaration-type-semantics"; -import type { InterfaceMemberSemantics } from "./interface-property-declaration-semantics"; - -export class InterfacePropertyDeclaration extends Declaration< - InterfaceMemberSemantics, - InterfacePropertyDeclarationTypeSemantics -> { - public get kind(): ASTDeclarationKind { - throw new Error("Method not implemented."); - } - public get ruleName(): ASTDeclarationRuleName { - throw new Error("Method not implemented."); - } - protected primarySemanticAnalysis?(): Promise { - throw new Error("Method not implemented."); - } - protected primarySemanticTypeChecking?(): Promise { - throw new Error("Method not implemented."); - } - protected checkForWarnings = undefined; - - public targetSemanticAnalysis: TargetASTNodeSemanticAnalyser | undefined; - //@ts-ignore - public targetCodeGenerator: TargetASTNodeCodeGenerator; -} 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 63863fe46..015e9a734 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 "../../../../par 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/parser/antlr/KipperLexer.ts b/kipper/core/src/compiler/parser/antlr/KipperLexer.ts index d5ef16faa..9d4046409 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperLexer.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperLexer.ts @@ -1,8 +1,6 @@ // Generated from ./KipperLexer.g4 by ANTLR 4.9.0-SNAPSHOT - - import KipperLexerBase from "./base/KipperLexerBase"; - +import KipperLexerBase from "./base/KipperLexerBase"; import { ATN } from "antlr4ts/atn/ATN"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; @@ -17,7 +15,6 @@ import { VocabularyImpl } from "antlr4ts/VocabularyImpl"; import * as Utils from "antlr4ts/misc/Utils"; - export class KipperLexer extends KipperLexerBase { public static readonly FStringExpStart = 1; public static readonly BlockComment = 2; @@ -109,70 +106,298 @@ export class KipperLexer extends KipperLexerBase { public static readonly DOUBLE_QUOTE_FSTRING = 2; // tslint:disable:no-trailing-whitespace - public static readonly channelNames: string[] = [ - "DEFAULT_TOKEN_CHANNEL", "HIDDEN", "COMMENT", - ]; + public static readonly channelNames: string[] = ["DEFAULT_TOKEN_CHANNEL", "HIDDEN", "COMMENT"]; // tslint:disable:no-trailing-whitespace - public static readonly modeNames: string[] = [ - "DEFAULT_MODE", "SINGLE_QUOTE_FSTRING", "DOUBLE_QUOTE_FSTRING", - ]; + public static readonly modeNames: string[] = ["DEFAULT_MODE", "SINGLE_QUOTE_FSTRING", "DOUBLE_QUOTE_FSTRING"]; public static readonly ruleNames: string[] = [ - "BlockComment", "LineComment", "Const", "Var", "As", "Spread", "Switch", - "Case", "Default", "Break", "Continue", "Do", "While", "If", "Else", "For", - "Enum", "DefFunc", "Return", "CallFunc", "RetIndicator", "Class", "Interface", - "True", "False", "Typeof", "Void", "Null", "Undefined", "Comma", "SemiColon", - "QuestionMark", "Colon", "LeftParen", "RightParen", "LeftBracket", "RightBracket", - "FStringExpEnd", "LeftBrace", "RightBrace", "Plus", "PlusPlus", "Minus", - "MinusMinus", "Star", "Div", "Mod", "PowerTo", "AndAnd", "OrOr", "Not", - "Assign", "PlusAssign", "MinusAssign", "StarAssign", "DivAssign", "ModAssign", - "Equal", "NotEqual", "Less", "LessEqual", "Greater", "GreaterEqual", "BitwiseAnd", - "BitwiseOr", "BitwiseXor", "BitwiseNot", "BitwiseZeroFillLeftShift", "BitwiseSignedRightShift", - "BitwiseZeroFillRightShift", "Dot", "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", - "DoubleQuoteStringLiteral", "FloatingConstant", "Whitespace", "Newline", - "FStringSingleQuoteStart", "FStringDoubleQuoteStart", "FStringSingleQuoteExpStart", - "FStringSingleQuoteEnd", "FStringSingleQuoteAtom", "FStringDoubleQuoteExpStart", - "FStringDoubleQuoteEnd", "FStringDoubleQuoteAtom", "IdentifierNondigit", - "Nondigit", "Digit", "DecimalConstant", "BinaryConstant", "OctalConstant", - "HexadecimalConstant", "NonzeroDigit", "BinaryDigit", "OctalDigit", "HexadecimalDigit", - "DecimalFloatingConstant", "FractionalConstant", "ExponentPart", "DigitSequence", - "Sign", "CCharSequence", "CChar", "EscapeSequence", "SimpleEscapeSequence", - "OctalEscapeSequence", "HexadecimalEscapeSequence", "SingleQuoteFStringSCharSequence", - "SingleQuoteFStringSChar", "DoubleQuoteFStringSCharSequence", "DoubleQuoteFStringSChar", - "SingleQuoteSCharSequence", "SingleQuoteSChar", "DoubleQuoteSCharSequence", + "BlockComment", + "LineComment", + "Const", + "Var", + "As", + "Spread", + "Switch", + "Case", + "Default", + "Break", + "Continue", + "Do", + "While", + "If", + "Else", + "For", + "Enum", + "DefFunc", + "Return", + "CallFunc", + "RetIndicator", + "Class", + "Interface", + "True", + "False", + "Typeof", + "Void", + "Null", + "Undefined", + "Comma", + "SemiColon", + "QuestionMark", + "Colon", + "LeftParen", + "RightParen", + "LeftBracket", + "RightBracket", + "FStringExpEnd", + "LeftBrace", + "RightBrace", + "Plus", + "PlusPlus", + "Minus", + "MinusMinus", + "Star", + "Div", + "Mod", + "PowerTo", + "AndAnd", + "OrOr", + "Not", + "Assign", + "PlusAssign", + "MinusAssign", + "StarAssign", + "DivAssign", + "ModAssign", + "Equal", + "NotEqual", + "Less", + "LessEqual", + "Greater", + "GreaterEqual", + "BitwiseAnd", + "BitwiseOr", + "BitwiseXor", + "BitwiseNot", + "BitwiseZeroFillLeftShift", + "BitwiseSignedRightShift", + "BitwiseZeroFillRightShift", + "Dot", + "Identifier", + "IntegerConstant", + "SingleQuoteStringLiteral", + "DoubleQuoteStringLiteral", + "FloatingConstant", + "Whitespace", + "Newline", + "FStringSingleQuoteStart", + "FStringDoubleQuoteStart", + "FStringSingleQuoteExpStart", + "FStringSingleQuoteEnd", + "FStringSingleQuoteAtom", + "FStringDoubleQuoteExpStart", + "FStringDoubleQuoteEnd", + "FStringDoubleQuoteAtom", + "IdentifierNondigit", + "Nondigit", + "Digit", + "DecimalConstant", + "BinaryConstant", + "OctalConstant", + "HexadecimalConstant", + "NonzeroDigit", + "BinaryDigit", + "OctalDigit", + "HexadecimalDigit", + "DecimalFloatingConstant", + "FractionalConstant", + "ExponentPart", + "DigitSequence", + "Sign", + "CCharSequence", + "CChar", + "EscapeSequence", + "SimpleEscapeSequence", + "OctalEscapeSequence", + "HexadecimalEscapeSequence", + "SingleQuoteFStringSCharSequence", + "SingleQuoteFStringSChar", + "DoubleQuoteFStringSCharSequence", + "DoubleQuoteFStringSChar", + "SingleQuoteSCharSequence", + "SingleQuoteSChar", + "DoubleQuoteSCharSequence", "DoubleQuoteSChar", ]; private static readonly _LITERAL_NAMES: Array = [ - undefined, undefined, undefined, undefined, "'const'", "'var'", "'as'", - "'...'", "'switch'", "'case'", "'default'", "'break'", "'continue'", "'do'", - "'while'", "'if'", "'else'", "'for'", "'enum'", "'def'", "'return'", "'call'", - "'->'", "'class'", "'interface'", "'true'", "'false'", "'typeof'", "'void'", - "'null'", "'undefined'", "','", "';'", "'?'", "':'", "'('", "')'", "'['", - "']'", undefined, "'{'", "'}'", "'+'", "'++'", "'-'", "'--'", "'*'", "'/'", - "'%'", "'**'", "'&&'", "'||'", "'!'", "'='", "'+='", "'-='", "'*='", "'/='", - "'%='", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'&'", "'|'", "'^'", - "'~'", "'<<'", "'>>'", "'>>>'", "'.'", + undefined, + undefined, + undefined, + undefined, + "'const'", + "'var'", + "'as'", + "'...'", + "'switch'", + "'case'", + "'default'", + "'break'", + "'continue'", + "'do'", + "'while'", + "'if'", + "'else'", + "'for'", + "'enum'", + "'def'", + "'return'", + "'call'", + "'->'", + "'class'", + "'interface'", + "'true'", + "'false'", + "'typeof'", + "'void'", + "'null'", + "'undefined'", + "','", + "';'", + "'?'", + "':'", + "'('", + "')'", + "'['", + "']'", + undefined, + "'{'", + "'}'", + "'+'", + "'++'", + "'-'", + "'--'", + "'*'", + "'/'", + "'%'", + "'**'", + "'&&'", + "'||'", + "'!'", + "'='", + "'+='", + "'-='", + "'*='", + "'/='", + "'%='", + "'=='", + "'!='", + "'<'", + "'<='", + "'>'", + "'>='", + "'&'", + "'|'", + "'^'", + "'~'", + "'<<'", + "'>>'", + "'>>>'", + "'.'", ]; private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, "FStringExpStart", "BlockComment", "LineComment", "Const", - "Var", "As", "Spread", "Switch", "Case", "Default", "Break", "Continue", - "Do", "While", "If", "Else", "For", "Enum", "DefFunc", "Return", "CallFunc", - "RetIndicator", "Class", "Interface", "True", "False", "Typeof", "Void", - "Null", "Undefined", "Comma", "SemiColon", "QuestionMark", "Colon", "LeftParen", - "RightParen", "LeftBracket", "RightBracket", "FStringExpEnd", "LeftBrace", - "RightBrace", "Plus", "PlusPlus", "Minus", "MinusMinus", "Star", "Div", - "Mod", "PowerTo", "AndAnd", "OrOr", "Not", "Assign", "PlusAssign", "MinusAssign", - "StarAssign", "DivAssign", "ModAssign", "Equal", "NotEqual", "Less", "LessEqual", - "Greater", "GreaterEqual", "BitwiseAnd", "BitwiseOr", "BitwiseXor", "BitwiseNot", - "BitwiseZeroFillLeftShift", "BitwiseSignedRightShift", "BitwiseZeroFillRightShift", - "Dot", "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", "DoubleQuoteStringLiteral", - "FloatingConstant", "Whitespace", "Newline", "FStringSingleQuoteStart", - "FStringDoubleQuoteStart", "FStringSingleQuoteEnd", "FStringSingleQuoteAtom", - "FStringDoubleQuoteEnd", "FStringDoubleQuoteAtom", + undefined, + "FStringExpStart", + "BlockComment", + "LineComment", + "Const", + "Var", + "As", + "Spread", + "Switch", + "Case", + "Default", + "Break", + "Continue", + "Do", + "While", + "If", + "Else", + "For", + "Enum", + "DefFunc", + "Return", + "CallFunc", + "RetIndicator", + "Class", + "Interface", + "True", + "False", + "Typeof", + "Void", + "Null", + "Undefined", + "Comma", + "SemiColon", + "QuestionMark", + "Colon", + "LeftParen", + "RightParen", + "LeftBracket", + "RightBracket", + "FStringExpEnd", + "LeftBrace", + "RightBrace", + "Plus", + "PlusPlus", + "Minus", + "MinusMinus", + "Star", + "Div", + "Mod", + "PowerTo", + "AndAnd", + "OrOr", + "Not", + "Assign", + "PlusAssign", + "MinusAssign", + "StarAssign", + "DivAssign", + "ModAssign", + "Equal", + "NotEqual", + "Less", + "LessEqual", + "Greater", + "GreaterEqual", + "BitwiseAnd", + "BitwiseOr", + "BitwiseXor", + "BitwiseNot", + "BitwiseZeroFillLeftShift", + "BitwiseSignedRightShift", + "BitwiseZeroFillRightShift", + "Dot", + "Identifier", + "IntegerConstant", + "SingleQuoteStringLiteral", + "DoubleQuoteStringLiteral", + "FloatingConstant", + "Whitespace", + "Newline", + "FStringSingleQuoteStart", + "FStringDoubleQuoteStart", + "FStringSingleQuoteEnd", + "FStringSingleQuoteAtom", + "FStringDoubleQuoteEnd", + "FStringDoubleQuoteAtom", ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(KipperLexer._LITERAL_NAMES, KipperLexer._SYMBOLIC_NAMES, []); + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( + KipperLexer._LITERAL_NAMES, + KipperLexer._SYMBOLIC_NAMES, + [], + ); // @Override // @NotNull @@ -181,107 +406,116 @@ export class KipperLexer extends KipperLexerBase { } // tslint:enable:no-trailing-whitespace - constructor(input: CharStream) { super(input); this._interp = new LexerATNSimulator(KipperLexer._ATN, this); } // @Override - public get grammarFileName(): string { return "KipperLexer.g4"; } + public get grammarFileName(): string { + return "KipperLexer.g4"; + } // @Override - public get ruleNames(): string[] { return KipperLexer.ruleNames; } + public get ruleNames(): string[] { + return KipperLexer.ruleNames; + } // @Override - public get serializedATN(): string { return KipperLexer._serializedATN; } + public get serializedATN(): string { + return KipperLexer._serializedATN; + } // @Override - public get channelNames(): string[] { return KipperLexer.channelNames; } + public get channelNames(): string[] { + return KipperLexer.channelNames; + } // @Override - public get modeNames(): string[] { return KipperLexer.modeNames; } + public get modeNames(): string[] { + return KipperLexer.modeNames; + } // @Override public action(_localctx: RuleContext, ruleIndex: number, actionIndex: number): void { switch (ruleIndex) { - case 78: - this.FStringSingleQuoteStart_action(_localctx, actionIndex); - break; + case 78: + this.FStringSingleQuoteStart_action(_localctx, actionIndex); + break; - case 79: - this.FStringDoubleQuoteStart_action(_localctx, actionIndex); - break; + case 79: + this.FStringDoubleQuoteStart_action(_localctx, actionIndex); + break; - case 81: - this.FStringSingleQuoteEnd_action(_localctx, actionIndex); - break; + case 81: + this.FStringSingleQuoteEnd_action(_localctx, actionIndex); + break; - case 84: - this.FStringDoubleQuoteEnd_action(_localctx, actionIndex); - break; + case 84: + this.FStringDoubleQuoteEnd_action(_localctx, actionIndex); + break; } } private FStringSingleQuoteStart_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 0: - this.incrementFStringDepth() - break; + case 0: + this.incrementFStringDepth(); + break; } } private FStringDoubleQuoteStart_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 1: - this.incrementFStringDepth() - break; + case 1: + this.incrementFStringDepth(); + break; } } private FStringSingleQuoteEnd_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 2: - this.decrementFStringDepth() - break; + case 2: + this.decrementFStringDepth(); + break; } } private FStringDoubleQuoteEnd_action(_localctx: RuleContext, actionIndex: number): void { switch (actionIndex) { - case 3: - this.decrementFStringDepth() - break; + case 3: + this.decrementFStringDepth(); + break; } } // @Override public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { switch (ruleIndex) { - case 37: - return this.FStringExpEnd_sempred(_localctx, predIndex); + case 37: + return this.FStringExpEnd_sempred(_localctx, predIndex); - case 80: - return this.FStringSingleQuoteExpStart_sempred(_localctx, predIndex); + case 80: + return this.FStringSingleQuoteExpStart_sempred(_localctx, predIndex); - case 83: - return this.FStringDoubleQuoteExpStart_sempred(_localctx, predIndex); + case 83: + return this.FStringDoubleQuoteExpStart_sempred(_localctx, predIndex); } return true; } private FStringExpEnd_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 0: - return this.insideFString(); + case 0: + return this.insideFString(); } return true; } private FStringSingleQuoteExpStart_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 1: - return this.insideFString(); + case 1: + return this.insideFString(); } return true; } private FStringDoubleQuoteExpStart_sempred(_localctx: RuleContext, predIndex: number): boolean { switch (predIndex) { - case 2: - return this.insideFString(); + case 2: + return this.insideFString(); } return true; } @@ -295,7 +529,7 @@ export class KipperLexer extends KipperLexerBase { "\x04\x12\t\x12\x04\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16" + "\x04\x17\t\x17\x04\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B" + "\x04\x1C\t\x1C\x04\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!" + - "\t!\x04\"\t\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(\x04)\t" + + "\t!\x04\"\t\"\x04#\t#\x04$\t$\x04%\t%\x04&\t&\x04'\t'\x04(\t(\x04)\t" + ")\x04*\t*\x04+\t+\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x040\t0\x041\t1\x04" + "2\t2\x043\t3\x044\t4\x045\t5\x046\t6\x047\t7\x048\t8\x049\t9\x04:\t:\x04" + ";\t;\x04<\t<\x04=\t=\x04>\t>\x04?\t?\x04@\t@\x04A\tA\x04B\tB\x04C\tC\x04" + @@ -323,8 +557,8 @@ export class KipperLexer extends KipperLexerBase { "\x1A\x03\x1A\x03\x1A\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03" + "\x1B\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1D\x03\x1D\x03\x1D\x03" + "\x1D\x03\x1D\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E\x03" + - "\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x03 \x03 \x03!\x03!\x03\"\x03\"\x03" + - "#\x03#\x03$\x03$\x03%\x03%\x03&\x03&\x03\'\x03\'\x03\'\x03\'\x03\'\x03" + + '\x1E\x03\x1E\x03\x1E\x03\x1F\x03\x1F\x03 \x03 \x03!\x03!\x03"\x03"\x03' + + "#\x03#\x03$\x03$\x03%\x03%\x03&\x03&\x03'\x03'\x03'\x03'\x03'\x03" + "(\x03(\x03)\x03)\x03*\x03*\x03+\x03+\x03+\x03,\x03,\x03-\x03-\x03-\x03" + ".\x03.\x03/\x03/\x030\x030\x031\x031\x031\x032\x032\x032\x033\x033\x03" + "3\x034\x034\x035\x035\x036\x036\x036\x037\x037\x037\x038\x038\x038\x03" + @@ -351,9 +585,9 @@ export class KipperLexer extends KipperLexerBase { "s\u02D8\ns\x03t\x06t\u02DB\nt\rt\x0Et\u02DC\x03u\x03u\x05u\u02E1\nu\x03" + "\xF3\x02\x02v\x05\x02\x04\x07\x02\x05\t\x02\x06\v\x02\x07\r\x02\b\x0F" + "\x02\t\x11\x02\n\x13\x02\v\x15\x02\f\x17\x02\r\x19\x02\x0E\x1B\x02\x0F" + - "\x1D\x02\x10\x1F\x02\x11!\x02\x12#\x02\x13%\x02\x14\'\x02\x15)\x02\x16" + + "\x1D\x02\x10\x1F\x02\x11!\x02\x12#\x02\x13%\x02\x14'\x02\x15)\x02\x16" + "+\x02\x17-\x02\x18/\x02\x191\x02\x1A3\x02\x1B5\x02\x1C7\x02\x1D9\x02\x1E" + - ";\x02\x1F=\x02 ?\x02!A\x02\"C\x02#E\x02$G\x02%I\x02&K\x02\'M\x02(O\x02" + + ";\x02\x1F=\x02 ?\x02!A\x02\"C\x02#E\x02$G\x02%I\x02&K\x02'M\x02(O\x02" + ")Q\x02*S\x02+U\x02,W\x02-Y\x02.[\x02/]\x020_\x021a\x022c\x023e\x024g\x02" + "5i\x026k\x027m\x028o\x029q\x02:s\x02;u\x02{\x02?}\x02@\x7F" + "\x02A\x81\x02B\x83\x02C\x85\x02D\x87\x02E\x89\x02F\x8B\x02G\x8D\x02H\x8F" + @@ -365,7 +599,7 @@ export class KipperLexer extends KipperLexerBase { "\x02\xD3\x02\x02\xD5\x02\x02\xD7\x02\x02\xD9\x02\x02\xDB\x02\x02\xDD\x02" + "\x02\xDF\x02\x02\xE1\x02\x02\xE3\x02\x02\xE5\x02\x02\xE7\x02\x02\xE9\x02" + "\x02\xEB\x02\x02\x05\x02\x03\x04\x14\x05\x02\f\f\x0F\x0F\u202A\u202B\x06" + - "\x02\v\v\r\x0E\"\"\xA2\xA2\x05\x02C\\aac|\x03\x022;\x04\x02DDdd\x04\x02" + + '\x02\v\v\r\x0E""\xA2\xA2\x05\x02C\\aac|\x03\x022;\x04\x02DDdd\x04\x02' + "QQqq\x04\x02ZZzz\x03\x023;\x03\x0223\x03\x0229\x05\x022;CHch\x04\x02G" + "Ggg\x04\x02--//\x06\x02\f\f\x0F\x0F))^^\x0E\x02$$))AA^^cdhhppttvvxx}}" + "\x7F\x7F\b\x02\f\f\x0F\x0F))^^}}\x7F\x7F\b\x02\f\f\x0F\x0F$$^^}}\x7F\x7F" + @@ -375,7 +609,7 @@ export class KipperLexer extends KipperLexerBase { "\x02\x02\x02\x15\x03\x02\x02\x02\x02\x17\x03\x02\x02\x02\x02\x19\x03\x02" + "\x02\x02\x02\x1B\x03\x02\x02\x02\x02\x1D\x03\x02\x02\x02\x02\x1F\x03\x02" + "\x02\x02\x02!\x03\x02\x02\x02\x02#\x03\x02\x02\x02\x02%\x03\x02\x02\x02" + - "\x02\'\x03\x02\x02\x02\x02)\x03\x02\x02\x02\x02+\x03\x02\x02\x02\x02-" + + "\x02'\x03\x02\x02\x02\x02)\x03\x02\x02\x02\x02+\x03\x02\x02\x02\x02-" + "\x03\x02\x02\x02\x02/\x03\x02\x02\x02\x021\x03\x02\x02\x02\x023\x03\x02" + "\x02\x02\x025\x03\x02\x02\x02\x027\x03\x02\x02\x02\x029\x03\x02\x02\x02" + "\x02;\x03\x02\x02\x02\x02=\x03\x02\x02\x02\x02?\x03\x02\x02\x02\x02A\x03" + @@ -402,7 +636,7 @@ export class KipperLexer extends KipperLexerBase { "\x02\x02\x15\u0123\x03\x02\x02\x02\x17\u012B\x03\x02\x02\x02\x19\u0131" + "\x03\x02\x02\x02\x1B\u013A\x03\x02\x02\x02\x1D\u013D\x03\x02\x02\x02\x1F" + "\u0143\x03\x02\x02\x02!\u0146\x03\x02\x02\x02#\u014B\x03\x02\x02\x02%" + - "\u014F\x03\x02\x02\x02\'\u0154\x03\x02\x02\x02)\u0158\x03\x02\x02\x02" + + "\u014F\x03\x02\x02\x02'\u0154\x03\x02\x02\x02)\u0158\x03\x02\x02\x02" + "+\u015F\x03\x02\x02\x02-\u0164\x03\x02\x02\x02/\u0167\x03\x02\x02\x02" + "1\u016D\x03\x02\x02\x023\u0177\x03\x02\x02\x025\u017C\x03\x02\x02\x02" + "7\u0182\x03\x02\x02\x029\u0189\x03\x02\x02\x02;\u018E\x03\x02\x02\x02" + @@ -470,7 +704,7 @@ export class KipperLexer extends KipperLexerBase { "\x02\u0141\u0142\x07g\x02\x02\u0142\x1E\x03\x02\x02\x02\u0143\u0144\x07" + "k\x02\x02\u0144\u0145\x07h\x02\x02\u0145 \x03\x02\x02\x02\u0146\u0147" + "\x07g\x02\x02\u0147\u0148\x07n\x02\x02\u0148\u0149\x07u\x02\x02\u0149" + - "\u014A\x07g\x02\x02\u014A\"\x03\x02\x02\x02\u014B\u014C\x07h\x02\x02\u014C" + + '\u014A\x07g\x02\x02\u014A"\x03\x02\x02\x02\u014B\u014C\x07h\x02\x02\u014C' + "\u014D\x07q\x02\x02\u014D\u014E\x07t\x02\x02\u014E$\x03\x02\x02\x02\u014F" + "\u0150\x07g\x02\x02\u0150\u0151\x07p\x02\x02\u0151\u0152\x07w\x02\x02" + "\u0152\u0153\x07o\x02\x02\u0153&\x03\x02\x02\x02\u0154\u0155\x07f\x02" + @@ -505,14 +739,14 @@ export class KipperLexer extends KipperLexerBase { "\x02\x02\u01A5\u01A6\x07*\x02\x02\u01A6H\x03\x02\x02\x02\u01A7\u01A8\x07" + "+\x02\x02\u01A8J\x03\x02\x02\x02\u01A9\u01AA\x07]\x02\x02\u01AAL\x03\x02" + "\x02\x02\u01AB\u01AC\x07_\x02\x02\u01ACN\x03\x02\x02\x02\u01AD\u01AE\x06" + - "\'\x02\x02\u01AE\u01AF\x07\x7F\x02\x02\u01AF\u01B0\x03\x02\x02\x02\u01B0" + - "\u01B1\b\'\x03\x02\u01B1P\x03\x02\x02\x02\u01B2\u01B3\x07}\x02\x02\u01B3" + + "'\x02\x02\u01AE\u01AF\x07\x7F\x02\x02\u01AF\u01B0\x03\x02\x02\x02\u01B0" + + "\u01B1\b'\x03\x02\u01B1P\x03\x02\x02\x02\u01B2\u01B3\x07}\x02\x02\u01B3" + "R\x03\x02\x02\x02\u01B4\u01B5\x07\x7F\x02\x02\u01B5T\x03\x02\x02\x02\u01B6" + "\u01B7\x07-\x02\x02\u01B7V\x03\x02\x02\x02\u01B8\u01B9\x07-\x02\x02\u01B9" + "\u01BA\x07-\x02\x02\u01BAX\x03\x02\x02\x02\u01BB\u01BC\x07/\x02\x02\u01BC" + "Z\x03\x02\x02\x02\u01BD\u01BE\x07/\x02\x02\u01BE\u01BF\x07/\x02\x02\u01BF" + "\\\x03\x02\x02\x02\u01C0\u01C1\x07,\x02\x02\u01C1^\x03\x02\x02\x02\u01C2" + - "\u01C3\x071\x02\x02\u01C3`\x03\x02\x02\x02\u01C4\u01C5\x07\'\x02\x02\u01C5" + + "\u01C3\x071\x02\x02\u01C3`\x03\x02\x02\x02\u01C4\u01C5\x07'\x02\x02\u01C5" + "b\x03\x02\x02\x02\u01C6\u01C7\x07,\x02\x02\u01C7\u01C8\x07,\x02\x02\u01C8" + "d\x03\x02\x02\x02\u01C9\u01CA\x07(\x02\x02\u01CA\u01CB\x07(\x02\x02\u01CB" + "f\x03\x02\x02\x02\u01CC\u01CD\x07~\x02\x02\u01CD\u01CE\x07~\x02\x02\u01CE" + @@ -521,7 +755,7 @@ export class KipperLexer extends KipperLexerBase { "\u01D5\x07?\x02\x02\u01D5n\x03\x02\x02\x02\u01D6\u01D7\x07/\x02\x02\u01D7" + "\u01D8\x07?\x02\x02\u01D8p\x03\x02\x02\x02\u01D9\u01DA\x07,\x02\x02\u01DA" + "\u01DB\x07?\x02\x02\u01DBr\x03\x02\x02\x02\u01DC\u01DD\x071\x02\x02\u01DD" + - "\u01DE\x07?\x02\x02\u01DEt\x03\x02\x02\x02\u01DF\u01E0\x07\'\x02\x02\u01E0" + + "\u01DE\x07?\x02\x02\u01DEt\x03\x02\x02\x02\u01DF\u01E0\x07'\x02\x02\u01E0" + "\u01E1\x07?\x02\x02\u01E1v\x03\x02\x02\x02\u01E2\u01E3\x07?\x02\x02\u01E3" + "\u01E4\x07?\x02\x02\u01E4x\x03\x02\x02\x02\u01E5\u01E6\x07#\x02\x02\u01E6" + "\u01E7\x07?\x02\x02\u01E7z\x03\x02\x02\x02\u01E8\u01E9\x07>\x02\x02\u01E9" + @@ -637,10 +871,7 @@ export class KipperLexer extends KipperLexerBase { "\x02\x02\x03\x02\x03P\x02\x07\x03\x02\x03Q\x03\x07\x04\x02\t\x03\x02\x07" + "\x02\x02\x03S\x04\x03V\x05"; public static readonly _serializedATN: string = Utils.join( - [ - KipperLexer._serializedATNSegment0, - KipperLexer._serializedATNSegment1, - ], + [KipperLexer._serializedATNSegment0, KipperLexer._serializedATNSegment1], "", ); public static __ATN: ATN; @@ -651,6 +882,4 @@ export class KipperLexer extends KipperLexerBase { return KipperLexer.__ATN; } - } - diff --git a/kipper/core/src/compiler/parser/antlr/KipperParser.interp b/kipper/core/src/compiler/parser/antlr/KipperParser.interp index 817a0f49d..b7aaa93c1 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParser.interp +++ b/kipper/core/src/compiler/parser/antlr/KipperParser.interp @@ -191,10 +191,9 @@ functionDeclaration parameterList parameterDeclaration interfaceDeclaration -interfaceMemberList interfaceMemberDeclaration -propertySignature -methodSignature +interfacePropertyDeclaration +interfaceMethodDeclaration classDeclaration statement compoundStatement @@ -260,4 +259,4 @@ typeSpecifierIdentifier atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 87, 739, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 3, 2, 5, 2, 168, 10, 2, 3, 2, 3, 2, 3, 3, 6, 3, 173, 10, 3, 13, 3, 14, 3, 174, 3, 4, 3, 4, 3, 5, 6, 5, 180, 10, 5, 13, 5, 14, 5, 181, 3, 6, 3, 6, 3, 6, 5, 6, 187, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 195, 10, 7, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 207, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 219, 10, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 225, 10, 14, 3, 15, 3, 15, 3, 15, 7, 15, 230, 10, 15, 12, 15, 14, 15, 233, 11, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 5, 17, 243, 10, 17, 3, 17, 3, 17, 3, 18, 6, 18, 248, 10, 18, 13, 18, 14, 18, 249, 3, 19, 3, 19, 5, 19, 254, 10, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 5, 21, 264, 10, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 5, 23, 282, 10, 23, 3, 24, 3, 24, 3, 24, 5, 24, 287, 10, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 5, 26, 298, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 5, 27, 307, 10, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 7, 28, 315, 10, 28, 12, 28, 14, 28, 318, 11, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 5, 29, 330, 10, 29, 3, 30, 3, 30, 3, 30, 5, 30, 335, 10, 30, 3, 31, 3, 31, 3, 31, 3, 31, 5, 31, 341, 10, 31, 3, 31, 3, 31, 5, 31, 345, 10, 31, 3, 31, 3, 31, 3, 31, 3, 31, 5, 31, 351, 10, 31, 3, 31, 3, 31, 3, 31, 3, 31, 5, 31, 357, 10, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 5, 35, 381, 10, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 394, 10, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 5, 41, 408, 10, 41, 3, 42, 3, 42, 3, 43, 3, 43, 7, 43, 414, 10, 43, 12, 43, 14, 43, 417, 11, 43, 3, 43, 3, 43, 3, 43, 7, 43, 422, 10, 43, 12, 43, 14, 43, 425, 11, 43, 3, 43, 5, 43, 428, 10, 43, 3, 44, 3, 44, 3, 44, 5, 44, 433, 10, 44, 3, 44, 5, 44, 436, 10, 44, 3, 45, 3, 45, 3, 45, 5, 45, 441, 10, 45, 3, 45, 5, 45, 444, 10, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 7, 47, 452, 10, 47, 12, 47, 14, 47, 455, 11, 47, 5, 47, 457, 10, 47, 3, 47, 5, 47, 460, 10, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 7, 48, 468, 10, 48, 12, 48, 14, 48, 471, 11, 48, 5, 48, 473, 10, 48, 3, 48, 5, 48, 476, 10, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 492, 10, 51, 3, 51, 3, 51, 3, 51, 5, 51, 497, 10, 51, 3, 51, 3, 51, 3, 51, 5, 51, 502, 10, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 7, 51, 518, 10, 51, 12, 51, 14, 51, 521, 11, 51, 3, 52, 3, 52, 3, 52, 7, 52, 526, 10, 52, 12, 52, 14, 52, 529, 11, 52, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 542, 10, 55, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 548, 10, 55, 3, 55, 3, 55, 3, 56, 3, 56, 5, 56, 554, 10, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 5, 58, 562, 10, 58, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 5, 63, 579, 10, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 7, 64, 587, 10, 64, 12, 64, 14, 64, 590, 11, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 7, 65, 598, 10, 65, 12, 65, 14, 65, 601, 11, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 7, 66, 610, 10, 66, 12, 66, 14, 66, 613, 11, 66, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 7, 68, 623, 10, 68, 12, 68, 14, 68, 626, 11, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 7, 69, 634, 10, 69, 12, 69, 14, 69, 637, 11, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 7, 70, 645, 10, 70, 12, 70, 14, 70, 648, 11, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 7, 71, 656, 10, 71, 12, 71, 14, 71, 659, 11, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 7, 72, 667, 10, 72, 12, 72, 14, 72, 670, 11, 72, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 7, 73, 678, 10, 73, 12, 73, 14, 73, 681, 11, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 7, 74, 689, 10, 74, 12, 74, 14, 74, 692, 11, 74, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 5, 75, 701, 10, 75, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 5, 76, 708, 10, 76, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 7, 78, 715, 10, 78, 12, 78, 14, 78, 718, 11, 78, 3, 79, 3, 79, 3, 79, 5, 79, 723, 10, 79, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 2, 2, 13, 100, 126, 128, 130, 134, 136, 138, 140, 142, 144, 146, 84, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 70, 2, 72, 2, 74, 2, 76, 2, 78, 2, 80, 2, 82, 2, 84, 2, 86, 2, 88, 2, 90, 2, 92, 2, 94, 2, 96, 2, 98, 2, 100, 2, 102, 2, 104, 2, 106, 2, 108, 2, 110, 2, 112, 2, 114, 2, 116, 2, 118, 2, 120, 2, 122, 2, 124, 2, 126, 2, 128, 2, 130, 2, 132, 2, 134, 2, 136, 2, 138, 2, 140, 2, 142, 2, 144, 2, 146, 2, 148, 2, 150, 2, 152, 2, 154, 2, 156, 2, 158, 2, 160, 2, 162, 2, 164, 2, 2, 17, 3, 2, 6, 7, 3, 2, 13, 14, 3, 2, 27, 28, 3, 2, 77, 78, 4, 2, 76, 76, 79, 79, 3, 2, 30, 32, 4, 2, 45, 45, 47, 47, 6, 2, 44, 44, 46, 46, 54, 54, 70, 70, 3, 2, 48, 51, 4, 2, 44, 44, 46, 46, 3, 2, 71, 73, 3, 2, 63, 66, 3, 2, 61, 62, 3, 2, 55, 60, 4, 2, 30, 32, 75, 75, 2, 740, 2, 167, 3, 2, 2, 2, 4, 172, 3, 2, 2, 2, 6, 176, 3, 2, 2, 2, 8, 179, 3, 2, 2, 2, 10, 186, 3, 2, 2, 2, 12, 194, 3, 2, 2, 2, 14, 196, 3, 2, 2, 2, 16, 199, 3, 2, 2, 2, 18, 201, 3, 2, 2, 2, 20, 208, 3, 2, 2, 2, 22, 210, 3, 2, 2, 2, 24, 212, 3, 2, 2, 2, 26, 214, 3, 2, 2, 2, 28, 226, 3, 2, 2, 2, 30, 234, 3, 2, 2, 2, 32, 238, 3, 2, 2, 2, 34, 247, 3, 2, 2, 2, 36, 253, 3, 2, 2, 2, 38, 255, 3, 2, 2, 2, 40, 260, 3, 2, 2, 2, 42, 270, 3, 2, 2, 2, 44, 281, 3, 2, 2, 2, 46, 283, 3, 2, 2, 2, 48, 290, 3, 2, 2, 2, 50, 297, 3, 2, 2, 2, 52, 299, 3, 2, 2, 2, 54, 308, 3, 2, 2, 2, 56, 329, 3, 2, 2, 2, 58, 334, 3, 2, 2, 2, 60, 336, 3, 2, 2, 2, 62, 361, 3, 2, 2, 2, 64, 367, 3, 2, 2, 2, 66, 375, 3, 2, 2, 2, 68, 378, 3, 2, 2, 2, 70, 393, 3, 2, 2, 2, 72, 395, 3, 2, 2, 2, 74, 399, 3, 2, 2, 2, 76, 401, 3, 2, 2, 2, 78, 403, 3, 2, 2, 2, 80, 407, 3, 2, 2, 2, 82, 409, 3, 2, 2, 2, 84, 427, 3, 2, 2, 2, 86, 435, 3, 2, 2, 2, 88, 443, 3, 2, 2, 2, 90, 445, 3, 2, 2, 2, 92, 447, 3, 2, 2, 2, 94, 463, 3, 2, 2, 2, 96, 479, 3, 2, 2, 2, 98, 483, 3, 2, 2, 2, 100, 496, 3, 2, 2, 2, 102, 522, 3, 2, 2, 2, 104, 530, 3, 2, 2, 2, 106, 533, 3, 2, 2, 2, 108, 537, 3, 2, 2, 2, 110, 553, 3, 2, 2, 2, 112, 555, 3, 2, 2, 2, 114, 561, 3, 2, 2, 2, 116, 563, 3, 2, 2, 2, 118, 566, 3, 2, 2, 2, 120, 569, 3, 2, 2, 2, 122, 571, 3, 2, 2, 2, 124, 578, 3, 2, 2, 2, 126, 580, 3, 2, 2, 2, 128, 591, 3, 2, 2, 2, 130, 602, 3, 2, 2, 2, 132, 614, 3, 2, 2, 2, 134, 616, 3, 2, 2, 2, 136, 627, 3, 2, 2, 2, 138, 638, 3, 2, 2, 2, 140, 649, 3, 2, 2, 2, 142, 660, 3, 2, 2, 2, 144, 671, 3, 2, 2, 2, 146, 682, 3, 2, 2, 2, 148, 700, 3, 2, 2, 2, 150, 707, 3, 2, 2, 2, 152, 709, 3, 2, 2, 2, 154, 711, 3, 2, 2, 2, 156, 722, 3, 2, 2, 2, 158, 724, 3, 2, 2, 2, 160, 726, 3, 2, 2, 2, 162, 731, 3, 2, 2, 2, 164, 736, 3, 2, 2, 2, 166, 168, 5, 4, 3, 2, 167, 166, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 170, 7, 2, 2, 3, 170, 3, 3, 2, 2, 2, 171, 173, 5, 6, 4, 2, 172, 171, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 174, 172, 3, 2, 2, 2, 174, 175, 3, 2, 2, 2, 175, 5, 3, 2, 2, 2, 176, 177, 5, 8, 5, 2, 177, 7, 3, 2, 2, 2, 178, 180, 5, 10, 6, 2, 179, 178, 3, 2, 2, 2, 180, 181, 3, 2, 2, 2, 181, 179, 3, 2, 2, 2, 181, 182, 3, 2, 2, 2, 182, 9, 3, 2, 2, 2, 183, 187, 5, 44, 23, 2, 184, 187, 5, 12, 7, 2, 185, 187, 7, 34, 2, 2, 186, 183, 3, 2, 2, 2, 186, 184, 3, 2, 2, 2, 186, 185, 3, 2, 2, 2, 187, 11, 3, 2, 2, 2, 188, 189, 5, 14, 8, 2, 189, 190, 7, 34, 2, 2, 190, 195, 3, 2, 2, 2, 191, 195, 5, 26, 14, 2, 192, 195, 5, 32, 17, 2, 193, 195, 5, 42, 22, 2, 194, 188, 3, 2, 2, 2, 194, 191, 3, 2, 2, 2, 194, 192, 3, 2, 2, 2, 194, 193, 3, 2, 2, 2, 195, 13, 3, 2, 2, 2, 196, 197, 5, 16, 9, 2, 197, 198, 5, 18, 10, 2, 198, 15, 3, 2, 2, 2, 199, 200, 9, 2, 2, 2, 200, 17, 3, 2, 2, 2, 201, 202, 5, 22, 12, 2, 202, 203, 7, 36, 2, 2, 203, 206, 5, 156, 79, 2, 204, 205, 7, 55, 2, 2, 205, 207, 5, 20, 11, 2, 206, 204, 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 19, 3, 2, 2, 2, 208, 209, 5, 150, 76, 2, 209, 21, 3, 2, 2, 2, 210, 211, 5, 24, 13, 2, 211, 23, 3, 2, 2, 2, 212, 213, 7, 75, 2, 2, 213, 25, 3, 2, 2, 2, 214, 215, 7, 21, 2, 2, 215, 216, 5, 22, 12, 2, 216, 218, 7, 37, 2, 2, 217, 219, 5, 28, 15, 2, 218, 217, 3, 2, 2, 2, 218, 219, 3, 2, 2, 2, 219, 220, 3, 2, 2, 2, 220, 221, 7, 38, 2, 2, 221, 222, 7, 24, 2, 2, 222, 224, 5, 156, 79, 2, 223, 225, 5, 46, 24, 2, 224, 223, 3, 2, 2, 2, 224, 225, 3, 2, 2, 2, 225, 27, 3, 2, 2, 2, 226, 231, 5, 30, 16, 2, 227, 228, 7, 33, 2, 2, 228, 230, 5, 30, 16, 2, 229, 227, 3, 2, 2, 2, 230, 233, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 29, 3, 2, 2, 2, 233, 231, 3, 2, 2, 2, 234, 235, 5, 22, 12, 2, 235, 236, 7, 36, 2, 2, 236, 237, 5, 156, 79, 2, 237, 31, 3, 2, 2, 2, 238, 239, 7, 26, 2, 2, 239, 240, 7, 75, 2, 2, 240, 242, 7, 42, 2, 2, 241, 243, 5, 34, 18, 2, 242, 241, 3, 2, 2, 2, 242, 243, 3, 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 245, 7, 43, 2, 2, 245, 33, 3, 2, 2, 2, 246, 248, 5, 36, 19, 2, 247, 246, 3, 2, 2, 2, 248, 249, 3, 2, 2, 2, 249, 247, 3, 2, 2, 2, 249, 250, 3, 2, 2, 2, 250, 35, 3, 2, 2, 2, 251, 254, 5, 38, 20, 2, 252, 254, 5, 40, 21, 2, 253, 251, 3, 2, 2, 2, 253, 252, 3, 2, 2, 2, 254, 37, 3, 2, 2, 2, 255, 256, 7, 75, 2, 2, 256, 257, 7, 36, 2, 2, 257, 258, 5, 156, 79, 2, 258, 259, 7, 34, 2, 2, 259, 39, 3, 2, 2, 2, 260, 261, 7, 75, 2, 2, 261, 263, 7, 37, 2, 2, 262, 264, 5, 28, 15, 2, 263, 262, 3, 2, 2, 2, 263, 264, 3, 2, 2, 2, 264, 265, 3, 2, 2, 2, 265, 266, 7, 38, 2, 2, 266, 267, 7, 24, 2, 2, 267, 268, 5, 156, 79, 2, 268, 269, 7, 34, 2, 2, 269, 41, 3, 2, 2, 2, 270, 271, 7, 25, 2, 2, 271, 272, 7, 75, 2, 2, 272, 273, 7, 42, 2, 2, 273, 274, 7, 43, 2, 2, 274, 43, 3, 2, 2, 2, 275, 282, 5, 48, 25, 2, 276, 282, 5, 50, 26, 2, 277, 282, 5, 58, 30, 2, 278, 282, 5, 66, 34, 2, 279, 282, 5, 68, 35, 2, 280, 282, 5, 46, 24, 2, 281, 275, 3, 2, 2, 2, 281, 276, 3, 2, 2, 2, 281, 277, 3, 2, 2, 2, 281, 278, 3, 2, 2, 2, 281, 279, 3, 2, 2, 2, 281, 280, 3, 2, 2, 2, 282, 45, 3, 2, 2, 2, 283, 284, 6, 24, 2, 2, 284, 286, 7, 42, 2, 2, 285, 287, 5, 8, 5, 2, 286, 285, 3, 2, 2, 2, 286, 287, 3, 2, 2, 2, 287, 288, 3, 2, 2, 2, 288, 289, 7, 43, 2, 2, 289, 47, 3, 2, 2, 2, 290, 291, 8, 25, 1, 2, 291, 292, 5, 154, 78, 2, 292, 293, 7, 34, 2, 2, 293, 294, 8, 25, 1, 2, 294, 49, 3, 2, 2, 2, 295, 298, 5, 52, 27, 2, 296, 298, 5, 54, 28, 2, 297, 295, 3, 2, 2, 2, 297, 296, 3, 2, 2, 2, 298, 51, 3, 2, 2, 2, 299, 300, 7, 17, 2, 2, 300, 301, 7, 37, 2, 2, 301, 302, 5, 154, 78, 2, 302, 303, 7, 38, 2, 2, 303, 306, 5, 44, 23, 2, 304, 305, 7, 18, 2, 2, 305, 307, 5, 44, 23, 2, 306, 304, 3, 2, 2, 2, 306, 307, 3, 2, 2, 2, 307, 53, 3, 2, 2, 2, 308, 309, 7, 10, 2, 2, 309, 310, 7, 37, 2, 2, 310, 311, 5, 154, 78, 2, 311, 312, 7, 38, 2, 2, 312, 316, 7, 42, 2, 2, 313, 315, 5, 56, 29, 2, 314, 313, 3, 2, 2, 2, 315, 318, 3, 2, 2, 2, 316, 314, 3, 2, 2, 2, 316, 317, 3, 2, 2, 2, 317, 319, 3, 2, 2, 2, 318, 316, 3, 2, 2, 2, 319, 320, 7, 43, 2, 2, 320, 55, 3, 2, 2, 2, 321, 322, 7, 11, 2, 2, 322, 323, 5, 154, 78, 2, 323, 324, 7, 36, 2, 2, 324, 325, 5, 44, 23, 2, 325, 330, 3, 2, 2, 2, 326, 327, 7, 12, 2, 2, 327, 328, 7, 36, 2, 2, 328, 330, 5, 44, 23, 2, 329, 321, 3, 2, 2, 2, 329, 326, 3, 2, 2, 2, 330, 57, 3, 2, 2, 2, 331, 335, 5, 60, 31, 2, 332, 335, 5, 62, 32, 2, 333, 335, 5, 64, 33, 2, 334, 331, 3, 2, 2, 2, 334, 332, 3, 2, 2, 2, 334, 333, 3, 2, 2, 2, 335, 59, 3, 2, 2, 2, 336, 337, 7, 19, 2, 2, 337, 344, 7, 37, 2, 2, 338, 341, 5, 14, 8, 2, 339, 341, 5, 154, 78, 2, 340, 338, 3, 2, 2, 2, 340, 339, 3, 2, 2, 2, 341, 342, 3, 2, 2, 2, 342, 343, 8, 31, 1, 2, 343, 345, 3, 2, 2, 2, 344, 340, 3, 2, 2, 2, 344, 345, 3, 2, 2, 2, 345, 346, 3, 2, 2, 2, 346, 350, 7, 34, 2, 2, 347, 348, 5, 154, 78, 2, 348, 349, 8, 31, 1, 2, 349, 351, 3, 2, 2, 2, 350, 347, 3, 2, 2, 2, 350, 351, 3, 2, 2, 2, 351, 352, 3, 2, 2, 2, 352, 356, 7, 34, 2, 2, 353, 354, 5, 154, 78, 2, 354, 355, 8, 31, 1, 2, 355, 357, 3, 2, 2, 2, 356, 353, 3, 2, 2, 2, 356, 357, 3, 2, 2, 2, 357, 358, 3, 2, 2, 2, 358, 359, 7, 38, 2, 2, 359, 360, 5, 44, 23, 2, 360, 61, 3, 2, 2, 2, 361, 362, 7, 16, 2, 2, 362, 363, 7, 37, 2, 2, 363, 364, 5, 154, 78, 2, 364, 365, 7, 38, 2, 2, 365, 366, 5, 44, 23, 2, 366, 63, 3, 2, 2, 2, 367, 368, 7, 15, 2, 2, 368, 369, 5, 44, 23, 2, 369, 370, 7, 16, 2, 2, 370, 371, 7, 37, 2, 2, 371, 372, 5, 154, 78, 2, 372, 373, 7, 38, 2, 2, 373, 374, 7, 34, 2, 2, 374, 65, 3, 2, 2, 2, 375, 376, 9, 3, 2, 2, 376, 377, 7, 34, 2, 2, 377, 67, 3, 2, 2, 2, 378, 380, 7, 22, 2, 2, 379, 381, 5, 154, 78, 2, 380, 379, 3, 2, 2, 2, 380, 381, 3, 2, 2, 2, 381, 382, 3, 2, 2, 2, 382, 383, 7, 34, 2, 2, 383, 69, 3, 2, 2, 2, 384, 394, 5, 72, 37, 2, 385, 394, 5, 92, 47, 2, 386, 394, 5, 94, 48, 2, 387, 394, 5, 74, 38, 2, 388, 394, 5, 76, 39, 2, 389, 394, 5, 82, 42, 2, 390, 394, 5, 84, 43, 2, 391, 394, 5, 90, 46, 2, 392, 394, 5, 98, 50, 2, 393, 384, 3, 2, 2, 2, 393, 385, 3, 2, 2, 2, 393, 386, 3, 2, 2, 2, 393, 387, 3, 2, 2, 2, 393, 388, 3, 2, 2, 2, 393, 389, 3, 2, 2, 2, 393, 390, 3, 2, 2, 2, 393, 391, 3, 2, 2, 2, 393, 392, 3, 2, 2, 2, 394, 71, 3, 2, 2, 2, 395, 396, 7, 37, 2, 2, 396, 397, 5, 154, 78, 2, 397, 398, 7, 38, 2, 2, 398, 73, 3, 2, 2, 2, 399, 400, 9, 4, 2, 2, 400, 75, 3, 2, 2, 2, 401, 402, 5, 78, 40, 2, 402, 77, 3, 2, 2, 2, 403, 404, 7, 75, 2, 2, 404, 79, 3, 2, 2, 2, 405, 408, 5, 78, 40, 2, 406, 408, 5, 82, 42, 2, 407, 405, 3, 2, 2, 2, 407, 406, 3, 2, 2, 2, 408, 81, 3, 2, 2, 2, 409, 410, 9, 5, 2, 2, 410, 83, 3, 2, 2, 2, 411, 415, 7, 82, 2, 2, 412, 414, 5, 86, 44, 2, 413, 412, 3, 2, 2, 2, 414, 417, 3, 2, 2, 2, 415, 413, 3, 2, 2, 2, 415, 416, 3, 2, 2, 2, 416, 418, 3, 2, 2, 2, 417, 415, 3, 2, 2, 2, 418, 428, 7, 84, 2, 2, 419, 423, 7, 83, 2, 2, 420, 422, 5, 88, 45, 2, 421, 420, 3, 2, 2, 2, 422, 425, 3, 2, 2, 2, 423, 421, 3, 2, 2, 2, 423, 424, 3, 2, 2, 2, 424, 426, 3, 2, 2, 2, 425, 423, 3, 2, 2, 2, 426, 428, 7, 86, 2, 2, 427, 411, 3, 2, 2, 2, 427, 419, 3, 2, 2, 2, 428, 85, 3, 2, 2, 2, 429, 436, 7, 85, 2, 2, 430, 432, 7, 3, 2, 2, 431, 433, 5, 154, 78, 2, 432, 431, 3, 2, 2, 2, 432, 433, 3, 2, 2, 2, 433, 434, 3, 2, 2, 2, 434, 436, 7, 41, 2, 2, 435, 429, 3, 2, 2, 2, 435, 430, 3, 2, 2, 2, 436, 87, 3, 2, 2, 2, 437, 444, 7, 87, 2, 2, 438, 440, 7, 3, 2, 2, 439, 441, 5, 154, 78, 2, 440, 439, 3, 2, 2, 2, 440, 441, 3, 2, 2, 2, 441, 442, 3, 2, 2, 2, 442, 444, 7, 41, 2, 2, 443, 437, 3, 2, 2, 2, 443, 438, 3, 2, 2, 2, 444, 89, 3, 2, 2, 2, 445, 446, 9, 6, 2, 2, 446, 91, 3, 2, 2, 2, 447, 456, 7, 39, 2, 2, 448, 453, 5, 154, 78, 2, 449, 450, 7, 33, 2, 2, 450, 452, 5, 154, 78, 2, 451, 449, 3, 2, 2, 2, 452, 455, 3, 2, 2, 2, 453, 451, 3, 2, 2, 2, 453, 454, 3, 2, 2, 2, 454, 457, 3, 2, 2, 2, 455, 453, 3, 2, 2, 2, 456, 448, 3, 2, 2, 2, 456, 457, 3, 2, 2, 2, 457, 459, 3, 2, 2, 2, 458, 460, 7, 33, 2, 2, 459, 458, 3, 2, 2, 2, 459, 460, 3, 2, 2, 2, 460, 461, 3, 2, 2, 2, 461, 462, 7, 40, 2, 2, 462, 93, 3, 2, 2, 2, 463, 472, 7, 42, 2, 2, 464, 469, 5, 96, 49, 2, 465, 466, 7, 33, 2, 2, 466, 468, 5, 96, 49, 2, 467, 465, 3, 2, 2, 2, 468, 471, 3, 2, 2, 2, 469, 467, 3, 2, 2, 2, 469, 470, 3, 2, 2, 2, 470, 473, 3, 2, 2, 2, 471, 469, 3, 2, 2, 2, 472, 464, 3, 2, 2, 2, 472, 473, 3, 2, 2, 2, 473, 475, 3, 2, 2, 2, 474, 476, 7, 33, 2, 2, 475, 474, 3, 2, 2, 2, 475, 476, 3, 2, 2, 2, 476, 477, 3, 2, 2, 2, 477, 478, 7, 43, 2, 2, 478, 95, 3, 2, 2, 2, 479, 480, 5, 80, 41, 2, 480, 481, 7, 36, 2, 2, 481, 482, 5, 154, 78, 2, 482, 97, 3, 2, 2, 2, 483, 484, 9, 7, 2, 2, 484, 99, 3, 2, 2, 2, 485, 486, 8, 51, 1, 2, 486, 497, 5, 70, 36, 2, 487, 488, 7, 23, 2, 2, 488, 489, 5, 100, 51, 2, 489, 491, 7, 37, 2, 2, 490, 492, 5, 102, 52, 2, 491, 490, 3, 2, 2, 2, 491, 492, 3, 2, 2, 2, 492, 493, 3, 2, 2, 2, 493, 494, 7, 38, 2, 2, 494, 495, 8, 51, 1, 2, 495, 497, 3, 2, 2, 2, 496, 485, 3, 2, 2, 2, 496, 487, 3, 2, 2, 2, 497, 519, 3, 2, 2, 2, 498, 499, 12, 7, 2, 2, 499, 501, 7, 37, 2, 2, 500, 502, 5, 102, 52, 2, 501, 500, 3, 2, 2, 2, 501, 502, 3, 2, 2, 2, 502, 503, 3, 2, 2, 2, 503, 504, 7, 38, 2, 2, 504, 518, 8, 51, 1, 2, 505, 506, 12, 5, 2, 2, 506, 507, 5, 104, 53, 2, 507, 508, 8, 51, 1, 2, 508, 518, 3, 2, 2, 2, 509, 510, 12, 4, 2, 2, 510, 511, 5, 106, 54, 2, 511, 512, 8, 51, 1, 2, 512, 518, 3, 2, 2, 2, 513, 514, 12, 3, 2, 2, 514, 515, 5, 108, 55, 2, 515, 516, 8, 51, 1, 2, 516, 518, 3, 2, 2, 2, 517, 498, 3, 2, 2, 2, 517, 505, 3, 2, 2, 2, 517, 509, 3, 2, 2, 2, 517, 513, 3, 2, 2, 2, 518, 521, 3, 2, 2, 2, 519, 517, 3, 2, 2, 2, 519, 520, 3, 2, 2, 2, 520, 101, 3, 2, 2, 2, 521, 519, 3, 2, 2, 2, 522, 527, 5, 150, 76, 2, 523, 524, 7, 33, 2, 2, 524, 526, 5, 150, 76, 2, 525, 523, 3, 2, 2, 2, 526, 529, 3, 2, 2, 2, 527, 525, 3, 2, 2, 2, 527, 528, 3, 2, 2, 2, 528, 103, 3, 2, 2, 2, 529, 527, 3, 2, 2, 2, 530, 531, 7, 74, 2, 2, 531, 532, 5, 78, 40, 2, 532, 105, 3, 2, 2, 2, 533, 534, 7, 39, 2, 2, 534, 535, 5, 154, 78, 2, 535, 536, 7, 40, 2, 2, 536, 107, 3, 2, 2, 2, 537, 541, 7, 39, 2, 2, 538, 539, 5, 154, 78, 2, 539, 540, 8, 55, 1, 2, 540, 542, 3, 2, 2, 2, 541, 538, 3, 2, 2, 2, 541, 542, 3, 2, 2, 2, 542, 543, 3, 2, 2, 2, 543, 547, 7, 36, 2, 2, 544, 545, 5, 154, 78, 2, 545, 546, 8, 55, 1, 2, 546, 548, 3, 2, 2, 2, 547, 544, 3, 2, 2, 2, 547, 548, 3, 2, 2, 2, 548, 549, 3, 2, 2, 2, 549, 550, 7, 40, 2, 2, 550, 109, 3, 2, 2, 2, 551, 554, 5, 100, 51, 2, 552, 554, 5, 112, 57, 2, 553, 551, 3, 2, 2, 2, 553, 552, 3, 2, 2, 2, 554, 111, 3, 2, 2, 2, 555, 556, 5, 100, 51, 2, 556, 557, 5, 120, 61, 2, 557, 113, 3, 2, 2, 2, 558, 562, 5, 110, 56, 2, 559, 562, 5, 116, 59, 2, 560, 562, 5, 118, 60, 2, 561, 558, 3, 2, 2, 2, 561, 559, 3, 2, 2, 2, 561, 560, 3, 2, 2, 2, 562, 115, 3, 2, 2, 2, 563, 564, 5, 120, 61, 2, 564, 565, 5, 110, 56, 2, 565, 117, 3, 2, 2, 2, 566, 567, 5, 122, 62, 2, 567, 568, 5, 110, 56, 2, 568, 119, 3, 2, 2, 2, 569, 570, 9, 8, 2, 2, 570, 121, 3, 2, 2, 2, 571, 572, 9, 9, 2, 2, 572, 123, 3, 2, 2, 2, 573, 579, 5, 114, 58, 2, 574, 575, 5, 114, 58, 2, 575, 576, 7, 8, 2, 2, 576, 577, 5, 156, 79, 2, 577, 579, 3, 2, 2, 2, 578, 573, 3, 2, 2, 2, 578, 574, 3, 2, 2, 2, 579, 125, 3, 2, 2, 2, 580, 581, 8, 64, 1, 2, 581, 582, 5, 124, 63, 2, 582, 588, 3, 2, 2, 2, 583, 584, 12, 3, 2, 2, 584, 585, 9, 10, 2, 2, 585, 587, 5, 124, 63, 2, 586, 583, 3, 2, 2, 2, 587, 590, 3, 2, 2, 2, 588, 586, 3, 2, 2, 2, 588, 589, 3, 2, 2, 2, 589, 127, 3, 2, 2, 2, 590, 588, 3, 2, 2, 2, 591, 592, 8, 65, 1, 2, 592, 593, 5, 126, 64, 2, 593, 599, 3, 2, 2, 2, 594, 595, 12, 3, 2, 2, 595, 596, 9, 11, 2, 2, 596, 598, 5, 126, 64, 2, 597, 594, 3, 2, 2, 2, 598, 601, 3, 2, 2, 2, 599, 597, 3, 2, 2, 2, 599, 600, 3, 2, 2, 2, 600, 129, 3, 2, 2, 2, 601, 599, 3, 2, 2, 2, 602, 603, 8, 66, 1, 2, 603, 604, 5, 128, 65, 2, 604, 611, 3, 2, 2, 2, 605, 606, 12, 3, 2, 2, 606, 607, 5, 132, 67, 2, 607, 608, 5, 138, 70, 2, 608, 610, 3, 2, 2, 2, 609, 605, 3, 2, 2, 2, 610, 613, 3, 2, 2, 2, 611, 609, 3, 2, 2, 2, 611, 612, 3, 2, 2, 2, 612, 131, 3, 2, 2, 2, 613, 611, 3, 2, 2, 2, 614, 615, 9, 12, 2, 2, 615, 133, 3, 2, 2, 2, 616, 617, 8, 68, 1, 2, 617, 618, 5, 130, 66, 2, 618, 624, 3, 2, 2, 2, 619, 620, 12, 3, 2, 2, 620, 621, 9, 13, 2, 2, 621, 623, 5, 130, 66, 2, 622, 619, 3, 2, 2, 2, 623, 626, 3, 2, 2, 2, 624, 622, 3, 2, 2, 2, 624, 625, 3, 2, 2, 2, 625, 135, 3, 2, 2, 2, 626, 624, 3, 2, 2, 2, 627, 628, 8, 69, 1, 2, 628, 629, 5, 134, 68, 2, 629, 635, 3, 2, 2, 2, 630, 631, 12, 3, 2, 2, 631, 632, 9, 14, 2, 2, 632, 634, 5, 134, 68, 2, 633, 630, 3, 2, 2, 2, 634, 637, 3, 2, 2, 2, 635, 633, 3, 2, 2, 2, 635, 636, 3, 2, 2, 2, 636, 137, 3, 2, 2, 2, 637, 635, 3, 2, 2, 2, 638, 639, 8, 70, 1, 2, 639, 640, 5, 136, 69, 2, 640, 646, 3, 2, 2, 2, 641, 642, 12, 3, 2, 2, 642, 643, 7, 67, 2, 2, 643, 645, 5, 136, 69, 2, 644, 641, 3, 2, 2, 2, 645, 648, 3, 2, 2, 2, 646, 644, 3, 2, 2, 2, 646, 647, 3, 2, 2, 2, 647, 139, 3, 2, 2, 2, 648, 646, 3, 2, 2, 2, 649, 650, 8, 71, 1, 2, 650, 651, 5, 138, 70, 2, 651, 657, 3, 2, 2, 2, 652, 653, 12, 3, 2, 2, 653, 654, 7, 69, 2, 2, 654, 656, 5, 138, 70, 2, 655, 652, 3, 2, 2, 2, 656, 659, 3, 2, 2, 2, 657, 655, 3, 2, 2, 2, 657, 658, 3, 2, 2, 2, 658, 141, 3, 2, 2, 2, 659, 657, 3, 2, 2, 2, 660, 661, 8, 72, 1, 2, 661, 662, 5, 140, 71, 2, 662, 668, 3, 2, 2, 2, 663, 664, 12, 3, 2, 2, 664, 665, 7, 68, 2, 2, 665, 667, 5, 140, 71, 2, 666, 663, 3, 2, 2, 2, 667, 670, 3, 2, 2, 2, 668, 666, 3, 2, 2, 2, 668, 669, 3, 2, 2, 2, 669, 143, 3, 2, 2, 2, 670, 668, 3, 2, 2, 2, 671, 672, 8, 73, 1, 2, 672, 673, 5, 142, 72, 2, 673, 679, 3, 2, 2, 2, 674, 675, 12, 3, 2, 2, 675, 676, 7, 52, 2, 2, 676, 678, 5, 142, 72, 2, 677, 674, 3, 2, 2, 2, 678, 681, 3, 2, 2, 2, 679, 677, 3, 2, 2, 2, 679, 680, 3, 2, 2, 2, 680, 145, 3, 2, 2, 2, 681, 679, 3, 2, 2, 2, 682, 683, 8, 74, 1, 2, 683, 684, 5, 144, 73, 2, 684, 690, 3, 2, 2, 2, 685, 686, 12, 3, 2, 2, 686, 687, 7, 53, 2, 2, 687, 689, 5, 144, 73, 2, 688, 685, 3, 2, 2, 2, 689, 692, 3, 2, 2, 2, 690, 688, 3, 2, 2, 2, 690, 691, 3, 2, 2, 2, 691, 147, 3, 2, 2, 2, 692, 690, 3, 2, 2, 2, 693, 701, 5, 146, 74, 2, 694, 695, 5, 146, 74, 2, 695, 696, 7, 35, 2, 2, 696, 697, 5, 148, 75, 2, 697, 698, 7, 36, 2, 2, 698, 699, 5, 148, 75, 2, 699, 701, 3, 2, 2, 2, 700, 693, 3, 2, 2, 2, 700, 694, 3, 2, 2, 2, 701, 149, 3, 2, 2, 2, 702, 708, 5, 148, 75, 2, 703, 704, 5, 100, 51, 2, 704, 705, 5, 152, 77, 2, 705, 706, 5, 150, 76, 2, 706, 708, 3, 2, 2, 2, 707, 702, 3, 2, 2, 2, 707, 703, 3, 2, 2, 2, 708, 151, 3, 2, 2, 2, 709, 710, 9, 15, 2, 2, 710, 153, 3, 2, 2, 2, 711, 716, 5, 150, 76, 2, 712, 713, 7, 33, 2, 2, 713, 715, 5, 150, 76, 2, 714, 712, 3, 2, 2, 2, 715, 718, 3, 2, 2, 2, 716, 714, 3, 2, 2, 2, 716, 717, 3, 2, 2, 2, 717, 155, 3, 2, 2, 2, 718, 716, 3, 2, 2, 2, 719, 723, 5, 158, 80, 2, 720, 723, 5, 160, 81, 2, 721, 723, 5, 162, 82, 2, 722, 719, 3, 2, 2, 2, 722, 720, 3, 2, 2, 2, 722, 721, 3, 2, 2, 2, 723, 157, 3, 2, 2, 2, 724, 725, 5, 164, 83, 2, 725, 159, 3, 2, 2, 2, 726, 727, 5, 164, 83, 2, 727, 728, 7, 63, 2, 2, 728, 729, 5, 164, 83, 2, 729, 730, 7, 65, 2, 2, 730, 161, 3, 2, 2, 2, 731, 732, 7, 29, 2, 2, 732, 733, 7, 37, 2, 2, 733, 734, 5, 164, 83, 2, 734, 735, 7, 38, 2, 2, 735, 163, 3, 2, 2, 2, 736, 737, 9, 16, 2, 2, 737, 165, 3, 2, 2, 2, 67, 167, 174, 181, 186, 194, 206, 218, 224, 231, 242, 249, 253, 263, 281, 286, 297, 306, 316, 329, 334, 340, 344, 350, 356, 380, 393, 407, 415, 423, 427, 432, 435, 440, 443, 453, 456, 459, 469, 472, 475, 491, 496, 501, 517, 519, 527, 541, 547, 553, 561, 578, 588, 599, 611, 624, 635, 646, 657, 668, 679, 690, 700, 707, 716, 722] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 87, 735, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 3, 2, 5, 2, 166, 10, 2, 3, 2, 3, 2, 3, 3, 6, 3, 171, 10, 3, 13, 3, 14, 3, 172, 3, 4, 3, 4, 3, 5, 6, 5, 178, 10, 5, 13, 5, 14, 5, 179, 3, 6, 3, 6, 3, 6, 5, 6, 185, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 193, 10, 7, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 205, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 217, 10, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 223, 10, 14, 3, 15, 3, 15, 3, 15, 7, 15, 228, 10, 15, 12, 15, 14, 15, 231, 11, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 241, 10, 17, 12, 17, 14, 17, 244, 11, 17, 3, 17, 3, 17, 3, 18, 3, 18, 5, 18, 250, 10, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 5, 20, 260, 10, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 278, 10, 22, 3, 23, 3, 23, 3, 23, 5, 23, 283, 10, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 5, 25, 294, 10, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 303, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 7, 27, 311, 10, 27, 12, 27, 14, 27, 314, 11, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 326, 10, 28, 3, 29, 3, 29, 3, 29, 5, 29, 331, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 337, 10, 30, 3, 30, 3, 30, 5, 30, 341, 10, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 347, 10, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 353, 10, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 5, 34, 377, 10, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 390, 10, 35, 3, 36, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 5, 40, 404, 10, 40, 3, 41, 3, 41, 3, 42, 3, 42, 7, 42, 410, 10, 42, 12, 42, 14, 42, 413, 11, 42, 3, 42, 3, 42, 3, 42, 7, 42, 418, 10, 42, 12, 42, 14, 42, 421, 11, 42, 3, 42, 5, 42, 424, 10, 42, 3, 43, 3, 43, 3, 43, 5, 43, 429, 10, 43, 3, 43, 5, 43, 432, 10, 43, 3, 44, 3, 44, 3, 44, 5, 44, 437, 10, 44, 3, 44, 5, 44, 440, 10, 44, 3, 45, 3, 45, 3, 46, 3, 46, 3, 46, 3, 46, 7, 46, 448, 10, 46, 12, 46, 14, 46, 451, 11, 46, 5, 46, 453, 10, 46, 3, 46, 5, 46, 456, 10, 46, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 7, 47, 464, 10, 47, 12, 47, 14, 47, 467, 11, 47, 5, 47, 469, 10, 47, 3, 47, 5, 47, 472, 10, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 5, 50, 488, 10, 50, 3, 50, 3, 50, 3, 50, 5, 50, 493, 10, 50, 3, 50, 3, 50, 3, 50, 5, 50, 498, 10, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 7, 50, 514, 10, 50, 12, 50, 14, 50, 517, 11, 50, 3, 51, 3, 51, 3, 51, 7, 51, 522, 10, 51, 12, 51, 14, 51, 525, 11, 51, 3, 52, 3, 52, 3, 52, 3, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 5, 54, 538, 10, 54, 3, 54, 3, 54, 3, 54, 3, 54, 5, 54, 544, 10, 54, 3, 54, 3, 54, 3, 55, 3, 55, 5, 55, 550, 10, 55, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 5, 57, 558, 10, 57, 3, 58, 3, 58, 3, 58, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 61, 3, 61, 3, 62, 3, 62, 3, 62, 3, 62, 3, 62, 5, 62, 575, 10, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 7, 63, 583, 10, 63, 12, 63, 14, 63, 586, 11, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 7, 64, 594, 10, 64, 12, 64, 14, 64, 597, 11, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 7, 65, 606, 10, 65, 12, 65, 14, 65, 609, 11, 65, 3, 66, 3, 66, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 3, 67, 7, 67, 619, 10, 67, 12, 67, 14, 67, 622, 11, 67, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 7, 68, 630, 10, 68, 12, 68, 14, 68, 633, 11, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 7, 69, 641, 10, 69, 12, 69, 14, 69, 644, 11, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 7, 70, 652, 10, 70, 12, 70, 14, 70, 655, 11, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 7, 71, 663, 10, 71, 12, 71, 14, 71, 666, 11, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 7, 72, 674, 10, 72, 12, 72, 14, 72, 677, 11, 72, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 7, 73, 685, 10, 73, 12, 73, 14, 73, 688, 11, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 5, 74, 697, 10, 74, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 5, 75, 704, 10, 75, 3, 76, 3, 76, 3, 77, 3, 77, 3, 77, 7, 77, 711, 10, 77, 12, 77, 14, 77, 714, 11, 77, 3, 78, 3, 78, 3, 78, 5, 78, 719, 10, 78, 3, 79, 3, 79, 3, 80, 3, 80, 3, 80, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 2, 2, 13, 98, 124, 126, 128, 132, 134, 136, 138, 140, 142, 144, 83, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 70, 2, 72, 2, 74, 2, 76, 2, 78, 2, 80, 2, 82, 2, 84, 2, 86, 2, 88, 2, 90, 2, 92, 2, 94, 2, 96, 2, 98, 2, 100, 2, 102, 2, 104, 2, 106, 2, 108, 2, 110, 2, 112, 2, 114, 2, 116, 2, 118, 2, 120, 2, 122, 2, 124, 2, 126, 2, 128, 2, 130, 2, 132, 2, 134, 2, 136, 2, 138, 2, 140, 2, 142, 2, 144, 2, 146, 2, 148, 2, 150, 2, 152, 2, 154, 2, 156, 2, 158, 2, 160, 2, 162, 2, 2, 17, 3, 2, 6, 7, 3, 2, 13, 14, 3, 2, 27, 28, 3, 2, 77, 78, 4, 2, 76, 76, 79, 79, 3, 2, 30, 32, 4, 2, 45, 45, 47, 47, 6, 2, 44, 44, 46, 46, 54, 54, 70, 70, 3, 2, 48, 51, 4, 2, 44, 44, 46, 46, 3, 2, 71, 73, 3, 2, 63, 66, 3, 2, 61, 62, 3, 2, 55, 60, 4, 2, 30, 32, 75, 75, 2, 736, 2, 165, 3, 2, 2, 2, 4, 170, 3, 2, 2, 2, 6, 174, 3, 2, 2, 2, 8, 177, 3, 2, 2, 2, 10, 184, 3, 2, 2, 2, 12, 192, 3, 2, 2, 2, 14, 194, 3, 2, 2, 2, 16, 197, 3, 2, 2, 2, 18, 199, 3, 2, 2, 2, 20, 206, 3, 2, 2, 2, 22, 208, 3, 2, 2, 2, 24, 210, 3, 2, 2, 2, 26, 212, 3, 2, 2, 2, 28, 224, 3, 2, 2, 2, 30, 232, 3, 2, 2, 2, 32, 236, 3, 2, 2, 2, 34, 249, 3, 2, 2, 2, 36, 251, 3, 2, 2, 2, 38, 256, 3, 2, 2, 2, 40, 266, 3, 2, 2, 2, 42, 277, 3, 2, 2, 2, 44, 279, 3, 2, 2, 2, 46, 286, 3, 2, 2, 2, 48, 293, 3, 2, 2, 2, 50, 295, 3, 2, 2, 2, 52, 304, 3, 2, 2, 2, 54, 325, 3, 2, 2, 2, 56, 330, 3, 2, 2, 2, 58, 332, 3, 2, 2, 2, 60, 357, 3, 2, 2, 2, 62, 363, 3, 2, 2, 2, 64, 371, 3, 2, 2, 2, 66, 374, 3, 2, 2, 2, 68, 389, 3, 2, 2, 2, 70, 391, 3, 2, 2, 2, 72, 395, 3, 2, 2, 2, 74, 397, 3, 2, 2, 2, 76, 399, 3, 2, 2, 2, 78, 403, 3, 2, 2, 2, 80, 405, 3, 2, 2, 2, 82, 423, 3, 2, 2, 2, 84, 431, 3, 2, 2, 2, 86, 439, 3, 2, 2, 2, 88, 441, 3, 2, 2, 2, 90, 443, 3, 2, 2, 2, 92, 459, 3, 2, 2, 2, 94, 475, 3, 2, 2, 2, 96, 479, 3, 2, 2, 2, 98, 492, 3, 2, 2, 2, 100, 518, 3, 2, 2, 2, 102, 526, 3, 2, 2, 2, 104, 529, 3, 2, 2, 2, 106, 533, 3, 2, 2, 2, 108, 549, 3, 2, 2, 2, 110, 551, 3, 2, 2, 2, 112, 557, 3, 2, 2, 2, 114, 559, 3, 2, 2, 2, 116, 562, 3, 2, 2, 2, 118, 565, 3, 2, 2, 2, 120, 567, 3, 2, 2, 2, 122, 574, 3, 2, 2, 2, 124, 576, 3, 2, 2, 2, 126, 587, 3, 2, 2, 2, 128, 598, 3, 2, 2, 2, 130, 610, 3, 2, 2, 2, 132, 612, 3, 2, 2, 2, 134, 623, 3, 2, 2, 2, 136, 634, 3, 2, 2, 2, 138, 645, 3, 2, 2, 2, 140, 656, 3, 2, 2, 2, 142, 667, 3, 2, 2, 2, 144, 678, 3, 2, 2, 2, 146, 696, 3, 2, 2, 2, 148, 703, 3, 2, 2, 2, 150, 705, 3, 2, 2, 2, 152, 707, 3, 2, 2, 2, 154, 718, 3, 2, 2, 2, 156, 720, 3, 2, 2, 2, 158, 722, 3, 2, 2, 2, 160, 727, 3, 2, 2, 2, 162, 732, 3, 2, 2, 2, 164, 166, 5, 4, 3, 2, 165, 164, 3, 2, 2, 2, 165, 166, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 168, 7, 2, 2, 3, 168, 3, 3, 2, 2, 2, 169, 171, 5, 6, 4, 2, 170, 169, 3, 2, 2, 2, 171, 172, 3, 2, 2, 2, 172, 170, 3, 2, 2, 2, 172, 173, 3, 2, 2, 2, 173, 5, 3, 2, 2, 2, 174, 175, 5, 8, 5, 2, 175, 7, 3, 2, 2, 2, 176, 178, 5, 10, 6, 2, 177, 176, 3, 2, 2, 2, 178, 179, 3, 2, 2, 2, 179, 177, 3, 2, 2, 2, 179, 180, 3, 2, 2, 2, 180, 9, 3, 2, 2, 2, 181, 185, 5, 42, 22, 2, 182, 185, 5, 12, 7, 2, 183, 185, 7, 34, 2, 2, 184, 181, 3, 2, 2, 2, 184, 182, 3, 2, 2, 2, 184, 183, 3, 2, 2, 2, 185, 11, 3, 2, 2, 2, 186, 187, 5, 14, 8, 2, 187, 188, 7, 34, 2, 2, 188, 193, 3, 2, 2, 2, 189, 193, 5, 26, 14, 2, 190, 193, 5, 32, 17, 2, 191, 193, 5, 40, 21, 2, 192, 186, 3, 2, 2, 2, 192, 189, 3, 2, 2, 2, 192, 190, 3, 2, 2, 2, 192, 191, 3, 2, 2, 2, 193, 13, 3, 2, 2, 2, 194, 195, 5, 16, 9, 2, 195, 196, 5, 18, 10, 2, 196, 15, 3, 2, 2, 2, 197, 198, 9, 2, 2, 2, 198, 17, 3, 2, 2, 2, 199, 200, 5, 22, 12, 2, 200, 201, 7, 36, 2, 2, 201, 204, 5, 154, 78, 2, 202, 203, 7, 55, 2, 2, 203, 205, 5, 20, 11, 2, 204, 202, 3, 2, 2, 2, 204, 205, 3, 2, 2, 2, 205, 19, 3, 2, 2, 2, 206, 207, 5, 148, 75, 2, 207, 21, 3, 2, 2, 2, 208, 209, 5, 24, 13, 2, 209, 23, 3, 2, 2, 2, 210, 211, 7, 75, 2, 2, 211, 25, 3, 2, 2, 2, 212, 213, 7, 21, 2, 2, 213, 214, 5, 22, 12, 2, 214, 216, 7, 37, 2, 2, 215, 217, 5, 28, 15, 2, 216, 215, 3, 2, 2, 2, 216, 217, 3, 2, 2, 2, 217, 218, 3, 2, 2, 2, 218, 219, 7, 38, 2, 2, 219, 220, 7, 24, 2, 2, 220, 222, 5, 154, 78, 2, 221, 223, 5, 44, 23, 2, 222, 221, 3, 2, 2, 2, 222, 223, 3, 2, 2, 2, 223, 27, 3, 2, 2, 2, 224, 229, 5, 30, 16, 2, 225, 226, 7, 33, 2, 2, 226, 228, 5, 30, 16, 2, 227, 225, 3, 2, 2, 2, 228, 231, 3, 2, 2, 2, 229, 227, 3, 2, 2, 2, 229, 230, 3, 2, 2, 2, 230, 29, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 232, 233, 5, 22, 12, 2, 233, 234, 7, 36, 2, 2, 234, 235, 5, 154, 78, 2, 235, 31, 3, 2, 2, 2, 236, 237, 7, 26, 2, 2, 237, 238, 5, 22, 12, 2, 238, 242, 7, 42, 2, 2, 239, 241, 5, 34, 18, 2, 240, 239, 3, 2, 2, 2, 241, 244, 3, 2, 2, 2, 242, 240, 3, 2, 2, 2, 242, 243, 3, 2, 2, 2, 243, 245, 3, 2, 2, 2, 244, 242, 3, 2, 2, 2, 245, 246, 7, 43, 2, 2, 246, 33, 3, 2, 2, 2, 247, 250, 5, 36, 19, 2, 248, 250, 5, 38, 20, 2, 249, 247, 3, 2, 2, 2, 249, 248, 3, 2, 2, 2, 250, 35, 3, 2, 2, 2, 251, 252, 5, 22, 12, 2, 252, 253, 7, 36, 2, 2, 253, 254, 5, 154, 78, 2, 254, 255, 7, 34, 2, 2, 255, 37, 3, 2, 2, 2, 256, 257, 5, 22, 12, 2, 257, 259, 7, 37, 2, 2, 258, 260, 5, 28, 15, 2, 259, 258, 3, 2, 2, 2, 259, 260, 3, 2, 2, 2, 260, 261, 3, 2, 2, 2, 261, 262, 7, 38, 2, 2, 262, 263, 7, 36, 2, 2, 263, 264, 5, 154, 78, 2, 264, 265, 7, 34, 2, 2, 265, 39, 3, 2, 2, 2, 266, 267, 7, 25, 2, 2, 267, 268, 5, 22, 12, 2, 268, 269, 7, 42, 2, 2, 269, 270, 7, 43, 2, 2, 270, 41, 3, 2, 2, 2, 271, 278, 5, 46, 24, 2, 272, 278, 5, 48, 25, 2, 273, 278, 5, 56, 29, 2, 274, 278, 5, 64, 33, 2, 275, 278, 5, 66, 34, 2, 276, 278, 5, 44, 23, 2, 277, 271, 3, 2, 2, 2, 277, 272, 3, 2, 2, 2, 277, 273, 3, 2, 2, 2, 277, 274, 3, 2, 2, 2, 277, 275, 3, 2, 2, 2, 277, 276, 3, 2, 2, 2, 278, 43, 3, 2, 2, 2, 279, 280, 6, 23, 2, 2, 280, 282, 7, 42, 2, 2, 281, 283, 5, 8, 5, 2, 282, 281, 3, 2, 2, 2, 282, 283, 3, 2, 2, 2, 283, 284, 3, 2, 2, 2, 284, 285, 7, 43, 2, 2, 285, 45, 3, 2, 2, 2, 286, 287, 8, 24, 1, 2, 287, 288, 5, 152, 77, 2, 288, 289, 7, 34, 2, 2, 289, 290, 8, 24, 1, 2, 290, 47, 3, 2, 2, 2, 291, 294, 5, 50, 26, 2, 292, 294, 5, 52, 27, 2, 293, 291, 3, 2, 2, 2, 293, 292, 3, 2, 2, 2, 294, 49, 3, 2, 2, 2, 295, 296, 7, 17, 2, 2, 296, 297, 7, 37, 2, 2, 297, 298, 5, 152, 77, 2, 298, 299, 7, 38, 2, 2, 299, 302, 5, 42, 22, 2, 300, 301, 7, 18, 2, 2, 301, 303, 5, 42, 22, 2, 302, 300, 3, 2, 2, 2, 302, 303, 3, 2, 2, 2, 303, 51, 3, 2, 2, 2, 304, 305, 7, 10, 2, 2, 305, 306, 7, 37, 2, 2, 306, 307, 5, 152, 77, 2, 307, 308, 7, 38, 2, 2, 308, 312, 7, 42, 2, 2, 309, 311, 5, 54, 28, 2, 310, 309, 3, 2, 2, 2, 311, 314, 3, 2, 2, 2, 312, 310, 3, 2, 2, 2, 312, 313, 3, 2, 2, 2, 313, 315, 3, 2, 2, 2, 314, 312, 3, 2, 2, 2, 315, 316, 7, 43, 2, 2, 316, 53, 3, 2, 2, 2, 317, 318, 7, 11, 2, 2, 318, 319, 5, 152, 77, 2, 319, 320, 7, 36, 2, 2, 320, 321, 5, 42, 22, 2, 321, 326, 3, 2, 2, 2, 322, 323, 7, 12, 2, 2, 323, 324, 7, 36, 2, 2, 324, 326, 5, 42, 22, 2, 325, 317, 3, 2, 2, 2, 325, 322, 3, 2, 2, 2, 326, 55, 3, 2, 2, 2, 327, 331, 5, 58, 30, 2, 328, 331, 5, 60, 31, 2, 329, 331, 5, 62, 32, 2, 330, 327, 3, 2, 2, 2, 330, 328, 3, 2, 2, 2, 330, 329, 3, 2, 2, 2, 331, 57, 3, 2, 2, 2, 332, 333, 7, 19, 2, 2, 333, 340, 7, 37, 2, 2, 334, 337, 5, 14, 8, 2, 335, 337, 5, 152, 77, 2, 336, 334, 3, 2, 2, 2, 336, 335, 3, 2, 2, 2, 337, 338, 3, 2, 2, 2, 338, 339, 8, 30, 1, 2, 339, 341, 3, 2, 2, 2, 340, 336, 3, 2, 2, 2, 340, 341, 3, 2, 2, 2, 341, 342, 3, 2, 2, 2, 342, 346, 7, 34, 2, 2, 343, 344, 5, 152, 77, 2, 344, 345, 8, 30, 1, 2, 345, 347, 3, 2, 2, 2, 346, 343, 3, 2, 2, 2, 346, 347, 3, 2, 2, 2, 347, 348, 3, 2, 2, 2, 348, 352, 7, 34, 2, 2, 349, 350, 5, 152, 77, 2, 350, 351, 8, 30, 1, 2, 351, 353, 3, 2, 2, 2, 352, 349, 3, 2, 2, 2, 352, 353, 3, 2, 2, 2, 353, 354, 3, 2, 2, 2, 354, 355, 7, 38, 2, 2, 355, 356, 5, 42, 22, 2, 356, 59, 3, 2, 2, 2, 357, 358, 7, 16, 2, 2, 358, 359, 7, 37, 2, 2, 359, 360, 5, 152, 77, 2, 360, 361, 7, 38, 2, 2, 361, 362, 5, 42, 22, 2, 362, 61, 3, 2, 2, 2, 363, 364, 7, 15, 2, 2, 364, 365, 5, 42, 22, 2, 365, 366, 7, 16, 2, 2, 366, 367, 7, 37, 2, 2, 367, 368, 5, 152, 77, 2, 368, 369, 7, 38, 2, 2, 369, 370, 7, 34, 2, 2, 370, 63, 3, 2, 2, 2, 371, 372, 9, 3, 2, 2, 372, 373, 7, 34, 2, 2, 373, 65, 3, 2, 2, 2, 374, 376, 7, 22, 2, 2, 375, 377, 5, 152, 77, 2, 376, 375, 3, 2, 2, 2, 376, 377, 3, 2, 2, 2, 377, 378, 3, 2, 2, 2, 378, 379, 7, 34, 2, 2, 379, 67, 3, 2, 2, 2, 380, 390, 5, 70, 36, 2, 381, 390, 5, 90, 46, 2, 382, 390, 5, 92, 47, 2, 383, 390, 5, 72, 37, 2, 384, 390, 5, 74, 38, 2, 385, 390, 5, 80, 41, 2, 386, 390, 5, 82, 42, 2, 387, 390, 5, 88, 45, 2, 388, 390, 5, 96, 49, 2, 389, 380, 3, 2, 2, 2, 389, 381, 3, 2, 2, 2, 389, 382, 3, 2, 2, 2, 389, 383, 3, 2, 2, 2, 389, 384, 3, 2, 2, 2, 389, 385, 3, 2, 2, 2, 389, 386, 3, 2, 2, 2, 389, 387, 3, 2, 2, 2, 389, 388, 3, 2, 2, 2, 390, 69, 3, 2, 2, 2, 391, 392, 7, 37, 2, 2, 392, 393, 5, 152, 77, 2, 393, 394, 7, 38, 2, 2, 394, 71, 3, 2, 2, 2, 395, 396, 9, 4, 2, 2, 396, 73, 3, 2, 2, 2, 397, 398, 5, 76, 39, 2, 398, 75, 3, 2, 2, 2, 399, 400, 7, 75, 2, 2, 400, 77, 3, 2, 2, 2, 401, 404, 5, 76, 39, 2, 402, 404, 5, 80, 41, 2, 403, 401, 3, 2, 2, 2, 403, 402, 3, 2, 2, 2, 404, 79, 3, 2, 2, 2, 405, 406, 9, 5, 2, 2, 406, 81, 3, 2, 2, 2, 407, 411, 7, 82, 2, 2, 408, 410, 5, 84, 43, 2, 409, 408, 3, 2, 2, 2, 410, 413, 3, 2, 2, 2, 411, 409, 3, 2, 2, 2, 411, 412, 3, 2, 2, 2, 412, 414, 3, 2, 2, 2, 413, 411, 3, 2, 2, 2, 414, 424, 7, 84, 2, 2, 415, 419, 7, 83, 2, 2, 416, 418, 5, 86, 44, 2, 417, 416, 3, 2, 2, 2, 418, 421, 3, 2, 2, 2, 419, 417, 3, 2, 2, 2, 419, 420, 3, 2, 2, 2, 420, 422, 3, 2, 2, 2, 421, 419, 3, 2, 2, 2, 422, 424, 7, 86, 2, 2, 423, 407, 3, 2, 2, 2, 423, 415, 3, 2, 2, 2, 424, 83, 3, 2, 2, 2, 425, 432, 7, 85, 2, 2, 426, 428, 7, 3, 2, 2, 427, 429, 5, 152, 77, 2, 428, 427, 3, 2, 2, 2, 428, 429, 3, 2, 2, 2, 429, 430, 3, 2, 2, 2, 430, 432, 7, 41, 2, 2, 431, 425, 3, 2, 2, 2, 431, 426, 3, 2, 2, 2, 432, 85, 3, 2, 2, 2, 433, 440, 7, 87, 2, 2, 434, 436, 7, 3, 2, 2, 435, 437, 5, 152, 77, 2, 436, 435, 3, 2, 2, 2, 436, 437, 3, 2, 2, 2, 437, 438, 3, 2, 2, 2, 438, 440, 7, 41, 2, 2, 439, 433, 3, 2, 2, 2, 439, 434, 3, 2, 2, 2, 440, 87, 3, 2, 2, 2, 441, 442, 9, 6, 2, 2, 442, 89, 3, 2, 2, 2, 443, 452, 7, 39, 2, 2, 444, 449, 5, 152, 77, 2, 445, 446, 7, 33, 2, 2, 446, 448, 5, 152, 77, 2, 447, 445, 3, 2, 2, 2, 448, 451, 3, 2, 2, 2, 449, 447, 3, 2, 2, 2, 449, 450, 3, 2, 2, 2, 450, 453, 3, 2, 2, 2, 451, 449, 3, 2, 2, 2, 452, 444, 3, 2, 2, 2, 452, 453, 3, 2, 2, 2, 453, 455, 3, 2, 2, 2, 454, 456, 7, 33, 2, 2, 455, 454, 3, 2, 2, 2, 455, 456, 3, 2, 2, 2, 456, 457, 3, 2, 2, 2, 457, 458, 7, 40, 2, 2, 458, 91, 3, 2, 2, 2, 459, 468, 7, 42, 2, 2, 460, 465, 5, 94, 48, 2, 461, 462, 7, 33, 2, 2, 462, 464, 5, 94, 48, 2, 463, 461, 3, 2, 2, 2, 464, 467, 3, 2, 2, 2, 465, 463, 3, 2, 2, 2, 465, 466, 3, 2, 2, 2, 466, 469, 3, 2, 2, 2, 467, 465, 3, 2, 2, 2, 468, 460, 3, 2, 2, 2, 468, 469, 3, 2, 2, 2, 469, 471, 3, 2, 2, 2, 470, 472, 7, 33, 2, 2, 471, 470, 3, 2, 2, 2, 471, 472, 3, 2, 2, 2, 472, 473, 3, 2, 2, 2, 473, 474, 7, 43, 2, 2, 474, 93, 3, 2, 2, 2, 475, 476, 5, 78, 40, 2, 476, 477, 7, 36, 2, 2, 477, 478, 5, 152, 77, 2, 478, 95, 3, 2, 2, 2, 479, 480, 9, 7, 2, 2, 480, 97, 3, 2, 2, 2, 481, 482, 8, 50, 1, 2, 482, 493, 5, 68, 35, 2, 483, 484, 7, 23, 2, 2, 484, 485, 5, 98, 50, 2, 485, 487, 7, 37, 2, 2, 486, 488, 5, 100, 51, 2, 487, 486, 3, 2, 2, 2, 487, 488, 3, 2, 2, 2, 488, 489, 3, 2, 2, 2, 489, 490, 7, 38, 2, 2, 490, 491, 8, 50, 1, 2, 491, 493, 3, 2, 2, 2, 492, 481, 3, 2, 2, 2, 492, 483, 3, 2, 2, 2, 493, 515, 3, 2, 2, 2, 494, 495, 12, 7, 2, 2, 495, 497, 7, 37, 2, 2, 496, 498, 5, 100, 51, 2, 497, 496, 3, 2, 2, 2, 497, 498, 3, 2, 2, 2, 498, 499, 3, 2, 2, 2, 499, 500, 7, 38, 2, 2, 500, 514, 8, 50, 1, 2, 501, 502, 12, 5, 2, 2, 502, 503, 5, 102, 52, 2, 503, 504, 8, 50, 1, 2, 504, 514, 3, 2, 2, 2, 505, 506, 12, 4, 2, 2, 506, 507, 5, 104, 53, 2, 507, 508, 8, 50, 1, 2, 508, 514, 3, 2, 2, 2, 509, 510, 12, 3, 2, 2, 510, 511, 5, 106, 54, 2, 511, 512, 8, 50, 1, 2, 512, 514, 3, 2, 2, 2, 513, 494, 3, 2, 2, 2, 513, 501, 3, 2, 2, 2, 513, 505, 3, 2, 2, 2, 513, 509, 3, 2, 2, 2, 514, 517, 3, 2, 2, 2, 515, 513, 3, 2, 2, 2, 515, 516, 3, 2, 2, 2, 516, 99, 3, 2, 2, 2, 517, 515, 3, 2, 2, 2, 518, 523, 5, 148, 75, 2, 519, 520, 7, 33, 2, 2, 520, 522, 5, 148, 75, 2, 521, 519, 3, 2, 2, 2, 522, 525, 3, 2, 2, 2, 523, 521, 3, 2, 2, 2, 523, 524, 3, 2, 2, 2, 524, 101, 3, 2, 2, 2, 525, 523, 3, 2, 2, 2, 526, 527, 7, 74, 2, 2, 527, 528, 5, 76, 39, 2, 528, 103, 3, 2, 2, 2, 529, 530, 7, 39, 2, 2, 530, 531, 5, 152, 77, 2, 531, 532, 7, 40, 2, 2, 532, 105, 3, 2, 2, 2, 533, 537, 7, 39, 2, 2, 534, 535, 5, 152, 77, 2, 535, 536, 8, 54, 1, 2, 536, 538, 3, 2, 2, 2, 537, 534, 3, 2, 2, 2, 537, 538, 3, 2, 2, 2, 538, 539, 3, 2, 2, 2, 539, 543, 7, 36, 2, 2, 540, 541, 5, 152, 77, 2, 541, 542, 8, 54, 1, 2, 542, 544, 3, 2, 2, 2, 543, 540, 3, 2, 2, 2, 543, 544, 3, 2, 2, 2, 544, 545, 3, 2, 2, 2, 545, 546, 7, 40, 2, 2, 546, 107, 3, 2, 2, 2, 547, 550, 5, 98, 50, 2, 548, 550, 5, 110, 56, 2, 549, 547, 3, 2, 2, 2, 549, 548, 3, 2, 2, 2, 550, 109, 3, 2, 2, 2, 551, 552, 5, 98, 50, 2, 552, 553, 5, 118, 60, 2, 553, 111, 3, 2, 2, 2, 554, 558, 5, 108, 55, 2, 555, 558, 5, 114, 58, 2, 556, 558, 5, 116, 59, 2, 557, 554, 3, 2, 2, 2, 557, 555, 3, 2, 2, 2, 557, 556, 3, 2, 2, 2, 558, 113, 3, 2, 2, 2, 559, 560, 5, 118, 60, 2, 560, 561, 5, 108, 55, 2, 561, 115, 3, 2, 2, 2, 562, 563, 5, 120, 61, 2, 563, 564, 5, 108, 55, 2, 564, 117, 3, 2, 2, 2, 565, 566, 9, 8, 2, 2, 566, 119, 3, 2, 2, 2, 567, 568, 9, 9, 2, 2, 568, 121, 3, 2, 2, 2, 569, 575, 5, 112, 57, 2, 570, 571, 5, 112, 57, 2, 571, 572, 7, 8, 2, 2, 572, 573, 5, 154, 78, 2, 573, 575, 3, 2, 2, 2, 574, 569, 3, 2, 2, 2, 574, 570, 3, 2, 2, 2, 575, 123, 3, 2, 2, 2, 576, 577, 8, 63, 1, 2, 577, 578, 5, 122, 62, 2, 578, 584, 3, 2, 2, 2, 579, 580, 12, 3, 2, 2, 580, 581, 9, 10, 2, 2, 581, 583, 5, 122, 62, 2, 582, 579, 3, 2, 2, 2, 583, 586, 3, 2, 2, 2, 584, 582, 3, 2, 2, 2, 584, 585, 3, 2, 2, 2, 585, 125, 3, 2, 2, 2, 586, 584, 3, 2, 2, 2, 587, 588, 8, 64, 1, 2, 588, 589, 5, 124, 63, 2, 589, 595, 3, 2, 2, 2, 590, 591, 12, 3, 2, 2, 591, 592, 9, 11, 2, 2, 592, 594, 5, 124, 63, 2, 593, 590, 3, 2, 2, 2, 594, 597, 3, 2, 2, 2, 595, 593, 3, 2, 2, 2, 595, 596, 3, 2, 2, 2, 596, 127, 3, 2, 2, 2, 597, 595, 3, 2, 2, 2, 598, 599, 8, 65, 1, 2, 599, 600, 5, 126, 64, 2, 600, 607, 3, 2, 2, 2, 601, 602, 12, 3, 2, 2, 602, 603, 5, 130, 66, 2, 603, 604, 5, 136, 69, 2, 604, 606, 3, 2, 2, 2, 605, 601, 3, 2, 2, 2, 606, 609, 3, 2, 2, 2, 607, 605, 3, 2, 2, 2, 607, 608, 3, 2, 2, 2, 608, 129, 3, 2, 2, 2, 609, 607, 3, 2, 2, 2, 610, 611, 9, 12, 2, 2, 611, 131, 3, 2, 2, 2, 612, 613, 8, 67, 1, 2, 613, 614, 5, 128, 65, 2, 614, 620, 3, 2, 2, 2, 615, 616, 12, 3, 2, 2, 616, 617, 9, 13, 2, 2, 617, 619, 5, 128, 65, 2, 618, 615, 3, 2, 2, 2, 619, 622, 3, 2, 2, 2, 620, 618, 3, 2, 2, 2, 620, 621, 3, 2, 2, 2, 621, 133, 3, 2, 2, 2, 622, 620, 3, 2, 2, 2, 623, 624, 8, 68, 1, 2, 624, 625, 5, 132, 67, 2, 625, 631, 3, 2, 2, 2, 626, 627, 12, 3, 2, 2, 627, 628, 9, 14, 2, 2, 628, 630, 5, 132, 67, 2, 629, 626, 3, 2, 2, 2, 630, 633, 3, 2, 2, 2, 631, 629, 3, 2, 2, 2, 631, 632, 3, 2, 2, 2, 632, 135, 3, 2, 2, 2, 633, 631, 3, 2, 2, 2, 634, 635, 8, 69, 1, 2, 635, 636, 5, 134, 68, 2, 636, 642, 3, 2, 2, 2, 637, 638, 12, 3, 2, 2, 638, 639, 7, 67, 2, 2, 639, 641, 5, 134, 68, 2, 640, 637, 3, 2, 2, 2, 641, 644, 3, 2, 2, 2, 642, 640, 3, 2, 2, 2, 642, 643, 3, 2, 2, 2, 643, 137, 3, 2, 2, 2, 644, 642, 3, 2, 2, 2, 645, 646, 8, 70, 1, 2, 646, 647, 5, 136, 69, 2, 647, 653, 3, 2, 2, 2, 648, 649, 12, 3, 2, 2, 649, 650, 7, 69, 2, 2, 650, 652, 5, 136, 69, 2, 651, 648, 3, 2, 2, 2, 652, 655, 3, 2, 2, 2, 653, 651, 3, 2, 2, 2, 653, 654, 3, 2, 2, 2, 654, 139, 3, 2, 2, 2, 655, 653, 3, 2, 2, 2, 656, 657, 8, 71, 1, 2, 657, 658, 5, 138, 70, 2, 658, 664, 3, 2, 2, 2, 659, 660, 12, 3, 2, 2, 660, 661, 7, 68, 2, 2, 661, 663, 5, 138, 70, 2, 662, 659, 3, 2, 2, 2, 663, 666, 3, 2, 2, 2, 664, 662, 3, 2, 2, 2, 664, 665, 3, 2, 2, 2, 665, 141, 3, 2, 2, 2, 666, 664, 3, 2, 2, 2, 667, 668, 8, 72, 1, 2, 668, 669, 5, 140, 71, 2, 669, 675, 3, 2, 2, 2, 670, 671, 12, 3, 2, 2, 671, 672, 7, 52, 2, 2, 672, 674, 5, 140, 71, 2, 673, 670, 3, 2, 2, 2, 674, 677, 3, 2, 2, 2, 675, 673, 3, 2, 2, 2, 675, 676, 3, 2, 2, 2, 676, 143, 3, 2, 2, 2, 677, 675, 3, 2, 2, 2, 678, 679, 8, 73, 1, 2, 679, 680, 5, 142, 72, 2, 680, 686, 3, 2, 2, 2, 681, 682, 12, 3, 2, 2, 682, 683, 7, 53, 2, 2, 683, 685, 5, 142, 72, 2, 684, 681, 3, 2, 2, 2, 685, 688, 3, 2, 2, 2, 686, 684, 3, 2, 2, 2, 686, 687, 3, 2, 2, 2, 687, 145, 3, 2, 2, 2, 688, 686, 3, 2, 2, 2, 689, 697, 5, 144, 73, 2, 690, 691, 5, 144, 73, 2, 691, 692, 7, 35, 2, 2, 692, 693, 5, 146, 74, 2, 693, 694, 7, 36, 2, 2, 694, 695, 5, 146, 74, 2, 695, 697, 3, 2, 2, 2, 696, 689, 3, 2, 2, 2, 696, 690, 3, 2, 2, 2, 697, 147, 3, 2, 2, 2, 698, 704, 5, 146, 74, 2, 699, 700, 5, 98, 50, 2, 700, 701, 5, 150, 76, 2, 701, 702, 5, 148, 75, 2, 702, 704, 3, 2, 2, 2, 703, 698, 3, 2, 2, 2, 703, 699, 3, 2, 2, 2, 704, 149, 3, 2, 2, 2, 705, 706, 9, 15, 2, 2, 706, 151, 3, 2, 2, 2, 707, 712, 5, 148, 75, 2, 708, 709, 7, 33, 2, 2, 709, 711, 5, 148, 75, 2, 710, 708, 3, 2, 2, 2, 711, 714, 3, 2, 2, 2, 712, 710, 3, 2, 2, 2, 712, 713, 3, 2, 2, 2, 713, 153, 3, 2, 2, 2, 714, 712, 3, 2, 2, 2, 715, 719, 5, 156, 79, 2, 716, 719, 5, 158, 80, 2, 717, 719, 5, 160, 81, 2, 718, 715, 3, 2, 2, 2, 718, 716, 3, 2, 2, 2, 718, 717, 3, 2, 2, 2, 719, 155, 3, 2, 2, 2, 720, 721, 5, 162, 82, 2, 721, 157, 3, 2, 2, 2, 722, 723, 5, 162, 82, 2, 723, 724, 7, 63, 2, 2, 724, 725, 5, 162, 82, 2, 725, 726, 7, 65, 2, 2, 726, 159, 3, 2, 2, 2, 727, 728, 7, 29, 2, 2, 728, 729, 7, 37, 2, 2, 729, 730, 5, 162, 82, 2, 730, 731, 7, 38, 2, 2, 731, 161, 3, 2, 2, 2, 732, 733, 9, 16, 2, 2, 733, 163, 3, 2, 2, 2, 66, 165, 172, 179, 184, 192, 204, 216, 222, 229, 242, 249, 259, 277, 282, 293, 302, 312, 325, 330, 336, 340, 346, 352, 376, 389, 403, 411, 419, 423, 428, 431, 436, 439, 449, 452, 455, 465, 468, 471, 487, 492, 497, 513, 515, 523, 537, 543, 549, 557, 574, 584, 595, 607, 620, 631, 642, 653, 664, 675, 686, 696, 703, 712, 718] \ No newline at end of file diff --git a/kipper/core/src/compiler/parser/antlr/KipperParser.ts b/kipper/core/src/compiler/parser/antlr/KipperParser.ts index 00ef4bc32..a9854a127 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParser.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperParser.ts @@ -1,11 +1,9 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT - - // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax - // kind values. - import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; - import KipperParserBase from "./base/KipperParserBase"; - +// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax +// kind values. +import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; +import KipperParserBase from "./base/KipperParserBase"; import { ATN } from "antlr4ts/atn/ATN"; import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer"; @@ -32,7 +30,6 @@ import * as Utils from "antlr4ts/misc/Utils"; import { KipperParserListener } from "./KipperParserListener"; import { KipperParserVisitor } from "./KipperParserVisitor"; - export class KipperParser extends KipperParserBase { public static readonly FStringExpStart = 1; public static readonly BlockComment = 2; @@ -135,130 +132,324 @@ export class KipperParser extends KipperParserBase { public static readonly RULE_parameterList = 13; public static readonly RULE_parameterDeclaration = 14; public static readonly RULE_interfaceDeclaration = 15; - public static readonly RULE_interfaceMemberList = 16; - public static readonly RULE_interfaceMemberDeclaration = 17; - public static readonly RULE_propertySignature = 18; - public static readonly RULE_methodSignature = 19; - public static readonly RULE_classDeclaration = 20; - public static readonly RULE_statement = 21; - public static readonly RULE_compoundStatement = 22; - public static readonly RULE_expressionStatement = 23; - public static readonly RULE_selectionStatement = 24; - public static readonly RULE_ifStatement = 25; - public static readonly RULE_switchStatement = 26; - public static readonly RULE_switchLabeledStatement = 27; - public static readonly RULE_iterationStatement = 28; - public static readonly RULE_forLoopIterationStatement = 29; - public static readonly RULE_whileLoopIterationStatement = 30; - public static readonly RULE_doWhileLoopIterationStatement = 31; - public static readonly RULE_jumpStatement = 32; - public static readonly RULE_returnStatement = 33; - public static readonly RULE_primaryExpression = 34; - public static readonly RULE_tangledPrimaryExpression = 35; - public static readonly RULE_boolPrimaryExpression = 36; - public static readonly RULE_identifierPrimaryExpression = 37; - public static readonly RULE_identifier = 38; - public static readonly RULE_identifierOrStringPrimaryExpression = 39; - public static readonly RULE_stringPrimaryExpression = 40; - public static readonly RULE_fStringPrimaryExpression = 41; - public static readonly RULE_fStringSingleQuoteAtom = 42; - public static readonly RULE_fStringDoubleQuoteAtom = 43; - public static readonly RULE_numberPrimaryExpression = 44; - public static readonly RULE_arrayPrimaryExpression = 45; - public static readonly RULE_objectPrimaryExpression = 46; - public static readonly RULE_objectProperty = 47; - public static readonly RULE_voidOrNullOrUndefinedPrimaryExpression = 48; - public static readonly RULE_computedPrimaryExpression = 49; - public static readonly RULE_argumentExpressionList = 50; - public static readonly RULE_dotNotation = 51; - public static readonly RULE_bracketNotation = 52; - public static readonly RULE_sliceNotation = 53; - public static readonly RULE_postfixExpression = 54; - public static readonly RULE_incrementOrDecrementPostfixExpression = 55; - public static readonly RULE_unaryExpression = 56; - public static readonly RULE_incrementOrDecrementUnaryExpression = 57; - public static readonly RULE_operatorModifiedUnaryExpression = 58; - public static readonly RULE_incrementOrDecrementOperator = 59; - public static readonly RULE_unaryOperator = 60; - public static readonly RULE_castOrConvertExpression = 61; - public static readonly RULE_multiplicativeExpression = 62; - public static readonly RULE_additiveExpression = 63; - public static readonly RULE_bitwiseShiftExpression = 64; - public static readonly RULE_bitwiseShiftOperators = 65; - public static readonly RULE_relationalExpression = 66; - public static readonly RULE_equalityExpression = 67; - public static readonly RULE_bitwiseAndExpression = 68; - public static readonly RULE_bitwiseXorExpression = 69; - public static readonly RULE_bitwiseOrExpression = 70; - public static readonly RULE_logicalAndExpression = 71; - public static readonly RULE_logicalOrExpression = 72; - public static readonly RULE_conditionalExpression = 73; - public static readonly RULE_assignmentExpression = 74; - public static readonly RULE_assignmentOperator = 75; - public static readonly RULE_expression = 76; - public static readonly RULE_typeSpecifierExpression = 77; - public static readonly RULE_identifierTypeSpecifierExpression = 78; - public static readonly RULE_genericTypeSpecifierExpression = 79; - public static readonly RULE_typeofTypeSpecifierExpression = 80; - public static readonly RULE_typeSpecifierIdentifier = 81; + public static readonly RULE_interfaceMemberDeclaration = 16; + public static readonly RULE_interfacePropertyDeclaration = 17; + public static readonly RULE_interfaceMethodDeclaration = 18; + public static readonly RULE_classDeclaration = 19; + public static readonly RULE_statement = 20; + public static readonly RULE_compoundStatement = 21; + public static readonly RULE_expressionStatement = 22; + public static readonly RULE_selectionStatement = 23; + public static readonly RULE_ifStatement = 24; + public static readonly RULE_switchStatement = 25; + public static readonly RULE_switchLabeledStatement = 26; + public static readonly RULE_iterationStatement = 27; + public static readonly RULE_forLoopIterationStatement = 28; + public static readonly RULE_whileLoopIterationStatement = 29; + public static readonly RULE_doWhileLoopIterationStatement = 30; + public static readonly RULE_jumpStatement = 31; + public static readonly RULE_returnStatement = 32; + public static readonly RULE_primaryExpression = 33; + public static readonly RULE_tangledPrimaryExpression = 34; + public static readonly RULE_boolPrimaryExpression = 35; + public static readonly RULE_identifierPrimaryExpression = 36; + public static readonly RULE_identifier = 37; + public static readonly RULE_identifierOrStringPrimaryExpression = 38; + public static readonly RULE_stringPrimaryExpression = 39; + public static readonly RULE_fStringPrimaryExpression = 40; + public static readonly RULE_fStringSingleQuoteAtom = 41; + public static readonly RULE_fStringDoubleQuoteAtom = 42; + public static readonly RULE_numberPrimaryExpression = 43; + public static readonly RULE_arrayPrimaryExpression = 44; + public static readonly RULE_objectPrimaryExpression = 45; + public static readonly RULE_objectProperty = 46; + public static readonly RULE_voidOrNullOrUndefinedPrimaryExpression = 47; + public static readonly RULE_computedPrimaryExpression = 48; + public static readonly RULE_argumentExpressionList = 49; + public static readonly RULE_dotNotation = 50; + public static readonly RULE_bracketNotation = 51; + public static readonly RULE_sliceNotation = 52; + public static readonly RULE_postfixExpression = 53; + public static readonly RULE_incrementOrDecrementPostfixExpression = 54; + public static readonly RULE_unaryExpression = 55; + public static readonly RULE_incrementOrDecrementUnaryExpression = 56; + public static readonly RULE_operatorModifiedUnaryExpression = 57; + public static readonly RULE_incrementOrDecrementOperator = 58; + public static readonly RULE_unaryOperator = 59; + public static readonly RULE_castOrConvertExpression = 60; + public static readonly RULE_multiplicativeExpression = 61; + public static readonly RULE_additiveExpression = 62; + public static readonly RULE_bitwiseShiftExpression = 63; + public static readonly RULE_bitwiseShiftOperators = 64; + public static readonly RULE_relationalExpression = 65; + public static readonly RULE_equalityExpression = 66; + public static readonly RULE_bitwiseAndExpression = 67; + public static readonly RULE_bitwiseXorExpression = 68; + public static readonly RULE_bitwiseOrExpression = 69; + public static readonly RULE_logicalAndExpression = 70; + public static readonly RULE_logicalOrExpression = 71; + public static readonly RULE_conditionalExpression = 72; + public static readonly RULE_assignmentExpression = 73; + public static readonly RULE_assignmentOperator = 74; + public static readonly RULE_expression = 75; + public static readonly RULE_typeSpecifierExpression = 76; + public static readonly RULE_identifierTypeSpecifierExpression = 77; + public static readonly RULE_genericTypeSpecifierExpression = 78; + public static readonly RULE_typeofTypeSpecifierExpression = 79; + public static readonly RULE_typeSpecifierIdentifier = 80; // tslint:disable:no-trailing-whitespace public static readonly ruleNames: string[] = [ - "compilationUnit", "translationUnit", "externalItem", "blockItemList", - "blockItem", "declaration", "variableDeclaration", "storageTypeSpecifier", - "initDeclarator", "initializer", "declarator", "directDeclarator", "functionDeclaration", - "parameterList", "parameterDeclaration", "interfaceDeclaration", "interfaceMemberList", - "interfaceMemberDeclaration", "propertySignature", "methodSignature", - "classDeclaration", "statement", "compoundStatement", "expressionStatement", - "selectionStatement", "ifStatement", "switchStatement", "switchLabeledStatement", - "iterationStatement", "forLoopIterationStatement", "whileLoopIterationStatement", - "doWhileLoopIterationStatement", "jumpStatement", "returnStatement", "primaryExpression", - "tangledPrimaryExpression", "boolPrimaryExpression", "identifierPrimaryExpression", - "identifier", "identifierOrStringPrimaryExpression", "stringPrimaryExpression", - "fStringPrimaryExpression", "fStringSingleQuoteAtom", "fStringDoubleQuoteAtom", - "numberPrimaryExpression", "arrayPrimaryExpression", "objectPrimaryExpression", - "objectProperty", "voidOrNullOrUndefinedPrimaryExpression", "computedPrimaryExpression", - "argumentExpressionList", "dotNotation", "bracketNotation", "sliceNotation", - "postfixExpression", "incrementOrDecrementPostfixExpression", "unaryExpression", - "incrementOrDecrementUnaryExpression", "operatorModifiedUnaryExpression", - "incrementOrDecrementOperator", "unaryOperator", "castOrConvertExpression", - "multiplicativeExpression", "additiveExpression", "bitwiseShiftExpression", - "bitwiseShiftOperators", "relationalExpression", "equalityExpression", - "bitwiseAndExpression", "bitwiseXorExpression", "bitwiseOrExpression", - "logicalAndExpression", "logicalOrExpression", "conditionalExpression", - "assignmentExpression", "assignmentOperator", "expression", "typeSpecifierExpression", - "identifierTypeSpecifierExpression", "genericTypeSpecifierExpression", - "typeofTypeSpecifierExpression", "typeSpecifierIdentifier", + "compilationUnit", + "translationUnit", + "externalItem", + "blockItemList", + "blockItem", + "declaration", + "variableDeclaration", + "storageTypeSpecifier", + "initDeclarator", + "initializer", + "declarator", + "directDeclarator", + "functionDeclaration", + "parameterList", + "parameterDeclaration", + "interfaceDeclaration", + "interfaceMemberDeclaration", + "interfacePropertyDeclaration", + "interfaceMethodDeclaration", + "classDeclaration", + "statement", + "compoundStatement", + "expressionStatement", + "selectionStatement", + "ifStatement", + "switchStatement", + "switchLabeledStatement", + "iterationStatement", + "forLoopIterationStatement", + "whileLoopIterationStatement", + "doWhileLoopIterationStatement", + "jumpStatement", + "returnStatement", + "primaryExpression", + "tangledPrimaryExpression", + "boolPrimaryExpression", + "identifierPrimaryExpression", + "identifier", + "identifierOrStringPrimaryExpression", + "stringPrimaryExpression", + "fStringPrimaryExpression", + "fStringSingleQuoteAtom", + "fStringDoubleQuoteAtom", + "numberPrimaryExpression", + "arrayPrimaryExpression", + "objectPrimaryExpression", + "objectProperty", + "voidOrNullOrUndefinedPrimaryExpression", + "computedPrimaryExpression", + "argumentExpressionList", + "dotNotation", + "bracketNotation", + "sliceNotation", + "postfixExpression", + "incrementOrDecrementPostfixExpression", + "unaryExpression", + "incrementOrDecrementUnaryExpression", + "operatorModifiedUnaryExpression", + "incrementOrDecrementOperator", + "unaryOperator", + "castOrConvertExpression", + "multiplicativeExpression", + "additiveExpression", + "bitwiseShiftExpression", + "bitwiseShiftOperators", + "relationalExpression", + "equalityExpression", + "bitwiseAndExpression", + "bitwiseXorExpression", + "bitwiseOrExpression", + "logicalAndExpression", + "logicalOrExpression", + "conditionalExpression", + "assignmentExpression", + "assignmentOperator", + "expression", + "typeSpecifierExpression", + "identifierTypeSpecifierExpression", + "genericTypeSpecifierExpression", + "typeofTypeSpecifierExpression", + "typeSpecifierIdentifier", ]; private static readonly _LITERAL_NAMES: Array = [ - undefined, undefined, undefined, undefined, "'const'", "'var'", "'as'", - "'...'", "'switch'", "'case'", "'default'", "'break'", "'continue'", "'do'", - "'while'", "'if'", "'else'", "'for'", "'enum'", "'def'", "'return'", "'call'", - "'->'", "'class'", "'interface'", "'true'", "'false'", "'typeof'", "'void'", - "'null'", "'undefined'", "','", "';'", "'?'", "':'", "'('", "')'", "'['", - "']'", undefined, "'{'", "'}'", "'+'", "'++'", "'-'", "'--'", "'*'", "'/'", - "'%'", "'**'", "'&&'", "'||'", "'!'", "'='", "'+='", "'-='", "'*='", "'/='", - "'%='", "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'&'", "'|'", "'^'", - "'~'", "'<<'", "'>>'", "'>>>'", "'.'", + undefined, + undefined, + undefined, + undefined, + "'const'", + "'var'", + "'as'", + "'...'", + "'switch'", + "'case'", + "'default'", + "'break'", + "'continue'", + "'do'", + "'while'", + "'if'", + "'else'", + "'for'", + "'enum'", + "'def'", + "'return'", + "'call'", + "'->'", + "'class'", + "'interface'", + "'true'", + "'false'", + "'typeof'", + "'void'", + "'null'", + "'undefined'", + "','", + "';'", + "'?'", + "':'", + "'('", + "')'", + "'['", + "']'", + undefined, + "'{'", + "'}'", + "'+'", + "'++'", + "'-'", + "'--'", + "'*'", + "'/'", + "'%'", + "'**'", + "'&&'", + "'||'", + "'!'", + "'='", + "'+='", + "'-='", + "'*='", + "'/='", + "'%='", + "'=='", + "'!='", + "'<'", + "'<='", + "'>'", + "'>='", + "'&'", + "'|'", + "'^'", + "'~'", + "'<<'", + "'>>'", + "'>>>'", + "'.'", ]; private static readonly _SYMBOLIC_NAMES: Array = [ - undefined, "FStringExpStart", "BlockComment", "LineComment", "Const", - "Var", "As", "Spread", "Switch", "Case", "Default", "Break", "Continue", - "Do", "While", "If", "Else", "For", "Enum", "DefFunc", "Return", "CallFunc", - "RetIndicator", "Class", "Interface", "True", "False", "Typeof", "Void", - "Null", "Undefined", "Comma", "SemiColon", "QuestionMark", "Colon", "LeftParen", - "RightParen", "LeftBracket", "RightBracket", "FStringExpEnd", "LeftBrace", - "RightBrace", "Plus", "PlusPlus", "Minus", "MinusMinus", "Star", "Div", - "Mod", "PowerTo", "AndAnd", "OrOr", "Not", "Assign", "PlusAssign", "MinusAssign", - "StarAssign", "DivAssign", "ModAssign", "Equal", "NotEqual", "Less", "LessEqual", - "Greater", "GreaterEqual", "BitwiseAnd", "BitwiseOr", "BitwiseXor", "BitwiseNot", - "BitwiseZeroFillLeftShift", "BitwiseSignedRightShift", "BitwiseZeroFillRightShift", - "Dot", "Identifier", "IntegerConstant", "SingleQuoteStringLiteral", "DoubleQuoteStringLiteral", - "FloatingConstant", "Whitespace", "Newline", "FStringSingleQuoteStart", - "FStringDoubleQuoteStart", "FStringSingleQuoteEnd", "FStringSingleQuoteAtom", - "FStringDoubleQuoteEnd", "FStringDoubleQuoteAtom", + undefined, + "FStringExpStart", + "BlockComment", + "LineComment", + "Const", + "Var", + "As", + "Spread", + "Switch", + "Case", + "Default", + "Break", + "Continue", + "Do", + "While", + "If", + "Else", + "For", + "Enum", + "DefFunc", + "Return", + "CallFunc", + "RetIndicator", + "Class", + "Interface", + "True", + "False", + "Typeof", + "Void", + "Null", + "Undefined", + "Comma", + "SemiColon", + "QuestionMark", + "Colon", + "LeftParen", + "RightParen", + "LeftBracket", + "RightBracket", + "FStringExpEnd", + "LeftBrace", + "RightBrace", + "Plus", + "PlusPlus", + "Minus", + "MinusMinus", + "Star", + "Div", + "Mod", + "PowerTo", + "AndAnd", + "OrOr", + "Not", + "Assign", + "PlusAssign", + "MinusAssign", + "StarAssign", + "DivAssign", + "ModAssign", + "Equal", + "NotEqual", + "Less", + "LessEqual", + "Greater", + "GreaterEqual", + "BitwiseAnd", + "BitwiseOr", + "BitwiseXor", + "BitwiseNot", + "BitwiseZeroFillLeftShift", + "BitwiseSignedRightShift", + "BitwiseZeroFillRightShift", + "Dot", + "Identifier", + "IntegerConstant", + "SingleQuoteStringLiteral", + "DoubleQuoteStringLiteral", + "FloatingConstant", + "Whitespace", + "Newline", + "FStringSingleQuoteStart", + "FStringDoubleQuoteStart", + "FStringSingleQuoteEnd", + "FStringSingleQuoteAtom", + "FStringDoubleQuoteEnd", + "FStringDoubleQuoteAtom", ]; - public static readonly VOCABULARY: Vocabulary = new VocabularyImpl(KipperParser._LITERAL_NAMES, KipperParser._SYMBOLIC_NAMES, []); + public static readonly VOCABULARY: Vocabulary = new VocabularyImpl( + KipperParser._LITERAL_NAMES, + KipperParser._SYMBOLIC_NAMES, + [], + ); // @Override // @NotNull @@ -268,13 +459,19 @@ export class KipperParser extends KipperParserBase { // tslint:enable:no-trailing-whitespace // @Override - public get grammarFileName(): string { return "KipperParser.g4"; } + public get grammarFileName(): string { + return "KipperParser.g4"; + } // @Override - public get ruleNames(): string[] { return KipperParser.ruleNames; } + public get ruleNames(): string[] { + return KipperParser.ruleNames; + } // @Override - public get serializedATN(): string { return KipperParser._serializedATN; } + public get serializedATN(): string { + return KipperParser._serializedATN; + } protected createFailedPredicateException(predicate?: string, message?: string): FailedPredicateException { return new FailedPredicateException(this, predicate, message); @@ -291,21 +488,20 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 165; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 0, this._ctx) ) { - case 1: - { - this.state = 164; - this.translationUnit(); + this.state = 163; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 0, this._ctx)) { + case 1: + { + this.state = 162; + this.translationUnit(); + } + break; } - break; - } - this.state = 167; - this.match(KipperParser.EOF); + this.state = 165; + this.match(KipperParser.EOF); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -313,8 +509,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -327,29 +522,28 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 170; - this._errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - this.state = 169; - this.externalItem(); - } - } - break; - default: - throw new NoViableAltException(this); - } - this.state = 172; + this.state = 168; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx); - } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 167; + this.externalItem(); + } + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 170; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -357,8 +551,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -371,11 +564,10 @@ export class KipperParser extends KipperParserBase { _localctx = new ExternalBlockItemContext(_localctx); this.enterOuterAlt(_localctx, 1); { - this.state = 174; - this.blockItemList(); + this.state = 172; + this.blockItemList(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -383,8 +575,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -397,29 +588,28 @@ export class KipperParser extends KipperParserBase { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 177; - this._errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - this.state = 176; - this.blockItem(); - } - } - break; - default: - throw new NoViableAltException(this); - } - this.state = 179; + this.state = 175; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); - } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + this.state = 174; + this.blockItem(); + } + } + break; + default: + throw new NoViableAltException(this); + } + this.state = 177; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 2, this._ctx); + } while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -427,8 +617,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -440,33 +629,32 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 184; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 3, this._ctx) ) { - case 1: - { - this.state = 181; - this.statement(); - } - break; - - case 2: - { this.state = 182; - this.declaration(); - } - break; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 3, this._ctx)) { + case 1: + { + this.state = 179; + this.statement(); + } + break; - case 3: - { - this.state = 183; - this.match(KipperParser.SemiColon); + case 2: + { + this.state = 180; + this.declaration(); + } + break; + + case 3: + { + this.state = 181; + this.match(KipperParser.SemiColon); + } + break; } - break; - } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -474,8 +662,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -485,45 +672,44 @@ export class KipperParser extends KipperParserBase { let _localctx: DeclarationContext = new DeclarationContext(this._ctx, this.state); this.enterRule(_localctx, 10, KipperParser.RULE_declaration); try { - this.state = 192; + this.state = 190; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Const: - case KipperParser.Var: - this.enterOuterAlt(_localctx, 1); - { - this.state = 186; - this.variableDeclaration(); - this.state = 187; - this.match(KipperParser.SemiColon); - } - break; - case KipperParser.DefFunc: - this.enterOuterAlt(_localctx, 2); - { - this.state = 189; - this.functionDeclaration(); - } - break; - case KipperParser.Interface: - this.enterOuterAlt(_localctx, 3); - { - this.state = 190; - this.interfaceDeclaration(); - } - break; - case KipperParser.Class: - this.enterOuterAlt(_localctx, 4); - { - this.state = 191; - this.classDeclaration(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Const: + case KipperParser.Var: + this.enterOuterAlt(_localctx, 1); + { + this.state = 184; + this.variableDeclaration(); + this.state = 185; + this.match(KipperParser.SemiColon); + } + break; + case KipperParser.DefFunc: + this.enterOuterAlt(_localctx, 2); + { + this.state = 187; + this.functionDeclaration(); + } + break; + case KipperParser.Interface: + this.enterOuterAlt(_localctx, 3); + { + this.state = 188; + this.interfaceDeclaration(); + } + break; + case KipperParser.Class: + this.enterOuterAlt(_localctx, 4); + { + this.state = 189; + this.classDeclaration(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -531,8 +717,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -544,13 +729,12 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 194; - this.storageTypeSpecifier(); - this.state = 195; - this.initDeclarator(); + this.state = 192; + this.storageTypeSpecifier(); + this.state = 193; + this.initDeclarator(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -558,8 +742,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -572,21 +755,20 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 197; - _la = this._input.LA(1); - if (!(_la === KipperParser.Const || _la === KipperParser.Var)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 195; + _la = this._input.LA(1); + if (!(_la === KipperParser.Const || _la === KipperParser.Var)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -594,8 +776,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -608,27 +789,25 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 199; - this.declarator(); - this.state = 200; - this.match(KipperParser.Colon); - this.state = 201; - this.typeSpecifierExpression(); - this.state = 204; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Assign) { - { + this.state = 197; + this.declarator(); + this.state = 198; + this.match(KipperParser.Colon); + this.state = 199; + this.typeSpecifierExpression(); this.state = 202; - this.match(KipperParser.Assign); - this.state = 203; - this.initializer(); + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Assign) { + { + this.state = 200; + this.match(KipperParser.Assign); + this.state = 201; + this.initializer(); + } } } - - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -636,8 +815,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -649,11 +827,10 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 206; - this.assignmentExpression(); + this.state = 204; + this.assignmentExpression(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -661,8 +838,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -674,11 +850,10 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 208; - this.directDeclarator(); + this.state = 206; + this.directDeclarator(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -686,8 +861,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -699,11 +873,10 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 210; - this.match(KipperParser.Identifier); + this.state = 208; + this.match(KipperParser.Identifier); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -711,8 +884,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -725,41 +897,40 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 212; - this.match(KipperParser.DefFunc); - this.state = 213; - this.declarator(); - this.state = 214; - this.match(KipperParser.LeftParen); - this.state = 216; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Identifier) { - { - this.state = 215; - this.parameterList(); + this.state = 210; + this.match(KipperParser.DefFunc); + this.state = 211; + this.declarator(); + this.state = 212; + this.match(KipperParser.LeftParen); + this.state = 214; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Identifier) { + { + this.state = 213; + this.parameterList(); + } } - } - this.state = 218; - this.match(KipperParser.RightParen); - this.state = 219; - this.match(KipperParser.RetIndicator); - this.state = 220; - this.typeSpecifierExpression(); - this.state = 222; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 7, this._ctx) ) { - case 1: - { - this.state = 221; - this.compoundStatement(); + this.state = 216; + this.match(KipperParser.RightParen); + this.state = 217; + this.match(KipperParser.RetIndicator); + this.state = 218; + this.typeSpecifierExpression(); + this.state = 220; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 7, this._ctx)) { + case 1: + { + this.state = 219; + this.compoundStatement(); + } + break; } - break; - } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -767,8 +938,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -781,27 +951,26 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 224; - this.parameterDeclaration(); - this.state = 229; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.Comma) { - { - { - this.state = 225; - this.match(KipperParser.Comma); - this.state = 226; + this.state = 222; this.parameterDeclaration(); - } - } - this.state = 231; + this.state = 227; this._errHandler.sync(this); _la = this._input.LA(1); + while (_la === KipperParser.Comma) { + { + { + this.state = 223; + this.match(KipperParser.Comma); + this.state = 224; + this.parameterDeclaration(); + } + } + this.state = 229; + this._errHandler.sync(this); + _la = this._input.LA(1); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -809,8 +978,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -822,15 +990,14 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 232; - this.declarator(); - this.state = 233; - this.match(KipperParser.Colon); - this.state = 234; - this.typeSpecifierExpression(); + this.state = 230; + this.declarator(); + this.state = 231; + this.match(KipperParser.Colon); + this.state = 232; + this.typeSpecifierExpression(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -838,8 +1005,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -852,27 +1018,30 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 236; - this.match(KipperParser.Interface); - this.state = 237; - this.match(KipperParser.Identifier); - this.state = 238; - this.match(KipperParser.LeftBrace); - this.state = 240; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Identifier) { - { - this.state = 239; - this.interfaceMemberList(); + this.state = 234; + this.match(KipperParser.Interface); + this.state = 235; + this.declarator(); + this.state = 236; + this.match(KipperParser.LeftBrace); + this.state = 240; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.Identifier) { + { + { + this.state = 237; + this.interfaceMemberDeclaration(); + } + } + this.state = 242; + this._errHandler.sync(this); + _la = this._input.LA(1); } + this.state = 243; + this.match(KipperParser.RightBrace); } - - this.state = 242; - this.match(KipperParser.RightBrace); - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -880,37 +1049,36 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) - public interfaceMemberList(): InterfaceMemberListContext { - let _localctx: InterfaceMemberListContext = new InterfaceMemberListContext(this._ctx, this.state); - this.enterRule(_localctx, 32, KipperParser.RULE_interfaceMemberList); - let _la: number; + public interfaceMemberDeclaration(): InterfaceMemberDeclarationContext { + let _localctx: InterfaceMemberDeclarationContext = new InterfaceMemberDeclarationContext(this._ctx, this.state); + this.enterRule(_localctx, 32, KipperParser.RULE_interfaceMemberDeclaration); try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 245; + this.state = 247; this._errHandler.sync(this); - _la = this._input.LA(1); - do { - { - { - this.state = 244; - this.interfaceMemberDeclaration(); - } - } - this.state = 247; - this._errHandler.sync(this); - _la = this._input.LA(1); - } while (_la === KipperParser.Identifier); + switch (this.interpreter.adaptivePredict(this._input, 10, this._ctx)) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 245; + this.interfacePropertyDeclaration(); + } + break; + + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 246; + this.interfaceMethodDeclaration(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -918,38 +1086,28 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) - public interfaceMemberDeclaration(): InterfaceMemberDeclarationContext { - let _localctx: InterfaceMemberDeclarationContext = new InterfaceMemberDeclarationContext(this._ctx, this.state); - this.enterRule(_localctx, 34, KipperParser.RULE_interfaceMemberDeclaration); + public interfacePropertyDeclaration(): InterfacePropertyDeclarationContext { + let _localctx: InterfacePropertyDeclarationContext = new InterfacePropertyDeclarationContext(this._ctx, this.state); + this.enterRule(_localctx, 34, KipperParser.RULE_interfacePropertyDeclaration); try { - this.state = 251; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 11, this._ctx) ) { - case 1: - this.enterOuterAlt(_localctx, 1); - { + this.enterOuterAlt(_localctx, 1); + { this.state = 249; - this.propertySignature(); - } - break; - - case 2: - this.enterOuterAlt(_localctx, 2); - { + this.declarator(); this.state = 250; - this.methodSignature(); - } - break; + this.match(KipperParser.Colon); + this.state = 251; + this.typeSpecifierExpression(); + this.state = 252; + this.match(KipperParser.SemiColon); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -957,30 +1115,43 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) - public propertySignature(): PropertySignatureContext { - let _localctx: PropertySignatureContext = new PropertySignatureContext(this._ctx, this.state); - this.enterRule(_localctx, 36, KipperParser.RULE_propertySignature); + public interfaceMethodDeclaration(): InterfaceMethodDeclarationContext { + let _localctx: InterfaceMethodDeclarationContext = new InterfaceMethodDeclarationContext(this._ctx, this.state); + this.enterRule(_localctx, 36, KipperParser.RULE_interfaceMethodDeclaration); + let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 253; - this.match(KipperParser.Identifier); - this.state = 254; - this.match(KipperParser.Colon); - this.state = 255; - this.typeSpecifierExpression(); - this.state = 256; - this.match(KipperParser.SemiColon); + this.state = 254; + this.declarator(); + this.state = 255; + this.match(KipperParser.LeftParen); + this.state = 257; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Identifier) { + { + this.state = 256; + this.parameterList(); + } + } + + this.state = 259; + this.match(KipperParser.RightParen); + this.state = 260; + this.match(KipperParser.Colon); + this.state = 261; + this.typeSpecifierExpression(); + this.state = 262; + this.match(KipperParser.SemiColon); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -988,76 +1159,28 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) - public methodSignature(): MethodSignatureContext { - let _localctx: MethodSignatureContext = new MethodSignatureContext(this._ctx, this.state); - this.enterRule(_localctx, 38, KipperParser.RULE_methodSignature); - let _la: number; + public classDeclaration(): ClassDeclarationContext { + let _localctx: ClassDeclarationContext = new ClassDeclarationContext(this._ctx, this.state); + this.enterRule(_localctx, 38, KipperParser.RULE_classDeclaration); try { this.enterOuterAlt(_localctx, 1); { - this.state = 258; - this.match(KipperParser.Identifier); - this.state = 259; - this.match(KipperParser.LeftParen); - this.state = 261; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Identifier) { - { - this.state = 260; - this.parameterList(); - } - } - - this.state = 263; - this.match(KipperParser.RightParen); - this.state = 264; - this.match(KipperParser.RetIndicator); - this.state = 265; - this.typeSpecifierExpression(); - this.state = 266; - this.match(KipperParser.SemiColon); - } - } - catch (re) { - if (re instanceof RecognitionException) { - _localctx.exception = re; - this._errHandler.reportError(this, re); - this._errHandler.recover(this, re); - } else { - throw re; - } - } - finally { - this.exitRule(); - } - return _localctx; - } - // @RuleVersion(0) - public classDeclaration(): ClassDeclarationContext { - let _localctx: ClassDeclarationContext = new ClassDeclarationContext(this._ctx, this.state); - this.enterRule(_localctx, 40, KipperParser.RULE_classDeclaration); - try { - this.enterOuterAlt(_localctx, 1); - { - this.state = 268; - this.match(KipperParser.Class); - this.state = 269; - this.match(KipperParser.Identifier); - this.state = 270; - this.match(KipperParser.LeftBrace); - this.state = 271; - this.match(KipperParser.RightBrace); - } - } - catch (re) { + this.state = 264; + this.match(KipperParser.Class); + this.state = 265; + this.declarator(); + this.state = 266; + this.match(KipperParser.LeftBrace); + this.state = 267; + this.match(KipperParser.RightBrace); + } + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1065,8 +1188,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1074,61 +1196,60 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public statement(): StatementContext { let _localctx: StatementContext = new StatementContext(this._ctx, this.state); - this.enterRule(_localctx, 42, KipperParser.RULE_statement); + this.enterRule(_localctx, 40, KipperParser.RULE_statement); try { - this.state = 279; + this.state = 275; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 13, this._ctx) ) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 273; - this.expressionStatement(); - } - break; + switch (this.interpreter.adaptivePredict(this._input, 12, this._ctx)) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 269; + this.expressionStatement(); + } + break; - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 274; - this.selectionStatement(); - } - break; + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 270; + this.selectionStatement(); + } + break; - case 3: - this.enterOuterAlt(_localctx, 3); - { - this.state = 275; - this.iterationStatement(); - } - break; + case 3: + this.enterOuterAlt(_localctx, 3); + { + this.state = 271; + this.iterationStatement(); + } + break; - case 4: - this.enterOuterAlt(_localctx, 4); - { - this.state = 276; - this.jumpStatement(); - } - break; + case 4: + this.enterOuterAlt(_localctx, 4); + { + this.state = 272; + this.jumpStatement(); + } + break; - case 5: - this.enterOuterAlt(_localctx, 5); - { - this.state = 277; - this.returnStatement(); - } - break; + case 5: + this.enterOuterAlt(_localctx, 5); + { + this.state = 273; + this.returnStatement(); + } + break; - case 6: - this.enterOuterAlt(_localctx, 6); - { - this.state = 278; - this.compoundStatement(); - } - break; + case 6: + this.enterOuterAlt(_localctx, 6); + { + this.state = 274; + this.compoundStatement(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1136,8 +1257,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1145,31 +1265,30 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public compoundStatement(): CompoundStatementContext { let _localctx: CompoundStatementContext = new CompoundStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 44, KipperParser.RULE_compoundStatement); + this.enterRule(_localctx, 42, KipperParser.RULE_compoundStatement); try { this.enterOuterAlt(_localctx, 1); { - this.state = 281; - if (!(this.notInsideExpressionStatement())) { - throw this.createFailedPredicateException("this.notInsideExpressionStatement()"); - } - this.state = 282; - this.match(KipperParser.LeftBrace); - this.state = 284; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 14, this._ctx) ) { - case 1: - { - this.state = 283; - this.blockItemList(); + this.state = 277; + if (!this.notInsideExpressionStatement()) { + throw this.createFailedPredicateException("this.notInsideExpressionStatement()"); } - break; - } - this.state = 286; - this.match(KipperParser.RightBrace); + this.state = 278; + this.match(KipperParser.LeftBrace); + this.state = 280; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 13, this._ctx)) { + case 1: + { + this.state = 279; + this.blockItemList(); + } + break; + } + this.state = 282; + this.match(KipperParser.RightBrace); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1177,8 +1296,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1186,19 +1304,18 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public expressionStatement(): ExpressionStatementContext { let _localctx: ExpressionStatementContext = new ExpressionStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 46, KipperParser.RULE_expressionStatement); + this.enterRule(_localctx, 44, KipperParser.RULE_expressionStatement); try { this.enterOuterAlt(_localctx, 1); { - this.enterExpressionStatement() - this.state = 289; - this.expression(); - this.state = 290; - this.match(KipperParser.SemiColon); - this.exitExpressionStatement() + this.enterExpressionStatement(); + this.state = 285; + this.expression(); + this.state = 286; + this.match(KipperParser.SemiColon); + this.exitExpressionStatement(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1206,8 +1323,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1215,30 +1331,29 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public selectionStatement(): SelectionStatementContext { let _localctx: SelectionStatementContext = new SelectionStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 48, KipperParser.RULE_selectionStatement); + this.enterRule(_localctx, 46, KipperParser.RULE_selectionStatement); try { - this.state = 295; + this.state = 291; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.If: - this.enterOuterAlt(_localctx, 1); - { - this.state = 293; - this.ifStatement(); - } - break; - case KipperParser.Switch: - this.enterOuterAlt(_localctx, 2); - { - this.state = 294; - this.switchStatement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.If: + this.enterOuterAlt(_localctx, 1); + { + this.state = 289; + this.ifStatement(); + } + break; + case KipperParser.Switch: + this.enterOuterAlt(_localctx, 2); + { + this.state = 290; + this.switchStatement(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1246,8 +1361,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1255,35 +1369,34 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public ifStatement(): IfStatementContext { let _localctx: IfStatementContext = new IfStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 50, KipperParser.RULE_ifStatement); + this.enterRule(_localctx, 48, KipperParser.RULE_ifStatement); try { this.enterOuterAlt(_localctx, 1); { - this.state = 297; - this.match(KipperParser.If); - this.state = 298; - this.match(KipperParser.LeftParen); - this.state = 299; - this.expression(); - this.state = 300; - this.match(KipperParser.RightParen); - this.state = 301; - this.statement(); - this.state = 304; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 16, this._ctx) ) { - case 1: - { - this.state = 302; - this.match(KipperParser.Else); - this.state = 303; + this.state = 293; + this.match(KipperParser.If); + this.state = 294; + this.match(KipperParser.LeftParen); + this.state = 295; + this.expression(); + this.state = 296; + this.match(KipperParser.RightParen); + this.state = 297; this.statement(); + this.state = 300; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 15, this._ctx)) { + case 1: + { + this.state = 298; + this.match(KipperParser.Else); + this.state = 299; + this.statement(); + } + break; } - break; } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1291,8 +1404,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1300,40 +1412,39 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public switchStatement(): SwitchStatementContext { let _localctx: SwitchStatementContext = new SwitchStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 52, KipperParser.RULE_switchStatement); + this.enterRule(_localctx, 50, KipperParser.RULE_switchStatement); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 306; - this.match(KipperParser.Switch); - this.state = 307; - this.match(KipperParser.LeftParen); - this.state = 308; - this.expression(); - this.state = 309; - this.match(KipperParser.RightParen); - this.state = 310; - this.match(KipperParser.LeftBrace); - this.state = 314; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.Case || _la === KipperParser.Default) { - { - { - this.state = 311; - this.switchLabeledStatement(); - } - } - this.state = 316; + this.state = 302; + this.match(KipperParser.Switch); + this.state = 303; + this.match(KipperParser.LeftParen); + this.state = 304; + this.expression(); + this.state = 305; + this.match(KipperParser.RightParen); + this.state = 306; + this.match(KipperParser.LeftBrace); + this.state = 310; this._errHandler.sync(this); _la = this._input.LA(1); + while (_la === KipperParser.Case || _la === KipperParser.Default) { + { + { + this.state = 307; + this.switchLabeledStatement(); + } + } + this.state = 312; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 313; + this.match(KipperParser.RightBrace); } - this.state = 317; - this.match(KipperParser.RightBrace); - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1341,8 +1452,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1350,40 +1460,39 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public switchLabeledStatement(): SwitchLabeledStatementContext { let _localctx: SwitchLabeledStatementContext = new SwitchLabeledStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 54, KipperParser.RULE_switchLabeledStatement); + this.enterRule(_localctx, 52, KipperParser.RULE_switchLabeledStatement); try { - this.state = 327; + this.state = 323; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Case: - this.enterOuterAlt(_localctx, 1); - { - this.state = 319; - this.match(KipperParser.Case); - this.state = 320; - this.expression(); - this.state = 321; - this.match(KipperParser.Colon); - this.state = 322; - this.statement(); - } - break; - case KipperParser.Default: - this.enterOuterAlt(_localctx, 2); - { - this.state = 324; - this.match(KipperParser.Default); - this.state = 325; - this.match(KipperParser.Colon); - this.state = 326; - this.statement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Case: + this.enterOuterAlt(_localctx, 1); + { + this.state = 315; + this.match(KipperParser.Case); + this.state = 316; + this.expression(); + this.state = 317; + this.match(KipperParser.Colon); + this.state = 318; + this.statement(); + } + break; + case KipperParser.Default: + this.enterOuterAlt(_localctx, 2); + { + this.state = 320; + this.match(KipperParser.Default); + this.state = 321; + this.match(KipperParser.Colon); + this.state = 322; + this.statement(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1391,8 +1500,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1400,37 +1508,36 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public iterationStatement(): IterationStatementContext { let _localctx: IterationStatementContext = new IterationStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 56, KipperParser.RULE_iterationStatement); + this.enterRule(_localctx, 54, KipperParser.RULE_iterationStatement); try { - this.state = 332; + this.state = 328; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.For: - this.enterOuterAlt(_localctx, 1); - { - this.state = 329; - this.forLoopIterationStatement(); - } - break; - case KipperParser.While: - this.enterOuterAlt(_localctx, 2); - { - this.state = 330; - this.whileLoopIterationStatement(); - } - break; - case KipperParser.Do: - this.enterOuterAlt(_localctx, 3); - { - this.state = 331; - this.doWhileLoopIterationStatement(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.For: + this.enterOuterAlt(_localctx, 1); + { + this.state = 325; + this.forLoopIterationStatement(); + } + break; + case KipperParser.While: + this.enterOuterAlt(_localctx, 2); + { + this.state = 326; + this.whileLoopIterationStatement(); + } + break; + case KipperParser.Do: + this.enterOuterAlt(_localctx, 3); + { + this.state = 327; + this.doWhileLoopIterationStatement(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1438,8 +1545,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1447,97 +1553,188 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public forLoopIterationStatement(): ForLoopIterationStatementContext { let _localctx: ForLoopIterationStatementContext = new ForLoopIterationStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 58, KipperParser.RULE_forLoopIterationStatement); + this.enterRule(_localctx, 56, KipperParser.RULE_forLoopIterationStatement); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 334; - this.match(KipperParser.For); - this.state = 335; - this.match(KipperParser.LeftParen); - this.state = 342; - this._errHandler.sync(this); - _la = this._input.LA(1); - if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Const) | (1 << KipperParser.Var) | (1 << KipperParser.CallFunc) | (1 << KipperParser.True) | (1 << KipperParser.False) | (1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0) || ((((_la - 35)) & ~0x1F) === 0 && ((1 << (_la - 35)) & ((1 << (KipperParser.LeftParen - 35)) | (1 << (KipperParser.LeftBracket - 35)) | (1 << (KipperParser.LeftBrace - 35)) | (1 << (KipperParser.Plus - 35)) | (1 << (KipperParser.PlusPlus - 35)) | (1 << (KipperParser.Minus - 35)) | (1 << (KipperParser.MinusMinus - 35)) | (1 << (KipperParser.Not - 35)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { + this.state = 330; + this.match(KipperParser.For); + this.state = 331; + this.match(KipperParser.LeftParen); this.state = 338; this._errHandler.sync(this); - switch (this._input.LA(1)) { - case KipperParser.Const: - case KipperParser.Var: - { - this.state = 336; - this.variableDeclaration(); - } - break; - case KipperParser.CallFunc: - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Plus: - case KipperParser.PlusPlus: - case KipperParser.Minus: - case KipperParser.MinusMinus: - case KipperParser.Not: - case KipperParser.BitwiseNot: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: + _la = this._input.LA(1); + if ( + ((_la & ~0x1f) === 0 && + ((1 << _la) & + ((1 << KipperParser.Const) | + (1 << KipperParser.Var) | + (1 << KipperParser.CallFunc) | + (1 << KipperParser.True) | + (1 << KipperParser.False) | + (1 << KipperParser.Void) | + (1 << KipperParser.Null) | + (1 << KipperParser.Undefined))) !== + 0) || + (((_la - 35) & ~0x1f) === 0 && + ((1 << (_la - 35)) & + ((1 << (KipperParser.LeftParen - 35)) | + (1 << (KipperParser.LeftBracket - 35)) | + (1 << (KipperParser.LeftBrace - 35)) | + (1 << (KipperParser.Plus - 35)) | + (1 << (KipperParser.PlusPlus - 35)) | + (1 << (KipperParser.Minus - 35)) | + (1 << (KipperParser.MinusMinus - 35)) | + (1 << (KipperParser.Not - 35)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { { - this.state = 337; - this.expression(); + this.state = 334; + this._errHandler.sync(this); + switch (this._input.LA(1)) { + case KipperParser.Const: + case KipperParser.Var: + { + this.state = 332; + this.variableDeclaration(); + } + break; + case KipperParser.CallFunc: + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Plus: + case KipperParser.PlusPlus: + case KipperParser.Minus: + case KipperParser.MinusMinus: + case KipperParser.Not: + case KipperParser.BitwiseNot: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + { + this.state = 333; + this.expression(); + } + break; + default: + throw new NoViableAltException(this); + } + _localctx._forDeclaration = true; } - break; - default: - throw new NoViableAltException(this); - } - _localctx._forDeclaration = true } - } - this.state = 344; - this.match(KipperParser.SemiColon); - this.state = 348; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { - this.state = 345; - this.expression(); - _localctx._forCondition = true + this.state = 340; + this.match(KipperParser.SemiColon); + this.state = 344; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 341; + this.expression(); + _localctx._forCondition = true; + } } - } - this.state = 350; - this.match(KipperParser.SemiColon); - this.state = 354; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { - this.state = 351; - this.expression(); - _localctx._forIterationExp = true + this.state = 346; + this.match(KipperParser.SemiColon); + this.state = 350; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 347; + this.expression(); + _localctx._forIterationExp = true; + } } - } - this.state = 356; - this.match(KipperParser.RightParen); - this.state = 357; - this.statement(); + this.state = 352; + this.match(KipperParser.RightParen); + this.state = 353; + this.statement(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1545,8 +1742,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1554,23 +1750,22 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public whileLoopIterationStatement(): WhileLoopIterationStatementContext { let _localctx: WhileLoopIterationStatementContext = new WhileLoopIterationStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 60, KipperParser.RULE_whileLoopIterationStatement); + this.enterRule(_localctx, 58, KipperParser.RULE_whileLoopIterationStatement); try { this.enterOuterAlt(_localctx, 1); { - this.state = 359; - this.match(KipperParser.While); - this.state = 360; - this.match(KipperParser.LeftParen); - this.state = 361; - this.expression(); - this.state = 362; - this.match(KipperParser.RightParen); - this.state = 363; - this.statement(); - } - } - catch (re) { + this.state = 355; + this.match(KipperParser.While); + this.state = 356; + this.match(KipperParser.LeftParen); + this.state = 357; + this.expression(); + this.state = 358; + this.match(KipperParser.RightParen); + this.state = 359; + this.statement(); + } + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1578,36 +1773,37 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public doWhileLoopIterationStatement(): DoWhileLoopIterationStatementContext { - let _localctx: DoWhileLoopIterationStatementContext = new DoWhileLoopIterationStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 62, KipperParser.RULE_doWhileLoopIterationStatement); + let _localctx: DoWhileLoopIterationStatementContext = new DoWhileLoopIterationStatementContext( + this._ctx, + this.state, + ); + this.enterRule(_localctx, 60, KipperParser.RULE_doWhileLoopIterationStatement); try { this.enterOuterAlt(_localctx, 1); { - this.state = 365; - this.match(KipperParser.Do); - this.state = 366; - this.statement(); - this.state = 367; - this.match(KipperParser.While); - this.state = 368; - this.match(KipperParser.LeftParen); - this.state = 369; - this.expression(); - this.state = 370; - this.match(KipperParser.RightParen); - this.state = 371; - this.match(KipperParser.SemiColon); - } - } - catch (re) { + this.state = 361; + this.match(KipperParser.Do); + this.state = 362; + this.statement(); + this.state = 363; + this.match(KipperParser.While); + this.state = 364; + this.match(KipperParser.LeftParen); + this.state = 365; + this.expression(); + this.state = 366; + this.match(KipperParser.RightParen); + this.state = 367; + this.match(KipperParser.SemiColon); + } + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1615,8 +1811,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1624,28 +1819,27 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public jumpStatement(): JumpStatementContext { let _localctx: JumpStatementContext = new JumpStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 64, KipperParser.RULE_jumpStatement); + this.enterRule(_localctx, 62, KipperParser.RULE_jumpStatement); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 373; - _la = this._input.LA(1); - if (!(_la === KipperParser.Break || _la === KipperParser.Continue)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 369; + _la = this._input.LA(1); + if (!(_la === KipperParser.Break || _la === KipperParser.Continue)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 374; - this.match(KipperParser.SemiColon); + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 370; + this.match(KipperParser.SemiColon); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1653,8 +1847,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1662,28 +1855,56 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public returnStatement(): ReturnStatementContext { let _localctx: ReturnStatementContext = new ReturnStatementContext(this._ctx, this.state); - this.enterRule(_localctx, 66, KipperParser.RULE_returnStatement); + this.enterRule(_localctx, 64, KipperParser.RULE_returnStatement); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 376; - this.match(KipperParser.Return); - this.state = 378; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { - this.state = 377; - this.expression(); + this.state = 372; + this.match(KipperParser.Return); + this.state = 374; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 373; + this.expression(); + } } - } - this.state = 380; - this.match(KipperParser.SemiColon); + this.state = 376; + this.match(KipperParser.SemiColon); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1691,8 +1912,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1700,85 +1920,84 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public primaryExpression(): PrimaryExpressionContext { let _localctx: PrimaryExpressionContext = new PrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 68, KipperParser.RULE_primaryExpression); + this.enterRule(_localctx, 66, KipperParser.RULE_primaryExpression); try { - this.state = 391; + this.state = 387; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.LeftParen: - this.enterOuterAlt(_localctx, 1); - { - this.state = 382; - this.tangledPrimaryExpression(); - } - break; - case KipperParser.LeftBracket: - this.enterOuterAlt(_localctx, 2); - { - this.state = 383; - this.arrayPrimaryExpression(); - } - break; - case KipperParser.LeftBrace: - this.enterOuterAlt(_localctx, 3); - { - this.state = 384; - this.objectPrimaryExpression(); - } - break; - case KipperParser.True: - case KipperParser.False: - this.enterOuterAlt(_localctx, 4); - { - this.state = 385; - this.boolPrimaryExpression(); - } - break; - case KipperParser.Identifier: - this.enterOuterAlt(_localctx, 5); - { - this.state = 386; - this.identifierPrimaryExpression(); - } - break; - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - this.enterOuterAlt(_localctx, 6); - { - this.state = 387; - this.stringPrimaryExpression(); - } - break; - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 7); - { - this.state = 388; - this.fStringPrimaryExpression(); - } - break; - case KipperParser.IntegerConstant: - case KipperParser.FloatingConstant: - this.enterOuterAlt(_localctx, 8); - { - this.state = 389; - this.numberPrimaryExpression(); - } - break; - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - this.enterOuterAlt(_localctx, 9); - { - this.state = 390; - this.voidOrNullOrUndefinedPrimaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.LeftParen: + this.enterOuterAlt(_localctx, 1); + { + this.state = 378; + this.tangledPrimaryExpression(); + } + break; + case KipperParser.LeftBracket: + this.enterOuterAlt(_localctx, 2); + { + this.state = 379; + this.arrayPrimaryExpression(); + } + break; + case KipperParser.LeftBrace: + this.enterOuterAlt(_localctx, 3); + { + this.state = 380; + this.objectPrimaryExpression(); + } + break; + case KipperParser.True: + case KipperParser.False: + this.enterOuterAlt(_localctx, 4); + { + this.state = 381; + this.boolPrimaryExpression(); + } + break; + case KipperParser.Identifier: + this.enterOuterAlt(_localctx, 5); + { + this.state = 382; + this.identifierPrimaryExpression(); + } + break; + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + this.enterOuterAlt(_localctx, 6); + { + this.state = 383; + this.stringPrimaryExpression(); + } + break; + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 7); + { + this.state = 384; + this.fStringPrimaryExpression(); + } + break; + case KipperParser.IntegerConstant: + case KipperParser.FloatingConstant: + this.enterOuterAlt(_localctx, 8); + { + this.state = 385; + this.numberPrimaryExpression(); + } + break; + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + this.enterOuterAlt(_localctx, 9); + { + this.state = 386; + this.voidOrNullOrUndefinedPrimaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1786,8 +2005,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1795,19 +2013,18 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public tangledPrimaryExpression(): TangledPrimaryExpressionContext { let _localctx: TangledPrimaryExpressionContext = new TangledPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 70, KipperParser.RULE_tangledPrimaryExpression); + this.enterRule(_localctx, 68, KipperParser.RULE_tangledPrimaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 393; - this.match(KipperParser.LeftParen); - this.state = 394; - this.expression(); - this.state = 395; - this.match(KipperParser.RightParen); + this.state = 389; + this.match(KipperParser.LeftParen); + this.state = 390; + this.expression(); + this.state = 391; + this.match(KipperParser.RightParen); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1815,8 +2032,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1824,26 +2040,25 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public boolPrimaryExpression(): BoolPrimaryExpressionContext { let _localctx: BoolPrimaryExpressionContext = new BoolPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 72, KipperParser.RULE_boolPrimaryExpression); + this.enterRule(_localctx, 70, KipperParser.RULE_boolPrimaryExpression); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 397; - _la = this._input.LA(1); - if (!(_la === KipperParser.True || _la === KipperParser.False)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 393; + _la = this._input.LA(1); + if (!(_la === KipperParser.True || _la === KipperParser.False)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1851,8 +2066,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1860,15 +2074,14 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public identifierPrimaryExpression(): IdentifierPrimaryExpressionContext { let _localctx: IdentifierPrimaryExpressionContext = new IdentifierPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 74, KipperParser.RULE_identifierPrimaryExpression); + this.enterRule(_localctx, 72, KipperParser.RULE_identifierPrimaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 399; - this.identifier(); + this.state = 395; + this.identifier(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1876,8 +2089,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1885,15 +2097,14 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public identifier(): IdentifierContext { let _localctx: IdentifierContext = new IdentifierContext(this._ctx, this.state); - this.enterRule(_localctx, 76, KipperParser.RULE_identifier); + this.enterRule(_localctx, 74, KipperParser.RULE_identifier); try { this.enterOuterAlt(_localctx, 1); { - this.state = 401; - this.match(KipperParser.Identifier); + this.state = 397; + this.match(KipperParser.Identifier); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1901,40 +2112,41 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public identifierOrStringPrimaryExpression(): IdentifierOrStringPrimaryExpressionContext { - let _localctx: IdentifierOrStringPrimaryExpressionContext = new IdentifierOrStringPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 78, KipperParser.RULE_identifierOrStringPrimaryExpression); + let _localctx: IdentifierOrStringPrimaryExpressionContext = new IdentifierOrStringPrimaryExpressionContext( + this._ctx, + this.state, + ); + this.enterRule(_localctx, 76, KipperParser.RULE_identifierOrStringPrimaryExpression); try { - this.state = 405; + this.state = 401; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.Identifier: - this.enterOuterAlt(_localctx, 1); - { - this.state = 403; - this.identifier(); - } - break; - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - this.enterOuterAlt(_localctx, 2); - { - this.state = 404; - this.stringPrimaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.Identifier: + this.enterOuterAlt(_localctx, 1); + { + this.state = 399; + this.identifier(); + } + break; + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + this.enterOuterAlt(_localctx, 2); + { + this.state = 400; + this.stringPrimaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1942,8 +2154,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1951,26 +2162,25 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public stringPrimaryExpression(): StringPrimaryExpressionContext { let _localctx: StringPrimaryExpressionContext = new StringPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 80, KipperParser.RULE_stringPrimaryExpression); + this.enterRule(_localctx, 78, KipperParser.RULE_stringPrimaryExpression); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 407; - _la = this._input.LA(1); - if (!(_la === KipperParser.SingleQuoteStringLiteral || _la === KipperParser.DoubleQuoteStringLiteral)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 403; + _la = this._input.LA(1); + if (!(_la === KipperParser.SingleQuoteStringLiteral || _la === KipperParser.DoubleQuoteStringLiteral)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -1978,8 +2188,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -1987,63 +2196,62 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public fStringPrimaryExpression(): FStringPrimaryExpressionContext { let _localctx: FStringPrimaryExpressionContext = new FStringPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 82, KipperParser.RULE_fStringPrimaryExpression); + this.enterRule(_localctx, 80, KipperParser.RULE_fStringPrimaryExpression); let _la: number; try { - this.state = 425; + this.state = 421; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringSingleQuoteStart: - this.enterOuterAlt(_localctx, 1); - { - this.state = 409; - this.match(KipperParser.FStringSingleQuoteStart); - this.state = 413; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringSingleQuoteAtom) { - { + case KipperParser.FStringSingleQuoteStart: + this.enterOuterAlt(_localctx, 1); { - this.state = 410; - this.fStringSingleQuoteAtom(); - } + this.state = 405; + this.match(KipperParser.FStringSingleQuoteStart); + this.state = 409; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringSingleQuoteAtom) { + { + { + this.state = 406; + this.fStringSingleQuoteAtom(); + } + } + this.state = 411; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 412; + this.match(KipperParser.FStringSingleQuoteEnd); } - this.state = 415; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 416; - this.match(KipperParser.FStringSingleQuoteEnd); - } - break; - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 2); - { - this.state = 417; - this.match(KipperParser.FStringDoubleQuoteStart); - this.state = 421; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringDoubleQuoteAtom) { - { + break; + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 2); { - this.state = 418; - this.fStringDoubleQuoteAtom(); - } + this.state = 413; + this.match(KipperParser.FStringDoubleQuoteStart); + this.state = 417; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.FStringExpStart || _la === KipperParser.FStringDoubleQuoteAtom) { + { + { + this.state = 414; + this.fStringDoubleQuoteAtom(); + } + } + this.state = 419; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + this.state = 420; + this.match(KipperParser.FStringDoubleQuoteEnd); } - this.state = 423; - this._errHandler.sync(this); - _la = this._input.LA(1); - } - this.state = 424; - this.match(KipperParser.FStringDoubleQuoteEnd); - } - break; - default: - throw new NoViableAltException(this); + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2051,8 +2259,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2060,43 +2267,71 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public fStringSingleQuoteAtom(): FStringSingleQuoteAtomContext { let _localctx: FStringSingleQuoteAtomContext = new FStringSingleQuoteAtomContext(this._ctx, this.state); - this.enterRule(_localctx, 84, KipperParser.RULE_fStringSingleQuoteAtom); + this.enterRule(_localctx, 82, KipperParser.RULE_fStringSingleQuoteAtom); let _la: number; try { - this.state = 433; + this.state = 429; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringSingleQuoteAtom: - this.enterOuterAlt(_localctx, 1); - { - this.state = 427; - this.match(KipperParser.FStringSingleQuoteAtom); - } - break; - case KipperParser.FStringExpStart: - this.enterOuterAlt(_localctx, 2); - { - this.state = 428; - this.match(KipperParser.FStringExpStart); - this.state = 430; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + case KipperParser.FStringSingleQuoteAtom: + this.enterOuterAlt(_localctx, 1); { - this.state = 429; - this.expression(); + this.state = 423; + this.match(KipperParser.FStringSingleQuoteAtom); } - } + break; + case KipperParser.FStringExpStart: + this.enterOuterAlt(_localctx, 2); + { + this.state = 424; + this.match(KipperParser.FStringExpStart); + this.state = 426; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 425; + this.expression(); + } + } - this.state = 432; - this.match(KipperParser.FStringExpEnd); - } - break; - default: - throw new NoViableAltException(this); + this.state = 428; + this.match(KipperParser.FStringExpEnd); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2104,8 +2339,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2113,43 +2347,71 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public fStringDoubleQuoteAtom(): FStringDoubleQuoteAtomContext { let _localctx: FStringDoubleQuoteAtomContext = new FStringDoubleQuoteAtomContext(this._ctx, this.state); - this.enterRule(_localctx, 86, KipperParser.RULE_fStringDoubleQuoteAtom); + this.enterRule(_localctx, 84, KipperParser.RULE_fStringDoubleQuoteAtom); let _la: number; try { - this.state = 441; + this.state = 437; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.FStringDoubleQuoteAtom: - this.enterOuterAlt(_localctx, 1); - { - this.state = 435; - this.match(KipperParser.FStringDoubleQuoteAtom); - } - break; - case KipperParser.FStringExpStart: - this.enterOuterAlt(_localctx, 2); - { - this.state = 436; - this.match(KipperParser.FStringExpStart); - this.state = 438; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { + case KipperParser.FStringDoubleQuoteAtom: + this.enterOuterAlt(_localctx, 1); { - this.state = 437; - this.expression(); + this.state = 431; + this.match(KipperParser.FStringDoubleQuoteAtom); } - } + break; + case KipperParser.FStringExpStart: + this.enterOuterAlt(_localctx, 2); + { + this.state = 432; + this.match(KipperParser.FStringExpStart); + this.state = 434; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 433; + this.expression(); + } + } - this.state = 440; - this.match(KipperParser.FStringExpEnd); - } - break; - default: - throw new NoViableAltException(this); + this.state = 436; + this.match(KipperParser.FStringExpEnd); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2157,8 +2419,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2166,26 +2427,25 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public numberPrimaryExpression(): NumberPrimaryExpressionContext { let _localctx: NumberPrimaryExpressionContext = new NumberPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 88, KipperParser.RULE_numberPrimaryExpression); + this.enterRule(_localctx, 86, KipperParser.RULE_numberPrimaryExpression); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 443; - _la = this._input.LA(1); - if (!(_la === KipperParser.IntegerConstant || _la === KipperParser.FloatingConstant)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 439; + _la = this._input.LA(1); + if (!(_la === KipperParser.IntegerConstant || _la === KipperParser.FloatingConstant)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2193,8 +2453,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2202,57 +2461,85 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public arrayPrimaryExpression(): ArrayPrimaryExpressionContext { let _localctx: ArrayPrimaryExpressionContext = new ArrayPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 90, KipperParser.RULE_arrayPrimaryExpression); + this.enterRule(_localctx, 88, KipperParser.RULE_arrayPrimaryExpression); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 445; - this.match(KipperParser.LeftBracket); - this.state = 454; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { - this.state = 446; - this.expression(); - this.state = 451; + this.state = 441; + this.match(KipperParser.LeftBracket); + this.state = 450; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 34, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 447; - this.match(KipperParser.Comma); - this.state = 448; + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 442; this.expression(); - } + this.state = 447; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 443; + this.match(KipperParser.Comma); + this.state = 444; + this.expression(); + } + } + } + this.state = 449; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 33, this._ctx); } } - this.state = 453; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 34, this._ctx); } - } - } - this.state = 457; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Comma) { - { - this.state = 456; - this.match(KipperParser.Comma); + this.state = 453; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Comma) { + { + this.state = 452; + this.match(KipperParser.Comma); + } } - } - this.state = 459; - this.match(KipperParser.RightBracket); + this.state = 455; + this.match(KipperParser.RightBracket); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2260,8 +2547,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2269,57 +2555,63 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public objectPrimaryExpression(): ObjectPrimaryExpressionContext { let _localctx: ObjectPrimaryExpressionContext = new ObjectPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 92, KipperParser.RULE_objectPrimaryExpression); + this.enterRule(_localctx, 90, KipperParser.RULE_objectPrimaryExpression); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 461; - this.match(KipperParser.LeftBrace); - this.state = 470; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 73)) & ~0x1F) === 0 && ((1 << (_la - 73)) & ((1 << (KipperParser.Identifier - 73)) | (1 << (KipperParser.SingleQuoteStringLiteral - 73)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 73)))) !== 0)) { - { - this.state = 462; - this.objectProperty(); - this.state = 467; + this.state = 457; + this.match(KipperParser.LeftBrace); + this.state = 466; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 37, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 463; - this.match(KipperParser.Comma); - this.state = 464; + _la = this._input.LA(1); + if ( + ((_la - 73) & ~0x1f) === 0 && + ((1 << (_la - 73)) & + ((1 << (KipperParser.Identifier - 73)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 73)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 73)))) !== + 0 + ) { + { + this.state = 458; this.objectProperty(); - } + this.state = 463; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 36, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 459; + this.match(KipperParser.Comma); + this.state = 460; + this.objectProperty(); + } + } + } + this.state = 465; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 36, this._ctx); } } - this.state = 469; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 37, this._ctx); - } } - } - this.state = 473; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (_la === KipperParser.Comma) { - { - this.state = 472; - this.match(KipperParser.Comma); + this.state = 469; + this._errHandler.sync(this); + _la = this._input.LA(1); + if (_la === KipperParser.Comma) { + { + this.state = 468; + this.match(KipperParser.Comma); + } } - } - this.state = 475; - this.match(KipperParser.RightBrace); + this.state = 471; + this.match(KipperParser.RightBrace); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2327,8 +2619,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2336,19 +2627,18 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public objectProperty(): ObjectPropertyContext { let _localctx: ObjectPropertyContext = new ObjectPropertyContext(this._ctx, this.state); - this.enterRule(_localctx, 94, KipperParser.RULE_objectProperty); + this.enterRule(_localctx, 92, KipperParser.RULE_objectProperty); try { this.enterOuterAlt(_localctx, 1); { - this.state = 477; - this.identifierOrStringPrimaryExpression(); - this.state = 478; - this.match(KipperParser.Colon); - this.state = 479; - this.expression(); + this.state = 473; + this.identifierOrStringPrimaryExpression(); + this.state = 474; + this.match(KipperParser.Colon); + this.state = 475; + this.expression(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2356,35 +2646,41 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public voidOrNullOrUndefinedPrimaryExpression(): VoidOrNullOrUndefinedPrimaryExpressionContext { - let _localctx: VoidOrNullOrUndefinedPrimaryExpressionContext = new VoidOrNullOrUndefinedPrimaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 96, KipperParser.RULE_voidOrNullOrUndefinedPrimaryExpression); + let _localctx: VoidOrNullOrUndefinedPrimaryExpressionContext = new VoidOrNullOrUndefinedPrimaryExpressionContext( + this._ctx, + this.state, + ); + this.enterRule(_localctx, 94, KipperParser.RULE_voidOrNullOrUndefinedPrimaryExpression); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 481; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 477; + _la = this._input.LA(1); + if ( + !( + (_la & ~0x1f) === 0 && + ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0 + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2392,8 +2688,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2411,160 +2706,225 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: ComputedPrimaryExpressionContext = new ComputedPrimaryExpressionContext(this._ctx, _parentState); let _prevctx: ComputedPrimaryExpressionContext = _localctx; - let _startState: number = 98; - this.enterRecursionRule(_localctx, 98, KipperParser.RULE_computedPrimaryExpression, _p); + let _startState: number = 96; + this.enterRecursionRule(_localctx, 96, KipperParser.RULE_computedPrimaryExpression, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 494; - this._errHandler.sync(this); - switch (this._input.LA(1)) { - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - { - _localctx = new PassOncomputedPrimaryExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 484; - this.primaryExpression(); - } - break; - case KipperParser.CallFunc: - { - _localctx = new ExplicitCallFunctionCallExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - this.state = 485; - this.match(KipperParser.CallFunc); - this.state = 486; - this.computedPrimaryExpression(0); - this.state = 487; - this.match(KipperParser.LeftParen); - this.state = 489; + this.state = 490; this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { - this.state = 488; - this.argumentExpressionList(); - } - } - - this.state = 491; - this.match(KipperParser.RightParen); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression - } - break; - default: - throw new NoViableAltException(this); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 517; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 44, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } - _prevctx = _localctx; - { - this.state = 515; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 43, this._ctx) ) { - case 1: + switch (this._input.LA(1)) { + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: { - _localctx = new FunctionCallExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 496; - if (!(this.precpred(this._ctx, 5))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 5)"); - } - this.state = 497; - this.match(KipperParser.LeftParen); - this.state = 499; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { - this.state = 498; - this.argumentExpressionList(); - } - } + _localctx = new PassOncomputedPrimaryExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; - this.state = 501; - this.match(KipperParser.RightParen); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression + this.state = 480; + this.primaryExpression(); } break; - - case 2: + case KipperParser.CallFunc: { - _localctx = new DotNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 503; - if (!(this.precpred(this._ctx, 3))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 3)"); - } - this.state = 504; - this.dotNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression - } - break; + _localctx = new ExplicitCallFunctionCallExpressionContext(_localctx); + this._ctx = _localctx; + _prevctx = _localctx; + this.state = 481; + this.match(KipperParser.CallFunc); + this.state = 482; + this.computedPrimaryExpression(0); + this.state = 483; + this.match(KipperParser.LeftParen); + this.state = 485; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 484; + this.argumentExpressionList(); + } + } - case 3: - { - _localctx = new BracketNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 507; - if (!(this.precpred(this._ctx, 2))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 2)"); - } - this.state = 508; - this.bracketNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression + this.state = 487; + this.match(KipperParser.RightParen); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression; } break; - - case 4: - { - _localctx = new SliceNotationMemberAccessExpressionContext(new ComputedPrimaryExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); - this.state = 511; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + default: + throw new NoViableAltException(this); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 513; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 43, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); } - this.state = 512; - this.sliceNotation(); - _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression + _prevctx = _localctx; + { + this.state = 511; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 42, this._ctx)) { + case 1: + { + _localctx = new FunctionCallExpressionContext( + new ComputedPrimaryExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 492; + if (!this.precpred(this._ctx, 5)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 5)"); + } + this.state = 493; + this.match(KipperParser.LeftParen); + this.state = 495; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 494; + this.argumentExpressionList(); + } + } + + this.state = 497; + this.match(KipperParser.RightParen); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_functionCallExpression; + } + break; + + case 2: + { + _localctx = new DotNotationMemberAccessExpressionContext( + new ComputedPrimaryExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 499; + if (!this.precpred(this._ctx, 3)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 3)"); + } + this.state = 500; + this.dotNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; + } + break; + + case 3: + { + _localctx = new BracketNotationMemberAccessExpressionContext( + new ComputedPrimaryExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 503; + if (!this.precpred(this._ctx, 2)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 2)"); + } + this.state = 504; + this.bracketNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; + } + break; + + case 4: + { + _localctx = new SliceNotationMemberAccessExpressionContext( + new ComputedPrimaryExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_computedPrimaryExpression); + this.state = 507; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 508; + this.sliceNotation(); + _localctx._labelASTKind = ParseRuleKindMapping.RULE_memberAccessExpression; + } + break; + } } - break; - } } + this.state = 515; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 43, this._ctx); } - this.state = 519; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 44, this._ctx); } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2572,8 +2932,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -2581,32 +2940,31 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public argumentExpressionList(): ArgumentExpressionListContext { let _localctx: ArgumentExpressionListContext = new ArgumentExpressionListContext(this._ctx, this.state); - this.enterRule(_localctx, 100, KipperParser.RULE_argumentExpressionList); + this.enterRule(_localctx, 98, KipperParser.RULE_argumentExpressionList); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 520; - this.assignmentExpression(); - this.state = 525; - this._errHandler.sync(this); - _la = this._input.LA(1); - while (_la === KipperParser.Comma) { - { - { - this.state = 521; - this.match(KipperParser.Comma); - this.state = 522; + this.state = 516; this.assignmentExpression(); - } - } - this.state = 527; + this.state = 521; this._errHandler.sync(this); _la = this._input.LA(1); + while (_la === KipperParser.Comma) { + { + { + this.state = 517; + this.match(KipperParser.Comma); + this.state = 518; + this.assignmentExpression(); + } + } + this.state = 523; + this._errHandler.sync(this); + _la = this._input.LA(1); + } } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2614,8 +2972,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2623,17 +2980,16 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public dotNotation(): DotNotationContext { let _localctx: DotNotationContext = new DotNotationContext(this._ctx, this.state); - this.enterRule(_localctx, 102, KipperParser.RULE_dotNotation); + this.enterRule(_localctx, 100, KipperParser.RULE_dotNotation); try { this.enterOuterAlt(_localctx, 1); { - this.state = 528; - this.match(KipperParser.Dot); - this.state = 529; - this.identifier(); + this.state = 524; + this.match(KipperParser.Dot); + this.state = 525; + this.identifier(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2641,8 +2997,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2650,19 +3005,18 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public bracketNotation(): BracketNotationContext { let _localctx: BracketNotationContext = new BracketNotationContext(this._ctx, this.state); - this.enterRule(_localctx, 104, KipperParser.RULE_bracketNotation); + this.enterRule(_localctx, 102, KipperParser.RULE_bracketNotation); try { this.enterOuterAlt(_localctx, 1); { - this.state = 531; - this.match(KipperParser.LeftBracket); - this.state = 532; - this.expression(); - this.state = 533; - this.match(KipperParser.RightBracket); + this.state = 527; + this.match(KipperParser.LeftBracket); + this.state = 528; + this.expression(); + this.state = 529; + this.match(KipperParser.RightBracket); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2670,8 +3024,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2679,42 +3032,99 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public sliceNotation(): SliceNotationContext { let _localctx: SliceNotationContext = new SliceNotationContext(this._ctx, this.state); - this.enterRule(_localctx, 106, KipperParser.RULE_sliceNotation); + this.enterRule(_localctx, 104, KipperParser.RULE_sliceNotation); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 535; - this.match(KipperParser.LeftBracket); - this.state = 539; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { - this.state = 536; - this.expression(); - _localctx.sliceStart = true + this.state = 531; + this.match(KipperParser.LeftBracket); + this.state = 535; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 532; + this.expression(); + _localctx.sliceStart = true; + } } - } - this.state = 541; - this.match(KipperParser.Colon); - this.state = 545; - this._errHandler.sync(this); - _la = this._input.LA(1); - if (((((_la - 21)) & ~0x1F) === 0 && ((1 << (_la - 21)) & ((1 << (KipperParser.CallFunc - 21)) | (1 << (KipperParser.True - 21)) | (1 << (KipperParser.False - 21)) | (1 << (KipperParser.Void - 21)) | (1 << (KipperParser.Null - 21)) | (1 << (KipperParser.Undefined - 21)) | (1 << (KipperParser.LeftParen - 21)) | (1 << (KipperParser.LeftBracket - 21)) | (1 << (KipperParser.LeftBrace - 21)) | (1 << (KipperParser.Plus - 21)) | (1 << (KipperParser.PlusPlus - 21)) | (1 << (KipperParser.Minus - 21)) | (1 << (KipperParser.MinusMinus - 21)) | (1 << (KipperParser.Not - 21)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (KipperParser.BitwiseNot - 68)) | (1 << (KipperParser.Identifier - 68)) | (1 << (KipperParser.IntegerConstant - 68)) | (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | (1 << (KipperParser.FloatingConstant - 68)) | (1 << (KipperParser.FStringSingleQuoteStart - 68)) | (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== 0)) { - { - this.state = 542; - this.expression(); - _localctx.sliceEnd = true + this.state = 537; + this.match(KipperParser.Colon); + this.state = 541; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + (((_la - 21) & ~0x1f) === 0 && + ((1 << (_la - 21)) & + ((1 << (KipperParser.CallFunc - 21)) | + (1 << (KipperParser.True - 21)) | + (1 << (KipperParser.False - 21)) | + (1 << (KipperParser.Void - 21)) | + (1 << (KipperParser.Null - 21)) | + (1 << (KipperParser.Undefined - 21)) | + (1 << (KipperParser.LeftParen - 21)) | + (1 << (KipperParser.LeftBracket - 21)) | + (1 << (KipperParser.LeftBrace - 21)) | + (1 << (KipperParser.Plus - 21)) | + (1 << (KipperParser.PlusPlus - 21)) | + (1 << (KipperParser.Minus - 21)) | + (1 << (KipperParser.MinusMinus - 21)) | + (1 << (KipperParser.Not - 21)))) !== + 0) || + (((_la - 68) & ~0x1f) === 0 && + ((1 << (_la - 68)) & + ((1 << (KipperParser.BitwiseNot - 68)) | + (1 << (KipperParser.Identifier - 68)) | + (1 << (KipperParser.IntegerConstant - 68)) | + (1 << (KipperParser.SingleQuoteStringLiteral - 68)) | + (1 << (KipperParser.DoubleQuoteStringLiteral - 68)) | + (1 << (KipperParser.FloatingConstant - 68)) | + (1 << (KipperParser.FStringSingleQuoteStart - 68)) | + (1 << (KipperParser.FStringDoubleQuoteStart - 68)))) !== + 0) + ) { + { + this.state = 538; + this.expression(); + _localctx.sliceEnd = true; + } } - } - this.state = 547; - this.match(KipperParser.RightBracket); + this.state = 543; + this.match(KipperParser.RightBracket); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2722,8 +3132,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2731,29 +3140,28 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public postfixExpression(): PostfixExpressionContext { let _localctx: PostfixExpressionContext = new PostfixExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 108, KipperParser.RULE_postfixExpression); + this.enterRule(_localctx, 106, KipperParser.RULE_postfixExpression); try { - this.state = 551; + this.state = 547; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 48, this._ctx) ) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 549; - this.computedPrimaryExpression(0); - } - break; + switch (this.interpreter.adaptivePredict(this._input, 47, this._ctx)) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 545; + this.computedPrimaryExpression(0); + } + break; - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 550; - this.incrementOrDecrementPostfixExpression(); - } - break; + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 546; + this.incrementOrDecrementPostfixExpression(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2761,26 +3169,27 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public incrementOrDecrementPostfixExpression(): IncrementOrDecrementPostfixExpressionContext { - let _localctx: IncrementOrDecrementPostfixExpressionContext = new IncrementOrDecrementPostfixExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 110, KipperParser.RULE_incrementOrDecrementPostfixExpression); + let _localctx: IncrementOrDecrementPostfixExpressionContext = new IncrementOrDecrementPostfixExpressionContext( + this._ctx, + this.state, + ); + this.enterRule(_localctx, 108, KipperParser.RULE_incrementOrDecrementPostfixExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 553; - this.computedPrimaryExpression(0); - this.state = 554; - this.incrementOrDecrementOperator(); + this.state = 549; + this.computedPrimaryExpression(0); + this.state = 550; + this.incrementOrDecrementOperator(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2788,8 +3197,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2797,56 +3205,55 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public unaryExpression(): UnaryExpressionContext { let _localctx: UnaryExpressionContext = new UnaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 112, KipperParser.RULE_unaryExpression); + this.enterRule(_localctx, 110, KipperParser.RULE_unaryExpression); try { - this.state = 559; + this.state = 555; this._errHandler.sync(this); switch (this._input.LA(1)) { - case KipperParser.CallFunc: - case KipperParser.True: - case KipperParser.False: - case KipperParser.Void: - case KipperParser.Null: - case KipperParser.Undefined: - case KipperParser.LeftParen: - case KipperParser.LeftBracket: - case KipperParser.LeftBrace: - case KipperParser.Identifier: - case KipperParser.IntegerConstant: - case KipperParser.SingleQuoteStringLiteral: - case KipperParser.DoubleQuoteStringLiteral: - case KipperParser.FloatingConstant: - case KipperParser.FStringSingleQuoteStart: - case KipperParser.FStringDoubleQuoteStart: - this.enterOuterAlt(_localctx, 1); - { - this.state = 556; - this.postfixExpression(); - } - break; - case KipperParser.PlusPlus: - case KipperParser.MinusMinus: - this.enterOuterAlt(_localctx, 2); - { - this.state = 557; - this.incrementOrDecrementUnaryExpression(); - } - break; - case KipperParser.Plus: - case KipperParser.Minus: - case KipperParser.Not: - case KipperParser.BitwiseNot: - this.enterOuterAlt(_localctx, 3); - { - this.state = 558; - this.operatorModifiedUnaryExpression(); - } - break; - default: - throw new NoViableAltException(this); + case KipperParser.CallFunc: + case KipperParser.True: + case KipperParser.False: + case KipperParser.Void: + case KipperParser.Null: + case KipperParser.Undefined: + case KipperParser.LeftParen: + case KipperParser.LeftBracket: + case KipperParser.LeftBrace: + case KipperParser.Identifier: + case KipperParser.IntegerConstant: + case KipperParser.SingleQuoteStringLiteral: + case KipperParser.DoubleQuoteStringLiteral: + case KipperParser.FloatingConstant: + case KipperParser.FStringSingleQuoteStart: + case KipperParser.FStringDoubleQuoteStart: + this.enterOuterAlt(_localctx, 1); + { + this.state = 552; + this.postfixExpression(); + } + break; + case KipperParser.PlusPlus: + case KipperParser.MinusMinus: + this.enterOuterAlt(_localctx, 2); + { + this.state = 553; + this.incrementOrDecrementUnaryExpression(); + } + break; + case KipperParser.Plus: + case KipperParser.Minus: + case KipperParser.Not: + case KipperParser.BitwiseNot: + this.enterOuterAlt(_localctx, 3); + { + this.state = 554; + this.operatorModifiedUnaryExpression(); + } + break; + default: + throw new NoViableAltException(this); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2854,26 +3261,27 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public incrementOrDecrementUnaryExpression(): IncrementOrDecrementUnaryExpressionContext { - let _localctx: IncrementOrDecrementUnaryExpressionContext = new IncrementOrDecrementUnaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 114, KipperParser.RULE_incrementOrDecrementUnaryExpression); + let _localctx: IncrementOrDecrementUnaryExpressionContext = new IncrementOrDecrementUnaryExpressionContext( + this._ctx, + this.state, + ); + this.enterRule(_localctx, 112, KipperParser.RULE_incrementOrDecrementUnaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 561; - this.incrementOrDecrementOperator(); - this.state = 562; - this.postfixExpression(); + this.state = 557; + this.incrementOrDecrementOperator(); + this.state = 558; + this.postfixExpression(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2881,26 +3289,27 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public operatorModifiedUnaryExpression(): OperatorModifiedUnaryExpressionContext { - let _localctx: OperatorModifiedUnaryExpressionContext = new OperatorModifiedUnaryExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 116, KipperParser.RULE_operatorModifiedUnaryExpression); + let _localctx: OperatorModifiedUnaryExpressionContext = new OperatorModifiedUnaryExpressionContext( + this._ctx, + this.state, + ); + this.enterRule(_localctx, 114, KipperParser.RULE_operatorModifiedUnaryExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 564; - this.unaryOperator(); - this.state = 565; - this.postfixExpression(); + this.state = 560; + this.unaryOperator(); + this.state = 561; + this.postfixExpression(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2908,8 +3317,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2917,26 +3325,25 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public incrementOrDecrementOperator(): IncrementOrDecrementOperatorContext { let _localctx: IncrementOrDecrementOperatorContext = new IncrementOrDecrementOperatorContext(this._ctx, this.state); - this.enterRule(_localctx, 118, KipperParser.RULE_incrementOrDecrementOperator); + this.enterRule(_localctx, 116, KipperParser.RULE_incrementOrDecrementOperator); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 567; - _la = this._input.LA(1); - if (!(_la === KipperParser.PlusPlus || _la === KipperParser.MinusMinus)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 563; + _la = this._input.LA(1); + if (!(_la === KipperParser.PlusPlus || _la === KipperParser.MinusMinus)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2944,8 +3351,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2953,26 +3359,35 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public unaryOperator(): UnaryOperatorContext { let _localctx: UnaryOperatorContext = new UnaryOperatorContext(this._ctx, this.state); - this.enterRule(_localctx, 120, KipperParser.RULE_unaryOperator); + this.enterRule(_localctx, 118, KipperParser.RULE_unaryOperator); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 569; - _la = this._input.LA(1); - if (!(((((_la - 42)) & ~0x1F) === 0 && ((1 << (_la - 42)) & ((1 << (KipperParser.Plus - 42)) | (1 << (KipperParser.Minus - 42)) | (1 << (KipperParser.Not - 42)) | (1 << (KipperParser.BitwiseNot - 42)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 565; + _la = this._input.LA(1); + if ( + !( + ((_la - 42) & ~0x1f) === 0 && + ((1 << (_la - 42)) & + ((1 << (KipperParser.Plus - 42)) | + (1 << (KipperParser.Minus - 42)) | + (1 << (KipperParser.Not - 42)) | + (1 << (KipperParser.BitwiseNot - 42)))) !== + 0 + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -2980,8 +3395,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -2989,35 +3403,34 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public castOrConvertExpression(): CastOrConvertExpressionContext { let _localctx: CastOrConvertExpressionContext = new CastOrConvertExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 122, KipperParser.RULE_castOrConvertExpression); + this.enterRule(_localctx, 120, KipperParser.RULE_castOrConvertExpression); try { - this.state = 576; - this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 50, this._ctx) ) { - case 1: - _localctx = new PassOnCastOrConvertExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 571; - this.unaryExpression(); - } - break; + this.state = 572; + this._errHandler.sync(this); + switch (this.interpreter.adaptivePredict(this._input, 49, this._ctx)) { + case 1: + _localctx = new PassOnCastOrConvertExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 567; + this.unaryExpression(); + } + break; - case 2: - _localctx = new ActualCastOrConvertExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 572; - this.unaryExpression(); - this.state = 573; - this.match(KipperParser.As); - this.state = 574; - this.typeSpecifierExpression(); - } - break; + case 2: + _localctx = new ActualCastOrConvertExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 568; + this.unaryExpression(); + this.state = 569; + this.match(KipperParser.As); + this.state = 570; + this.typeSpecifierExpression(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3025,8 +3438,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -3044,63 +3456,74 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: MultiplicativeExpressionContext = new MultiplicativeExpressionContext(this._ctx, _parentState); let _prevctx: MultiplicativeExpressionContext = _localctx; - let _startState: number = 124; - this.enterRecursionRule(_localctx, 124, KipperParser.RULE_multiplicativeExpression, _p); + let _startState: number = 122; + this.enterRecursionRule(_localctx, 122, KipperParser.RULE_multiplicativeExpression, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnMultiplicativeExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 579; - this.castOrConvertExpression(); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 586; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnMultiplicativeExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualMultiplicativeExpressionContext(new MultiplicativeExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_multiplicativeExpression); - this.state = 581; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 582; - _la = this._input.LA(1); - if (!(((((_la - 46)) & ~0x1F) === 0 && ((1 << (_la - 46)) & ((1 << (KipperParser.Star - 46)) | (1 << (KipperParser.Div - 46)) | (1 << (KipperParser.Mod - 46)) | (1 << (KipperParser.PowerTo - 46)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 583; + this.state = 575; this.castOrConvertExpression(); - } - } } - this.state = 588; + this._ctx._stop = this._input.tryLT(-1); + this.state = 582; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); - } + _alt = this.interpreter.adaptivePredict(this._input, 50, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualMultiplicativeExpressionContext( + new MultiplicativeExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_multiplicativeExpression); + this.state = 577; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 578; + _la = this._input.LA(1); + if ( + !( + ((_la - 46) & ~0x1f) === 0 && + ((1 << (_la - 46)) & + ((1 << (KipperParser.Star - 46)) | + (1 << (KipperParser.Div - 46)) | + (1 << (KipperParser.Mod - 46)) | + (1 << (KipperParser.PowerTo - 46)))) !== + 0 + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 579; + this.castOrConvertExpression(); + } + } + } + this.state = 584; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 50, this._ctx); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3108,8 +3531,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3127,63 +3549,64 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: AdditiveExpressionContext = new AdditiveExpressionContext(this._ctx, _parentState); let _prevctx: AdditiveExpressionContext = _localctx; - let _startState: number = 126; - this.enterRecursionRule(_localctx, 126, KipperParser.RULE_additiveExpression, _p); + let _startState: number = 124; + this.enterRecursionRule(_localctx, 124, KipperParser.RULE_additiveExpression, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnAdditiveExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 590; - this.multiplicativeExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 597; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnAdditiveExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualAdditiveExpressionContext(new AdditiveExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_additiveExpression); - this.state = 592; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 593; - _la = this._input.LA(1); - if (!(_la === KipperParser.Plus || _la === KipperParser.Minus)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 594; + this.state = 586; this.multiplicativeExpression(0); - } - } } - this.state = 599; + this._ctx._stop = this._input.tryLT(-1); + this.state = 593; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); - } + _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualAdditiveExpressionContext( + new AdditiveExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_additiveExpression); + this.state = 588; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 589; + _la = this._input.LA(1); + if (!(_la === KipperParser.Plus || _la === KipperParser.Minus)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 590; + this.multiplicativeExpression(0); + } + } + } + this.state = 595; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 51, this._ctx); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3191,8 +3614,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3210,52 +3632,53 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: BitwiseShiftExpressionContext = new BitwiseShiftExpressionContext(this._ctx, _parentState); let _prevctx: BitwiseShiftExpressionContext = _localctx; - let _startState: number = 128; - this.enterRecursionRule(_localctx, 128, KipperParser.RULE_bitwiseShiftExpression, _p); + let _startState: number = 126; + this.enterRecursionRule(_localctx, 126, KipperParser.RULE_bitwiseShiftExpression, _p); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnBitwiseShiftExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 601; - this.additiveExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 609; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 53, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnBitwiseShiftExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualBitwiseShiftExpressionContext(new BitwiseShiftExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseShiftExpression); - this.state = 603; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 604; - this.bitwiseShiftOperators(); - this.state = 605; - this.bitwiseAndExpression(0); - } - } + + this.state = 597; + this.additiveExpression(0); } - this.state = 611; + this._ctx._stop = this._input.tryLT(-1); + this.state = 605; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 53, this._ctx); - } + _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualBitwiseShiftExpressionContext( + new BitwiseShiftExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseShiftExpression); + this.state = 599; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 600; + this.bitwiseShiftOperators(); + this.state = 601; + this.bitwiseAndExpression(0); + } + } + } + this.state = 607; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 52, this._ctx); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3263,8 +3686,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3272,26 +3694,34 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public bitwiseShiftOperators(): BitwiseShiftOperatorsContext { let _localctx: BitwiseShiftOperatorsContext = new BitwiseShiftOperatorsContext(this._ctx, this.state); - this.enterRule(_localctx, 130, KipperParser.RULE_bitwiseShiftOperators); + this.enterRule(_localctx, 128, KipperParser.RULE_bitwiseShiftOperators); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 612; - _la = this._input.LA(1); - if (!(((((_la - 69)) & ~0x1F) === 0 && ((1 << (_la - 69)) & ((1 << (KipperParser.BitwiseZeroFillLeftShift - 69)) | (1 << (KipperParser.BitwiseSignedRightShift - 69)) | (1 << (KipperParser.BitwiseZeroFillRightShift - 69)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 608; + _la = this._input.LA(1); + if ( + !( + ((_la - 69) & ~0x1f) === 0 && + ((1 << (_la - 69)) & + ((1 << (KipperParser.BitwiseZeroFillLeftShift - 69)) | + (1 << (KipperParser.BitwiseSignedRightShift - 69)) | + (1 << (KipperParser.BitwiseZeroFillRightShift - 69)))) !== + 0 + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3299,8 +3729,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -3318,63 +3747,74 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: RelationalExpressionContext = new RelationalExpressionContext(this._ctx, _parentState); let _prevctx: RelationalExpressionContext = _localctx; - let _startState: number = 132; - this.enterRecursionRule(_localctx, 132, KipperParser.RULE_relationalExpression, _p); + let _startState: number = 130; + this.enterRecursionRule(_localctx, 130, KipperParser.RULE_relationalExpression, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnRelationalExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 615; - this.bitwiseShiftExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 622; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 54, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnRelationalExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualRelationalExpressionContext(new RelationalExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_relationalExpression); - this.state = 617; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 618; - _la = this._input.LA(1); - if (!(((((_la - 61)) & ~0x1F) === 0 && ((1 << (_la - 61)) & ((1 << (KipperParser.Less - 61)) | (1 << (KipperParser.LessEqual - 61)) | (1 << (KipperParser.Greater - 61)) | (1 << (KipperParser.GreaterEqual - 61)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 619; + this.state = 611; this.bitwiseShiftExpression(0); - } - } } - this.state = 624; + this._ctx._stop = this._input.tryLT(-1); + this.state = 618; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 54, this._ctx); - } + _alt = this.interpreter.adaptivePredict(this._input, 53, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualRelationalExpressionContext( + new RelationalExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_relationalExpression); + this.state = 613; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 614; + _la = this._input.LA(1); + if ( + !( + ((_la - 61) & ~0x1f) === 0 && + ((1 << (_la - 61)) & + ((1 << (KipperParser.Less - 61)) | + (1 << (KipperParser.LessEqual - 61)) | + (1 << (KipperParser.Greater - 61)) | + (1 << (KipperParser.GreaterEqual - 61)))) !== + 0 + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 615; + this.bitwiseShiftExpression(0); + } + } + } + this.state = 620; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 53, this._ctx); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3382,8 +3822,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3401,63 +3840,64 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: EqualityExpressionContext = new EqualityExpressionContext(this._ctx, _parentState); let _prevctx: EqualityExpressionContext = _localctx; - let _startState: number = 134; - this.enterRecursionRule(_localctx, 134, KipperParser.RULE_equalityExpression, _p); + let _startState: number = 132; + this.enterRecursionRule(_localctx, 132, KipperParser.RULE_equalityExpression, _p); let _la: number; try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnEqualityExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 626; - this.relationalExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 633; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnEqualityExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualEqualityExpressionContext(new EqualityExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_equalityExpression); - this.state = 628; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 629; - _la = this._input.LA(1); - if (!(_la === KipperParser.Equal || _la === KipperParser.NotEqual)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } - this._errHandler.reportMatch(this); - this.consume(); - } - this.state = 630; + this.state = 622; this.relationalExpression(0); - } - } } - this.state = 635; + this._ctx._stop = this._input.tryLT(-1); + this.state = 629; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); - } + _alt = this.interpreter.adaptivePredict(this._input, 54, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualEqualityExpressionContext( + new EqualityExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_equalityExpression); + this.state = 624; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 625; + _la = this._input.LA(1); + if (!(_la === KipperParser.Equal || _la === KipperParser.NotEqual)) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } + + this._errHandler.reportMatch(this); + this.consume(); + } + this.state = 626; + this.relationalExpression(0); + } + } + } + this.state = 631; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 54, this._ctx); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3465,8 +3905,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3484,52 +3923,53 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: BitwiseAndExpressionContext = new BitwiseAndExpressionContext(this._ctx, _parentState); let _prevctx: BitwiseAndExpressionContext = _localctx; - let _startState: number = 136; - this.enterRecursionRule(_localctx, 136, KipperParser.RULE_bitwiseAndExpression, _p); + let _startState: number = 134; + this.enterRecursionRule(_localctx, 134, KipperParser.RULE_bitwiseAndExpression, _p); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnBitwiseAndExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 637; - this.equalityExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 644; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 56, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnBitwiseAndExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualBitwiseAndExpressionContext(new BitwiseAndExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseAndExpression); - this.state = 639; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 640; - this.match(KipperParser.BitwiseAnd); - this.state = 641; + + this.state = 633; this.equalityExpression(0); - } - } } - this.state = 646; + this._ctx._stop = this._input.tryLT(-1); + this.state = 640; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 56, this._ctx); - } + _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualBitwiseAndExpressionContext( + new BitwiseAndExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseAndExpression); + this.state = 635; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 636; + this.match(KipperParser.BitwiseAnd); + this.state = 637; + this.equalityExpression(0); + } + } + } + this.state = 642; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 55, this._ctx); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3537,8 +3977,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3556,52 +3995,53 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: BitwiseXorExpressionContext = new BitwiseXorExpressionContext(this._ctx, _parentState); let _prevctx: BitwiseXorExpressionContext = _localctx; - let _startState: number = 138; - this.enterRecursionRule(_localctx, 138, KipperParser.RULE_bitwiseXorExpression, _p); + let _startState: number = 136; + this.enterRecursionRule(_localctx, 136, KipperParser.RULE_bitwiseXorExpression, _p); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnBitwiseXorExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 648; - this.bitwiseAndExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 655; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 57, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnBitwiseXorExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualBitwiseXorExpressionContext(new BitwiseXorExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseXorExpression); - this.state = 650; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 651; - this.match(KipperParser.BitwiseXor); - this.state = 652; + + this.state = 644; this.bitwiseAndExpression(0); - } - } } - this.state = 657; + this._ctx._stop = this._input.tryLT(-1); + this.state = 651; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 57, this._ctx); - } + _alt = this.interpreter.adaptivePredict(this._input, 56, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualBitwiseXorExpressionContext( + new BitwiseXorExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseXorExpression); + this.state = 646; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 647; + this.match(KipperParser.BitwiseXor); + this.state = 648; + this.bitwiseAndExpression(0); + } + } + } + this.state = 653; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 56, this._ctx); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3609,8 +4049,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3628,52 +4067,53 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: BitwiseOrExpressionContext = new BitwiseOrExpressionContext(this._ctx, _parentState); let _prevctx: BitwiseOrExpressionContext = _localctx; - let _startState: number = 140; - this.enterRecursionRule(_localctx, 140, KipperParser.RULE_bitwiseOrExpression, _p); + let _startState: number = 138; + this.enterRecursionRule(_localctx, 138, KipperParser.RULE_bitwiseOrExpression, _p); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnBitwiseOrExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 659; - this.bitwiseXorExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 666; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 58, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnBitwiseOrExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualBitwiseOrExpressionContext(new BitwiseOrExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseOrExpression); - this.state = 661; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 662; - this.match(KipperParser.BitwiseOr); - this.state = 663; + + this.state = 655; this.bitwiseXorExpression(0); + } + this._ctx._stop = this._input.tryLT(-1); + this.state = 662; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 57, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualBitwiseOrExpressionContext( + new BitwiseOrExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_bitwiseOrExpression); + this.state = 657; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 658; + this.match(KipperParser.BitwiseOr); + this.state = 659; + this.bitwiseXorExpression(0); + } + } } - } + this.state = 664; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 57, this._ctx); } - this.state = 668; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 58, this._ctx); - } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3681,8 +4121,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3700,52 +4139,53 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: LogicalAndExpressionContext = new LogicalAndExpressionContext(this._ctx, _parentState); let _prevctx: LogicalAndExpressionContext = _localctx; - let _startState: number = 142; - this.enterRecursionRule(_localctx, 142, KipperParser.RULE_logicalAndExpression, _p); + let _startState: number = 140; + this.enterRecursionRule(_localctx, 140, KipperParser.RULE_logicalAndExpression, _p); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnLogicalAndExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 670; - this.bitwiseOrExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 677; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 59, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnLogicalAndExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualLogicalAndExpressionContext(new LogicalAndExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalAndExpression); - this.state = 672; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 673; - this.match(KipperParser.AndAnd); - this.state = 674; + + this.state = 666; this.bitwiseOrExpression(0); - } - } } - this.state = 679; + this._ctx._stop = this._input.tryLT(-1); + this.state = 673; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 59, this._ctx); - } + _alt = this.interpreter.adaptivePredict(this._input, 58, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualLogicalAndExpressionContext( + new LogicalAndExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalAndExpression); + this.state = 668; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 669; + this.match(KipperParser.AndAnd); + this.state = 670; + this.bitwiseOrExpression(0); + } + } + } + this.state = 675; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 58, this._ctx); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3753,8 +4193,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3772,52 +4211,53 @@ export class KipperParser extends KipperParserBase { let _parentState: number = this.state; let _localctx: LogicalOrExpressionContext = new LogicalOrExpressionContext(this._ctx, _parentState); let _prevctx: LogicalOrExpressionContext = _localctx; - let _startState: number = 144; - this.enterRecursionRule(_localctx, 144, KipperParser.RULE_logicalOrExpression, _p); + let _startState: number = 142; + this.enterRecursionRule(_localctx, 142, KipperParser.RULE_logicalOrExpression, _p); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - { - _localctx = new PassOnLogicalOrExpressionContext(_localctx); - this._ctx = _localctx; - _prevctx = _localctx; - - this.state = 681; - this.logicalAndExpression(0); - } - this._ctx._stop = this._input.tryLT(-1); - this.state = 688; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 60, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - if (this._parseListeners != null) { - this.triggerExitRuleEvent(); - } + { + _localctx = new PassOnLogicalOrExpressionContext(_localctx); + this._ctx = _localctx; _prevctx = _localctx; - { - { - _localctx = new ActualLogicalOrExpressionContext(new LogicalOrExpressionContext(_parentctx, _parentState)); - this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalOrExpression); - this.state = 683; - if (!(this.precpred(this._ctx, 1))) { - throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); - } - this.state = 684; - this.match(KipperParser.OrOr); - this.state = 685; + + this.state = 677; this.logicalAndExpression(0); - } - } } - this.state = 690; + this._ctx._stop = this._input.tryLT(-1); + this.state = 684; this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 60, this._ctx); - } + _alt = this.interpreter.adaptivePredict(this._input, 59, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + if (this._parseListeners != null) { + this.triggerExitRuleEvent(); + } + _prevctx = _localctx; + { + { + _localctx = new ActualLogicalOrExpressionContext( + new LogicalOrExpressionContext(_parentctx, _parentState), + ); + this.pushNewRecursionContext(_localctx, _startState, KipperParser.RULE_logicalOrExpression); + this.state = 679; + if (!this.precpred(this._ctx, 1)) { + throw this.createFailedPredicateException("this.precpred(this._ctx, 1)"); + } + this.state = 680; + this.match(KipperParser.OrOr); + this.state = 681; + this.logicalAndExpression(0); + } + } + } + this.state = 686; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 59, this._ctx); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3825,8 +4265,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.unrollRecursionContexts(_parentctx); } return _localctx; @@ -3834,39 +4273,38 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public conditionalExpression(): ConditionalExpressionContext { let _localctx: ConditionalExpressionContext = new ConditionalExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 146, KipperParser.RULE_conditionalExpression); + this.enterRule(_localctx, 144, KipperParser.RULE_conditionalExpression); try { - this.state = 698; + this.state = 694; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 61, this._ctx) ) { - case 1: - _localctx = new PassOnConditionalExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 691; - this.logicalOrExpression(0); - } - break; + switch (this.interpreter.adaptivePredict(this._input, 60, this._ctx)) { + case 1: + _localctx = new PassOnConditionalExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 687; + this.logicalOrExpression(0); + } + break; - case 2: - _localctx = new ActualConditionalExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 692; - this.logicalOrExpression(0); - this.state = 693; - this.match(KipperParser.QuestionMark); - this.state = 694; - this.conditionalExpression(); - this.state = 695; - this.match(KipperParser.Colon); - this.state = 696; - this.conditionalExpression(); - } - break; + case 2: + _localctx = new ActualConditionalExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 688; + this.logicalOrExpression(0); + this.state = 689; + this.match(KipperParser.QuestionMark); + this.state = 690; + this.conditionalExpression(); + this.state = 691; + this.match(KipperParser.Colon); + this.state = 692; + this.conditionalExpression(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3874,8 +4312,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -3883,35 +4320,34 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public assignmentExpression(): AssignmentExpressionContext { let _localctx: AssignmentExpressionContext = new AssignmentExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 148, KipperParser.RULE_assignmentExpression); + this.enterRule(_localctx, 146, KipperParser.RULE_assignmentExpression); try { - this.state = 705; + this.state = 701; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 62, this._ctx) ) { - case 1: - _localctx = new PassOnAssignmentExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 1); - { - this.state = 700; - this.conditionalExpression(); - } - break; + switch (this.interpreter.adaptivePredict(this._input, 61, this._ctx)) { + case 1: + _localctx = new PassOnAssignmentExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 1); + { + this.state = 696; + this.conditionalExpression(); + } + break; - case 2: - _localctx = new ActualAssignmentExpressionContext(_localctx); - this.enterOuterAlt(_localctx, 2); - { - this.state = 701; - this.computedPrimaryExpression(0); - this.state = 702; - this.assignmentOperator(); - this.state = 703; - this.assignmentExpression(); - } - break; + case 2: + _localctx = new ActualAssignmentExpressionContext(_localctx); + this.enterOuterAlt(_localctx, 2); + { + this.state = 697; + this.computedPrimaryExpression(0); + this.state = 698; + this.assignmentOperator(); + this.state = 699; + this.assignmentExpression(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3919,8 +4355,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -3928,26 +4363,37 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public assignmentOperator(): AssignmentOperatorContext { let _localctx: AssignmentOperatorContext = new AssignmentOperatorContext(this._ctx, this.state); - this.enterRule(_localctx, 150, KipperParser.RULE_assignmentOperator); + this.enterRule(_localctx, 148, KipperParser.RULE_assignmentOperator); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 707; - _la = this._input.LA(1); - if (!(((((_la - 53)) & ~0x1F) === 0 && ((1 << (_la - 53)) & ((1 << (KipperParser.Assign - 53)) | (1 << (KipperParser.PlusAssign - 53)) | (1 << (KipperParser.MinusAssign - 53)) | (1 << (KipperParser.StarAssign - 53)) | (1 << (KipperParser.DivAssign - 53)) | (1 << (KipperParser.ModAssign - 53)))) !== 0))) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 703; + _la = this._input.LA(1); + if ( + !( + ((_la - 53) & ~0x1f) === 0 && + ((1 << (_la - 53)) & + ((1 << (KipperParser.Assign - 53)) | + (1 << (KipperParser.PlusAssign - 53)) | + (1 << (KipperParser.MinusAssign - 53)) | + (1 << (KipperParser.StarAssign - 53)) | + (1 << (KipperParser.DivAssign - 53)) | + (1 << (KipperParser.ModAssign - 53)))) !== + 0 + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3955,8 +4401,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -3964,34 +4409,33 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public expression(): ExpressionContext { let _localctx: ExpressionContext = new ExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 152, KipperParser.RULE_expression); + this.enterRule(_localctx, 150, KipperParser.RULE_expression); try { let _alt: number; this.enterOuterAlt(_localctx, 1); { - this.state = 709; - this.assignmentExpression(); - this.state = 714; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 63, this._ctx); - while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { - if (_alt === 1) { - { - { - this.state = 710; - this.match(KipperParser.Comma); - this.state = 711; - this.assignmentExpression(); - } + this.state = 705; + this.assignmentExpression(); + this.state = 710; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 62, this._ctx); + while (_alt !== 2 && _alt !== ATN.INVALID_ALT_NUMBER) { + if (_alt === 1) { + { + { + this.state = 706; + this.match(KipperParser.Comma); + this.state = 707; + this.assignmentExpression(); + } + } } + this.state = 712; + this._errHandler.sync(this); + _alt = this.interpreter.adaptivePredict(this._input, 62, this._ctx); } - this.state = 716; - this._errHandler.sync(this); - _alt = this.interpreter.adaptivePredict(this._input, 63, this._ctx); } - } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -3999,8 +4443,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -4008,37 +4451,36 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public typeSpecifierExpression(): TypeSpecifierExpressionContext { let _localctx: TypeSpecifierExpressionContext = new TypeSpecifierExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 154, KipperParser.RULE_typeSpecifierExpression); + this.enterRule(_localctx, 152, KipperParser.RULE_typeSpecifierExpression); try { - this.state = 720; + this.state = 716; this._errHandler.sync(this); - switch ( this.interpreter.adaptivePredict(this._input, 64, this._ctx) ) { - case 1: - this.enterOuterAlt(_localctx, 1); - { - this.state = 717; - this.identifierTypeSpecifierExpression(); - } - break; + switch (this.interpreter.adaptivePredict(this._input, 63, this._ctx)) { + case 1: + this.enterOuterAlt(_localctx, 1); + { + this.state = 713; + this.identifierTypeSpecifierExpression(); + } + break; - case 2: - this.enterOuterAlt(_localctx, 2); - { - this.state = 718; - this.genericTypeSpecifierExpression(); - } - break; + case 2: + this.enterOuterAlt(_localctx, 2); + { + this.state = 714; + this.genericTypeSpecifierExpression(); + } + break; - case 3: - this.enterOuterAlt(_localctx, 3); - { - this.state = 719; - this.typeofTypeSpecifierExpression(); - } - break; + case 3: + this.enterOuterAlt(_localctx, 3); + { + this.state = 715; + this.typeofTypeSpecifierExpression(); + } + break; } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4046,24 +4488,25 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public identifierTypeSpecifierExpression(): IdentifierTypeSpecifierExpressionContext { - let _localctx: IdentifierTypeSpecifierExpressionContext = new IdentifierTypeSpecifierExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 156, KipperParser.RULE_identifierTypeSpecifierExpression); + let _localctx: IdentifierTypeSpecifierExpressionContext = new IdentifierTypeSpecifierExpressionContext( + this._ctx, + this.state, + ); + this.enterRule(_localctx, 154, KipperParser.RULE_identifierTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 722; - this.typeSpecifierIdentifier(); + this.state = 718; + this.typeSpecifierIdentifier(); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4071,30 +4514,31 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public genericTypeSpecifierExpression(): GenericTypeSpecifierExpressionContext { - let _localctx: GenericTypeSpecifierExpressionContext = new GenericTypeSpecifierExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 158, KipperParser.RULE_genericTypeSpecifierExpression); + let _localctx: GenericTypeSpecifierExpressionContext = new GenericTypeSpecifierExpressionContext( + this._ctx, + this.state, + ); + this.enterRule(_localctx, 156, KipperParser.RULE_genericTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 724; - this.typeSpecifierIdentifier(); - this.state = 725; - this.match(KipperParser.Less); - this.state = 726; - this.typeSpecifierIdentifier(); - this.state = 727; - this.match(KipperParser.Greater); - } - } - catch (re) { + this.state = 720; + this.typeSpecifierIdentifier(); + this.state = 721; + this.match(KipperParser.Less); + this.state = 722; + this.typeSpecifierIdentifier(); + this.state = 723; + this.match(KipperParser.Greater); + } + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4102,30 +4546,31 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) public typeofTypeSpecifierExpression(): TypeofTypeSpecifierExpressionContext { - let _localctx: TypeofTypeSpecifierExpressionContext = new TypeofTypeSpecifierExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 160, KipperParser.RULE_typeofTypeSpecifierExpression); + let _localctx: TypeofTypeSpecifierExpressionContext = new TypeofTypeSpecifierExpressionContext( + this._ctx, + this.state, + ); + this.enterRule(_localctx, 158, KipperParser.RULE_typeofTypeSpecifierExpression); try { this.enterOuterAlt(_localctx, 1); { - this.state = 729; - this.match(KipperParser.Typeof); - this.state = 730; - this.match(KipperParser.LeftParen); - this.state = 731; - this.typeSpecifierIdentifier(); - this.state = 732; - this.match(KipperParser.RightParen); + this.state = 725; + this.match(KipperParser.Typeof); + this.state = 726; + this.match(KipperParser.LeftParen); + this.state = 727; + this.typeSpecifierIdentifier(); + this.state = 728; + this.match(KipperParser.RightParen); } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4133,8 +4578,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -4142,26 +4586,32 @@ export class KipperParser extends KipperParserBase { // @RuleVersion(0) public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext { let _localctx: TypeSpecifierIdentifierContext = new TypeSpecifierIdentifierContext(this._ctx, this.state); - this.enterRule(_localctx, 162, KipperParser.RULE_typeSpecifierIdentifier); + this.enterRule(_localctx, 160, KipperParser.RULE_typeSpecifierIdentifier); let _la: number; try { this.enterOuterAlt(_localctx, 1); { - this.state = 734; - _la = this._input.LA(1); - if (!((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== 0) || _la === KipperParser.Identifier)) { - this._errHandler.recoverInline(this); - } else { - if (this._input.LA(1) === Token.EOF) { - this.matchedEOF = true; - } + this.state = 730; + _la = this._input.LA(1); + if ( + !( + ((_la & ~0x1f) === 0 && + ((1 << _la) & ((1 << KipperParser.Void) | (1 << KipperParser.Null) | (1 << KipperParser.Undefined))) !== + 0) || + _la === KipperParser.Identifier + ) + ) { + this._errHandler.recoverInline(this); + } else { + if (this._input.LA(1) === Token.EOF) { + this.matchedEOF = true; + } - this._errHandler.reportMatch(this); - this.consume(); - } + this._errHandler.reportMatch(this); + this.consume(); + } } - } - catch (re) { + } catch (re) { if (re instanceof RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); @@ -4169,8 +4619,7 @@ export class KipperParser extends KipperParserBase { } else { throw re; } - } - finally { + } finally { this.exitRule(); } return _localctx; @@ -4178,491 +4627,486 @@ export class KipperParser extends KipperParserBase { public sempred(_localctx: RuleContext, ruleIndex: number, predIndex: number): boolean { switch (ruleIndex) { - case 22: - return this.compoundStatement_sempred(_localctx as CompoundStatementContext, predIndex); + case 21: + return this.compoundStatement_sempred(_localctx as CompoundStatementContext, predIndex); - case 49: - return this.computedPrimaryExpression_sempred(_localctx as ComputedPrimaryExpressionContext, predIndex); + case 48: + return this.computedPrimaryExpression_sempred(_localctx as ComputedPrimaryExpressionContext, predIndex); - case 62: - return this.multiplicativeExpression_sempred(_localctx as MultiplicativeExpressionContext, predIndex); + case 61: + return this.multiplicativeExpression_sempred(_localctx as MultiplicativeExpressionContext, predIndex); - case 63: - return this.additiveExpression_sempred(_localctx as AdditiveExpressionContext, predIndex); + case 62: + return this.additiveExpression_sempred(_localctx as AdditiveExpressionContext, predIndex); - case 64: - return this.bitwiseShiftExpression_sempred(_localctx as BitwiseShiftExpressionContext, predIndex); + case 63: + return this.bitwiseShiftExpression_sempred(_localctx as BitwiseShiftExpressionContext, predIndex); - case 66: - return this.relationalExpression_sempred(_localctx as RelationalExpressionContext, predIndex); + case 65: + return this.relationalExpression_sempred(_localctx as RelationalExpressionContext, predIndex); - case 67: - return this.equalityExpression_sempred(_localctx as EqualityExpressionContext, predIndex); + case 66: + return this.equalityExpression_sempred(_localctx as EqualityExpressionContext, predIndex); - case 68: - return this.bitwiseAndExpression_sempred(_localctx as BitwiseAndExpressionContext, predIndex); + case 67: + return this.bitwiseAndExpression_sempred(_localctx as BitwiseAndExpressionContext, predIndex); - case 69: - return this.bitwiseXorExpression_sempred(_localctx as BitwiseXorExpressionContext, predIndex); + case 68: + return this.bitwiseXorExpression_sempred(_localctx as BitwiseXorExpressionContext, predIndex); - case 70: - return this.bitwiseOrExpression_sempred(_localctx as BitwiseOrExpressionContext, predIndex); + case 69: + return this.bitwiseOrExpression_sempred(_localctx as BitwiseOrExpressionContext, predIndex); - case 71: - return this.logicalAndExpression_sempred(_localctx as LogicalAndExpressionContext, predIndex); + case 70: + return this.logicalAndExpression_sempred(_localctx as LogicalAndExpressionContext, predIndex); - case 72: - return this.logicalOrExpression_sempred(_localctx as LogicalOrExpressionContext, predIndex); + case 71: + return this.logicalOrExpression_sempred(_localctx as LogicalOrExpressionContext, predIndex); } return true; } private compoundStatement_sempred(_localctx: CompoundStatementContext, predIndex: number): boolean { switch (predIndex) { - case 0: - return this.notInsideExpressionStatement(); + case 0: + return this.notInsideExpressionStatement(); } return true; } private computedPrimaryExpression_sempred(_localctx: ComputedPrimaryExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 1: - return this.precpred(this._ctx, 5); + case 1: + return this.precpred(this._ctx, 5); - case 2: - return this.precpred(this._ctx, 3); + case 2: + return this.precpred(this._ctx, 3); - case 3: - return this.precpred(this._ctx, 2); + case 3: + return this.precpred(this._ctx, 2); - case 4: - return this.precpred(this._ctx, 1); + case 4: + return this.precpred(this._ctx, 1); } return true; } private multiplicativeExpression_sempred(_localctx: MultiplicativeExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 5: - return this.precpred(this._ctx, 1); + case 5: + return this.precpred(this._ctx, 1); } return true; } private additiveExpression_sempred(_localctx: AdditiveExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 6: - return this.precpred(this._ctx, 1); + case 6: + return this.precpred(this._ctx, 1); } return true; } private bitwiseShiftExpression_sempred(_localctx: BitwiseShiftExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 7: - return this.precpred(this._ctx, 1); + case 7: + return this.precpred(this._ctx, 1); } return true; } private relationalExpression_sempred(_localctx: RelationalExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 8: - return this.precpred(this._ctx, 1); + case 8: + return this.precpred(this._ctx, 1); } return true; } private equalityExpression_sempred(_localctx: EqualityExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 9: - return this.precpred(this._ctx, 1); + case 9: + return this.precpred(this._ctx, 1); } return true; } private bitwiseAndExpression_sempred(_localctx: BitwiseAndExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 10: - return this.precpred(this._ctx, 1); + case 10: + return this.precpred(this._ctx, 1); } return true; } private bitwiseXorExpression_sempred(_localctx: BitwiseXorExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 11: - return this.precpred(this._ctx, 1); + case 11: + return this.precpred(this._ctx, 1); } return true; } private bitwiseOrExpression_sempred(_localctx: BitwiseOrExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 12: - return this.precpred(this._ctx, 1); + case 12: + return this.precpred(this._ctx, 1); } return true; } private logicalAndExpression_sempred(_localctx: LogicalAndExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 13: - return this.precpred(this._ctx, 1); + case 13: + return this.precpred(this._ctx, 1); } return true; } private logicalOrExpression_sempred(_localctx: LogicalOrExpressionContext, predIndex: number): boolean { switch (predIndex) { - case 14: - return this.precpred(this._ctx, 1); + case 14: + return this.precpred(this._ctx, 1); } return true; } private static readonly _serializedATNSegments: number = 2; private static readonly _serializedATNSegment0: string = - "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03W\u02E3\x04\x02" + + "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03W\u02DF\x04\x02" + "\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07" + "\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r\t\r\x04" + "\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t\x12\x04" + "\x13\t\x13\x04\x14\t\x14\x04\x15\t\x15\x04\x16\t\x16\x04\x17\t\x17\x04" + "\x18\t\x18\x04\x19\t\x19\x04\x1A\t\x1A\x04\x1B\t\x1B\x04\x1C\t\x1C\x04" + - "\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04\"\t\"\x04#" + - "\t#\x04$\t$\x04%\t%\x04&\t&\x04\'\t\'\x04(\t(\x04)\t)\x04*\t*\x04+\t+" + + '\x1D\t\x1D\x04\x1E\t\x1E\x04\x1F\t\x1F\x04 \t \x04!\t!\x04"\t"\x04#' + + "\t#\x04$\t$\x04%\t%\x04&\t&\x04'\t'\x04(\t(\x04)\t)\x04*\t*\x04+\t+" + "\x04,\t,\x04-\t-\x04.\t.\x04/\t/\x040\t0\x041\t1\x042\t2\x043\t3\x044" + "\t4\x045\t5\x046\t6\x047\t7\x048\t8\x049\t9\x04:\t:\x04;\t;\x04<\t<\x04" + "=\t=\x04>\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\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\x05\x11" + - "\xF3\n\x11\x03\x11\x03\x11\x03\x12\x06\x12\xF8\n\x12\r\x12\x0E\x12\xF9" + - "\x03\x13\x03\x13\x05\x13\xFE\n\x13\x03\x14\x03\x14\x03\x14\x03\x14\x03" + - "\x14\x03\x15\x03\x15\x03\x15\x05\x15\u0108\n\x15\x03\x15\x03\x15\x03\x15" + - "\x03\x15\x03\x15\x03\x16\x03\x16\x03\x16\x03\x16\x03\x16\x03\x17\x03\x17" + - "\x03\x17\x03\x17\x03\x17\x03\x17\x05\x17\u011A\n\x17\x03\x18\x03\x18\x03" + - "\x18\x05\x18\u011F\n\x18\x03\x18\x03\x18\x03\x19\x03\x19\x03\x19\x03\x19" + - "\x03\x19\x03\x1A\x03\x1A\x05\x1A\u012A\n\x1A\x03\x1B\x03\x1B\x03\x1B\x03" + - "\x1B\x03\x1B\x03\x1B\x03\x1B\x05\x1B\u0133\n\x1B\x03\x1C\x03\x1C\x03\x1C" + - "\x03\x1C\x03\x1C\x03\x1C\x07\x1C\u013B\n\x1C\f\x1C\x0E\x1C\u013E\v\x1C" + - "\x03\x1C\x03\x1C\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D\x03\x1D" + - "\x03\x1D\x05\x1D\u014A\n\x1D\x03\x1E\x03\x1E\x03\x1E\x05\x1E\u014F\n\x1E" + - "\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x05\x1F\u0155\n\x1F\x03\x1F\x03\x1F\x05" + - "\x1F\u0159\n\x1F\x03\x1F\x03\x1F\x03\x1F\x03\x1F\x05\x1F\u015F\n\x1F\x03" + - "\x1F\x03\x1F\x03\x1F\x03\x1F\x05\x1F\u0165\n\x1F\x03\x1F\x03\x1F\x03\x1F" + - "\x03 \x03 \x03 \x03 \x03 \x03 \x03!\x03!\x03!\x03!\x03!\x03!\x03!\x03" + - "!\x03\"\x03\"\x03\"\x03#\x03#\x05#\u017D\n#\x03#\x03#\x03$\x03$\x03$\x03" + - "$\x03$\x03$\x03$\x03$\x03$\x05$\u018A\n$\x03%\x03%\x03%\x03%\x03&\x03" + - "&\x03\'\x03\'\x03(\x03(\x03)\x03)\x05)\u0198\n)\x03*\x03*\x03+\x03+\x07" + - "+\u019E\n+\f+\x0E+\u01A1\v+\x03+\x03+\x03+\x07+\u01A6\n+\f+\x0E+\u01A9" + - "\v+\x03+\x05+\u01AC\n+\x03,\x03,\x03,\x05,\u01B1\n,\x03,\x05,\u01B4\n" + - ",\x03-\x03-\x03-\x05-\u01B9\n-\x03-\x05-\u01BC\n-\x03.\x03.\x03/\x03/" + - "\x03/\x03/\x07/\u01C4\n/\f/\x0E/\u01C7\v/\x05/\u01C9\n/\x03/\x05/\u01CC" + - "\n/\x03/\x03/\x030\x030\x030\x030\x070\u01D4\n0\f0\x0E0\u01D7\v0\x050" + - "\u01D9\n0\x030\x050\u01DC\n0\x030\x030\x031\x031\x031\x031\x032\x032\x03" + - "3\x033\x033\x033\x033\x033\x053\u01EC\n3\x033\x033\x033\x053\u01F1\n3" + - "\x033\x033\x033\x053\u01F6\n3\x033\x033\x033\x033\x033\x033\x033\x033" + - "\x033\x033\x033\x033\x033\x033\x073\u0206\n3\f3\x0E3\u0209\v3\x034\x03" + - "4\x034\x074\u020E\n4\f4\x0E4\u0211\v4\x035\x035\x035\x036\x036\x036\x03" + - "6\x037\x037\x037\x037\x057\u021E\n7\x037\x037\x037\x037\x057\u0224\n7" + - "\x037\x037\x038\x038\x058\u022A\n8\x039\x039\x039\x03:\x03:\x03:\x05:" + - "\u0232\n:\x03;\x03;\x03;\x03<\x03<\x03<\x03=\x03=\x03>\x03>\x03?\x03?" + - "\x03?\x03?\x03?\x05?\u0243\n?\x03@\x03@\x03@\x03@\x03@\x03@\x07@\u024B" + - "\n@\f@\x0E@\u024E\v@\x03A\x03A\x03A\x03A\x03A\x03A\x07A\u0256\nA\fA\x0E" + - "A\u0259\vA\x03B\x03B\x03B\x03B\x03B\x03B\x03B\x07B\u0262\nB\fB\x0EB\u0265" + - "\vB\x03C\x03C\x03D\x03D\x03D\x03D\x03D\x03D\x07D\u026F\nD\fD\x0ED\u0272" + - "\vD\x03E\x03E\x03E\x03E\x03E\x03E\x07E\u027A\nE\fE\x0EE\u027D\vE\x03F" + - "\x03F\x03F\x03F\x03F\x03F\x07F\u0285\nF\fF\x0EF\u0288\vF\x03G\x03G\x03" + - "G\x03G\x03G\x03G\x07G\u0290\nG\fG\x0EG\u0293\vG\x03H\x03H\x03H\x03H\x03" + - "H\x03H\x07H\u029B\nH\fH\x0EH\u029E\vH\x03I\x03I\x03I\x03I\x03I\x03I\x07" + - "I\u02A6\nI\fI\x0EI\u02A9\vI\x03J\x03J\x03J\x03J\x03J\x03J\x07J\u02B1\n" + - "J\fJ\x0EJ\u02B4\vJ\x03K\x03K\x03K\x03K\x03K\x03K\x03K\x05K\u02BD\nK\x03" + - "L\x03L\x03L\x03L\x03L\x05L\u02C4\nL\x03M\x03M\x03N\x03N\x03N\x07N\u02CB" + - "\nN\fN\x0EN\u02CE\vN\x03O\x03O\x03O\x05O\u02D3\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\x06\x07" + - "\x03\x02\r\x0E\x03\x02\x1B\x1C\x03\x02MN\x04\x02LLOO\x03\x02\x1E \x04" + - "\x02--//\x06\x02,,..66FF\x03\x0203\x04\x02,,..\x03\x02GI\x03\x02?B\x03" + - "\x02=>\x03\x027<\x04\x02\x1E KK\x02\u02E4\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\"\xF7\x03" + - "\x02\x02\x02$\xFD\x03\x02\x02\x02&\xFF\x03\x02\x02\x02(\u0104\x03\x02" + - "\x02\x02*\u010E\x03\x02\x02\x02,\u0119\x03\x02\x02\x02.\u011B\x03\x02" + - "\x02\x020\u0122\x03\x02\x02\x022\u0129\x03\x02\x02\x024\u012B\x03\x02" + - "\x02\x026\u0134\x03\x02\x02\x028\u0149\x03\x02\x02\x02:\u014E\x03\x02" + - "\x02\x02<\u0150\x03\x02\x02\x02>\u0169\x03\x02\x02\x02@\u016F\x03\x02" + - "\x02\x02B\u0177\x03\x02\x02\x02D\u017A\x03\x02\x02\x02F\u0189\x03\x02" + - "\x02\x02H\u018B\x03\x02\x02\x02J\u018F\x03\x02\x02\x02L\u0191\x03\x02" + - "\x02\x02N\u0193\x03\x02\x02\x02P\u0197\x03\x02\x02\x02R\u0199\x03\x02" + - "\x02\x02T\u01AB\x03\x02\x02\x02V\u01B3\x03\x02\x02\x02X\u01BB\x03\x02" + - "\x02\x02Z\u01BD\x03\x02\x02\x02\\\u01BF\x03\x02\x02\x02^\u01CF\x03\x02" + - "\x02\x02`\u01DF\x03\x02\x02\x02b\u01E3\x03\x02\x02\x02d\u01F0\x03\x02" + - "\x02\x02f\u020A\x03\x02\x02\x02h\u0212\x03\x02\x02\x02j\u0215\x03\x02" + - "\x02\x02l\u0219\x03\x02\x02\x02n\u0229\x03\x02\x02\x02p\u022B\x03\x02" + - "\x02\x02r\u0231\x03\x02\x02\x02t\u0233\x03\x02\x02\x02v\u0236\x03\x02" + - "\x02\x02x\u0239\x03\x02\x02\x02z\u023B\x03\x02\x02\x02|\u0242\x03\x02" + - "\x02\x02~\u0244\x03\x02\x02\x02\x80\u024F\x03\x02\x02\x02\x82\u025A\x03" + - "\x02\x02\x02\x84\u0266\x03\x02\x02\x02\x86\u0268\x03\x02\x02\x02\x88\u0273" + - "\x03\x02\x02\x02\x8A\u027E\x03\x02\x02\x02\x8C\u0289\x03\x02\x02\x02\x8E" + - "\u0294\x03\x02\x02\x02\x90\u029F\x03\x02\x02\x02\x92\u02AA\x03\x02\x02" + - "\x02\x94\u02BC\x03\x02\x02\x02\x96\u02C3\x03\x02\x02\x02\x98\u02C5\x03" + - "\x02\x02\x02\x9A\u02C7\x03\x02\x02\x02\x9C\u02D2\x03\x02\x02\x02\x9E\u02D4" + - "\x03\x02\x02\x02\xA0\u02D6\x03\x02\x02\x02\xA2\u02DB\x03\x02\x02\x02\xA4" + - "\u02E0\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,\x17\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*\x16\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\x077\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\x07K\x02\x02\xD5\x19\x03\x02\x02\x02" + - "\xD6\xD7\x07\x15\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\x18\x02\x02\xDE" + - "\xE0\x05\x9CO\x02\xDF\xE1\x05.\x18\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" + - "\x1A\x02\x02\xEF\xF0\x07K\x02\x02\xF0\xF2\x07*\x02\x02\xF1\xF3\x05\"\x12" + - "\x02\xF2\xF1\x03\x02\x02\x02\xF2\xF3\x03\x02\x02\x02\xF3\xF4\x03\x02\x02" + - "\x02\xF4\xF5\x07+\x02\x02\xF5!\x03\x02\x02\x02\xF6\xF8\x05$\x13\x02\xF7" + - "\xF6\x03\x02\x02\x02\xF8\xF9\x03\x02\x02\x02\xF9\xF7\x03\x02\x02\x02\xF9" + - "\xFA\x03\x02\x02\x02\xFA#\x03\x02\x02\x02\xFB\xFE\x05&\x14\x02\xFC\xFE" + - "\x05(\x15\x02\xFD\xFB\x03\x02\x02\x02\xFD\xFC\x03\x02\x02\x02\xFE%\x03" + - "\x02\x02\x02\xFF\u0100\x07K\x02\x02\u0100\u0101\x07$\x02\x02\u0101\u0102" + - "\x05\x9CO\x02\u0102\u0103\x07\"\x02\x02\u0103\'\x03\x02\x02\x02\u0104" + - "\u0105\x07K\x02\x02\u0105\u0107\x07%\x02\x02\u0106\u0108\x05\x1C\x0F\x02" + - "\u0107\u0106\x03\x02\x02\x02\u0107\u0108\x03\x02\x02\x02\u0108\u0109\x03" + - "\x02\x02\x02\u0109\u010A\x07&\x02\x02\u010A\u010B\x07\x18\x02\x02\u010B" + - "\u010C\x05\x9CO\x02\u010C\u010D\x07\"\x02\x02\u010D)\x03\x02\x02\x02\u010E" + - "\u010F\x07\x19\x02\x02\u010F\u0110\x07K\x02\x02\u0110\u0111\x07*\x02\x02" + - "\u0111\u0112\x07+\x02\x02\u0112+\x03\x02\x02\x02\u0113\u011A\x050\x19" + - "\x02\u0114\u011A\x052\x1A\x02\u0115\u011A\x05:\x1E\x02\u0116\u011A\x05" + - "B\"\x02\u0117\u011A\x05D#\x02\u0118\u011A\x05.\x18\x02\u0119\u0113\x03" + - "\x02\x02\x02\u0119\u0114\x03\x02\x02\x02\u0119\u0115\x03\x02\x02\x02\u0119" + - "\u0116\x03\x02\x02\x02\u0119\u0117\x03\x02\x02\x02\u0119\u0118\x03\x02" + - "\x02\x02\u011A-\x03\x02\x02\x02\u011B\u011C\x06\x18\x02\x02\u011C\u011E" + - "\x07*\x02\x02\u011D\u011F\x05\b\x05\x02\u011E\u011D\x03\x02\x02\x02\u011E" + - "\u011F\x03\x02\x02\x02\u011F\u0120\x03\x02\x02\x02\u0120\u0121\x07+\x02" + - "\x02\u0121/\x03\x02\x02\x02\u0122\u0123\b\x19\x01\x02\u0123\u0124\x05" + - "\x9AN\x02\u0124\u0125\x07\"\x02\x02\u0125\u0126\b\x19\x01\x02\u01261\x03" + - "\x02\x02\x02\u0127\u012A\x054\x1B\x02\u0128\u012A\x056\x1C\x02\u0129\u0127" + - "\x03\x02\x02\x02\u0129\u0128\x03\x02\x02\x02\u012A3\x03\x02\x02\x02\u012B" + - "\u012C\x07\x11\x02\x02\u012C\u012D\x07%\x02\x02\u012D\u012E\x05\x9AN\x02" + - "\u012E\u012F\x07&\x02\x02\u012F\u0132\x05,\x17\x02\u0130\u0131\x07\x12" + - "\x02\x02\u0131\u0133\x05,\x17\x02\u0132\u0130\x03\x02\x02\x02\u0132\u0133" + - "\x03\x02\x02\x02\u01335\x03\x02\x02\x02\u0134\u0135\x07\n\x02\x02\u0135" + - "\u0136\x07%\x02\x02\u0136\u0137\x05\x9AN\x02\u0137\u0138\x07&\x02\x02" + - "\u0138\u013C\x07*\x02\x02\u0139\u013B\x058\x1D\x02\u013A\u0139\x03\x02" + - "\x02\x02\u013B\u013E\x03\x02\x02\x02\u013C\u013A\x03\x02\x02\x02\u013C" + - "\u013D\x03\x02\x02\x02\u013D\u013F\x03\x02\x02\x02\u013E\u013C\x03\x02" + - "\x02\x02\u013F\u0140\x07+\x02\x02\u01407\x03\x02\x02\x02\u0141\u0142\x07" + - "\v\x02\x02\u0142\u0143\x05\x9AN\x02\u0143\u0144\x07$\x02\x02\u0144\u0145" + - "\x05,\x17\x02\u0145\u014A\x03\x02\x02\x02\u0146\u0147\x07\f\x02\x02\u0147" + - "\u0148\x07$\x02\x02\u0148\u014A\x05,\x17\x02\u0149\u0141\x03\x02\x02\x02" + - "\u0149\u0146\x03\x02\x02\x02\u014A9\x03\x02\x02\x02\u014B\u014F\x05<\x1F" + - "\x02\u014C\u014F\x05> \x02\u014D\u014F\x05@!\x02\u014E\u014B\x03\x02\x02" + - "\x02\u014E\u014C\x03\x02\x02\x02\u014E\u014D\x03\x02\x02\x02\u014F;\x03" + - "\x02\x02\x02\u0150\u0151\x07\x13\x02\x02\u0151\u0158\x07%\x02\x02\u0152" + - "\u0155\x05\x0E\b\x02\u0153\u0155\x05\x9AN\x02\u0154\u0152\x03\x02\x02" + - "\x02\u0154\u0153\x03\x02\x02\x02\u0155\u0156\x03\x02\x02\x02\u0156\u0157" + - "\b\x1F\x01\x02\u0157\u0159\x03\x02\x02\x02\u0158\u0154\x03\x02\x02\x02" + - "\u0158\u0159\x03\x02\x02\x02\u0159\u015A\x03\x02\x02\x02\u015A\u015E\x07" + - "\"\x02\x02\u015B\u015C\x05\x9AN\x02\u015C\u015D\b\x1F\x01\x02\u015D\u015F" + - "\x03\x02\x02\x02\u015E\u015B\x03\x02\x02\x02\u015E\u015F\x03\x02\x02\x02" + - "\u015F\u0160\x03\x02\x02\x02\u0160\u0164\x07\"\x02\x02\u0161\u0162\x05" + - "\x9AN\x02\u0162\u0163\b\x1F\x01\x02\u0163\u0165\x03\x02\x02\x02\u0164" + - "\u0161\x03\x02\x02\x02\u0164\u0165\x03\x02\x02\x02\u0165\u0166\x03\x02" + - "\x02\x02\u0166\u0167\x07&\x02\x02\u0167\u0168\x05,\x17\x02\u0168=\x03" + - "\x02\x02\x02\u0169\u016A\x07\x10\x02\x02\u016A\u016B\x07%\x02\x02\u016B" + - "\u016C\x05\x9AN\x02\u016C\u016D\x07&\x02\x02\u016D\u016E\x05,\x17\x02" + - "\u016E?\x03\x02\x02\x02\u016F\u0170\x07\x0F\x02\x02\u0170\u0171\x05,\x17" + - "\x02\u0171\u0172\x07\x10\x02\x02\u0172\u0173\x07%\x02\x02\u0173\u0174" + - "\x05\x9AN\x02\u0174\u0175\x07&\x02\x02\u0175\u0176\x07\"\x02\x02\u0176" + - "A\x03\x02\x02\x02\u0177\u0178\t\x03\x02\x02\u0178\u0179\x07\"\x02\x02" + - "\u0179C\x03\x02\x02\x02\u017A\u017C\x07\x16\x02\x02\u017B\u017D\x05\x9A" + - "N\x02\u017C\u017B\x03\x02\x02\x02\u017C\u017D\x03\x02\x02\x02\u017D\u017E" + - "\x03\x02\x02\x02\u017E\u017F\x07\"\x02\x02\u017FE\x03\x02\x02\x02\u0180" + - "\u018A\x05H%\x02\u0181\u018A\x05\\/\x02\u0182\u018A\x05^0\x02\u0183\u018A" + - "\x05J&\x02\u0184\u018A\x05L\'\x02\u0185\u018A\x05R*\x02\u0186\u018A\x05" + - "T+\x02\u0187\u018A\x05Z.\x02\u0188\u018A\x05b2\x02\u0189\u0180\x03\x02" + - "\x02\x02\u0189\u0181\x03\x02\x02\x02\u0189\u0182\x03\x02\x02\x02\u0189" + - "\u0183\x03\x02\x02\x02\u0189\u0184\x03\x02\x02\x02\u0189\u0185\x03\x02" + - "\x02\x02\u0189\u0186\x03\x02\x02\x02\u0189\u0187\x03\x02\x02\x02\u0189" + - "\u0188\x03\x02\x02\x02\u018AG\x03\x02\x02\x02\u018B\u018C\x07%\x02\x02" + - "\u018C\u018D\x05\x9AN\x02\u018D\u018E\x07&\x02\x02\u018EI\x03\x02\x02" + - "\x02\u018F\u0190\t\x04\x02\x02\u0190K\x03\x02\x02\x02\u0191\u0192\x05" + - "N(\x02\u0192M\x03\x02\x02\x02\u0193\u0194\x07K\x02\x02\u0194O\x03\x02" + - "\x02\x02\u0195\u0198\x05N(\x02\u0196\u0198\x05R*\x02\u0197\u0195\x03\x02" + - "\x02\x02\u0197\u0196\x03\x02\x02\x02\u0198Q\x03\x02\x02\x02\u0199\u019A" + - "\t\x05\x02\x02\u019AS\x03\x02\x02\x02\u019B\u019F\x07R\x02\x02\u019C\u019E" + - "\x05V,\x02\u019D\u019C\x03\x02\x02\x02\u019E\u01A1\x03\x02\x02\x02\u019F" + - "\u019D\x03\x02\x02\x02\u019F\u01A0\x03\x02\x02\x02\u01A0\u01A2\x03\x02" + - "\x02\x02\u01A1\u019F\x03\x02\x02\x02\u01A2\u01AC\x07T\x02\x02\u01A3\u01A7" + - "\x07S\x02\x02\u01A4\u01A6\x05X-\x02\u01A5\u01A4\x03\x02\x02\x02\u01A6" + - "\u01A9\x03\x02\x02\x02\u01A7\u01A5\x03\x02\x02\x02\u01A7\u01A8\x03\x02" + - "\x02\x02\u01A8\u01AA\x03\x02\x02\x02\u01A9\u01A7\x03\x02\x02\x02\u01AA" + - "\u01AC\x07V\x02\x02\u01AB\u019B\x03\x02\x02\x02\u01AB\u01A3\x03\x02\x02" + - "\x02\u01ACU\x03\x02\x02\x02\u01AD\u01B4\x07U\x02\x02\u01AE\u01B0\x07\x03" + - "\x02\x02\u01AF\u01B1\x05\x9AN\x02\u01B0\u01AF\x03\x02\x02\x02\u01B0\u01B1" + - "\x03\x02\x02\x02\u01B1\u01B2\x03\x02\x02\x02\u01B2\u01B4\x07)\x02\x02" + - "\u01B3\u01AD\x03\x02\x02\x02\u01B3\u01AE\x03\x02\x02\x02\u01B4W\x03\x02" + - "\x02\x02\u01B5\u01BC\x07W\x02\x02\u01B6\u01B8\x07\x03\x02\x02\u01B7\u01B9" + - "\x05\x9AN\x02\u01B8\u01B7\x03\x02\x02\x02\u01B8\u01B9\x03\x02\x02\x02" + - "\u01B9\u01BA\x03\x02\x02\x02\u01BA\u01BC\x07)\x02\x02\u01BB\u01B5\x03" + - "\x02\x02\x02\u01BB\u01B6\x03\x02\x02\x02\u01BCY\x03\x02\x02\x02\u01BD" + - "\u01BE\t\x06\x02\x02\u01BE[\x03\x02\x02\x02\u01BF\u01C8\x07\'\x02\x02" + - "\u01C0\u01C5\x05\x9AN\x02\u01C1\u01C2\x07!\x02\x02\u01C2\u01C4\x05\x9A" + - "N\x02\u01C3\u01C1\x03\x02\x02\x02\u01C4\u01C7\x03\x02\x02\x02\u01C5\u01C3" + - "\x03\x02\x02\x02\u01C5\u01C6\x03\x02\x02\x02\u01C6\u01C9\x03\x02\x02\x02" + - "\u01C7\u01C5\x03\x02\x02\x02\u01C8\u01C0\x03\x02\x02\x02\u01C8\u01C9\x03" + - "\x02\x02\x02\u01C9\u01CB\x03\x02\x02\x02\u01CA\u01CC\x07!\x02\x02\u01CB" + - "\u01CA\x03\x02\x02\x02\u01CB\u01CC\x03\x02\x02\x02\u01CC\u01CD\x03\x02" + - "\x02\x02\u01CD\u01CE\x07(\x02\x02\u01CE]\x03\x02\x02\x02\u01CF\u01D8\x07" + - "*\x02\x02\u01D0\u01D5\x05`1\x02\u01D1\u01D2\x07!\x02\x02\u01D2\u01D4\x05" + - "`1\x02\u01D3\u01D1\x03\x02\x02\x02\u01D4\u01D7\x03\x02\x02\x02\u01D5\u01D3" + - "\x03\x02\x02\x02\u01D5\u01D6\x03\x02\x02\x02\u01D6\u01D9\x03\x02\x02\x02" + - "\u01D7\u01D5\x03\x02\x02\x02\u01D8\u01D0\x03\x02\x02\x02\u01D8\u01D9\x03" + - "\x02\x02\x02\u01D9\u01DB\x03\x02\x02\x02\u01DA\u01DC\x07!\x02\x02\u01DB" + - "\u01DA\x03\x02\x02\x02\u01DB\u01DC\x03\x02\x02\x02\u01DC\u01DD\x03\x02" + - "\x02\x02\u01DD\u01DE\x07+\x02\x02\u01DE_\x03\x02\x02\x02\u01DF\u01E0\x05" + - "P)\x02\u01E0\u01E1\x07$\x02\x02\u01E1\u01E2\x05\x9AN\x02\u01E2a\x03\x02" + - "\x02\x02\u01E3\u01E4\t\x07\x02\x02\u01E4c\x03\x02\x02\x02\u01E5\u01E6" + - "\b3\x01\x02\u01E6\u01F1\x05F$\x02\u01E7\u01E8\x07\x17\x02\x02\u01E8\u01E9" + - "\x05d3\x02\u01E9\u01EB\x07%\x02\x02\u01EA\u01EC\x05f4\x02\u01EB\u01EA" + - "\x03\x02\x02\x02\u01EB\u01EC\x03\x02\x02\x02\u01EC\u01ED\x03\x02\x02\x02" + - "\u01ED\u01EE\x07&\x02\x02\u01EE\u01EF\b3\x01\x02\u01EF\u01F1\x03\x02\x02" + - "\x02\u01F0\u01E5\x03\x02\x02\x02\u01F0\u01E7\x03\x02\x02\x02\u01F1\u0207" + - "\x03\x02\x02\x02\u01F2\u01F3\f\x07\x02\x02\u01F3\u01F5\x07%\x02\x02\u01F4" + - "\u01F6\x05f4\x02\u01F5\u01F4\x03\x02\x02\x02\u01F5\u01F6\x03\x02\x02\x02" + - "\u01F6\u01F7\x03\x02\x02\x02\u01F7\u01F8\x07&\x02\x02\u01F8\u0206\b3\x01" + - "\x02\u01F9\u01FA\f\x05\x02\x02\u01FA\u01FB\x05h5\x02\u01FB\u01FC\b3\x01" + - "\x02\u01FC\u0206\x03\x02\x02\x02\u01FD\u01FE\f\x04\x02\x02\u01FE\u01FF" + - "\x05j6\x02\u01FF\u0200\b3\x01\x02\u0200\u0206\x03\x02\x02\x02\u0201\u0202" + - "\f\x03\x02\x02\u0202\u0203\x05l7\x02\u0203\u0204\b3\x01\x02\u0204\u0206" + - "\x03\x02\x02\x02\u0205\u01F2\x03\x02\x02\x02\u0205\u01F9\x03\x02\x02\x02" + - "\u0205\u01FD\x03\x02\x02\x02\u0205\u0201\x03\x02\x02\x02\u0206\u0209\x03" + - "\x02\x02\x02\u0207\u0205\x03\x02\x02\x02\u0207\u0208\x03\x02\x02\x02\u0208" + - "e\x03\x02\x02\x02\u0209\u0207\x03\x02\x02\x02\u020A\u020F\x05\x96L\x02" + - "\u020B\u020C\x07!\x02\x02\u020C\u020E\x05\x96L\x02\u020D\u020B\x03\x02" + - "\x02\x02\u020E\u0211\x03\x02\x02\x02\u020F\u020D\x03\x02\x02\x02\u020F" + - "\u0210\x03\x02\x02\x02\u0210g\x03\x02\x02\x02\u0211\u020F\x03\x02\x02" + - "\x02\u0212\u0213\x07J\x02\x02\u0213\u0214\x05N(\x02\u0214i\x03\x02\x02" + - "\x02\u0215\u0216\x07\'\x02\x02\u0216\u0217\x05\x9AN\x02\u0217\u0218\x07" + - "(\x02\x02\u0218k\x03\x02\x02\x02\u0219\u021D\x07\'\x02\x02\u021A\u021B" + - "\x05\x9AN\x02\u021B\u021C\b7\x01\x02\u021C\u021E\x03\x02\x02\x02\u021D" + - "\u021A\x03\x02\x02\x02\u021D\u021E\x03\x02\x02\x02\u021E\u021F\x03\x02" + - "\x02\x02\u021F\u0223\x07$\x02\x02\u0220\u0221\x05\x9AN\x02\u0221\u0222" + - "\b7\x01\x02\u0222\u0224\x03\x02\x02\x02\u0223\u0220\x03\x02\x02\x02\u0223" + - "\u0224\x03"; + "O\tO\x04P\tP\x04Q\tQ\x04R\tR\x03\x02\x05\x02\xA6\n\x02\x03\x02\x03\x02" + + "\x03\x03\x06\x03\xAB\n\x03\r\x03\x0E\x03\xAC\x03\x04\x03\x04\x03\x05\x06" + + "\x05\xB2\n\x05\r\x05\x0E\x05\xB3\x03\x06\x03\x06\x03\x06\x05\x06\xB9\n" + + "\x06\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x03\x07\x05\x07\xC1\n\x07" + + "\x03\b\x03\b\x03\b\x03\t\x03\t\x03\n\x03\n\x03\n\x03\n\x03\n\x05\n\xCD" + + "\n\n\x03\v\x03\v\x03\f\x03\f\x03\r\x03\r\x03\x0E\x03\x0E\x03\x0E\x03\x0E" + + "\x05\x0E\xD9\n\x0E\x03\x0E\x03\x0E\x03\x0E\x03\x0E\x05\x0E\xDF\n\x0E\x03" + + "\x0F\x03\x0F\x03\x0F\x07\x0F\xE4\n\x0F\f\x0F\x0E\x0F\xE7\v\x0F\x03\x10" + + "\x03\x10\x03\x10\x03\x10\x03\x11\x03\x11\x03\x11\x03\x11\x07\x11\xF1\n" + + "\x11\f\x11\x0E\x11\xF4\v\x11\x03\x11\x03\x11\x03\x12\x03\x12\x05\x12\xFA" + + "\n\x12\x03\x13\x03\x13\x03\x13\x03\x13\x03\x13\x03\x14\x03\x14\x03\x14" + + "\x05\x14\u0104\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\u0116\n\x16\x03\x17\x03\x17\x03\x17\x05\x17\u011B\n\x17\x03" + + "\x17\x03\x17\x03\x18\x03\x18\x03\x18\x03\x18\x03\x18\x03\x19\x03\x19\x05" + + "\x19\u0126\n\x19\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A\x03\x1A" + + "\x05\x1A\u012F\n\x1A\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x03\x1B\x07" + + "\x1B\u0137\n\x1B\f\x1B\x0E\x1B\u013A\v\x1B\x03\x1B\x03\x1B\x03\x1C\x03" + + "\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x03\x1C\x05\x1C\u0146\n\x1C" + + "\x03\x1D\x03\x1D\x03\x1D\x05\x1D\u014B\n\x1D\x03\x1E\x03\x1E\x03\x1E\x03" + + "\x1E\x05\x1E\u0151\n\x1E\x03\x1E\x03\x1E\x05\x1E\u0155\n\x1E\x03\x1E\x03" + + "\x1E\x03\x1E\x03\x1E\x05\x1E\u015B\n\x1E\x03\x1E\x03\x1E\x03\x1E\x03\x1E" + + "\x05\x1E\u0161\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"\u0179\n"\x03"\x03"\x03#\x03#\x03#\x03#\x03' + + "#\x03#\x03#\x03#\x03#\x05#\u0186\n#\x03$\x03$\x03$\x03$\x03%\x03%\x03" + + "&\x03&\x03'\x03'\x03(\x03(\x05(\u0194\n(\x03)\x03)\x03*\x03*\x07*\u019A" + + "\n*\f*\x0E*\u019D\v*\x03*\x03*\x03*\x07*\u01A2\n*\f*\x0E*\u01A5\v*\x03" + + "*\x05*\u01A8\n*\x03+\x03+\x03+\x05+\u01AD\n+\x03+\x05+\u01B0\n+\x03,\x03" + + ",\x03,\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/\x07/\u01D0\n/\f/\x0E/\u01D3\v/\x05/\u01D5\n" + + "/\x03/\x05/\u01D8\n/\x03/\x03/\x030\x030\x030\x030\x031\x031\x032\x03" + + "2\x032\x032\x032\x032\x052\u01E8\n2\x032\x032\x032\x052\u01ED\n2\x032" + + "\x032\x032\x052\u01F2\n2\x032\x032\x032\x032\x032\x032\x032\x032\x032" + + "\x032\x032\x032\x032\x032\x072\u0202\n2\f2\x0E2\u0205\v2\x033\x033\x03" + + "3\x073\u020A\n3\f3\x0E3\u020D\v3\x034\x034\x034\x035\x035\x035\x035\x03" + + "6\x036\x036\x036\x056\u021A\n6\x036\x036\x036\x036\x056\u0220\n6\x036" + + "\x036\x037\x037\x057\u0226\n7\x038\x038\x038\x039\x039\x039\x059\u022E" + + "\n9\x03:\x03:\x03:\x03;\x03;\x03;\x03<\x03<\x03=\x03=\x03>\x03>\x03>\x03" + + ">\x03>\x05>\u023F\n>\x03?\x03?\x03?\x03?\x03?\x03?\x07?\u0247\n?\f?\x0E" + + "?\u024A\v?\x03@\x03@\x03@\x03@\x03@\x03@\x07@\u0252\n@\f@\x0E@\u0255\v" + + "@\x03A\x03A\x03A\x03A\x03A\x03A\x03A\x07A\u025E\nA\fA\x0EA\u0261\vA\x03" + + "B\x03B\x03C\x03C\x03C\x03C\x03C\x03C\x07C\u026B\nC\fC\x0EC\u026E\vC\x03" + + "D\x03D\x03D\x03D\x03D\x03D\x07D\u0276\nD\fD\x0ED\u0279\vD\x03E\x03E\x03" + + "E\x03E\x03E\x03E\x07E\u0281\nE\fE\x0EE\u0284\vE\x03F\x03F\x03F\x03F\x03" + + "F\x03F\x07F\u028C\nF\fF\x0EF\u028F\vF\x03G\x03G\x03G\x03G\x03G\x03G\x07" + + "G\u0297\nG\fG\x0EG\u029A\vG\x03H\x03H\x03H\x03H\x03H\x03H\x07H\u02A2\n" + + "H\fH\x0EH\u02A5\vH\x03I\x03I\x03I\x03I\x03I\x03I\x07I\u02AD\nI\fI\x0E" + + "I\u02B0\vI\x03J\x03J\x03J\x03J\x03J\x03J\x03J\x05J\u02B9\nJ\x03K\x03K" + + "\x03K\x03K\x03K\x05K\u02C0\nK\x03L\x03L\x03M\x03M\x03M\x07M\u02C7\nM\f" + + "M\x0EM\u02CA\vM\x03N\x03N\x03N\x05N\u02CF\nN\x03O\x03O\x03P\x03P\x03P" + + "\x03P\x03P\x03Q\x03Q\x03Q\x03Q\x03Q\x03R\x03R\x03R\x02\x02\rb|~\x80\x84" + + "\x86\x88\x8A\x8C\x8E\x90S\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\x028\x02:\x02' + + "<\x02>\x02@\x02B\x02D\x02F\x02H\x02J\x02L\x02N\x02P\x02R\x02T\x02V\x02" + + "X\x02Z\x02\\\x02^\x02`\x02b\x02d\x02f\x02h\x02j\x02l\x02n\x02p\x02r\x02" + + "t\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\x02\x11\x03\x02\x06\x07\x03\x02\r\x0E" + + "\x03\x02\x1B\x1C\x03\x02MN\x04\x02LLOO\x03\x02\x1E \x04\x02--//\x06\x02" + + ",,..66FF\x03\x0203\x04\x02,,..\x03\x02GI\x03\x02?B\x03\x02=>\x03\x027" + + "<\x04\x02\x1E KK\x02\u02E0\x02\xA5\x03\x02\x02\x02\x04\xAA\x03\x02\x02" + + "\x02\x06\xAE\x03\x02\x02\x02\b\xB1\x03\x02\x02\x02\n\xB8\x03\x02\x02\x02" + + "\f\xC0\x03\x02\x02\x02\x0E\xC2\x03\x02\x02\x02\x10\xC5\x03\x02\x02\x02" + + "\x12\xC7\x03\x02\x02\x02\x14\xCE\x03\x02\x02\x02\x16\xD0\x03\x02\x02\x02" + + "\x18\xD2\x03\x02\x02\x02\x1A\xD4\x03\x02\x02\x02\x1C\xE0\x03\x02\x02\x02" + + '\x1E\xE8\x03\x02\x02\x02 \xEC\x03\x02\x02\x02"\xF9\x03\x02\x02\x02$\xFB' + + "\x03\x02\x02\x02&\u0100\x03\x02\x02\x02(\u010A\x03\x02\x02\x02*\u0115" + + "\x03\x02\x02\x02,\u0117\x03\x02\x02\x02.\u011E\x03\x02\x02\x020\u0125" + + "\x03\x02\x02\x022\u0127\x03\x02\x02\x024\u0130\x03\x02\x02\x026\u0145" + + "\x03\x02\x02\x028\u014A\x03\x02\x02\x02:\u014C\x03\x02\x02\x02<\u0165" + + "\x03\x02\x02\x02>\u016B\x03\x02\x02\x02@\u0173\x03\x02\x02\x02B\u0176" + + "\x03\x02\x02\x02D\u0185\x03\x02\x02\x02F\u0187\x03\x02\x02\x02H\u018B" + + "\x03\x02\x02\x02J\u018D\x03\x02\x02\x02L\u018F\x03\x02\x02\x02N\u0193" + + "\x03\x02\x02\x02P\u0195\x03\x02\x02\x02R\u01A7\x03\x02\x02\x02T\u01AF" + + "\x03\x02\x02\x02V\u01B7\x03\x02\x02\x02X\u01B9\x03\x02\x02\x02Z\u01BB" + + "\x03\x02\x02\x02\\\u01CB\x03\x02\x02\x02^\u01DB\x03\x02\x02\x02`\u01DF" + + "\x03\x02\x02\x02b\u01EC\x03\x02\x02\x02d\u0206\x03\x02\x02\x02f\u020E" + + "\x03\x02\x02\x02h\u0211\x03\x02\x02\x02j\u0215\x03\x02\x02\x02l\u0225" + + "\x03\x02\x02\x02n\u0227\x03\x02\x02\x02p\u022D\x03\x02\x02\x02r\u022F" + + "\x03\x02\x02\x02t\u0232\x03\x02\x02\x02v\u0235\x03\x02\x02\x02x\u0237" + + "\x03\x02\x02\x02z\u023E\x03\x02\x02\x02|\u0240\x03\x02\x02\x02~\u024B" + + "\x03\x02\x02\x02\x80\u0256\x03\x02\x02\x02\x82\u0262\x03\x02\x02\x02\x84" + + "\u0264\x03\x02\x02\x02\x86\u026F\x03\x02\x02\x02\x88\u027A\x03\x02\x02" + + "\x02\x8A\u0285\x03\x02\x02\x02\x8C\u0290\x03\x02\x02\x02\x8E\u029B\x03" + + "\x02\x02\x02\x90\u02A6\x03\x02\x02\x02\x92\u02B8\x03\x02\x02\x02\x94\u02BF" + + "\x03\x02\x02\x02\x96\u02C1\x03\x02\x02\x02\x98\u02C3\x03\x02\x02\x02\x9A" + + "\u02CE\x03\x02\x02\x02\x9C\u02D0\x03\x02\x02\x02\x9E\u02D2\x03\x02\x02" + + "\x02\xA0\u02D7\x03\x02\x02\x02\xA2\u02DC\x03\x02\x02\x02\xA4\xA6\x05\x04" + + "\x03\x02\xA5\xA4\x03\x02\x02\x02\xA5\xA6\x03\x02\x02\x02\xA6\xA7\x03\x02" + + "\x02\x02\xA7\xA8\x07\x02\x02\x03\xA8\x03\x03\x02\x02\x02\xA9\xAB\x05\x06" + + "\x04\x02\xAA\xA9\x03\x02\x02\x02\xAB\xAC\x03\x02\x02\x02\xAC\xAA\x03\x02" + + "\x02\x02\xAC\xAD\x03\x02\x02\x02\xAD\x05\x03\x02\x02\x02\xAE\xAF\x05\b" + + "\x05\x02\xAF\x07\x03\x02\x02\x02\xB0\xB2\x05\n\x06\x02\xB1\xB0\x03\x02" + + "\x02\x02\xB2\xB3\x03\x02\x02\x02\xB3\xB1\x03\x02\x02\x02\xB3\xB4\x03\x02" + + "\x02\x02\xB4\t\x03\x02\x02\x02\xB5\xB9\x05*\x16\x02\xB6\xB9\x05\f\x07" + + '\x02\xB7\xB9\x07"\x02\x02\xB8\xB5\x03\x02\x02\x02\xB8\xB6\x03\x02\x02' + + "\x02\xB8\xB7\x03\x02\x02\x02\xB9\v\x03\x02\x02\x02\xBA\xBB\x05\x0E\b\x02" + + '\xBB\xBC\x07"\x02\x02\xBC\xC1\x03\x02\x02\x02\xBD\xC1\x05\x1A\x0E\x02' + + "\xBE\xC1\x05 \x11\x02\xBF\xC1\x05(\x15\x02\xC0\xBA\x03\x02\x02\x02\xC0" + + "\xBD\x03\x02\x02\x02\xC0\xBE\x03\x02\x02\x02\xC0\xBF\x03\x02\x02\x02\xC1" + + "\r\x03\x02\x02\x02\xC2\xC3\x05\x10\t\x02\xC3\xC4\x05\x12\n\x02\xC4\x0F" + + "\x03\x02\x02\x02\xC5\xC6\t\x02\x02\x02\xC6\x11\x03\x02\x02\x02\xC7\xC8" + + "\x05\x16\f\x02\xC8\xC9\x07$\x02\x02\xC9\xCC\x05\x9AN\x02\xCA\xCB\x077" + + "\x02\x02\xCB\xCD\x05\x14\v\x02\xCC\xCA\x03\x02\x02\x02\xCC\xCD\x03\x02" + + "\x02\x02\xCD\x13\x03\x02\x02\x02\xCE\xCF\x05\x94K\x02\xCF\x15\x03\x02" + + "\x02\x02\xD0\xD1\x05\x18\r\x02\xD1\x17\x03\x02\x02\x02\xD2\xD3\x07K\x02" + + "\x02\xD3\x19\x03\x02\x02\x02\xD4\xD5\x07\x15\x02\x02\xD5\xD6\x05\x16\f" + + "\x02\xD6\xD8\x07%\x02\x02\xD7\xD9\x05\x1C\x0F\x02\xD8\xD7\x03\x02\x02" + + "\x02\xD8\xD9\x03\x02\x02\x02\xD9\xDA\x03\x02\x02\x02\xDA\xDB\x07&\x02" + + "\x02\xDB\xDC\x07\x18\x02\x02\xDC\xDE\x05\x9AN\x02\xDD\xDF\x05,\x17\x02" + + "\xDE\xDD\x03\x02\x02\x02\xDE\xDF\x03\x02\x02\x02\xDF\x1B\x03\x02\x02\x02" + + "\xE0\xE5\x05\x1E\x10\x02\xE1\xE2\x07!\x02\x02\xE2\xE4\x05\x1E\x10\x02" + + "\xE3\xE1\x03\x02\x02\x02\xE4\xE7\x03\x02\x02\x02\xE5\xE3\x03\x02\x02\x02" + + "\xE5\xE6\x03\x02\x02\x02\xE6\x1D\x03\x02\x02\x02\xE7\xE5\x03\x02\x02\x02" + + "\xE8\xE9\x05\x16\f\x02\xE9\xEA\x07$\x02\x02\xEA\xEB\x05\x9AN\x02\xEB\x1F" + + "\x03\x02\x02\x02\xEC\xED\x07\x1A\x02\x02\xED\xEE\x05\x16\f\x02\xEE\xF2" + + '\x07*\x02\x02\xEF\xF1\x05"\x12\x02\xF0\xEF\x03\x02\x02\x02\xF1\xF4\x03' + + "\x02\x02\x02\xF2\xF0\x03\x02\x02\x02\xF2\xF3\x03\x02\x02\x02\xF3\xF5\x03" + + "\x02\x02\x02\xF4\xF2\x03\x02\x02\x02\xF5\xF6\x07+\x02\x02\xF6!\x03\x02" + + "\x02\x02\xF7\xFA\x05$\x13\x02\xF8\xFA\x05&\x14\x02\xF9\xF7\x03\x02\x02" + + "\x02\xF9\xF8\x03\x02\x02\x02\xFA#\x03\x02\x02\x02\xFB\xFC\x05\x16\f\x02" + + '\xFC\xFD\x07$\x02\x02\xFD\xFE\x05\x9AN\x02\xFE\xFF\x07"\x02\x02\xFF%' + + "\x03\x02\x02\x02\u0100\u0101\x05\x16\f\x02\u0101\u0103\x07%\x02\x02\u0102" + + "\u0104\x05\x1C\x0F\x02\u0103\u0102\x03\x02\x02\x02\u0103\u0104\x03\x02" + + "\x02\x02\u0104\u0105\x03\x02\x02\x02\u0105\u0106\x07&\x02\x02\u0106\u0107" + + '\x07$\x02\x02\u0107\u0108\x05\x9AN\x02\u0108\u0109\x07"\x02\x02\u0109' + + "'\x03\x02\x02\x02\u010A\u010B\x07\x19\x02\x02\u010B\u010C\x05\x16\f\x02" + + "\u010C\u010D\x07*\x02\x02\u010D\u010E\x07+\x02\x02\u010E)\x03\x02\x02" + + "\x02\u010F\u0116\x05.\x18\x02\u0110\u0116\x050\x19\x02\u0111\u0116\x05" + + '8\x1D\x02\u0112\u0116\x05@!\x02\u0113\u0116\x05B"\x02\u0114\u0116\x05' + + ",\x17\x02\u0115\u010F\x03\x02\x02\x02\u0115\u0110\x03\x02\x02\x02\u0115" + + "\u0111\x03\x02\x02\x02\u0115\u0112\x03\x02\x02\x02\u0115\u0113\x03\x02" + + "\x02\x02\u0115\u0114\x03\x02\x02\x02\u0116+\x03\x02\x02\x02\u0117\u0118" + + "\x06\x17\x02\x02\u0118\u011A\x07*\x02\x02\u0119\u011B\x05\b\x05\x02\u011A" + + "\u0119\x03\x02\x02\x02\u011A\u011B\x03\x02\x02\x02\u011B\u011C\x03\x02" + + "\x02\x02\u011C\u011D\x07+\x02\x02\u011D-\x03\x02\x02\x02\u011E\u011F\b" + + '\x18\x01\x02\u011F\u0120\x05\x98M\x02\u0120\u0121\x07"\x02\x02\u0121' + + "\u0122\b\x18\x01\x02\u0122/\x03\x02\x02\x02\u0123\u0126\x052\x1A\x02\u0124" + + "\u0126\x054\x1B\x02\u0125\u0123\x03\x02\x02\x02\u0125\u0124\x03\x02\x02" + + "\x02\u01261\x03\x02\x02\x02\u0127\u0128\x07\x11\x02\x02\u0128\u0129\x07" + + "%\x02\x02\u0129\u012A\x05\x98M\x02\u012A\u012B\x07&\x02\x02\u012B\u012E" + + "\x05*\x16\x02\u012C\u012D\x07\x12\x02\x02\u012D\u012F\x05*\x16\x02\u012E" + + "\u012C\x03\x02\x02\x02\u012E\u012F\x03\x02\x02\x02\u012F3\x03\x02\x02" + + "\x02\u0130\u0131\x07\n\x02\x02\u0131\u0132\x07%\x02\x02\u0132\u0133\x05" + + "\x98M\x02\u0133\u0134\x07&\x02\x02\u0134\u0138\x07*\x02\x02\u0135\u0137" + + "\x056\x1C\x02\u0136\u0135\x03\x02\x02\x02\u0137\u013A\x03\x02\x02\x02" + + "\u0138\u0136\x03\x02\x02\x02\u0138\u0139\x03\x02\x02\x02\u0139\u013B\x03" + + "\x02\x02\x02\u013A\u0138\x03\x02\x02\x02\u013B\u013C\x07+\x02\x02\u013C" + + "5\x03\x02\x02\x02\u013D\u013E\x07\v\x02\x02\u013E\u013F\x05\x98M\x02\u013F" + + "\u0140\x07$\x02\x02\u0140\u0141\x05*\x16\x02\u0141\u0146\x03\x02\x02\x02" + + "\u0142\u0143\x07\f\x02\x02\u0143\u0144\x07$\x02\x02\u0144\u0146\x05*\x16" + + "\x02\u0145\u013D\x03\x02\x02\x02\u0145\u0142\x03\x02\x02\x02\u01467\x03" + + "\x02\x02\x02\u0147\u014B\x05:\x1E\x02\u0148\u014B\x05<\x1F\x02\u0149\u014B" + + "\x05> \x02\u014A\u0147\x03\x02\x02\x02\u014A\u0148\x03\x02\x02\x02\u014A" + + "\u0149\x03\x02\x02\x02\u014B9\x03\x02\x02\x02\u014C\u014D\x07\x13\x02" + + "\x02\u014D\u0154\x07%\x02\x02\u014E\u0151\x05\x0E\b\x02\u014F\u0151\x05" + + "\x98M\x02\u0150\u014E\x03\x02\x02\x02\u0150\u014F\x03\x02\x02\x02\u0151" + + "\u0152\x03\x02\x02\x02\u0152\u0153\b\x1E\x01\x02\u0153\u0155\x03\x02\x02" + + "\x02\u0154\u0150\x03\x02\x02\x02\u0154\u0155\x03\x02\x02\x02\u0155\u0156" + + '\x03\x02\x02\x02\u0156\u015A\x07"\x02\x02\u0157\u0158\x05\x98M\x02\u0158' + + "\u0159\b\x1E\x01\x02\u0159\u015B\x03\x02\x02\x02\u015A\u0157\x03\x02\x02" + + "\x02\u015A\u015B\x03\x02\x02\x02\u015B\u015C\x03\x02\x02\x02\u015C\u0160" + + '\x07"\x02\x02\u015D\u015E\x05\x98M\x02\u015E\u015F\b\x1E\x01\x02\u015F' + + "\u0161\x03\x02\x02\x02\u0160\u015D\x03\x02\x02\x02\u0160\u0161\x03\x02" + + "\x02\x02\u0161\u0162\x03\x02\x02\x02\u0162\u0163\x07&\x02\x02\u0163\u0164" + + "\x05*\x16\x02\u0164;\x03\x02\x02\x02\u0165\u0166\x07\x10\x02\x02\u0166" + + "\u0167\x07%\x02\x02\u0167\u0168\x05\x98M\x02\u0168\u0169\x07&\x02\x02" + + "\u0169\u016A\x05*\x16\x02\u016A=\x03\x02\x02\x02\u016B\u016C\x07\x0F\x02" + + "\x02\u016C\u016D\x05*\x16\x02\u016D\u016E\x07\x10\x02\x02\u016E\u016F" + + "\x07%\x02\x02\u016F\u0170\x05\x98M\x02\u0170\u0171\x07&\x02\x02\u0171" + + '\u0172\x07"\x02\x02\u0172?\x03\x02\x02\x02\u0173\u0174\t\x03\x02\x02' + + '\u0174\u0175\x07"\x02\x02\u0175A\x03\x02\x02\x02\u0176\u0178\x07\x16' + + "\x02\x02\u0177\u0179\x05\x98M\x02\u0178\u0177\x03\x02\x02\x02\u0178\u0179" + + '\x03\x02\x02\x02\u0179\u017A\x03\x02\x02\x02\u017A\u017B\x07"\x02\x02' + + "\u017BC\x03\x02\x02\x02\u017C\u0186\x05F$\x02\u017D\u0186\x05Z.\x02\u017E" + + "\u0186\x05\\/\x02\u017F\u0186\x05H%\x02\u0180\u0186\x05J&\x02\u0181\u0186" + + "\x05P)\x02\u0182\u0186\x05R*\x02\u0183\u0186\x05X-\x02\u0184\u0186\x05" + + "`1\x02\u0185\u017C\x03\x02\x02\x02\u0185\u017D\x03\x02\x02\x02\u0185\u017E" + + "\x03\x02\x02\x02\u0185\u017F\x03\x02\x02\x02\u0185\u0180\x03\x02\x02\x02" + + "\u0185\u0181\x03\x02\x02\x02\u0185\u0182\x03\x02\x02\x02\u0185\u0183\x03" + + "\x02\x02\x02\u0185\u0184\x03\x02\x02\x02\u0186E\x03\x02\x02\x02\u0187" + + "\u0188\x07%\x02\x02\u0188\u0189\x05\x98M\x02\u0189\u018A\x07&\x02\x02" + + "\u018AG\x03\x02\x02\x02\u018B\u018C\t\x04\x02\x02\u018CI\x03\x02\x02\x02" + + "\u018D\u018E\x05L'\x02\u018EK\x03\x02\x02\x02\u018F\u0190\x07K\x02\x02" + + "\u0190M\x03\x02\x02\x02\u0191\u0194\x05L'\x02\u0192\u0194\x05P)\x02\u0193" + + "\u0191\x03\x02\x02\x02\u0193\u0192\x03\x02\x02\x02\u0194O\x03\x02\x02" + + "\x02\u0195\u0196\t\x05\x02\x02\u0196Q\x03\x02\x02\x02\u0197\u019B\x07" + + "R\x02\x02\u0198\u019A\x05T+\x02\u0199\u0198\x03\x02\x02\x02\u019A\u019D" + + "\x03\x02\x02\x02\u019B\u0199\x03\x02\x02\x02\u019B\u019C\x03\x02\x02\x02" + + "\u019C\u019E\x03\x02\x02\x02\u019D\u019B\x03\x02\x02\x02\u019E\u01A8\x07" + + "T\x02\x02\u019F\u01A3\x07S\x02\x02\u01A0\u01A2\x05V,\x02\u01A1\u01A0\x03" + + "\x02\x02\x02\u01A2\u01A5\x03\x02\x02\x02\u01A3\u01A1\x03\x02\x02\x02\u01A3" + + "\u01A4\x03\x02\x02\x02\u01A4\u01A6\x03\x02\x02\x02\u01A5\u01A3\x03\x02" + + "\x02\x02\u01A6\u01A8\x07V\x02\x02\u01A7\u0197\x03\x02\x02\x02\u01A7\u019F" + + "\x03\x02\x02\x02\u01A8S\x03\x02\x02\x02\u01A9\u01B0\x07U\x02\x02\u01AA" + + "\u01AC\x07\x03\x02\x02\u01AB\u01AD\x05\x98M\x02\u01AC\u01AB\x03\x02\x02" + + "\x02\u01AC\u01AD\x03\x02\x02\x02\u01AD\u01AE\x03\x02\x02\x02\u01AE\u01B0" + + "\x07)\x02\x02\u01AF\u01A9\x03\x02\x02\x02\u01AF\u01AA\x03\x02\x02\x02" + + "\u01B0U\x03\x02\x02\x02\u01B1\u01B8\x07W\x02\x02\u01B2\u01B4\x07\x03\x02" + + "\x02\u01B3\u01B5\x05\x98M\x02\u01B4\u01B3\x03\x02\x02\x02\u01B4\u01B5" + + "\x03\x02\x02\x02\u01B5\u01B6\x03\x02\x02\x02\u01B6\u01B8\x07)\x02\x02" + + "\u01B7\u01B1\x03\x02\x02\x02\u01B7\u01B2\x03\x02\x02\x02\u01B8W\x03\x02" + + "\x02\x02\u01B9\u01BA\t\x06\x02\x02\u01BAY\x03\x02\x02\x02\u01BB\u01C4" + + "\x07'\x02\x02\u01BC\u01C1\x05\x98M\x02\u01BD\u01BE\x07!\x02\x02\u01BE" + + "\u01C0\x05\x98M\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\u01CA[\x03\x02\x02\x02" + + "\u01CB\u01D4\x07*\x02\x02\u01CC\u01D1\x05^0\x02\u01CD\u01CE\x07!\x02\x02" + + "\u01CE\u01D0\x05^0\x02\u01CF\u01CD\x03\x02\x02\x02\u01D0\u01D3\x03\x02" + + "\x02\x02\u01D1\u01CF\x03\x02\x02\x02\u01D1\u01D2\x03\x02\x02\x02\u01D2" + + "\u01D5\x03\x02\x02\x02\u01D3\u01D1\x03\x02\x02\x02\u01D4\u01CC\x03\x02" + + "\x02\x02\u01D4\u01D5\x03\x02\x02\x02\u01D5\u01D7\x03\x02\x02\x02\u01D6" + + "\u01D8\x07!\x02\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]\x03\x02" + + "\x02\x02\u01DB\u01DC\x05N(\x02\u01DC\u01DD\x07$\x02\x02\u01DD\u01DE\x05" + + "\x98M\x02\u01DE_\x03\x02\x02\x02\u01DF\u01E0\t\x07\x02\x02\u01E0a\x03" + + "\x02\x02\x02\u01E1\u01E2\b2\x01\x02\u01E2\u01ED\x05D#\x02\u01E3\u01E4" + + "\x07\x17\x02\x02\u01E4\u01E5\x05b2\x02\u01E5\u01E7\x07%\x02\x02\u01E6" + + "\u01E8\x05d3\x02\u01E7\u01E6\x03\x02\x02\x02\u01E7\u01E8\x03\x02\x02\x02" + + "\u01E8\u01E9\x03\x02\x02\x02\u01E9\u01EA\x07&\x02\x02\u01EA\u01EB\b2\x01" + + "\x02\u01EB\u01ED\x03\x02\x02\x02\u01EC\u01E1\x03\x02\x02\x02\u01EC\u01E3" + + "\x03\x02\x02\x02\u01ED\u0203\x03\x02\x02\x02\u01EE\u01EF\f\x07\x02\x02" + + "\u01EF\u01F1\x07%\x02\x02\u01F0\u01F2\x05d3\x02\u01F1\u01F0\x03\x02\x02" + + "\x02\u01F1\u01F2\x03\x02\x02\x02\u01F2\u01F3\x03\x02\x02\x02\u01F3\u01F4" + + "\x07&\x02\x02\u01F4\u0202\b2\x01\x02\u01F5\u01F6\f\x05\x02\x02\u01F6\u01F7" + + "\x05f4\x02\u01F7\u01F8\b2\x01\x02\u01F8\u0202\x03\x02\x02\x02\u01F9\u01FA" + + "\f\x04\x02\x02\u01FA\u01FB\x05h5\x02\u01FB\u01FC\b2\x01\x02\u01FC\u0202" + + "\x03\x02\x02\x02\u01FD\u01FE\f\x03\x02\x02\u01FE\u01FF\x05j6\x02\u01FF" + + "\u0200\b2\x01\x02\u0200\u0202\x03\x02\x02\x02\u0201\u01EE\x03\x02\x02" + + "\x02\u0201\u01F5\x03\x02\x02\x02\u0201\u01F9\x03\x02\x02\x02\u0201\u01FD" + + "\x03\x02\x02\x02\u0202\u0205\x03\x02\x02\x02\u0203\u0201\x03\x02\x02\x02" + + "\u0203\u0204\x03\x02\x02\x02\u0204c\x03\x02\x02\x02\u0205\u0203\x03\x02" + + "\x02\x02\u0206\u020B\x05\x94K\x02\u0207\u0208\x07!\x02\x02\u0208\u020A" + + "\x05\x94K\x02\u0209\u0207\x03\x02\x02\x02\u020A\u020D\x03\x02\x02\x02" + + "\u020B\u0209\x03\x02\x02\x02\u020B\u020C\x03\x02\x02\x02\u020Ce\x03\x02" + + "\x02\x02\u020D\u020B\x03\x02\x02\x02\u020E\u020F\x07J\x02\x02\u020F\u0210" + + "\x05L'\x02\u0210g\x03\x02\x02\x02\u0211\u0212\x07'\x02\x02\u0212\u0213" + + "\x05\x98M\x02\u0213\u0214\x07(\x02\x02\u0214i\x03\x02\x02\x02\u0215\u0219" + + "\x07'\x02\x02\u0216\u0217\x05\x98M\x02\u0217\u0218\b6\x01\x02\u0218\u021A" + + "\x03\x02\x02\x02\u0219\u0216\x03\x02\x02\x02\u0219\u021A\x03\x02\x02\x02" + + "\u021A\u021B\x03\x02\x02\x02\u021B\u021F\x07$\x02\x02\u021C\u021D\x05" + + "\x98M\x02\u021D\u021E\b6\x01\x02\u021E\u0220\x03\x02\x02\x02\u021F\u021C" + + "\x03\x02\x02\x02\u021F\u0220\x03\x02\x02\x02\u0220\u0221\x03\x02\x02\x02" + + "\u0221\u0222\x07(\x02\x02\u0222k\x03\x02\x02\x02\u0223\u0226\x05b2\x02" + + "\u0224\u0226\x05n8\x02\u0225\u0223"; private static readonly _serializedATNSegment1: string = - "\x02\x02\x02\u0224\u0225\x03\x02\x02\x02\u0225\u0226\x07(\x02\x02\u0226" + - "m\x03\x02\x02\x02\u0227\u022A\x05d3\x02\u0228\u022A\x05p9\x02\u0229\u0227" + - "\x03\x02\x02\x02\u0229\u0228\x03\x02\x02\x02\u022Ao\x03\x02\x02\x02\u022B" + - "\u022C\x05d3\x02\u022C\u022D\x05x=\x02\u022Dq\x03\x02\x02\x02\u022E\u0232" + - "\x05n8\x02\u022F\u0232\x05t;\x02\u0230\u0232\x05v<\x02\u0231\u022E\x03" + - "\x02\x02\x02\u0231\u022F\x03\x02\x02\x02\u0231\u0230\x03\x02\x02\x02\u0232" + - "s\x03\x02\x02\x02\u0233\u0234\x05x=\x02\u0234\u0235\x05n8\x02\u0235u\x03" + - "\x02\x02\x02\u0236\u0237\x05z>\x02\u0237\u0238\x05n8\x02\u0238w\x03\x02" + - "\x02\x02\u0239\u023A\t\b\x02\x02\u023Ay\x03\x02\x02\x02\u023B\u023C\t" + - "\t\x02\x02\u023C{\x03\x02\x02\x02\u023D\u0243\x05r:\x02\u023E\u023F\x05" + - "r:\x02\u023F\u0240\x07\b\x02\x02\u0240\u0241\x05\x9CO\x02\u0241\u0243" + - "\x03\x02\x02\x02\u0242\u023D\x03\x02\x02\x02\u0242\u023E\x03\x02\x02\x02" + - "\u0243}\x03\x02\x02\x02\u0244\u0245\b@\x01\x02\u0245\u0246\x05|?\x02\u0246" + - "\u024C\x03\x02\x02\x02\u0247\u0248\f\x03\x02\x02\u0248\u0249\t\n\x02\x02" + - "\u0249\u024B\x05|?\x02\u024A\u0247\x03\x02\x02\x02\u024B\u024E\x03\x02" + - "\x02\x02\u024C\u024A\x03\x02\x02\x02\u024C\u024D\x03\x02\x02\x02\u024D" + - "\x7F\x03\x02\x02\x02\u024E\u024C\x03\x02\x02\x02\u024F\u0250\bA\x01\x02" + - "\u0250\u0251\x05~@\x02\u0251\u0257\x03\x02\x02\x02\u0252\u0253\f\x03\x02" + - "\x02\u0253\u0254\t\v\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\x81\x03\x02\x02\x02\u0259\u0257\x03\x02\x02" + - "\x02\u025A\u025B\bB\x01\x02\u025B\u025C\x05\x80A\x02\u025C\u0263\x03\x02" + - "\x02\x02\u025D\u025E\f\x03\x02\x02\u025E\u025F\x05\x84C\x02\u025F\u0260" + - "\x05\x8AF\x02\u0260\u0262\x03\x02\x02\x02\u0261\u025D\x03\x02\x02\x02" + - "\u0262\u0265\x03\x02\x02\x02\u0263\u0261\x03\x02\x02\x02\u0263\u0264\x03" + - "\x02\x02\x02\u0264\x83\x03\x02\x02\x02\u0265\u0263\x03\x02\x02\x02\u0266" + - "\u0267\t\f\x02\x02\u0267\x85\x03\x02\x02\x02\u0268\u0269\bD\x01\x02\u0269" + - "\u026A\x05\x82B\x02\u026A\u0270\x03\x02\x02\x02\u026B\u026C\f\x03\x02" + - "\x02\u026C\u026D\t\r\x02\x02\u026D\u026F\x05\x82B\x02\u026E\u026B\x03" + - "\x02\x02\x02\u026F\u0272\x03\x02\x02\x02\u0270\u026E\x03\x02\x02\x02\u0270" + - "\u0271\x03\x02\x02\x02\u0271\x87\x03\x02\x02\x02\u0272\u0270\x03\x02\x02" + - "\x02\u0273\u0274\bE\x01\x02\u0274\u0275\x05\x86D\x02\u0275\u027B\x03\x02" + - "\x02\x02\u0276\u0277\f\x03\x02\x02\u0277\u0278\t\x0E\x02\x02\u0278\u027A" + - "\x05\x86D\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\x89\x03" + - "\x02\x02\x02\u027D\u027B\x03\x02\x02\x02\u027E\u027F\bF\x01\x02\u027F" + - "\u0280\x05\x88E\x02\u0280\u0286\x03\x02\x02\x02\u0281\u0282\f\x03\x02" + - "\x02\u0282\u0283\x07C\x02\x02\u0283\u0285\x05\x88E\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\x8B\x03\x02\x02\x02\u0288\u0286\x03\x02\x02" + - "\x02\u0289\u028A\bG\x01\x02\u028A\u028B\x05\x8AF\x02\u028B\u0291\x03\x02" + - "\x02\x02\u028C\u028D\f\x03\x02\x02\u028D\u028E\x07E\x02\x02\u028E\u0290" + - "\x05\x8AF\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\x8D\x03" + - "\x02\x02\x02\u0293\u0291\x03\x02\x02\x02\u0294\u0295\bH\x01\x02\u0295" + - "\u0296\x05\x8CG\x02\u0296\u029C\x03\x02\x02\x02\u0297\u0298\f\x03\x02" + - "\x02\u0298\u0299\x07D\x02\x02\u0299\u029B\x05\x8CG\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\x8F\x03\x02\x02\x02\u029E\u029C\x03\x02\x02" + - "\x02\u029F\u02A0\bI\x01\x02\u02A0\u02A1\x05\x8EH\x02\u02A1\u02A7\x03\x02" + - "\x02\x02\u02A2\u02A3\f\x03\x02\x02\u02A3\u02A4\x074\x02\x02\u02A4\u02A6" + - "\x05\x8EH\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\x91\x03" + - "\x02\x02\x02\u02A9\u02A7\x03\x02\x02\x02\u02AA\u02AB\bJ\x01\x02\u02AB" + - "\u02AC\x05\x90I\x02\u02AC\u02B2\x03\x02\x02\x02\u02AD\u02AE\f\x03\x02" + - "\x02\u02AE\u02AF\x075\x02\x02\u02AF\u02B1\x05\x90I\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\x93\x03\x02\x02\x02\u02B4\u02B2\x03\x02\x02" + - "\x02\u02B5\u02BD\x05\x92J\x02\u02B6\u02B7\x05\x92J\x02\u02B7\u02B8\x07" + - "#\x02\x02\u02B8\u02B9\x05\x94K\x02\u02B9\u02BA\x07$\x02\x02\u02BA\u02BB" + - "\x05\x94K\x02\u02BB\u02BD\x03\x02\x02\x02\u02BC\u02B5\x03\x02\x02\x02" + - "\u02BC\u02B6\x03\x02\x02\x02\u02BD\x95\x03\x02\x02\x02\u02BE\u02C4\x05" + - "\x94K\x02\u02BF\u02C0\x05d3\x02\u02C0\u02C1\x05\x98M\x02\u02C1\u02C2\x05" + - "\x96L\x02\u02C2\u02C4\x03\x02\x02\x02\u02C3\u02BE\x03\x02\x02\x02\u02C3" + - "\u02BF\x03\x02\x02\x02\u02C4\x97\x03\x02\x02\x02\u02C5\u02C6\t\x0F\x02" + - "\x02\u02C6\x99\x03\x02\x02\x02\u02C7\u02CC\x05\x96L\x02\u02C8\u02C9\x07" + - "!\x02\x02\u02C9\u02CB\x05\x96L\x02\u02CA\u02C8\x03\x02\x02\x02\u02CB\u02CE" + - "\x03\x02\x02\x02\u02CC\u02CA\x03\x02\x02\x02\u02CC\u02CD\x03\x02\x02\x02" + - "\u02CD\x9B\x03\x02\x02\x02\u02CE\u02CC\x03\x02\x02\x02\u02CF\u02D3\x05" + - "\x9EP\x02\u02D0\u02D3\x05\xA0Q\x02\u02D1\u02D3\x05\xA2R\x02\u02D2\u02CF" + - "\x03\x02\x02\x02\u02D2\u02D0\x03\x02\x02\x02\u02D2\u02D1\x03\x02\x02\x02" + - "\u02D3\x9D\x03\x02\x02\x02\u02D4\u02D5\x05\xA4S\x02\u02D5\x9F\x03\x02" + - "\x02\x02\u02D6\u02D7\x05\xA4S\x02\u02D7\u02D8\x07?\x02\x02\u02D8\u02D9" + - "\x05\xA4S\x02\u02D9\u02DA\x07A\x02\x02\u02DA\xA1\x03\x02\x02\x02\u02DB" + - "\u02DC\x07\x1D\x02\x02\u02DC\u02DD\x07%\x02\x02\u02DD\u02DE\x05\xA4S\x02" + - "\u02DE\u02DF\x07&\x02\x02\u02DF\xA3\x03\x02\x02\x02\u02E0\u02E1\t\x10" + - "\x02\x02\u02E1\xA5\x03\x02\x02\x02C\xA7\xAE\xB5\xBA\xC2\xCE\xDA\xE0\xE7" + - "\xF2\xF9\xFD\u0107\u0119\u011E\u0129\u0132\u013C\u0149\u014E\u0154\u0158" + - "\u015E\u0164\u017C\u0189\u0197\u019F\u01A7\u01AB\u01B0\u01B3\u01B8\u01BB" + - "\u01C5\u01C8\u01CB\u01D5\u01D8\u01DB\u01EB\u01F0\u01F5\u0205\u0207\u020F" + - "\u021D\u0223\u0229\u0231\u0242\u024C\u0257\u0263\u0270\u027B\u0286\u0291" + - "\u029C\u02A7\u02B2\u02BC\u02C3\u02CC\u02D2"; + "\x03\x02\x02\x02\u0225\u0224\x03\x02\x02\x02\u0226m\x03\x02\x02\x02\u0227" + + "\u0228\x05b2\x02\u0228\u0229\x05v<\x02\u0229o\x03\x02\x02\x02\u022A\u022E" + + "\x05l7\x02\u022B\u022E\x05r:\x02\u022C\u022E\x05t;\x02\u022D\u022A\x03" + + "\x02\x02\x02\u022D\u022B\x03\x02\x02\x02\u022D\u022C\x03\x02\x02\x02\u022E" + + "q\x03\x02\x02\x02\u022F\u0230\x05v<\x02\u0230\u0231\x05l7\x02\u0231s\x03" + + "\x02\x02\x02\u0232\u0233\x05x=\x02\u0233\u0234\x05l7\x02\u0234u\x03\x02" + + "\x02\x02\u0235\u0236\t\b\x02\x02\u0236w\x03\x02\x02\x02\u0237\u0238\t" + + "\t\x02\x02\u0238y\x03\x02\x02\x02\u0239\u023F\x05p9\x02\u023A\u023B\x05" + + "p9\x02\u023B\u023C\x07\b\x02\x02\u023C\u023D\x05\x9AN\x02\u023D\u023F" + + "\x03\x02\x02\x02\u023E\u0239\x03\x02\x02\x02\u023E\u023A\x03\x02\x02\x02" + + "\u023F{\x03\x02\x02\x02\u0240\u0241\b?\x01\x02\u0241\u0242\x05z>\x02\u0242" + + "\u0248\x03\x02\x02\x02\u0243\u0244\f\x03\x02\x02\u0244\u0245\t\n\x02\x02" + + "\u0245\u0247\x05z>\x02\u0246\u0243\x03\x02\x02\x02\u0247\u024A\x03\x02" + + "\x02\x02\u0248\u0246\x03\x02\x02\x02\u0248\u0249\x03\x02\x02\x02\u0249" + + "}\x03\x02\x02\x02\u024A\u0248\x03\x02\x02\x02\u024B\u024C\b@\x01\x02\u024C" + + "\u024D\x05|?\x02\u024D\u0253\x03\x02\x02\x02\u024E\u024F\f\x03\x02\x02" + + "\u024F\u0250\t\v\x02\x02\u0250\u0252\x05|?\x02\u0251\u024E\x03\x02\x02" + + "\x02\u0252\u0255\x03\x02\x02\x02\u0253\u0251\x03\x02\x02\x02\u0253\u0254" + + "\x03\x02\x02\x02\u0254\x7F\x03\x02\x02\x02\u0255\u0253\x03\x02\x02\x02" + + "\u0256\u0257\bA\x01\x02\u0257\u0258\x05~@\x02\u0258\u025F\x03\x02\x02" + + "\x02\u0259\u025A\f\x03\x02\x02\u025A\u025B\x05\x82B\x02\u025B\u025C\x05" + + "\x88E\x02\u025C\u025E\x03\x02\x02\x02\u025D\u0259\x03\x02\x02\x02\u025E" + + "\u0261\x03\x02\x02\x02\u025F\u025D\x03\x02\x02\x02\u025F\u0260\x03\x02" + + "\x02\x02\u0260\x81\x03\x02\x02\x02\u0261\u025F\x03\x02\x02\x02\u0262\u0263" + + "\t\f\x02\x02\u0263\x83\x03\x02\x02\x02\u0264\u0265\bC\x01\x02\u0265\u0266" + + "\x05\x80A\x02\u0266\u026C\x03\x02\x02\x02\u0267\u0268\f\x03\x02\x02\u0268" + + "\u0269\t\r\x02\x02\u0269\u026B\x05\x80A\x02\u026A\u0267\x03\x02\x02\x02" + + "\u026B\u026E\x03\x02\x02\x02\u026C\u026A\x03\x02\x02\x02\u026C\u026D\x03" + + "\x02\x02\x02\u026D\x85\x03\x02\x02\x02\u026E\u026C\x03\x02\x02\x02\u026F" + + "\u0270\bD\x01\x02\u0270\u0271\x05\x84C\x02\u0271\u0277\x03\x02\x02\x02" + + "\u0272\u0273\f\x03\x02\x02\u0273\u0274\t\x0E\x02\x02\u0274\u0276\x05\x84" + + "C\x02\u0275\u0272\x03\x02\x02\x02\u0276\u0279\x03\x02\x02\x02\u0277\u0275" + + "\x03\x02\x02\x02\u0277\u0278\x03\x02\x02\x02\u0278\x87\x03\x02\x02\x02" + + "\u0279\u0277\x03\x02\x02\x02\u027A\u027B\bE\x01\x02\u027B\u027C\x05\x86" + + "D\x02\u027C\u0282\x03\x02\x02\x02\u027D\u027E\f\x03\x02\x02\u027E\u027F" + + "\x07C\x02\x02\u027F\u0281\x05\x86D\x02\u0280\u027D\x03\x02\x02\x02\u0281" + + "\u0284\x03\x02\x02\x02\u0282\u0280\x03\x02\x02\x02\u0282\u0283\x03\x02" + + "\x02\x02\u0283\x89\x03\x02\x02\x02\u0284\u0282\x03\x02\x02\x02\u0285\u0286" + + "\bF\x01\x02\u0286\u0287\x05\x88E\x02\u0287\u028D\x03\x02\x02\x02\u0288" + + "\u0289\f\x03\x02\x02\u0289\u028A\x07E\x02\x02\u028A\u028C\x05\x88E\x02" + + "\u028B\u0288\x03\x02\x02\x02\u028C\u028F\x03\x02\x02\x02\u028D\u028B\x03" + + "\x02\x02\x02\u028D\u028E\x03\x02\x02\x02\u028E\x8B\x03\x02\x02\x02\u028F" + + "\u028D\x03\x02\x02\x02\u0290\u0291\bG\x01\x02\u0291\u0292\x05\x8AF\x02" + + "\u0292\u0298\x03\x02\x02\x02\u0293\u0294\f\x03\x02\x02\u0294\u0295\x07" + + "D\x02\x02\u0295\u0297\x05\x8AF\x02\u0296\u0293\x03\x02\x02\x02\u0297\u029A" + + "\x03\x02\x02\x02\u0298\u0296\x03\x02\x02\x02\u0298\u0299\x03\x02\x02\x02" + + "\u0299\x8D\x03\x02\x02\x02\u029A\u0298\x03\x02\x02\x02\u029B\u029C\bH" + + "\x01\x02\u029C\u029D\x05\x8CG\x02\u029D\u02A3\x03\x02\x02\x02\u029E\u029F" + + "\f\x03\x02\x02\u029F\u02A0\x074\x02\x02\u02A0\u02A2\x05\x8CG\x02\u02A1" + + "\u029E\x03\x02\x02\x02\u02A2\u02A5\x03\x02\x02\x02\u02A3\u02A1\x03\x02" + + "\x02\x02\u02A3\u02A4\x03\x02\x02\x02\u02A4\x8F\x03\x02\x02\x02\u02A5\u02A3" + + "\x03\x02\x02\x02\u02A6\u02A7\bI\x01\x02\u02A7\u02A8\x05\x8EH\x02\u02A8" + + "\u02AE\x03\x02\x02\x02\u02A9\u02AA\f\x03\x02\x02\u02AA\u02AB\x075\x02" + + "\x02\u02AB\u02AD\x05\x8EH\x02\u02AC\u02A9\x03\x02\x02\x02\u02AD\u02B0" + + "\x03\x02\x02\x02\u02AE\u02AC\x03\x02\x02\x02\u02AE\u02AF\x03\x02\x02\x02" + + "\u02AF\x91\x03\x02\x02\x02\u02B0\u02AE\x03\x02\x02\x02\u02B1\u02B9\x05" + + "\x90I\x02\u02B2\u02B3\x05\x90I\x02\u02B3\u02B4\x07#\x02\x02\u02B4\u02B5" + + "\x05\x92J\x02\u02B5\u02B6\x07$\x02\x02\u02B6\u02B7\x05\x92J\x02\u02B7" + + "\u02B9\x03\x02\x02\x02\u02B8\u02B1\x03\x02\x02\x02\u02B8\u02B2\x03\x02" + + "\x02\x02\u02B9\x93\x03\x02\x02\x02\u02BA\u02C0\x05\x92J\x02\u02BB\u02BC" + + "\x05b2\x02\u02BC\u02BD\x05\x96L\x02\u02BD\u02BE\x05\x94K\x02\u02BE\u02C0" + + "\x03\x02\x02\x02\u02BF\u02BA\x03\x02\x02\x02\u02BF\u02BB\x03\x02\x02\x02" + + "\u02C0\x95\x03\x02\x02\x02\u02C1\u02C2\t\x0F\x02\x02\u02C2\x97\x03\x02" + + "\x02\x02\u02C3\u02C8\x05\x94K\x02\u02C4\u02C5\x07!\x02\x02\u02C5\u02C7" + + "\x05\x94K\x02\u02C6\u02C4\x03\x02\x02\x02\u02C7\u02CA\x03\x02\x02\x02" + + "\u02C8\u02C6\x03\x02\x02\x02\u02C8\u02C9\x03\x02\x02\x02\u02C9\x99\x03" + + "\x02\x02\x02\u02CA\u02C8\x03\x02\x02\x02\u02CB\u02CF\x05\x9CO\x02\u02CC" + + "\u02CF\x05\x9EP\x02\u02CD\u02CF\x05\xA0Q\x02\u02CE\u02CB\x03\x02\x02\x02" + + "\u02CE\u02CC\x03\x02\x02\x02\u02CE\u02CD\x03\x02\x02\x02\u02CF\x9B\x03" + + "\x02\x02\x02\u02D0\u02D1\x05\xA2R\x02\u02D1\x9D\x03\x02\x02\x02\u02D2" + + "\u02D3\x05\xA2R\x02\u02D3\u02D4\x07?\x02\x02\u02D4\u02D5\x05\xA2R\x02" + + "\u02D5\u02D6\x07A\x02\x02\u02D6\x9F\x03\x02\x02\x02\u02D7\u02D8\x07\x1D" + + "\x02\x02\u02D8\u02D9\x07%\x02\x02\u02D9\u02DA\x05\xA2R\x02\u02DA\u02DB" + + "\x07&\x02\x02\u02DB\xA1\x03\x02\x02\x02\u02DC\u02DD\t\x10\x02\x02\u02DD" + + "\xA3\x03\x02\x02\x02B\xA5\xAC\xB3\xB8\xC0\xCC\xD8\xDE\xE5\xF2\xF9\u0103" + + "\u0115\u011A\u0125\u012E\u0138\u0145\u014A\u0150\u0154\u015A\u0160\u0178" + + "\u0185\u0193\u019B\u01A3\u01A7\u01AC\u01AF\u01B4\u01B7\u01C1\u01C4\u01C7" + + "\u01D1\u01D4\u01D7\u01E7\u01EC\u01F1\u0201\u0203\u020B\u0219\u021F\u0225" + + "\u022D\u023E\u0248\u0253\u025F\u026C\u0277\u0282\u028D\u0298\u02A3\u02AE" + + "\u02B8\u02BF\u02C8\u02CE"; public static readonly _serializedATN: string = Utils.join( - [ - KipperParser._serializedATNSegment0, - KipperParser._serializedATNSegment1, - ], + [KipperParser._serializedATNSegment0, KipperParser._serializedATNSegment1], "", ); public static __ATN: ATN; @@ -4673,11 +5117,12 @@ export class KipperParser extends KipperParserBase { return KipperParser.__ATN; } - } export class CompilationUnitContext extends KipperParserRuleContext { - public EOF(): TerminalNode { return this.getToken(KipperParser.EOF, 0); } + public EOF(): TerminalNode { + return this.getToken(KipperParser.EOF, 0); + } public translationUnit(): TranslationUnitContext | undefined { return this.tryGetRuleContext(0, TranslationUnitContext); } @@ -4685,7 +5130,9 @@ export class CompilationUnitContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_compilationUnit; } + public get ruleIndex(): number { + return KipperParser.RULE_compilationUnit; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterCompilationUnit) { @@ -4708,7 +5155,6 @@ export class CompilationUnitContext extends KipperParserRuleContext { } } - export class TranslationUnitContext extends KipperParserRuleContext { public externalItem(): ExternalItemContext[]; public externalItem(i: number): ExternalItemContext; @@ -4723,7 +5169,9 @@ export class TranslationUnitContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_translationUnit; } + public get ruleIndex(): number { + return KipperParser.RULE_translationUnit; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTranslationUnit) { @@ -4746,13 +5194,14 @@ export class TranslationUnitContext extends KipperParserRuleContext { } } - export class ExternalItemContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_externalItem; } + public get ruleIndex(): number { + return KipperParser.RULE_externalItem; + } public copyFrom(ctx: ExternalItemContext): void { super.copyFrom(ctx); } @@ -4787,7 +5236,6 @@ export class ExternalBlockItemContext extends ExternalItemContext { } } - export class BlockItemListContext extends KipperParserRuleContext { public blockItem(): BlockItemContext[]; public blockItem(i: number): BlockItemContext; @@ -4802,7 +5250,9 @@ export class BlockItemListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_blockItemList; } + public get ruleIndex(): number { + return KipperParser.RULE_blockItemList; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBlockItemList) { @@ -4825,7 +5275,6 @@ export class BlockItemListContext extends KipperParserRuleContext { } } - export class BlockItemContext extends KipperParserRuleContext { public statement(): StatementContext | undefined { return this.tryGetRuleContext(0, StatementContext); @@ -4833,12 +5282,16 @@ export class BlockItemContext extends KipperParserRuleContext { public declaration(): DeclarationContext | undefined { return this.tryGetRuleContext(0, DeclarationContext); } - public SemiColon(): TerminalNode | undefined { return this.tryGetToken(KipperParser.SemiColon, 0); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_blockItem; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBlockItem) { @@ -4861,12 +5314,13 @@ export class BlockItemContext extends KipperParserRuleContext { } } - 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 SemiColon(): TerminalNode | undefined { + return this.tryGetToken(KipperParser.SemiColon, 0); + } public functionDeclaration(): FunctionDeclarationContext | undefined { return this.tryGetRuleContext(0, FunctionDeclarationContext); } @@ -4880,7 +5334,9 @@ export class DeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_declaration; } + public get ruleIndex(): number { + return KipperParser.RULE_declaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDeclaration) { @@ -4903,7 +5359,6 @@ export class DeclarationContext extends KipperParserRuleContext { } } - export class VariableDeclarationContext extends KipperParserRuleContext { public storageTypeSpecifier(): StorageTypeSpecifierContext { return this.getRuleContext(0, StorageTypeSpecifierContext); @@ -4915,7 +5370,9 @@ export class VariableDeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_variableDeclaration; } + public get ruleIndex(): number { + return KipperParser.RULE_variableDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterVariableDeclaration) { @@ -4938,15 +5395,20 @@ export class VariableDeclarationContext extends KipperParserRuleContext { } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_storageTypeSpecifier; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStorageTypeSpecifier) { @@ -4969,16 +5431,19 @@ export class StorageTypeSpecifierContext extends KipperParserRuleContext { } } - export class InitDeclaratorContext extends KipperParserRuleContext { public declarator(): DeclaratorContext { return this.getRuleContext(0, DeclaratorContext); } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } + 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 Assign(): TerminalNode | undefined { + return this.tryGetToken(KipperParser.Assign, 0); + } public initializer(): InitializerContext | undefined { return this.tryGetRuleContext(0, InitializerContext); } @@ -4986,7 +5451,9 @@ export class InitDeclaratorContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_initDeclarator; } + public get ruleIndex(): number { + return KipperParser.RULE_initDeclarator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterInitDeclarator) { @@ -5009,7 +5476,6 @@ export class InitDeclaratorContext extends KipperParserRuleContext { } } - export class InitializerContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext { return this.getRuleContext(0, AssignmentExpressionContext); @@ -5018,7 +5484,9 @@ export class InitializerContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_initializer; } + public get ruleIndex(): number { + return KipperParser.RULE_initializer; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterInitializer) { @@ -5041,7 +5509,6 @@ export class InitializerContext extends KipperParserRuleContext { } } - export class DeclaratorContext extends KipperParserRuleContext { public directDeclarator(): DirectDeclaratorContext { return this.getRuleContext(0, DirectDeclaratorContext); @@ -5050,7 +5517,9 @@ export class DeclaratorContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_declarator; } + public get ruleIndex(): number { + return KipperParser.RULE_declarator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDeclarator) { @@ -5073,14 +5542,17 @@ export class DeclaratorContext extends KipperParserRuleContext { } } - export class DirectDeclaratorContext extends KipperParserRuleContext { - public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_directDeclarator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDirectDeclarator) { @@ -5103,15 +5575,22 @@ export class DirectDeclaratorContext extends KipperParserRuleContext { } } - export class FunctionDeclarationContext extends KipperParserRuleContext { - public DefFunc(): TerminalNode { return this.getToken(KipperParser.DefFunc, 0); } + 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 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); } @@ -5125,7 +5604,9 @@ export class FunctionDeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_functionDeclaration; } + public get ruleIndex(): number { + return KipperParser.RULE_functionDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFunctionDeclaration) { @@ -5148,7 +5629,6 @@ export class FunctionDeclarationContext extends KipperParserRuleContext { } } - export class ParameterListContext extends KipperParserRuleContext { public parameterDeclaration(): ParameterDeclarationContext[]; public parameterDeclaration(i: number): ParameterDeclarationContext; @@ -5172,7 +5652,9 @@ export class ParameterListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_parameterList; } + public get ruleIndex(): number { + return KipperParser.RULE_parameterList; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterParameterList) { @@ -5195,12 +5677,13 @@ export class ParameterListContext extends KipperParserRuleContext { } } - export class ParameterDeclarationContext extends KipperParserRuleContext { public declarator(): DeclaratorContext { return this.getRuleContext(0, DeclaratorContext); } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } + public Colon(): TerminalNode { + return this.getToken(KipperParser.Colon, 0); + } public typeSpecifierExpression(): TypeSpecifierExpressionContext { return this.getRuleContext(0, TypeSpecifierExpressionContext); } @@ -5208,7 +5691,9 @@ export class ParameterDeclarationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_parameterDeclaration; } + public get ruleIndex(): number { + return KipperParser.RULE_parameterDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterParameterDeclaration) { @@ -5231,47 +5716,24 @@ export class ParameterDeclarationContext extends KipperParserRuleContext { } } - export class InterfaceDeclarationContext extends KipperParserRuleContext { - public Interface(): TerminalNode { return this.getToken(KipperParser.Interface, 0); } - public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } - public LeftBrace(): TerminalNode { return this.getToken(KipperParser.LeftBrace, 0); } - public RightBrace(): TerminalNode { return this.getToken(KipperParser.RightBrace, 0); } - public interfaceMemberList(): InterfaceMemberListContext | undefined { - return this.tryGetRuleContext(0, InterfaceMemberListContext); + public Interface(): TerminalNode { + return this.getToken(KipperParser.Interface, 0); } - 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); - } + public declarator(): DeclaratorContext { + return this.getRuleContext(0, DeclaratorContext); } - // @Override - public exitRule(listener: KipperParserListener): void { - if (listener.exitInterfaceDeclaration) { - listener.exitInterfaceDeclaration(this); - } + public LeftBrace(): TerminalNode { + return this.getToken(KipperParser.LeftBrace, 0); } - // @Override - public accept(visitor: KipperParserVisitor): Result { - if (visitor.visitInterfaceDeclaration) { - return visitor.visitInterfaceDeclaration(this); - } else { - return visitor.visitChildren(this); - } + public RightBrace(): TerminalNode { + return this.getToken(KipperParser.RightBrace, 0); } -} - - -export class InterfaceMemberListContext extends KipperParserRuleContext { public interfaceMemberDeclaration(): InterfaceMemberDeclarationContext[]; public interfaceMemberDeclaration(i: number): InterfaceMemberDeclarationContext; - public interfaceMemberDeclaration(i?: number): InterfaceMemberDeclarationContext | InterfaceMemberDeclarationContext[] { + public interfaceMemberDeclaration( + i?: number, + ): InterfaceMemberDeclarationContext | InterfaceMemberDeclarationContext[] { if (i === undefined) { return this.getRuleContexts(InterfaceMemberDeclarationContext); } else { @@ -5282,42 +5744,45 @@ export class InterfaceMemberListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_interfaceMemberList; } + public get ruleIndex(): number { + return KipperParser.RULE_interfaceDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { - if (listener.enterInterfaceMemberList) { - listener.enterInterfaceMemberList(this); + if (listener.enterInterfaceDeclaration) { + listener.enterInterfaceDeclaration(this); } } // @Override public exitRule(listener: KipperParserListener): void { - if (listener.exitInterfaceMemberList) { - listener.exitInterfaceMemberList(this); + if (listener.exitInterfaceDeclaration) { + listener.exitInterfaceDeclaration(this); } } // @Override public accept(visitor: KipperParserVisitor): Result { - if (visitor.visitInterfaceMemberList) { - return visitor.visitInterfaceMemberList(this); + if (visitor.visitInterfaceDeclaration) { + return visitor.visitInterfaceDeclaration(this); } else { return visitor.visitChildren(this); } } } - export class InterfaceMemberDeclarationContext extends KipperParserRuleContext { - public propertySignature(): PropertySignatureContext | undefined { - return this.tryGetRuleContext(0, PropertySignatureContext); + public interfacePropertyDeclaration(): InterfacePropertyDeclarationContext | undefined { + return this.tryGetRuleContext(0, InterfacePropertyDeclarationContext); } - public methodSignature(): MethodSignatureContext | undefined { - return this.tryGetRuleContext(0, MethodSignatureContext); + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_interfaceMemberDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterInterfaceMemberDeclaration) { @@ -5340,51 +5805,67 @@ export class InterfaceMemberDeclarationContext extends KipperParserRuleContext { } } - -export class PropertySignatureContext extends KipperParserRuleContext { - public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 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); } + 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_propertySignature; } + public get ruleIndex(): number { + return KipperParser.RULE_interfacePropertyDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { - if (listener.enterPropertySignature) { - listener.enterPropertySignature(this); + if (listener.enterInterfacePropertyDeclaration) { + listener.enterInterfacePropertyDeclaration(this); } } // @Override public exitRule(listener: KipperParserListener): void { - if (listener.exitPropertySignature) { - listener.exitPropertySignature(this); + if (listener.exitInterfacePropertyDeclaration) { + listener.exitInterfacePropertyDeclaration(this); } } // @Override public accept(visitor: KipperParserVisitor): Result { - if (visitor.visitPropertySignature) { - return visitor.visitPropertySignature(this); + if (visitor.visitInterfacePropertyDeclaration) { + return visitor.visitInterfacePropertyDeclaration(this); } else { return visitor.visitChildren(this); } } } - -export class MethodSignatureContext extends KipperParserRuleContext { - public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } - 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); } +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 SemiColon(): TerminalNode { + return this.getToken(KipperParser.SemiColon, 0); + } public parameterList(): ParameterListContext | undefined { return this.tryGetRuleContext(0, ParameterListContext); } @@ -5392,40 +5873,51 @@ export class MethodSignatureContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_methodSignature; } + public get ruleIndex(): number { + return KipperParser.RULE_interfaceMethodDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { - if (listener.enterMethodSignature) { - listener.enterMethodSignature(this); + if (listener.enterInterfaceMethodDeclaration) { + listener.enterInterfaceMethodDeclaration(this); } } // @Override public exitRule(listener: KipperParserListener): void { - if (listener.exitMethodSignature) { - listener.exitMethodSignature(this); + if (listener.exitInterfaceMethodDeclaration) { + listener.exitInterfaceMethodDeclaration(this); } } // @Override public accept(visitor: KipperParserVisitor): Result { - if (visitor.visitMethodSignature) { - return visitor.visitMethodSignature(this); + 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 Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } - public LeftBrace(): TerminalNode { return this.getToken(KipperParser.LeftBrace, 0); } - public RightBrace(): TerminalNode { return this.getToken(KipperParser.RightBrace, 0); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_classDeclaration; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterClassDeclaration) { @@ -5448,7 +5940,6 @@ export class ClassDeclarationContext extends KipperParserRuleContext { } } - export class StatementContext extends KipperParserRuleContext { public expressionStatement(): ExpressionStatementContext | undefined { return this.tryGetRuleContext(0, ExpressionStatementContext); @@ -5472,7 +5963,9 @@ export class StatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_statement; } + public get ruleIndex(): number { + return KipperParser.RULE_statement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStatement) { @@ -5495,10 +5988,13 @@ export class StatementContext extends KipperParserRuleContext { } } - export class CompoundStatementContext extends KipperParserRuleContext { - public LeftBrace(): TerminalNode { return this.getToken(KipperParser.LeftBrace, 0); } - public RightBrace(): TerminalNode { return this.getToken(KipperParser.RightBrace, 0); } + 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); } @@ -5506,7 +6002,9 @@ export class CompoundStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_compoundStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_compoundStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterCompoundStatement) { @@ -5529,17 +6027,20 @@ export class CompoundStatementContext extends KipperParserRuleContext { } } - export class ExpressionStatementContext extends KipperParserRuleContext { public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } - public SemiColon(): TerminalNode { return this.getToken(KipperParser.SemiColon, 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_expressionStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_expressionStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterExpressionStatement) { @@ -5562,7 +6063,6 @@ export class ExpressionStatementContext extends KipperParserRuleContext { } } - export class SelectionStatementContext extends KipperParserRuleContext { public ifStatement(): IfStatementContext | undefined { return this.tryGetRuleContext(0, IfStatementContext); @@ -5574,7 +6074,9 @@ export class SelectionStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_selectionStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_selectionStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSelectionStatement) { @@ -5597,14 +6099,19 @@ export class SelectionStatementContext extends KipperParserRuleContext { } } - export class IfStatementContext extends KipperParserRuleContext { - public If(): TerminalNode { return this.getToken(KipperParser.If, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } + 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 RightParen(): TerminalNode { + return this.getToken(KipperParser.RightParen, 0); + } public statement(): StatementContext[]; public statement(i: number): StatementContext; public statement(i?: number): StatementContext | StatementContext[] { @@ -5614,12 +6121,16 @@ export class IfStatementContext extends KipperParserRuleContext { return this.getRuleContext(i, StatementContext); } } - public Else(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Else, 0); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_ifStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIfStatement) { @@ -5642,16 +6153,25 @@ export class IfStatementContext extends KipperParserRuleContext { } } - export class SwitchStatementContext extends KipperParserRuleContext { - public Switch(): TerminalNode { return this.getToken(KipperParser.Switch, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } + 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 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[] { @@ -5665,7 +6185,9 @@ export class SwitchStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_switchStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_switchStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSwitchStatement) { @@ -5688,22 +6210,29 @@ export class SwitchStatementContext extends KipperParserRuleContext { } } - export class SwitchLabeledStatementContext extends KipperParserRuleContext { - public Case(): TerminalNode | undefined { return this.tryGetToken(KipperParser.Case, 0); } + 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 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_switchLabeledStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSwitchLabeledStatement) { @@ -5726,7 +6255,6 @@ export class SwitchLabeledStatementContext extends KipperParserRuleContext { } } - export class IterationStatementContext extends KipperParserRuleContext { public forLoopIterationStatement(): ForLoopIterationStatementContext | undefined { return this.tryGetRuleContext(0, ForLoopIterationStatementContext); @@ -5741,7 +6269,9 @@ export class IterationStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_iterationStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_iterationStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIterationStatement) { @@ -5764,13 +6294,16 @@ export class IterationStatementContext extends KipperParserRuleContext { } } - 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 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[] { @@ -5780,7 +6313,9 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { return this.getToken(KipperParser.SemiColon, i); } } - public RightParen(): TerminalNode { return this.getToken(KipperParser.RightParen, 0); } + public RightParen(): TerminalNode { + return this.getToken(KipperParser.RightParen, 0); + } public statement(): StatementContext { return this.getRuleContext(0, StatementContext); } @@ -5800,7 +6335,9 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_forLoopIterationStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_forLoopIterationStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterForLoopIterationStatement) { @@ -5823,14 +6360,19 @@ export class ForLoopIterationStatementContext extends KipperParserRuleContext { } } - export class WhileLoopIterationStatementContext extends KipperParserRuleContext { - public While(): TerminalNode { return this.getToken(KipperParser.While, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } + 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 RightParen(): TerminalNode { + return this.getToken(KipperParser.RightParen, 0); + } public statement(): StatementContext { return this.getRuleContext(0, StatementContext); } @@ -5838,7 +6380,9 @@ export class WhileLoopIterationStatementContext extends KipperParserRuleContext super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_whileLoopIterationStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_whileLoopIterationStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterWhileLoopIterationStatement) { @@ -5861,24 +6405,35 @@ export class WhileLoopIterationStatementContext extends KipperParserRuleContext } } - export class DoWhileLoopIterationStatementContext extends KipperParserRuleContext { - public Do(): TerminalNode { return this.getToken(KipperParser.Do, 0); } + 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 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_doWhileLoopIterationStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDoWhileLoopIterationStatement) { @@ -5901,16 +6456,23 @@ export class DoWhileLoopIterationStatementContext extends KipperParserRuleContex } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_jumpStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterJumpStatement) { @@ -5933,10 +6495,13 @@ export class JumpStatementContext extends KipperParserRuleContext { } } - export class ReturnStatementContext extends KipperParserRuleContext { - public Return(): TerminalNode { return this.getToken(KipperParser.Return, 0); } - public SemiColon(): TerminalNode { return this.getToken(KipperParser.SemiColon, 0); } + 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); } @@ -5944,7 +6509,9 @@ export class ReturnStatementContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_returnStatement; } + public get ruleIndex(): number { + return KipperParser.RULE_returnStatement; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterReturnStatement) { @@ -5967,7 +6534,6 @@ export class ReturnStatementContext extends KipperParserRuleContext { } } - export class PrimaryExpressionContext extends KipperParserRuleContext { public tangledPrimaryExpression(): TangledPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, TangledPrimaryExpressionContext); @@ -6000,7 +6566,9 @@ export class PrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_primaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_primaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPrimaryExpression) { @@ -6023,18 +6591,23 @@ export class PrimaryExpressionContext extends KipperParserRuleContext { } } - export class TangledPrimaryExpressionContext extends KipperParserRuleContext { - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 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 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; } + public get ruleIndex(): number { + return KipperParser.RULE_tangledPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTangledPrimaryExpression) { @@ -6057,15 +6630,20 @@ export class TangledPrimaryExpressionContext extends KipperParserRuleContext { } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_boolPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBoolPrimaryExpression) { @@ -6088,7 +6666,6 @@ export class BoolPrimaryExpressionContext extends KipperParserRuleContext { } } - export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext { public identifier(): IdentifierContext { return this.getRuleContext(0, IdentifierContext); @@ -6097,7 +6674,9 @@ export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_identifierPrimaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_identifierPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierPrimaryExpression) { @@ -6120,14 +6699,17 @@ export class IdentifierPrimaryExpressionContext extends KipperParserRuleContext } } - export class IdentifierContext extends KipperParserRuleContext { - public Identifier(): TerminalNode { return this.getToken(KipperParser.Identifier, 0); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_identifier; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifier) { @@ -6150,7 +6732,6 @@ export class IdentifierContext extends KipperParserRuleContext { } } - export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRuleContext { public identifier(): IdentifierContext | undefined { return this.tryGetRuleContext(0, IdentifierContext); @@ -6162,7 +6743,9 @@ export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRule super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_identifierOrStringPrimaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_identifierOrStringPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierOrStringPrimaryExpression) { @@ -6185,15 +6768,20 @@ export class IdentifierOrStringPrimaryExpressionContext extends KipperParserRule } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_stringPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterStringPrimaryExpression) { @@ -6216,10 +6804,13 @@ export class StringPrimaryExpressionContext extends KipperParserRuleContext { } } - 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 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[] { @@ -6229,8 +6820,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 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[] { @@ -6244,7 +6839,9 @@ export class FStringPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_fStringPrimaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_fStringPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringPrimaryExpression) { @@ -6267,11 +6864,16 @@ export class FStringPrimaryExpressionContext extends KipperParserRuleContext { } } - 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 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); } @@ -6279,7 +6881,9 @@ export class FStringSingleQuoteAtomContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_fStringSingleQuoteAtom; } + public get ruleIndex(): number { + return KipperParser.RULE_fStringSingleQuoteAtom; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringSingleQuoteAtom) { @@ -6302,11 +6906,16 @@ export class FStringSingleQuoteAtomContext extends KipperParserRuleContext { } } - 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 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); } @@ -6314,7 +6923,9 @@ export class FStringDoubleQuoteAtomContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_fStringDoubleQuoteAtom; } + public get ruleIndex(): number { + return KipperParser.RULE_fStringDoubleQuoteAtom; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterFStringDoubleQuoteAtom) { @@ -6337,15 +6948,20 @@ export class FStringDoubleQuoteAtomContext extends KipperParserRuleContext { } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_numberPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterNumberPrimaryExpression) { @@ -6368,10 +6984,13 @@ export class NumberPrimaryExpressionContext extends KipperParserRuleContext { } } - export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { - public LeftBracket(): TerminalNode { return this.getToken(KipperParser.LeftBracket, 0); } - public RightBracket(): TerminalNode { return this.getToken(KipperParser.RightBracket, 0); } + 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[] { @@ -6394,7 +7013,9 @@ export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_arrayPrimaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_arrayPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterArrayPrimaryExpression) { @@ -6417,10 +7038,13 @@ export class ArrayPrimaryExpressionContext extends KipperParserRuleContext { } } - export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { - public LeftBrace(): TerminalNode { return this.getToken(KipperParser.LeftBrace, 0); } - public RightBrace(): TerminalNode { return this.getToken(KipperParser.RightBrace, 0); } + 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[] { @@ -6443,7 +7067,9 @@ export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_objectPrimaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_objectPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterObjectPrimaryExpression) { @@ -6466,12 +7092,13 @@ export class ObjectPrimaryExpressionContext extends KipperParserRuleContext { } } - export class ObjectPropertyContext extends KipperParserRuleContext { public identifierOrStringPrimaryExpression(): IdentifierOrStringPrimaryExpressionContext { return this.getRuleContext(0, IdentifierOrStringPrimaryExpressionContext); } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } + public Colon(): TerminalNode { + return this.getToken(KipperParser.Colon, 0); + } public expression(): ExpressionContext { return this.getRuleContext(0, ExpressionContext); } @@ -6479,7 +7106,9 @@ export class ObjectPropertyContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_objectProperty; } + public get ruleIndex(): number { + return KipperParser.RULE_objectProperty; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterObjectProperty) { @@ -6502,16 +7131,23 @@ export class ObjectPropertyContext extends KipperParserRuleContext { } } - export class VoidOrNullOrUndefinedPrimaryExpressionContext extends KipperParserRuleContext { - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_voidOrNullOrUndefinedPrimaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterVoidOrNullOrUndefinedPrimaryExpression) { @@ -6534,14 +7170,15 @@ 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 get ruleIndex(): number { + return KipperParser.RULE_computedPrimaryExpression; + } public copyFrom(ctx: ComputedPrimaryExpressionContext): void { super.copyFrom(ctx); this._labelASTKind = ctx._labelASTKind; @@ -6580,8 +7217,12 @@ export class FunctionCallExpressionContext extends ComputedPrimaryExpressionCont 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 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); } @@ -6611,12 +7252,18 @@ export class FunctionCallExpressionContext extends ComputedPrimaryExpressionCont } } export class ExplicitCallFunctionCallExpressionContext extends ComputedPrimaryExpressionContext { - public CallFunc(): TerminalNode { return this.getToken(KipperParser.CallFunc, 0); } + 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 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); } @@ -6742,7 +7389,6 @@ export class SliceNotationMemberAccessExpressionContext extends ComputedPrimaryE } } - export class ArgumentExpressionListContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext[]; public assignmentExpression(i: number): AssignmentExpressionContext; @@ -6766,7 +7412,9 @@ export class ArgumentExpressionListContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_argumentExpressionList; } + public get ruleIndex(): number { + return KipperParser.RULE_argumentExpressionList; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterArgumentExpressionList) { @@ -6789,9 +7437,10 @@ export class ArgumentExpressionListContext extends KipperParserRuleContext { } } - export class DotNotationContext extends KipperParserRuleContext { - public Dot(): TerminalNode { return this.getToken(KipperParser.Dot, 0); } + public Dot(): TerminalNode { + return this.getToken(KipperParser.Dot, 0); + } public identifier(): IdentifierContext { return this.getRuleContext(0, IdentifierContext); } @@ -6799,7 +7448,9 @@ export class DotNotationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_dotNotation; } + public get ruleIndex(): number { + return KipperParser.RULE_dotNotation; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterDotNotation) { @@ -6822,18 +7473,23 @@ export class DotNotationContext extends KipperParserRuleContext { } } - export class BracketNotationContext extends KipperParserRuleContext { - public LeftBracket(): TerminalNode { return this.getToken(KipperParser.LeftBracket, 0); } + 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_bracketNotation; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBracketNotation) { @@ -6856,13 +7512,18 @@ 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 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[] { @@ -6876,7 +7537,9 @@ export class SliceNotationContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_sliceNotation; } + public get ruleIndex(): number { + return KipperParser.RULE_sliceNotation; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterSliceNotation) { @@ -6899,7 +7562,6 @@ export class SliceNotationContext extends KipperParserRuleContext { } } - export class PostfixExpressionContext extends KipperParserRuleContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext | undefined { return this.tryGetRuleContext(0, ComputedPrimaryExpressionContext); @@ -6911,7 +7573,9 @@ export class PostfixExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_postfixExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_postfixExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterPostfixExpression) { @@ -6934,7 +7598,6 @@ export class PostfixExpressionContext extends KipperParserRuleContext { } } - export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRuleContext { public computedPrimaryExpression(): ComputedPrimaryExpressionContext { return this.getRuleContext(0, ComputedPrimaryExpressionContext); @@ -6946,7 +7609,9 @@ export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRu super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementPostfixExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_incrementOrDecrementPostfixExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementPostfixExpression) { @@ -6969,7 +7634,6 @@ export class IncrementOrDecrementPostfixExpressionContext extends KipperParserRu } } - export class UnaryExpressionContext extends KipperParserRuleContext { public postfixExpression(): PostfixExpressionContext | undefined { return this.tryGetRuleContext(0, PostfixExpressionContext); @@ -6984,7 +7648,9 @@ export class UnaryExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_unaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_unaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterUnaryExpression) { @@ -7007,7 +7673,6 @@ export class UnaryExpressionContext extends KipperParserRuleContext { } } - export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRuleContext { public incrementOrDecrementOperator(): IncrementOrDecrementOperatorContext { return this.getRuleContext(0, IncrementOrDecrementOperatorContext); @@ -7019,7 +7684,9 @@ export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRule super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_incrementOrDecrementUnaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_incrementOrDecrementUnaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementUnaryExpression) { @@ -7042,7 +7709,6 @@ export class IncrementOrDecrementUnaryExpressionContext extends KipperParserRule } } - export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleContext { public unaryOperator(): UnaryOperatorContext { return this.getRuleContext(0, UnaryOperatorContext); @@ -7054,7 +7720,9 @@ export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleCont super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_operatorModifiedUnaryExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_operatorModifiedUnaryExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterOperatorModifiedUnaryExpression) { @@ -7077,15 +7745,20 @@ export class OperatorModifiedUnaryExpressionContext extends KipperParserRuleCont } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_incrementOrDecrementOperator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIncrementOrDecrementOperator) { @@ -7108,17 +7781,26 @@ export class IncrementOrDecrementOperatorContext extends KipperParserRuleContext } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_unaryOperator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterUnaryOperator) { @@ -7141,13 +7823,14 @@ export class UnaryOperatorContext extends KipperParserRuleContext { } } - export class CastOrConvertExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_castOrConvertExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_castOrConvertExpression; + } public copyFrom(ctx: CastOrConvertExpressionContext): void { super.copyFrom(ctx); } @@ -7185,7 +7868,9 @@ export class ActualCastOrConvertExpressionContext extends CastOrConvertExpressio public unaryExpression(): UnaryExpressionContext { return this.getRuleContext(0, UnaryExpressionContext); } - public As(): TerminalNode { return this.getToken(KipperParser.As, 0); } + public As(): TerminalNode { + return this.getToken(KipperParser.As, 0); + } public typeSpecifierExpression(): TypeSpecifierExpressionContext { return this.getRuleContext(0, TypeSpecifierExpressionContext); } @@ -7215,13 +7900,14 @@ export class ActualCastOrConvertExpressionContext extends CastOrConvertExpressio } } - export class MultiplicativeExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_multiplicativeExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_multiplicativeExpression; + } public copyFrom(ctx: MultiplicativeExpressionContext): void { super.copyFrom(ctx); } @@ -7262,10 +7948,18 @@ export class ActualMultiplicativeExpressionContext extends MultiplicativeExpress 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); } + 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); @@ -7292,13 +7986,14 @@ export class ActualMultiplicativeExpressionContext extends MultiplicativeExpress } } - export class AdditiveExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_additiveExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_additiveExpression; + } public copyFrom(ctx: AdditiveExpressionContext): void { super.copyFrom(ctx); } @@ -7339,8 +8034,12 @@ export class ActualAdditiveExpressionContext extends 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); } + 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); @@ -7367,13 +8066,14 @@ export class ActualAdditiveExpressionContext extends AdditiveExpressionContext { } } - export class BitwiseShiftExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_bitwiseShiftExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_bitwiseShiftExpression; + } public copyFrom(ctx: BitwiseShiftExpressionContext): void { super.copyFrom(ctx); } @@ -7443,16 +8143,23 @@ export class ActualBitwiseShiftExpressionContext extends BitwiseShiftExpressionC } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_bitwiseShiftOperators; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterBitwiseShiftOperators) { @@ -7475,13 +8182,14 @@ export class BitwiseShiftOperatorsContext extends KipperParserRuleContext { } } - export class RelationalExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_relationalExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_relationalExpression; + } public copyFrom(ctx: RelationalExpressionContext): void { super.copyFrom(ctx); } @@ -7522,10 +8230,18 @@ export class ActualRelationalExpressionContext extends RelationalExpressionConte 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); } + 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); @@ -7552,13 +8268,14 @@ export class ActualRelationalExpressionContext extends RelationalExpressionConte } } - export class EqualityExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_equalityExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_equalityExpression; + } public copyFrom(ctx: EqualityExpressionContext): void { super.copyFrom(ctx); } @@ -7599,8 +8316,12 @@ export class ActualEqualityExpressionContext extends 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); } + 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); @@ -7627,13 +8348,14 @@ export class ActualEqualityExpressionContext extends EqualityExpressionContext { } } - export class BitwiseAndExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_bitwiseAndExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_bitwiseAndExpression; + } public copyFrom(ctx: BitwiseAndExpressionContext): void { super.copyFrom(ctx); } @@ -7671,7 +8393,9 @@ export class ActualBitwiseAndExpressionContext extends BitwiseAndExpressionConte public bitwiseAndExpression(): BitwiseAndExpressionContext { return this.getRuleContext(0, BitwiseAndExpressionContext); } - public BitwiseAnd(): TerminalNode { return this.getToken(KipperParser.BitwiseAnd, 0); } + public BitwiseAnd(): TerminalNode { + return this.getToken(KipperParser.BitwiseAnd, 0); + } public equalityExpression(): EqualityExpressionContext { return this.getRuleContext(0, EqualityExpressionContext); } @@ -7701,13 +8425,14 @@ export class ActualBitwiseAndExpressionContext extends BitwiseAndExpressionConte } } - export class BitwiseXorExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_bitwiseXorExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_bitwiseXorExpression; + } public copyFrom(ctx: BitwiseXorExpressionContext): void { super.copyFrom(ctx); } @@ -7745,7 +8470,9 @@ export class ActualBitwiseXorExpressionContext extends BitwiseXorExpressionConte public bitwiseXorExpression(): BitwiseXorExpressionContext { return this.getRuleContext(0, BitwiseXorExpressionContext); } - public BitwiseXor(): TerminalNode { return this.getToken(KipperParser.BitwiseXor, 0); } + public BitwiseXor(): TerminalNode { + return this.getToken(KipperParser.BitwiseXor, 0); + } public bitwiseAndExpression(): BitwiseAndExpressionContext { return this.getRuleContext(0, BitwiseAndExpressionContext); } @@ -7775,13 +8502,14 @@ export class ActualBitwiseXorExpressionContext extends BitwiseXorExpressionConte } } - export class BitwiseOrExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_bitwiseOrExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_bitwiseOrExpression; + } public copyFrom(ctx: BitwiseOrExpressionContext): void { super.copyFrom(ctx); } @@ -7819,7 +8547,9 @@ export class ActualBitwiseOrExpressionContext extends BitwiseOrExpressionContext public bitwiseOrExpression(): BitwiseOrExpressionContext { return this.getRuleContext(0, BitwiseOrExpressionContext); } - public BitwiseOr(): TerminalNode { return this.getToken(KipperParser.BitwiseOr, 0); } + public BitwiseOr(): TerminalNode { + return this.getToken(KipperParser.BitwiseOr, 0); + } public bitwiseXorExpression(): BitwiseXorExpressionContext { return this.getRuleContext(0, BitwiseXorExpressionContext); } @@ -7849,13 +8579,14 @@ export class ActualBitwiseOrExpressionContext extends BitwiseOrExpressionContext } } - export class LogicalAndExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_logicalAndExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_logicalAndExpression; + } public copyFrom(ctx: LogicalAndExpressionContext): void { super.copyFrom(ctx); } @@ -7893,7 +8624,9 @@ export class ActualLogicalAndExpressionContext extends LogicalAndExpressionConte public logicalAndExpression(): LogicalAndExpressionContext { return this.getRuleContext(0, LogicalAndExpressionContext); } - public AndAnd(): TerminalNode { return this.getToken(KipperParser.AndAnd, 0); } + public AndAnd(): TerminalNode { + return this.getToken(KipperParser.AndAnd, 0); + } public bitwiseOrExpression(): BitwiseOrExpressionContext { return this.getRuleContext(0, BitwiseOrExpressionContext); } @@ -7923,13 +8656,14 @@ export class ActualLogicalAndExpressionContext extends LogicalAndExpressionConte } } - export class LogicalOrExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_logicalOrExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_logicalOrExpression; + } public copyFrom(ctx: LogicalOrExpressionContext): void { super.copyFrom(ctx); } @@ -7967,7 +8701,9 @@ export class ActualLogicalOrExpressionContext extends LogicalOrExpressionContext public logicalOrExpression(): LogicalOrExpressionContext { return this.getRuleContext(0, LogicalOrExpressionContext); } - public OrOr(): TerminalNode { return this.getToken(KipperParser.OrOr, 0); } + public OrOr(): TerminalNode { + return this.getToken(KipperParser.OrOr, 0); + } public logicalAndExpression(): LogicalAndExpressionContext { return this.getRuleContext(0, LogicalAndExpressionContext); } @@ -7997,13 +8733,14 @@ export class ActualLogicalOrExpressionContext extends LogicalOrExpressionContext } } - export class ConditionalExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_conditionalExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_conditionalExpression; + } public copyFrom(ctx: ConditionalExpressionContext): void { super.copyFrom(ctx); } @@ -8041,7 +8778,9 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon public logicalOrExpression(): LogicalOrExpressionContext { return this.getRuleContext(0, LogicalOrExpressionContext); } - public QuestionMark(): TerminalNode { return this.getToken(KipperParser.QuestionMark, 0); } + public QuestionMark(): TerminalNode { + return this.getToken(KipperParser.QuestionMark, 0); + } public conditionalExpression(): ConditionalExpressionContext[]; public conditionalExpression(i: number): ConditionalExpressionContext; public conditionalExpression(i?: number): ConditionalExpressionContext | ConditionalExpressionContext[] { @@ -8051,7 +8790,9 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon return this.getRuleContext(i, ConditionalExpressionContext); } } - public Colon(): TerminalNode { return this.getToken(KipperParser.Colon, 0); } + public Colon(): TerminalNode { + return this.getToken(KipperParser.Colon, 0); + } constructor(ctx: ConditionalExpressionContext) { super(ctx.parent, ctx.invokingState); this.copyFrom(ctx); @@ -8078,13 +8819,14 @@ export class ActualConditionalExpressionContext extends ConditionalExpressionCon } } - export class AssignmentExpressionContext extends KipperParserRuleContext { constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_assignmentExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_assignmentExpression; + } public copyFrom(ctx: AssignmentExpressionContext): void { super.copyFrom(ctx); } @@ -8154,19 +8896,32 @@ export class ActualAssignmentExpressionContext extends AssignmentExpressionConte } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_assignmentOperator; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterAssignmentOperator) { @@ -8189,7 +8944,6 @@ export class AssignmentOperatorContext extends KipperParserRuleContext { } } - export class ExpressionContext extends KipperParserRuleContext { public assignmentExpression(): AssignmentExpressionContext[]; public assignmentExpression(i: number): AssignmentExpressionContext; @@ -8213,7 +8967,9 @@ export class ExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_expression; } + public get ruleIndex(): number { + return KipperParser.RULE_expression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterExpression) { @@ -8236,7 +8992,6 @@ export class ExpressionContext extends KipperParserRuleContext { } } - export class TypeSpecifierExpressionContext extends KipperParserRuleContext { public identifierTypeSpecifierExpression(): IdentifierTypeSpecifierExpressionContext | undefined { return this.tryGetRuleContext(0, IdentifierTypeSpecifierExpressionContext); @@ -8251,7 +9006,9 @@ export class TypeSpecifierExpressionContext extends KipperParserRuleContext { super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_typeSpecifierExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_typeSpecifierExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeSpecifierExpression) { @@ -8274,7 +9031,6 @@ export class TypeSpecifierExpressionContext extends KipperParserRuleContext { } } - export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleContext { public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext { return this.getRuleContext(0, TypeSpecifierIdentifierContext); @@ -8283,7 +9039,9 @@ export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleCo super(parent, invokingState); } // @Override - public get ruleIndex(): number { return KipperParser.RULE_identifierTypeSpecifierExpression; } + public get ruleIndex(): number { + return KipperParser.RULE_identifierTypeSpecifierExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterIdentifierTypeSpecifierExpression) { @@ -8306,7 +9064,6 @@ export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleCo } } - export class GenericTypeSpecifierExpressionContext extends KipperParserRuleContext { public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext[]; public typeSpecifierIdentifier(i: number): TypeSpecifierIdentifierContext; @@ -8317,13 +9074,19 @@ 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_genericTypeSpecifierExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterGenericTypeSpecifierExpression) { @@ -8346,19 +9109,26 @@ export class GenericTypeSpecifierExpressionContext extends KipperParserRuleConte } } - export class TypeofTypeSpecifierExpressionContext extends KipperParserRuleContext { - public Typeof(): TerminalNode { return this.getToken(KipperParser.Typeof, 0); } - public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } + 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_typeofTypeSpecifierExpression; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeofTypeSpecifierExpression) { @@ -8381,17 +9151,26 @@ export class TypeofTypeSpecifierExpressionContext extends KipperParserRuleContex } } - 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); } + 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; } + public get ruleIndex(): number { + return KipperParser.RULE_typeSpecifierIdentifier; + } // @Override public enterRule(listener: KipperParserListener): void { if (listener.enterTypeSpecifierIdentifier) { @@ -8413,5 +9192,3 @@ export class TypeSpecifierIdentifierContext extends KipperParserRuleContext { } } } - - diff --git a/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts b/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts index 7f1e7d0b9..bc039c3a1 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperParserListener.ts @@ -1,11 +1,9 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT - - // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax - // kind values. - import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; - import KipperParserBase from "./base/KipperParserBase"; - +// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax +// kind values. +import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; +import KipperParserBase from "./base/KipperParserBase"; import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; @@ -58,10 +56,9 @@ import { FunctionDeclarationContext } from "./KipperParser"; import { ParameterListContext } from "./KipperParser"; import { ParameterDeclarationContext } from "./KipperParser"; import { InterfaceDeclarationContext } from "./KipperParser"; -import { InterfaceMemberListContext } from "./KipperParser"; import { InterfaceMemberDeclarationContext } from "./KipperParser"; -import { PropertySignatureContext } from "./KipperParser"; -import { MethodSignatureContext } from "./KipperParser"; +import { InterfacePropertyDeclarationContext } from "./KipperParser"; +import { InterfaceMethodDeclarationContext } from "./KipperParser"; import { ClassDeclarationContext } from "./KipperParser"; import { StatementContext } from "./KipperParser"; import { CompoundStatementContext } from "./KipperParser"; @@ -125,7 +122,6 @@ import { GenericTypeSpecifierExpressionContext } from "./KipperParser"; import { TypeofTypeSpecifierExpressionContext } from "./KipperParser"; import { TypeSpecifierIdentifierContext } from "./KipperParser"; - /** * This interface defines a complete listener for a parse tree produced by * `KipperParser`. @@ -736,17 +732,6 @@ export interface KipperParserListener extends ParseTreeListener { */ exitInterfaceDeclaration?: (ctx: InterfaceDeclarationContext) => void; - /** - * Enter a parse tree produced by `KipperParser.interface-member-list-declaration`. - * @param ctx the parse tree - */ - enterInterfaceMemberList?: (ctx: InterfaceMemberListContext) => void; - /** - * Exit a parse tree produced by `KipperParser.interface-member-list-declaration`. - * @param ctx the parse tree - */ - exitInterfaceMemberList?: (ctx: InterfaceMemberListContext) => void; - /** * Enter a parse tree produced by `KipperParser.interfaceMemberDeclaration`. * @param ctx the parse tree @@ -759,26 +744,26 @@ export interface KipperParserListener extends ParseTreeListener { exitInterfaceMemberDeclaration?: (ctx: InterfaceMemberDeclarationContext) => void; /** - * Enter a parse tree produced by `KipperParser.propertySignature`. + * Enter a parse tree produced by `KipperParser.interfacePropertyDeclaration`. * @param ctx the parse tree */ - enterPropertySignature?: (ctx: PropertySignatureContext) => void; + enterInterfacePropertyDeclaration?: (ctx: InterfacePropertyDeclarationContext) => void; /** - * Exit a parse tree produced by `KipperParser.propertySignature`. + * Exit a parse tree produced by `KipperParser.interfacePropertyDeclaration`. * @param ctx the parse tree */ - exitPropertySignature?: (ctx: PropertySignatureContext) => void; + exitInterfacePropertyDeclaration?: (ctx: InterfacePropertyDeclarationContext) => void; /** - * Enter a parse tree produced by `KipperParser.methodSignature`. + * Enter a parse tree produced by `KipperParser.interfaceMethodDeclaration`. * @param ctx the parse tree */ - enterMethodSignature?: (ctx: MethodSignatureContext) => void; + enterInterfaceMethodDeclaration?: (ctx: InterfaceMethodDeclarationContext) => void; /** - * Exit a parse tree produced by `KipperParser.methodSignature`. + * Exit a parse tree produced by `KipperParser.interfaceMethodDeclaration`. * @param ctx the parse tree */ - exitMethodSignature?: (ctx: MethodSignatureContext) => void; + exitInterfaceMethodDeclaration?: (ctx: InterfaceMethodDeclarationContext) => void; /** * Enter a parse tree produced by `KipperParser.classDeclaration`. @@ -1462,4 +1447,3 @@ export interface KipperParserListener extends ParseTreeListener { */ exitTypeSpecifierIdentifier?: (ctx: TypeSpecifierIdentifierContext) => void; } - diff --git a/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts b/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts index d2914143a..fed6142f3 100644 --- a/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts +++ b/kipper/core/src/compiler/parser/antlr/KipperParserVisitor.ts @@ -1,11 +1,9 @@ // Generated from ./KipperParser.g4 by ANTLR 4.9.0-SNAPSHOT - - // Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax - // kind values. - import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; - import KipperParserBase from "./base/KipperParserBase"; - +// Import the required class for the ctx super class, as well as the 'ASTKind' type defining all possible syntax +// kind values. +import { KipperParserRuleContext, ParseRuleKindMapping, ASTKind } from ".."; +import KipperParserBase from "./base/KipperParserBase"; import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; @@ -58,10 +56,9 @@ import { FunctionDeclarationContext } from "./KipperParser"; import { ParameterListContext } from "./KipperParser"; import { ParameterDeclarationContext } from "./KipperParser"; import { InterfaceDeclarationContext } from "./KipperParser"; -import { InterfaceMemberListContext } from "./KipperParser"; import { InterfaceMemberDeclarationContext } from "./KipperParser"; -import { PropertySignatureContext } from "./KipperParser"; -import { MethodSignatureContext } from "./KipperParser"; +import { InterfacePropertyDeclarationContext } from "./KipperParser"; +import { InterfaceMethodDeclarationContext } from "./KipperParser"; import { ClassDeclarationContext } from "./KipperParser"; import { StatementContext } from "./KipperParser"; import { CompoundStatementContext } from "./KipperParser"; @@ -125,7 +122,6 @@ import { GenericTypeSpecifierExpressionContext } from "./KipperParser"; import { TypeofTypeSpecifierExpressionContext } from "./KipperParser"; import { TypeSpecifierIdentifierContext } from "./KipperParser"; - /** * This interface defines a complete generic visitor for a parse tree produced * by `KipperParser`. @@ -510,13 +506,6 @@ export interface KipperParserVisitor extends ParseTreeVisitor { */ visitInterfaceDeclaration?: (ctx: InterfaceDeclarationContext) => Result; - /** - * Visit a parse tree produced by `KipperParser.interface-member-list-declaration`. - * @param ctx the parse tree - * @return the visitor result - */ - visitInterfaceMemberList?: (ctx: InterfaceMemberListContext) => Result; - /** * Visit a parse tree produced by `KipperParser.interfaceMemberDeclaration`. * @param ctx the parse tree @@ -525,18 +514,18 @@ export interface KipperParserVisitor extends ParseTreeVisitor { visitInterfaceMemberDeclaration?: (ctx: InterfaceMemberDeclarationContext) => Result; /** - * Visit a parse tree produced by `KipperParser.propertySignature`. + * Visit a parse tree produced by `KipperParser.interfacePropertyDeclaration`. * @param ctx the parse tree * @return the visitor result */ - visitPropertySignature?: (ctx: PropertySignatureContext) => Result; + visitInterfacePropertyDeclaration?: (ctx: InterfacePropertyDeclarationContext) => Result; /** - * Visit a parse tree produced by `KipperParser.methodSignature`. + * Visit a parse tree produced by `KipperParser.interfaceMethodDeclaration`. * @param ctx the parse tree * @return the visitor result */ - visitMethodSignature?: (ctx: MethodSignatureContext) => Result; + visitInterfaceMethodDeclaration?: (ctx: InterfaceMethodDeclarationContext) => Result; /** * Visit a parse tree produced by `KipperParser.classDeclaration`. @@ -972,4 +961,3 @@ export interface KipperParserVisitor extends ParseTreeVisitor { */ visitTypeSpecifierIdentifier?: (ctx: TypeSpecifierIdentifierContext) => Result; } - diff --git a/kipper/core/src/compiler/parser/parse-rule-kind-mapping.ts b/kipper/core/src/compiler/parser/parse-rule-kind-mapping.ts index a0c9fd9d7..2c3c2439e 100644 --- a/kipper/core/src/compiler/parser/parse-rule-kind-mapping.ts +++ b/kipper/core/src/compiler/parser/parse-rule-kind-mapping.ts @@ -35,7 +35,8 @@ export const ParseRuleKindMapping = { RULE_parameterList: KipperParser.RULE_parameterList, RULE_parameterDeclaration: KipperParser.RULE_parameterDeclaration, RULE_interfaceDeclaration: KipperParser.RULE_interfaceDeclaration, - RULE_interfaceMemberList: KipperParser.RULE_interfaceMemberList, + 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, diff --git a/kipper/core/src/compiler/target-presets/semantic-analyser.ts b/kipper/core/src/compiler/target-presets/semantic-analyser.ts index 395dbe7f7..dc5eb44c6 100644 --- a/kipper/core/src/compiler/target-presets/semantic-analyser.ts +++ b/kipper/core/src/compiler/target-presets/semantic-analyser.ts @@ -54,6 +54,8 @@ import type { } from "../ast"; import { KipperSemanticErrorHandler } from "../analysis"; 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 type { InterfaceMethodDeclaration } from "../ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration"; /** * Represents a function that checks the semantics for a {@link AnalysableASTNode}. @@ -301,4 +303,14 @@ export abstract class KipperTargetSemanticAnalyser extends KipperSemanticErrorHa * Performs translation-specific semantic analysis for {@link AssignmentExpression} instances. */ public abstract assignmentExpression?: 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; } 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 a75b3aba1..648abf910 100644 --- a/kipper/core/src/compiler/target-presets/translation/code-generator.ts +++ b/kipper/core/src/compiler/target-presets/translation/code-generator.ts @@ -52,6 +52,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 @@ -192,6 +195,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. */ diff --git a/kipper/target-js/src/code-generator.ts b/kipper/target-js/src/code-generator.ts index 18f9e2e9c..8e8f8682d 100644 --- a/kipper/target-js/src/code-generator.ts +++ b/kipper/target-js/src/code-generator.ts @@ -51,6 +51,7 @@ import type { ForLoopIterationStatement, MemberAccessExpression, VoidOrNullOrUndefinedPrimaryExpression, + InterfacePropertyDeclaration, WhileLoopIterationStatement, ObjectPrimaryExpression, ObjectProperty, @@ -68,6 +69,7 @@ import { } from "@kipper/core"; import { createJSFunctionSignature, getJSFunctionSignature, indentLines, removeBraces } from "./tools"; import { TargetJS, version } from "./index"; +import type { InterfaceMethodDeclaration } from "@kipper/core/lib/compiler/ast/nodes/declarations/type-declaration/interface-declaration/interface-member-declaration/interface-method-declaration"; function removeBrackets(lines: Array) { return lines.slice(1, lines.length - 1); @@ -356,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}`]]; }; /** @@ -392,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. */ diff --git a/kipper/target-js/src/semantic-analyser.ts b/kipper/target-js/src/semantic-analyser.ts index 30c3e3655..3d59a78ee 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); }; diff --git a/kipper/target-ts/src/code-generator.ts b/kipper/target-ts/src/code-generator.ts index 49283d8ad..f3204ef08 100644 --- a/kipper/target-ts/src/code-generator.ts +++ b/kipper/target-ts/src/code-generator.ts @@ -2,11 +2,19 @@ * 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, + KipperCompilableType, + 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 +60,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]]; + }; } From e9ddb6d374328de14f88c31095d0056859e090dd Mon Sep 17 00:00:00 2001 From: Fabian Date: Thu, 11 Jul 2024 14:37:50 +0200 Subject: [PATCH 24/57] other: Added interface tests --- test/kipper-files/empty-interface.kip | 0 test/kipper-files/populated-interface.kip | 0 test/module/core/core-functionality.test.ts | 40 +++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 test/kipper-files/empty-interface.kip create mode 100644 test/kipper-files/populated-interface.kip 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..8de279bb8 100644 --- a/test/module/core/core-functionality.test.ts +++ b/test/module/core/core-functionality.test.ts @@ -1307,4 +1307,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)", + ); + }); + }); }); From 0490f5cb7a0952a9b1f66e351ec97a1bf55d6a1e Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Thu, 11 Jul 2024 14:43:34 +0200 Subject: [PATCH 25/57] minor (#524): Added empty static constructor methods to `CustomType` for future implementation --- kipper/core/src/compiler/ast/ast-node.ts | 4 +- .../semantics/types/base/processed-type.ts | 2 +- .../compiler/semantics/types/custom-type.ts | 84 ++++++++++++++++--- 3 files changed, 76 insertions(+), 14 deletions(-) diff --git a/kipper/core/src/compiler/ast/ast-node.ts b/kipper/core/src/compiler/ast/ast-node.ts index a3706ec7c..358be4438 100644 --- a/kipper/core/src/compiler/ast/ast-node.ts +++ b/kipper/core/src/compiler/ast/ast-node.ts @@ -15,13 +15,13 @@ import type { KipperParserRuleContext } from "../lexer-parser"; * {@link CompilableASTNode}. * @since 0.3.0 */ -export type SemanticData = Record; +export type SemanticData = { [key: string]: any }; /** * Type semantics for an expression class that must be evaluated during Type Checking. * @since 0.10.0 */ -export type TypeData = Record; +export type TypeData = { [key: string]: any }; /** * Empty semantics interface for hinting an AST node has *no* semantics. diff --git a/kipper/core/src/compiler/semantics/types/base/processed-type.ts b/kipper/core/src/compiler/semantics/types/base/processed-type.ts index ac8d54145..0b8ea29b3 100644 --- a/kipper/core/src/compiler/semantics/types/base/processed-type.ts +++ b/kipper/core/src/compiler/semantics/types/base/processed-type.ts @@ -51,7 +51,7 @@ export abstract class ProcessedType extends Type { * @param propertyName The name of the property that is being assigned. This is used for error messages. * @param argumentName The name of the argument that is being assigned to. This is used for error messages. * @throws TypeError If the types are not assignable. - * @since 0.11.0 + * @since 0.12.0 */ public abstract assertAssignableTo(type: ProcessedType, propertyName?: string, argumentName?: string): void; } diff --git a/kipper/core/src/compiler/semantics/types/custom-type.ts b/kipper/core/src/compiler/semantics/types/custom-type.ts index fd4324178..a7386d3f0 100644 --- a/kipper/core/src/compiler/semantics/types/custom-type.ts +++ b/kipper/core/src/compiler/semantics/types/custom-type.ts @@ -1,27 +1,32 @@ import { ProcessedType } from "./base"; -import type { TypeError } from "../../../errors"; +import {KipperInternalError, TypeError} from "../../../errors"; import { ArgumentAssignmentTypeError, AssignmentTypeError, PropertyAssignmentTypeError, PropertyNotFoundError, } from "../../../errors"; +import { + ClassDeclaration, + InterfaceDeclaration, + ObjectPrimaryExpression, +} from "../../ast"; /** * Represents the kind of a custom type. - * @since 0.11.0 + * @since 0.12.0 */ export type CustomTypeKind = "interface" | "class"; /** * Represents a field of a custom type. This is simply another type. - * @since 0.11.0 + * @since 0.12.0 */ export type CustomTypeField = ProcessedType; /** * Represents a map of field names to their types. - * @since 0.11.0 + * @since 0.12.0 */ export type CustomTypeFields = Map; @@ -29,17 +34,17 @@ export type CustomTypeFields = Map; * Represents a custom type which is not a built-in type. * * This type implements its own type constraints and can be used to represent complex type structures. - * @since 0.11.0 + * @since 0.12.0 */ export class CustomType extends ProcessedType { /** * The kind of this type. This is simply used to differentiate between classes and interfaces. - * @since 0.11.0 + * @since 0.12.0 */ public readonly kind: CustomTypeKind; private readonly _fields: CustomTypeFields; - public constructor(identifier: string, kind: CustomTypeKind, fields: CustomTypeFields) { + protected constructor(identifier: string, kind: CustomTypeKind, fields: CustomTypeFields) { super(identifier); this._fields = fields; this.kind = kind; @@ -50,7 +55,7 @@ export class CustomType extends ProcessedType { * * This runs through all fields and checks if they are compilable. As such this is an expensive operation and should * only be used once during type checking. - * @since 0.11.0 + * @since 0.12.0 */ public override get isCompilable(): boolean { return Object.values(this._fields).every((field) => field.isCompilable); @@ -58,12 +63,69 @@ export class CustomType extends ProcessedType { /** * The fields of this type. - * @since 0.11.0 + * @since 0.12.0 */ public get fields(): CustomTypeFields { return this._fields; } + /** + * Creates a custom type from a class declaration. + * + * This can only be run AFTER the class declaration has passed semantic validation. + * @param classDeclaration The class declaration to create the custom type from. + * @since 0.12.0 + */ + public static fromClassDeclaration(classDeclaration: ClassDeclaration): CustomType { + classDeclaration.ensureSemanticallyValid(); + throw new KipperInternalError("Internal class representations are not implemented."); + + // TODO! Implement custom type generation from class declaration + // const fields: CustomTypeFields = new Map(); + // for (const field of objectSemantics.fields) { + // fields.set(field.identifier, field.type); + // } + // return new CustomType(objectSemantics.identifier, "class", fields); + } + + /** + * Creates a custom type from an interface declaration. + * + * This can only be run AFTER the interface declaration has passed semantic validation. + * @param interfaceDeclaration The interface declaration to create the custom type from. + * @since 0.12.0 + */ + public static fromInterfaceDeclaration(interfaceDeclaration: InterfaceDeclaration): CustomType { + interfaceDeclaration.ensureSemanticallyValid(); + throw new KipperInternalError("Internal interface representations are not implemented."); + + // TODO! Implement custom type generation from interface declaration + // const fields: CustomTypeFields = new Map(); + // for (const field of interfaceSemantics.fields) { + // fields.set(field.identifier, field.type); + // } + // return new CustomType(interfaceSemantics.identifier, "interface", fields); + } + + /** + * Creates a custom type from an object literal. + * + * This can only be run AFTER the object primary expression has passed semantic validation. + * @param objectPrimaryExpression The object primary expression to create the custom type from. + * @since 0.12.0 + */ + public static fromObjectLiteral(objectPrimaryExpression: ObjectPrimaryExpression): CustomType { + objectPrimaryExpression.ensureSemanticallyValid(); + throw new KipperInternalError("Object literal custom types are not implemented."); + + // TODO! Implement custom type generation from object literal + // const fields: CustomTypeFields = new Map(); + // for (const field of objectLiteral.fields) { + // fields.set(field.identifier, field.type); + // } + // return new CustomType("object", "interface", fields); + } + /** * Checks whether this type is assignable to another type. * @@ -75,12 +137,12 @@ export class CustomType extends ProcessedType { * @throws PropertyAssignmentTypeError If a property is not assignable. * @throws ArgumentAssignmentTypeError If an argument is not assignable. * @throws PropertyNotFoundError If a property is not found. - * @since 0.11.0 + * @since 0.12.0 */ assertAssignableTo(type: ProcessedType, propertyName?: string, argumentName?: string): void { if (type === this) { return; - } else if (type instanceof CustomType) { + } else if (type instanceof CustomType && type.kind === "interface") { for (const [fieldName, fieldType] of this.fields) { const targetTypeField = type.fields.get(fieldName); if (!targetTypeField) { From 550b346196fd97facbc580cd6d39f2e8b650a82f Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Thu, 11 Jul 2024 15:13:21 +0200 Subject: [PATCH 26/57] other: Updated CHANGELOG.md --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01bc753be..8e96bf476 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,10 @@ To use development versions of Kipper download the ### Added -- Implemented internal representation for custom types such as objects, interfaces and classes. This change means that the entire core type system has been reworked and adjusted to also support custom types as well as complex types (objects, arrays etc.). This does not inheritely add functionality but serves as the stepping stone for the implementation of all custom types in the future. ([#524](https://github.com/Kipper-Lang/Kipper/issues/524)) +- Implemented internal representation for custom types such as objects, interfaces and classes. This change means that + the entire core type system has been reworked and adjusted to also support custom types as well as complex types + (objects, arrays etc.). This does not inheritely add functionality but serves as the stepping stone for the + implementation of all custom types in the future. ([#524](https://github.com/Kipper-Lang/Kipper/issues/524)) - New module: - `semantics/runtime-built-ins`, which contains runtime built-in functions, variables and types. - `semantics/runtime-internals`, which contains the runtime internal functions. From 1dd3500cc019569e784353f10bee2c8ee6e0238a Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Thu, 11 Jul 2024 15:14:23 +0200 Subject: [PATCH 27/57] other: Prettified code --- CHANGELOG.md | 16 ++++++++-------- .../src/compiler/semantics/types/custom-type.ts | 9 +++------ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e96bf476..dbdad7884 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,10 +18,10 @@ To use development versions of Kipper download the ### Added -- Implemented internal representation for custom types such as objects, interfaces and classes. This change means that - the entire core type system has been reworked and adjusted to also support custom types as well as complex types - (objects, arrays etc.). This does not inheritely add functionality but serves as the stepping stone for the - implementation of all custom types in the future. ([#524](https://github.com/Kipper-Lang/Kipper/issues/524)) +- Implemented internal representation for custom types such as objects, interfaces and classes. This change means that + the entire core type system has been reworked and adjusted to also support custom types as well as complex types + (objects, arrays etc.). This does not inheritely add functionality but serves as the stepping stone for the + implementation of all custom types in the future. ([#524](https://github.com/Kipper-Lang/Kipper/issues/524)) - New module: - `semantics/runtime-built-ins`, which contains runtime built-in functions, variables and types. - `semantics/runtime-internals`, which contains the runtime internal functions. @@ -33,7 +33,7 @@ To use development versions of Kipper download the - `CustomType`, which represents a user defined type. - `ScopeTypeDeclaration`, which represents a scope type declaration. - `UniverseTypeDeclaration`, which represents the universe, where all built-in types, functions and variables are - declared. This serves as the parent of the global scope. + declared. This serves as the parent of the global scope. - `CustomType`, which is a class extending from `ProcessedType` and implementing the functionality for a custom type such as a interface or class. - New errors: - `TypeCanNotBeUsedForTypeCheckingError`, which is thrown when a type is used for type checking, but is not a valid @@ -51,10 +51,10 @@ To use development versions of Kipper download the ### Changed - Changed type from interface to class: - - `InternalFunction`, which represents an internal function. - - `BuiltInFunction`, which represents a built-in function. + - `InternalFunction`, which represents an internal function. + - `BuiltInFunction`, which represents a built-in function. - `InternalFunctionArgument`, which represents an internal function argument. - - `BuiltInVariable`, which represents a built-in variable. + - `BuiltInVariable`, which represents a built-in variable. - Renamed: - Module `analysis` to `semantics`. - Class `UncheckedType` to `RawType`. diff --git a/kipper/core/src/compiler/semantics/types/custom-type.ts b/kipper/core/src/compiler/semantics/types/custom-type.ts index a7386d3f0..a843f899a 100644 --- a/kipper/core/src/compiler/semantics/types/custom-type.ts +++ b/kipper/core/src/compiler/semantics/types/custom-type.ts @@ -1,16 +1,13 @@ import { ProcessedType } from "./base"; -import {KipperInternalError, TypeError} from "../../../errors"; +import type { TypeError } from "../../../errors"; +import { KipperInternalError } from "../../../errors"; import { ArgumentAssignmentTypeError, AssignmentTypeError, PropertyAssignmentTypeError, PropertyNotFoundError, } from "../../../errors"; -import { - ClassDeclaration, - InterfaceDeclaration, - ObjectPrimaryExpression, -} from "../../ast"; +import type { ClassDeclaration, InterfaceDeclaration, ObjectPrimaryExpression } from "../../ast"; /** * Represents the kind of a custom type. From c2137775197bc7a254951caa51995ae6e152bcc8 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Fri, 12 Jul 2024 09:39:34 +0200 Subject: [PATCH 28/57] fix: Fixed errors caused by merge --- kipper/core/KipperParser.g4 | 4 +- kipper/core/src/compiler/ast/ast-generator.ts | 122 +++++++----------- .../core/src/compiler/ast/common/ast-types.ts | 4 +- .../compiler/ast/mapping/ast-node-mapper.ts | 8 +- .../lambda-expression/lambda-expression.ts | 16 +-- .../lexer-parser/antlr/KipperParser.interp | 4 +- .../lexer-parser/antlr/KipperParser.ts | 56 ++++---- .../antlr/KipperParserListener.ts | 10 +- .../lexer-parser/antlr/KipperParserVisitor.ts | 6 +- .../lexer-parser/parse-rule-kind-mapping.ts | 2 +- .../target-presets/semantic-analyser.ts | 2 +- .../translation/code-generator.ts | 2 +- kipper/target-js/src/code-generator.ts | 7 +- kipper/target-js/src/semantic-analyser.ts | 2 +- test/module/core/core-functionality.test.ts | 2 +- 15 files changed, 108 insertions(+), 139 deletions(-) diff --git a/kipper/core/KipperParser.g4 b/kipper/core/KipperParser.g4 index 9143863e4..44c61d930 100644 --- a/kipper/core/KipperParser.g4 +++ b/kipper/core/KipperParser.g4 @@ -177,6 +177,7 @@ returnStatement primaryExpression // Primary expressions, which build up the rest of the more complex expressions : tangledPrimaryExpression + | lambdaPrimaryExpression | arrayPrimaryExpression | objectPrimaryExpression | boolPrimaryExpression @@ -185,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 9f1dac5c8..ffdca57e9 100644 --- a/kipper/core/src/compiler/ast/ast-generator.ts +++ b/kipper/core/src/compiler/ast/ast-generator.ts @@ -59,7 +59,7 @@ import type { JumpStatementContext, KipperParserListener, KipperParserRuleContext, - LambdaExpressionContext, + LambdaPrimaryExpressionContext, LogicalAndExpressionContext, NumberPrimaryExpressionContext, ObjectPrimaryExpressionContext, @@ -100,36 +100,15 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi private readonly _statementFactory: StatementASTNodeFactory; 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 | undefined; - - /** - * The current expression that is being walked through. 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 _currentExpression: Expression | undefined; + 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(); @@ -178,15 +157,24 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi 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. If - * {@link _currentExpression} is defined, then that item will be returned, otherwise {@link _currentPrimaryNode}. + * Returns which token is being processed at the moment and where meta-data should be assigned to. * @private */ - private get getCurrentNode(): CompilableASTNode | RootASTNode { - if (this._currentExpression) { - return this._currentExpression; - } else if (this._currentPrimaryNode) { + private get currentNode(): CompilableASTNode | RootASTNode { + if (this._currentPrimaryNode) { return this._currentPrimaryNode; } else { return this.rootNode; @@ -204,67 +192,39 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi * @private */ private handleEnteringTreeNode(ctx: ASTNodeParserContext) { - if (this.statementFactory.ruleIds.find((id) => ctx.astSyntaxKind === id)) { - // Create statement instance using factory - this._currentPrimaryNode = this.statementFactory.create(ctx, this.getCurrentNode); - } else if (this.declarationFactory.ruleIds.find((id) => ctx.astSyntaxKind === id)) { - // Create declaration instance using factory - this._currentPrimaryNode = this.declarationFactory.create(ctx, this.getCurrentNode); - } else if (this.expressionFactory.ruleIds.find((id) => ctx.astSyntaxKind === id)) { + 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.getCurrentNode instanceof RootASTNode) { + 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.", + " definition.", ); } - - // Create expression instance using factory - this._currentExpression = this.expressionFactory.create(ctx, this.getCurrentNode); + 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.getCurrentNode.constructor.name}' for context '${ctx.astSyntaxKind}'` + - `(Loc: ${ctx.start.line}:${ctx.start.charPositionInLine})`, + `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. - * - * The handling algorithm for declaration/statement nodes as following: - * - If {@link _currentPrimaryNode.parent} is of type {@link Declaration} or {@link Statement}, then set - * {@link _currentPrimaryNode} to that parent. - * - Otherwise set {@link _currentPrimaryNode} to {@link undefined} again. If {@link handleExitingTreeNode} is called - * again, the {@link _currentPrimaryNode} will be defined again and the whole process starts over. - * - * The handling algorithm for expressions is: - * - If {@link _currentExpression.parent} is of type {@link Expression}, then set {@link _currentExpression} to - * that parent. - * - Otherwise set {@link _currentExpression} to {@link undefined} again. If {@link handleExitingTreeNode} is called - * again, the {@link _currentExpression} will be defined again and the whole process starts over. * @private */ private handleExitingTreeNode() { - if (this._currentExpression) { - // Ensure expressions stay separately handled from statements/declarations - const parent = this._currentExpression?.parent; - if (parent instanceof Expression) { - this._currentExpression = parent; - } else { - this._currentExpression = undefined; - } + const parent = this._currentPrimaryNode?.parent; + if (parent instanceof Declaration || parent instanceof Statement || parent instanceof Expression) { + this._currentPrimaryNode = parent; } else { - // Ensure that the parents of the declaration/statements are properly - // handled. Whether it is a child node or directly at the top of the file. - const parent = this._currentPrimaryNode?.parent; - if (parent instanceof Declaration || parent instanceof Statement) { - this._currentPrimaryNode = parent; - } else { - this._currentPrimaryNode = undefined; - } + this._currentPrimaryNode = undefined; } } @@ -288,17 +248,13 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi * Enter a parse tree produced by the `externalItem`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ - public enterExternalItem(ctx: ExternalItemContext): void { - this._isExternalItem = true; - } + 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 { - this._isExternalItem = false; - } + public exitExternalItem?: (ctx: ExternalItemContext) => void = undefined; // ------------------------------------------------------------------------------------------------------------------- // Expression section @@ -404,6 +360,18 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi */ 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}). diff --git a/kipper/core/src/compiler/ast/common/ast-types.ts b/kipper/core/src/compiler/ast/common/ast-types.ts index 7625dc90e..e2bb8c468 100644 --- a/kipper/core/src/compiler/ast/common/ast-types.ts +++ b/kipper/core/src/compiler/ast/common/ast-types.ts @@ -195,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; /** @@ -273,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 6b60a24bb..dadcd4ff3 100644 --- a/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts +++ b/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts @@ -37,7 +37,7 @@ import { InterfaceMethodDeclarationContext, InterfacePropertyDeclarationContext, JumpStatementContext, - LambdaExpressionContext, + LambdaPrimaryExpressionContext, LogicalAndExpressionContext, LogicalOrExpressionContext, MultiplicativeExpressionContext, @@ -178,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>; /** @@ -249,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, @@ -327,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/expressions/lambda-expression/lambda-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/lambda-expression.ts index afb301780..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,7 +36,7 @@ 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. @@ -49,14 +49,14 @@ export class LambdaExpression * 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,7 +94,7 @@ 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; } @@ -168,6 +168,6 @@ export class LambdaExpression public checkForWarnings = undefined; - readonly targetSemanticAnalysis = this.semanticAnalyser.lambdaExpression; - readonly targetCodeGenerator = this.codeGenerator.lambdaExpression; + readonly targetSemanticAnalysis = this.semanticAnalyser.lambdaPrimaryExpression; + readonly targetCodeGenerator = this.codeGenerator.lambdaPrimaryExpression; } diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.interp b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.interp index 043eb9f9b..05d344eaa 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.interp +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.interp @@ -211,7 +211,7 @@ doWhileLoopIterationStatement jumpStatement returnStatement primaryExpression -lambdaExpression +lambdaPrimaryExpression tangledPrimaryExpression boolPrimaryExpression identifierPrimaryExpression @@ -262,4 +262,4 @@ typeSpecifierIdentifier atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 88, 750, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 3, 2, 5, 2, 168, 10, 2, 3, 2, 3, 2, 3, 3, 6, 3, 173, 10, 3, 13, 3, 14, 3, 174, 3, 4, 3, 4, 3, 5, 6, 5, 180, 10, 5, 13, 5, 14, 5, 181, 3, 6, 3, 6, 3, 6, 5, 6, 187, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 195, 10, 7, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 207, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 219, 10, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 225, 10, 14, 3, 15, 3, 15, 3, 15, 7, 15, 230, 10, 15, 12, 15, 14, 15, 233, 11, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 243, 10, 17, 12, 17, 14, 17, 246, 11, 17, 3, 17, 3, 17, 3, 18, 3, 18, 5, 18, 252, 10, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 5, 20, 262, 10, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 280, 10, 22, 3, 23, 3, 23, 3, 23, 5, 23, 285, 10, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 5, 25, 296, 10, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 305, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 7, 27, 313, 10, 27, 12, 27, 14, 27, 316, 11, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 328, 10, 28, 3, 29, 3, 29, 3, 29, 5, 29, 333, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 339, 10, 30, 3, 30, 3, 30, 5, 30, 343, 10, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 349, 10, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 355, 10, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 5, 34, 379, 10, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 393, 10, 35, 3, 36, 3, 36, 5, 36, 397, 10, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 405, 10, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 5, 41, 419, 10, 41, 3, 42, 3, 42, 3, 43, 3, 43, 7, 43, 425, 10, 43, 12, 43, 14, 43, 428, 11, 43, 3, 43, 3, 43, 3, 43, 7, 43, 433, 10, 43, 12, 43, 14, 43, 436, 11, 43, 3, 43, 5, 43, 439, 10, 43, 3, 44, 3, 44, 3, 44, 5, 44, 444, 10, 44, 3, 44, 5, 44, 447, 10, 44, 3, 45, 3, 45, 3, 45, 5, 45, 452, 10, 45, 3, 45, 5, 45, 455, 10, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 7, 47, 463, 10, 47, 12, 47, 14, 47, 466, 11, 47, 5, 47, 468, 10, 47, 3, 47, 5, 47, 471, 10, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 7, 48, 479, 10, 48, 12, 48, 14, 48, 482, 11, 48, 5, 48, 484, 10, 48, 3, 48, 5, 48, 487, 10, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 503, 10, 51, 3, 51, 3, 51, 3, 51, 5, 51, 508, 10, 51, 3, 51, 3, 51, 3, 51, 5, 51, 513, 10, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 7, 51, 529, 10, 51, 12, 51, 14, 51, 532, 11, 51, 3, 52, 3, 52, 3, 52, 7, 52, 537, 10, 52, 12, 52, 14, 52, 540, 11, 52, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 553, 10, 55, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 559, 10, 55, 3, 55, 3, 55, 3, 56, 3, 56, 5, 56, 565, 10, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 5, 58, 573, 10, 58, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 5, 63, 590, 10, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 7, 64, 598, 10, 64, 12, 64, 14, 64, 601, 11, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 7, 65, 609, 10, 65, 12, 65, 14, 65, 612, 11, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 7, 66, 621, 10, 66, 12, 66, 14, 66, 624, 11, 66, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 7, 68, 634, 10, 68, 12, 68, 14, 68, 637, 11, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 7, 69, 645, 10, 69, 12, 69, 14, 69, 648, 11, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 7, 70, 656, 10, 70, 12, 70, 14, 70, 659, 11, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 7, 71, 667, 10, 71, 12, 71, 14, 71, 670, 11, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 7, 72, 678, 10, 72, 12, 72, 14, 72, 681, 11, 72, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 7, 73, 689, 10, 73, 12, 73, 14, 73, 692, 11, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 7, 74, 700, 10, 74, 12, 74, 14, 74, 703, 11, 74, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 5, 75, 712, 10, 75, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 5, 76, 719, 10, 76, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 7, 78, 726, 10, 78, 12, 78, 14, 78, 729, 11, 78, 3, 79, 3, 79, 3, 79, 5, 79, 734, 10, 79, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 2, 2, 13, 100, 126, 128, 130, 134, 136, 138, 140, 142, 144, 146, 84, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 70, 2, 72, 2, 74, 2, 76, 2, 78, 2, 80, 2, 82, 2, 84, 2, 86, 2, 88, 2, 90, 2, 92, 2, 94, 2, 96, 2, 98, 2, 100, 2, 102, 2, 104, 2, 106, 2, 108, 2, 110, 2, 112, 2, 114, 2, 116, 2, 118, 2, 120, 2, 122, 2, 124, 2, 126, 2, 128, 2, 130, 2, 132, 2, 134, 2, 136, 2, 138, 2, 140, 2, 142, 2, 144, 2, 146, 2, 148, 2, 150, 2, 152, 2, 154, 2, 156, 2, 158, 2, 160, 2, 162, 2, 164, 2, 2, 17, 3, 2, 7, 8, 3, 2, 14, 15, 3, 2, 28, 29, 3, 2, 78, 79, 4, 2, 77, 77, 80, 80, 3, 2, 31, 33, 4, 2, 46, 46, 48, 48, 6, 2, 45, 45, 47, 47, 55, 55, 71, 71, 3, 2, 49, 52, 4, 2, 45, 45, 47, 47, 3, 2, 72, 74, 3, 2, 64, 67, 3, 2, 62, 63, 3, 2, 56, 61, 4, 2, 31, 33, 76, 76, 2, 753, 2, 167, 3, 2, 2, 2, 4, 172, 3, 2, 2, 2, 6, 176, 3, 2, 2, 2, 8, 179, 3, 2, 2, 2, 10, 186, 3, 2, 2, 2, 12, 194, 3, 2, 2, 2, 14, 196, 3, 2, 2, 2, 16, 199, 3, 2, 2, 2, 18, 201, 3, 2, 2, 2, 20, 208, 3, 2, 2, 2, 22, 210, 3, 2, 2, 2, 24, 212, 3, 2, 2, 2, 26, 214, 3, 2, 2, 2, 28, 226, 3, 2, 2, 2, 30, 234, 3, 2, 2, 2, 32, 238, 3, 2, 2, 2, 34, 251, 3, 2, 2, 2, 36, 253, 3, 2, 2, 2, 38, 258, 3, 2, 2, 2, 40, 268, 3, 2, 2, 2, 42, 279, 3, 2, 2, 2, 44, 281, 3, 2, 2, 2, 46, 288, 3, 2, 2, 2, 48, 295, 3, 2, 2, 2, 50, 297, 3, 2, 2, 2, 52, 306, 3, 2, 2, 2, 54, 327, 3, 2, 2, 2, 56, 332, 3, 2, 2, 2, 58, 334, 3, 2, 2, 2, 60, 359, 3, 2, 2, 2, 62, 365, 3, 2, 2, 2, 64, 373, 3, 2, 2, 2, 66, 376, 3, 2, 2, 2, 68, 392, 3, 2, 2, 2, 70, 394, 3, 2, 2, 2, 72, 406, 3, 2, 2, 2, 74, 410, 3, 2, 2, 2, 76, 412, 3, 2, 2, 2, 78, 414, 3, 2, 2, 2, 80, 418, 3, 2, 2, 2, 82, 420, 3, 2, 2, 2, 84, 438, 3, 2, 2, 2, 86, 446, 3, 2, 2, 2, 88, 454, 3, 2, 2, 2, 90, 456, 3, 2, 2, 2, 92, 458, 3, 2, 2, 2, 94, 474, 3, 2, 2, 2, 96, 490, 3, 2, 2, 2, 98, 494, 3, 2, 2, 2, 100, 507, 3, 2, 2, 2, 102, 533, 3, 2, 2, 2, 104, 541, 3, 2, 2, 2, 106, 544, 3, 2, 2, 2, 108, 548, 3, 2, 2, 2, 110, 564, 3, 2, 2, 2, 112, 566, 3, 2, 2, 2, 114, 572, 3, 2, 2, 2, 116, 574, 3, 2, 2, 2, 118, 577, 3, 2, 2, 2, 120, 580, 3, 2, 2, 2, 122, 582, 3, 2, 2, 2, 124, 589, 3, 2, 2, 2, 126, 591, 3, 2, 2, 2, 128, 602, 3, 2, 2, 2, 130, 613, 3, 2, 2, 2, 132, 625, 3, 2, 2, 2, 134, 627, 3, 2, 2, 2, 136, 638, 3, 2, 2, 2, 138, 649, 3, 2, 2, 2, 140, 660, 3, 2, 2, 2, 142, 671, 3, 2, 2, 2, 144, 682, 3, 2, 2, 2, 146, 693, 3, 2, 2, 2, 148, 711, 3, 2, 2, 2, 150, 718, 3, 2, 2, 2, 152, 720, 3, 2, 2, 2, 154, 722, 3, 2, 2, 2, 156, 733, 3, 2, 2, 2, 158, 735, 3, 2, 2, 2, 160, 737, 3, 2, 2, 2, 162, 742, 3, 2, 2, 2, 164, 747, 3, 2, 2, 2, 166, 168, 5, 4, 3, 2, 167, 166, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 170, 7, 2, 2, 3, 170, 3, 3, 2, 2, 2, 171, 173, 5, 6, 4, 2, 172, 171, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 174, 172, 3, 2, 2, 2, 174, 175, 3, 2, 2, 2, 175, 5, 3, 2, 2, 2, 176, 177, 5, 8, 5, 2, 177, 7, 3, 2, 2, 2, 178, 180, 5, 10, 6, 2, 179, 178, 3, 2, 2, 2, 180, 181, 3, 2, 2, 2, 181, 179, 3, 2, 2, 2, 181, 182, 3, 2, 2, 2, 182, 9, 3, 2, 2, 2, 183, 187, 5, 42, 22, 2, 184, 187, 5, 12, 7, 2, 185, 187, 7, 35, 2, 2, 186, 183, 3, 2, 2, 2, 186, 184, 3, 2, 2, 2, 186, 185, 3, 2, 2, 2, 187, 11, 3, 2, 2, 2, 188, 189, 5, 14, 8, 2, 189, 190, 7, 35, 2, 2, 190, 195, 3, 2, 2, 2, 191, 195, 5, 26, 14, 2, 192, 195, 5, 32, 17, 2, 193, 195, 5, 40, 21, 2, 194, 188, 3, 2, 2, 2, 194, 191, 3, 2, 2, 2, 194, 192, 3, 2, 2, 2, 194, 193, 3, 2, 2, 2, 195, 13, 3, 2, 2, 2, 196, 197, 5, 16, 9, 2, 197, 198, 5, 18, 10, 2, 198, 15, 3, 2, 2, 2, 199, 200, 9, 2, 2, 2, 200, 17, 3, 2, 2, 2, 201, 202, 5, 22, 12, 2, 202, 203, 7, 37, 2, 2, 203, 206, 5, 156, 79, 2, 204, 205, 7, 56, 2, 2, 205, 207, 5, 20, 11, 2, 206, 204, 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 19, 3, 2, 2, 2, 208, 209, 5, 150, 76, 2, 209, 21, 3, 2, 2, 2, 210, 211, 5, 24, 13, 2, 211, 23, 3, 2, 2, 2, 212, 213, 7, 76, 2, 2, 213, 25, 3, 2, 2, 2, 214, 215, 7, 22, 2, 2, 215, 216, 5, 22, 12, 2, 216, 218, 7, 38, 2, 2, 217, 219, 5, 28, 15, 2, 218, 217, 3, 2, 2, 2, 218, 219, 3, 2, 2, 2, 219, 220, 3, 2, 2, 2, 220, 221, 7, 39, 2, 2, 221, 222, 7, 25, 2, 2, 222, 224, 5, 156, 79, 2, 223, 225, 5, 44, 23, 2, 224, 223, 3, 2, 2, 2, 224, 225, 3, 2, 2, 2, 225, 27, 3, 2, 2, 2, 226, 231, 5, 30, 16, 2, 227, 228, 7, 34, 2, 2, 228, 230, 5, 30, 16, 2, 229, 227, 3, 2, 2, 2, 230, 233, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 29, 3, 2, 2, 2, 233, 231, 3, 2, 2, 2, 234, 235, 5, 22, 12, 2, 235, 236, 7, 37, 2, 2, 236, 237, 5, 156, 79, 2, 237, 31, 3, 2, 2, 2, 238, 239, 7, 27, 2, 2, 239, 240, 5, 22, 12, 2, 240, 244, 7, 43, 2, 2, 241, 243, 5, 34, 18, 2, 242, 241, 3, 2, 2, 2, 243, 246, 3, 2, 2, 2, 244, 242, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 247, 3, 2, 2, 2, 246, 244, 3, 2, 2, 2, 247, 248, 7, 44, 2, 2, 248, 33, 3, 2, 2, 2, 249, 252, 5, 36, 19, 2, 250, 252, 5, 38, 20, 2, 251, 249, 3, 2, 2, 2, 251, 250, 3, 2, 2, 2, 252, 35, 3, 2, 2, 2, 253, 254, 5, 22, 12, 2, 254, 255, 7, 37, 2, 2, 255, 256, 5, 156, 79, 2, 256, 257, 7, 35, 2, 2, 257, 37, 3, 2, 2, 2, 258, 259, 5, 22, 12, 2, 259, 261, 7, 38, 2, 2, 260, 262, 5, 28, 15, 2, 261, 260, 3, 2, 2, 2, 261, 262, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 264, 7, 39, 2, 2, 264, 265, 7, 37, 2, 2, 265, 266, 5, 156, 79, 2, 266, 267, 7, 35, 2, 2, 267, 39, 3, 2, 2, 2, 268, 269, 7, 26, 2, 2, 269, 270, 5, 22, 12, 2, 270, 271, 7, 43, 2, 2, 271, 272, 7, 44, 2, 2, 272, 41, 3, 2, 2, 2, 273, 280, 5, 46, 24, 2, 274, 280, 5, 48, 25, 2, 275, 280, 5, 56, 29, 2, 276, 280, 5, 64, 33, 2, 277, 280, 5, 66, 34, 2, 278, 280, 5, 44, 23, 2, 279, 273, 3, 2, 2, 2, 279, 274, 3, 2, 2, 2, 279, 275, 3, 2, 2, 2, 279, 276, 3, 2, 2, 2, 279, 277, 3, 2, 2, 2, 279, 278, 3, 2, 2, 2, 280, 43, 3, 2, 2, 2, 281, 282, 6, 23, 2, 2, 282, 284, 7, 43, 2, 2, 283, 285, 5, 8, 5, 2, 284, 283, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 287, 7, 44, 2, 2, 287, 45, 3, 2, 2, 2, 288, 289, 8, 24, 1, 2, 289, 290, 5, 154, 78, 2, 290, 291, 7, 35, 2, 2, 291, 292, 8, 24, 1, 2, 292, 47, 3, 2, 2, 2, 293, 296, 5, 50, 26, 2, 294, 296, 5, 52, 27, 2, 295, 293, 3, 2, 2, 2, 295, 294, 3, 2, 2, 2, 296, 49, 3, 2, 2, 2, 297, 298, 7, 18, 2, 2, 298, 299, 7, 38, 2, 2, 299, 300, 5, 154, 78, 2, 300, 301, 7, 39, 2, 2, 301, 304, 5, 42, 22, 2, 302, 303, 7, 19, 2, 2, 303, 305, 5, 42, 22, 2, 304, 302, 3, 2, 2, 2, 304, 305, 3, 2, 2, 2, 305, 51, 3, 2, 2, 2, 306, 307, 7, 11, 2, 2, 307, 308, 7, 38, 2, 2, 308, 309, 5, 154, 78, 2, 309, 310, 7, 39, 2, 2, 310, 314, 7, 43, 2, 2, 311, 313, 5, 54, 28, 2, 312, 311, 3, 2, 2, 2, 313, 316, 3, 2, 2, 2, 314, 312, 3, 2, 2, 2, 314, 315, 3, 2, 2, 2, 315, 317, 3, 2, 2, 2, 316, 314, 3, 2, 2, 2, 317, 318, 7, 44, 2, 2, 318, 53, 3, 2, 2, 2, 319, 320, 7, 12, 2, 2, 320, 321, 5, 154, 78, 2, 321, 322, 7, 37, 2, 2, 322, 323, 5, 42, 22, 2, 323, 328, 3, 2, 2, 2, 324, 325, 7, 13, 2, 2, 325, 326, 7, 37, 2, 2, 326, 328, 5, 42, 22, 2, 327, 319, 3, 2, 2, 2, 327, 324, 3, 2, 2, 2, 328, 55, 3, 2, 2, 2, 329, 333, 5, 58, 30, 2, 330, 333, 5, 60, 31, 2, 331, 333, 5, 62, 32, 2, 332, 329, 3, 2, 2, 2, 332, 330, 3, 2, 2, 2, 332, 331, 3, 2, 2, 2, 333, 57, 3, 2, 2, 2, 334, 335, 7, 20, 2, 2, 335, 342, 7, 38, 2, 2, 336, 339, 5, 14, 8, 2, 337, 339, 5, 154, 78, 2, 338, 336, 3, 2, 2, 2, 338, 337, 3, 2, 2, 2, 339, 340, 3, 2, 2, 2, 340, 341, 8, 30, 1, 2, 341, 343, 3, 2, 2, 2, 342, 338, 3, 2, 2, 2, 342, 343, 3, 2, 2, 2, 343, 344, 3, 2, 2, 2, 344, 348, 7, 35, 2, 2, 345, 346, 5, 154, 78, 2, 346, 347, 8, 30, 1, 2, 347, 349, 3, 2, 2, 2, 348, 345, 3, 2, 2, 2, 348, 349, 3, 2, 2, 2, 349, 350, 3, 2, 2, 2, 350, 354, 7, 35, 2, 2, 351, 352, 5, 154, 78, 2, 352, 353, 8, 30, 1, 2, 353, 355, 3, 2, 2, 2, 354, 351, 3, 2, 2, 2, 354, 355, 3, 2, 2, 2, 355, 356, 3, 2, 2, 2, 356, 357, 7, 39, 2, 2, 357, 358, 5, 42, 22, 2, 358, 59, 3, 2, 2, 2, 359, 360, 7, 17, 2, 2, 360, 361, 7, 38, 2, 2, 361, 362, 5, 154, 78, 2, 362, 363, 7, 39, 2, 2, 363, 364, 5, 42, 22, 2, 364, 61, 3, 2, 2, 2, 365, 366, 7, 16, 2, 2, 366, 367, 5, 42, 22, 2, 367, 368, 7, 17, 2, 2, 368, 369, 7, 38, 2, 2, 369, 370, 5, 154, 78, 2, 370, 371, 7, 39, 2, 2, 371, 372, 7, 35, 2, 2, 372, 63, 3, 2, 2, 2, 373, 374, 9, 3, 2, 2, 374, 375, 7, 35, 2, 2, 375, 65, 3, 2, 2, 2, 376, 378, 7, 23, 2, 2, 377, 379, 5, 154, 78, 2, 378, 377, 3, 2, 2, 2, 378, 379, 3, 2, 2, 2, 379, 380, 3, 2, 2, 2, 380, 381, 7, 35, 2, 2, 381, 67, 3, 2, 2, 2, 382, 393, 5, 72, 37, 2, 383, 393, 5, 92, 47, 2, 384, 393, 5, 94, 48, 2, 385, 393, 5, 74, 38, 2, 386, 393, 5, 76, 39, 2, 387, 393, 5, 82, 42, 2, 388, 393, 5, 84, 43, 2, 389, 393, 5, 90, 46, 2, 390, 393, 5, 98, 50, 2, 391, 393, 5, 70, 36, 2, 392, 382, 3, 2, 2, 2, 392, 383, 3, 2, 2, 2, 392, 384, 3, 2, 2, 2, 392, 385, 3, 2, 2, 2, 392, 386, 3, 2, 2, 2, 392, 387, 3, 2, 2, 2, 392, 388, 3, 2, 2, 2, 392, 389, 3, 2, 2, 2, 392, 390, 3, 2, 2, 2, 392, 391, 3, 2, 2, 2, 393, 69, 3, 2, 2, 2, 394, 396, 7, 38, 2, 2, 395, 397, 5, 28, 15, 2, 396, 395, 3, 2, 2, 2, 396, 397, 3, 2, 2, 2, 397, 398, 3, 2, 2, 2, 398, 399, 7, 39, 2, 2, 399, 400, 7, 37, 2, 2, 400, 401, 5, 156, 79, 2, 401, 404, 7, 25, 2, 2, 402, 405, 5, 154, 78, 2, 403, 405, 5, 44, 23, 2, 404, 402, 3, 2, 2, 2, 404, 403, 3, 2, 2, 2, 405, 71, 3, 2, 2, 2, 406, 407, 7, 38, 2, 2, 407, 408, 5, 154, 78, 2, 408, 409, 7, 39, 2, 2, 409, 73, 3, 2, 2, 2, 410, 411, 9, 4, 2, 2, 411, 75, 3, 2, 2, 2, 412, 413, 5, 78, 40, 2, 413, 77, 3, 2, 2, 2, 414, 415, 7, 76, 2, 2, 415, 79, 3, 2, 2, 2, 416, 419, 5, 78, 40, 2, 417, 419, 5, 82, 42, 2, 418, 416, 3, 2, 2, 2, 418, 417, 3, 2, 2, 2, 419, 81, 3, 2, 2, 2, 420, 421, 9, 5, 2, 2, 421, 83, 3, 2, 2, 2, 422, 426, 7, 83, 2, 2, 423, 425, 5, 86, 44, 2, 424, 423, 3, 2, 2, 2, 425, 428, 3, 2, 2, 2, 426, 424, 3, 2, 2, 2, 426, 427, 3, 2, 2, 2, 427, 429, 3, 2, 2, 2, 428, 426, 3, 2, 2, 2, 429, 439, 7, 85, 2, 2, 430, 434, 7, 84, 2, 2, 431, 433, 5, 88, 45, 2, 432, 431, 3, 2, 2, 2, 433, 436, 3, 2, 2, 2, 434, 432, 3, 2, 2, 2, 434, 435, 3, 2, 2, 2, 435, 437, 3, 2, 2, 2, 436, 434, 3, 2, 2, 2, 437, 439, 7, 87, 2, 2, 438, 422, 3, 2, 2, 2, 438, 430, 3, 2, 2, 2, 439, 85, 3, 2, 2, 2, 440, 447, 7, 86, 2, 2, 441, 443, 7, 3, 2, 2, 442, 444, 5, 154, 78, 2, 443, 442, 3, 2, 2, 2, 443, 444, 3, 2, 2, 2, 444, 445, 3, 2, 2, 2, 445, 447, 7, 42, 2, 2, 446, 440, 3, 2, 2, 2, 446, 441, 3, 2, 2, 2, 447, 87, 3, 2, 2, 2, 448, 455, 7, 88, 2, 2, 449, 451, 7, 3, 2, 2, 450, 452, 5, 154, 78, 2, 451, 450, 3, 2, 2, 2, 451, 452, 3, 2, 2, 2, 452, 453, 3, 2, 2, 2, 453, 455, 7, 42, 2, 2, 454, 448, 3, 2, 2, 2, 454, 449, 3, 2, 2, 2, 455, 89, 3, 2, 2, 2, 456, 457, 9, 6, 2, 2, 457, 91, 3, 2, 2, 2, 458, 467, 7, 40, 2, 2, 459, 464, 5, 154, 78, 2, 460, 461, 7, 34, 2, 2, 461, 463, 5, 154, 78, 2, 462, 460, 3, 2, 2, 2, 463, 466, 3, 2, 2, 2, 464, 462, 3, 2, 2, 2, 464, 465, 3, 2, 2, 2, 465, 468, 3, 2, 2, 2, 466, 464, 3, 2, 2, 2, 467, 459, 3, 2, 2, 2, 467, 468, 3, 2, 2, 2, 468, 470, 3, 2, 2, 2, 469, 471, 7, 34, 2, 2, 470, 469, 3, 2, 2, 2, 470, 471, 3, 2, 2, 2, 471, 472, 3, 2, 2, 2, 472, 473, 7, 41, 2, 2, 473, 93, 3, 2, 2, 2, 474, 483, 7, 43, 2, 2, 475, 480, 5, 96, 49, 2, 476, 477, 7, 34, 2, 2, 477, 479, 5, 96, 49, 2, 478, 476, 3, 2, 2, 2, 479, 482, 3, 2, 2, 2, 480, 478, 3, 2, 2, 2, 480, 481, 3, 2, 2, 2, 481, 484, 3, 2, 2, 2, 482, 480, 3, 2, 2, 2, 483, 475, 3, 2, 2, 2, 483, 484, 3, 2, 2, 2, 484, 486, 3, 2, 2, 2, 485, 487, 7, 34, 2, 2, 486, 485, 3, 2, 2, 2, 486, 487, 3, 2, 2, 2, 487, 488, 3, 2, 2, 2, 488, 489, 7, 44, 2, 2, 489, 95, 3, 2, 2, 2, 490, 491, 5, 80, 41, 2, 491, 492, 7, 37, 2, 2, 492, 493, 5, 154, 78, 2, 493, 97, 3, 2, 2, 2, 494, 495, 9, 7, 2, 2, 495, 99, 3, 2, 2, 2, 496, 497, 8, 51, 1, 2, 497, 508, 5, 68, 35, 2, 498, 499, 7, 24, 2, 2, 499, 500, 5, 100, 51, 2, 500, 502, 7, 38, 2, 2, 501, 503, 5, 102, 52, 2, 502, 501, 3, 2, 2, 2, 502, 503, 3, 2, 2, 2, 503, 504, 3, 2, 2, 2, 504, 505, 7, 39, 2, 2, 505, 506, 8, 51, 1, 2, 506, 508, 3, 2, 2, 2, 507, 496, 3, 2, 2, 2, 507, 498, 3, 2, 2, 2, 508, 530, 3, 2, 2, 2, 509, 510, 12, 7, 2, 2, 510, 512, 7, 38, 2, 2, 511, 513, 5, 102, 52, 2, 512, 511, 3, 2, 2, 2, 512, 513, 3, 2, 2, 2, 513, 514, 3, 2, 2, 2, 514, 515, 7, 39, 2, 2, 515, 529, 8, 51, 1, 2, 516, 517, 12, 5, 2, 2, 517, 518, 5, 104, 53, 2, 518, 519, 8, 51, 1, 2, 519, 529, 3, 2, 2, 2, 520, 521, 12, 4, 2, 2, 521, 522, 5, 106, 54, 2, 522, 523, 8, 51, 1, 2, 523, 529, 3, 2, 2, 2, 524, 525, 12, 3, 2, 2, 525, 526, 5, 108, 55, 2, 526, 527, 8, 51, 1, 2, 527, 529, 3, 2, 2, 2, 528, 509, 3, 2, 2, 2, 528, 516, 3, 2, 2, 2, 528, 520, 3, 2, 2, 2, 528, 524, 3, 2, 2, 2, 529, 532, 3, 2, 2, 2, 530, 528, 3, 2, 2, 2, 530, 531, 3, 2, 2, 2, 531, 101, 3, 2, 2, 2, 532, 530, 3, 2, 2, 2, 533, 538, 5, 150, 76, 2, 534, 535, 7, 34, 2, 2, 535, 537, 5, 150, 76, 2, 536, 534, 3, 2, 2, 2, 537, 540, 3, 2, 2, 2, 538, 536, 3, 2, 2, 2, 538, 539, 3, 2, 2, 2, 539, 103, 3, 2, 2, 2, 540, 538, 3, 2, 2, 2, 541, 542, 7, 75, 2, 2, 542, 543, 5, 78, 40, 2, 543, 105, 3, 2, 2, 2, 544, 545, 7, 40, 2, 2, 545, 546, 5, 154, 78, 2, 546, 547, 7, 41, 2, 2, 547, 107, 3, 2, 2, 2, 548, 552, 7, 40, 2, 2, 549, 550, 5, 154, 78, 2, 550, 551, 8, 55, 1, 2, 551, 553, 3, 2, 2, 2, 552, 549, 3, 2, 2, 2, 552, 553, 3, 2, 2, 2, 553, 554, 3, 2, 2, 2, 554, 558, 7, 37, 2, 2, 555, 556, 5, 154, 78, 2, 556, 557, 8, 55, 1, 2, 557, 559, 3, 2, 2, 2, 558, 555, 3, 2, 2, 2, 558, 559, 3, 2, 2, 2, 559, 560, 3, 2, 2, 2, 560, 561, 7, 41, 2, 2, 561, 109, 3, 2, 2, 2, 562, 565, 5, 100, 51, 2, 563, 565, 5, 112, 57, 2, 564, 562, 3, 2, 2, 2, 564, 563, 3, 2, 2, 2, 565, 111, 3, 2, 2, 2, 566, 567, 5, 100, 51, 2, 567, 568, 5, 120, 61, 2, 568, 113, 3, 2, 2, 2, 569, 573, 5, 110, 56, 2, 570, 573, 5, 116, 59, 2, 571, 573, 5, 118, 60, 2, 572, 569, 3, 2, 2, 2, 572, 570, 3, 2, 2, 2, 572, 571, 3, 2, 2, 2, 573, 115, 3, 2, 2, 2, 574, 575, 5, 120, 61, 2, 575, 576, 5, 110, 56, 2, 576, 117, 3, 2, 2, 2, 577, 578, 5, 122, 62, 2, 578, 579, 5, 110, 56, 2, 579, 119, 3, 2, 2, 2, 580, 581, 9, 8, 2, 2, 581, 121, 3, 2, 2, 2, 582, 583, 9, 9, 2, 2, 583, 123, 3, 2, 2, 2, 584, 590, 5, 114, 58, 2, 585, 586, 5, 114, 58, 2, 586, 587, 7, 9, 2, 2, 587, 588, 5, 156, 79, 2, 588, 590, 3, 2, 2, 2, 589, 584, 3, 2, 2, 2, 589, 585, 3, 2, 2, 2, 590, 125, 3, 2, 2, 2, 591, 592, 8, 64, 1, 2, 592, 593, 5, 124, 63, 2, 593, 599, 3, 2, 2, 2, 594, 595, 12, 3, 2, 2, 595, 596, 9, 10, 2, 2, 596, 598, 5, 124, 63, 2, 597, 594, 3, 2, 2, 2, 598, 601, 3, 2, 2, 2, 599, 597, 3, 2, 2, 2, 599, 600, 3, 2, 2, 2, 600, 127, 3, 2, 2, 2, 601, 599, 3, 2, 2, 2, 602, 603, 8, 65, 1, 2, 603, 604, 5, 126, 64, 2, 604, 610, 3, 2, 2, 2, 605, 606, 12, 3, 2, 2, 606, 607, 9, 11, 2, 2, 607, 609, 5, 126, 64, 2, 608, 605, 3, 2, 2, 2, 609, 612, 3, 2, 2, 2, 610, 608, 3, 2, 2, 2, 610, 611, 3, 2, 2, 2, 611, 129, 3, 2, 2, 2, 612, 610, 3, 2, 2, 2, 613, 614, 8, 66, 1, 2, 614, 615, 5, 128, 65, 2, 615, 622, 3, 2, 2, 2, 616, 617, 12, 3, 2, 2, 617, 618, 5, 132, 67, 2, 618, 619, 5, 138, 70, 2, 619, 621, 3, 2, 2, 2, 620, 616, 3, 2, 2, 2, 621, 624, 3, 2, 2, 2, 622, 620, 3, 2, 2, 2, 622, 623, 3, 2, 2, 2, 623, 131, 3, 2, 2, 2, 624, 622, 3, 2, 2, 2, 625, 626, 9, 12, 2, 2, 626, 133, 3, 2, 2, 2, 627, 628, 8, 68, 1, 2, 628, 629, 5, 130, 66, 2, 629, 635, 3, 2, 2, 2, 630, 631, 12, 3, 2, 2, 631, 632, 9, 13, 2, 2, 632, 634, 5, 130, 66, 2, 633, 630, 3, 2, 2, 2, 634, 637, 3, 2, 2, 2, 635, 633, 3, 2, 2, 2, 635, 636, 3, 2, 2, 2, 636, 135, 3, 2, 2, 2, 637, 635, 3, 2, 2, 2, 638, 639, 8, 69, 1, 2, 639, 640, 5, 134, 68, 2, 640, 646, 3, 2, 2, 2, 641, 642, 12, 3, 2, 2, 642, 643, 9, 14, 2, 2, 643, 645, 5, 134, 68, 2, 644, 641, 3, 2, 2, 2, 645, 648, 3, 2, 2, 2, 646, 644, 3, 2, 2, 2, 646, 647, 3, 2, 2, 2, 647, 137, 3, 2, 2, 2, 648, 646, 3, 2, 2, 2, 649, 650, 8, 70, 1, 2, 650, 651, 5, 136, 69, 2, 651, 657, 3, 2, 2, 2, 652, 653, 12, 3, 2, 2, 653, 654, 7, 68, 2, 2, 654, 656, 5, 136, 69, 2, 655, 652, 3, 2, 2, 2, 656, 659, 3, 2, 2, 2, 657, 655, 3, 2, 2, 2, 657, 658, 3, 2, 2, 2, 658, 139, 3, 2, 2, 2, 659, 657, 3, 2, 2, 2, 660, 661, 8, 71, 1, 2, 661, 662, 5, 138, 70, 2, 662, 668, 3, 2, 2, 2, 663, 664, 12, 3, 2, 2, 664, 665, 7, 70, 2, 2, 665, 667, 5, 138, 70, 2, 666, 663, 3, 2, 2, 2, 667, 670, 3, 2, 2, 2, 668, 666, 3, 2, 2, 2, 668, 669, 3, 2, 2, 2, 669, 141, 3, 2, 2, 2, 670, 668, 3, 2, 2, 2, 671, 672, 8, 72, 1, 2, 672, 673, 5, 140, 71, 2, 673, 679, 3, 2, 2, 2, 674, 675, 12, 3, 2, 2, 675, 676, 7, 69, 2, 2, 676, 678, 5, 140, 71, 2, 677, 674, 3, 2, 2, 2, 678, 681, 3, 2, 2, 2, 679, 677, 3, 2, 2, 2, 679, 680, 3, 2, 2, 2, 680, 143, 3, 2, 2, 2, 681, 679, 3, 2, 2, 2, 682, 683, 8, 73, 1, 2, 683, 684, 5, 142, 72, 2, 684, 690, 3, 2, 2, 2, 685, 686, 12, 3, 2, 2, 686, 687, 7, 53, 2, 2, 687, 689, 5, 142, 72, 2, 688, 685, 3, 2, 2, 2, 689, 692, 3, 2, 2, 2, 690, 688, 3, 2, 2, 2, 690, 691, 3, 2, 2, 2, 691, 145, 3, 2, 2, 2, 692, 690, 3, 2, 2, 2, 693, 694, 8, 74, 1, 2, 694, 695, 5, 144, 73, 2, 695, 701, 3, 2, 2, 2, 696, 697, 12, 3, 2, 2, 697, 698, 7, 54, 2, 2, 698, 700, 5, 144, 73, 2, 699, 696, 3, 2, 2, 2, 700, 703, 3, 2, 2, 2, 701, 699, 3, 2, 2, 2, 701, 702, 3, 2, 2, 2, 702, 147, 3, 2, 2, 2, 703, 701, 3, 2, 2, 2, 704, 712, 5, 146, 74, 2, 705, 706, 5, 146, 74, 2, 706, 707, 7, 36, 2, 2, 707, 708, 5, 148, 75, 2, 708, 709, 7, 37, 2, 2, 709, 710, 5, 148, 75, 2, 710, 712, 3, 2, 2, 2, 711, 704, 3, 2, 2, 2, 711, 705, 3, 2, 2, 2, 712, 149, 3, 2, 2, 2, 713, 719, 5, 148, 75, 2, 714, 715, 5, 100, 51, 2, 715, 716, 5, 152, 77, 2, 716, 717, 5, 150, 76, 2, 717, 719, 3, 2, 2, 2, 718, 713, 3, 2, 2, 2, 718, 714, 3, 2, 2, 2, 719, 151, 3, 2, 2, 2, 720, 721, 9, 15, 2, 2, 721, 153, 3, 2, 2, 2, 722, 727, 5, 150, 76, 2, 723, 724, 7, 34, 2, 2, 724, 726, 5, 150, 76, 2, 725, 723, 3, 2, 2, 2, 726, 729, 3, 2, 2, 2, 727, 725, 3, 2, 2, 2, 727, 728, 3, 2, 2, 2, 728, 155, 3, 2, 2, 2, 729, 727, 3, 2, 2, 2, 730, 734, 5, 158, 80, 2, 731, 734, 5, 160, 81, 2, 732, 734, 5, 162, 82, 2, 733, 730, 3, 2, 2, 2, 733, 731, 3, 2, 2, 2, 733, 732, 3, 2, 2, 2, 734, 157, 3, 2, 2, 2, 735, 736, 5, 164, 83, 2, 736, 159, 3, 2, 2, 2, 737, 738, 5, 164, 83, 2, 738, 739, 7, 64, 2, 2, 739, 740, 5, 164, 83, 2, 740, 741, 7, 66, 2, 2, 741, 161, 3, 2, 2, 2, 742, 743, 7, 30, 2, 2, 743, 744, 7, 38, 2, 2, 744, 745, 5, 164, 83, 2, 745, 746, 7, 39, 2, 2, 746, 163, 3, 2, 2, 2, 747, 748, 9, 16, 2, 2, 748, 165, 3, 2, 2, 2, 68, 167, 174, 181, 186, 194, 206, 218, 224, 231, 244, 251, 261, 279, 284, 295, 304, 314, 327, 332, 338, 342, 348, 354, 378, 392, 396, 404, 418, 426, 434, 438, 443, 446, 451, 454, 464, 467, 470, 480, 483, 486, 502, 507, 512, 528, 530, 538, 552, 558, 564, 572, 589, 599, 610, 622, 635, 646, 657, 668, 679, 690, 701, 711, 718, 727, 733] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 88, 750, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 3, 2, 5, 2, 168, 10, 2, 3, 2, 3, 2, 3, 3, 6, 3, 173, 10, 3, 13, 3, 14, 3, 174, 3, 4, 3, 4, 3, 5, 6, 5, 180, 10, 5, 13, 5, 14, 5, 181, 3, 6, 3, 6, 3, 6, 5, 6, 187, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 195, 10, 7, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 207, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 219, 10, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 225, 10, 14, 3, 15, 3, 15, 3, 15, 7, 15, 230, 10, 15, 12, 15, 14, 15, 233, 11, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 243, 10, 17, 12, 17, 14, 17, 246, 11, 17, 3, 17, 3, 17, 3, 18, 3, 18, 5, 18, 252, 10, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 5, 20, 262, 10, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 280, 10, 22, 3, 23, 3, 23, 3, 23, 5, 23, 285, 10, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 5, 25, 296, 10, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 305, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 7, 27, 313, 10, 27, 12, 27, 14, 27, 316, 11, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 328, 10, 28, 3, 29, 3, 29, 3, 29, 5, 29, 333, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 339, 10, 30, 3, 30, 3, 30, 5, 30, 343, 10, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 349, 10, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 355, 10, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 5, 34, 379, 10, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 393, 10, 35, 3, 36, 3, 36, 5, 36, 397, 10, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 405, 10, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 5, 41, 419, 10, 41, 3, 42, 3, 42, 3, 43, 3, 43, 7, 43, 425, 10, 43, 12, 43, 14, 43, 428, 11, 43, 3, 43, 3, 43, 3, 43, 7, 43, 433, 10, 43, 12, 43, 14, 43, 436, 11, 43, 3, 43, 5, 43, 439, 10, 43, 3, 44, 3, 44, 3, 44, 5, 44, 444, 10, 44, 3, 44, 5, 44, 447, 10, 44, 3, 45, 3, 45, 3, 45, 5, 45, 452, 10, 45, 3, 45, 5, 45, 455, 10, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 7, 47, 463, 10, 47, 12, 47, 14, 47, 466, 11, 47, 5, 47, 468, 10, 47, 3, 47, 5, 47, 471, 10, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 7, 48, 479, 10, 48, 12, 48, 14, 48, 482, 11, 48, 5, 48, 484, 10, 48, 3, 48, 5, 48, 487, 10, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 503, 10, 51, 3, 51, 3, 51, 3, 51, 5, 51, 508, 10, 51, 3, 51, 3, 51, 3, 51, 5, 51, 513, 10, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 7, 51, 529, 10, 51, 12, 51, 14, 51, 532, 11, 51, 3, 52, 3, 52, 3, 52, 7, 52, 537, 10, 52, 12, 52, 14, 52, 540, 11, 52, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 553, 10, 55, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 559, 10, 55, 3, 55, 3, 55, 3, 56, 3, 56, 5, 56, 565, 10, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 5, 58, 573, 10, 58, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 5, 63, 590, 10, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 7, 64, 598, 10, 64, 12, 64, 14, 64, 601, 11, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 7, 65, 609, 10, 65, 12, 65, 14, 65, 612, 11, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 7, 66, 621, 10, 66, 12, 66, 14, 66, 624, 11, 66, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 7, 68, 634, 10, 68, 12, 68, 14, 68, 637, 11, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 7, 69, 645, 10, 69, 12, 69, 14, 69, 648, 11, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 7, 70, 656, 10, 70, 12, 70, 14, 70, 659, 11, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 7, 71, 667, 10, 71, 12, 71, 14, 71, 670, 11, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 7, 72, 678, 10, 72, 12, 72, 14, 72, 681, 11, 72, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 7, 73, 689, 10, 73, 12, 73, 14, 73, 692, 11, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 7, 74, 700, 10, 74, 12, 74, 14, 74, 703, 11, 74, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 5, 75, 712, 10, 75, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 5, 76, 719, 10, 76, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 7, 78, 726, 10, 78, 12, 78, 14, 78, 729, 11, 78, 3, 79, 3, 79, 3, 79, 5, 79, 734, 10, 79, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 2, 2, 13, 100, 126, 128, 130, 134, 136, 138, 140, 142, 144, 146, 84, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 70, 2, 72, 2, 74, 2, 76, 2, 78, 2, 80, 2, 82, 2, 84, 2, 86, 2, 88, 2, 90, 2, 92, 2, 94, 2, 96, 2, 98, 2, 100, 2, 102, 2, 104, 2, 106, 2, 108, 2, 110, 2, 112, 2, 114, 2, 116, 2, 118, 2, 120, 2, 122, 2, 124, 2, 126, 2, 128, 2, 130, 2, 132, 2, 134, 2, 136, 2, 138, 2, 140, 2, 142, 2, 144, 2, 146, 2, 148, 2, 150, 2, 152, 2, 154, 2, 156, 2, 158, 2, 160, 2, 162, 2, 164, 2, 2, 17, 3, 2, 7, 8, 3, 2, 14, 15, 3, 2, 28, 29, 3, 2, 78, 79, 4, 2, 77, 77, 80, 80, 3, 2, 31, 33, 4, 2, 46, 46, 48, 48, 6, 2, 45, 45, 47, 47, 55, 55, 71, 71, 3, 2, 49, 52, 4, 2, 45, 45, 47, 47, 3, 2, 72, 74, 3, 2, 64, 67, 3, 2, 62, 63, 3, 2, 56, 61, 4, 2, 31, 33, 76, 76, 2, 753, 2, 167, 3, 2, 2, 2, 4, 172, 3, 2, 2, 2, 6, 176, 3, 2, 2, 2, 8, 179, 3, 2, 2, 2, 10, 186, 3, 2, 2, 2, 12, 194, 3, 2, 2, 2, 14, 196, 3, 2, 2, 2, 16, 199, 3, 2, 2, 2, 18, 201, 3, 2, 2, 2, 20, 208, 3, 2, 2, 2, 22, 210, 3, 2, 2, 2, 24, 212, 3, 2, 2, 2, 26, 214, 3, 2, 2, 2, 28, 226, 3, 2, 2, 2, 30, 234, 3, 2, 2, 2, 32, 238, 3, 2, 2, 2, 34, 251, 3, 2, 2, 2, 36, 253, 3, 2, 2, 2, 38, 258, 3, 2, 2, 2, 40, 268, 3, 2, 2, 2, 42, 279, 3, 2, 2, 2, 44, 281, 3, 2, 2, 2, 46, 288, 3, 2, 2, 2, 48, 295, 3, 2, 2, 2, 50, 297, 3, 2, 2, 2, 52, 306, 3, 2, 2, 2, 54, 327, 3, 2, 2, 2, 56, 332, 3, 2, 2, 2, 58, 334, 3, 2, 2, 2, 60, 359, 3, 2, 2, 2, 62, 365, 3, 2, 2, 2, 64, 373, 3, 2, 2, 2, 66, 376, 3, 2, 2, 2, 68, 392, 3, 2, 2, 2, 70, 394, 3, 2, 2, 2, 72, 406, 3, 2, 2, 2, 74, 410, 3, 2, 2, 2, 76, 412, 3, 2, 2, 2, 78, 414, 3, 2, 2, 2, 80, 418, 3, 2, 2, 2, 82, 420, 3, 2, 2, 2, 84, 438, 3, 2, 2, 2, 86, 446, 3, 2, 2, 2, 88, 454, 3, 2, 2, 2, 90, 456, 3, 2, 2, 2, 92, 458, 3, 2, 2, 2, 94, 474, 3, 2, 2, 2, 96, 490, 3, 2, 2, 2, 98, 494, 3, 2, 2, 2, 100, 507, 3, 2, 2, 2, 102, 533, 3, 2, 2, 2, 104, 541, 3, 2, 2, 2, 106, 544, 3, 2, 2, 2, 108, 548, 3, 2, 2, 2, 110, 564, 3, 2, 2, 2, 112, 566, 3, 2, 2, 2, 114, 572, 3, 2, 2, 2, 116, 574, 3, 2, 2, 2, 118, 577, 3, 2, 2, 2, 120, 580, 3, 2, 2, 2, 122, 582, 3, 2, 2, 2, 124, 589, 3, 2, 2, 2, 126, 591, 3, 2, 2, 2, 128, 602, 3, 2, 2, 2, 130, 613, 3, 2, 2, 2, 132, 625, 3, 2, 2, 2, 134, 627, 3, 2, 2, 2, 136, 638, 3, 2, 2, 2, 138, 649, 3, 2, 2, 2, 140, 660, 3, 2, 2, 2, 142, 671, 3, 2, 2, 2, 144, 682, 3, 2, 2, 2, 146, 693, 3, 2, 2, 2, 148, 711, 3, 2, 2, 2, 150, 718, 3, 2, 2, 2, 152, 720, 3, 2, 2, 2, 154, 722, 3, 2, 2, 2, 156, 733, 3, 2, 2, 2, 158, 735, 3, 2, 2, 2, 160, 737, 3, 2, 2, 2, 162, 742, 3, 2, 2, 2, 164, 747, 3, 2, 2, 2, 166, 168, 5, 4, 3, 2, 167, 166, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 170, 7, 2, 2, 3, 170, 3, 3, 2, 2, 2, 171, 173, 5, 6, 4, 2, 172, 171, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 174, 172, 3, 2, 2, 2, 174, 175, 3, 2, 2, 2, 175, 5, 3, 2, 2, 2, 176, 177, 5, 8, 5, 2, 177, 7, 3, 2, 2, 2, 178, 180, 5, 10, 6, 2, 179, 178, 3, 2, 2, 2, 180, 181, 3, 2, 2, 2, 181, 179, 3, 2, 2, 2, 181, 182, 3, 2, 2, 2, 182, 9, 3, 2, 2, 2, 183, 187, 5, 42, 22, 2, 184, 187, 5, 12, 7, 2, 185, 187, 7, 35, 2, 2, 186, 183, 3, 2, 2, 2, 186, 184, 3, 2, 2, 2, 186, 185, 3, 2, 2, 2, 187, 11, 3, 2, 2, 2, 188, 189, 5, 14, 8, 2, 189, 190, 7, 35, 2, 2, 190, 195, 3, 2, 2, 2, 191, 195, 5, 26, 14, 2, 192, 195, 5, 32, 17, 2, 193, 195, 5, 40, 21, 2, 194, 188, 3, 2, 2, 2, 194, 191, 3, 2, 2, 2, 194, 192, 3, 2, 2, 2, 194, 193, 3, 2, 2, 2, 195, 13, 3, 2, 2, 2, 196, 197, 5, 16, 9, 2, 197, 198, 5, 18, 10, 2, 198, 15, 3, 2, 2, 2, 199, 200, 9, 2, 2, 2, 200, 17, 3, 2, 2, 2, 201, 202, 5, 22, 12, 2, 202, 203, 7, 37, 2, 2, 203, 206, 5, 156, 79, 2, 204, 205, 7, 56, 2, 2, 205, 207, 5, 20, 11, 2, 206, 204, 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 19, 3, 2, 2, 2, 208, 209, 5, 150, 76, 2, 209, 21, 3, 2, 2, 2, 210, 211, 5, 24, 13, 2, 211, 23, 3, 2, 2, 2, 212, 213, 7, 76, 2, 2, 213, 25, 3, 2, 2, 2, 214, 215, 7, 22, 2, 2, 215, 216, 5, 22, 12, 2, 216, 218, 7, 38, 2, 2, 217, 219, 5, 28, 15, 2, 218, 217, 3, 2, 2, 2, 218, 219, 3, 2, 2, 2, 219, 220, 3, 2, 2, 2, 220, 221, 7, 39, 2, 2, 221, 222, 7, 25, 2, 2, 222, 224, 5, 156, 79, 2, 223, 225, 5, 44, 23, 2, 224, 223, 3, 2, 2, 2, 224, 225, 3, 2, 2, 2, 225, 27, 3, 2, 2, 2, 226, 231, 5, 30, 16, 2, 227, 228, 7, 34, 2, 2, 228, 230, 5, 30, 16, 2, 229, 227, 3, 2, 2, 2, 230, 233, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 29, 3, 2, 2, 2, 233, 231, 3, 2, 2, 2, 234, 235, 5, 22, 12, 2, 235, 236, 7, 37, 2, 2, 236, 237, 5, 156, 79, 2, 237, 31, 3, 2, 2, 2, 238, 239, 7, 27, 2, 2, 239, 240, 5, 22, 12, 2, 240, 244, 7, 43, 2, 2, 241, 243, 5, 34, 18, 2, 242, 241, 3, 2, 2, 2, 243, 246, 3, 2, 2, 2, 244, 242, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 247, 3, 2, 2, 2, 246, 244, 3, 2, 2, 2, 247, 248, 7, 44, 2, 2, 248, 33, 3, 2, 2, 2, 249, 252, 5, 36, 19, 2, 250, 252, 5, 38, 20, 2, 251, 249, 3, 2, 2, 2, 251, 250, 3, 2, 2, 2, 252, 35, 3, 2, 2, 2, 253, 254, 5, 22, 12, 2, 254, 255, 7, 37, 2, 2, 255, 256, 5, 156, 79, 2, 256, 257, 7, 35, 2, 2, 257, 37, 3, 2, 2, 2, 258, 259, 5, 22, 12, 2, 259, 261, 7, 38, 2, 2, 260, 262, 5, 28, 15, 2, 261, 260, 3, 2, 2, 2, 261, 262, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 264, 7, 39, 2, 2, 264, 265, 7, 37, 2, 2, 265, 266, 5, 156, 79, 2, 266, 267, 7, 35, 2, 2, 267, 39, 3, 2, 2, 2, 268, 269, 7, 26, 2, 2, 269, 270, 5, 22, 12, 2, 270, 271, 7, 43, 2, 2, 271, 272, 7, 44, 2, 2, 272, 41, 3, 2, 2, 2, 273, 280, 5, 46, 24, 2, 274, 280, 5, 48, 25, 2, 275, 280, 5, 56, 29, 2, 276, 280, 5, 64, 33, 2, 277, 280, 5, 66, 34, 2, 278, 280, 5, 44, 23, 2, 279, 273, 3, 2, 2, 2, 279, 274, 3, 2, 2, 2, 279, 275, 3, 2, 2, 2, 279, 276, 3, 2, 2, 2, 279, 277, 3, 2, 2, 2, 279, 278, 3, 2, 2, 2, 280, 43, 3, 2, 2, 2, 281, 282, 6, 23, 2, 2, 282, 284, 7, 43, 2, 2, 283, 285, 5, 8, 5, 2, 284, 283, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 287, 7, 44, 2, 2, 287, 45, 3, 2, 2, 2, 288, 289, 8, 24, 1, 2, 289, 290, 5, 154, 78, 2, 290, 291, 7, 35, 2, 2, 291, 292, 8, 24, 1, 2, 292, 47, 3, 2, 2, 2, 293, 296, 5, 50, 26, 2, 294, 296, 5, 52, 27, 2, 295, 293, 3, 2, 2, 2, 295, 294, 3, 2, 2, 2, 296, 49, 3, 2, 2, 2, 297, 298, 7, 18, 2, 2, 298, 299, 7, 38, 2, 2, 299, 300, 5, 154, 78, 2, 300, 301, 7, 39, 2, 2, 301, 304, 5, 42, 22, 2, 302, 303, 7, 19, 2, 2, 303, 305, 5, 42, 22, 2, 304, 302, 3, 2, 2, 2, 304, 305, 3, 2, 2, 2, 305, 51, 3, 2, 2, 2, 306, 307, 7, 11, 2, 2, 307, 308, 7, 38, 2, 2, 308, 309, 5, 154, 78, 2, 309, 310, 7, 39, 2, 2, 310, 314, 7, 43, 2, 2, 311, 313, 5, 54, 28, 2, 312, 311, 3, 2, 2, 2, 313, 316, 3, 2, 2, 2, 314, 312, 3, 2, 2, 2, 314, 315, 3, 2, 2, 2, 315, 317, 3, 2, 2, 2, 316, 314, 3, 2, 2, 2, 317, 318, 7, 44, 2, 2, 318, 53, 3, 2, 2, 2, 319, 320, 7, 12, 2, 2, 320, 321, 5, 154, 78, 2, 321, 322, 7, 37, 2, 2, 322, 323, 5, 42, 22, 2, 323, 328, 3, 2, 2, 2, 324, 325, 7, 13, 2, 2, 325, 326, 7, 37, 2, 2, 326, 328, 5, 42, 22, 2, 327, 319, 3, 2, 2, 2, 327, 324, 3, 2, 2, 2, 328, 55, 3, 2, 2, 2, 329, 333, 5, 58, 30, 2, 330, 333, 5, 60, 31, 2, 331, 333, 5, 62, 32, 2, 332, 329, 3, 2, 2, 2, 332, 330, 3, 2, 2, 2, 332, 331, 3, 2, 2, 2, 333, 57, 3, 2, 2, 2, 334, 335, 7, 20, 2, 2, 335, 342, 7, 38, 2, 2, 336, 339, 5, 14, 8, 2, 337, 339, 5, 154, 78, 2, 338, 336, 3, 2, 2, 2, 338, 337, 3, 2, 2, 2, 339, 340, 3, 2, 2, 2, 340, 341, 8, 30, 1, 2, 341, 343, 3, 2, 2, 2, 342, 338, 3, 2, 2, 2, 342, 343, 3, 2, 2, 2, 343, 344, 3, 2, 2, 2, 344, 348, 7, 35, 2, 2, 345, 346, 5, 154, 78, 2, 346, 347, 8, 30, 1, 2, 347, 349, 3, 2, 2, 2, 348, 345, 3, 2, 2, 2, 348, 349, 3, 2, 2, 2, 349, 350, 3, 2, 2, 2, 350, 354, 7, 35, 2, 2, 351, 352, 5, 154, 78, 2, 352, 353, 8, 30, 1, 2, 353, 355, 3, 2, 2, 2, 354, 351, 3, 2, 2, 2, 354, 355, 3, 2, 2, 2, 355, 356, 3, 2, 2, 2, 356, 357, 7, 39, 2, 2, 357, 358, 5, 42, 22, 2, 358, 59, 3, 2, 2, 2, 359, 360, 7, 17, 2, 2, 360, 361, 7, 38, 2, 2, 361, 362, 5, 154, 78, 2, 362, 363, 7, 39, 2, 2, 363, 364, 5, 42, 22, 2, 364, 61, 3, 2, 2, 2, 365, 366, 7, 16, 2, 2, 366, 367, 5, 42, 22, 2, 367, 368, 7, 17, 2, 2, 368, 369, 7, 38, 2, 2, 369, 370, 5, 154, 78, 2, 370, 371, 7, 39, 2, 2, 371, 372, 7, 35, 2, 2, 372, 63, 3, 2, 2, 2, 373, 374, 9, 3, 2, 2, 374, 375, 7, 35, 2, 2, 375, 65, 3, 2, 2, 2, 376, 378, 7, 23, 2, 2, 377, 379, 5, 154, 78, 2, 378, 377, 3, 2, 2, 2, 378, 379, 3, 2, 2, 2, 379, 380, 3, 2, 2, 2, 380, 381, 7, 35, 2, 2, 381, 67, 3, 2, 2, 2, 382, 393, 5, 72, 37, 2, 383, 393, 5, 70, 36, 2, 384, 393, 5, 92, 47, 2, 385, 393, 5, 94, 48, 2, 386, 393, 5, 74, 38, 2, 387, 393, 5, 76, 39, 2, 388, 393, 5, 82, 42, 2, 389, 393, 5, 84, 43, 2, 390, 393, 5, 90, 46, 2, 391, 393, 5, 98, 50, 2, 392, 382, 3, 2, 2, 2, 392, 383, 3, 2, 2, 2, 392, 384, 3, 2, 2, 2, 392, 385, 3, 2, 2, 2, 392, 386, 3, 2, 2, 2, 392, 387, 3, 2, 2, 2, 392, 388, 3, 2, 2, 2, 392, 389, 3, 2, 2, 2, 392, 390, 3, 2, 2, 2, 392, 391, 3, 2, 2, 2, 393, 69, 3, 2, 2, 2, 394, 396, 7, 38, 2, 2, 395, 397, 5, 28, 15, 2, 396, 395, 3, 2, 2, 2, 396, 397, 3, 2, 2, 2, 397, 398, 3, 2, 2, 2, 398, 399, 7, 39, 2, 2, 399, 400, 7, 37, 2, 2, 400, 401, 5, 156, 79, 2, 401, 404, 7, 25, 2, 2, 402, 405, 5, 154, 78, 2, 403, 405, 5, 44, 23, 2, 404, 402, 3, 2, 2, 2, 404, 403, 3, 2, 2, 2, 405, 71, 3, 2, 2, 2, 406, 407, 7, 38, 2, 2, 407, 408, 5, 154, 78, 2, 408, 409, 7, 39, 2, 2, 409, 73, 3, 2, 2, 2, 410, 411, 9, 4, 2, 2, 411, 75, 3, 2, 2, 2, 412, 413, 5, 78, 40, 2, 413, 77, 3, 2, 2, 2, 414, 415, 7, 76, 2, 2, 415, 79, 3, 2, 2, 2, 416, 419, 5, 78, 40, 2, 417, 419, 5, 82, 42, 2, 418, 416, 3, 2, 2, 2, 418, 417, 3, 2, 2, 2, 419, 81, 3, 2, 2, 2, 420, 421, 9, 5, 2, 2, 421, 83, 3, 2, 2, 2, 422, 426, 7, 83, 2, 2, 423, 425, 5, 86, 44, 2, 424, 423, 3, 2, 2, 2, 425, 428, 3, 2, 2, 2, 426, 424, 3, 2, 2, 2, 426, 427, 3, 2, 2, 2, 427, 429, 3, 2, 2, 2, 428, 426, 3, 2, 2, 2, 429, 439, 7, 85, 2, 2, 430, 434, 7, 84, 2, 2, 431, 433, 5, 88, 45, 2, 432, 431, 3, 2, 2, 2, 433, 436, 3, 2, 2, 2, 434, 432, 3, 2, 2, 2, 434, 435, 3, 2, 2, 2, 435, 437, 3, 2, 2, 2, 436, 434, 3, 2, 2, 2, 437, 439, 7, 87, 2, 2, 438, 422, 3, 2, 2, 2, 438, 430, 3, 2, 2, 2, 439, 85, 3, 2, 2, 2, 440, 447, 7, 86, 2, 2, 441, 443, 7, 3, 2, 2, 442, 444, 5, 154, 78, 2, 443, 442, 3, 2, 2, 2, 443, 444, 3, 2, 2, 2, 444, 445, 3, 2, 2, 2, 445, 447, 7, 42, 2, 2, 446, 440, 3, 2, 2, 2, 446, 441, 3, 2, 2, 2, 447, 87, 3, 2, 2, 2, 448, 455, 7, 88, 2, 2, 449, 451, 7, 3, 2, 2, 450, 452, 5, 154, 78, 2, 451, 450, 3, 2, 2, 2, 451, 452, 3, 2, 2, 2, 452, 453, 3, 2, 2, 2, 453, 455, 7, 42, 2, 2, 454, 448, 3, 2, 2, 2, 454, 449, 3, 2, 2, 2, 455, 89, 3, 2, 2, 2, 456, 457, 9, 6, 2, 2, 457, 91, 3, 2, 2, 2, 458, 467, 7, 40, 2, 2, 459, 464, 5, 154, 78, 2, 460, 461, 7, 34, 2, 2, 461, 463, 5, 154, 78, 2, 462, 460, 3, 2, 2, 2, 463, 466, 3, 2, 2, 2, 464, 462, 3, 2, 2, 2, 464, 465, 3, 2, 2, 2, 465, 468, 3, 2, 2, 2, 466, 464, 3, 2, 2, 2, 467, 459, 3, 2, 2, 2, 467, 468, 3, 2, 2, 2, 468, 470, 3, 2, 2, 2, 469, 471, 7, 34, 2, 2, 470, 469, 3, 2, 2, 2, 470, 471, 3, 2, 2, 2, 471, 472, 3, 2, 2, 2, 472, 473, 7, 41, 2, 2, 473, 93, 3, 2, 2, 2, 474, 483, 7, 43, 2, 2, 475, 480, 5, 96, 49, 2, 476, 477, 7, 34, 2, 2, 477, 479, 5, 96, 49, 2, 478, 476, 3, 2, 2, 2, 479, 482, 3, 2, 2, 2, 480, 478, 3, 2, 2, 2, 480, 481, 3, 2, 2, 2, 481, 484, 3, 2, 2, 2, 482, 480, 3, 2, 2, 2, 483, 475, 3, 2, 2, 2, 483, 484, 3, 2, 2, 2, 484, 486, 3, 2, 2, 2, 485, 487, 7, 34, 2, 2, 486, 485, 3, 2, 2, 2, 486, 487, 3, 2, 2, 2, 487, 488, 3, 2, 2, 2, 488, 489, 7, 44, 2, 2, 489, 95, 3, 2, 2, 2, 490, 491, 5, 80, 41, 2, 491, 492, 7, 37, 2, 2, 492, 493, 5, 154, 78, 2, 493, 97, 3, 2, 2, 2, 494, 495, 9, 7, 2, 2, 495, 99, 3, 2, 2, 2, 496, 497, 8, 51, 1, 2, 497, 508, 5, 68, 35, 2, 498, 499, 7, 24, 2, 2, 499, 500, 5, 100, 51, 2, 500, 502, 7, 38, 2, 2, 501, 503, 5, 102, 52, 2, 502, 501, 3, 2, 2, 2, 502, 503, 3, 2, 2, 2, 503, 504, 3, 2, 2, 2, 504, 505, 7, 39, 2, 2, 505, 506, 8, 51, 1, 2, 506, 508, 3, 2, 2, 2, 507, 496, 3, 2, 2, 2, 507, 498, 3, 2, 2, 2, 508, 530, 3, 2, 2, 2, 509, 510, 12, 7, 2, 2, 510, 512, 7, 38, 2, 2, 511, 513, 5, 102, 52, 2, 512, 511, 3, 2, 2, 2, 512, 513, 3, 2, 2, 2, 513, 514, 3, 2, 2, 2, 514, 515, 7, 39, 2, 2, 515, 529, 8, 51, 1, 2, 516, 517, 12, 5, 2, 2, 517, 518, 5, 104, 53, 2, 518, 519, 8, 51, 1, 2, 519, 529, 3, 2, 2, 2, 520, 521, 12, 4, 2, 2, 521, 522, 5, 106, 54, 2, 522, 523, 8, 51, 1, 2, 523, 529, 3, 2, 2, 2, 524, 525, 12, 3, 2, 2, 525, 526, 5, 108, 55, 2, 526, 527, 8, 51, 1, 2, 527, 529, 3, 2, 2, 2, 528, 509, 3, 2, 2, 2, 528, 516, 3, 2, 2, 2, 528, 520, 3, 2, 2, 2, 528, 524, 3, 2, 2, 2, 529, 532, 3, 2, 2, 2, 530, 528, 3, 2, 2, 2, 530, 531, 3, 2, 2, 2, 531, 101, 3, 2, 2, 2, 532, 530, 3, 2, 2, 2, 533, 538, 5, 150, 76, 2, 534, 535, 7, 34, 2, 2, 535, 537, 5, 150, 76, 2, 536, 534, 3, 2, 2, 2, 537, 540, 3, 2, 2, 2, 538, 536, 3, 2, 2, 2, 538, 539, 3, 2, 2, 2, 539, 103, 3, 2, 2, 2, 540, 538, 3, 2, 2, 2, 541, 542, 7, 75, 2, 2, 542, 543, 5, 78, 40, 2, 543, 105, 3, 2, 2, 2, 544, 545, 7, 40, 2, 2, 545, 546, 5, 154, 78, 2, 546, 547, 7, 41, 2, 2, 547, 107, 3, 2, 2, 2, 548, 552, 7, 40, 2, 2, 549, 550, 5, 154, 78, 2, 550, 551, 8, 55, 1, 2, 551, 553, 3, 2, 2, 2, 552, 549, 3, 2, 2, 2, 552, 553, 3, 2, 2, 2, 553, 554, 3, 2, 2, 2, 554, 558, 7, 37, 2, 2, 555, 556, 5, 154, 78, 2, 556, 557, 8, 55, 1, 2, 557, 559, 3, 2, 2, 2, 558, 555, 3, 2, 2, 2, 558, 559, 3, 2, 2, 2, 559, 560, 3, 2, 2, 2, 560, 561, 7, 41, 2, 2, 561, 109, 3, 2, 2, 2, 562, 565, 5, 100, 51, 2, 563, 565, 5, 112, 57, 2, 564, 562, 3, 2, 2, 2, 564, 563, 3, 2, 2, 2, 565, 111, 3, 2, 2, 2, 566, 567, 5, 100, 51, 2, 567, 568, 5, 120, 61, 2, 568, 113, 3, 2, 2, 2, 569, 573, 5, 110, 56, 2, 570, 573, 5, 116, 59, 2, 571, 573, 5, 118, 60, 2, 572, 569, 3, 2, 2, 2, 572, 570, 3, 2, 2, 2, 572, 571, 3, 2, 2, 2, 573, 115, 3, 2, 2, 2, 574, 575, 5, 120, 61, 2, 575, 576, 5, 110, 56, 2, 576, 117, 3, 2, 2, 2, 577, 578, 5, 122, 62, 2, 578, 579, 5, 110, 56, 2, 579, 119, 3, 2, 2, 2, 580, 581, 9, 8, 2, 2, 581, 121, 3, 2, 2, 2, 582, 583, 9, 9, 2, 2, 583, 123, 3, 2, 2, 2, 584, 590, 5, 114, 58, 2, 585, 586, 5, 114, 58, 2, 586, 587, 7, 9, 2, 2, 587, 588, 5, 156, 79, 2, 588, 590, 3, 2, 2, 2, 589, 584, 3, 2, 2, 2, 589, 585, 3, 2, 2, 2, 590, 125, 3, 2, 2, 2, 591, 592, 8, 64, 1, 2, 592, 593, 5, 124, 63, 2, 593, 599, 3, 2, 2, 2, 594, 595, 12, 3, 2, 2, 595, 596, 9, 10, 2, 2, 596, 598, 5, 124, 63, 2, 597, 594, 3, 2, 2, 2, 598, 601, 3, 2, 2, 2, 599, 597, 3, 2, 2, 2, 599, 600, 3, 2, 2, 2, 600, 127, 3, 2, 2, 2, 601, 599, 3, 2, 2, 2, 602, 603, 8, 65, 1, 2, 603, 604, 5, 126, 64, 2, 604, 610, 3, 2, 2, 2, 605, 606, 12, 3, 2, 2, 606, 607, 9, 11, 2, 2, 607, 609, 5, 126, 64, 2, 608, 605, 3, 2, 2, 2, 609, 612, 3, 2, 2, 2, 610, 608, 3, 2, 2, 2, 610, 611, 3, 2, 2, 2, 611, 129, 3, 2, 2, 2, 612, 610, 3, 2, 2, 2, 613, 614, 8, 66, 1, 2, 614, 615, 5, 128, 65, 2, 615, 622, 3, 2, 2, 2, 616, 617, 12, 3, 2, 2, 617, 618, 5, 132, 67, 2, 618, 619, 5, 138, 70, 2, 619, 621, 3, 2, 2, 2, 620, 616, 3, 2, 2, 2, 621, 624, 3, 2, 2, 2, 622, 620, 3, 2, 2, 2, 622, 623, 3, 2, 2, 2, 623, 131, 3, 2, 2, 2, 624, 622, 3, 2, 2, 2, 625, 626, 9, 12, 2, 2, 626, 133, 3, 2, 2, 2, 627, 628, 8, 68, 1, 2, 628, 629, 5, 130, 66, 2, 629, 635, 3, 2, 2, 2, 630, 631, 12, 3, 2, 2, 631, 632, 9, 13, 2, 2, 632, 634, 5, 130, 66, 2, 633, 630, 3, 2, 2, 2, 634, 637, 3, 2, 2, 2, 635, 633, 3, 2, 2, 2, 635, 636, 3, 2, 2, 2, 636, 135, 3, 2, 2, 2, 637, 635, 3, 2, 2, 2, 638, 639, 8, 69, 1, 2, 639, 640, 5, 134, 68, 2, 640, 646, 3, 2, 2, 2, 641, 642, 12, 3, 2, 2, 642, 643, 9, 14, 2, 2, 643, 645, 5, 134, 68, 2, 644, 641, 3, 2, 2, 2, 645, 648, 3, 2, 2, 2, 646, 644, 3, 2, 2, 2, 646, 647, 3, 2, 2, 2, 647, 137, 3, 2, 2, 2, 648, 646, 3, 2, 2, 2, 649, 650, 8, 70, 1, 2, 650, 651, 5, 136, 69, 2, 651, 657, 3, 2, 2, 2, 652, 653, 12, 3, 2, 2, 653, 654, 7, 68, 2, 2, 654, 656, 5, 136, 69, 2, 655, 652, 3, 2, 2, 2, 656, 659, 3, 2, 2, 2, 657, 655, 3, 2, 2, 2, 657, 658, 3, 2, 2, 2, 658, 139, 3, 2, 2, 2, 659, 657, 3, 2, 2, 2, 660, 661, 8, 71, 1, 2, 661, 662, 5, 138, 70, 2, 662, 668, 3, 2, 2, 2, 663, 664, 12, 3, 2, 2, 664, 665, 7, 70, 2, 2, 665, 667, 5, 138, 70, 2, 666, 663, 3, 2, 2, 2, 667, 670, 3, 2, 2, 2, 668, 666, 3, 2, 2, 2, 668, 669, 3, 2, 2, 2, 669, 141, 3, 2, 2, 2, 670, 668, 3, 2, 2, 2, 671, 672, 8, 72, 1, 2, 672, 673, 5, 140, 71, 2, 673, 679, 3, 2, 2, 2, 674, 675, 12, 3, 2, 2, 675, 676, 7, 69, 2, 2, 676, 678, 5, 140, 71, 2, 677, 674, 3, 2, 2, 2, 678, 681, 3, 2, 2, 2, 679, 677, 3, 2, 2, 2, 679, 680, 3, 2, 2, 2, 680, 143, 3, 2, 2, 2, 681, 679, 3, 2, 2, 2, 682, 683, 8, 73, 1, 2, 683, 684, 5, 142, 72, 2, 684, 690, 3, 2, 2, 2, 685, 686, 12, 3, 2, 2, 686, 687, 7, 53, 2, 2, 687, 689, 5, 142, 72, 2, 688, 685, 3, 2, 2, 2, 689, 692, 3, 2, 2, 2, 690, 688, 3, 2, 2, 2, 690, 691, 3, 2, 2, 2, 691, 145, 3, 2, 2, 2, 692, 690, 3, 2, 2, 2, 693, 694, 8, 74, 1, 2, 694, 695, 5, 144, 73, 2, 695, 701, 3, 2, 2, 2, 696, 697, 12, 3, 2, 2, 697, 698, 7, 54, 2, 2, 698, 700, 5, 144, 73, 2, 699, 696, 3, 2, 2, 2, 700, 703, 3, 2, 2, 2, 701, 699, 3, 2, 2, 2, 701, 702, 3, 2, 2, 2, 702, 147, 3, 2, 2, 2, 703, 701, 3, 2, 2, 2, 704, 712, 5, 146, 74, 2, 705, 706, 5, 146, 74, 2, 706, 707, 7, 36, 2, 2, 707, 708, 5, 148, 75, 2, 708, 709, 7, 37, 2, 2, 709, 710, 5, 148, 75, 2, 710, 712, 3, 2, 2, 2, 711, 704, 3, 2, 2, 2, 711, 705, 3, 2, 2, 2, 712, 149, 3, 2, 2, 2, 713, 719, 5, 148, 75, 2, 714, 715, 5, 100, 51, 2, 715, 716, 5, 152, 77, 2, 716, 717, 5, 150, 76, 2, 717, 719, 3, 2, 2, 2, 718, 713, 3, 2, 2, 2, 718, 714, 3, 2, 2, 2, 719, 151, 3, 2, 2, 2, 720, 721, 9, 15, 2, 2, 721, 153, 3, 2, 2, 2, 722, 727, 5, 150, 76, 2, 723, 724, 7, 34, 2, 2, 724, 726, 5, 150, 76, 2, 725, 723, 3, 2, 2, 2, 726, 729, 3, 2, 2, 2, 727, 725, 3, 2, 2, 2, 727, 728, 3, 2, 2, 2, 728, 155, 3, 2, 2, 2, 729, 727, 3, 2, 2, 2, 730, 734, 5, 158, 80, 2, 731, 734, 5, 160, 81, 2, 732, 734, 5, 162, 82, 2, 733, 730, 3, 2, 2, 2, 733, 731, 3, 2, 2, 2, 733, 732, 3, 2, 2, 2, 734, 157, 3, 2, 2, 2, 735, 736, 5, 164, 83, 2, 736, 159, 3, 2, 2, 2, 737, 738, 5, 164, 83, 2, 738, 739, 7, 64, 2, 2, 739, 740, 5, 164, 83, 2, 740, 741, 7, 66, 2, 2, 741, 161, 3, 2, 2, 2, 742, 743, 7, 30, 2, 2, 743, 744, 7, 38, 2, 2, 744, 745, 5, 164, 83, 2, 745, 746, 7, 39, 2, 2, 746, 163, 3, 2, 2, 2, 747, 748, 9, 16, 2, 2, 748, 165, 3, 2, 2, 2, 68, 167, 174, 181, 186, 194, 206, 218, 224, 231, 244, 251, 261, 279, 284, 295, 304, 314, 327, 332, 338, 342, 348, 354, 378, 392, 396, 404, 418, 426, 434, 438, 443, 446, 451, 454, 464, 467, 470, 480, 483, 486, 502, 507, 512, 528, 530, 538, 552, 558, 564, 572, 589, 599, 610, 622, 635, 646, 657, 668, 679, 690, 701, 711, 718, 727, 733] \ No newline at end of file diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts index 3f482524e..232c1c728 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts @@ -151,7 +151,7 @@ export class KipperParser extends KipperParserBase { public static readonly RULE_jumpStatement = 31; public static readonly RULE_returnStatement = 32; public static readonly RULE_primaryExpression = 33; - public static readonly RULE_lambdaExpression = 34; + public static readonly RULE_lambdaPrimaryExpression = 34; public static readonly RULE_tangledPrimaryExpression = 35; public static readonly RULE_boolPrimaryExpression = 36; public static readonly RULE_identifierPrimaryExpression = 37; @@ -235,7 +235,7 @@ export class KipperParser extends KipperParserBase { "jumpStatement", "returnStatement", "primaryExpression", - "lambdaExpression", + "lambdaPrimaryExpression", "tangledPrimaryExpression", "boolPrimaryExpression", "identifierPrimaryExpression", @@ -1942,7 +1942,7 @@ export class KipperParser extends KipperParserBase { this.enterOuterAlt(_localctx, 2); { this.state = 381; - this.arrayPrimaryExpression(); + this.lambdaPrimaryExpression(); } break; @@ -1950,7 +1950,7 @@ export class KipperParser extends KipperParserBase { this.enterOuterAlt(_localctx, 3); { this.state = 382; - this.objectPrimaryExpression(); + this.arrayPrimaryExpression(); } break; @@ -1958,7 +1958,7 @@ export class KipperParser extends KipperParserBase { this.enterOuterAlt(_localctx, 4); { this.state = 383; - this.boolPrimaryExpression(); + this.objectPrimaryExpression(); } break; @@ -1966,7 +1966,7 @@ export class KipperParser extends KipperParserBase { this.enterOuterAlt(_localctx, 5); { this.state = 384; - this.identifierPrimaryExpression(); + this.boolPrimaryExpression(); } break; @@ -1974,7 +1974,7 @@ export class KipperParser extends KipperParserBase { this.enterOuterAlt(_localctx, 6); { this.state = 385; - this.stringPrimaryExpression(); + this.identifierPrimaryExpression(); } break; @@ -1982,7 +1982,7 @@ export class KipperParser extends KipperParserBase { this.enterOuterAlt(_localctx, 7); { this.state = 386; - this.fStringPrimaryExpression(); + this.stringPrimaryExpression(); } break; @@ -1990,7 +1990,7 @@ export class KipperParser extends KipperParserBase { this.enterOuterAlt(_localctx, 8); { this.state = 387; - this.numberPrimaryExpression(); + this.fStringPrimaryExpression(); } break; @@ -1998,7 +1998,7 @@ export class KipperParser extends KipperParserBase { this.enterOuterAlt(_localctx, 9); { this.state = 388; - this.voidOrNullOrUndefinedPrimaryExpression(); + this.numberPrimaryExpression(); } break; @@ -2006,7 +2006,7 @@ export class KipperParser extends KipperParserBase { this.enterOuterAlt(_localctx, 10); { this.state = 389; - this.lambdaExpression(); + this.voidOrNullOrUndefinedPrimaryExpression(); } break; } @@ -2024,9 +2024,9 @@ export class KipperParser extends KipperParserBase { return _localctx; } // @RuleVersion(0) - public lambdaExpression(): LambdaExpressionContext { - let _localctx: LambdaExpressionContext = new LambdaExpressionContext(this._ctx, this.state); - this.enterRule(_localctx, 68, KipperParser.RULE_lambdaExpression); + public lambdaPrimaryExpression(): LambdaPrimaryExpressionContext { + let _localctx: LambdaPrimaryExpressionContext = new LambdaPrimaryExpressionContext(this._ctx, this.state); + this.enterRule(_localctx, 68, KipperParser.RULE_lambdaPrimaryExpression); let _la: number; try { this.enterOuterAlt(_localctx, 1); @@ -5024,9 +5024,9 @@ export class KipperParser extends KipperParserBase { "\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" + - "\x05\\/\x02\u0180\u0189\x05^0\x02\u0181\u0189\x05J&\x02\u0182\u0189\x05" + - "L'\x02\u0183\u0189\x05R*\x02\u0184\u0189\x05T+\x02\u0185\u0189\x05Z." + - "\x02\u0186\u0189\x05b2\x02\u0187\u0189\x05F$\x02\u0188\u017E\x03\x02\x02" + + "\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" + @@ -6617,6 +6617,9 @@ 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); } @@ -6641,9 +6644,6 @@ export class PrimaryExpressionContext extends KipperParserRuleContext { 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); } @@ -6673,7 +6673,7 @@ export class PrimaryExpressionContext extends KipperParserRuleContext { } } -export class LambdaExpressionContext extends KipperParserRuleContext { +export class LambdaPrimaryExpressionContext extends KipperParserRuleContext { public LeftParen(): TerminalNode { return this.getToken(KipperParser.LeftParen, 0); } @@ -6703,24 +6703,24 @@ export class LambdaExpressionContext extends KipperParserRuleContext { } // @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); } diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParserListener.ts b/kipper/core/src/compiler/lexer-parser/antlr/KipperParserListener.ts index 4ef55e3a8..5f63de83b 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParserListener.ts +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParserListener.ts @@ -74,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"; @@ -932,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 f2d22cc9c..b29174fb7 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParserVisitor.ts +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParserVisitor.ts @@ -74,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"; @@ -634,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 4c6a29c6b..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 @@ -52,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 bd0f706cd..de09c618f 100644 --- a/kipper/core/src/compiler/target-presets/semantic-analyser.ts +++ b/kipper/core/src/compiler/target-presets/semantic-analyser.ts @@ -317,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 3df0cc2c0..e24369b25 100644 --- a/kipper/core/src/compiler/target-presets/translation/code-generator.ts +++ b/kipper/core/src/compiler/target-presets/translation/code-generator.ts @@ -396,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 af3027af5..56b2196a4 100644 --- a/kipper/target-js/src/code-generator.ts +++ b/kipper/target-js/src/code-generator.ts @@ -2,7 +2,7 @@ * The JavaScript target-specific code generator for translating Kipper code into JavaScript. * @since 0.10.0 */ -import { +import type { AdditiveExpression, ArrayPrimaryExpression, AssignmentExpression, @@ -56,7 +56,8 @@ import { InterfacePropertyDeclaration, WhileLoopIterationStatement, InterfaceDeclaration, - ClassDeclaration, InterfaceMethodDeclaration, + ClassDeclaration, + InterfaceMethodDeclaration, } from "@kipper/core"; import { CompoundStatement, @@ -800,7 +801,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 843642bba..39a866f87 100644 --- a/kipper/target-js/src/semantic-analyser.ts +++ b/kipper/target-js/src/semantic-analyser.ts @@ -300,5 +300,5 @@ export class JavaScriptTargetSemanticAnalyser extends KipperTargetSemanticAnalys /** * Performs typescript-specific semantic analysis for {@link LambdaExpression} instances. */ - lambdaExpression = undefined; + lambdaPrimaryExpression = undefined; } diff --git a/test/module/core/core-functionality.test.ts b/test/module/core/core-functionality.test.ts index 1c12fb574..e342dad3c 100644 --- a/test/module/core/core-functionality.test.ts +++ b/test/module/core/core-functionality.test.ts @@ -3,7 +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"; +import { jsConfig } from "./errors"; /** * Tests the 'print' function of Kipper. From 3c365fc32be87e3726d84064f54827ac7d209251 Mon Sep 17 00:00:00 2001 From: Fabian Date: Fri, 12 Jul 2024 11:11:42 +0200 Subject: [PATCH 29/57] 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"; };'); - }); -}); From 828b7ac2b36eaec10375383906774360c9349394 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Fri, 12 Jul 2024 16:12:31 +0200 Subject: [PATCH 30/57] major (#499): Introduced built-in type classes and any type --- kipper/core/src/compiler/ast/ast-generator.ts | 5 +- .../core/src/compiler/ast/common/ast-types.ts | 1 - .../compiler/ast/mapping/ast-node-mapper.ts | 8 +- .../parameter-declaration-semantics.ts | 4 +- .../parameter-declaration.ts | 4 +- .../interface-declaration-semantics.ts | 1 - .../interface-declaration.ts | 2 +- .../interface-method-declaration-semantics.ts | 1 - ...rface-method-declaration-type-semantics.ts | 1 - .../interface-method-declaration.ts | 8 +- ...ace-property-declaration-type-semantics.ts | 1 - .../interface-property-declaration.ts | 1 - .../type-declaration-type-semantics.ts | 1 - .../expressions/expression-type-semantics.ts | 2 - .../compiler/ast/nodes/expressions/index.ts | 2 +- .../expressions/lambda-expression/index.ts | 3 - .../lambda-primary-expression/index.ts | 3 + .../lambda-primary-expression-semantics.ts} | 14 ++-- ...mbda-primary-expression-type-semantics.ts} | 6 +- .../lambda-primary-expression.ts} | 38 ++++----- .../primary-expression/primary-expression.ts | 1 + .../return-statement-semantics.ts | 4 +- kipper/core/src/compiler/const.ts | 22 ++++- .../semantics/analyser/semantic-checker.ts | 6 +- .../semantics/analyser/type-checker.ts | 32 ++++++-- .../entry/scope-function-declaration.ts | 2 +- .../entry/scope-parameter-declaration.ts | 6 +- .../entry/scope-variable-declaration.ts | 2 +- .../semantics/symbol-table/function-scope.ts | 4 +- .../semantics/symbol-table/universum-scope.ts | 35 +++++--- .../types/{ => base}/built-in-type.ts | 16 ++-- .../types/base/generic-built-in-type.ts | 54 ++++++++++++ .../semantics/types/base/generic-type.ts | 24 ++++++ .../compiler/semantics/types/base/index.ts | 3 + .../semantics/types/base/processed-type.ts | 30 ++++++- .../compiler/semantics/types/built-in/any.ts | 41 ++++++++++ .../semantics/types/built-in/array.ts | 82 +++++++++++++++++++ .../compiler/semantics/types/built-in/bool.ts | 21 +++++ .../compiler/semantics/types/built-in/func.ts | 40 +++++++++ .../semantics/types/built-in/index.ts | 13 +++ .../compiler/semantics/types/built-in/null.ts | 21 +++++ .../compiler/semantics/types/built-in/num.ts | 21 +++++ .../compiler/semantics/types/built-in/str.ts | 21 +++++ .../compiler/semantics/types/built-in/type.ts | 21 +++++ .../semantics/types/built-in/undefined.ts | 21 +++++ .../compiler/semantics/types/built-in/void.ts | 21 +++++ .../compiler/semantics/types/custom-type.ts | 3 +- .../src/compiler/semantics/types/index.ts | 2 +- .../target-presets/semantic-analyser.ts | 6 +- .../translation/code-generator.ts | 6 +- kipper/core/src/errors.ts | 62 ++++++++++++-- kipper/target-js/src/code-generator.ts | 6 +- 52 files changed, 637 insertions(+), 118 deletions(-) delete mode 100644 kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/index.ts create mode 100644 kipper/core/src/compiler/ast/nodes/expressions/primary-expression/lambda-primary-expression/index.ts rename kipper/core/src/compiler/ast/nodes/expressions/{lambda-expression/lambda-expression-semantics.ts => primary-expression/lambda-primary-expression/lambda-primary-expression-semantics.ts} (56%) rename kipper/core/src/compiler/ast/nodes/expressions/{lambda-expression/lambda-expression-type-semantics.ts => primary-expression/lambda-primary-expression/lambda-primary-expression-type-semantics.ts} (53%) rename kipper/core/src/compiler/ast/nodes/expressions/{lambda-expression/lambda-expression.ts => primary-expression/lambda-primary-expression/lambda-primary-expression.ts} (83%) rename kipper/core/src/compiler/semantics/types/{ => base}/built-in-type.ts (76%) create mode 100644 kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts create mode 100644 kipper/core/src/compiler/semantics/types/base/generic-type.ts create mode 100644 kipper/core/src/compiler/semantics/types/built-in/any.ts create mode 100644 kipper/core/src/compiler/semantics/types/built-in/array.ts create mode 100644 kipper/core/src/compiler/semantics/types/built-in/bool.ts create mode 100644 kipper/core/src/compiler/semantics/types/built-in/func.ts create mode 100644 kipper/core/src/compiler/semantics/types/built-in/index.ts create mode 100644 kipper/core/src/compiler/semantics/types/built-in/null.ts create mode 100644 kipper/core/src/compiler/semantics/types/built-in/num.ts create mode 100644 kipper/core/src/compiler/semantics/types/built-in/str.ts create mode 100644 kipper/core/src/compiler/semantics/types/built-in/type.ts create mode 100644 kipper/core/src/compiler/semantics/types/built-in/undefined.ts create mode 100644 kipper/core/src/compiler/semantics/types/built-in/void.ts diff --git a/kipper/core/src/compiler/ast/ast-generator.ts b/kipper/core/src/compiler/ast/ast-generator.ts index ffdca57e9..3b2722669 100644 --- a/kipper/core/src/compiler/ast/ast-generator.ts +++ b/kipper/core/src/compiler/ast/ast-generator.ts @@ -80,7 +80,6 @@ import type { VariableDeclarationContext, VoidOrNullOrUndefinedPrimaryExpressionContext, WhileLoopIterationStatementContext, - InterfaceMemberDeclarationContext, } from "../lexer-parser"; import type { KipperProgramContext } from "../program-ctx"; import type { CompilableASTNode } from "./compilable-ast-node"; @@ -201,7 +200,7 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi 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.", + " definition.", ); } this._currentPrimaryNode = this.expressionFactory.create(ctx, this.currentNode); @@ -211,7 +210,7 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi this.programCtx.logger.debug( `Created AST node of type '${this.currentNode.constructor.name}' for context '${ctx.astSyntaxKind}'` + - `(Loc: ${ctx.start.line}:${ctx.start.charPositionInLine})`, + `(Loc: ${ctx.start.line}:${ctx.start.charPositionInLine})`, ); } diff --git a/kipper/core/src/compiler/ast/common/ast-types.ts b/kipper/core/src/compiler/ast/common/ast-types.ts index e2bb8c468..554210fe5 100644 --- a/kipper/core/src/compiler/ast/common/ast-types.ts +++ b/kipper/core/src/compiler/ast/common/ast-types.ts @@ -33,7 +33,6 @@ import type { InterfaceDeclarationContext, InterfaceMethodDeclarationContext, InterfacePropertyDeclarationContext, - InterfaceMemberDeclarationContext, JumpStatementContext, KindParseRuleMapping, LogicalAndExpressionContext, 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 dadcd4ff3..2fe7964ff 100644 --- a/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts +++ b/kipper/core/src/compiler/ast/mapping/ast-node-mapper.ts @@ -33,7 +33,6 @@ import { IncrementOrDecrementPostfixExpressionContext, IncrementOrDecrementUnaryExpressionContext, InterfaceDeclarationContext, - InterfaceMemberDeclarationContext, InterfaceMethodDeclarationContext, InterfacePropertyDeclarationContext, JumpStatementContext, @@ -67,7 +66,6 @@ import type { ASTStatementRuleName, } from "../common"; import type { Declaration, Expression, Statement } from "../nodes"; -import { InterfaceMemberDeclaration, InterfaceMemberDeclarationSemantics } from "../nodes"; import { AdditiveExpression, ArrayPrimaryExpression, @@ -96,7 +94,7 @@ import { IncrementOrDecrementUnaryExpression, InterfaceDeclaration, JumpStatement, - LambdaExpression, + LambdaPrimaryExpression, LogicalAndExpression, LogicalOrExpression, MemberAccessExpression, @@ -178,7 +176,7 @@ export class ASTNodeMapper { [ParseRuleKindMapping.RULE_bitwiseAndExpression]: BitwiseAndExpression, [ParseRuleKindMapping.RULE_bitwiseXorExpression]: BitwiseXorExpression, [ParseRuleKindMapping.RULE_bitwiseShiftExpression]: BitwiseShiftExpression, - [ParseRuleKindMapping.RULE_lambdaPrimaryExpression]: LambdaExpression, + [ParseRuleKindMapping.RULE_lambdaPrimaryExpression]: LambdaPrimaryExpression, } satisfies Record>; /** @@ -327,7 +325,7 @@ export class ASTNodeMapper { RULE_bitwiseAndExpression: BitwiseAndExpression, RULE_bitwiseXorExpression: BitwiseXorExpression, RULE_bitwiseShiftExpression: BitwiseShiftExpression, - RULE_lambdaPrimaryExpression: LambdaExpression, + RULE_lambdaPrimaryExpression: LambdaPrimaryExpression, } satisfies Record>; /** diff --git a/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-semantics.ts b/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-semantics.ts index 1079771bc..086f8f2f7 100644 --- a/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/declarations/parameter-declaration/parameter-declaration-semantics.ts @@ -4,7 +4,7 @@ */ import type { RawType } from "../../../../semantics"; import type { DeclarationSemantics } from "../declaration-semantics"; -import type { FunctionDeclaration, IdentifierTypeSpecifierExpression, LambdaExpression } from "../../../nodes"; +import type { FunctionDeclaration, IdentifierTypeSpecifierExpression, LambdaPrimaryExpression } from "../../../nodes"; /** * Semantics for AST Node {@link ParameterDeclaration}. @@ -30,5 +30,5 @@ export interface ParameterDeclarationSemantics extends DeclarationSemantics { * The parent function of this parameter. * @since 0.10.0 */ - func: FunctionDeclaration | LambdaExpression; + func: FunctionDeclaration | LambdaPrimaryExpression; } 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 614bf0a24..8bde5acde 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 @@ -7,7 +7,7 @@ import type { ParameterDeclarationTypeSemantics } from "./parameter-declaration- import type { CompilableNodeParent } from "../../../compilable-ast-node"; import type { FunctionScope, LambdaScope, ScopeParameterDeclaration } from "../../../../semantics"; import type { FunctionDeclaration } from "../function-declaration"; -import type { IdentifierTypeSpecifierExpression, LambdaExpression } from "../../expressions"; +import type { IdentifierTypeSpecifierExpression, LambdaPrimaryExpression } from "../../expressions"; import { Declaration } from "../declaration"; import type { ParameterDeclarationContext } from "../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../lexer-parser"; @@ -132,7 +132,7 @@ export class ParameterDeclaration extends Declaration< identifier: getParseTreeSource(this.tokenStream, parseTreeChildren[0]), valueTypeSpecifier: typeSpecifier, valueType: typeSpecifier.getSemanticData().typeIdentifier, - func: this.parent, + func: this.parent, }; // Register this parameter in the function scope 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 e0f77a03d..f83fe8d33 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 @@ -4,7 +4,6 @@ */ 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}. 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 468a31b43..07bdfde9b 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,8 @@ 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 type { InterfaceMemberDeclaration } from "./interface-member-declaration"; import { KipperNotImplementedError, UnableToDetermineSemanticDataError } from "../../../../../../errors"; import { TypeDeclaration } from "../type-declaration"; 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 index 55afeda11..16fdddcd7 100644 --- 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 @@ -1,7 +1,6 @@ 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}. 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 index 768616c10..38a750cbe 100644 --- 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 @@ -1,6 +1,5 @@ import type { TypeDeclarationTypeSemantics } from "../../../type-declaration-type-semantics"; import type { ProcessedType } from "../../../../../../../semantics"; -import { CustomType } from "../../../../../../../semantics"; /** * 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 index 900b5f203..388b5f314 100644 --- 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 @@ -4,13 +4,11 @@ */ 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 { DeclaratorContext, KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../../../lexer-parser"; import { InterfaceMemberDeclaration } from "../interface-member-declaration"; import type { CompilableNodeParent } from "../../../../../../compilable-ast-node"; -import { KipperNotImplementedError, UnableToDetermineSemanticDataError } from "../../../../../../../../errors"; +import { 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"; @@ -166,7 +164,7 @@ export class InterfaceMethodDeclaration extends InterfaceMemberDeclaration< const returnType = semanticData.returnType.getTypeSemanticData().storedType; this.typeSemantics = { returnType: returnType, - type: BuiltInTypes.func, + type: BuiltInTypes.Func, }; } 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 index 764c928d6..9f8fd5ae8 100644 --- 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 @@ -1,6 +1,5 @@ import type { TypeDeclarationTypeSemantics } from "../../../type-declaration-type-semantics"; import type { ProcessedType } from "../../../../../../../semantics"; -import { CustomType } from "../../../../../../../semantics"; /** * Type semantics for AST Node {@link InterfacePropertyDeclaration}. 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 index e0bb70a57..dcc10d3da 100644 --- 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 @@ -3,7 +3,6 @@ * @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"; 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 051ce11ac..02854427a 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,6 +1,5 @@ import type { TypeData } from "../../../ast-node"; import type { ProcessedType } from "../../../../semantics"; -import { CustomType } from "../../../../semantics"; /** * Type semantics for a {@link TypeDeclaration}. diff --git a/kipper/core/src/compiler/ast/nodes/expressions/expression-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/expression-type-semantics.ts index 01a6fc932..4cba408c7 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/expression-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/expression-type-semantics.ts @@ -13,8 +13,6 @@ export interface ExpressionTypeSemantics extends TypeData { /** * The value type that this expression evaluates to. This is used to properly represent the evaluated type of * expressions that do not explicitly show their type. - * - * This will always evaluate to "type", as a type specifier will always be a type. * @since 0.10.0 */ evaluatedType: ProcessedType; diff --git a/kipper/core/src/compiler/ast/nodes/expressions/index.ts b/kipper/core/src/compiler/ast/nodes/expressions/index.ts index c27514e9c..b74c6cd0c 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/index.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/index.ts @@ -20,4 +20,4 @@ export * from "./conditional-expression/"; export * from "./function-call-expression/"; export * from "./member-access-expression/"; export * from "./bitwise-expression/"; -export * from "./lambda-expression/"; +export * from "./primary-expression/lambda-primary-expression/"; diff --git a/kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/index.ts b/kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/index.ts deleted file mode 100644 index f27f00dd5..000000000 --- a/kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./lambda-expression"; -export * from "./lambda-expression-semantics"; -export * from "./lambda-expression-type-semantics"; diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/lambda-primary-expression/index.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/lambda-primary-expression/index.ts new file mode 100644 index 000000000..0518250bd --- /dev/null +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/lambda-primary-expression/index.ts @@ -0,0 +1,3 @@ +export * from "./lambda-primary-expression"; +export * from "./lambda-primary-expression-semantics"; +export * from "./lambda-primary-expression-type-semantics"; diff --git a/kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/lambda-expression-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/lambda-primary-expression/lambda-primary-expression-semantics.ts similarity index 56% rename from kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/lambda-expression-semantics.ts rename to kipper/core/src/compiler/ast/nodes/expressions/primary-expression/lambda-primary-expression/lambda-primary-expression-semantics.ts index b5a885263..a79abb149 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/lambda-expression-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/lambda-primary-expression/lambda-primary-expression-semantics.ts @@ -2,18 +2,18 @@ * Semantics for AST Node {@link LambdaExpression}. * @since 0.11.0 */ -import type { ExpressionSemantics } from "../expression-semantics"; -import type { ParameterDeclaration } from "../../declarations"; -import type { IdentifierTypeSpecifierExpression } from "../type-specifier-expression"; -import type { CompoundStatement } from "../../statements"; -import type { Expression } from "../expression"; -import type { RawType } from "../../../../semantics"; +import type { ExpressionSemantics } from "../../expression-semantics"; +import type { ParameterDeclaration } from "../../../declarations"; +import type { IdentifierTypeSpecifierExpression } from "../../type-specifier-expression"; +import type { CompoundStatement } from "../../../statements"; +import type { Expression } from "../../expression"; +import type { RawType } from "../../../../../semantics"; /** * Semantics for AST Node {@link LambdaExpression}. * @since 0.11.0 */ -export interface LambdaExpressionSemantics extends ExpressionSemantics { +export interface LambdaPrimaryExpressionSemantics extends ExpressionSemantics { /** * The return type of the lambda expression. * @since 0.11.0 diff --git a/kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/lambda-expression-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/lambda-primary-expression/lambda-primary-expression-type-semantics.ts similarity index 53% rename from kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/lambda-expression-type-semantics.ts rename to kipper/core/src/compiler/ast/nodes/expressions/primary-expression/lambda-primary-expression/lambda-primary-expression-type-semantics.ts index 311f83328..92defda61 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/lambda-expression-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/lambda-primary-expression/lambda-primary-expression-type-semantics.ts @@ -2,14 +2,14 @@ * Type semantics for AST Node {@link LambdaExpression}. * @since 0.11.0 */ -import type { ExpressionTypeSemantics } from "../expression-type-semantics"; -import type { ProcessedType } from "../../../../semantics"; +import type { ExpressionTypeSemantics } from "../../expression-type-semantics"; +import type { ProcessedType } from "../../../../../semantics"; /** * Type semantics for AST Node {@link LambdaExpression}. * @since 0.11.0 */ -export interface LambdaExpressionTypeSemantics extends ExpressionTypeSemantics { +export interface LambdaPrimaryExpressionTypeSemantics extends ExpressionTypeSemantics { /** * The return type of the lambda expression. * @since 0.11.0 diff --git a/kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/lambda-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/lambda-primary-expression/lambda-primary-expression.ts similarity index 83% rename from kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/lambda-expression.ts rename to kipper/core/src/compiler/ast/nodes/expressions/primary-expression/lambda-primary-expression/lambda-primary-expression.ts index 4563c4155..cb2a8c88f 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/lambda-expression/lambda-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/lambda-primary-expression/lambda-primary-expression.ts @@ -4,19 +4,19 @@ * @example * var add: num = (a: num, b: num) => a + b; */ -import { Expression } from "../expression"; -import type { LambdaExpressionSemantics } from "./lambda-expression-semantics"; -import type { LambdaExpressionTypeSemantics } from "./lambda-expression-type-semantics"; -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"; -import type { Statement } from "../../statements"; -import { CompoundStatement } from "../../statements"; -import type { IdentifierTypeSpecifierExpression } from "../type-specifier-expression"; -import { ParameterDeclaration } from "../../declarations"; -import { UnableToDetermineSemanticDataError } from "../../../../../errors"; -import { BuiltInTypes, LambdaScope } from "../../../../semantics"; +import { Expression } from "../../expression"; +import type { LambdaPrimaryExpressionSemantics } from "./lambda-primary-expression-semantics"; +import type { LambdaPrimaryExpressionTypeSemantics } from "./lambda-primary-expression-type-semantics"; +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"; +import type { Statement } from "../../../statements"; +import { CompoundStatement } from "../../../statements"; +import type { IdentifierTypeSpecifierExpression } from "../../type-specifier-expression"; +import { ParameterDeclaration } from "../../../declarations"; +import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; +import { BuiltInTypes, LambdaScope } from "../../../../../semantics"; /** * Lambda expression class, which represents a lambda expression in the AST. @@ -24,10 +24,10 @@ import { BuiltInTypes, LambdaScope } from "../../../../semantics"; * @example * var add: num = (a: num, b: num) -> a + b; */ -export class LambdaExpression +export class LambdaPrimaryExpression extends Expression< - LambdaExpressionSemantics, - LambdaExpressionTypeSemantics, + LambdaPrimaryExpressionSemantics, + LambdaPrimaryExpressionTypeSemantics, Expression | ParameterDeclaration | CompoundStatement > implements ScopeNode @@ -79,7 +79,7 @@ export class LambdaExpression * @since 0.11.0 */ public override get kind() { - return LambdaExpression.kind; + return LambdaPrimaryExpression.kind; } /** @@ -88,7 +88,7 @@ export class LambdaExpression * @since 0.11.0 */ public override get ruleName() { - return LambdaExpression.ruleName; + return LambdaPrimaryExpression.ruleName; } /** @@ -156,7 +156,7 @@ export class LambdaExpression // Get the type that will be returned using the return type specifier const returnType = semanticData.returnTypeSpecifier.getTypeSemanticData().storedType; this.typeSemantics = { - evaluatedType: BuiltInTypes.func, + evaluatedType: BuiltInTypes.Func, returnType: returnType, }; diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/primary-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/primary-expression.ts index 89f4e55e6..e5da161ae 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/primary-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/primary-expression.ts @@ -22,6 +22,7 @@ export type ASTPrimaryExpressionKind = | typeof ParseRuleKindMapping.RULE_voidOrNullOrUndefinedPrimaryExpression | typeof ParseRuleKindMapping.RULE_arrayPrimaryExpression | typeof ParseRuleKindMapping.RULE_objectPrimaryExpression + | typeof ParseRuleKindMapping.RULE_lambdaPrimaryExpression | typeof ParseRuleKindMapping.RULE_fStringPrimaryExpression | typeof ParseRuleKindMapping.RULE_identifierPrimaryExpression | typeof ParseRuleKindMapping.RULE_tangledPrimaryExpression; diff --git a/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement-semantics.ts b/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement-semantics.ts index 08de52afb..ed04641ad 100644 --- a/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/statements/return-statement/return-statement-semantics.ts @@ -3,7 +3,7 @@ * @since 0.10.0 */ import type { SemanticData } from "../../../ast-node"; -import type { Expression, LambdaExpression } from "../../expressions"; +import type { Expression, LambdaPrimaryExpression } from "../../expressions"; import type { FunctionDeclaration } from "../../declarations"; /** @@ -20,5 +20,5 @@ export interface ReturnStatementSemantics extends SemanticData { * The function that this return statement is in. * @since 0.10.0 */ - function: FunctionDeclaration | LambdaExpression; + function: FunctionDeclaration | LambdaPrimaryExpression; } diff --git a/kipper/core/src/compiler/const.ts b/kipper/core/src/compiler/const.ts index e62883f06..e20b5870d 100644 --- a/kipper/core/src/compiler/const.ts +++ b/kipper/core/src/compiler/const.ts @@ -27,6 +27,18 @@ export type KipperMetaTypeLiteral = "type"; */ export const kipperMetaTypeLiteral: KipperMetaTypeLiteral = "type"; +/** + * Any type in Kipper, which can be used to represent any type. + * @since 0.12.0 + */ +export type KipperAnyTypeLiteral = "any"; + +/** + * Any type in Kipper, which can be used to represent any type. + * @since 0.12.0 + */ +export const kipperAnyTypeLiteral: KipperAnyTypeLiteral = "any"; + /** * Null type in Kipper. * @since 0.10.0 @@ -55,13 +67,13 @@ export const kipperUndefinedTypeLiteral: KipperUndefinedTypeLiteral = "undefined * Function type in Kipper. * @since 0.6.0 */ -export type KipperFuncTypeLiteral = "func"; +export type KipperFuncTypeLiteral = "Func"; /** * Function type in Kipper. * @since 0.6.0 */ -export const kipperFuncTypeLiteral: KipperFuncTypeLiteral = "func"; +export const kipperFuncTypeLiteral: KipperFuncTypeLiteral = "Func"; /** * Void type in Kipper. @@ -140,7 +152,7 @@ export const kipperBoolTypeLiteral: KipperBoolTypeLiteral = "bool"; * type checking generic type, it will not change the type itself. * @since 0.5.0 */ -export type KipperListTypeLiteral = "list"; +export type KipperListTypeLiteral = "Array"; /** * List type in Kipper. {@link KipperType ValueType} represents the type of the list content and only serves as a @@ -149,7 +161,7 @@ export type KipperListTypeLiteral = "list"; * @example * list */ -export const kipperListTypeLiteral: KipperListTypeLiteral = "list"; +export const kipperListTypeLiteral: KipperListTypeLiteral = "Array"; /** * All primitive types inside Kipper. @@ -184,6 +196,7 @@ export const kipperPrimitiveTypeLiterals: Array = [ * @since 0.10.0 */ export type KipperBuiltInTypeLiteral = + | KipperAnyTypeLiteral | KipperMetaTypeLiteral | KipperPrimitiveTypeLiteral | KipperFuncTypeLiteral @@ -194,6 +207,7 @@ export type KipperBuiltInTypeLiteral = * @since 0.10.0 */ export const kipperBuiltInTypeLiterals: Array = [ + kipperAnyTypeLiteral, kipperMetaTypeLiteral, kipperFuncTypeLiteral, ...kipperPrimitiveTypeLiterals, diff --git a/kipper/core/src/compiler/semantics/analyser/semantic-checker.ts b/kipper/core/src/compiler/semantics/analyser/semantic-checker.ts index ae6ae683d..db0270970 100644 --- a/kipper/core/src/compiler/semantics/analyser/semantic-checker.ts +++ b/kipper/core/src/compiler/semantics/analyser/semantic-checker.ts @@ -12,7 +12,7 @@ import type { ReturnStatement, VariableDeclaration, } from "../../ast"; -import { LambdaExpression, Expression } from "../../ast"; +import { LambdaPrimaryExpression, Expression } from "../../ast"; import { CompoundStatement, FunctionDeclaration, IdentifierPrimaryExpression, IterationStatement } from "../../ast"; import { KipperSemanticsAsserter } from "./err-handler"; import type { Scope } from "../symbol-table"; @@ -198,12 +198,12 @@ export class KipperSemanticChecker extends KipperSemanticsAsserter { * @returns The parent function if found. * @since 0.10.0 */ - public getReturnStatementParent(retStatement: ReturnStatement): FunctionDeclaration | LambdaExpression { + public getReturnStatementParent(retStatement: ReturnStatement): FunctionDeclaration | LambdaPrimaryExpression { // Move up the parent chain and continue as long as there are parents and the current parent is not a function // declaration. This is to ensure a return statement is always used inside a function. let currentParent: CompilableNodeParent | undefined = retStatement.parent; while ( - !(currentParent instanceof FunctionDeclaration || currentParent instanceof LambdaExpression) && + !(currentParent instanceof FunctionDeclaration || currentParent instanceof LambdaPrimaryExpression) && currentParent ) { currentParent = currentParent.parent; diff --git a/kipper/core/src/compiler/semantics/analyser/type-checker.ts b/kipper/core/src/compiler/semantics/analyser/type-checker.ts index cf3b44a27..1377c8226 100644 --- a/kipper/core/src/compiler/semantics/analyser/type-checker.ts +++ b/kipper/core/src/compiler/semantics/analyser/type-checker.ts @@ -5,7 +5,7 @@ */ import type { BuiltInFunctionArgument } from "../runtime-built-ins"; import type { KipperProgramContext } from "../../program-ctx"; -import type { +import { AssignmentExpression, FunctionDeclaration, IncrementOrDecrementPostfixExpression, @@ -16,7 +16,8 @@ import type { Statement, UnaryExpression, UnaryExpressionSemantics, - LambdaExpression, + LambdaPrimaryExpression, + ArrayPrimaryExpression, } from "../../ast"; import { CompoundStatement, @@ -489,7 +490,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * @throws {IncompleteReturnsInCodePathsError} If not all code paths return a value. * @since 0.10.0 */ - public validReturnCodePathsInFunctionBody(func: FunctionDeclaration | LambdaExpression): void { + public validReturnCodePathsInFunctionBody(func: FunctionDeclaration | LambdaPrimaryExpression): void { const semanticData = func.getSemanticData(); const typeData = func.getTypeSemanticData(); const returnType = typeData.returnType; @@ -580,8 +581,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { return; } - // TODO! Add support for 'object' types once they are implemented - if (objType !== BuiltInTypes.str && objType !== BuiltInTypes.list) { + if (!objType.isAssignableTo(BuiltInTypes.str) && !objType.isAssignableTo(BuiltInTypes.Array)) { throw this.assertError(new ValueNotIndexableTypeError(objType.identifier)); } } @@ -713,4 +713,26 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { ); } } + + /** + * Checks whether the passed array expression is valid. + * + * This for now only checks that the types of the array elements are always the same. + * @param param The array primary expression to check. + */ + validArrayExpression(param: ArrayPrimaryExpression) { + const children = param.getSemanticData().value; + if (children.length > 0) { + const expectedType = children[0].getTypeSemanticData().evaluatedType; + + for (const child of children) { + if (child.getTypeSemanticData().evaluatedType !== expectedType) { + // Arrays may only have a single type of elements (for now) + throw this.notImplementedError( + new KipperNotImplementedError("Arrays with multiple types of elements are not implemented yet."), + ); + } + } + } + } } diff --git a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-function-declaration.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-function-declaration.ts index b9ffbd055..b26d39277 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-function-declaration.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-function-declaration.ts @@ -96,7 +96,7 @@ export class ScopeFunctionDeclaration extends ScopeDeclaration { * @since 0.10.0 */ public get type(): ProcessedType { - return BuiltInTypes.func; + return BuiltInTypes.Func; } /** diff --git a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts index 21b06566a..98fbf8aef 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-parameter-declaration.ts @@ -5,7 +5,7 @@ import { ScopeDeclaration } from "./scope-declaration"; import type { FunctionDeclaration, - LambdaExpression, + LambdaPrimaryExpression, ParameterDeclaration, ParameterDeclarationSemantics, ParameterDeclarationTypeSemantics, @@ -111,7 +111,7 @@ export class ScopeParameterDeclaration extends ScopeDeclaration { * Returns the function this parameter is defined in. * @since 0.10.0 */ - public get func(): FunctionDeclaration | LambdaExpression { + public get func(): FunctionDeclaration | LambdaPrimaryExpression { return this.semanticData.func; } @@ -142,6 +142,6 @@ export class ScopeParameterDeclaration extends ScopeDeclaration { * @since 0.10.0 */ public get isCallable(): boolean { - return this.type === BuiltInTypes.func; + return this.type === BuiltInTypes.Func; } } diff --git a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts index ccffe7131..1a11ad0c3 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/entry/scope-variable-declaration.ts @@ -155,6 +155,6 @@ export class ScopeVariableDeclaration extends ScopeDeclaration { * @since 0.10.0 */ public get isCallable(): boolean { - return this.type === BuiltInTypes.func; + return this.type === BuiltInTypes.Func; } } diff --git a/kipper/core/src/compiler/semantics/symbol-table/function-scope.ts b/kipper/core/src/compiler/semantics/symbol-table/function-scope.ts index ef568efdf..3b451089b 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/function-scope.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/function-scope.ts @@ -3,7 +3,7 @@ * the global namespace. * @since 0.8.0 */ -import type { FunctionDeclaration, LambdaExpression, ParameterDeclaration } from "../../ast"; +import type { FunctionDeclaration, LambdaPrimaryExpression, ParameterDeclaration } from "../../ast"; import type { ScopeDeclaration } from "./entry"; import { ScopeParameterDeclaration } from "./entry"; import { LocalScope } from "./local-scope"; @@ -15,7 +15,7 @@ import { LocalScope } from "./local-scope"; export class FunctionScope extends LocalScope { protected readonly _arguments: Map; - constructor(public ctx: FunctionDeclaration | LambdaExpression) { + constructor(public ctx: FunctionDeclaration | LambdaPrimaryExpression) { super(ctx); this._arguments = new Map(); } diff --git a/kipper/core/src/compiler/semantics/symbol-table/universum-scope.ts b/kipper/core/src/compiler/semantics/symbol-table/universum-scope.ts index f9fefe5f1..5136f975f 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/universum-scope.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/universum-scope.ts @@ -1,25 +1,40 @@ import { Scope } from "./base"; import type { ScopeDeclaration } from "./entry"; import { ScopeFunctionDeclaration, ScopeTypeDeclaration, ScopeVariableDeclaration } from "./entry"; -import { BuiltInType } from "../types"; +import type { BuiltInType } from "../types"; import type { KipperProgramContext } from "../../program-ctx"; import { BuiltInFunction, BuiltInVariable } from "../runtime-built-ins"; import type { KipperBuiltInTypeLiteral } from "../../const"; +import { + BuiltInTypeArray, + BuiltInTypeBool, + BuiltInTypeFunc, + BuiltInTypeNull, + BuiltInTypeNum, + BuiltInTypeStr, + BuiltInTypeType, + BuiltInTypeUndefined, + BuiltInTypeVoid, +} from "../types/built-in"; +import { BuiltInTypeAny } from "../types/built-in/any"; + +const any = new BuiltInTypeAny(); /** * Contains all the built-in types that are used in the type analysis phase. * @since 0.11.0 */ export const BuiltInTypes = { - type: new BuiltInType("type"), - undefined: new BuiltInType("undefined"), - void: new BuiltInType("void"), - null: new BuiltInType("null"), - bool: new BuiltInType("bool"), - num: new BuiltInType("num"), - str: new BuiltInType("str"), - func: new BuiltInType("func"), - list: new BuiltInType("list"), + any: any, + type: new BuiltInTypeType(), + undefined: new BuiltInTypeUndefined(), + void: new BuiltInTypeVoid(), + null: new BuiltInTypeNull(), + bool: new BuiltInTypeBool(), + num: new BuiltInTypeNum(), + str: new BuiltInTypeStr(), + Func: new BuiltInTypeFunc(), + Array: new BuiltInTypeArray(any), } satisfies Record; /** diff --git a/kipper/core/src/compiler/semantics/types/built-in-type.ts b/kipper/core/src/compiler/semantics/types/base/built-in-type.ts similarity index 76% rename from kipper/core/src/compiler/semantics/types/built-in-type.ts rename to kipper/core/src/compiler/semantics/types/base/built-in-type.ts index 1a4a2b0e1..4b4f1a494 100644 --- a/kipper/core/src/compiler/semantics/types/built-in-type.ts +++ b/kipper/core/src/compiler/semantics/types/base/built-in-type.ts @@ -1,13 +1,13 @@ -import { ProcessedType } from "./base/processed-type"; -import type { KipperBuiltInTypeLiteral } from "../../const"; -import type { CompilableType } from "./base/compilable-type"; -import { ArgumentAssignmentTypeError, AssignmentTypeError, PropertyAssignmentTypeError } from "../../../errors"; +import { ProcessedType } from "./processed-type"; +import type { KipperBuiltInTypeLiteral } from "../../../const"; +import { ArgumentAssignmentTypeError, AssignmentTypeError, PropertyAssignmentTypeError } from "../../../../errors"; +import { BuiltInTypes } from "../../symbol-table"; /** * Represents a built-in type that is used in the type analysis phase. * @since 0.11.0 */ -export class BuiltInType extends ProcessedType implements CompilableType { +export abstract class BuiltInType extends ProcessedType { public static readonly interchangeableTypes = ["void", "undefined"]; public constructor(identifier: KipperBuiltInTypeLiteral) { @@ -17,10 +17,10 @@ export class BuiltInType extends ProcessedType implements CompilableType { /** * Returns whether the type is compilable. * - * This is ALWAYS true, since built-in types are always compilable. + * This is usually true for built-in types, but for generics it depends on the generic type arguments. * @since 0.11.0 */ - public get isCompilable(): true { + public get isCompilable(): boolean { return true; } @@ -35,7 +35,7 @@ export class BuiltInType extends ProcessedType implements CompilableType { * @since 0.11.0 */ public assertAssignableTo(type: ProcessedType, propertyName?: string, argumentName?: string): void { - if (this === type) { + if (this === type || type === BuiltInTypes.any) { return; } else if ( BuiltInType.interchangeableTypes.includes(this.identifier) && diff --git a/kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts b/kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts new file mode 100644 index 000000000..6e47e4f9f --- /dev/null +++ b/kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts @@ -0,0 +1,54 @@ +import { BuiltInType } from "./built-in-type"; +import type { GenericType, GenericTypeArguments } from "./generic-type"; +import type { KipperBuiltInTypeLiteral } from "../../../const"; +import type { ProcessedType } from "./index"; + +/** + * Represents a generic built-in type that is used in the type analysis phase. + * @since 0.12.0 + */ +export abstract class GenericBuiltInType extends BuiltInType implements GenericType { + /** + * The generic type arguments for this type. + * @since 0.12.0 + */ + public readonly genericTypeArguments: GenericTypeArguments; + + protected constructor(identifier: KipperBuiltInTypeLiteral, genericTypeArguments: GenericTypeArguments) { + super(identifier); + this.genericTypeArguments = genericTypeArguments; + } + + /** + * Returns the identifiers of the generic type arguments. + * @since 0.12.0 + */ + public get genericTypeArgumentIdentifiers(): Array { + return Object.values(this.genericTypeArguments).map((arg) => arg.identifier); + } + + /** + * Returns whether the type is a generic type. + * + * This is ALWAYS true, since this is a generic type. + * @since 0.12.0 + */ + public get isGeneric(): true { + return true; + } + + /** + * Asserts that this type is assignable to another type. + * + * This will check for generic type arguments as well. + * @pasram type The type to check against. + * @param propertyName The name of the property that is being assigned. This is used for error messages. + * @param argumentName The name of the argument that is being assigned to. This is used for error messages. + * @throws AssignmentTypeError If the types are not assignable. + * @throws PropertyAssignmentTypeError If a property is not assignable. + * @throws ArgumentAssignmentTypeError If an argument is not assignable. + * @since 0.12.0 + * @override + */ + public abstract assertAssignableTo(type: ProcessedType, propertyName?: string, argumentName?: string): void; +} diff --git a/kipper/core/src/compiler/semantics/types/base/generic-type.ts b/kipper/core/src/compiler/semantics/types/base/generic-type.ts new file mode 100644 index 000000000..64e1e94f8 --- /dev/null +++ b/kipper/core/src/compiler/semantics/types/base/generic-type.ts @@ -0,0 +1,24 @@ +import type { BuiltInType } from "./built-in-type"; + +/** + * Represents the generic type arguments for a generic type. + * @since 0.12.0 + */ +export type GenericTypeArguments = Array<{ identifier: string; type: BuiltInType }>; + +/** + * Represents a type which takes in generic type arguments. + * @since 0.12.0 + */ +export interface GenericType { + /** + * Returns whether the type is a generic type. + * @since 0.12.0 + */ + readonly isGeneric: true; + /** + * The generic type arguments for this type. + * @since 0.12.0 + */ + readonly genericTypeArguments: GenericTypeArguments; +} diff --git a/kipper/core/src/compiler/semantics/types/base/index.ts b/kipper/core/src/compiler/semantics/types/base/index.ts index 6b44e81e4..16a4fee71 100644 --- a/kipper/core/src/compiler/semantics/types/base/index.ts +++ b/kipper/core/src/compiler/semantics/types/base/index.ts @@ -5,3 +5,6 @@ export * from "./type"; export * from "./processed-type"; export * from "./compilable-type"; +export * from "./generic-type"; +export * from "./generic-built-in-type"; +export * from "./built-in-type"; diff --git a/kipper/core/src/compiler/semantics/types/base/processed-type.ts b/kipper/core/src/compiler/semantics/types/base/processed-type.ts index 0b8ea29b3..65957c90c 100644 --- a/kipper/core/src/compiler/semantics/types/base/processed-type.ts +++ b/kipper/core/src/compiler/semantics/types/base/processed-type.ts @@ -1,5 +1,5 @@ import type { CompilableType } from "./compilable-type"; -import { TypeNotCompilableError, type TypeError } from "../../../../errors"; +import { type TypeError, TypeNotCompilableError } from "../../../../errors"; import { Type } from "./type"; /** @@ -28,6 +28,16 @@ export abstract class ProcessedType extends Type { */ public abstract get isCompilable(): boolean; + /** + * Returns whether the type is a generic type. + * + * This is false unless overridden by a subclass. + * @since 0.12.0 + */ + public get isGeneric(): boolean { + return false; + } + /** * Gets the compilable type for this type. * @@ -46,7 +56,7 @@ export abstract class ProcessedType extends Type { } /** - * Returns whether this type is assignable to the given {@link type}. + * Asserts that this type is assignable to the given {@link type}. * @param type The type to check against. * @param propertyName The name of the property that is being assigned. This is used for error messages. * @param argumentName The name of the argument that is being assigned to. This is used for error messages. @@ -54,4 +64,20 @@ export abstract class ProcessedType extends Type { * @since 0.12.0 */ public abstract assertAssignableTo(type: ProcessedType, propertyName?: string, argumentName?: string): void; + + /** + * Returns whether this type is assignable to the given {@link type}. This discards any error messages. + * + * This simply returns whether the {@link assertAssignableTo} function throws an error or not. + * @param type The type to check against. + * @since 0.12.0 + */ + public isAssignableTo(type: ProcessedType): boolean { + try { + this.assertAssignableTo(type); + return true; + } catch (e) { + return false; + } + } } diff --git a/kipper/core/src/compiler/semantics/types/built-in/any.ts b/kipper/core/src/compiler/semantics/types/built-in/any.ts new file mode 100644 index 000000000..09e14e33b --- /dev/null +++ b/kipper/core/src/compiler/semantics/types/built-in/any.ts @@ -0,0 +1,41 @@ +import type { ProcessedType } from "../../types"; +import { BuiltInType, type CompilableType } from "../../types"; +import { ArgumentAssignmentTypeError, AssignmentTypeError, PropertyAssignmentTypeError } from "../../../../errors"; + +/** + * Represents the built-in type `any`. + * @since 0.12.0 + */ +export class BuiltInTypeAny extends BuiltInType implements CompilableType { + constructor() { + super("any"); + } + + /** + * Returns whether the type is a compilable type. + * + * This is always true for the built-in type `any`. + * @since 0.12.0 + */ + public get isCompilable(): true { + return true; + } + + /** + * Asserts that the type is assignable to another type. + * + * This can only be true if the other type is also `any`. + * @since 0.12.0 + */ + public assertAssignableTo(type: ProcessedType, propertyName?: string, argumentName?: string) { + if (this === type) { + return; + } else if (propertyName) { + throw new PropertyAssignmentTypeError(propertyName, type.identifier, this.identifier); + } else if (argumentName) { + throw new ArgumentAssignmentTypeError(argumentName, type.identifier, this.identifier); + } else { + throw new AssignmentTypeError(type.identifier, this.identifier); + } + } +} diff --git a/kipper/core/src/compiler/semantics/types/built-in/array.ts b/kipper/core/src/compiler/semantics/types/built-in/array.ts new file mode 100644 index 000000000..609aa0b4d --- /dev/null +++ b/kipper/core/src/compiler/semantics/types/built-in/array.ts @@ -0,0 +1,82 @@ +import { GenericBuiltInType } from "../base/generic-built-in-type"; +import type { ProcessedType } from "../index"; +import type { TypeError } from "../../../../errors"; +import { + ArgumentAssignmentTypeError, + AssignmentTypeError, + GenericArgumentTypeError, + PropertyAssignmentTypeError, +} from "../../../../errors"; +import { BuiltInTypes } from "../../symbol-table"; + +/** + * Represents the built-in type `Array`. + * + * This is a generic type, which takes in exactly one type argument. + * @since 0.12.0 + */ +export class BuiltInTypeArray extends GenericBuiltInType { + constructor(genericTypeArgument: ProcessedType) { + super("Array", [{ identifier: "T", type: genericTypeArgument }]); + } + + /** + * Returns whether the type is compilable. + * @since 0.12.0 + */ + public get isCompilable(): boolean { + return this.genericTypeArguments[0].type.isCompilable; + } + + public assertAssignableTo(type: ProcessedType, propertyName?: string, argumentName?: string) { + if (this === type || type === BuiltInTypes.any) { + return; + } + + let e: TypeError | undefined = undefined; + if ( + type instanceof BuiltInTypeArray && + this.genericTypeArguments.length === (type).genericTypeArguments.length + ) { + try { + this.genericTypeArguments[0].type.assertAssignableTo((type).genericTypeArguments[0].type); + return; + } catch (typeError) { + e = new GenericArgumentTypeError( + (type).genericTypeArguments[0].identifier, + (type).genericTypeArguments[0].type.identifier, + this.genericTypeArguments[0].type.identifier, + typeError, + ); + } + } + + if (propertyName) { + throw new PropertyAssignmentTypeError( + propertyName, + type.identifier, + this.identifier, + e, + (type).genericTypeArgumentIdentifiers, + this.genericTypeArgumentIdentifiers, + ); + } else if (argumentName) { + throw new ArgumentAssignmentTypeError( + argumentName, + type.identifier, + this.identifier, + e, + (type).genericTypeArgumentIdentifiers, + this.genericTypeArgumentIdentifiers, + ); + } else { + throw new AssignmentTypeError( + type.identifier, + this.identifier, + e, + (type).genericTypeArgumentIdentifiers, + this.genericTypeArgumentIdentifiers, + ); + } + } +} diff --git a/kipper/core/src/compiler/semantics/types/built-in/bool.ts b/kipper/core/src/compiler/semantics/types/built-in/bool.ts new file mode 100644 index 000000000..ab40159ab --- /dev/null +++ b/kipper/core/src/compiler/semantics/types/built-in/bool.ts @@ -0,0 +1,21 @@ +import { BuiltInType, type CompilableType } from "../index"; + +/** + * Represents the built-in type `bool`. + * @since 0.12.0 + */ +export class BuiltInTypeBool extends BuiltInType implements CompilableType { + constructor() { + super("bool"); + } + + /** + * Returns whether the type is a compilable type. + * + * This is always true for the built-in type `bool`. + * @since 0.12.0 + */ + public get isCompilable(): true { + return true; + } +} diff --git a/kipper/core/src/compiler/semantics/types/built-in/func.ts b/kipper/core/src/compiler/semantics/types/built-in/func.ts new file mode 100644 index 000000000..ae11ee981 --- /dev/null +++ b/kipper/core/src/compiler/semantics/types/built-in/func.ts @@ -0,0 +1,40 @@ +import { GenericBuiltInType } from "../base/generic-built-in-type"; +import type { ProcessedType } from "../index"; +import { + ArgumentAssignmentTypeError, + AssignmentTypeError, + KipperInternalError, + PropertyAssignmentTypeError, +} from "../../../../errors"; + +/** + * Represents the built-in type `Func`. + * @since 0.12.0 + */ +export class BuiltInTypeFunc extends GenericBuiltInType { + constructor() { + super("Func", []); + } + + /** + * Returns whether the type is compilable. + * @since 0.12.0 + */ + public get isCompilable(): boolean { + // TODO! Implement generic type arguments + return true; + } + + public assertAssignableTo(type: ProcessedType, propertyName?: string, argumentName?: string) { + // TODO! Implement generic type arguments and function signature checking + if (this === type) { + return; + } else if (propertyName) { + throw new PropertyAssignmentTypeError(propertyName, type.identifier, this.identifier); + } else if (argumentName) { + throw new ArgumentAssignmentTypeError(argumentName, type.identifier, this.identifier); + } else { + throw new AssignmentTypeError(type.identifier, this.identifier); + } + } +} diff --git a/kipper/core/src/compiler/semantics/types/built-in/index.ts b/kipper/core/src/compiler/semantics/types/built-in/index.ts new file mode 100644 index 000000000..533b48613 --- /dev/null +++ b/kipper/core/src/compiler/semantics/types/built-in/index.ts @@ -0,0 +1,13 @@ +/** + * All built-in types in the Kipper language. + * @since 0.12.0 + */ +export * from "./array"; +export * from "./bool"; +export * from "./func"; +export * from "./null"; +export * from "./num"; +export * from "./str"; +export * from "./type"; +export * from "./undefined"; +export * from "./void"; diff --git a/kipper/core/src/compiler/semantics/types/built-in/null.ts b/kipper/core/src/compiler/semantics/types/built-in/null.ts new file mode 100644 index 000000000..753b98f25 --- /dev/null +++ b/kipper/core/src/compiler/semantics/types/built-in/null.ts @@ -0,0 +1,21 @@ +import { BuiltInType, type CompilableType } from "../index"; + +/** + * Represents the built-in type `null`. + * @since 0.12.0 + */ +export class BuiltInTypeNull extends BuiltInType implements CompilableType { + constructor() { + super("null"); + } + + /** + * Returns whether the type is a compilable type. + * + * This is always true for the built-in type `null`. + * @since 0.12.0 + */ + public get isCompilable(): true { + return true; + } +} diff --git a/kipper/core/src/compiler/semantics/types/built-in/num.ts b/kipper/core/src/compiler/semantics/types/built-in/num.ts new file mode 100644 index 000000000..556365457 --- /dev/null +++ b/kipper/core/src/compiler/semantics/types/built-in/num.ts @@ -0,0 +1,21 @@ +import { BuiltInType, type CompilableType } from "../index"; + +/** + * Represents the built-in type `num`. + * @since 0.12.0 + */ +export class BuiltInTypeNum extends BuiltInType implements CompilableType { + constructor() { + super("num"); + } + + /** + * Returns whether the type is a compilable type. + * + * This is always true for the built-in type `num`. + * @since 0.12.0 + */ + public get isCompilable(): true { + return true; + } +} diff --git a/kipper/core/src/compiler/semantics/types/built-in/str.ts b/kipper/core/src/compiler/semantics/types/built-in/str.ts new file mode 100644 index 000000000..7b1ffb826 --- /dev/null +++ b/kipper/core/src/compiler/semantics/types/built-in/str.ts @@ -0,0 +1,21 @@ +import { BuiltInType, type CompilableType } from "../index"; + +/** + * Represents the built-in type `str`. + * @since 0.12.0 + */ +export class BuiltInTypeStr extends BuiltInType implements CompilableType { + constructor() { + super("str"); + } + + /** + * Returns whether the type is a compilable type. + * + * This is always true for the built-in type `str`. + * @since 0.12.0 + */ + public get isCompilable(): true { + return true; + } +} diff --git a/kipper/core/src/compiler/semantics/types/built-in/type.ts b/kipper/core/src/compiler/semantics/types/built-in/type.ts new file mode 100644 index 000000000..43c69eebf --- /dev/null +++ b/kipper/core/src/compiler/semantics/types/built-in/type.ts @@ -0,0 +1,21 @@ +import { BuiltInType, type CompilableType } from "../index"; + +/** + * Represents the built-in type `type`. + * @since 0.12.0 + */ +export class BuiltInTypeType extends BuiltInType implements CompilableType { + constructor() { + super("type"); + } + + /** + * Returns whether the type is a compilable type. + * + * This is always true for the built-in type `type`. + * @since 0.12.0 + */ + public get isCompilable(): true { + return true; + } +} diff --git a/kipper/core/src/compiler/semantics/types/built-in/undefined.ts b/kipper/core/src/compiler/semantics/types/built-in/undefined.ts new file mode 100644 index 000000000..eb58290f0 --- /dev/null +++ b/kipper/core/src/compiler/semantics/types/built-in/undefined.ts @@ -0,0 +1,21 @@ +import { BuiltInType, type CompilableType } from "../index"; + +/** + * Represents the built-in type `undefined`. + * @since 0.12.0 + */ +export class BuiltInTypeUndefined extends BuiltInType implements CompilableType { + constructor() { + super("undefined"); + } + + /** + * Returns whether the type is a compilable type. + * + * This is always true for the built-in type `undefined`. + * @since 0.12.0 + */ + public get isCompilable(): true { + return true; + } +} diff --git a/kipper/core/src/compiler/semantics/types/built-in/void.ts b/kipper/core/src/compiler/semantics/types/built-in/void.ts new file mode 100644 index 000000000..86d04ff49 --- /dev/null +++ b/kipper/core/src/compiler/semantics/types/built-in/void.ts @@ -0,0 +1,21 @@ +import { BuiltInType, type CompilableType } from "../index"; + +/** + * Represents the built-in type `void`. + * @since 0.12.0 + */ +export class BuiltInTypeVoid extends BuiltInType implements CompilableType { + constructor() { + super("void"); + } + + /** + * Returns whether the type is a compilable type. + * + * This is always true for the built-in type `void`. + * @since 0.12.0 + */ + public get isCompilable(): true { + return true; + } +} diff --git a/kipper/core/src/compiler/semantics/types/custom-type.ts b/kipper/core/src/compiler/semantics/types/custom-type.ts index a843f899a..eb13fcfc0 100644 --- a/kipper/core/src/compiler/semantics/types/custom-type.ts +++ b/kipper/core/src/compiler/semantics/types/custom-type.ts @@ -8,6 +8,7 @@ import { PropertyNotFoundError, } from "../../../errors"; import type { ClassDeclaration, InterfaceDeclaration, ObjectPrimaryExpression } from "../../ast"; +import { BuiltInTypes } from "../symbol-table"; /** * Represents the kind of a custom type. @@ -137,7 +138,7 @@ export class CustomType extends ProcessedType { * @since 0.12.0 */ assertAssignableTo(type: ProcessedType, propertyName?: string, argumentName?: string): void { - if (type === this) { + if (this === type || type === BuiltInTypes.any) { return; } else if (type instanceof CustomType && type.kind === "interface") { for (const [fieldName, fieldType] of this.fields) { diff --git a/kipper/core/src/compiler/semantics/types/index.ts b/kipper/core/src/compiler/semantics/types/index.ts index e46f92fb9..c71d6e5db 100644 --- a/kipper/core/src/compiler/semantics/types/index.ts +++ b/kipper/core/src/compiler/semantics/types/index.ts @@ -3,7 +3,7 @@ * @since 0.11.0 */ export * from "./base/"; +export * from "./built-in/"; export * from "./raw-type"; export * from "./undefined-type"; export * from "./custom-type"; -export * from "./built-in-type"; diff --git a/kipper/core/src/compiler/target-presets/semantic-analyser.ts b/kipper/core/src/compiler/target-presets/semantic-analyser.ts index de09c618f..0e7611e54 100644 --- a/kipper/core/src/compiler/target-presets/semantic-analyser.ts +++ b/kipper/core/src/compiler/target-presets/semantic-analyser.ts @@ -31,7 +31,7 @@ import type { IncrementOrDecrementUnaryExpression, InterfaceDeclaration, JumpStatement, - LambdaExpression, + LambdaPrimaryExpression, LogicalAndExpression, LogicalOrExpression, MemberAccessExpression, @@ -315,7 +315,7 @@ export abstract class KipperTargetSemanticAnalyser extends KipperSemanticErrorHa public abstract assignmentExpression?: TargetASTNodeSemanticAnalyser; /** - * Performs translation-specific semantic analysis for {@link LambdaExpression} instances. + * Performs translation-specific semantic analysis for {@link LambdaPrimaryExpression} instances. */ - public abstract lambdaPrimaryExpression?: 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 e24369b25..ab1a2a55f 100644 --- a/kipper/core/src/compiler/target-presets/translation/code-generator.ts +++ b/kipper/core/src/compiler/target-presets/translation/code-generator.ts @@ -31,7 +31,7 @@ import type { IncrementOrDecrementUnaryExpression, InterfaceDeclaration, JumpStatement, - LambdaExpression, + LambdaPrimaryExpression, LogicalAndExpression, LogicalOrExpression, MemberAccessExpression, @@ -394,7 +394,7 @@ export abstract class KipperTargetCodeGenerator { public abstract assignmentExpression: TargetASTNodeCodeGenerator; /** - * Translates a {@link LambdaExpression} into a specific language. + * Translates a {@link LambdaPrimaryExpression} into a specific language. */ - public abstract lambdaPrimaryExpression: TargetASTNodeCodeGenerator; + public abstract lambdaPrimaryExpression: TargetASTNodeCodeGenerator; } diff --git a/kipper/core/src/errors.ts b/kipper/core/src/errors.ts index 832edc3a5..52dddfbdb 100644 --- a/kipper/core/src/errors.ts +++ b/kipper/core/src/errors.ts @@ -596,9 +596,20 @@ export class BitwiseOperationTypeError extends TypeError { * Error that is thrown whenever an argument is not assignable to the parameter's type. */ export class ArgumentAssignmentTypeError extends TypeError { - constructor(paramIdentifier: string, expectedType: string, receivedType: string, cause?: TypeError) { + constructor( + paramIdentifier: string, + expectedType: string, + receivedType: string, + cause?: TypeError, + expectedGenericTypes?: Array, + receivedGenericTypes?: Array, + ) { super( - `Type '${receivedType}' is not assignable to parameter '${paramIdentifier}' of type '${expectedType}'.`, + `Type '${AssignmentTypeError.formatGenericTypes(receivedType, expectedGenericTypes)}' is not assignable` + + `to parameter '${paramIdentifier}' of type '${AssignmentTypeError.formatGenericTypes( + expectedType, + receivedGenericTypes, + )}'.`, cause, ); } @@ -611,8 +622,23 @@ export class ArgumentAssignmentTypeError extends TypeError { * @since 0.8.3 */ export class AssignmentTypeError extends TypeError { - constructor(leftExpType: string, rightExpType: string, cause?: TypeError) { - super(`Type '${rightExpType}' is not assignable to type '${leftExpType}'.`, cause); + constructor( + leftExpType: string, + rightExpType: string, + cause?: TypeError, + leftExpGenericTypes?: Array, + rightExpGenericTypes?: Array, + ) { + super( + `Type '${AssignmentTypeError.formatGenericTypes(leftExpType, leftExpGenericTypes)}' is not assignable` + + `to type '${AssignmentTypeError.formatGenericTypes(rightExpType, rightExpGenericTypes)}'.`, + cause, + ); + } + + static formatGenericTypes(identifier: string, genericTypes?: Array): string { + const params = genericTypes?.join(", "); + return `${identifier}${params ? `<${params}>` : ""}`; } } @@ -621,8 +647,22 @@ export class AssignmentTypeError extends TypeError { * @since 0.11.0 */ export class PropertyAssignmentTypeError extends TypeError { - constructor(identifier: string, propertyType: string, valueType: string, cause?: TypeError) { - super(`Type '${valueType}' is not assignable to property '${identifier}' of type '${propertyType}'.`, cause); + constructor( + identifier: string, + propertyType: string, + valueType: string, + cause?: TypeError, + propertyGenericTypes?: Array, + valueGenericTypes?: Array, + ) { + super( + `Type '${AssignmentTypeError.formatGenericTypes(valueType, propertyGenericTypes)}' is not assignable to ` + + `property '${identifier}' of type '${AssignmentTypeError.formatGenericTypes( + propertyType, + valueGenericTypes, + )}'.`, + cause, + ); } } @@ -636,6 +676,16 @@ export class PropertyNotFoundError extends TypeError { } } +/** + * Error that is thrown whenever a generic argument is used that is not assignable to the expected type. + * @since 0.12.0 + */ +export class GenericArgumentTypeError extends TypeError { + constructor(identifier: string, expectedType: string, receivedType: string, cause?: TypeError) { + super(`Type '${receivedType}' is not assignable to generic argument '${identifier}' of type '${expectedType}'.`); + } +} + /** * Error that is thrown whenever a read-only variable is being assigned to. * @since 0.8.3 diff --git a/kipper/target-js/src/code-generator.ts b/kipper/target-js/src/code-generator.ts index 56b2196a4..6b982553b 100644 --- a/kipper/target-js/src/code-generator.ts +++ b/kipper/target-js/src/code-generator.ts @@ -31,7 +31,7 @@ import type { IncrementOrDecrementUnaryExpression, JumpStatement, KipperProgramContext, - LambdaExpression, + LambdaPrimaryExpression, LogicalAndExpression, LogicalExpression, LogicalExpressionSemantics, @@ -799,9 +799,9 @@ export class JavaScriptTargetCodeGenerator extends KipperTargetCodeGenerator { }; /** - * Translates a {@link LambdaExpression} into the JavaScript language. + * Translates a {@link LambdaPrimaryExpression} into the JavaScript language. */ - lambdaPrimaryExpression = async (node: LambdaExpression): Promise => { + lambdaPrimaryExpression = async (node: LambdaPrimaryExpression): Promise => { // Step 1: Extract Semantic Data const semanticData = node.getSemanticData(); const params = semanticData.params; From 6e45a04ed77c4455b9277d24efeae540a0d0abf9 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Fri, 12 Jul 2024 16:12:54 +0200 Subject: [PATCH 31/57] minor (#499): Added semantic checking and type-checking for arrays --- .../array-primary-expression-type-semantics.ts | 9 ++++++++- .../array-primary-expression.ts | 11 ++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/array-primary-expression/array-primary-expression-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/array-primary-expression/array-primary-expression-type-semantics.ts index d1c274d55..3aebc5838 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/array-primary-expression/array-primary-expression-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/array-primary-expression/array-primary-expression-type-semantics.ts @@ -3,9 +3,16 @@ * @since 0.10.0 */ import type { PrimaryExpressionTypeSemantics } from "../primary-expression-type-semantics"; +import { ProcessedType } from "../../../../../semantics"; /** * Type semantics for AST Node {@link ArrayPrimaryExpression}. * @since 0.10.0 */ -export interface ArrayPrimaryExpressionTypeSemantics extends PrimaryExpressionTypeSemantics {} +export interface ArrayPrimaryExpressionTypeSemantics extends PrimaryExpressionTypeSemantics { + /** + * The value type that each member of the array evaluates to. + * @since 0.12.0 + */ + valueType: ProcessedType; +} 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 04bdffafa..f0b9ce820 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 @@ -9,6 +9,7 @@ import type { ArrayPrimaryExpressionContext } from "../../../../../lexer-parser" import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; import { BuiltInTypes } from "../../../../../semantics"; import { PrimaryExpression } from "../primary-expression"; +import { BuiltInTypeArray } from "../../../../../semantics/types/built-in"; /** * List constant expression, which represents a list constant that was defined in the source code. @@ -82,7 +83,7 @@ export class ArrayPrimaryExpression extends PrimaryExpression< */ public async primarySemanticAnalysis(): Promise { this.semanticData = { - value: [], // TODO! Implement list data fetching. + value: this.children, }; } @@ -95,9 +96,13 @@ export class ArrayPrimaryExpression extends PrimaryExpression< * @since 0.7.0 */ public async primarySemanticTypeChecking(): Promise { - // This will always be of type 'list' + this.programCtx.typeCheck(this).validArrayExpression(this); + + const valueType = + this.children.length > 1 ? this.children[0].getTypeSemanticData().evaluatedType : BuiltInTypes.any; this.typeSemantics = { - evaluatedType: BuiltInTypes.list, + evaluatedType: new BuiltInTypeArray(valueType), + valueType, }; } From fbf8c2729ab30bb9e797d6fa61ca3df6a87bb751 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Fri, 12 Jul 2024 16:18:15 +0200 Subject: [PATCH 32/57] minor (#499): Added code translation for arrays --- kipper/target-js/src/code-generator.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/kipper/target-js/src/code-generator.ts b/kipper/target-js/src/code-generator.ts index 6b982553b..d3f3502ec 100644 --- a/kipper/target-js/src/code-generator.ts +++ b/kipper/target-js/src/code-generator.ts @@ -432,7 +432,14 @@ export class JavaScriptTargetCodeGenerator extends KipperTargetCodeGenerator { * Translates a {@link ArrayPrimaryExpression} into the JavaScript language. */ arrayPrimaryExpression = async (node: ArrayPrimaryExpression): Promise => { - return []; + const values = node.getSemanticData().value; + const translatedValues: Array = await Promise.all( + values.map(async (value, i) => { + const exp = await value.translateCtxAndChildren(); + return [...exp, i + 1 === values.length ? "" : ", "]; + }), + ); + return ["[", ...translatedValues.flat(), "]"]; }; /** From 86d0e429ed56a66b25d069ec9677837fd2adc8af Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Fri, 12 Jul 2024 16:53:44 +0200 Subject: [PATCH 33/57] minor (#499): Implemented generic type specifier semantic analysis and type checking This commit now allows variables and parameters to be specified using generic syntax --- kipper/core/KipperParser.g4 | 2 +- .../function-declaration.ts | 2 +- .../parameter-declaration.ts | 2 +- .../interface-property-declaration.ts | 2 +- .../variable-declaration.ts | 2 +- .../cast-or-convert-expression.ts | 2 +- ...array-primary-expression-type-semantics.ts | 2 +- .../lambda-primary-expression.ts | 2 +- ...ric-type-specifier-expression-semantics.ts | 7 +++- .../generic-type-specifier-expression.ts | 33 +++++++++++++++---- ...ier-type-specifier-expression-semantics.ts | 10 +----- .../identifier-type-specifier-expression.ts | 4 +-- .../type-specifier-expression-semantics.ts | 10 +++++- .../lexer-parser/antlr/KipperParser.interp | 2 +- .../lexer-parser/antlr/KipperParser.ts | 17 ++++------ .../semantics/analyser/type-checker.ts | 23 +++++++++++-- .../types/base/generic-built-in-type.ts | 3 ++ .../semantics/types/base/generic-type.ts | 14 ++++++-- .../semantics/types/built-in/array.ts | 12 +++++++ .../compiler/semantics/types/built-in/func.ts | 11 +++++++ kipper/core/src/errors.ts | 24 ++++++++++++++ kipper/target-ts/src/code-generator.ts | 2 +- 22 files changed, 143 insertions(+), 45 deletions(-) diff --git a/kipper/core/KipperParser.g4 b/kipper/core/KipperParser.g4 index 44c61d930..582cb42b1 100644 --- a/kipper/core/KipperParser.g4 +++ b/kipper/core/KipperParser.g4 @@ -406,7 +406,7 @@ identifierTypeSpecifierExpression ; genericTypeSpecifierExpression - : typeSpecifierIdentifier '<' typeSpecifierIdentifier '>' + : typeSpecifierIdentifier '<' typeSpecifierExpression '>' ; typeofTypeSpecifierExpression 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 000f581ff..1e8aa46c4 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 @@ -174,7 +174,7 @@ export class FunctionDeclaration this.programCtx.semanticCheck(this).validFunctionBody(body); const identifier = this.tokenStream.getText(declaratorCtx.sourceInterval); - const returnType: RawType = retTypeSpecifier.getSemanticData().typeIdentifier; + const returnType: RawType = retTypeSpecifier.getSemanticData().rawType; this.semanticData = { isDefined: parseTreeChildren.find((val) => val instanceof CompoundStatementContext) !== undefined, 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 8bde5acde..a9675c5d9 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 @@ -131,7 +131,7 @@ export class ParameterDeclaration extends Declaration< this.semanticData = { identifier: getParseTreeSource(this.tokenStream, parseTreeChildren[0]), valueTypeSpecifier: typeSpecifier, - valueType: typeSpecifier.getSemanticData().typeIdentifier, + valueType: typeSpecifier.getSemanticData().rawType, func: this.parent, }; 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 index dcc10d3da..41ae9e1bc 100644 --- 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 @@ -119,7 +119,7 @@ export class InterfacePropertyDeclaration extends InterfaceMemberDeclaration< this.semanticData = { identifier: identifier, typeSpecifier: typeSpecifier, - type: typeSpecifier.getSemanticData().typeIdentifier, + type: typeSpecifier.getSemanticData().rawType, }; } 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 b4f8f2508..c5731051e 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 @@ -160,7 +160,7 @@ export class VariableDeclaration extends Declarationthis.tokenStream.getText(storageTypeCtx.sourceInterval); - const valueType: RawType = typeSpecifier.getSemanticData().typeIdentifier; + const valueType: RawType = typeSpecifier.getSemanticData().rawType; this.semanticData = { isDefined: isDefined, diff --git a/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression.ts index 77dabef94..a6bae5388 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/cast-or-convert-expression/cast-or-convert-expression.ts @@ -100,7 +100,7 @@ export class CastOrConvertExpression extends Expression< // Get the type using the type specifier const typeSpecifier = this.children[1]; - const type: RawType = typeSpecifier.getSemanticData().typeIdentifier; + const type: RawType = typeSpecifier.getSemanticData().rawType; // Ensure that the children are fully present and not undefined if (!exp || !type) { diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/array-primary-expression/array-primary-expression-type-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/array-primary-expression/array-primary-expression-type-semantics.ts index 3aebc5838..18e8a35a5 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/array-primary-expression/array-primary-expression-type-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/array-primary-expression/array-primary-expression-type-semantics.ts @@ -3,7 +3,7 @@ * @since 0.10.0 */ import type { PrimaryExpressionTypeSemantics } from "../primary-expression-type-semantics"; -import { ProcessedType } from "../../../../../semantics"; +import type { ProcessedType } from "../../../../../semantics"; /** * Type semantics for AST Node {@link ArrayPrimaryExpression}. diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/lambda-primary-expression/lambda-primary-expression.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/lambda-primary-expression/lambda-primary-expression.ts index cb2a8c88f..ca1b103f5 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/lambda-primary-expression/lambda-primary-expression.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/lambda-primary-expression/lambda-primary-expression.ts @@ -132,7 +132,7 @@ export class LambdaPrimaryExpression throw new UnableToDetermineSemanticDataError(); } - const retType = retTypeSpecifier.getSemanticData().typeIdentifier; + const retType = retTypeSpecifier.getSemanticData().rawType; this.programCtx.semanticCheck(this).validFunctionBody(body); this.semanticData = { returnType: retType, diff --git a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/generic-type-specifier-expression/generic-type-specifier-expression-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/generic-type-specifier-expression/generic-type-specifier-expression-semantics.ts index 395aa87f7..b4e6e4224 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/generic-type-specifier-expression/generic-type-specifier-expression-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/generic-type-specifier-expression/generic-type-specifier-expression-semantics.ts @@ -3,11 +3,16 @@ * @since 0.8.0 */ import type { TypeSpecifierExpressionSemantics } from "../type-specifier-expression-semantics"; +import type { TypeSpecifierExpression } from "../type-specifier-expression"; /** * Semantics for AST Node {@link GenericTypeSpecifierExpression}. * @since 0.8.0 */ export interface GenericTypeSpecifierExpressionSemantics extends TypeSpecifierExpressionSemantics { - // Not implemented. + /** + * The generic arguments of this generic type specifier expression. + * @since 0.12.0 + */ + genericArguments: TypeSpecifierExpression[]; } 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 dc39d27a4..2ccc76999 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 @@ -10,7 +10,9 @@ import type { CompilableASTNode } from "../../../../compilable-ast-node"; import { TypeSpecifierExpression } from "../type-specifier-expression"; import type { GenericTypeSpecifierExpressionContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import { KipperNotImplementedError } from "../../../../../../errors"; +import { KipperNotImplementedError, UnableToDetermineSemanticDataError } from "../../../../../../errors"; +import type { GenericType } from "../../../../../semantics"; +import { BuiltInTypes, RawType } from "../../../../../semantics"; /** * Generic type specifier expression, which represents a generic type specifier. @@ -85,9 +87,17 @@ export class GenericTypeSpecifierExpression extends TypeSpecifierExpression< * 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("Generic Type Expressions have not been implemented yet.")); + const antlrChildren = this.antlrRuleCtx.children; + if (!antlrChildren?.length) { + throw new UnableToDetermineSemanticDataError(); + } + const identifier = antlrChildren[0].text; + const genericArguments = >this.children.slice(); + + this.semanticData = { + rawType: new RawType(identifier), + genericArguments: genericArguments, + }; } /** @@ -96,9 +106,18 @@ export class GenericTypeSpecifierExpression extends TypeSpecifierExpression< * @since 0.8.0 */ public async primarySemanticTypeChecking(): Promise { - throw this.programCtx - .semanticCheck(this) - .notImplementedError(new KipperNotImplementedError("Generic Type Expressions have not been implemented yet.")); + const semanticData = this.getSemanticData(); + const valueType = this.programCtx.typeCheck(this).getCheckedType(semanticData.rawType, this.scope); + const genericArguments = semanticData.genericArguments.map((arg) => arg.getTypeSemanticData().storedType); + + // Ensure the type is even generic and that there are the correct number of generic arguments + this.programCtx.typeCheck(this).ensureValidGenericType(valueType, genericArguments); + + this.typeSemantics = { + evaluatedType: BuiltInTypes.type, + storedType: (valueType).changeGenericTypeArguments(genericArguments), + }; + console.log(this.typeSemantics); } public checkForWarnings = undefined; // TODO! diff --git a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/identifier-type-specifier-expression/identifier-type-specifier-expression-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/identifier-type-specifier-expression/identifier-type-specifier-expression-semantics.ts index 68b74b568..0732de3a4 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/identifier-type-specifier-expression/identifier-type-specifier-expression-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/identifier-type-specifier-expression/identifier-type-specifier-expression-semantics.ts @@ -2,18 +2,10 @@ * Semantics for AST Node {@link IdentifierTypeSpecifierExpression}. * @since 0.8.0 */ -import type { RawType } from "../../../../../semantics"; import type { TypeSpecifierExpressionSemantics } from "../type-specifier-expression-semantics"; /** * Semantics for AST Node {@link IdentifierTypeSpecifierExpression}. * @since 0.8.0 */ -export interface IdentifierTypeSpecifierExpressionSemantics extends TypeSpecifierExpressionSemantics { - /** - * The type specified by this expression, which per default is an unchecked type as the type is not yet known and - * therefore may be invalid/undefined. - * @since 0.8.0 - */ - typeIdentifier: RawType; -} +export interface IdentifierTypeSpecifierExpressionSemantics extends TypeSpecifierExpressionSemantics {} 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 f39b14fee..4216c98c8 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 @@ -92,7 +92,7 @@ export class IdentifierTypeSpecifierExpression extends TypeSpecifierExpression< */ public async primarySemanticAnalysis(): Promise { this.semanticData = { - typeIdentifier: new RawType(this.sourceCode), + rawType: new RawType(this.sourceCode), }; } @@ -105,7 +105,7 @@ export class IdentifierTypeSpecifierExpression extends TypeSpecifierExpression< const semanticData = this.getSemanticData(); // Create a checked type instance (this function handles error recovery and invalid types) - const valueType = this.programCtx.typeCheck(this).getCheckedType(semanticData.typeIdentifier, this.scope); + const valueType = this.programCtx.typeCheck(this).getCheckedType(semanticData.rawType, this.scope); this.typeSemantics = { // A type specifier will always evaluate to be of type 'type' evaluatedType: BuiltInTypes.type, diff --git a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/type-specifier-expression-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/type-specifier-expression-semantics.ts index 1703316c9..227d5eeb3 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/type-specifier-expression-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/type-specifier-expression/type-specifier-expression-semantics.ts @@ -2,8 +2,16 @@ * Semantics for AST Node {@link TypeSpecifierExpression}. */ import type { ExpressionSemantics } from "../expression-semantics"; +import type { RawType } from "../../../../semantics"; /** * Semantics for AST Node {@link TypeSpecifierExpression}. */ -export interface TypeSpecifierExpressionSemantics extends ExpressionSemantics {} +export interface TypeSpecifierExpressionSemantics extends ExpressionSemantics { + /** + * The type specified by this expression, which per default is an unchecked type as the type is not yet known and + * therefore may be invalid/undefined. + * @since 0.12.0 + */ + rawType: RawType; +} diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.interp b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.interp index 05d344eaa..4ca202f77 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.interp +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.interp @@ -262,4 +262,4 @@ typeSpecifierIdentifier atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 88, 750, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 3, 2, 5, 2, 168, 10, 2, 3, 2, 3, 2, 3, 3, 6, 3, 173, 10, 3, 13, 3, 14, 3, 174, 3, 4, 3, 4, 3, 5, 6, 5, 180, 10, 5, 13, 5, 14, 5, 181, 3, 6, 3, 6, 3, 6, 5, 6, 187, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 195, 10, 7, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 207, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 219, 10, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 225, 10, 14, 3, 15, 3, 15, 3, 15, 7, 15, 230, 10, 15, 12, 15, 14, 15, 233, 11, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 243, 10, 17, 12, 17, 14, 17, 246, 11, 17, 3, 17, 3, 17, 3, 18, 3, 18, 5, 18, 252, 10, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 5, 20, 262, 10, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 280, 10, 22, 3, 23, 3, 23, 3, 23, 5, 23, 285, 10, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 5, 25, 296, 10, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 305, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 7, 27, 313, 10, 27, 12, 27, 14, 27, 316, 11, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 328, 10, 28, 3, 29, 3, 29, 3, 29, 5, 29, 333, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 339, 10, 30, 3, 30, 3, 30, 5, 30, 343, 10, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 349, 10, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 355, 10, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 5, 34, 379, 10, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 393, 10, 35, 3, 36, 3, 36, 5, 36, 397, 10, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 405, 10, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 5, 41, 419, 10, 41, 3, 42, 3, 42, 3, 43, 3, 43, 7, 43, 425, 10, 43, 12, 43, 14, 43, 428, 11, 43, 3, 43, 3, 43, 3, 43, 7, 43, 433, 10, 43, 12, 43, 14, 43, 436, 11, 43, 3, 43, 5, 43, 439, 10, 43, 3, 44, 3, 44, 3, 44, 5, 44, 444, 10, 44, 3, 44, 5, 44, 447, 10, 44, 3, 45, 3, 45, 3, 45, 5, 45, 452, 10, 45, 3, 45, 5, 45, 455, 10, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 7, 47, 463, 10, 47, 12, 47, 14, 47, 466, 11, 47, 5, 47, 468, 10, 47, 3, 47, 5, 47, 471, 10, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 7, 48, 479, 10, 48, 12, 48, 14, 48, 482, 11, 48, 5, 48, 484, 10, 48, 3, 48, 5, 48, 487, 10, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 503, 10, 51, 3, 51, 3, 51, 3, 51, 5, 51, 508, 10, 51, 3, 51, 3, 51, 3, 51, 5, 51, 513, 10, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 7, 51, 529, 10, 51, 12, 51, 14, 51, 532, 11, 51, 3, 52, 3, 52, 3, 52, 7, 52, 537, 10, 52, 12, 52, 14, 52, 540, 11, 52, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 553, 10, 55, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 559, 10, 55, 3, 55, 3, 55, 3, 56, 3, 56, 5, 56, 565, 10, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 5, 58, 573, 10, 58, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 5, 63, 590, 10, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 7, 64, 598, 10, 64, 12, 64, 14, 64, 601, 11, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 7, 65, 609, 10, 65, 12, 65, 14, 65, 612, 11, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 7, 66, 621, 10, 66, 12, 66, 14, 66, 624, 11, 66, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 7, 68, 634, 10, 68, 12, 68, 14, 68, 637, 11, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 7, 69, 645, 10, 69, 12, 69, 14, 69, 648, 11, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 7, 70, 656, 10, 70, 12, 70, 14, 70, 659, 11, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 7, 71, 667, 10, 71, 12, 71, 14, 71, 670, 11, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 7, 72, 678, 10, 72, 12, 72, 14, 72, 681, 11, 72, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 7, 73, 689, 10, 73, 12, 73, 14, 73, 692, 11, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 7, 74, 700, 10, 74, 12, 74, 14, 74, 703, 11, 74, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 5, 75, 712, 10, 75, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 5, 76, 719, 10, 76, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 7, 78, 726, 10, 78, 12, 78, 14, 78, 729, 11, 78, 3, 79, 3, 79, 3, 79, 5, 79, 734, 10, 79, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 2, 2, 13, 100, 126, 128, 130, 134, 136, 138, 140, 142, 144, 146, 84, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 70, 2, 72, 2, 74, 2, 76, 2, 78, 2, 80, 2, 82, 2, 84, 2, 86, 2, 88, 2, 90, 2, 92, 2, 94, 2, 96, 2, 98, 2, 100, 2, 102, 2, 104, 2, 106, 2, 108, 2, 110, 2, 112, 2, 114, 2, 116, 2, 118, 2, 120, 2, 122, 2, 124, 2, 126, 2, 128, 2, 130, 2, 132, 2, 134, 2, 136, 2, 138, 2, 140, 2, 142, 2, 144, 2, 146, 2, 148, 2, 150, 2, 152, 2, 154, 2, 156, 2, 158, 2, 160, 2, 162, 2, 164, 2, 2, 17, 3, 2, 7, 8, 3, 2, 14, 15, 3, 2, 28, 29, 3, 2, 78, 79, 4, 2, 77, 77, 80, 80, 3, 2, 31, 33, 4, 2, 46, 46, 48, 48, 6, 2, 45, 45, 47, 47, 55, 55, 71, 71, 3, 2, 49, 52, 4, 2, 45, 45, 47, 47, 3, 2, 72, 74, 3, 2, 64, 67, 3, 2, 62, 63, 3, 2, 56, 61, 4, 2, 31, 33, 76, 76, 2, 753, 2, 167, 3, 2, 2, 2, 4, 172, 3, 2, 2, 2, 6, 176, 3, 2, 2, 2, 8, 179, 3, 2, 2, 2, 10, 186, 3, 2, 2, 2, 12, 194, 3, 2, 2, 2, 14, 196, 3, 2, 2, 2, 16, 199, 3, 2, 2, 2, 18, 201, 3, 2, 2, 2, 20, 208, 3, 2, 2, 2, 22, 210, 3, 2, 2, 2, 24, 212, 3, 2, 2, 2, 26, 214, 3, 2, 2, 2, 28, 226, 3, 2, 2, 2, 30, 234, 3, 2, 2, 2, 32, 238, 3, 2, 2, 2, 34, 251, 3, 2, 2, 2, 36, 253, 3, 2, 2, 2, 38, 258, 3, 2, 2, 2, 40, 268, 3, 2, 2, 2, 42, 279, 3, 2, 2, 2, 44, 281, 3, 2, 2, 2, 46, 288, 3, 2, 2, 2, 48, 295, 3, 2, 2, 2, 50, 297, 3, 2, 2, 2, 52, 306, 3, 2, 2, 2, 54, 327, 3, 2, 2, 2, 56, 332, 3, 2, 2, 2, 58, 334, 3, 2, 2, 2, 60, 359, 3, 2, 2, 2, 62, 365, 3, 2, 2, 2, 64, 373, 3, 2, 2, 2, 66, 376, 3, 2, 2, 2, 68, 392, 3, 2, 2, 2, 70, 394, 3, 2, 2, 2, 72, 406, 3, 2, 2, 2, 74, 410, 3, 2, 2, 2, 76, 412, 3, 2, 2, 2, 78, 414, 3, 2, 2, 2, 80, 418, 3, 2, 2, 2, 82, 420, 3, 2, 2, 2, 84, 438, 3, 2, 2, 2, 86, 446, 3, 2, 2, 2, 88, 454, 3, 2, 2, 2, 90, 456, 3, 2, 2, 2, 92, 458, 3, 2, 2, 2, 94, 474, 3, 2, 2, 2, 96, 490, 3, 2, 2, 2, 98, 494, 3, 2, 2, 2, 100, 507, 3, 2, 2, 2, 102, 533, 3, 2, 2, 2, 104, 541, 3, 2, 2, 2, 106, 544, 3, 2, 2, 2, 108, 548, 3, 2, 2, 2, 110, 564, 3, 2, 2, 2, 112, 566, 3, 2, 2, 2, 114, 572, 3, 2, 2, 2, 116, 574, 3, 2, 2, 2, 118, 577, 3, 2, 2, 2, 120, 580, 3, 2, 2, 2, 122, 582, 3, 2, 2, 2, 124, 589, 3, 2, 2, 2, 126, 591, 3, 2, 2, 2, 128, 602, 3, 2, 2, 2, 130, 613, 3, 2, 2, 2, 132, 625, 3, 2, 2, 2, 134, 627, 3, 2, 2, 2, 136, 638, 3, 2, 2, 2, 138, 649, 3, 2, 2, 2, 140, 660, 3, 2, 2, 2, 142, 671, 3, 2, 2, 2, 144, 682, 3, 2, 2, 2, 146, 693, 3, 2, 2, 2, 148, 711, 3, 2, 2, 2, 150, 718, 3, 2, 2, 2, 152, 720, 3, 2, 2, 2, 154, 722, 3, 2, 2, 2, 156, 733, 3, 2, 2, 2, 158, 735, 3, 2, 2, 2, 160, 737, 3, 2, 2, 2, 162, 742, 3, 2, 2, 2, 164, 747, 3, 2, 2, 2, 166, 168, 5, 4, 3, 2, 167, 166, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 170, 7, 2, 2, 3, 170, 3, 3, 2, 2, 2, 171, 173, 5, 6, 4, 2, 172, 171, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 174, 172, 3, 2, 2, 2, 174, 175, 3, 2, 2, 2, 175, 5, 3, 2, 2, 2, 176, 177, 5, 8, 5, 2, 177, 7, 3, 2, 2, 2, 178, 180, 5, 10, 6, 2, 179, 178, 3, 2, 2, 2, 180, 181, 3, 2, 2, 2, 181, 179, 3, 2, 2, 2, 181, 182, 3, 2, 2, 2, 182, 9, 3, 2, 2, 2, 183, 187, 5, 42, 22, 2, 184, 187, 5, 12, 7, 2, 185, 187, 7, 35, 2, 2, 186, 183, 3, 2, 2, 2, 186, 184, 3, 2, 2, 2, 186, 185, 3, 2, 2, 2, 187, 11, 3, 2, 2, 2, 188, 189, 5, 14, 8, 2, 189, 190, 7, 35, 2, 2, 190, 195, 3, 2, 2, 2, 191, 195, 5, 26, 14, 2, 192, 195, 5, 32, 17, 2, 193, 195, 5, 40, 21, 2, 194, 188, 3, 2, 2, 2, 194, 191, 3, 2, 2, 2, 194, 192, 3, 2, 2, 2, 194, 193, 3, 2, 2, 2, 195, 13, 3, 2, 2, 2, 196, 197, 5, 16, 9, 2, 197, 198, 5, 18, 10, 2, 198, 15, 3, 2, 2, 2, 199, 200, 9, 2, 2, 2, 200, 17, 3, 2, 2, 2, 201, 202, 5, 22, 12, 2, 202, 203, 7, 37, 2, 2, 203, 206, 5, 156, 79, 2, 204, 205, 7, 56, 2, 2, 205, 207, 5, 20, 11, 2, 206, 204, 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 19, 3, 2, 2, 2, 208, 209, 5, 150, 76, 2, 209, 21, 3, 2, 2, 2, 210, 211, 5, 24, 13, 2, 211, 23, 3, 2, 2, 2, 212, 213, 7, 76, 2, 2, 213, 25, 3, 2, 2, 2, 214, 215, 7, 22, 2, 2, 215, 216, 5, 22, 12, 2, 216, 218, 7, 38, 2, 2, 217, 219, 5, 28, 15, 2, 218, 217, 3, 2, 2, 2, 218, 219, 3, 2, 2, 2, 219, 220, 3, 2, 2, 2, 220, 221, 7, 39, 2, 2, 221, 222, 7, 25, 2, 2, 222, 224, 5, 156, 79, 2, 223, 225, 5, 44, 23, 2, 224, 223, 3, 2, 2, 2, 224, 225, 3, 2, 2, 2, 225, 27, 3, 2, 2, 2, 226, 231, 5, 30, 16, 2, 227, 228, 7, 34, 2, 2, 228, 230, 5, 30, 16, 2, 229, 227, 3, 2, 2, 2, 230, 233, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 29, 3, 2, 2, 2, 233, 231, 3, 2, 2, 2, 234, 235, 5, 22, 12, 2, 235, 236, 7, 37, 2, 2, 236, 237, 5, 156, 79, 2, 237, 31, 3, 2, 2, 2, 238, 239, 7, 27, 2, 2, 239, 240, 5, 22, 12, 2, 240, 244, 7, 43, 2, 2, 241, 243, 5, 34, 18, 2, 242, 241, 3, 2, 2, 2, 243, 246, 3, 2, 2, 2, 244, 242, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 247, 3, 2, 2, 2, 246, 244, 3, 2, 2, 2, 247, 248, 7, 44, 2, 2, 248, 33, 3, 2, 2, 2, 249, 252, 5, 36, 19, 2, 250, 252, 5, 38, 20, 2, 251, 249, 3, 2, 2, 2, 251, 250, 3, 2, 2, 2, 252, 35, 3, 2, 2, 2, 253, 254, 5, 22, 12, 2, 254, 255, 7, 37, 2, 2, 255, 256, 5, 156, 79, 2, 256, 257, 7, 35, 2, 2, 257, 37, 3, 2, 2, 2, 258, 259, 5, 22, 12, 2, 259, 261, 7, 38, 2, 2, 260, 262, 5, 28, 15, 2, 261, 260, 3, 2, 2, 2, 261, 262, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 264, 7, 39, 2, 2, 264, 265, 7, 37, 2, 2, 265, 266, 5, 156, 79, 2, 266, 267, 7, 35, 2, 2, 267, 39, 3, 2, 2, 2, 268, 269, 7, 26, 2, 2, 269, 270, 5, 22, 12, 2, 270, 271, 7, 43, 2, 2, 271, 272, 7, 44, 2, 2, 272, 41, 3, 2, 2, 2, 273, 280, 5, 46, 24, 2, 274, 280, 5, 48, 25, 2, 275, 280, 5, 56, 29, 2, 276, 280, 5, 64, 33, 2, 277, 280, 5, 66, 34, 2, 278, 280, 5, 44, 23, 2, 279, 273, 3, 2, 2, 2, 279, 274, 3, 2, 2, 2, 279, 275, 3, 2, 2, 2, 279, 276, 3, 2, 2, 2, 279, 277, 3, 2, 2, 2, 279, 278, 3, 2, 2, 2, 280, 43, 3, 2, 2, 2, 281, 282, 6, 23, 2, 2, 282, 284, 7, 43, 2, 2, 283, 285, 5, 8, 5, 2, 284, 283, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 287, 7, 44, 2, 2, 287, 45, 3, 2, 2, 2, 288, 289, 8, 24, 1, 2, 289, 290, 5, 154, 78, 2, 290, 291, 7, 35, 2, 2, 291, 292, 8, 24, 1, 2, 292, 47, 3, 2, 2, 2, 293, 296, 5, 50, 26, 2, 294, 296, 5, 52, 27, 2, 295, 293, 3, 2, 2, 2, 295, 294, 3, 2, 2, 2, 296, 49, 3, 2, 2, 2, 297, 298, 7, 18, 2, 2, 298, 299, 7, 38, 2, 2, 299, 300, 5, 154, 78, 2, 300, 301, 7, 39, 2, 2, 301, 304, 5, 42, 22, 2, 302, 303, 7, 19, 2, 2, 303, 305, 5, 42, 22, 2, 304, 302, 3, 2, 2, 2, 304, 305, 3, 2, 2, 2, 305, 51, 3, 2, 2, 2, 306, 307, 7, 11, 2, 2, 307, 308, 7, 38, 2, 2, 308, 309, 5, 154, 78, 2, 309, 310, 7, 39, 2, 2, 310, 314, 7, 43, 2, 2, 311, 313, 5, 54, 28, 2, 312, 311, 3, 2, 2, 2, 313, 316, 3, 2, 2, 2, 314, 312, 3, 2, 2, 2, 314, 315, 3, 2, 2, 2, 315, 317, 3, 2, 2, 2, 316, 314, 3, 2, 2, 2, 317, 318, 7, 44, 2, 2, 318, 53, 3, 2, 2, 2, 319, 320, 7, 12, 2, 2, 320, 321, 5, 154, 78, 2, 321, 322, 7, 37, 2, 2, 322, 323, 5, 42, 22, 2, 323, 328, 3, 2, 2, 2, 324, 325, 7, 13, 2, 2, 325, 326, 7, 37, 2, 2, 326, 328, 5, 42, 22, 2, 327, 319, 3, 2, 2, 2, 327, 324, 3, 2, 2, 2, 328, 55, 3, 2, 2, 2, 329, 333, 5, 58, 30, 2, 330, 333, 5, 60, 31, 2, 331, 333, 5, 62, 32, 2, 332, 329, 3, 2, 2, 2, 332, 330, 3, 2, 2, 2, 332, 331, 3, 2, 2, 2, 333, 57, 3, 2, 2, 2, 334, 335, 7, 20, 2, 2, 335, 342, 7, 38, 2, 2, 336, 339, 5, 14, 8, 2, 337, 339, 5, 154, 78, 2, 338, 336, 3, 2, 2, 2, 338, 337, 3, 2, 2, 2, 339, 340, 3, 2, 2, 2, 340, 341, 8, 30, 1, 2, 341, 343, 3, 2, 2, 2, 342, 338, 3, 2, 2, 2, 342, 343, 3, 2, 2, 2, 343, 344, 3, 2, 2, 2, 344, 348, 7, 35, 2, 2, 345, 346, 5, 154, 78, 2, 346, 347, 8, 30, 1, 2, 347, 349, 3, 2, 2, 2, 348, 345, 3, 2, 2, 2, 348, 349, 3, 2, 2, 2, 349, 350, 3, 2, 2, 2, 350, 354, 7, 35, 2, 2, 351, 352, 5, 154, 78, 2, 352, 353, 8, 30, 1, 2, 353, 355, 3, 2, 2, 2, 354, 351, 3, 2, 2, 2, 354, 355, 3, 2, 2, 2, 355, 356, 3, 2, 2, 2, 356, 357, 7, 39, 2, 2, 357, 358, 5, 42, 22, 2, 358, 59, 3, 2, 2, 2, 359, 360, 7, 17, 2, 2, 360, 361, 7, 38, 2, 2, 361, 362, 5, 154, 78, 2, 362, 363, 7, 39, 2, 2, 363, 364, 5, 42, 22, 2, 364, 61, 3, 2, 2, 2, 365, 366, 7, 16, 2, 2, 366, 367, 5, 42, 22, 2, 367, 368, 7, 17, 2, 2, 368, 369, 7, 38, 2, 2, 369, 370, 5, 154, 78, 2, 370, 371, 7, 39, 2, 2, 371, 372, 7, 35, 2, 2, 372, 63, 3, 2, 2, 2, 373, 374, 9, 3, 2, 2, 374, 375, 7, 35, 2, 2, 375, 65, 3, 2, 2, 2, 376, 378, 7, 23, 2, 2, 377, 379, 5, 154, 78, 2, 378, 377, 3, 2, 2, 2, 378, 379, 3, 2, 2, 2, 379, 380, 3, 2, 2, 2, 380, 381, 7, 35, 2, 2, 381, 67, 3, 2, 2, 2, 382, 393, 5, 72, 37, 2, 383, 393, 5, 70, 36, 2, 384, 393, 5, 92, 47, 2, 385, 393, 5, 94, 48, 2, 386, 393, 5, 74, 38, 2, 387, 393, 5, 76, 39, 2, 388, 393, 5, 82, 42, 2, 389, 393, 5, 84, 43, 2, 390, 393, 5, 90, 46, 2, 391, 393, 5, 98, 50, 2, 392, 382, 3, 2, 2, 2, 392, 383, 3, 2, 2, 2, 392, 384, 3, 2, 2, 2, 392, 385, 3, 2, 2, 2, 392, 386, 3, 2, 2, 2, 392, 387, 3, 2, 2, 2, 392, 388, 3, 2, 2, 2, 392, 389, 3, 2, 2, 2, 392, 390, 3, 2, 2, 2, 392, 391, 3, 2, 2, 2, 393, 69, 3, 2, 2, 2, 394, 396, 7, 38, 2, 2, 395, 397, 5, 28, 15, 2, 396, 395, 3, 2, 2, 2, 396, 397, 3, 2, 2, 2, 397, 398, 3, 2, 2, 2, 398, 399, 7, 39, 2, 2, 399, 400, 7, 37, 2, 2, 400, 401, 5, 156, 79, 2, 401, 404, 7, 25, 2, 2, 402, 405, 5, 154, 78, 2, 403, 405, 5, 44, 23, 2, 404, 402, 3, 2, 2, 2, 404, 403, 3, 2, 2, 2, 405, 71, 3, 2, 2, 2, 406, 407, 7, 38, 2, 2, 407, 408, 5, 154, 78, 2, 408, 409, 7, 39, 2, 2, 409, 73, 3, 2, 2, 2, 410, 411, 9, 4, 2, 2, 411, 75, 3, 2, 2, 2, 412, 413, 5, 78, 40, 2, 413, 77, 3, 2, 2, 2, 414, 415, 7, 76, 2, 2, 415, 79, 3, 2, 2, 2, 416, 419, 5, 78, 40, 2, 417, 419, 5, 82, 42, 2, 418, 416, 3, 2, 2, 2, 418, 417, 3, 2, 2, 2, 419, 81, 3, 2, 2, 2, 420, 421, 9, 5, 2, 2, 421, 83, 3, 2, 2, 2, 422, 426, 7, 83, 2, 2, 423, 425, 5, 86, 44, 2, 424, 423, 3, 2, 2, 2, 425, 428, 3, 2, 2, 2, 426, 424, 3, 2, 2, 2, 426, 427, 3, 2, 2, 2, 427, 429, 3, 2, 2, 2, 428, 426, 3, 2, 2, 2, 429, 439, 7, 85, 2, 2, 430, 434, 7, 84, 2, 2, 431, 433, 5, 88, 45, 2, 432, 431, 3, 2, 2, 2, 433, 436, 3, 2, 2, 2, 434, 432, 3, 2, 2, 2, 434, 435, 3, 2, 2, 2, 435, 437, 3, 2, 2, 2, 436, 434, 3, 2, 2, 2, 437, 439, 7, 87, 2, 2, 438, 422, 3, 2, 2, 2, 438, 430, 3, 2, 2, 2, 439, 85, 3, 2, 2, 2, 440, 447, 7, 86, 2, 2, 441, 443, 7, 3, 2, 2, 442, 444, 5, 154, 78, 2, 443, 442, 3, 2, 2, 2, 443, 444, 3, 2, 2, 2, 444, 445, 3, 2, 2, 2, 445, 447, 7, 42, 2, 2, 446, 440, 3, 2, 2, 2, 446, 441, 3, 2, 2, 2, 447, 87, 3, 2, 2, 2, 448, 455, 7, 88, 2, 2, 449, 451, 7, 3, 2, 2, 450, 452, 5, 154, 78, 2, 451, 450, 3, 2, 2, 2, 451, 452, 3, 2, 2, 2, 452, 453, 3, 2, 2, 2, 453, 455, 7, 42, 2, 2, 454, 448, 3, 2, 2, 2, 454, 449, 3, 2, 2, 2, 455, 89, 3, 2, 2, 2, 456, 457, 9, 6, 2, 2, 457, 91, 3, 2, 2, 2, 458, 467, 7, 40, 2, 2, 459, 464, 5, 154, 78, 2, 460, 461, 7, 34, 2, 2, 461, 463, 5, 154, 78, 2, 462, 460, 3, 2, 2, 2, 463, 466, 3, 2, 2, 2, 464, 462, 3, 2, 2, 2, 464, 465, 3, 2, 2, 2, 465, 468, 3, 2, 2, 2, 466, 464, 3, 2, 2, 2, 467, 459, 3, 2, 2, 2, 467, 468, 3, 2, 2, 2, 468, 470, 3, 2, 2, 2, 469, 471, 7, 34, 2, 2, 470, 469, 3, 2, 2, 2, 470, 471, 3, 2, 2, 2, 471, 472, 3, 2, 2, 2, 472, 473, 7, 41, 2, 2, 473, 93, 3, 2, 2, 2, 474, 483, 7, 43, 2, 2, 475, 480, 5, 96, 49, 2, 476, 477, 7, 34, 2, 2, 477, 479, 5, 96, 49, 2, 478, 476, 3, 2, 2, 2, 479, 482, 3, 2, 2, 2, 480, 478, 3, 2, 2, 2, 480, 481, 3, 2, 2, 2, 481, 484, 3, 2, 2, 2, 482, 480, 3, 2, 2, 2, 483, 475, 3, 2, 2, 2, 483, 484, 3, 2, 2, 2, 484, 486, 3, 2, 2, 2, 485, 487, 7, 34, 2, 2, 486, 485, 3, 2, 2, 2, 486, 487, 3, 2, 2, 2, 487, 488, 3, 2, 2, 2, 488, 489, 7, 44, 2, 2, 489, 95, 3, 2, 2, 2, 490, 491, 5, 80, 41, 2, 491, 492, 7, 37, 2, 2, 492, 493, 5, 154, 78, 2, 493, 97, 3, 2, 2, 2, 494, 495, 9, 7, 2, 2, 495, 99, 3, 2, 2, 2, 496, 497, 8, 51, 1, 2, 497, 508, 5, 68, 35, 2, 498, 499, 7, 24, 2, 2, 499, 500, 5, 100, 51, 2, 500, 502, 7, 38, 2, 2, 501, 503, 5, 102, 52, 2, 502, 501, 3, 2, 2, 2, 502, 503, 3, 2, 2, 2, 503, 504, 3, 2, 2, 2, 504, 505, 7, 39, 2, 2, 505, 506, 8, 51, 1, 2, 506, 508, 3, 2, 2, 2, 507, 496, 3, 2, 2, 2, 507, 498, 3, 2, 2, 2, 508, 530, 3, 2, 2, 2, 509, 510, 12, 7, 2, 2, 510, 512, 7, 38, 2, 2, 511, 513, 5, 102, 52, 2, 512, 511, 3, 2, 2, 2, 512, 513, 3, 2, 2, 2, 513, 514, 3, 2, 2, 2, 514, 515, 7, 39, 2, 2, 515, 529, 8, 51, 1, 2, 516, 517, 12, 5, 2, 2, 517, 518, 5, 104, 53, 2, 518, 519, 8, 51, 1, 2, 519, 529, 3, 2, 2, 2, 520, 521, 12, 4, 2, 2, 521, 522, 5, 106, 54, 2, 522, 523, 8, 51, 1, 2, 523, 529, 3, 2, 2, 2, 524, 525, 12, 3, 2, 2, 525, 526, 5, 108, 55, 2, 526, 527, 8, 51, 1, 2, 527, 529, 3, 2, 2, 2, 528, 509, 3, 2, 2, 2, 528, 516, 3, 2, 2, 2, 528, 520, 3, 2, 2, 2, 528, 524, 3, 2, 2, 2, 529, 532, 3, 2, 2, 2, 530, 528, 3, 2, 2, 2, 530, 531, 3, 2, 2, 2, 531, 101, 3, 2, 2, 2, 532, 530, 3, 2, 2, 2, 533, 538, 5, 150, 76, 2, 534, 535, 7, 34, 2, 2, 535, 537, 5, 150, 76, 2, 536, 534, 3, 2, 2, 2, 537, 540, 3, 2, 2, 2, 538, 536, 3, 2, 2, 2, 538, 539, 3, 2, 2, 2, 539, 103, 3, 2, 2, 2, 540, 538, 3, 2, 2, 2, 541, 542, 7, 75, 2, 2, 542, 543, 5, 78, 40, 2, 543, 105, 3, 2, 2, 2, 544, 545, 7, 40, 2, 2, 545, 546, 5, 154, 78, 2, 546, 547, 7, 41, 2, 2, 547, 107, 3, 2, 2, 2, 548, 552, 7, 40, 2, 2, 549, 550, 5, 154, 78, 2, 550, 551, 8, 55, 1, 2, 551, 553, 3, 2, 2, 2, 552, 549, 3, 2, 2, 2, 552, 553, 3, 2, 2, 2, 553, 554, 3, 2, 2, 2, 554, 558, 7, 37, 2, 2, 555, 556, 5, 154, 78, 2, 556, 557, 8, 55, 1, 2, 557, 559, 3, 2, 2, 2, 558, 555, 3, 2, 2, 2, 558, 559, 3, 2, 2, 2, 559, 560, 3, 2, 2, 2, 560, 561, 7, 41, 2, 2, 561, 109, 3, 2, 2, 2, 562, 565, 5, 100, 51, 2, 563, 565, 5, 112, 57, 2, 564, 562, 3, 2, 2, 2, 564, 563, 3, 2, 2, 2, 565, 111, 3, 2, 2, 2, 566, 567, 5, 100, 51, 2, 567, 568, 5, 120, 61, 2, 568, 113, 3, 2, 2, 2, 569, 573, 5, 110, 56, 2, 570, 573, 5, 116, 59, 2, 571, 573, 5, 118, 60, 2, 572, 569, 3, 2, 2, 2, 572, 570, 3, 2, 2, 2, 572, 571, 3, 2, 2, 2, 573, 115, 3, 2, 2, 2, 574, 575, 5, 120, 61, 2, 575, 576, 5, 110, 56, 2, 576, 117, 3, 2, 2, 2, 577, 578, 5, 122, 62, 2, 578, 579, 5, 110, 56, 2, 579, 119, 3, 2, 2, 2, 580, 581, 9, 8, 2, 2, 581, 121, 3, 2, 2, 2, 582, 583, 9, 9, 2, 2, 583, 123, 3, 2, 2, 2, 584, 590, 5, 114, 58, 2, 585, 586, 5, 114, 58, 2, 586, 587, 7, 9, 2, 2, 587, 588, 5, 156, 79, 2, 588, 590, 3, 2, 2, 2, 589, 584, 3, 2, 2, 2, 589, 585, 3, 2, 2, 2, 590, 125, 3, 2, 2, 2, 591, 592, 8, 64, 1, 2, 592, 593, 5, 124, 63, 2, 593, 599, 3, 2, 2, 2, 594, 595, 12, 3, 2, 2, 595, 596, 9, 10, 2, 2, 596, 598, 5, 124, 63, 2, 597, 594, 3, 2, 2, 2, 598, 601, 3, 2, 2, 2, 599, 597, 3, 2, 2, 2, 599, 600, 3, 2, 2, 2, 600, 127, 3, 2, 2, 2, 601, 599, 3, 2, 2, 2, 602, 603, 8, 65, 1, 2, 603, 604, 5, 126, 64, 2, 604, 610, 3, 2, 2, 2, 605, 606, 12, 3, 2, 2, 606, 607, 9, 11, 2, 2, 607, 609, 5, 126, 64, 2, 608, 605, 3, 2, 2, 2, 609, 612, 3, 2, 2, 2, 610, 608, 3, 2, 2, 2, 610, 611, 3, 2, 2, 2, 611, 129, 3, 2, 2, 2, 612, 610, 3, 2, 2, 2, 613, 614, 8, 66, 1, 2, 614, 615, 5, 128, 65, 2, 615, 622, 3, 2, 2, 2, 616, 617, 12, 3, 2, 2, 617, 618, 5, 132, 67, 2, 618, 619, 5, 138, 70, 2, 619, 621, 3, 2, 2, 2, 620, 616, 3, 2, 2, 2, 621, 624, 3, 2, 2, 2, 622, 620, 3, 2, 2, 2, 622, 623, 3, 2, 2, 2, 623, 131, 3, 2, 2, 2, 624, 622, 3, 2, 2, 2, 625, 626, 9, 12, 2, 2, 626, 133, 3, 2, 2, 2, 627, 628, 8, 68, 1, 2, 628, 629, 5, 130, 66, 2, 629, 635, 3, 2, 2, 2, 630, 631, 12, 3, 2, 2, 631, 632, 9, 13, 2, 2, 632, 634, 5, 130, 66, 2, 633, 630, 3, 2, 2, 2, 634, 637, 3, 2, 2, 2, 635, 633, 3, 2, 2, 2, 635, 636, 3, 2, 2, 2, 636, 135, 3, 2, 2, 2, 637, 635, 3, 2, 2, 2, 638, 639, 8, 69, 1, 2, 639, 640, 5, 134, 68, 2, 640, 646, 3, 2, 2, 2, 641, 642, 12, 3, 2, 2, 642, 643, 9, 14, 2, 2, 643, 645, 5, 134, 68, 2, 644, 641, 3, 2, 2, 2, 645, 648, 3, 2, 2, 2, 646, 644, 3, 2, 2, 2, 646, 647, 3, 2, 2, 2, 647, 137, 3, 2, 2, 2, 648, 646, 3, 2, 2, 2, 649, 650, 8, 70, 1, 2, 650, 651, 5, 136, 69, 2, 651, 657, 3, 2, 2, 2, 652, 653, 12, 3, 2, 2, 653, 654, 7, 68, 2, 2, 654, 656, 5, 136, 69, 2, 655, 652, 3, 2, 2, 2, 656, 659, 3, 2, 2, 2, 657, 655, 3, 2, 2, 2, 657, 658, 3, 2, 2, 2, 658, 139, 3, 2, 2, 2, 659, 657, 3, 2, 2, 2, 660, 661, 8, 71, 1, 2, 661, 662, 5, 138, 70, 2, 662, 668, 3, 2, 2, 2, 663, 664, 12, 3, 2, 2, 664, 665, 7, 70, 2, 2, 665, 667, 5, 138, 70, 2, 666, 663, 3, 2, 2, 2, 667, 670, 3, 2, 2, 2, 668, 666, 3, 2, 2, 2, 668, 669, 3, 2, 2, 2, 669, 141, 3, 2, 2, 2, 670, 668, 3, 2, 2, 2, 671, 672, 8, 72, 1, 2, 672, 673, 5, 140, 71, 2, 673, 679, 3, 2, 2, 2, 674, 675, 12, 3, 2, 2, 675, 676, 7, 69, 2, 2, 676, 678, 5, 140, 71, 2, 677, 674, 3, 2, 2, 2, 678, 681, 3, 2, 2, 2, 679, 677, 3, 2, 2, 2, 679, 680, 3, 2, 2, 2, 680, 143, 3, 2, 2, 2, 681, 679, 3, 2, 2, 2, 682, 683, 8, 73, 1, 2, 683, 684, 5, 142, 72, 2, 684, 690, 3, 2, 2, 2, 685, 686, 12, 3, 2, 2, 686, 687, 7, 53, 2, 2, 687, 689, 5, 142, 72, 2, 688, 685, 3, 2, 2, 2, 689, 692, 3, 2, 2, 2, 690, 688, 3, 2, 2, 2, 690, 691, 3, 2, 2, 2, 691, 145, 3, 2, 2, 2, 692, 690, 3, 2, 2, 2, 693, 694, 8, 74, 1, 2, 694, 695, 5, 144, 73, 2, 695, 701, 3, 2, 2, 2, 696, 697, 12, 3, 2, 2, 697, 698, 7, 54, 2, 2, 698, 700, 5, 144, 73, 2, 699, 696, 3, 2, 2, 2, 700, 703, 3, 2, 2, 2, 701, 699, 3, 2, 2, 2, 701, 702, 3, 2, 2, 2, 702, 147, 3, 2, 2, 2, 703, 701, 3, 2, 2, 2, 704, 712, 5, 146, 74, 2, 705, 706, 5, 146, 74, 2, 706, 707, 7, 36, 2, 2, 707, 708, 5, 148, 75, 2, 708, 709, 7, 37, 2, 2, 709, 710, 5, 148, 75, 2, 710, 712, 3, 2, 2, 2, 711, 704, 3, 2, 2, 2, 711, 705, 3, 2, 2, 2, 712, 149, 3, 2, 2, 2, 713, 719, 5, 148, 75, 2, 714, 715, 5, 100, 51, 2, 715, 716, 5, 152, 77, 2, 716, 717, 5, 150, 76, 2, 717, 719, 3, 2, 2, 2, 718, 713, 3, 2, 2, 2, 718, 714, 3, 2, 2, 2, 719, 151, 3, 2, 2, 2, 720, 721, 9, 15, 2, 2, 721, 153, 3, 2, 2, 2, 722, 727, 5, 150, 76, 2, 723, 724, 7, 34, 2, 2, 724, 726, 5, 150, 76, 2, 725, 723, 3, 2, 2, 2, 726, 729, 3, 2, 2, 2, 727, 725, 3, 2, 2, 2, 727, 728, 3, 2, 2, 2, 728, 155, 3, 2, 2, 2, 729, 727, 3, 2, 2, 2, 730, 734, 5, 158, 80, 2, 731, 734, 5, 160, 81, 2, 732, 734, 5, 162, 82, 2, 733, 730, 3, 2, 2, 2, 733, 731, 3, 2, 2, 2, 733, 732, 3, 2, 2, 2, 734, 157, 3, 2, 2, 2, 735, 736, 5, 164, 83, 2, 736, 159, 3, 2, 2, 2, 737, 738, 5, 164, 83, 2, 738, 739, 7, 64, 2, 2, 739, 740, 5, 164, 83, 2, 740, 741, 7, 66, 2, 2, 741, 161, 3, 2, 2, 2, 742, 743, 7, 30, 2, 2, 743, 744, 7, 38, 2, 2, 744, 745, 5, 164, 83, 2, 745, 746, 7, 39, 2, 2, 746, 163, 3, 2, 2, 2, 747, 748, 9, 16, 2, 2, 748, 165, 3, 2, 2, 2, 68, 167, 174, 181, 186, 194, 206, 218, 224, 231, 244, 251, 261, 279, 284, 295, 304, 314, 327, 332, 338, 342, 348, 354, 378, 392, 396, 404, 418, 426, 434, 438, 443, 446, 451, 454, 464, 467, 470, 480, 483, 486, 502, 507, 512, 528, 530, 538, 552, 558, 564, 572, 589, 599, 610, 622, 635, 646, 657, 668, 679, 690, 701, 711, 718, 727, 733] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 88, 750, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 3, 2, 5, 2, 168, 10, 2, 3, 2, 3, 2, 3, 3, 6, 3, 173, 10, 3, 13, 3, 14, 3, 174, 3, 4, 3, 4, 3, 5, 6, 5, 180, 10, 5, 13, 5, 14, 5, 181, 3, 6, 3, 6, 3, 6, 5, 6, 187, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 195, 10, 7, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 207, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 219, 10, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 225, 10, 14, 3, 15, 3, 15, 3, 15, 7, 15, 230, 10, 15, 12, 15, 14, 15, 233, 11, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 243, 10, 17, 12, 17, 14, 17, 246, 11, 17, 3, 17, 3, 17, 3, 18, 3, 18, 5, 18, 252, 10, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 5, 20, 262, 10, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 280, 10, 22, 3, 23, 3, 23, 3, 23, 5, 23, 285, 10, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 5, 25, 296, 10, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 305, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 7, 27, 313, 10, 27, 12, 27, 14, 27, 316, 11, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 328, 10, 28, 3, 29, 3, 29, 3, 29, 5, 29, 333, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 339, 10, 30, 3, 30, 3, 30, 5, 30, 343, 10, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 349, 10, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 355, 10, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 5, 34, 379, 10, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 393, 10, 35, 3, 36, 3, 36, 5, 36, 397, 10, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 405, 10, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 5, 41, 419, 10, 41, 3, 42, 3, 42, 3, 43, 3, 43, 7, 43, 425, 10, 43, 12, 43, 14, 43, 428, 11, 43, 3, 43, 3, 43, 3, 43, 7, 43, 433, 10, 43, 12, 43, 14, 43, 436, 11, 43, 3, 43, 5, 43, 439, 10, 43, 3, 44, 3, 44, 3, 44, 5, 44, 444, 10, 44, 3, 44, 5, 44, 447, 10, 44, 3, 45, 3, 45, 3, 45, 5, 45, 452, 10, 45, 3, 45, 5, 45, 455, 10, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 7, 47, 463, 10, 47, 12, 47, 14, 47, 466, 11, 47, 5, 47, 468, 10, 47, 3, 47, 5, 47, 471, 10, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 7, 48, 479, 10, 48, 12, 48, 14, 48, 482, 11, 48, 5, 48, 484, 10, 48, 3, 48, 5, 48, 487, 10, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 503, 10, 51, 3, 51, 3, 51, 3, 51, 5, 51, 508, 10, 51, 3, 51, 3, 51, 3, 51, 5, 51, 513, 10, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 7, 51, 529, 10, 51, 12, 51, 14, 51, 532, 11, 51, 3, 52, 3, 52, 3, 52, 7, 52, 537, 10, 52, 12, 52, 14, 52, 540, 11, 52, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 553, 10, 55, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 559, 10, 55, 3, 55, 3, 55, 3, 56, 3, 56, 5, 56, 565, 10, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 5, 58, 573, 10, 58, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 5, 63, 590, 10, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 7, 64, 598, 10, 64, 12, 64, 14, 64, 601, 11, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 7, 65, 609, 10, 65, 12, 65, 14, 65, 612, 11, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 7, 66, 621, 10, 66, 12, 66, 14, 66, 624, 11, 66, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 7, 68, 634, 10, 68, 12, 68, 14, 68, 637, 11, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 7, 69, 645, 10, 69, 12, 69, 14, 69, 648, 11, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 7, 70, 656, 10, 70, 12, 70, 14, 70, 659, 11, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 7, 71, 667, 10, 71, 12, 71, 14, 71, 670, 11, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 7, 72, 678, 10, 72, 12, 72, 14, 72, 681, 11, 72, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 7, 73, 689, 10, 73, 12, 73, 14, 73, 692, 11, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 7, 74, 700, 10, 74, 12, 74, 14, 74, 703, 11, 74, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 5, 75, 712, 10, 75, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 5, 76, 719, 10, 76, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 7, 78, 726, 10, 78, 12, 78, 14, 78, 729, 11, 78, 3, 79, 3, 79, 3, 79, 5, 79, 734, 10, 79, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 2, 2, 13, 100, 126, 128, 130, 134, 136, 138, 140, 142, 144, 146, 84, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 70, 2, 72, 2, 74, 2, 76, 2, 78, 2, 80, 2, 82, 2, 84, 2, 86, 2, 88, 2, 90, 2, 92, 2, 94, 2, 96, 2, 98, 2, 100, 2, 102, 2, 104, 2, 106, 2, 108, 2, 110, 2, 112, 2, 114, 2, 116, 2, 118, 2, 120, 2, 122, 2, 124, 2, 126, 2, 128, 2, 130, 2, 132, 2, 134, 2, 136, 2, 138, 2, 140, 2, 142, 2, 144, 2, 146, 2, 148, 2, 150, 2, 152, 2, 154, 2, 156, 2, 158, 2, 160, 2, 162, 2, 164, 2, 2, 17, 3, 2, 7, 8, 3, 2, 14, 15, 3, 2, 28, 29, 3, 2, 78, 79, 4, 2, 77, 77, 80, 80, 3, 2, 31, 33, 4, 2, 46, 46, 48, 48, 6, 2, 45, 45, 47, 47, 55, 55, 71, 71, 3, 2, 49, 52, 4, 2, 45, 45, 47, 47, 3, 2, 72, 74, 3, 2, 64, 67, 3, 2, 62, 63, 3, 2, 56, 61, 4, 2, 31, 33, 76, 76, 2, 753, 2, 167, 3, 2, 2, 2, 4, 172, 3, 2, 2, 2, 6, 176, 3, 2, 2, 2, 8, 179, 3, 2, 2, 2, 10, 186, 3, 2, 2, 2, 12, 194, 3, 2, 2, 2, 14, 196, 3, 2, 2, 2, 16, 199, 3, 2, 2, 2, 18, 201, 3, 2, 2, 2, 20, 208, 3, 2, 2, 2, 22, 210, 3, 2, 2, 2, 24, 212, 3, 2, 2, 2, 26, 214, 3, 2, 2, 2, 28, 226, 3, 2, 2, 2, 30, 234, 3, 2, 2, 2, 32, 238, 3, 2, 2, 2, 34, 251, 3, 2, 2, 2, 36, 253, 3, 2, 2, 2, 38, 258, 3, 2, 2, 2, 40, 268, 3, 2, 2, 2, 42, 279, 3, 2, 2, 2, 44, 281, 3, 2, 2, 2, 46, 288, 3, 2, 2, 2, 48, 295, 3, 2, 2, 2, 50, 297, 3, 2, 2, 2, 52, 306, 3, 2, 2, 2, 54, 327, 3, 2, 2, 2, 56, 332, 3, 2, 2, 2, 58, 334, 3, 2, 2, 2, 60, 359, 3, 2, 2, 2, 62, 365, 3, 2, 2, 2, 64, 373, 3, 2, 2, 2, 66, 376, 3, 2, 2, 2, 68, 392, 3, 2, 2, 2, 70, 394, 3, 2, 2, 2, 72, 406, 3, 2, 2, 2, 74, 410, 3, 2, 2, 2, 76, 412, 3, 2, 2, 2, 78, 414, 3, 2, 2, 2, 80, 418, 3, 2, 2, 2, 82, 420, 3, 2, 2, 2, 84, 438, 3, 2, 2, 2, 86, 446, 3, 2, 2, 2, 88, 454, 3, 2, 2, 2, 90, 456, 3, 2, 2, 2, 92, 458, 3, 2, 2, 2, 94, 474, 3, 2, 2, 2, 96, 490, 3, 2, 2, 2, 98, 494, 3, 2, 2, 2, 100, 507, 3, 2, 2, 2, 102, 533, 3, 2, 2, 2, 104, 541, 3, 2, 2, 2, 106, 544, 3, 2, 2, 2, 108, 548, 3, 2, 2, 2, 110, 564, 3, 2, 2, 2, 112, 566, 3, 2, 2, 2, 114, 572, 3, 2, 2, 2, 116, 574, 3, 2, 2, 2, 118, 577, 3, 2, 2, 2, 120, 580, 3, 2, 2, 2, 122, 582, 3, 2, 2, 2, 124, 589, 3, 2, 2, 2, 126, 591, 3, 2, 2, 2, 128, 602, 3, 2, 2, 2, 130, 613, 3, 2, 2, 2, 132, 625, 3, 2, 2, 2, 134, 627, 3, 2, 2, 2, 136, 638, 3, 2, 2, 2, 138, 649, 3, 2, 2, 2, 140, 660, 3, 2, 2, 2, 142, 671, 3, 2, 2, 2, 144, 682, 3, 2, 2, 2, 146, 693, 3, 2, 2, 2, 148, 711, 3, 2, 2, 2, 150, 718, 3, 2, 2, 2, 152, 720, 3, 2, 2, 2, 154, 722, 3, 2, 2, 2, 156, 733, 3, 2, 2, 2, 158, 735, 3, 2, 2, 2, 160, 737, 3, 2, 2, 2, 162, 742, 3, 2, 2, 2, 164, 747, 3, 2, 2, 2, 166, 168, 5, 4, 3, 2, 167, 166, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 170, 7, 2, 2, 3, 170, 3, 3, 2, 2, 2, 171, 173, 5, 6, 4, 2, 172, 171, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 174, 172, 3, 2, 2, 2, 174, 175, 3, 2, 2, 2, 175, 5, 3, 2, 2, 2, 176, 177, 5, 8, 5, 2, 177, 7, 3, 2, 2, 2, 178, 180, 5, 10, 6, 2, 179, 178, 3, 2, 2, 2, 180, 181, 3, 2, 2, 2, 181, 179, 3, 2, 2, 2, 181, 182, 3, 2, 2, 2, 182, 9, 3, 2, 2, 2, 183, 187, 5, 42, 22, 2, 184, 187, 5, 12, 7, 2, 185, 187, 7, 35, 2, 2, 186, 183, 3, 2, 2, 2, 186, 184, 3, 2, 2, 2, 186, 185, 3, 2, 2, 2, 187, 11, 3, 2, 2, 2, 188, 189, 5, 14, 8, 2, 189, 190, 7, 35, 2, 2, 190, 195, 3, 2, 2, 2, 191, 195, 5, 26, 14, 2, 192, 195, 5, 32, 17, 2, 193, 195, 5, 40, 21, 2, 194, 188, 3, 2, 2, 2, 194, 191, 3, 2, 2, 2, 194, 192, 3, 2, 2, 2, 194, 193, 3, 2, 2, 2, 195, 13, 3, 2, 2, 2, 196, 197, 5, 16, 9, 2, 197, 198, 5, 18, 10, 2, 198, 15, 3, 2, 2, 2, 199, 200, 9, 2, 2, 2, 200, 17, 3, 2, 2, 2, 201, 202, 5, 22, 12, 2, 202, 203, 7, 37, 2, 2, 203, 206, 5, 156, 79, 2, 204, 205, 7, 56, 2, 2, 205, 207, 5, 20, 11, 2, 206, 204, 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 19, 3, 2, 2, 2, 208, 209, 5, 150, 76, 2, 209, 21, 3, 2, 2, 2, 210, 211, 5, 24, 13, 2, 211, 23, 3, 2, 2, 2, 212, 213, 7, 76, 2, 2, 213, 25, 3, 2, 2, 2, 214, 215, 7, 22, 2, 2, 215, 216, 5, 22, 12, 2, 216, 218, 7, 38, 2, 2, 217, 219, 5, 28, 15, 2, 218, 217, 3, 2, 2, 2, 218, 219, 3, 2, 2, 2, 219, 220, 3, 2, 2, 2, 220, 221, 7, 39, 2, 2, 221, 222, 7, 25, 2, 2, 222, 224, 5, 156, 79, 2, 223, 225, 5, 44, 23, 2, 224, 223, 3, 2, 2, 2, 224, 225, 3, 2, 2, 2, 225, 27, 3, 2, 2, 2, 226, 231, 5, 30, 16, 2, 227, 228, 7, 34, 2, 2, 228, 230, 5, 30, 16, 2, 229, 227, 3, 2, 2, 2, 230, 233, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 29, 3, 2, 2, 2, 233, 231, 3, 2, 2, 2, 234, 235, 5, 22, 12, 2, 235, 236, 7, 37, 2, 2, 236, 237, 5, 156, 79, 2, 237, 31, 3, 2, 2, 2, 238, 239, 7, 27, 2, 2, 239, 240, 5, 22, 12, 2, 240, 244, 7, 43, 2, 2, 241, 243, 5, 34, 18, 2, 242, 241, 3, 2, 2, 2, 243, 246, 3, 2, 2, 2, 244, 242, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 247, 3, 2, 2, 2, 246, 244, 3, 2, 2, 2, 247, 248, 7, 44, 2, 2, 248, 33, 3, 2, 2, 2, 249, 252, 5, 36, 19, 2, 250, 252, 5, 38, 20, 2, 251, 249, 3, 2, 2, 2, 251, 250, 3, 2, 2, 2, 252, 35, 3, 2, 2, 2, 253, 254, 5, 22, 12, 2, 254, 255, 7, 37, 2, 2, 255, 256, 5, 156, 79, 2, 256, 257, 7, 35, 2, 2, 257, 37, 3, 2, 2, 2, 258, 259, 5, 22, 12, 2, 259, 261, 7, 38, 2, 2, 260, 262, 5, 28, 15, 2, 261, 260, 3, 2, 2, 2, 261, 262, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 264, 7, 39, 2, 2, 264, 265, 7, 37, 2, 2, 265, 266, 5, 156, 79, 2, 266, 267, 7, 35, 2, 2, 267, 39, 3, 2, 2, 2, 268, 269, 7, 26, 2, 2, 269, 270, 5, 22, 12, 2, 270, 271, 7, 43, 2, 2, 271, 272, 7, 44, 2, 2, 272, 41, 3, 2, 2, 2, 273, 280, 5, 46, 24, 2, 274, 280, 5, 48, 25, 2, 275, 280, 5, 56, 29, 2, 276, 280, 5, 64, 33, 2, 277, 280, 5, 66, 34, 2, 278, 280, 5, 44, 23, 2, 279, 273, 3, 2, 2, 2, 279, 274, 3, 2, 2, 2, 279, 275, 3, 2, 2, 2, 279, 276, 3, 2, 2, 2, 279, 277, 3, 2, 2, 2, 279, 278, 3, 2, 2, 2, 280, 43, 3, 2, 2, 2, 281, 282, 6, 23, 2, 2, 282, 284, 7, 43, 2, 2, 283, 285, 5, 8, 5, 2, 284, 283, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 287, 7, 44, 2, 2, 287, 45, 3, 2, 2, 2, 288, 289, 8, 24, 1, 2, 289, 290, 5, 154, 78, 2, 290, 291, 7, 35, 2, 2, 291, 292, 8, 24, 1, 2, 292, 47, 3, 2, 2, 2, 293, 296, 5, 50, 26, 2, 294, 296, 5, 52, 27, 2, 295, 293, 3, 2, 2, 2, 295, 294, 3, 2, 2, 2, 296, 49, 3, 2, 2, 2, 297, 298, 7, 18, 2, 2, 298, 299, 7, 38, 2, 2, 299, 300, 5, 154, 78, 2, 300, 301, 7, 39, 2, 2, 301, 304, 5, 42, 22, 2, 302, 303, 7, 19, 2, 2, 303, 305, 5, 42, 22, 2, 304, 302, 3, 2, 2, 2, 304, 305, 3, 2, 2, 2, 305, 51, 3, 2, 2, 2, 306, 307, 7, 11, 2, 2, 307, 308, 7, 38, 2, 2, 308, 309, 5, 154, 78, 2, 309, 310, 7, 39, 2, 2, 310, 314, 7, 43, 2, 2, 311, 313, 5, 54, 28, 2, 312, 311, 3, 2, 2, 2, 313, 316, 3, 2, 2, 2, 314, 312, 3, 2, 2, 2, 314, 315, 3, 2, 2, 2, 315, 317, 3, 2, 2, 2, 316, 314, 3, 2, 2, 2, 317, 318, 7, 44, 2, 2, 318, 53, 3, 2, 2, 2, 319, 320, 7, 12, 2, 2, 320, 321, 5, 154, 78, 2, 321, 322, 7, 37, 2, 2, 322, 323, 5, 42, 22, 2, 323, 328, 3, 2, 2, 2, 324, 325, 7, 13, 2, 2, 325, 326, 7, 37, 2, 2, 326, 328, 5, 42, 22, 2, 327, 319, 3, 2, 2, 2, 327, 324, 3, 2, 2, 2, 328, 55, 3, 2, 2, 2, 329, 333, 5, 58, 30, 2, 330, 333, 5, 60, 31, 2, 331, 333, 5, 62, 32, 2, 332, 329, 3, 2, 2, 2, 332, 330, 3, 2, 2, 2, 332, 331, 3, 2, 2, 2, 333, 57, 3, 2, 2, 2, 334, 335, 7, 20, 2, 2, 335, 342, 7, 38, 2, 2, 336, 339, 5, 14, 8, 2, 337, 339, 5, 154, 78, 2, 338, 336, 3, 2, 2, 2, 338, 337, 3, 2, 2, 2, 339, 340, 3, 2, 2, 2, 340, 341, 8, 30, 1, 2, 341, 343, 3, 2, 2, 2, 342, 338, 3, 2, 2, 2, 342, 343, 3, 2, 2, 2, 343, 344, 3, 2, 2, 2, 344, 348, 7, 35, 2, 2, 345, 346, 5, 154, 78, 2, 346, 347, 8, 30, 1, 2, 347, 349, 3, 2, 2, 2, 348, 345, 3, 2, 2, 2, 348, 349, 3, 2, 2, 2, 349, 350, 3, 2, 2, 2, 350, 354, 7, 35, 2, 2, 351, 352, 5, 154, 78, 2, 352, 353, 8, 30, 1, 2, 353, 355, 3, 2, 2, 2, 354, 351, 3, 2, 2, 2, 354, 355, 3, 2, 2, 2, 355, 356, 3, 2, 2, 2, 356, 357, 7, 39, 2, 2, 357, 358, 5, 42, 22, 2, 358, 59, 3, 2, 2, 2, 359, 360, 7, 17, 2, 2, 360, 361, 7, 38, 2, 2, 361, 362, 5, 154, 78, 2, 362, 363, 7, 39, 2, 2, 363, 364, 5, 42, 22, 2, 364, 61, 3, 2, 2, 2, 365, 366, 7, 16, 2, 2, 366, 367, 5, 42, 22, 2, 367, 368, 7, 17, 2, 2, 368, 369, 7, 38, 2, 2, 369, 370, 5, 154, 78, 2, 370, 371, 7, 39, 2, 2, 371, 372, 7, 35, 2, 2, 372, 63, 3, 2, 2, 2, 373, 374, 9, 3, 2, 2, 374, 375, 7, 35, 2, 2, 375, 65, 3, 2, 2, 2, 376, 378, 7, 23, 2, 2, 377, 379, 5, 154, 78, 2, 378, 377, 3, 2, 2, 2, 378, 379, 3, 2, 2, 2, 379, 380, 3, 2, 2, 2, 380, 381, 7, 35, 2, 2, 381, 67, 3, 2, 2, 2, 382, 393, 5, 72, 37, 2, 383, 393, 5, 70, 36, 2, 384, 393, 5, 92, 47, 2, 385, 393, 5, 94, 48, 2, 386, 393, 5, 74, 38, 2, 387, 393, 5, 76, 39, 2, 388, 393, 5, 82, 42, 2, 389, 393, 5, 84, 43, 2, 390, 393, 5, 90, 46, 2, 391, 393, 5, 98, 50, 2, 392, 382, 3, 2, 2, 2, 392, 383, 3, 2, 2, 2, 392, 384, 3, 2, 2, 2, 392, 385, 3, 2, 2, 2, 392, 386, 3, 2, 2, 2, 392, 387, 3, 2, 2, 2, 392, 388, 3, 2, 2, 2, 392, 389, 3, 2, 2, 2, 392, 390, 3, 2, 2, 2, 392, 391, 3, 2, 2, 2, 393, 69, 3, 2, 2, 2, 394, 396, 7, 38, 2, 2, 395, 397, 5, 28, 15, 2, 396, 395, 3, 2, 2, 2, 396, 397, 3, 2, 2, 2, 397, 398, 3, 2, 2, 2, 398, 399, 7, 39, 2, 2, 399, 400, 7, 37, 2, 2, 400, 401, 5, 156, 79, 2, 401, 404, 7, 25, 2, 2, 402, 405, 5, 154, 78, 2, 403, 405, 5, 44, 23, 2, 404, 402, 3, 2, 2, 2, 404, 403, 3, 2, 2, 2, 405, 71, 3, 2, 2, 2, 406, 407, 7, 38, 2, 2, 407, 408, 5, 154, 78, 2, 408, 409, 7, 39, 2, 2, 409, 73, 3, 2, 2, 2, 410, 411, 9, 4, 2, 2, 411, 75, 3, 2, 2, 2, 412, 413, 5, 78, 40, 2, 413, 77, 3, 2, 2, 2, 414, 415, 7, 76, 2, 2, 415, 79, 3, 2, 2, 2, 416, 419, 5, 78, 40, 2, 417, 419, 5, 82, 42, 2, 418, 416, 3, 2, 2, 2, 418, 417, 3, 2, 2, 2, 419, 81, 3, 2, 2, 2, 420, 421, 9, 5, 2, 2, 421, 83, 3, 2, 2, 2, 422, 426, 7, 83, 2, 2, 423, 425, 5, 86, 44, 2, 424, 423, 3, 2, 2, 2, 425, 428, 3, 2, 2, 2, 426, 424, 3, 2, 2, 2, 426, 427, 3, 2, 2, 2, 427, 429, 3, 2, 2, 2, 428, 426, 3, 2, 2, 2, 429, 439, 7, 85, 2, 2, 430, 434, 7, 84, 2, 2, 431, 433, 5, 88, 45, 2, 432, 431, 3, 2, 2, 2, 433, 436, 3, 2, 2, 2, 434, 432, 3, 2, 2, 2, 434, 435, 3, 2, 2, 2, 435, 437, 3, 2, 2, 2, 436, 434, 3, 2, 2, 2, 437, 439, 7, 87, 2, 2, 438, 422, 3, 2, 2, 2, 438, 430, 3, 2, 2, 2, 439, 85, 3, 2, 2, 2, 440, 447, 7, 86, 2, 2, 441, 443, 7, 3, 2, 2, 442, 444, 5, 154, 78, 2, 443, 442, 3, 2, 2, 2, 443, 444, 3, 2, 2, 2, 444, 445, 3, 2, 2, 2, 445, 447, 7, 42, 2, 2, 446, 440, 3, 2, 2, 2, 446, 441, 3, 2, 2, 2, 447, 87, 3, 2, 2, 2, 448, 455, 7, 88, 2, 2, 449, 451, 7, 3, 2, 2, 450, 452, 5, 154, 78, 2, 451, 450, 3, 2, 2, 2, 451, 452, 3, 2, 2, 2, 452, 453, 3, 2, 2, 2, 453, 455, 7, 42, 2, 2, 454, 448, 3, 2, 2, 2, 454, 449, 3, 2, 2, 2, 455, 89, 3, 2, 2, 2, 456, 457, 9, 6, 2, 2, 457, 91, 3, 2, 2, 2, 458, 467, 7, 40, 2, 2, 459, 464, 5, 154, 78, 2, 460, 461, 7, 34, 2, 2, 461, 463, 5, 154, 78, 2, 462, 460, 3, 2, 2, 2, 463, 466, 3, 2, 2, 2, 464, 462, 3, 2, 2, 2, 464, 465, 3, 2, 2, 2, 465, 468, 3, 2, 2, 2, 466, 464, 3, 2, 2, 2, 467, 459, 3, 2, 2, 2, 467, 468, 3, 2, 2, 2, 468, 470, 3, 2, 2, 2, 469, 471, 7, 34, 2, 2, 470, 469, 3, 2, 2, 2, 470, 471, 3, 2, 2, 2, 471, 472, 3, 2, 2, 2, 472, 473, 7, 41, 2, 2, 473, 93, 3, 2, 2, 2, 474, 483, 7, 43, 2, 2, 475, 480, 5, 96, 49, 2, 476, 477, 7, 34, 2, 2, 477, 479, 5, 96, 49, 2, 478, 476, 3, 2, 2, 2, 479, 482, 3, 2, 2, 2, 480, 478, 3, 2, 2, 2, 480, 481, 3, 2, 2, 2, 481, 484, 3, 2, 2, 2, 482, 480, 3, 2, 2, 2, 483, 475, 3, 2, 2, 2, 483, 484, 3, 2, 2, 2, 484, 486, 3, 2, 2, 2, 485, 487, 7, 34, 2, 2, 486, 485, 3, 2, 2, 2, 486, 487, 3, 2, 2, 2, 487, 488, 3, 2, 2, 2, 488, 489, 7, 44, 2, 2, 489, 95, 3, 2, 2, 2, 490, 491, 5, 80, 41, 2, 491, 492, 7, 37, 2, 2, 492, 493, 5, 154, 78, 2, 493, 97, 3, 2, 2, 2, 494, 495, 9, 7, 2, 2, 495, 99, 3, 2, 2, 2, 496, 497, 8, 51, 1, 2, 497, 508, 5, 68, 35, 2, 498, 499, 7, 24, 2, 2, 499, 500, 5, 100, 51, 2, 500, 502, 7, 38, 2, 2, 501, 503, 5, 102, 52, 2, 502, 501, 3, 2, 2, 2, 502, 503, 3, 2, 2, 2, 503, 504, 3, 2, 2, 2, 504, 505, 7, 39, 2, 2, 505, 506, 8, 51, 1, 2, 506, 508, 3, 2, 2, 2, 507, 496, 3, 2, 2, 2, 507, 498, 3, 2, 2, 2, 508, 530, 3, 2, 2, 2, 509, 510, 12, 7, 2, 2, 510, 512, 7, 38, 2, 2, 511, 513, 5, 102, 52, 2, 512, 511, 3, 2, 2, 2, 512, 513, 3, 2, 2, 2, 513, 514, 3, 2, 2, 2, 514, 515, 7, 39, 2, 2, 515, 529, 8, 51, 1, 2, 516, 517, 12, 5, 2, 2, 517, 518, 5, 104, 53, 2, 518, 519, 8, 51, 1, 2, 519, 529, 3, 2, 2, 2, 520, 521, 12, 4, 2, 2, 521, 522, 5, 106, 54, 2, 522, 523, 8, 51, 1, 2, 523, 529, 3, 2, 2, 2, 524, 525, 12, 3, 2, 2, 525, 526, 5, 108, 55, 2, 526, 527, 8, 51, 1, 2, 527, 529, 3, 2, 2, 2, 528, 509, 3, 2, 2, 2, 528, 516, 3, 2, 2, 2, 528, 520, 3, 2, 2, 2, 528, 524, 3, 2, 2, 2, 529, 532, 3, 2, 2, 2, 530, 528, 3, 2, 2, 2, 530, 531, 3, 2, 2, 2, 531, 101, 3, 2, 2, 2, 532, 530, 3, 2, 2, 2, 533, 538, 5, 150, 76, 2, 534, 535, 7, 34, 2, 2, 535, 537, 5, 150, 76, 2, 536, 534, 3, 2, 2, 2, 537, 540, 3, 2, 2, 2, 538, 536, 3, 2, 2, 2, 538, 539, 3, 2, 2, 2, 539, 103, 3, 2, 2, 2, 540, 538, 3, 2, 2, 2, 541, 542, 7, 75, 2, 2, 542, 543, 5, 78, 40, 2, 543, 105, 3, 2, 2, 2, 544, 545, 7, 40, 2, 2, 545, 546, 5, 154, 78, 2, 546, 547, 7, 41, 2, 2, 547, 107, 3, 2, 2, 2, 548, 552, 7, 40, 2, 2, 549, 550, 5, 154, 78, 2, 550, 551, 8, 55, 1, 2, 551, 553, 3, 2, 2, 2, 552, 549, 3, 2, 2, 2, 552, 553, 3, 2, 2, 2, 553, 554, 3, 2, 2, 2, 554, 558, 7, 37, 2, 2, 555, 556, 5, 154, 78, 2, 556, 557, 8, 55, 1, 2, 557, 559, 3, 2, 2, 2, 558, 555, 3, 2, 2, 2, 558, 559, 3, 2, 2, 2, 559, 560, 3, 2, 2, 2, 560, 561, 7, 41, 2, 2, 561, 109, 3, 2, 2, 2, 562, 565, 5, 100, 51, 2, 563, 565, 5, 112, 57, 2, 564, 562, 3, 2, 2, 2, 564, 563, 3, 2, 2, 2, 565, 111, 3, 2, 2, 2, 566, 567, 5, 100, 51, 2, 567, 568, 5, 120, 61, 2, 568, 113, 3, 2, 2, 2, 569, 573, 5, 110, 56, 2, 570, 573, 5, 116, 59, 2, 571, 573, 5, 118, 60, 2, 572, 569, 3, 2, 2, 2, 572, 570, 3, 2, 2, 2, 572, 571, 3, 2, 2, 2, 573, 115, 3, 2, 2, 2, 574, 575, 5, 120, 61, 2, 575, 576, 5, 110, 56, 2, 576, 117, 3, 2, 2, 2, 577, 578, 5, 122, 62, 2, 578, 579, 5, 110, 56, 2, 579, 119, 3, 2, 2, 2, 580, 581, 9, 8, 2, 2, 581, 121, 3, 2, 2, 2, 582, 583, 9, 9, 2, 2, 583, 123, 3, 2, 2, 2, 584, 590, 5, 114, 58, 2, 585, 586, 5, 114, 58, 2, 586, 587, 7, 9, 2, 2, 587, 588, 5, 156, 79, 2, 588, 590, 3, 2, 2, 2, 589, 584, 3, 2, 2, 2, 589, 585, 3, 2, 2, 2, 590, 125, 3, 2, 2, 2, 591, 592, 8, 64, 1, 2, 592, 593, 5, 124, 63, 2, 593, 599, 3, 2, 2, 2, 594, 595, 12, 3, 2, 2, 595, 596, 9, 10, 2, 2, 596, 598, 5, 124, 63, 2, 597, 594, 3, 2, 2, 2, 598, 601, 3, 2, 2, 2, 599, 597, 3, 2, 2, 2, 599, 600, 3, 2, 2, 2, 600, 127, 3, 2, 2, 2, 601, 599, 3, 2, 2, 2, 602, 603, 8, 65, 1, 2, 603, 604, 5, 126, 64, 2, 604, 610, 3, 2, 2, 2, 605, 606, 12, 3, 2, 2, 606, 607, 9, 11, 2, 2, 607, 609, 5, 126, 64, 2, 608, 605, 3, 2, 2, 2, 609, 612, 3, 2, 2, 2, 610, 608, 3, 2, 2, 2, 610, 611, 3, 2, 2, 2, 611, 129, 3, 2, 2, 2, 612, 610, 3, 2, 2, 2, 613, 614, 8, 66, 1, 2, 614, 615, 5, 128, 65, 2, 615, 622, 3, 2, 2, 2, 616, 617, 12, 3, 2, 2, 617, 618, 5, 132, 67, 2, 618, 619, 5, 138, 70, 2, 619, 621, 3, 2, 2, 2, 620, 616, 3, 2, 2, 2, 621, 624, 3, 2, 2, 2, 622, 620, 3, 2, 2, 2, 622, 623, 3, 2, 2, 2, 623, 131, 3, 2, 2, 2, 624, 622, 3, 2, 2, 2, 625, 626, 9, 12, 2, 2, 626, 133, 3, 2, 2, 2, 627, 628, 8, 68, 1, 2, 628, 629, 5, 130, 66, 2, 629, 635, 3, 2, 2, 2, 630, 631, 12, 3, 2, 2, 631, 632, 9, 13, 2, 2, 632, 634, 5, 130, 66, 2, 633, 630, 3, 2, 2, 2, 634, 637, 3, 2, 2, 2, 635, 633, 3, 2, 2, 2, 635, 636, 3, 2, 2, 2, 636, 135, 3, 2, 2, 2, 637, 635, 3, 2, 2, 2, 638, 639, 8, 69, 1, 2, 639, 640, 5, 134, 68, 2, 640, 646, 3, 2, 2, 2, 641, 642, 12, 3, 2, 2, 642, 643, 9, 14, 2, 2, 643, 645, 5, 134, 68, 2, 644, 641, 3, 2, 2, 2, 645, 648, 3, 2, 2, 2, 646, 644, 3, 2, 2, 2, 646, 647, 3, 2, 2, 2, 647, 137, 3, 2, 2, 2, 648, 646, 3, 2, 2, 2, 649, 650, 8, 70, 1, 2, 650, 651, 5, 136, 69, 2, 651, 657, 3, 2, 2, 2, 652, 653, 12, 3, 2, 2, 653, 654, 7, 68, 2, 2, 654, 656, 5, 136, 69, 2, 655, 652, 3, 2, 2, 2, 656, 659, 3, 2, 2, 2, 657, 655, 3, 2, 2, 2, 657, 658, 3, 2, 2, 2, 658, 139, 3, 2, 2, 2, 659, 657, 3, 2, 2, 2, 660, 661, 8, 71, 1, 2, 661, 662, 5, 138, 70, 2, 662, 668, 3, 2, 2, 2, 663, 664, 12, 3, 2, 2, 664, 665, 7, 70, 2, 2, 665, 667, 5, 138, 70, 2, 666, 663, 3, 2, 2, 2, 667, 670, 3, 2, 2, 2, 668, 666, 3, 2, 2, 2, 668, 669, 3, 2, 2, 2, 669, 141, 3, 2, 2, 2, 670, 668, 3, 2, 2, 2, 671, 672, 8, 72, 1, 2, 672, 673, 5, 140, 71, 2, 673, 679, 3, 2, 2, 2, 674, 675, 12, 3, 2, 2, 675, 676, 7, 69, 2, 2, 676, 678, 5, 140, 71, 2, 677, 674, 3, 2, 2, 2, 678, 681, 3, 2, 2, 2, 679, 677, 3, 2, 2, 2, 679, 680, 3, 2, 2, 2, 680, 143, 3, 2, 2, 2, 681, 679, 3, 2, 2, 2, 682, 683, 8, 73, 1, 2, 683, 684, 5, 142, 72, 2, 684, 690, 3, 2, 2, 2, 685, 686, 12, 3, 2, 2, 686, 687, 7, 53, 2, 2, 687, 689, 5, 142, 72, 2, 688, 685, 3, 2, 2, 2, 689, 692, 3, 2, 2, 2, 690, 688, 3, 2, 2, 2, 690, 691, 3, 2, 2, 2, 691, 145, 3, 2, 2, 2, 692, 690, 3, 2, 2, 2, 693, 694, 8, 74, 1, 2, 694, 695, 5, 144, 73, 2, 695, 701, 3, 2, 2, 2, 696, 697, 12, 3, 2, 2, 697, 698, 7, 54, 2, 2, 698, 700, 5, 144, 73, 2, 699, 696, 3, 2, 2, 2, 700, 703, 3, 2, 2, 2, 701, 699, 3, 2, 2, 2, 701, 702, 3, 2, 2, 2, 702, 147, 3, 2, 2, 2, 703, 701, 3, 2, 2, 2, 704, 712, 5, 146, 74, 2, 705, 706, 5, 146, 74, 2, 706, 707, 7, 36, 2, 2, 707, 708, 5, 148, 75, 2, 708, 709, 7, 37, 2, 2, 709, 710, 5, 148, 75, 2, 710, 712, 3, 2, 2, 2, 711, 704, 3, 2, 2, 2, 711, 705, 3, 2, 2, 2, 712, 149, 3, 2, 2, 2, 713, 719, 5, 148, 75, 2, 714, 715, 5, 100, 51, 2, 715, 716, 5, 152, 77, 2, 716, 717, 5, 150, 76, 2, 717, 719, 3, 2, 2, 2, 718, 713, 3, 2, 2, 2, 718, 714, 3, 2, 2, 2, 719, 151, 3, 2, 2, 2, 720, 721, 9, 15, 2, 2, 721, 153, 3, 2, 2, 2, 722, 727, 5, 150, 76, 2, 723, 724, 7, 34, 2, 2, 724, 726, 5, 150, 76, 2, 725, 723, 3, 2, 2, 2, 726, 729, 3, 2, 2, 2, 727, 725, 3, 2, 2, 2, 727, 728, 3, 2, 2, 2, 728, 155, 3, 2, 2, 2, 729, 727, 3, 2, 2, 2, 730, 734, 5, 158, 80, 2, 731, 734, 5, 160, 81, 2, 732, 734, 5, 162, 82, 2, 733, 730, 3, 2, 2, 2, 733, 731, 3, 2, 2, 2, 733, 732, 3, 2, 2, 2, 734, 157, 3, 2, 2, 2, 735, 736, 5, 164, 83, 2, 736, 159, 3, 2, 2, 2, 737, 738, 5, 164, 83, 2, 738, 739, 7, 64, 2, 2, 739, 740, 5, 156, 79, 2, 740, 741, 7, 66, 2, 2, 741, 161, 3, 2, 2, 2, 742, 743, 7, 30, 2, 2, 743, 744, 7, 38, 2, 2, 744, 745, 5, 164, 83, 2, 745, 746, 7, 39, 2, 2, 746, 163, 3, 2, 2, 2, 747, 748, 9, 16, 2, 2, 748, 165, 3, 2, 2, 2, 68, 167, 174, 181, 186, 194, 206, 218, 224, 231, 244, 251, 261, 279, 284, 295, 304, 314, 327, 332, 338, 342, 348, 354, 378, 392, 396, 404, 418, 426, 434, 438, 443, 446, 451, 454, 464, 467, 470, 480, 483, 486, 502, 507, 512, 528, 530, 538, 552, 558, 564, 572, 589, 599, 610, 622, 635, 646, 657, 668, 679, 690, 701, 711, 718, 727, 733] \ No newline at end of file diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts index 232c1c728..864cea126 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts @@ -4606,7 +4606,7 @@ export class KipperParser extends KipperParserBase { this.state = 736; this.match(KipperParser.Less); this.state = 737; - this.typeSpecifierIdentifier(); + this.typeSpecifierExpression(); this.state = 738; this.match(KipperParser.Greater); } @@ -5175,7 +5175,7 @@ export class KipperParser extends KipperParserBase { "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" + + "\u02E3\u02E4\x05\x9CO\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" + @@ -9201,18 +9201,15 @@ export class IdentifierTypeSpecifierExpressionContext extends KipperParserRuleCo } export class GenericTypeSpecifierExpressionContext extends KipperParserRuleContext { - public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext[]; - public typeSpecifierIdentifier(i: number): TypeSpecifierIdentifierContext; - public typeSpecifierIdentifier(i?: number): TypeSpecifierIdentifierContext | TypeSpecifierIdentifierContext[] { - if (i === undefined) { - return this.getRuleContexts(TypeSpecifierIdentifierContext); - } else { - return this.getRuleContext(i, TypeSpecifierIdentifierContext); - } + public typeSpecifierIdentifier(): TypeSpecifierIdentifierContext { + return this.getRuleContext(0, TypeSpecifierIdentifierContext); } public Less(): TerminalNode { return this.getToken(KipperParser.Less, 0); } + public typeSpecifierExpression(): TypeSpecifierExpressionContext { + return this.getRuleContext(0, TypeSpecifierExpressionContext); + } public Greater(): TerminalNode { return this.getToken(KipperParser.Greater, 0); } diff --git a/kipper/core/src/compiler/semantics/analyser/type-checker.ts b/kipper/core/src/compiler/semantics/analyser/type-checker.ts index 1377c8226..8bd305ddf 100644 --- a/kipper/core/src/compiler/semantics/analyser/type-checker.ts +++ b/kipper/core/src/compiler/semantics/analyser/type-checker.ts @@ -5,7 +5,7 @@ */ import type { BuiltInFunctionArgument } from "../runtime-built-ins"; import type { KipperProgramContext } from "../../program-ctx"; -import { +import type { AssignmentExpression, FunctionDeclaration, IncrementOrDecrementPostfixExpression, @@ -45,6 +45,7 @@ import { kipperSupportedConversions, } from "../../const"; import type { TypeError } from "../../../errors"; +import { CanNotUseNonGenericAsGenericTypeError, InvalidAmountOfGenericArgumentsError } from "../../../errors"; import { ArithmeticOperationTypeError, BitwiseOperationTypeError, @@ -63,7 +64,7 @@ import { UnknownTypeError, ValueNotIndexableTypeError, } from "../../../errors"; -import type { RawType, ProcessedType } from "../types"; +import type { RawType, ProcessedType, GenericType, GenericTypeArguments } from "../types"; import { UndefinedType } from "../types"; import type { Reference } from "../reference"; @@ -125,6 +126,24 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { } } + /** + * Ensures that the given {@link type generic type} is valid by checking whether the provided generic arguments + * match the generic type's constraints. + * + * As generics are not fully implemented, this only checks for the number of arguments. + * @param type The generic type to check. + * @param args The generic arguments to check. + */ + public ensureValidGenericType(type: ProcessedType | GenericType, args: ProcessedType[]): void { + if (!type.isGeneric || !("genericTypeArguments" in type)) { + throw this.assertError(new CanNotUseNonGenericAsGenericTypeError(type.identifier)); + } else if (type.genericTypeArguments.length !== args.length) { + throw this.assertError( + new InvalidAmountOfGenericArgumentsError(type.identifier, type.genericTypeArguments.length, args.length), + ); + } + } + /** * Asserts that the passed {@link ref} is callable. This function will only check {@link ScopeDeclaration} instances, * since {@link BuiltInFunction built-in functions} will always be callable. diff --git a/kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts b/kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts index 6e47e4f9f..76390aa24 100644 --- a/kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts +++ b/kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts @@ -2,6 +2,7 @@ import { BuiltInType } from "./built-in-type"; import type { GenericType, GenericTypeArguments } from "./generic-type"; import type { KipperBuiltInTypeLiteral } from "../../../const"; import type { ProcessedType } from "./index"; +import { KipperInternalError } from "../../../../errors"; /** * Represents a generic built-in type that is used in the type analysis phase. @@ -37,6 +38,8 @@ export abstract class GenericBuiltInType extends BuiltInType implements GenericT return true; } + public abstract changeGenericTypeArguments(genericTypeArguments: Array): GenericType; + /** * Asserts that this type is assignable to another type. * diff --git a/kipper/core/src/compiler/semantics/types/base/generic-type.ts b/kipper/core/src/compiler/semantics/types/base/generic-type.ts index 64e1e94f8..e460b0c1f 100644 --- a/kipper/core/src/compiler/semantics/types/base/generic-type.ts +++ b/kipper/core/src/compiler/semantics/types/base/generic-type.ts @@ -1,16 +1,16 @@ -import type { BuiltInType } from "./built-in-type"; +import type { ProcessedType } from "./processed-type"; /** * Represents the generic type arguments for a generic type. * @since 0.12.0 */ -export type GenericTypeArguments = Array<{ identifier: string; type: BuiltInType }>; +export type GenericTypeArguments = Array<{ identifier: string; type: ProcessedType }>; /** * Represents a type which takes in generic type arguments. * @since 0.12.0 */ -export interface GenericType { +export interface GenericType extends ProcessedType { /** * Returns whether the type is a generic type. * @since 0.12.0 @@ -21,4 +21,12 @@ export interface GenericType { * @since 0.12.0 */ readonly genericTypeArguments: GenericTypeArguments; + /** + * Changes the generic type arguments for this generic type and returns a new generic type instance with the new + * arguments where the types have been adjusted. + * @param genericTypeArguments The new generic type arguments. The length of this array must be equal to the length + * of the current generic type arguments. + * @since 0.12.0 + */ + changeGenericTypeArguments(genericTypeArguments: Array): GenericType; } diff --git a/kipper/core/src/compiler/semantics/types/built-in/array.ts b/kipper/core/src/compiler/semantics/types/built-in/array.ts index 609aa0b4d..62901b49e 100644 --- a/kipper/core/src/compiler/semantics/types/built-in/array.ts +++ b/kipper/core/src/compiler/semantics/types/built-in/array.ts @@ -1,6 +1,7 @@ import { GenericBuiltInType } from "../base/generic-built-in-type"; import type { ProcessedType } from "../index"; import type { TypeError } from "../../../../errors"; +import { KipperInternalError } from "../../../../errors"; import { ArgumentAssignmentTypeError, AssignmentTypeError, @@ -28,6 +29,17 @@ export class BuiltInTypeArray extends GenericBuiltInType { return this.genericTypeArguments[0].type.isCompilable; } + public changeGenericTypeArguments(genericTypeArguments: Array): BuiltInTypeArray { + if (genericTypeArguments.length !== this.genericTypeArguments.length) { + throw new KipperInternalError( + "The length of the new generic type arguments must be equal to the length of the current generic type arguments.", + ); + } + + // TODO! Implement generic type arguments + return new BuiltInTypeArray(genericTypeArguments[0]); + } + public assertAssignableTo(type: ProcessedType, propertyName?: string, argumentName?: string) { if (this === type || type === BuiltInTypes.any) { return; diff --git a/kipper/core/src/compiler/semantics/types/built-in/func.ts b/kipper/core/src/compiler/semantics/types/built-in/func.ts index ae11ee981..1007d4140 100644 --- a/kipper/core/src/compiler/semantics/types/built-in/func.ts +++ b/kipper/core/src/compiler/semantics/types/built-in/func.ts @@ -25,6 +25,17 @@ export class BuiltInTypeFunc extends GenericBuiltInType { return true; } + public changeGenericTypeArguments(genericTypeArguments: Array): BuiltInTypeFunc { + if (genericTypeArguments.length !== this.genericTypeArguments.length) { + throw new KipperInternalError( + "The length of the new generic type arguments must be equal to the length of the current generic type arguments.", + ); + } + + // TODO! Implement generic type arguments + return new BuiltInTypeFunc(); + } + public assertAssignableTo(type: ProcessedType, propertyName?: string, argumentName?: string) { // TODO! Implement generic type arguments and function signature checking if (this === type) { diff --git a/kipper/core/src/errors.ts b/kipper/core/src/errors.ts index 52dddfbdb..051a2ca04 100644 --- a/kipper/core/src/errors.ts +++ b/kipper/core/src/errors.ts @@ -686,6 +686,30 @@ export class GenericArgumentTypeError extends TypeError { } } +/** + * Error that is thrown when an invalid amount of generic arguments is passed to a type. + * @since 0.12.0 + */ +export class InvalidAmountOfGenericArgumentsError extends TypeError { + constructor(typeIdentifier: string, expected: number, received: number) { + super( + `Type '${typeIdentifier}' only accepts ${expected} generic argument${ + expected === 1 ? "" : "s" + }, received ${received}.`, + ); + } +} + +/** + * Error that is thrown whenever a type is used that is not a generic type. + * @since 0.12.0 + */ +export class CanNotUseNonGenericAsGenericTypeError extends TypeError { + constructor(identifier: string) { + super(`Type '${identifier}' does not accept generic arguments.`); + } +} + /** * Error that is thrown whenever a read-only variable is being assigned to. * @since 0.8.3 diff --git a/kipper/target-ts/src/code-generator.ts b/kipper/target-ts/src/code-generator.ts index d2066b7a0..4520530b8 100644 --- a/kipper/target-ts/src/code-generator.ts +++ b/kipper/target-ts/src/code-generator.ts @@ -84,7 +84,7 @@ export class TypeScriptTargetCodeGenerator extends JavaScriptTargetCodeGenerator const semanticData = node.getSemanticData(); const params = semanticData.parameters; const returnTypeIdentifier = TargetTS.getTypeScriptType( - semanticData.returnType.getSemanticData().typeIdentifier.identifier, + semanticData.returnType.getSemanticData().rawType.identifier, ); const paramsCode: TranslatedCodeLine[] = await Promise.all( From 1d9dbde9fd80240c64b2d733cb7e9419b184c85e Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Fri, 12 Jul 2024 16:54:12 +0200 Subject: [PATCH 34/57] other: Fixed failing test cases due to last commit 86d0e429ed56a66b25d069ec9677837fd2adc8af --- test/module/core/core-functionality.test.ts | 8 ++++---- .../core/errors/type-errors/invalid-conversion.ts | 12 ++++++------ test/module/core/not-implemented.test.ts | 13 ------------- 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/test/module/core/core-functionality.test.ts b/test/module/core/core-functionality.test.ts index e342dad3c..ca3c3c99d 100644 --- a/test/module/core/core-functionality.test.ts +++ b/test/module/core/core-functionality.test.ts @@ -1246,7 +1246,7 @@ describe("Core functionality", () => { 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;`; + const code = `var add: Func = (x: num, y: num): num -> x + y;`; try { const result = await compiler.compile(code, jsConfig); @@ -1261,7 +1261,7 @@ describe("Core functionality", () => { }); it("correctly identifies semantic data for a lambda with compound statement", async () => { - const code = `var greet: func = (name: str): str -> { return "Hello, " + name; };`; + const code = `var greet: Func = (name: str): str -> { return "Hello, " + name; };`; try { const result = await compiler.compile(code, jsConfig); @@ -1276,7 +1276,7 @@ describe("Core functionality", () => { }); it("correctly identifies semantic data for a lambda with single statement", async () => { - const code = `var greet: func = (name: str): str -> "Hello, " + name;`; + const code = `var greet: Func = (name: str): str -> "Hello, " + name;`; try { const result = await compiler.compile(code, jsConfig); @@ -1291,7 +1291,7 @@ describe("Core functionality", () => { }); it("correctly identifies semantic data for a lambda with no parameters", async () => { - const code = `var greet: func = (): str -> "Hello, World!";`; + const code = `var greet: Func = (): str -> "Hello, World!";`; try { const result = await compiler.compile(code, jsConfig); diff --git a/test/module/core/errors/type-errors/invalid-conversion.ts b/test/module/core/errors/type-errors/invalid-conversion.ts index b1e57cb1f..2138b0d2b 100644 --- a/test/module/core/errors/type-errors/invalid-conversion.ts +++ b/test/module/core/errors/type-errors/invalid-conversion.ts @@ -5,9 +5,9 @@ import { assert } from "chai"; describe("InvalidConversionTypeError", () => { describe("Error", () => { - it("str as func", async () => { + it("str as Func", async () => { try { - await new KipperCompiler().compile('"5" as func;', defaultConfig); + await new KipperCompiler().compile('"5" as Func;', defaultConfig); } catch (e) { assert.equal((e).constructor.name, "InvalidConversionTypeError", "Expected different error"); assert((e).name === "TypeError", "Expected different error"); @@ -17,9 +17,9 @@ describe("InvalidConversionTypeError", () => { assert.fail("Expected 'InvalidConversionTypeError'"); }); - it("num as func", async () => { + it("num as Func", async () => { try { - await new KipperCompiler().compile("5 as func;", defaultConfig); + await new KipperCompiler().compile("5 as Func;", defaultConfig); } catch (e) { assert.equal((e).constructor.name, "InvalidConversionTypeError", "Expected different error"); assert((e).name === "TypeError", "Expected different error"); @@ -29,9 +29,9 @@ describe("InvalidConversionTypeError", () => { assert.fail("Expected 'InvalidConversionTypeError'"); }); - it("bool as func", async () => { + it("bool as Func", async () => { try { - await new KipperCompiler().compile("true as func;", defaultConfig); + await new KipperCompiler().compile("true as Func;", defaultConfig); } catch (e) { assert.equal((e).constructor.name, "InvalidConversionTypeError", "Expected different error"); assert((e).name === "TypeError", "Expected different error"); diff --git a/test/module/core/not-implemented.test.ts b/test/module/core/not-implemented.test.ts index 3f966221d..d8af531fa 100644 --- a/test/module/core/not-implemented.test.ts +++ b/test/module/core/not-implemented.test.ts @@ -20,19 +20,6 @@ describe("NotImplemented", () => { assert.fail("Expected NotImplementedError"); }); - it("Generic Type Expression", async () => { - try { - await new KipperCompiler().compile("var x: list = [];", { - abortOnFirstError: true, - target: defaultTarget, - }); - } catch (e) { - assert.equal((e).constructor.name, "KipperNotImplementedError", "Expected different error"); - assert.equal((e).name, "NotImplementedError", "Expected different error"); - return; - } - assert.fail("Expected NotImplementedError"); - }); it("Conditional Expression with union types", async () => { try { From 922372cd9e1c7e2f9e94d3a35104bc2db174b12c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 13 Jul 2024 13:55:43 +0000 Subject: [PATCH 35/57] chore(deps): update dependency prettier to v3 --- kipper/cli/package.json | 2 +- kipper/cli/pnpm-lock.yaml | 12 +++++++----- kipper/core/package.json | 2 +- kipper/core/pnpm-lock.yaml | 11 ++++++----- kipper/target-js/package.json | 2 +- kipper/target-js/pnpm-lock.yaml | 11 ++++++----- kipper/target-ts/package.json | 2 +- kipper/target-ts/pnpm-lock.yaml | 11 ++++++----- kipper/web/package.json | 2 +- kipper/web/pnpm-lock.yaml | 11 ++++++----- package.json | 2 +- pnpm-lock.yaml | 14 +++++++++----- 12 files changed, 46 insertions(+), 36 deletions(-) diff --git a/kipper/cli/package.json b/kipper/cli/package.json index 778103401..5f3ea13fa 100644 --- a/kipper/cli/package.json +++ b/kipper/cli/package.json @@ -38,7 +38,7 @@ "typescript": "5.1.3", "oclif": "3.17.2", "semver": "7.6.2", - "prettier": "2.8.8" + "prettier": "3.3.3" }, "engines": { "node": "16.x || 18.x || 20.x || 22.x", diff --git a/kipper/cli/pnpm-lock.yaml b/kipper/cli/pnpm-lock.yaml index 89943a6d7..95403064a 100644 --- a/kipper/cli/pnpm-lock.yaml +++ b/kipper/cli/pnpm-lock.yaml @@ -80,8 +80,8 @@ devDependencies: specifier: 2.0.0 version: 2.0.0 prettier: - specifier: 2.8.8 - version: 2.8.8 + specifier: 3.3.3 + version: 3.3.3 pseudomap: specifier: 1.0.2 version: 1.0.2 @@ -3546,9 +3546,10 @@ packages: which-pm: 2.0.0 dev: true - /prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} + /prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} + engines: {node: '>=14'} + hasBin: true dev: true /pretty-bytes@5.6.0: @@ -4240,6 +4241,7 @@ packages: /ts-node@10.9.2(@types/node@20.14.9)(typescript@5.1.3): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true peerDependencies: '@swc/core': '>=1.2.50' '@swc/wasm': '>=1.2.50' diff --git a/kipper/core/package.json b/kipper/core/package.json index 5f5e65129..66d8f6a96 100644 --- a/kipper/core/package.json +++ b/kipper/core/package.json @@ -10,7 +10,7 @@ "devDependencies": { "@types/node": "20.14.9", "typescript": "5.1.3", - "prettier": "2.8.8", + "prettier": "3.3.3", "size-limit": "11.1.4", "antlr4ts-cli": "^0.5.0-alpha.4" }, diff --git a/kipper/core/pnpm-lock.yaml b/kipper/core/pnpm-lock.yaml index 99bc615de..179c4e427 100644 --- a/kipper/core/pnpm-lock.yaml +++ b/kipper/core/pnpm-lock.yaml @@ -20,8 +20,8 @@ devDependencies: specifier: ^0.5.0-alpha.4 version: 0.5.0-alpha.4 prettier: - specifier: 2.8.8 - version: 2.8.8 + specifier: 3.3.3 + version: 3.3.3 size-limit: specifier: 11.1.4 version: 11.1.4 @@ -238,9 +238,10 @@ packages: engines: {node: '>=8.6'} dev: true - /prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} + /prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} + engines: {node: '>=14'} + hasBin: true dev: true /queue-microtask@1.2.3: diff --git a/kipper/target-js/package.json b/kipper/target-js/package.json index b822a9c00..3dc7f7899 100644 --- a/kipper/target-js/package.json +++ b/kipper/target-js/package.json @@ -10,7 +10,7 @@ "devDependencies": { "@types/node": "18.16.16", "typescript": "5.1.3", - "prettier": "2.8.8" + "prettier": "3.3.3" }, "engines": { "node": "16.x || 18.x || 20.x || 22.x", diff --git a/kipper/target-js/pnpm-lock.yaml b/kipper/target-js/pnpm-lock.yaml index 17381bee9..2b373210f 100644 --- a/kipper/target-js/pnpm-lock.yaml +++ b/kipper/target-js/pnpm-lock.yaml @@ -17,8 +17,8 @@ devDependencies: specifier: 18.16.16 version: 18.16.16 prettier: - specifier: 2.8.8 - version: 2.8.8 + specifier: 3.3.3 + version: 3.3.3 typescript: specifier: 5.1.3 version: 5.1.3 @@ -29,9 +29,10 @@ packages: resolution: {integrity: sha512-NpaM49IGQQAUlBhHMF82QH80J08os4ZmyF9MkpCzWAGuOHqE4gTEbhzd7L3l5LmWuZ6E0OiC1FweQ4tsiW35+g==} dev: true - /prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} + /prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} + engines: {node: '>=14'} + hasBin: true dev: true /tslib@2.6.2: diff --git a/kipper/target-ts/package.json b/kipper/target-ts/package.json index 6dfaacd24..24b505906 100644 --- a/kipper/target-ts/package.json +++ b/kipper/target-ts/package.json @@ -11,7 +11,7 @@ "devDependencies": { "@types/node": "18.16.16", "typescript": "5.1.3", - "prettier": "2.8.8" + "prettier": "3.3.3" }, "engines": { "node": "16.x || 18.x || 20.x || 22.x", diff --git a/kipper/target-ts/pnpm-lock.yaml b/kipper/target-ts/pnpm-lock.yaml index e2386b4bf..16e3e9dc2 100644 --- a/kipper/target-ts/pnpm-lock.yaml +++ b/kipper/target-ts/pnpm-lock.yaml @@ -20,8 +20,8 @@ devDependencies: specifier: 18.16.16 version: 18.16.16 prettier: - specifier: 2.8.8 - version: 2.8.8 + specifier: 3.3.3 + version: 3.3.3 typescript: specifier: 5.1.3 version: 5.1.3 @@ -32,9 +32,10 @@ packages: resolution: {integrity: sha512-NpaM49IGQQAUlBhHMF82QH80J08os4ZmyF9MkpCzWAGuOHqE4gTEbhzd7L3l5LmWuZ6E0OiC1FweQ4tsiW35+g==} dev: true - /prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} + /prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} + engines: {node: '>=14'} + hasBin: true dev: true /tslib@2.6.2: diff --git a/kipper/web/package.json b/kipper/web/package.json index d1b37ba29..5b792af48 100644 --- a/kipper/web/package.json +++ b/kipper/web/package.json @@ -9,7 +9,7 @@ "@kipper/core": "workspace:~", "@types/node": "18.16.16", "typescript": "5.1.3", - "prettier": "2.8.8", + "prettier": "3.3.3", "browserify": "17.0.0", "uglify-js": "3.18.0" }, diff --git a/kipper/web/pnpm-lock.yaml b/kipper/web/pnpm-lock.yaml index a2c78b92c..1558af509 100644 --- a/kipper/web/pnpm-lock.yaml +++ b/kipper/web/pnpm-lock.yaml @@ -21,8 +21,8 @@ devDependencies: specifier: 17.0.0 version: 17.0.0 prettier: - specifier: 2.8.8 - version: 2.8.8 + specifier: 3.3.3 + version: 3.3.3 typescript: specifier: 5.1.3 version: 5.1.3 @@ -920,9 +920,10 @@ packages: sha.js: 2.4.11 dev: true - /prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} + /prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} + engines: {node: '>=14'} + hasBin: true dev: true /process-nextick-args@2.0.1: diff --git a/package.json b/package.json index cdea96b21..8564acddf 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "mkdirp": "3.0.1", "mocha": "10.6.0", "nyc": "17.0.0", - "prettier": "2.8.8", + "prettier": "3.3.3", "run-script-os": "1.1.6", "semver": "7.6.0", "source-map-support": "0.5.21", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4f8f3fe9f..c0a0a1c0f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -80,8 +80,8 @@ devDependencies: specifier: 17.0.0 version: 17.0.0 prettier: - specifier: 2.8.8 - version: 2.8.8 + specifier: 3.3.3 + version: 3.3.3 run-script-os: specifier: 1.1.6 version: 1.1.6 @@ -2905,9 +2905,10 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} + /prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} + engines: {node: '>=14'} + hasBin: true dev: true /process-nextick-args@2.0.1: @@ -3427,6 +3428,7 @@ packages: /ts-mocha@10.0.0(mocha@10.6.0): resolution: {integrity: sha512-VRfgDO+iiuJFlNB18tzOfypJ21xn2xbuZyDvJvqpTbWgkAgD17ONGr8t+Tl8rcBtOBdjXp5e/Rk+d39f7XBHRw==} engines: {node: '>= 6.X.X'} + hasBin: true peerDependencies: mocha: ^3.X.X || ^4.X.X || ^5.X.X || ^6.X.X || ^7.X.X || ^8.X.X || ^9.X.X || ^10.X.X dependencies: @@ -3438,6 +3440,7 @@ packages: /ts-node@10.9.2(@types/node@18.16.16)(typescript@5.1.3): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true peerDependencies: '@swc/core': '>=1.2.50' '@swc/wasm': '>=1.2.50' @@ -3587,6 +3590,7 @@ packages: /update-browserslist-db@1.0.13(browserslist@4.23.0): resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} + hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: From b910f6469fee3ea5d7cfe2d2386a4506a85d942c Mon Sep 17 00:00:00 2001 From: Fabian Date: Mon, 15 Jul 2024 12:59:05 +0200 Subject: [PATCH 36/57] Added semantic analysis and code generation to ObjectPrimaryExpression and --- CHANGELOG.md | 2 +- kipper/core/src/compiler/ast/ast-generator.ts | 4 +- .../object-primary-expression-semantics.ts | 3 ++ .../object-primary-expression.ts | 26 ++++++++---- .../object-property-semantics.ts | 6 +-- .../object-property/object-property.ts | 28 +++++++++---- .../compiler/semantics/types/custom-type.ts | 13 +++--- kipper/target-js/src/code-generator.ts | 41 +++++++++++++++---- kipper/target-ts/src/code-generator.ts | 13 +++++- test/module/core/core-functionality.test.ts | 13 ++++++ 10 files changed, 110 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbdad7884..eed2249db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ To use development versions of Kipper download the [`next` tag release](https://www.npmjs.com/package/kipper?activeTab=versions), which will include the specified changes. ### Added - +- Added semantic checking and code generation for PrimaryObjectExpression and ObjectProperty - Implemented internal representation for custom types such as objects, interfaces and classes. This change means that the entire core type system has been reworked and adjusted to also support custom types as well as complex types (objects, arrays etc.). This does not inheritely add functionality but serves as the stepping stone for the diff --git a/kipper/core/src/compiler/ast/ast-generator.ts b/kipper/core/src/compiler/ast/ast-generator.ts index ffdca57e9..49e6d85f6 100644 --- a/kipper/core/src/compiler/ast/ast-generator.ts +++ b/kipper/core/src/compiler/ast/ast-generator.ts @@ -201,7 +201,7 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi 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.", + " definition.", ); } this._currentPrimaryNode = this.expressionFactory.create(ctx, this.currentNode); @@ -211,7 +211,7 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi this.programCtx.logger.debug( `Created AST node of type '${this.currentNode.constructor.name}' for context '${ctx.astSyntaxKind}'` + - `(Loc: ${ctx.start.line}:${ctx.start.charPositionInLine})`, + `(Loc: ${ctx.start.line}:${ctx.start.charPositionInLine})`, ); } diff --git a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/object-primary-expression/object-primary-expression-semantics.ts b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/object-primary-expression/object-primary-expression-semantics.ts index 263f06d4a..22b16a518 100644 --- a/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/object-primary-expression/object-primary-expression-semantics.ts +++ b/kipper/core/src/compiler/ast/nodes/expressions/primary-expression/object-primary-expression/object-primary-expression-semantics.ts @@ -1,5 +1,8 @@ import type { PrimaryExpressionSemantics } from "../primary-expression-semantics"; import type { ObjectProperty } from "./object-property"; +import { StringPrimaryExpression } from "../string-primary-expression"; +import type { KipperStorageType } from "../../../../../const"; +import type { IdentifierTypeSpecifierExpression } from "../../type-specifier-expression"; /** * Semantics for AST Node {@link VariableDeclaration}. 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 6fcf7e2ab..f69736672 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 @@ -6,10 +6,17 @@ import type { ObjectPrimaryExpressionSemantics } from "./object-primary-expressi import type { ObjectPrimaryExpressionTypeSemantics } from "./object-primary-expression-type-semantics"; import type { CompilableASTNode } from "../../../../compilable-ast-node"; import type { ObjectPrimaryExpressionContext } from "../../../../../lexer-parser"; +import { DeclaratorContext } from "../../../../../lexer-parser"; +import { InitDeclaratorContext, StorageTypeSpecifierContext } from "../../../../../lexer-parser"; import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../lexer-parser"; -import { KipperNotImplementedError } from "../../../../../../errors"; import { PrimaryExpression } from "../primary-expression"; -import { ObjectProperty } from "./object-property"; +import { CustomType } from "../../../../../semantics"; +import type { ObjectProperty } from "./object-property"; +import { UnableToDetermineSemanticDataError } from "../../../../../../errors"; +import type { KipperStorageType } from "../../../../../const"; +import type { IdentifierTypeSpecifierExpression } from "../../type-specifier-expression"; +import type { ParseTree } from "antlr4ts/tree"; +import type { Expression } from "../../expression"; /** * Object literal constant, which represents an object that was defined in the source code. @@ -75,10 +82,15 @@ export class ObjectPrimaryExpression extends PrimaryExpression< * the children has already failed and as such no parent node should run type checking. */ public async primarySemanticAnalysis(): Promise { - const objectProperties = this.children; + const children: Array = this.getAntlrRuleChildren(); + if (!children) { + throw new UnableToDetermineSemanticDataError(); + } + + const keyValuePairs = this.children; this.semanticData = { - keyValuePairs: objectProperties + keyValuePairs: keyValuePairs, }; } @@ -91,9 +103,9 @@ export class ObjectPrimaryExpression extends PrimaryExpression< * @since 0.11.0 */ public async primarySemanticTypeChecking(): Promise { - throw this.programCtx - .semanticCheck(this) - .notImplementedError(new KipperNotImplementedError("Object Literals have not been implemented yet.")); + this.typeSemantics = { + evaluatedType: CustomType.fromObjectLiteral(this), + }; } /** 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 030d958bf..6aed0fa69 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,5 +1,5 @@ import type { PrimaryExpressionSemantics } from "../../primary-expression-semantics"; -import { Expression } from "../../../expression"; +import type { Expression } from "../../../expression"; import { StringPrimaryExpression } from "../../string-primary-expression"; /** @@ -7,6 +7,6 @@ import { StringPrimaryExpression } from "../../string-primary-expression"; * @since 0.11.0 */ export interface ObjectPropertySemantics extends PrimaryExpressionSemantics { - identifier: string - expressoDepresso: Expression + 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 e32b01c08..84f59e0cf 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 @@ -5,6 +5,8 @@ import { KindParseRuleMapping, ParseRuleKindMapping } from "../../../../../../le import { PrimaryExpression } from "../../primary-expression"; import type { CompilableASTNode } from "../../../../../compilable-ast-node"; import type { StringPrimaryExpression } from "../../string-primary-expression"; +import type { Expression } from "../../../expression"; +import { UnableToDetermineSemanticDataError } from "../../../../../../../errors"; /** * Object property, which represents a property inside an {@link ObjectPrimaryExpression object}. This is a key-value @@ -75,20 +77,24 @@ export class ObjectProperty extends PrimaryExpression { - let id; - let expression; + const antlrChildren = this.antlrRuleCtx.children; + if (!antlrChildren?.length) { + throw new UnableToDetermineSemanticDataError(); + } - if(this.children.length < 2) { - id = this.antlrRuleCtx.children![0].text; - expression = this.children[0]; + let id: string | StringPrimaryExpression; + let value: Expression; + if (this.children.length < 2) { + id = antlrChildren[0].text; + value = this.children[0]; } else { - id = ( this.children[0]).getSemanticData().value; - expression = this.children[1]; + id = (this.children[0]).getSemanticData().value; + value = this.children[1]; } this.semanticData = { identifier: id, - expressoDepresso: expression + expressoDepresso: value, }; } @@ -104,7 +110,11 @@ export class ObjectProperty extends PrimaryExpression => { - return []; + const semanticData = node.getSemanticData(); + const keyValuePairs = semanticData.keyValuePairs; + let keyValuePairsCodeString = await this.getStringifiedKeyValuePairs(keyValuePairs); + + return ["{", ...keyValuePairsCodeString, "}", ";"]; }; + protected async getStringifiedKeyValuePairs(keyValuePairs: Array): Promise { + let keyValuePairsCode: Array = []; + + for (let pair of keyValuePairs) { + let pairCode = await pair.translateCtxAndChildren(); + keyValuePairsCode.push(pairCode[0] + ",\n"); + } + + let code = keyValuePairsCode.join(""); + + if (code.endsWith(",\n")) { + code = code.slice(0, -2); + } + + return code; + } + /** * Translates a {@link ObjectProperty} into the JavaScript language. * @since 0.11.0 @@ -451,7 +472,11 @@ export class JavaScriptTargetCodeGenerator extends KipperTargetCodeGenerator { const expression = node.getSemanticData().expressoDepresso; const identifier = node.getSemanticData().identifier; - return [identifier, ":", ...(await expression.translateCtxAndChildren())]; + // Await the translation and join the array into a string + const translatedExpression = (await expression.translateCtxAndChildren()).join(""); + + // Return the concatenated result + return [` ${identifier}: ${translatedExpression}`]; }; /** diff --git a/kipper/target-ts/src/code-generator.ts b/kipper/target-ts/src/code-generator.ts index d2066b7a0..512f0642a 100644 --- a/kipper/target-ts/src/code-generator.ts +++ b/kipper/target-ts/src/code-generator.ts @@ -6,14 +6,16 @@ import type { FunctionDeclaration, InterfaceDeclaration, InterfacePropertyDeclaration, + ObjectPrimaryExpression, ParameterDeclaration, TranslatedCodeLine, VariableDeclaration, + InterfaceMethodDeclaration, + TranslatedExpression, } 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. @@ -127,4 +129,13 @@ export class TypeScriptTargetCodeGenerator extends JavaScriptTargetCodeGenerator // Return the parameter declaration return [[identifier, ":", " ", valueType]]; }; + + objectPrimaryExpression = async (node: ObjectPrimaryExpression): Promise => { + const semanticData = node.getSemanticData(); + const keyValuePairs = semanticData.keyValuePairs; + let keyValuePairsCodeString = await this.getStringifiedKeyValuePairs(keyValuePairs); + + // Return the object primary expression + return ["{\n", ...keyValuePairsCodeString, "\n}"]; + }; } diff --git a/test/module/core/core-functionality.test.ts b/test/module/core/core-functionality.test.ts index e342dad3c..8c62c5c61 100644 --- a/test/module/core/core-functionality.test.ts +++ b/test/module/core/core-functionality.test.ts @@ -1412,4 +1412,17 @@ describe("Core functionality", () => { ); }); }); + + describe("Object literals", () => { + it("should be able to create an Object literal", async () => { + const fileContent = "{ x: 1, y: '2' };"; + 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, "{\n x: 1,\n y: '2'\n};", "Invalid TypeScript code (Expected different output)"); + }); + + }); }); From 67d26324f322bacec1b24d1ec63a781990bced45 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Mon, 15 Jul 2024 15:25:54 +0200 Subject: [PATCH 37/57] minor (#499): Implemented indexing and slicing for arrays --- .../generic-type-specifier-expression.ts | 1 - .../semantics/analyser/type-checker.ts | 32 ++++++---------- .../semantics/types/base/compilable-type.ts | 4 +- kipper/core/src/errors.ts | 8 ++-- kipper/target-ts/src/built-in-generator.ts | 8 ++-- kipper/target-ts/src/code-generator.ts | 12 +++--- kipper/target-ts/src/target.ts | 38 ++++++++++++------- kipper/target-ts/src/tools.ts | 20 +++++----- 8 files changed, 64 insertions(+), 59 deletions(-) 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 2ccc76999..5345d4d1c 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 @@ -117,7 +117,6 @@ export class GenericTypeSpecifierExpression extends TypeSpecifierExpression< evaluatedType: BuiltInTypes.type, storedType: (valueType).changeGenericTypeArguments(genericArguments), }; - console.log(this.typeSemantics); } public checkForWarnings = undefined; // TODO! diff --git a/kipper/core/src/compiler/semantics/analyser/type-checker.ts b/kipper/core/src/compiler/semantics/analyser/type-checker.ts index 8bd305ddf..3de026ea3 100644 --- a/kipper/core/src/compiler/semantics/analyser/type-checker.ts +++ b/kipper/core/src/compiler/semantics/analyser/type-checker.ts @@ -64,7 +64,7 @@ import { UnknownTypeError, ValueNotIndexableTypeError, } from "../../../errors"; -import type { RawType, ProcessedType, GenericType, GenericTypeArguments } from "../types"; +import {RawType, ProcessedType, GenericType, GenericTypeArguments, BuiltInTypeArray} from "../types"; import { UndefinedType } from "../types"; import type { Reference } from "../reference"; @@ -677,32 +677,24 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { new KipperNotImplementedError("Member access expression using dot notation is not implemented yet"), ); case "bracket": { - if (objType === BuiltInTypes.str) { - // Also ensure the key is valid - this.validBracketNotationKey(semanticData.objectLike, semanticData.propertyIndexOrKeyOrSlice); + this.validBracketNotationKey(semanticData.objectLike, semanticData.propertyIndexOrKeyOrSlice); - return BuiltInTypes.str; + if (objType.isAssignableTo(BuiltInTypes.Array)) { + return (objType).genericTypeArguments[0].type; } else { - // Must be a list -> Not implemented yet - throw this.notImplementedError( - new KipperNotImplementedError("Member access expression on lists are not implemented yet"), - ); // TODO! Add support for lists + return BuiltInTypes.str; } } case "slice": { - if (objType === BuiltInTypes.str) { - // Also ensure the key is valid - this.validSliceNotationKey( - semanticData.objectLike, - <{ start?: Expression; end?: Expression }>semanticData.propertyIndexOrKeyOrSlice, - ); + this.validSliceNotationKey( + semanticData.objectLike, + <{ start?: Expression; end?: Expression }>semanticData.propertyIndexOrKeyOrSlice, + ); - return BuiltInTypes.str; + if (objType.isAssignableTo(BuiltInTypes.Array)) { + return objType; } else { - // Must be a list -> Not implemented yet - throw this.notImplementedError( - new KipperNotImplementedError("Member access expression on lists are not implemented yet"), - ); // TODO! Add support for lists + return BuiltInTypes.str; } } } diff --git a/kipper/core/src/compiler/semantics/types/base/compilable-type.ts b/kipper/core/src/compiler/semantics/types/base/compilable-type.ts index 29fcdf037..b181d28f4 100644 --- a/kipper/core/src/compiler/semantics/types/base/compilable-type.ts +++ b/kipper/core/src/compiler/semantics/types/base/compilable-type.ts @@ -1,8 +1,10 @@ +import { ProcessedType } from "./processed-type"; + /** * Represents a type that can be compiled i.e. a type that exists and type checks can be done on it. * @since 0.11.0 */ -export interface CompilableType { +export interface CompilableType extends ProcessedType { /** * The identifier of this type. * @since 0.11.0 diff --git a/kipper/core/src/errors.ts b/kipper/core/src/errors.ts index 051a2ca04..cfdde5c21 100644 --- a/kipper/core/src/errors.ts +++ b/kipper/core/src/errors.ts @@ -623,15 +623,15 @@ export class ArgumentAssignmentTypeError extends TypeError { */ export class AssignmentTypeError extends TypeError { constructor( - leftExpType: string, - rightExpType: string, + expectedType: string, + receivedType: string, cause?: TypeError, leftExpGenericTypes?: Array, rightExpGenericTypes?: Array, ) { super( - `Type '${AssignmentTypeError.formatGenericTypes(leftExpType, leftExpGenericTypes)}' is not assignable` + - `to type '${AssignmentTypeError.formatGenericTypes(rightExpType, rightExpGenericTypes)}'.`, + `Type '${AssignmentTypeError.formatGenericTypes(receivedType, leftExpGenericTypes)}' is not assignable` + + `to type '${AssignmentTypeError.formatGenericTypes(expectedType, rightExpGenericTypes)}'.`, cause, ); } diff --git a/kipper/target-ts/src/built-in-generator.ts b/kipper/target-ts/src/built-in-generator.ts index d5b3f8c57..778a5b409 100644 --- a/kipper/target-ts/src/built-in-generator.ts +++ b/kipper/target-ts/src/built-in-generator.ts @@ -3,7 +3,7 @@ * functions. * @since 0.8.0 */ -import type { BuiltInFunction, InternalFunction, TranslatedCodeLine } from "@kipper/core"; +import {BuiltInFunction, InternalFunction, ProcessedType, TranslatedCodeLine} from "@kipper/core"; import { JavaScriptTargetBuiltInGenerator } from "@kipper/target-js"; import { getTSFunctionSignature, createTSFunctionSignature } from "./tools"; import type { BuiltInVariable, KipperBuiltInTypeLiteral, KipperProgramContext } from "@kipper/core"; @@ -19,8 +19,8 @@ import { TargetTS } from "./target"; export function genTSFunction( signature: { identifier: string; - params: Array<{ identifier: string; type: string | Array }>; - returnType: string | Array; + params: Array<{ identifier: string; type: ProcessedType | Array }>; + returnType: ProcessedType | Array; }, body: string, ignoreParams: boolean = false, @@ -50,7 +50,7 @@ export function genTSVariable(varSpec: BuiltInVariable, value: string): Translat TargetTS.getBuiltInIdentifier(varSpec), ":", " ", - TargetTS.getTypeScriptType(varSpec.valueType.identifier), + TargetTS.getTypeScriptType(varSpec.valueType), " ", "=", " ", diff --git a/kipper/target-ts/src/code-generator.ts b/kipper/target-ts/src/code-generator.ts index 4520530b8..dcdf23359 100644 --- a/kipper/target-ts/src/code-generator.ts +++ b/kipper/target-ts/src/code-generator.ts @@ -39,10 +39,10 @@ export class TypeScriptTargetCodeGenerator extends JavaScriptTargetCodeGenerator */ override variableDeclaration = async (node: VariableDeclaration): Promise> => { const semanticData = node.getSemanticData(); - const typeData = node.getTypeSemanticData(); + const typeSemantics = node.getTypeSemanticData(); const storage = semanticData.storageType === "const" ? "const" : "let"; - const tsType = TargetTS.getTypeScriptType(typeData.valueType.identifier); + const tsType = TargetTS.getTypeScriptType(typeSemantics.valueType); const assign = semanticData.value ? await semanticData.value.translateCtxAndChildren() : []; // Only add ' = EXP' if assignValue is defined @@ -84,7 +84,7 @@ export class TypeScriptTargetCodeGenerator extends JavaScriptTargetCodeGenerator const semanticData = node.getSemanticData(); const params = semanticData.parameters; const returnTypeIdentifier = TargetTS.getTypeScriptType( - semanticData.returnType.getSemanticData().rawType.identifier, + semanticData.returnType.getTypeSemanticData().storedType, ); const paramsCode: TranslatedCodeLine[] = await Promise.all( @@ -112,8 +112,9 @@ export class TypeScriptTargetCodeGenerator extends JavaScriptTargetCodeGenerator node: InterfacePropertyDeclaration, ): Promise> => { const semanticData = node.getSemanticData(); + const typeSemantics = node.getTypeSemanticData(); const identifier = semanticData.identifier; - const valueType = TargetTS.getTypeScriptType(semanticData.type.identifier); + const valueType = TargetTS.getTypeScriptType(typeSemantics.type); // Return the property declaration return [[identifier, ":", " ", valueType, ";"]]; @@ -121,8 +122,9 @@ export class TypeScriptTargetCodeGenerator extends JavaScriptTargetCodeGenerator override parameterDeclaration = async (node: ParameterDeclaration): Promise> => { const semanticData = node.getSemanticData(); + const typeSemantics = node.getTypeSemanticData(); const identifier = semanticData.identifier; - const valueType = TargetTS.getTypeScriptType(semanticData.valueType.identifier); + const valueType = TargetTS.getTypeScriptType(typeSemantics.valueType); // Return the parameter declaration return [[identifier, ":", " ", valueType]]; diff --git a/kipper/target-ts/src/target.ts b/kipper/target-ts/src/target.ts index 2e41465f6..b8138def3 100644 --- a/kipper/target-ts/src/target.ts +++ b/kipper/target-ts/src/target.ts @@ -2,7 +2,14 @@ * The TypeScript translation target for the Kipper language. * @since 0.10.0 */ -import type { BuiltInFunction, BuiltInVariable, KipperBuiltInTypeLiteral } from "@kipper/core"; +import { + BuiltInFunction, BuiltInType, + BuiltInTypes, + BuiltInVariable, + CompilableType, + KipperBuiltInTypeLiteral, + ProcessedType +} from "@kipper/core"; import { kipperBoolTypeLiteral, KipperCompileTarget, @@ -63,31 +70,34 @@ export class KipperTypeScriptTarget extends KipperCompileTarget { * @param kipperType The type to get the equivalent for. * @since 0.8.0 */ - public static getTypeScriptType(kipperType: T | Array): string { + public static getTypeScriptType(kipperType: ProcessedType | Array): string { if (Array.isArray(kipperType)) { // Recursively call this function for each type in the array return `${kipperType.map(this.getTypeScriptType).join(" | ")}`; } - switch (kipperType) { - case kipperBoolTypeLiteral: + switch (kipperType.identifier) { + case BuiltInTypes.bool.identifier: return "boolean"; - case kipperFuncTypeLiteral: - return "Function"; - case kipperListTypeLiteral: - return "Array"; - case kipperMetaTypeLiteral: + case BuiltInTypes.type.identifier: return "object"; - case kipperNullTypeLiteral: + case BuiltInTypes.null.identifier: return "null"; - case kipperNumTypeLiteral: + case BuiltInTypes.num.identifier: return "number"; - case kipperStrTypeLiteral: + case BuiltInTypes.str.identifier: return "string"; - case kipperUndefinedTypeLiteral: + case BuiltInTypes.undefined.identifier: return "undefined"; - case kipperVoidTypeLiteral: + case BuiltInTypes.void.identifier: return "void"; + case BuiltInTypes.Func.identifier: + return "() => any"; + case BuiltInTypes.Array.identifier: + const memberType = this.getTypeScriptType( + (kipperType).genericTypeArguments[0].type + ); + return `Array<${memberType}>`; default: throw new KipperNotImplementedError(`TypeScript type for ${kipperType} not implemented.`); } diff --git a/kipper/target-ts/src/tools.ts b/kipper/target-ts/src/tools.ts index 0fcc89918..63f37d15f 100644 --- a/kipper/target-ts/src/tools.ts +++ b/kipper/target-ts/src/tools.ts @@ -2,13 +2,13 @@ * Tools for handling the translation of Kipper code to TypeScript. * @since 0.8.0 */ -import type { +import { FunctionDeclaration, BuiltInFunction, BuiltInFunctionArgument, KipperBuiltInTypeLiteral, InternalFunction, - InternalFunctionArgument, + InternalFunctionArgument, ProcessedType, } from "@kipper/core"; import { TargetTS } from "./target"; @@ -19,8 +19,8 @@ import { TargetTS } from "./target"; */ export function getTSFunctionSignature(funcSpec: InternalFunction | BuiltInFunction | FunctionDeclaration): { identifier: string; - params: Array<{ identifier: string; type: string | Array }>; - returnType: string | Array; + params: Array<{ identifier: string; type: ProcessedType | Array }>; + returnType: ProcessedType | Array; } { if ("antlrRuleCtx" in funcSpec) { const semanticData = funcSpec.getSemanticData(); @@ -31,10 +31,10 @@ export function getTSFunctionSignature(funcSpec: InternalFunction | BuiltInFunct params: semanticData.params.map((param) => { return { identifier: param.getSemanticData().identifier, - type: param.getTypeSemanticData().valueType.identifier, + type: param.getTypeSemanticData().valueType, }; }), - returnType: typeData.returnType.identifier, + returnType: typeData.returnType, }; } else { return { @@ -42,10 +42,10 @@ export function getTSFunctionSignature(funcSpec: InternalFunction | BuiltInFunct params: funcSpec.params.map((arg: BuiltInFunctionArgument | InternalFunctionArgument) => { return { identifier: arg.identifier, - type: Array.isArray(arg.valueType) ? arg.valueType.map((t) => t.identifier) : arg.valueType.identifier, + type: Array.isArray(arg.valueType) ? arg.valueType : arg.valueType, }; }), - returnType: funcSpec.returnType.identifier, + returnType: funcSpec.returnType, }; } } @@ -59,8 +59,8 @@ export function getTSFunctionSignature(funcSpec: InternalFunction | BuiltInFunct export function createTSFunctionSignature( signature: { identifier: string; - params: Array<{ identifier: string; type: string | Array }>; - returnType: string | Array; + params: Array<{ identifier: string; type: ProcessedType | Array }>; + returnType: ProcessedType | Array; }, ignoreParams: boolean = false, ): string { From 879734c44b6023a9cd50ec3519b5550654915a58 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Mon, 15 Jul 2024 15:26:29 +0200 Subject: [PATCH 38/57] other: Added tests for arrays This is still WIP as not all tests are implemented and we still need to check for the newly introduced errors --- test/module/core/core-functionality.test.ts | 401 +++++++++++++------- 1 file changed, 256 insertions(+), 145 deletions(-) diff --git a/test/module/core/core-functionality.test.ts b/test/module/core/core-functionality.test.ts index ca3c3c99d..0824c85bc 100644 --- a/test/module/core/core-functionality.test.ts +++ b/test/module/core/core-functionality.test.ts @@ -29,7 +29,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); assert.include(instance.write(), "let x: number = 5;", "Expected variable declaration to be present in output"); assert.include(instance.write(), '__kipper.print("");', "Expected print call to be present in output"); }); @@ -39,7 +39,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); assert.include(instance.write(), "let x: number = 5;", "Expected variable declaration to be present in output"); assert.include(instance.write(), '__kipper.print("");', "Expected print call to be present in output"); }); @@ -51,7 +51,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); assert(instance.write().includes("let x: number;"), "Invalid TypeScript code (Expected different output)"); }); }); @@ -62,7 +62,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); assert(instance.write().includes("let x: number = 4;"), "Invalid TypeScript code (Expected different output)"); }); @@ -71,7 +71,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); assert(instance.write().includes("const x: number = 4;"), "Invalid TypeScript code (Expected different output)"); }); }); @@ -82,7 +82,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); assert( instance.write().includes("let x: number = 4;\nx = 5;"), "Invalid TypeScript code (Expected different output)", @@ -94,7 +94,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); assert( instance.write().includes('let x: string = "4";\nx = "5";'), "Invalid TypeScript code (Expected different output)", @@ -108,7 +108,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); assert( instance.write().includes("__kipper.print = __kipper.print;"), "Invalid TypeScript code (Expected different output)", @@ -120,7 +120,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); assert(instance.write().includes("12 * 93;"), "Invalid TypeScript code (Expected different output)"); assert(instance.write().includes('"5" + "1";'), "Invalid TypeScript code (Expected different output)"); }); @@ -130,7 +130,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); assert(instance.write().includes('__kipper.print("x");'), "Invalid TypeScript code (Expected different output)"); assert(instance.write().includes('__kipper.print("y");'), "Invalid TypeScript code (Expected different output)"); assert(instance.write().includes('__kipper.print("z");'), "Invalid TypeScript code (Expected different output)"); @@ -143,7 +143,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); assert( instance.write().includes("let x: void = void(0);"), "Invalid TypeScript code (Expected different output)", @@ -159,7 +159,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); assert(instance.write().includes("let x: null = null;"), "Invalid TypeScript code (Expected different output)"); }); @@ -168,7 +168,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); assert( instance.write().includes("let x: undefined = undefined;"), "Invalid TypeScript code (Expected different output)", @@ -186,7 +186,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); assert(instance.write().includes("+4;"), "Invalid TypeScript code (Expected different output)"); }); @@ -195,7 +195,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); assert(instance.write().includes("-4;"), "Invalid TypeScript code (Expected different output)"); }); @@ -206,7 +206,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); assert(instance.write().includes("!true;"), "Invalid TypeScript code (Expected different output)"); }); @@ -216,7 +216,7 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); assert(instance.write().includes("let y: number = --x;"), "Expected different TypeScript code"); }); @@ -225,7 +225,7 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); assert(instance.write().includes("let y: number = x--;"), "Expected different TypeScript code"); }); }); @@ -236,7 +236,7 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); assert(instance.write().includes("let y: number = ++x;"), "Expected different TypeScript code"); }); @@ -245,7 +245,7 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); assert(instance.write().includes("let y: number = x++;"), "Expected different TypeScript code"); }); }); @@ -258,7 +258,7 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); const code = instance.write(); assert.include(code, "let x: number = 4;", "Invalid TypeScript code (Expected different output)"); @@ -270,7 +270,7 @@ describe("Core functionality", () => { const jsCode = ts.transpile(code); // Overwrite built-in to access output const prevLog = console.log; - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); console.log = (message: any) => { assert.equal(message, "Works", "Expected different output"); }; @@ -285,7 +285,7 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); const code = instance.write(); assert.include(code, "let x: number = 4;", "Invalid TypeScript code (Expected different output)"); @@ -303,7 +303,7 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); const code = instance.write(); assert.include(code, "let x: number = 4;", "Invalid TypeScript code (Expected different output)"); @@ -321,7 +321,7 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); const code = instance.write(); assert.include(code, "let x: number = 4;", "Invalid TypeScript code (Expected different output)"); @@ -341,7 +341,7 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); const code = instance.write(); assert.include(code, "let x: number = 4;", "Invalid TypeScript code (Expected different output)"); @@ -359,7 +359,7 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); const code = instance.write(); assert.include(code, "let x: number = 4;", "Invalid TypeScript code (Expected different output)"); @@ -377,7 +377,7 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); const code = instance.write(); assert.include(code, "let x: number = 4;", "Invalid TypeScript code (Expected different output)"); @@ -395,7 +395,7 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); const code = instance.write(); assert.include(code, "let x: number = 4;", "Invalid TypeScript code (Expected different output)"); @@ -416,7 +416,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include(code, "let x: number = 4;", "Invalid TypeScript code (Expected different output)"); @@ -435,7 +435,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include(code, "let x: number = 4;", "Invalid TypeScript code (Expected different output)"); @@ -453,7 +453,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include(code, "let x: number = 4;", "Invalid TypeScript code (Expected different output)"); @@ -471,7 +471,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include(code, "let x: number = 4;", "Invalid TypeScript code (Expected different output)"); @@ -489,7 +489,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include(code, "let x: number = 5;", "Invalid TypeScript code (Expected different output)"); @@ -507,7 +507,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include(code, "let x: number = 5;", "Invalid TypeScript code (Expected different output)"); @@ -527,7 +527,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -542,7 +542,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -557,7 +557,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -575,7 +575,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include(code, "const x: number = true ? 5 : 10", "Invalid TypeScript code (Expected different output)"); @@ -587,7 +587,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -603,7 +603,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -620,7 +620,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include(code, "while (x <= 5) {\n x += 1;\n}", "Invalid TypeScript code (Expected different output)"); @@ -634,7 +634,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include(code, "while (x <= 10) \n x += 1;", "Invalid TypeScript code (Expected different output)"); @@ -648,7 +648,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -666,7 +666,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -685,7 +685,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -705,7 +705,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -723,7 +723,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -741,7 +741,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -760,7 +760,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -779,7 +779,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -800,7 +800,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include(code, "do {\n x += 1;\n} while (x <= 5)", "Invalid TypeScript code (Expected different output)"); @@ -814,7 +814,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include(code, "do \n x += 1;\nwhile (x <= 10)", "Invalid TypeScript code (Expected different output)"); @@ -828,7 +828,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -846,7 +846,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -865,7 +865,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -888,8 +888,8 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); - assert(instance.programCtx!!.stream.stringContent === fileContent, "Expected matching streams"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); assert.include( instance.write(), 'let x: string = __kipper.index("1234", 1);', @@ -901,73 +901,134 @@ describe("Core functionality", () => { }); }); - describe("Slice notation", () => { - it("Simple slice with both start and end", async () => { - const fileContent = 'var x: str = "1234"[1:2]; print(x);'; - const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); + describe("Slice notation ", () => { + describe("str", () => { - assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); - assert(instance.programCtx!!.stream.stringContent === fileContent, "Expected matching streams"); - assert.include( - instance.write(), - 'let x: string = __kipper.slice("1234", 1, 2);', - "Expected different TypeScript code", - ); + it("Simple slice with both start and end", async () => { + const fileContent = 'var x: str = "1234"[1:2]; print(x);'; + const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); - const jsCode = ts.transpile(instance.write()); - testPrintOutput((message: any) => assert.equal(message, "2", "Expected different output"), jsCode); - }); + assert.isDefined(instance.programCtx); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); + assert.include( + instance.write(), + 'let x: string = __kipper.slice("1234", 1, 2);', + "Expected different TypeScript code", + ); - it("Simple slice with only start", async () => { - const fileContent = 'var x: str = "1234"[1:]; print(x);'; - const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); + const jsCode = ts.transpile(instance.write()); + testPrintOutput((message: any) => assert.equal(message, "2", "Expected different output"), jsCode); + }); - assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); - assert(instance.programCtx!!.stream.stringContent === fileContent, "Expected matching streams"); - assert.include( - instance.write(), - 'let x: string = __kipper.slice("1234", 1, undefined);', - "Expected different TypeScript code", - ); + it("Simple slice with only start", async () => { + const fileContent = 'var x: str = "1234"[1:]; print(x);'; + const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); - const jsCode = ts.transpile(instance.write()); - testPrintOutput((message: any) => assert.equal(message, "234", "Expected different output"), jsCode); - }); + assert.isDefined(instance.programCtx); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); + assert.include( + instance.write(), + 'let x: string = __kipper.slice("1234", 1, undefined);', + "Expected different TypeScript code", + ); - it("Simple slice with only end", async () => { - const fileContent = 'var x: str = "1234"[:2]; print(x);'; - const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); + const jsCode = ts.transpile(instance.write()); + testPrintOutput((message: any) => assert.equal(message, "234", "Expected different output"), jsCode); + }); - assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); - assert(instance.programCtx!!.stream.stringContent === fileContent, "Expected matching streams"); - assert.include( - instance.write(), - 'let x: string = __kipper.slice("1234", undefined, 2);', - "Expected different TypeScript code", - ); + it("Simple slice with only end", async () => { + const fileContent = 'var x: str = "1234"[:2]; print(x);'; + const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); - const jsCode = ts.transpile(instance.write()); - testPrintOutput((message: any) => assert.equal(message, "12", "Expected different output"), jsCode); + assert.isDefined(instance.programCtx); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); + assert.include( + instance.write(), + 'let x: string = __kipper.slice("1234", undefined, 2);', + "Expected different TypeScript code", + ); + + const jsCode = ts.transpile(instance.write()); + testPrintOutput((message: any) => assert.equal(message, "12", "Expected different output"), jsCode); + }); + + it("Simple slice with neither start nor end", async () => { + const fileContent = 'var x: str = "1234"[:]; print(x);'; + const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); + + assert.isDefined(instance.programCtx); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); + assert.include( + instance.write(), + 'let x: string = __kipper.slice("1234", undefined, undefined);', + "Expected different TypeScript code", + ); + + const jsCode = ts.transpile(instance.write()); + testPrintOutput((message: any) => assert.equal(message, "1234", "Expected different output"), jsCode); + }); }); - it("Simple slice with neither start nor end", async () => { - const fileContent = 'var x: str = "1234"[:]; print(x);'; - const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); + describe("array", () => { + it("Simple slice with both start and end", async () => { + const fileContent = 'var x: Array = [1, 2, 3, 4][1:2]; print(x[0] as str);'; + const instance: KipperCompileResult = await compiler.compile(fileContent, {target: defaultTarget}); - assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); - assert(instance.programCtx!!.stream.stringContent === fileContent, "Expected matching streams"); - assert.include( - instance.write(), - 'let x: string = __kipper.slice("1234", undefined, undefined);', - "Expected different TypeScript code", - ); + assert.isDefined(instance.programCtx); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); + assert.include( + instance.write(), + 'let x: Array = __kipper.slice([1, 2, 3, 4], 1, 2);', + "Expected different TypeScript code", + ); + }); - const jsCode = ts.transpile(instance.write()); - testPrintOutput((message: any) => assert.equal(message, "1234", "Expected different output"), jsCode); + it("Simple slice with only start", async () => { + const fileContent = 'var x: Array = [1, 2, 3, 4][1:]; print(x[0] as str);'; + const instance: KipperCompileResult = await compiler.compile(fileContent, {target: defaultTarget}); + + assert.isDefined(instance.programCtx); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); + assert.include( + instance.write(), + 'let x: Array = __kipper.slice([1, 2, 3, 4], 1, undefined);', + "Expected different TypeScript code", + ); + }); + + it("Simple slice with only end", async () => { + const fileContent = 'var x: Array = [1, 2, 3, 4][:2]; print(x[0] as str);'; + const instance: KipperCompileResult = await compiler.compile(fileContent, {target: defaultTarget}); + + assert.isDefined(instance.programCtx); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); + assert.include( + instance.write(), + 'let x: Array = __kipper.slice([1, 2, 3, 4], undefined, 2);', + "Expected different TypeScript code", + ); + }); + + it("Simple slice with neither start nor end", async () => { + const fileContent = 'var x: Array = [1, 2, 3, 4][:]; print(x[0] as str);'; + const instance: KipperCompileResult = await compiler.compile(fileContent, {target: defaultTarget}); + + assert.isDefined(instance.programCtx); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); + assert.include( + instance.write(), + 'let x: Array = __kipper.slice([1, 2, 3, 4], undefined, undefined);', + "Expected different TypeScript code", + ); + }); }); }); }); @@ -987,8 +1048,8 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); - assert(instance.programCtx!!.stream.stringContent === fileContent, "Expected matching streams"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); const jsCode = ts.transpile(instance.write()); testPrintOutput( @@ -1007,8 +1068,8 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); - assert(instance.programCtx!!.stream.stringContent === fileContent, "Expected matching streams"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); const jsCode = ts.transpile(instance.write()); testPrintOutput( @@ -1027,8 +1088,8 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); - assert(instance.programCtx!!.stream.stringContent === fileContent, "Expected matching streams"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); const jsCode = ts.transpile(instance.write()); testPrintOutput( @@ -1055,8 +1116,8 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); - assert(instance.programCtx!!.stream.stringContent === fileContent, "Expected matching streams"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); const jsCode = ts.transpile(instance.write()); testPrintOutput( @@ -1075,8 +1136,8 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); - assert(instance.programCtx!!.stream.stringContent === fileContent, "Expected matching streams"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); const jsCode = ts.transpile(instance.write()); testPrintOutput( @@ -1095,8 +1156,8 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); - assert(instance.programCtx!!.stream.stringContent === fileContent, "Expected matching streams"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); const jsCode = ts.transpile(instance.write()); testPrintOutput( @@ -1123,8 +1184,8 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); - assert(instance.programCtx!!.stream.stringContent === fileContent, "Expected matching streams"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); const jsCode = ts.transpile(instance.write()); testPrintOutput( @@ -1143,8 +1204,8 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); - assert(instance.programCtx!!.stream.stringContent === fileContent, "Expected matching streams"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); const jsCode = ts.transpile(instance.write()); testPrintOutput( @@ -1163,8 +1224,8 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); - assert(instance.programCtx!!.stream.stringContent === fileContent, "Expected matching streams"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); const jsCode = ts.transpile(instance.write()); testPrintOutput( @@ -1185,8 +1246,8 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); - assert(instance.programCtx!!.stream.stringContent === fileContent, "Expected matching streams"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); const jsCode = ts.transpile(instance.write()); testPrintOutput( @@ -1205,8 +1266,8 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); - assert(instance.programCtx!!.stream.stringContent === fileContent, "Expected matching streams"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); const jsCode = ts.transpile(instance.write()); testPrintOutput( @@ -1225,8 +1286,8 @@ describe("Core functionality", () => { const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); - assert(instance.programCtx!!.errors.length === 0, "Expected no compilation errors"); - assert(instance.programCtx!!.stream.stringContent === fileContent, "Expected matching streams"); + assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); + assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); const jsCode = ts.transpile(instance.write()); testPrintOutput( @@ -1242,6 +1303,56 @@ describe("Core functionality", () => { }); }); + describe("Arrays", () => { + it("Simple array declaration", async () => { + const fileContent = `var x: Array = [1, 2, 3];`; + const instance: KipperCompileResult = await compiler.compile(fileContent, {target: defaultTarget}); + + assert.isDefined(instance.programCtx); + assert.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); + + const code = instance.write(); + assert.include( + code, + "let x: Array = [1, 2, 3];", + "Invalid TypeScript code (Expected different output)", + ); + }); + + it("Assign array to array", async () => { + const code = "var x: Array\ = [1, 2, 3]; var y: Array\ = x;"; + const instance: KipperCompileResult = await compiler.compile(code, { target: defaultTarget }); + + assert.isDefined(instance.programCtx); + assert.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); + + const jsCode = instance.write(); + assert.include(jsCode, `let x: Array = [1, 2, 3];\nlet y: Array = x;`); + }); + + it("Accessing array element", async () => { + const code = "var x: Array\ = [1, 2, 3]; print(x[1] as str);"; + const instance: KipperCompileResult = await compiler.compile(code, { target: defaultTarget }); + + assert.isDefined(instance.programCtx); + assert.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); + + const jsCode = ts.transpile(instance.write()); + testPrintOutput((message: any) => assert.equal(message, "2", "Expected different output"), jsCode); + }); + + it("Assigning one array element to another", async () => { + const code = "var x: Array\ = [1, 2, 3]; var y: num = x[1]; print(y as str);"; + const instance: KipperCompileResult = await compiler.compile(code, { target: defaultTarget }); + + assert.isDefined(instance.programCtx); + assert.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); + + const jsCode = ts.transpile(instance.write()); + testPrintOutput((message: any) => assert.equal(message, "2", "Expected different output"), jsCode); + }); + }); + describe("Lambdas", () => { const compiler = new KipperCompiler(); @@ -1312,7 +1423,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include(code, "function test(): void {\n}", "Invalid TypeScript code (Expected different output)"); @@ -1323,7 +1434,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -1341,7 +1452,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -1359,7 +1470,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); assert.include( @@ -1379,17 +1490,17 @@ describe("Core functionality", () => { 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.deepEqual(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 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"); + assert.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); let written = instance.write(); assert.include( written, @@ -1403,7 +1514,7 @@ describe("Core functionality", () => { 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.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); let written = instance.write(); assert.include( written, From dd85c64fdfddb59064aeaa0f80e5704d7bcd1c2f Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Mon, 15 Jul 2024 17:28:20 +0200 Subject: [PATCH 39/57] other: Fixed failing tests due to ESLint error --- test/module/core/core-functionality.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/module/core/core-functionality.test.ts b/test/module/core/core-functionality.test.ts index 0824c85bc..49c0f54f2 100644 --- a/test/module/core/core-functionality.test.ts +++ b/test/module/core/core-functionality.test.ts @@ -1320,7 +1320,7 @@ describe("Core functionality", () => { }); it("Assign array to array", async () => { - const code = "var x: Array\ = [1, 2, 3]; var y: Array\ = x;"; + const code = "var x: Array = [1, 2, 3]; var y: Array = x;"; const instance: KipperCompileResult = await compiler.compile(code, { target: defaultTarget }); assert.isDefined(instance.programCtx); @@ -1331,7 +1331,7 @@ describe("Core functionality", () => { }); it("Accessing array element", async () => { - const code = "var x: Array\ = [1, 2, 3]; print(x[1] as str);"; + const code = "var x: Array = [1, 2, 3]; print(x[1] as str);"; const instance: KipperCompileResult = await compiler.compile(code, { target: defaultTarget }); assert.isDefined(instance.programCtx); @@ -1342,7 +1342,7 @@ describe("Core functionality", () => { }); it("Assigning one array element to another", async () => { - const code = "var x: Array\ = [1, 2, 3]; var y: num = x[1]; print(y as str);"; + const code = "var x: Array = [1, 2, 3]; var y: num = x[1]; print(y as str);"; const instance: KipperCompileResult = await compiler.compile(code, { target: defaultTarget }); assert.isDefined(instance.programCtx); From 0f9f10e3aed9416b816db76ec1ebaffef6a8dd32 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Mon, 15 Jul 2024 18:25:07 +0200 Subject: [PATCH 40/57] minor (#499): Fixed multiple bugs in the array logic --- .../array-primary-expression.ts | 2 +- .../semantics/analyser/type-checker.ts | 31 +++++----- .../semantics/types/base/compilable-type.ts | 2 +- .../types/base/generic-built-in-type.ts | 8 --- .../semantics/types/base/processed-type.ts | 10 ++++ .../src/compiler/semantics/types/base/type.ts | 8 +++ .../semantics/types/built-in/array.ts | 30 ++-------- .../src/compiler/semantics/types/raw-type.ts | 4 ++ kipper/core/src/errors.ts | 60 +++++-------------- kipper/core/src/tools/functions/indent.ts | 5 +- kipper/target-js/src/built-in-generator.ts | 2 +- kipper/target-js/src/code-generator.ts | 12 ++-- kipper/target-js/src/semantic-analyser.ts | 3 +- kipper/target-js/src/target.ts | 3 +- kipper/target-js/src/tools.ts | 2 +- kipper/target-ts/src/built-in-generator.ts | 12 +++- kipper/target-ts/src/code-generator.ts | 4 +- kipper/target-ts/src/target.ts | 32 +++------- kipper/target-ts/src/tools.ts | 8 +-- 19 files changed, 95 insertions(+), 143 deletions(-) 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 f0b9ce820..75f71ab17 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 @@ -99,7 +99,7 @@ export class ArrayPrimaryExpression extends PrimaryExpression< this.programCtx.typeCheck(this).validArrayExpression(this); const valueType = - this.children.length > 1 ? this.children[0].getTypeSemanticData().evaluatedType : BuiltInTypes.any; + this.children.length > 0 ? this.children[0].getTypeSemanticData().evaluatedType : BuiltInTypes.any; this.typeSemantics = { evaluatedType: new BuiltInTypeArray(valueType), valueType, diff --git a/kipper/core/src/compiler/semantics/analyser/type-checker.ts b/kipper/core/src/compiler/semantics/analyser/type-checker.ts index 3de026ea3..3f0e848a1 100644 --- a/kipper/core/src/compiler/semantics/analyser/type-checker.ts +++ b/kipper/core/src/compiler/semantics/analyser/type-checker.ts @@ -64,7 +64,8 @@ import { UnknownTypeError, ValueNotIndexableTypeError, } from "../../../errors"; -import {RawType, ProcessedType, GenericType, GenericTypeArguments, BuiltInTypeArray} from "../types"; +import type { RawType, ProcessedType, GenericType, BuiltInTypeArray } from "../types"; +import { GenericTypeArguments } from "../types"; import { UndefinedType } from "../types"; import type { Reference } from "../reference"; @@ -104,7 +105,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { */ public getCheckedType(rawType: RawType, scope: Scope): ProcessedType { try { - const type = this.getTypeFromIdentifier(rawType.identifier, scope); + const type = this.getTypeFromIdentifier(rawType.toString(), scope); return type.typeValue; } catch (e) { // If the error is not a KipperError, rethrow it (since it is not a rawType error, and we don't know what happened) @@ -118,7 +119,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { this.programCtx.reportError(e); // Recover from the error by wrapping the undefined rawType - return new UndefinedType(rawType.identifier); + return new UndefinedType(rawType.toString()); } // If error recovery is not enabled, we shouldn't bother trying to handle invalid types @@ -136,10 +137,10 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { */ public ensureValidGenericType(type: ProcessedType | GenericType, args: ProcessedType[]): void { if (!type.isGeneric || !("genericTypeArguments" in type)) { - throw this.assertError(new CanNotUseNonGenericAsGenericTypeError(type.identifier)); + throw this.assertError(new CanNotUseNonGenericAsGenericTypeError(type.toString())); } else if (type.genericTypeArguments.length !== args.length) { throw this.assertError( - new InvalidAmountOfGenericArgumentsError(type.identifier, type.genericTypeArguments.length, args.length), + new InvalidAmountOfGenericArgumentsError(type.toString(), type.genericTypeArguments.length, args.length), ); } } @@ -161,7 +162,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { // If the reference is not callable, throw an error if (!target.isCallable) { - throw this.assertError(new ExpressionNotCallableError(targetType.identifier)); + throw this.assertError(new ExpressionNotCallableError(targetType.toString())); } else if (ref instanceof ScopeParameterDeclaration || ref instanceof ScopeVariableDeclaration) { // Calling a function stored in a variable or parameter is not implemented yet throw this.notImplementedError( @@ -323,7 +324,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { // Ensure that both expressions are of type 'num' if (leftOpType !== BuiltInTypes.num || rightOpType !== BuiltInTypes.num) { - throw this.assertError(new InvalidRelationalComparisonTypeError(leftOpType.identifier, rightOpType.identifier)); + throw this.assertError(new InvalidRelationalComparisonTypeError(leftOpType.toString(), rightOpType.toString())); } } @@ -349,7 +350,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { // Ensure that the operator '+', '-', '++' and '--' are only used on numbers if (semanticData.operator !== "!" && expType !== BuiltInTypes.num) { - throw this.assertError(new InvalidUnaryExpressionTypeError(semanticData.operator, expType.identifier)); + throw this.assertError(new InvalidUnaryExpressionTypeError(semanticData.operator, expType.toString())); } // Ensure that the operand of an '++' and '--' modifier expression is a reference @@ -407,7 +408,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { } // If types are not matching, not numeric, and they are not of string-like types, throw an error - throw this.assertError(new ArithmeticOperationTypeError(leftOpType.identifier, rightOpType.identifier)); + throw this.assertError(new ArithmeticOperationTypeError(leftOpType.toString(), rightOpType.toString())); } } @@ -430,7 +431,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { // Ensure that both expressions are of type 'num' if (leftOpType !== BuiltInTypes.num || rightOpType !== BuiltInTypes.num) { - throw this.assertError(new BitwiseOperationTypeError(leftOpType.identifier, rightOpType.identifier)); + throw this.assertError(new BitwiseOperationTypeError(leftOpType.toString(), rightOpType.toString())); } } @@ -463,7 +464,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { ) !== undefined; if (!viableConversion) { throw this.assertError( - new InvalidConversionTypeError(originalCompileType.identifier, targetCompileType.identifier), + new InvalidConversionTypeError(originalCompileType.toString(), targetCompileType.toString()), ); } } @@ -601,7 +602,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { } if (!objType.isAssignableTo(BuiltInTypes.str) && !objType.isAssignableTo(BuiltInTypes.Array)) { - throw this.assertError(new ValueNotIndexableTypeError(objType.identifier)); + throw this.assertError(new ValueNotIndexableTypeError(objType.toString())); } } @@ -623,7 +624,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { // As currently only strings and lists are indexable, for now we only need to check for numeric indexes if (keyType !== BuiltInTypes.num) { - throw this.assertError(new InvalidKeyTypeError(objType.identifier, keyType.identifier)); + throw this.assertError(new InvalidKeyTypeError(objType.toString(), keyType.toString())); } } @@ -646,9 +647,9 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { // As currently only strings and lists are indexable, for now we only need to check for numeric indexes if (startType !== undefined && startType !== BuiltInTypes.num) { - throw this.assertError(new InvalidKeyTypeError(objType.identifier, startType.identifier), key.start); + throw this.assertError(new InvalidKeyTypeError(objType.toString(), startType.toString()), key.start); } else if (endType !== undefined && endType !== BuiltInTypes.num) { - throw this.assertError(new InvalidKeyTypeError(objType.identifier, endType.identifier), key.end); + throw this.assertError(new InvalidKeyTypeError(objType.toString(), endType.toString()), key.end); } } diff --git a/kipper/core/src/compiler/semantics/types/base/compilable-type.ts b/kipper/core/src/compiler/semantics/types/base/compilable-type.ts index b181d28f4..cd07362fa 100644 --- a/kipper/core/src/compiler/semantics/types/base/compilable-type.ts +++ b/kipper/core/src/compiler/semantics/types/base/compilable-type.ts @@ -1,4 +1,4 @@ -import { ProcessedType } from "./processed-type"; +import type { ProcessedType } from "./processed-type"; /** * Represents a type that can be compiled i.e. a type that exists and type checks can be done on it. diff --git a/kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts b/kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts index 76390aa24..9686ec522 100644 --- a/kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts +++ b/kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts @@ -20,14 +20,6 @@ export abstract class GenericBuiltInType extends BuiltInType implements GenericT this.genericTypeArguments = genericTypeArguments; } - /** - * Returns the identifiers of the generic type arguments. - * @since 0.12.0 - */ - public get genericTypeArgumentIdentifiers(): Array { - return Object.values(this.genericTypeArguments).map((arg) => arg.identifier); - } - /** * Returns whether the type is a generic type. * diff --git a/kipper/core/src/compiler/semantics/types/base/processed-type.ts b/kipper/core/src/compiler/semantics/types/base/processed-type.ts index 65957c90c..caef0c3af 100644 --- a/kipper/core/src/compiler/semantics/types/base/processed-type.ts +++ b/kipper/core/src/compiler/semantics/types/base/processed-type.ts @@ -1,6 +1,7 @@ import type { CompilableType } from "./compilable-type"; import { type TypeError, TypeNotCompilableError } from "../../../../errors"; import { Type } from "./type"; +import type { GenericType } from "./generic-type"; /** * A processed type that may be used for type checking and compilation. This type is the general type that will be used @@ -80,4 +81,13 @@ export abstract class ProcessedType extends Type { return false; } } + + public toString(): string { + let type = this.identifier; + if (this.isGeneric) { + type += + "<" + ((this)).genericTypeArguments?.map((arg) => arg.type.toString()).join(", ") + ">"; + } + return type; + } } diff --git a/kipper/core/src/compiler/semantics/types/base/type.ts b/kipper/core/src/compiler/semantics/types/base/type.ts index d2e44183f..9db3c8a54 100644 --- a/kipper/core/src/compiler/semantics/types/base/type.ts +++ b/kipper/core/src/compiler/semantics/types/base/type.ts @@ -19,4 +19,12 @@ export abstract class Type { public get identifier(): string { return this._identifier; } + + /** + * Returns the full string representation of this type. + * + * This also includes generic type arguments if this type is a generic type. + * @since 0.12.0 + */ + public abstract toString(): string; } diff --git a/kipper/core/src/compiler/semantics/types/built-in/array.ts b/kipper/core/src/compiler/semantics/types/built-in/array.ts index 62901b49e..f7c2dfa99 100644 --- a/kipper/core/src/compiler/semantics/types/built-in/array.ts +++ b/kipper/core/src/compiler/semantics/types/built-in/array.ts @@ -56,39 +56,19 @@ export class BuiltInTypeArray extends GenericBuiltInType { } catch (typeError) { e = new GenericArgumentTypeError( (type).genericTypeArguments[0].identifier, - (type).genericTypeArguments[0].type.identifier, - this.genericTypeArguments[0].type.identifier, + (type).genericTypeArguments[0].type.toString(), + this.genericTypeArguments[0].type.toString(), typeError, ); } } if (propertyName) { - throw new PropertyAssignmentTypeError( - propertyName, - type.identifier, - this.identifier, - e, - (type).genericTypeArgumentIdentifiers, - this.genericTypeArgumentIdentifiers, - ); + throw new PropertyAssignmentTypeError(propertyName, type.toString(), this.toString(), e); } else if (argumentName) { - throw new ArgumentAssignmentTypeError( - argumentName, - type.identifier, - this.identifier, - e, - (type).genericTypeArgumentIdentifiers, - this.genericTypeArgumentIdentifiers, - ); + throw new ArgumentAssignmentTypeError(argumentName, type.toString(), this.toString(), e); } else { - throw new AssignmentTypeError( - type.identifier, - this.identifier, - e, - (type).genericTypeArgumentIdentifiers, - this.genericTypeArgumentIdentifiers, - ); + throw new AssignmentTypeError(type.toString(), this.toString(), e); } } } diff --git a/kipper/core/src/compiler/semantics/types/raw-type.ts b/kipper/core/src/compiler/semantics/types/raw-type.ts index 6f46ac43e..4beb988b7 100644 --- a/kipper/core/src/compiler/semantics/types/raw-type.ts +++ b/kipper/core/src/compiler/semantics/types/raw-type.ts @@ -18,4 +18,8 @@ export class RawType extends Type { public get identifier(): string { return super.identifier; } + + public toString(): string { + return this.identifier; + } } diff --git a/kipper/core/src/errors.ts b/kipper/core/src/errors.ts index cfdde5c21..0c7065b41 100644 --- a/kipper/core/src/errors.ts +++ b/kipper/core/src/errors.ts @@ -54,7 +54,13 @@ export class KipperError extends Error { */ public tracebackData: TracebackMetadata; - constructor(msg: string) { + /** + * The cause of this error. This is used to chain errors together. + * @since 0.12.0 + */ + public cause?: KipperError; + + constructor(msg: string, cause?: KipperError) { super(msg); this.name = this.constructor.name === "KipperError" ? "Error" : this.constructor.name; this.tracebackData = { @@ -64,6 +70,7 @@ export class KipperError extends Error { streamSrc: undefined, errorNode: undefined, }; + this.cause = cause; } /** @@ -127,7 +134,7 @@ export class KipperError extends Error { `line ${this.tracebackData.location ? this.tracebackData.location.line : "'Unknown'"}, ` + `col ${this.tracebackData.location ? this.tracebackData.location.col : "'Unknown'"}:\n` + `${tokenSrc ? ` ${tokenSrc}\n` : ""}` + - `${this.name}: ${this.message}` + `${this.name}: ${this.message}`.replace(/\\n/g, `\n`) ); } @@ -560,7 +567,7 @@ export class ReservedIdentifierOverwriteError extends IdentifierError { */ export class TypeError extends KipperError { constructor(msg: string, cause?: TypeError) { - super(msg + (cause?.message ? `\n${addLeftIndent(cause.message)}` : "")); + super(`${msg}${cause?.message ? `\n${addLeftIndent(cause.message, "~> ")}` : ""}`, cause); this.name = "TypeError"; } } @@ -596,20 +603,9 @@ export class BitwiseOperationTypeError extends TypeError { * Error that is thrown whenever an argument is not assignable to the parameter's type. */ export class ArgumentAssignmentTypeError extends TypeError { - constructor( - paramIdentifier: string, - expectedType: string, - receivedType: string, - cause?: TypeError, - expectedGenericTypes?: Array, - receivedGenericTypes?: Array, - ) { + constructor(paramIdentifier: string, expectedType: string, receivedType: string, cause?: TypeError) { super( - `Type '${AssignmentTypeError.formatGenericTypes(receivedType, expectedGenericTypes)}' is not assignable` + - `to parameter '${paramIdentifier}' of type '${AssignmentTypeError.formatGenericTypes( - expectedType, - receivedGenericTypes, - )}'.`, + `Type '${receivedType}' is not assignable to parameter '${paramIdentifier}' of type '${expectedType}'.`, cause, ); } @@ -622,18 +618,8 @@ export class ArgumentAssignmentTypeError extends TypeError { * @since 0.8.3 */ export class AssignmentTypeError extends TypeError { - constructor( - expectedType: string, - receivedType: string, - cause?: TypeError, - leftExpGenericTypes?: Array, - rightExpGenericTypes?: Array, - ) { - super( - `Type '${AssignmentTypeError.formatGenericTypes(receivedType, leftExpGenericTypes)}' is not assignable` + - `to type '${AssignmentTypeError.formatGenericTypes(expectedType, rightExpGenericTypes)}'.`, - cause, - ); + constructor(expectedType: string, receivedType: string, cause?: TypeError) { + super(`Type '${receivedType}' is not assignable to type '${expectedType}'.`, cause); } static formatGenericTypes(identifier: string, genericTypes?: Array): string { @@ -647,22 +633,8 @@ export class AssignmentTypeError extends TypeError { * @since 0.11.0 */ export class PropertyAssignmentTypeError extends TypeError { - constructor( - identifier: string, - propertyType: string, - valueType: string, - cause?: TypeError, - propertyGenericTypes?: Array, - valueGenericTypes?: Array, - ) { - super( - `Type '${AssignmentTypeError.formatGenericTypes(valueType, propertyGenericTypes)}' is not assignable to ` + - `property '${identifier}' of type '${AssignmentTypeError.formatGenericTypes( - propertyType, - valueGenericTypes, - )}'.`, - cause, - ); + constructor(identifier: string, propertyType: string, valueType: string, cause?: TypeError) { + super(`Type '${valueType}' is not assignable to property '${identifier}' of type '${propertyType}'.`, cause); } } diff --git a/kipper/core/src/tools/functions/indent.ts b/kipper/core/src/tools/functions/indent.ts index 7f94b394b..1544b084d 100644 --- a/kipper/core/src/tools/functions/indent.ts +++ b/kipper/core/src/tools/functions/indent.ts @@ -1,12 +1,13 @@ /** * Adds a left indentation to the message with the specified amount of spaces. * @param msg The message to indent. + * @param prefix The prefix to add to the message. * @param spaces The amount of spaces to indent the message with. * @since 0.11.0 */ -export function addLeftIndent(msg: string, spaces: number = 2): string { +export function addLeftIndent(msg: string, prefix: string = "", spaces: number = 2): string { return msg .split("\n") - .map((line: string): string => `${" ".repeat(spaces)}${line}`) + .map((line: string): string => `${" ".repeat(spaces)}${prefix}${line}`) .join("\n"); } diff --git a/kipper/target-js/src/built-in-generator.ts b/kipper/target-js/src/built-in-generator.ts index e189cf0c1..4e142905b 100644 --- a/kipper/target-js/src/built-in-generator.ts +++ b/kipper/target-js/src/built-in-generator.ts @@ -7,8 +7,8 @@ import type { BuiltInFunction, BuiltInVariable, InternalFunction, - TranslatedCodeLine, KipperProgramContext, + TranslatedCodeLine, } from "@kipper/core"; import { KipperTargetBuiltInGenerator } from "@kipper/core"; import { createJSFunctionSignature, getJSFunctionSignature } from "./tools"; diff --git a/kipper/target-js/src/code-generator.ts b/kipper/target-js/src/code-generator.ts index d3f3502ec..2b11fd93c 100644 --- a/kipper/target-js/src/code-generator.ts +++ b/kipper/target-js/src/code-generator.ts @@ -14,6 +14,7 @@ import type { BitwiseXorExpression, BoolPrimaryExpression, CastOrConvertExpression, + ClassDeclaration, ComparativeExpression, ComparativeExpressionSemantics, ConditionalExpression, @@ -29,6 +30,9 @@ import type { IdentifierTypeSpecifierExpression, IncrementOrDecrementPostfixExpression, IncrementOrDecrementUnaryExpression, + InterfaceDeclaration, + InterfaceMethodDeclaration, + InterfacePropertyDeclaration, JumpStatement, KipperProgramContext, LambdaPrimaryExpression, @@ -53,20 +57,16 @@ import type { TranslatedExpression, TypeofTypeSpecifierExpression, VoidOrNullOrUndefinedPrimaryExpression, - InterfacePropertyDeclaration, WhileLoopIterationStatement, - InterfaceDeclaration, - ClassDeclaration, - InterfaceMethodDeclaration, } from "@kipper/core"; import { + BuiltInTypes, CompoundStatement, + Expression, getConversionFunctionIdentifier, IfStatement, KipperTargetCodeGenerator, VariableDeclaration, - Expression, - BuiltInTypes, } from "@kipper/core"; import { createJSFunctionSignature, getJSFunctionSignature, indentLines, removeBraces } from "./tools"; import { TargetJS, version } from "./index"; diff --git a/kipper/target-js/src/semantic-analyser.ts b/kipper/target-js/src/semantic-analyser.ts index 39a866f87..bc184bf18 100644 --- a/kipper/target-js/src/semantic-analyser.ts +++ b/kipper/target-js/src/semantic-analyser.ts @@ -7,10 +7,9 @@ import type { Declaration, FunctionDeclaration, InterfaceDeclaration, + InterfacePropertyDeclaration, ParameterDeclaration, VariableDeclaration, - InterfacePropertyDeclaration, - TargetASTNodeSemanticAnalyser, } from "@kipper/core"; import { KipperTargetSemanticAnalyser, ReservedIdentifierOverwriteError } from "@kipper/core"; import { TargetJS } from "./target"; diff --git a/kipper/target-js/src/target.ts b/kipper/target-js/src/target.ts index 5bddeedb1..451b02e68 100644 --- a/kipper/target-js/src/target.ts +++ b/kipper/target-js/src/target.ts @@ -5,8 +5,7 @@ * @since 0.10.0 */ import type { BuiltInFunction, BuiltInType } from "@kipper/core"; -import { BuiltInVariable } from "@kipper/core"; -import { KipperCompileTarget } from "@kipper/core"; +import { BuiltInVariable, KipperCompileTarget } from "@kipper/core"; import { JavaScriptTargetSemanticAnalyser } from "./semantic-analyser"; import { JavaScriptTargetCodeGenerator } from "./code-generator"; import { JavaScriptTargetBuiltInGenerator } from "./built-in-generator"; diff --git a/kipper/target-js/src/tools.ts b/kipper/target-js/src/tools.ts index af7495a92..b1a5486e8 100644 --- a/kipper/target-js/src/tools.ts +++ b/kipper/target-js/src/tools.ts @@ -9,8 +9,8 @@ import type { FunctionDeclaration, InternalFunction, InternalFunctionArgument, + TranslatedCodeLine, } from "@kipper/core"; -import type { TranslatedCodeLine } from "@kipper/core"; /** * Generates the signature for the function based on the {@link funcSpec}, which can be used in an JavaScript env. diff --git a/kipper/target-ts/src/built-in-generator.ts b/kipper/target-ts/src/built-in-generator.ts index 778a5b409..bedceea0f 100644 --- a/kipper/target-ts/src/built-in-generator.ts +++ b/kipper/target-ts/src/built-in-generator.ts @@ -3,10 +3,16 @@ * functions. * @since 0.8.0 */ -import {BuiltInFunction, InternalFunction, ProcessedType, TranslatedCodeLine} from "@kipper/core"; +import type { + BuiltInFunction, + BuiltInVariable, + InternalFunction, + KipperProgramContext, + ProcessedType, + TranslatedCodeLine, +} from "@kipper/core"; import { JavaScriptTargetBuiltInGenerator } from "@kipper/target-js"; -import { getTSFunctionSignature, createTSFunctionSignature } from "./tools"; -import type { BuiltInVariable, KipperBuiltInTypeLiteral, KipperProgramContext } from "@kipper/core"; +import { createTSFunctionSignature, getTSFunctionSignature } from "./tools"; import { TargetTS } from "./target"; /** diff --git a/kipper/target-ts/src/code-generator.ts b/kipper/target-ts/src/code-generator.ts index dcdf23359..860a335e3 100644 --- a/kipper/target-ts/src/code-generator.ts +++ b/kipper/target-ts/src/code-generator.ts @@ -83,9 +83,7 @@ export class TypeScriptTargetCodeGenerator extends JavaScriptTargetCodeGenerator ): Promise> => { const semanticData = node.getSemanticData(); const params = semanticData.parameters; - const returnTypeIdentifier = TargetTS.getTypeScriptType( - semanticData.returnType.getTypeSemanticData().storedType, - ); + const returnTypeIdentifier = TargetTS.getTypeScriptType(semanticData.returnType.getTypeSemanticData().storedType); const paramsCode: TranslatedCodeLine[] = await Promise.all( params.map(async (param) => { diff --git a/kipper/target-ts/src/target.ts b/kipper/target-ts/src/target.ts index b8138def3..cf5e0e42c 100644 --- a/kipper/target-ts/src/target.ts +++ b/kipper/target-ts/src/target.ts @@ -2,27 +2,8 @@ * The TypeScript translation target for the Kipper language. * @since 0.10.0 */ -import { - BuiltInFunction, BuiltInType, - BuiltInTypes, - BuiltInVariable, - CompilableType, - KipperBuiltInTypeLiteral, - ProcessedType -} from "@kipper/core"; -import { - kipperBoolTypeLiteral, - KipperCompileTarget, - kipperFuncTypeLiteral, - kipperListTypeLiteral, - kipperMetaTypeLiteral, - KipperNotImplementedError, - kipperNullTypeLiteral, - kipperNumTypeLiteral, - kipperStrTypeLiteral, - kipperUndefinedTypeLiteral, - kipperVoidTypeLiteral, -} from "@kipper/core"; +import type { BuiltInFunction, BuiltInVariable, ProcessedType } from "@kipper/core"; +import { BuiltInTypes, KipperBuiltInTypeLiteral, KipperCompileTarget, KipperNotImplementedError } from "@kipper/core"; import { TypeScriptTargetSemanticAnalyser } from "./semantic-analyser"; import { TypeScriptTargetCodeGenerator } from "./code-generator"; import { TypeScriptTargetBuiltInGenerator } from "./built-in-generator"; @@ -93,11 +74,12 @@ export class KipperTypeScriptTarget extends KipperCompileTarget { return "void"; case BuiltInTypes.Func.identifier: return "() => any"; - case BuiltInTypes.Array.identifier: - const memberType = this.getTypeScriptType( - (kipperType).genericTypeArguments[0].type - ); + case BuiltInTypes.Array.identifier: { + const memberType = this.getTypeScriptType((kipperType).genericTypeArguments[0].type); return `Array<${memberType}>`; + } + case BuiltInTypes.any.identifier: + return "any"; default: throw new KipperNotImplementedError(`TypeScript type for ${kipperType} not implemented.`); } diff --git a/kipper/target-ts/src/tools.ts b/kipper/target-ts/src/tools.ts index 63f37d15f..fe02e57c1 100644 --- a/kipper/target-ts/src/tools.ts +++ b/kipper/target-ts/src/tools.ts @@ -2,13 +2,13 @@ * Tools for handling the translation of Kipper code to TypeScript. * @since 0.8.0 */ -import { - FunctionDeclaration, +import type { BuiltInFunction, BuiltInFunctionArgument, - KipperBuiltInTypeLiteral, + FunctionDeclaration, InternalFunction, - InternalFunctionArgument, ProcessedType, + InternalFunctionArgument, + ProcessedType, } from "@kipper/core"; import { TargetTS } from "./target"; From 600c6907e4726916b805e6461d43446bb8fd2dc8 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Mon, 15 Jul 2024 18:25:21 +0200 Subject: [PATCH 41/57] minor (#499): Added ability to specify multiple generic arguments --- kipper/core/KipperParser.g4 | 2 +- .../lexer-parser/antlr/KipperParser.interp | 2 +- .../lexer-parser/antlr/KipperParser.ts | 387 ++++++++++-------- 3 files changed, 223 insertions(+), 168 deletions(-) diff --git a/kipper/core/KipperParser.g4 b/kipper/core/KipperParser.g4 index 582cb42b1..4c972ce86 100644 --- a/kipper/core/KipperParser.g4 +++ b/kipper/core/KipperParser.g4 @@ -406,7 +406,7 @@ identifierTypeSpecifierExpression ; genericTypeSpecifierExpression - : typeSpecifierIdentifier '<' typeSpecifierExpression '>' + : typeSpecifierIdentifier '<' (typeSpecifierExpression (',' typeSpecifierExpression)*)? '>' ; typeofTypeSpecifierExpression diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.interp b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.interp index 4ca202f77..f3a51a707 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.interp +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.interp @@ -262,4 +262,4 @@ typeSpecifierIdentifier atn: -[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 88, 750, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 3, 2, 5, 2, 168, 10, 2, 3, 2, 3, 2, 3, 3, 6, 3, 173, 10, 3, 13, 3, 14, 3, 174, 3, 4, 3, 4, 3, 5, 6, 5, 180, 10, 5, 13, 5, 14, 5, 181, 3, 6, 3, 6, 3, 6, 5, 6, 187, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 195, 10, 7, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 207, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 219, 10, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 225, 10, 14, 3, 15, 3, 15, 3, 15, 7, 15, 230, 10, 15, 12, 15, 14, 15, 233, 11, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 243, 10, 17, 12, 17, 14, 17, 246, 11, 17, 3, 17, 3, 17, 3, 18, 3, 18, 5, 18, 252, 10, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 5, 20, 262, 10, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 280, 10, 22, 3, 23, 3, 23, 3, 23, 5, 23, 285, 10, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 5, 25, 296, 10, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 305, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 7, 27, 313, 10, 27, 12, 27, 14, 27, 316, 11, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 328, 10, 28, 3, 29, 3, 29, 3, 29, 5, 29, 333, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 339, 10, 30, 3, 30, 3, 30, 5, 30, 343, 10, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 349, 10, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 355, 10, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 5, 34, 379, 10, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 393, 10, 35, 3, 36, 3, 36, 5, 36, 397, 10, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 405, 10, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 5, 41, 419, 10, 41, 3, 42, 3, 42, 3, 43, 3, 43, 7, 43, 425, 10, 43, 12, 43, 14, 43, 428, 11, 43, 3, 43, 3, 43, 3, 43, 7, 43, 433, 10, 43, 12, 43, 14, 43, 436, 11, 43, 3, 43, 5, 43, 439, 10, 43, 3, 44, 3, 44, 3, 44, 5, 44, 444, 10, 44, 3, 44, 5, 44, 447, 10, 44, 3, 45, 3, 45, 3, 45, 5, 45, 452, 10, 45, 3, 45, 5, 45, 455, 10, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 7, 47, 463, 10, 47, 12, 47, 14, 47, 466, 11, 47, 5, 47, 468, 10, 47, 3, 47, 5, 47, 471, 10, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 7, 48, 479, 10, 48, 12, 48, 14, 48, 482, 11, 48, 5, 48, 484, 10, 48, 3, 48, 5, 48, 487, 10, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 503, 10, 51, 3, 51, 3, 51, 3, 51, 5, 51, 508, 10, 51, 3, 51, 3, 51, 3, 51, 5, 51, 513, 10, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 7, 51, 529, 10, 51, 12, 51, 14, 51, 532, 11, 51, 3, 52, 3, 52, 3, 52, 7, 52, 537, 10, 52, 12, 52, 14, 52, 540, 11, 52, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 553, 10, 55, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 559, 10, 55, 3, 55, 3, 55, 3, 56, 3, 56, 5, 56, 565, 10, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 5, 58, 573, 10, 58, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 5, 63, 590, 10, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 7, 64, 598, 10, 64, 12, 64, 14, 64, 601, 11, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 7, 65, 609, 10, 65, 12, 65, 14, 65, 612, 11, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 7, 66, 621, 10, 66, 12, 66, 14, 66, 624, 11, 66, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 7, 68, 634, 10, 68, 12, 68, 14, 68, 637, 11, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 7, 69, 645, 10, 69, 12, 69, 14, 69, 648, 11, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 7, 70, 656, 10, 70, 12, 70, 14, 70, 659, 11, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 7, 71, 667, 10, 71, 12, 71, 14, 71, 670, 11, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 7, 72, 678, 10, 72, 12, 72, 14, 72, 681, 11, 72, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 7, 73, 689, 10, 73, 12, 73, 14, 73, 692, 11, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 7, 74, 700, 10, 74, 12, 74, 14, 74, 703, 11, 74, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 5, 75, 712, 10, 75, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 5, 76, 719, 10, 76, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 7, 78, 726, 10, 78, 12, 78, 14, 78, 729, 11, 78, 3, 79, 3, 79, 3, 79, 5, 79, 734, 10, 79, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 2, 2, 13, 100, 126, 128, 130, 134, 136, 138, 140, 142, 144, 146, 84, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 70, 2, 72, 2, 74, 2, 76, 2, 78, 2, 80, 2, 82, 2, 84, 2, 86, 2, 88, 2, 90, 2, 92, 2, 94, 2, 96, 2, 98, 2, 100, 2, 102, 2, 104, 2, 106, 2, 108, 2, 110, 2, 112, 2, 114, 2, 116, 2, 118, 2, 120, 2, 122, 2, 124, 2, 126, 2, 128, 2, 130, 2, 132, 2, 134, 2, 136, 2, 138, 2, 140, 2, 142, 2, 144, 2, 146, 2, 148, 2, 150, 2, 152, 2, 154, 2, 156, 2, 158, 2, 160, 2, 162, 2, 164, 2, 2, 17, 3, 2, 7, 8, 3, 2, 14, 15, 3, 2, 28, 29, 3, 2, 78, 79, 4, 2, 77, 77, 80, 80, 3, 2, 31, 33, 4, 2, 46, 46, 48, 48, 6, 2, 45, 45, 47, 47, 55, 55, 71, 71, 3, 2, 49, 52, 4, 2, 45, 45, 47, 47, 3, 2, 72, 74, 3, 2, 64, 67, 3, 2, 62, 63, 3, 2, 56, 61, 4, 2, 31, 33, 76, 76, 2, 753, 2, 167, 3, 2, 2, 2, 4, 172, 3, 2, 2, 2, 6, 176, 3, 2, 2, 2, 8, 179, 3, 2, 2, 2, 10, 186, 3, 2, 2, 2, 12, 194, 3, 2, 2, 2, 14, 196, 3, 2, 2, 2, 16, 199, 3, 2, 2, 2, 18, 201, 3, 2, 2, 2, 20, 208, 3, 2, 2, 2, 22, 210, 3, 2, 2, 2, 24, 212, 3, 2, 2, 2, 26, 214, 3, 2, 2, 2, 28, 226, 3, 2, 2, 2, 30, 234, 3, 2, 2, 2, 32, 238, 3, 2, 2, 2, 34, 251, 3, 2, 2, 2, 36, 253, 3, 2, 2, 2, 38, 258, 3, 2, 2, 2, 40, 268, 3, 2, 2, 2, 42, 279, 3, 2, 2, 2, 44, 281, 3, 2, 2, 2, 46, 288, 3, 2, 2, 2, 48, 295, 3, 2, 2, 2, 50, 297, 3, 2, 2, 2, 52, 306, 3, 2, 2, 2, 54, 327, 3, 2, 2, 2, 56, 332, 3, 2, 2, 2, 58, 334, 3, 2, 2, 2, 60, 359, 3, 2, 2, 2, 62, 365, 3, 2, 2, 2, 64, 373, 3, 2, 2, 2, 66, 376, 3, 2, 2, 2, 68, 392, 3, 2, 2, 2, 70, 394, 3, 2, 2, 2, 72, 406, 3, 2, 2, 2, 74, 410, 3, 2, 2, 2, 76, 412, 3, 2, 2, 2, 78, 414, 3, 2, 2, 2, 80, 418, 3, 2, 2, 2, 82, 420, 3, 2, 2, 2, 84, 438, 3, 2, 2, 2, 86, 446, 3, 2, 2, 2, 88, 454, 3, 2, 2, 2, 90, 456, 3, 2, 2, 2, 92, 458, 3, 2, 2, 2, 94, 474, 3, 2, 2, 2, 96, 490, 3, 2, 2, 2, 98, 494, 3, 2, 2, 2, 100, 507, 3, 2, 2, 2, 102, 533, 3, 2, 2, 2, 104, 541, 3, 2, 2, 2, 106, 544, 3, 2, 2, 2, 108, 548, 3, 2, 2, 2, 110, 564, 3, 2, 2, 2, 112, 566, 3, 2, 2, 2, 114, 572, 3, 2, 2, 2, 116, 574, 3, 2, 2, 2, 118, 577, 3, 2, 2, 2, 120, 580, 3, 2, 2, 2, 122, 582, 3, 2, 2, 2, 124, 589, 3, 2, 2, 2, 126, 591, 3, 2, 2, 2, 128, 602, 3, 2, 2, 2, 130, 613, 3, 2, 2, 2, 132, 625, 3, 2, 2, 2, 134, 627, 3, 2, 2, 2, 136, 638, 3, 2, 2, 2, 138, 649, 3, 2, 2, 2, 140, 660, 3, 2, 2, 2, 142, 671, 3, 2, 2, 2, 144, 682, 3, 2, 2, 2, 146, 693, 3, 2, 2, 2, 148, 711, 3, 2, 2, 2, 150, 718, 3, 2, 2, 2, 152, 720, 3, 2, 2, 2, 154, 722, 3, 2, 2, 2, 156, 733, 3, 2, 2, 2, 158, 735, 3, 2, 2, 2, 160, 737, 3, 2, 2, 2, 162, 742, 3, 2, 2, 2, 164, 747, 3, 2, 2, 2, 166, 168, 5, 4, 3, 2, 167, 166, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 170, 7, 2, 2, 3, 170, 3, 3, 2, 2, 2, 171, 173, 5, 6, 4, 2, 172, 171, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 174, 172, 3, 2, 2, 2, 174, 175, 3, 2, 2, 2, 175, 5, 3, 2, 2, 2, 176, 177, 5, 8, 5, 2, 177, 7, 3, 2, 2, 2, 178, 180, 5, 10, 6, 2, 179, 178, 3, 2, 2, 2, 180, 181, 3, 2, 2, 2, 181, 179, 3, 2, 2, 2, 181, 182, 3, 2, 2, 2, 182, 9, 3, 2, 2, 2, 183, 187, 5, 42, 22, 2, 184, 187, 5, 12, 7, 2, 185, 187, 7, 35, 2, 2, 186, 183, 3, 2, 2, 2, 186, 184, 3, 2, 2, 2, 186, 185, 3, 2, 2, 2, 187, 11, 3, 2, 2, 2, 188, 189, 5, 14, 8, 2, 189, 190, 7, 35, 2, 2, 190, 195, 3, 2, 2, 2, 191, 195, 5, 26, 14, 2, 192, 195, 5, 32, 17, 2, 193, 195, 5, 40, 21, 2, 194, 188, 3, 2, 2, 2, 194, 191, 3, 2, 2, 2, 194, 192, 3, 2, 2, 2, 194, 193, 3, 2, 2, 2, 195, 13, 3, 2, 2, 2, 196, 197, 5, 16, 9, 2, 197, 198, 5, 18, 10, 2, 198, 15, 3, 2, 2, 2, 199, 200, 9, 2, 2, 2, 200, 17, 3, 2, 2, 2, 201, 202, 5, 22, 12, 2, 202, 203, 7, 37, 2, 2, 203, 206, 5, 156, 79, 2, 204, 205, 7, 56, 2, 2, 205, 207, 5, 20, 11, 2, 206, 204, 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 19, 3, 2, 2, 2, 208, 209, 5, 150, 76, 2, 209, 21, 3, 2, 2, 2, 210, 211, 5, 24, 13, 2, 211, 23, 3, 2, 2, 2, 212, 213, 7, 76, 2, 2, 213, 25, 3, 2, 2, 2, 214, 215, 7, 22, 2, 2, 215, 216, 5, 22, 12, 2, 216, 218, 7, 38, 2, 2, 217, 219, 5, 28, 15, 2, 218, 217, 3, 2, 2, 2, 218, 219, 3, 2, 2, 2, 219, 220, 3, 2, 2, 2, 220, 221, 7, 39, 2, 2, 221, 222, 7, 25, 2, 2, 222, 224, 5, 156, 79, 2, 223, 225, 5, 44, 23, 2, 224, 223, 3, 2, 2, 2, 224, 225, 3, 2, 2, 2, 225, 27, 3, 2, 2, 2, 226, 231, 5, 30, 16, 2, 227, 228, 7, 34, 2, 2, 228, 230, 5, 30, 16, 2, 229, 227, 3, 2, 2, 2, 230, 233, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 29, 3, 2, 2, 2, 233, 231, 3, 2, 2, 2, 234, 235, 5, 22, 12, 2, 235, 236, 7, 37, 2, 2, 236, 237, 5, 156, 79, 2, 237, 31, 3, 2, 2, 2, 238, 239, 7, 27, 2, 2, 239, 240, 5, 22, 12, 2, 240, 244, 7, 43, 2, 2, 241, 243, 5, 34, 18, 2, 242, 241, 3, 2, 2, 2, 243, 246, 3, 2, 2, 2, 244, 242, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 247, 3, 2, 2, 2, 246, 244, 3, 2, 2, 2, 247, 248, 7, 44, 2, 2, 248, 33, 3, 2, 2, 2, 249, 252, 5, 36, 19, 2, 250, 252, 5, 38, 20, 2, 251, 249, 3, 2, 2, 2, 251, 250, 3, 2, 2, 2, 252, 35, 3, 2, 2, 2, 253, 254, 5, 22, 12, 2, 254, 255, 7, 37, 2, 2, 255, 256, 5, 156, 79, 2, 256, 257, 7, 35, 2, 2, 257, 37, 3, 2, 2, 2, 258, 259, 5, 22, 12, 2, 259, 261, 7, 38, 2, 2, 260, 262, 5, 28, 15, 2, 261, 260, 3, 2, 2, 2, 261, 262, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 264, 7, 39, 2, 2, 264, 265, 7, 37, 2, 2, 265, 266, 5, 156, 79, 2, 266, 267, 7, 35, 2, 2, 267, 39, 3, 2, 2, 2, 268, 269, 7, 26, 2, 2, 269, 270, 5, 22, 12, 2, 270, 271, 7, 43, 2, 2, 271, 272, 7, 44, 2, 2, 272, 41, 3, 2, 2, 2, 273, 280, 5, 46, 24, 2, 274, 280, 5, 48, 25, 2, 275, 280, 5, 56, 29, 2, 276, 280, 5, 64, 33, 2, 277, 280, 5, 66, 34, 2, 278, 280, 5, 44, 23, 2, 279, 273, 3, 2, 2, 2, 279, 274, 3, 2, 2, 2, 279, 275, 3, 2, 2, 2, 279, 276, 3, 2, 2, 2, 279, 277, 3, 2, 2, 2, 279, 278, 3, 2, 2, 2, 280, 43, 3, 2, 2, 2, 281, 282, 6, 23, 2, 2, 282, 284, 7, 43, 2, 2, 283, 285, 5, 8, 5, 2, 284, 283, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 287, 7, 44, 2, 2, 287, 45, 3, 2, 2, 2, 288, 289, 8, 24, 1, 2, 289, 290, 5, 154, 78, 2, 290, 291, 7, 35, 2, 2, 291, 292, 8, 24, 1, 2, 292, 47, 3, 2, 2, 2, 293, 296, 5, 50, 26, 2, 294, 296, 5, 52, 27, 2, 295, 293, 3, 2, 2, 2, 295, 294, 3, 2, 2, 2, 296, 49, 3, 2, 2, 2, 297, 298, 7, 18, 2, 2, 298, 299, 7, 38, 2, 2, 299, 300, 5, 154, 78, 2, 300, 301, 7, 39, 2, 2, 301, 304, 5, 42, 22, 2, 302, 303, 7, 19, 2, 2, 303, 305, 5, 42, 22, 2, 304, 302, 3, 2, 2, 2, 304, 305, 3, 2, 2, 2, 305, 51, 3, 2, 2, 2, 306, 307, 7, 11, 2, 2, 307, 308, 7, 38, 2, 2, 308, 309, 5, 154, 78, 2, 309, 310, 7, 39, 2, 2, 310, 314, 7, 43, 2, 2, 311, 313, 5, 54, 28, 2, 312, 311, 3, 2, 2, 2, 313, 316, 3, 2, 2, 2, 314, 312, 3, 2, 2, 2, 314, 315, 3, 2, 2, 2, 315, 317, 3, 2, 2, 2, 316, 314, 3, 2, 2, 2, 317, 318, 7, 44, 2, 2, 318, 53, 3, 2, 2, 2, 319, 320, 7, 12, 2, 2, 320, 321, 5, 154, 78, 2, 321, 322, 7, 37, 2, 2, 322, 323, 5, 42, 22, 2, 323, 328, 3, 2, 2, 2, 324, 325, 7, 13, 2, 2, 325, 326, 7, 37, 2, 2, 326, 328, 5, 42, 22, 2, 327, 319, 3, 2, 2, 2, 327, 324, 3, 2, 2, 2, 328, 55, 3, 2, 2, 2, 329, 333, 5, 58, 30, 2, 330, 333, 5, 60, 31, 2, 331, 333, 5, 62, 32, 2, 332, 329, 3, 2, 2, 2, 332, 330, 3, 2, 2, 2, 332, 331, 3, 2, 2, 2, 333, 57, 3, 2, 2, 2, 334, 335, 7, 20, 2, 2, 335, 342, 7, 38, 2, 2, 336, 339, 5, 14, 8, 2, 337, 339, 5, 154, 78, 2, 338, 336, 3, 2, 2, 2, 338, 337, 3, 2, 2, 2, 339, 340, 3, 2, 2, 2, 340, 341, 8, 30, 1, 2, 341, 343, 3, 2, 2, 2, 342, 338, 3, 2, 2, 2, 342, 343, 3, 2, 2, 2, 343, 344, 3, 2, 2, 2, 344, 348, 7, 35, 2, 2, 345, 346, 5, 154, 78, 2, 346, 347, 8, 30, 1, 2, 347, 349, 3, 2, 2, 2, 348, 345, 3, 2, 2, 2, 348, 349, 3, 2, 2, 2, 349, 350, 3, 2, 2, 2, 350, 354, 7, 35, 2, 2, 351, 352, 5, 154, 78, 2, 352, 353, 8, 30, 1, 2, 353, 355, 3, 2, 2, 2, 354, 351, 3, 2, 2, 2, 354, 355, 3, 2, 2, 2, 355, 356, 3, 2, 2, 2, 356, 357, 7, 39, 2, 2, 357, 358, 5, 42, 22, 2, 358, 59, 3, 2, 2, 2, 359, 360, 7, 17, 2, 2, 360, 361, 7, 38, 2, 2, 361, 362, 5, 154, 78, 2, 362, 363, 7, 39, 2, 2, 363, 364, 5, 42, 22, 2, 364, 61, 3, 2, 2, 2, 365, 366, 7, 16, 2, 2, 366, 367, 5, 42, 22, 2, 367, 368, 7, 17, 2, 2, 368, 369, 7, 38, 2, 2, 369, 370, 5, 154, 78, 2, 370, 371, 7, 39, 2, 2, 371, 372, 7, 35, 2, 2, 372, 63, 3, 2, 2, 2, 373, 374, 9, 3, 2, 2, 374, 375, 7, 35, 2, 2, 375, 65, 3, 2, 2, 2, 376, 378, 7, 23, 2, 2, 377, 379, 5, 154, 78, 2, 378, 377, 3, 2, 2, 2, 378, 379, 3, 2, 2, 2, 379, 380, 3, 2, 2, 2, 380, 381, 7, 35, 2, 2, 381, 67, 3, 2, 2, 2, 382, 393, 5, 72, 37, 2, 383, 393, 5, 70, 36, 2, 384, 393, 5, 92, 47, 2, 385, 393, 5, 94, 48, 2, 386, 393, 5, 74, 38, 2, 387, 393, 5, 76, 39, 2, 388, 393, 5, 82, 42, 2, 389, 393, 5, 84, 43, 2, 390, 393, 5, 90, 46, 2, 391, 393, 5, 98, 50, 2, 392, 382, 3, 2, 2, 2, 392, 383, 3, 2, 2, 2, 392, 384, 3, 2, 2, 2, 392, 385, 3, 2, 2, 2, 392, 386, 3, 2, 2, 2, 392, 387, 3, 2, 2, 2, 392, 388, 3, 2, 2, 2, 392, 389, 3, 2, 2, 2, 392, 390, 3, 2, 2, 2, 392, 391, 3, 2, 2, 2, 393, 69, 3, 2, 2, 2, 394, 396, 7, 38, 2, 2, 395, 397, 5, 28, 15, 2, 396, 395, 3, 2, 2, 2, 396, 397, 3, 2, 2, 2, 397, 398, 3, 2, 2, 2, 398, 399, 7, 39, 2, 2, 399, 400, 7, 37, 2, 2, 400, 401, 5, 156, 79, 2, 401, 404, 7, 25, 2, 2, 402, 405, 5, 154, 78, 2, 403, 405, 5, 44, 23, 2, 404, 402, 3, 2, 2, 2, 404, 403, 3, 2, 2, 2, 405, 71, 3, 2, 2, 2, 406, 407, 7, 38, 2, 2, 407, 408, 5, 154, 78, 2, 408, 409, 7, 39, 2, 2, 409, 73, 3, 2, 2, 2, 410, 411, 9, 4, 2, 2, 411, 75, 3, 2, 2, 2, 412, 413, 5, 78, 40, 2, 413, 77, 3, 2, 2, 2, 414, 415, 7, 76, 2, 2, 415, 79, 3, 2, 2, 2, 416, 419, 5, 78, 40, 2, 417, 419, 5, 82, 42, 2, 418, 416, 3, 2, 2, 2, 418, 417, 3, 2, 2, 2, 419, 81, 3, 2, 2, 2, 420, 421, 9, 5, 2, 2, 421, 83, 3, 2, 2, 2, 422, 426, 7, 83, 2, 2, 423, 425, 5, 86, 44, 2, 424, 423, 3, 2, 2, 2, 425, 428, 3, 2, 2, 2, 426, 424, 3, 2, 2, 2, 426, 427, 3, 2, 2, 2, 427, 429, 3, 2, 2, 2, 428, 426, 3, 2, 2, 2, 429, 439, 7, 85, 2, 2, 430, 434, 7, 84, 2, 2, 431, 433, 5, 88, 45, 2, 432, 431, 3, 2, 2, 2, 433, 436, 3, 2, 2, 2, 434, 432, 3, 2, 2, 2, 434, 435, 3, 2, 2, 2, 435, 437, 3, 2, 2, 2, 436, 434, 3, 2, 2, 2, 437, 439, 7, 87, 2, 2, 438, 422, 3, 2, 2, 2, 438, 430, 3, 2, 2, 2, 439, 85, 3, 2, 2, 2, 440, 447, 7, 86, 2, 2, 441, 443, 7, 3, 2, 2, 442, 444, 5, 154, 78, 2, 443, 442, 3, 2, 2, 2, 443, 444, 3, 2, 2, 2, 444, 445, 3, 2, 2, 2, 445, 447, 7, 42, 2, 2, 446, 440, 3, 2, 2, 2, 446, 441, 3, 2, 2, 2, 447, 87, 3, 2, 2, 2, 448, 455, 7, 88, 2, 2, 449, 451, 7, 3, 2, 2, 450, 452, 5, 154, 78, 2, 451, 450, 3, 2, 2, 2, 451, 452, 3, 2, 2, 2, 452, 453, 3, 2, 2, 2, 453, 455, 7, 42, 2, 2, 454, 448, 3, 2, 2, 2, 454, 449, 3, 2, 2, 2, 455, 89, 3, 2, 2, 2, 456, 457, 9, 6, 2, 2, 457, 91, 3, 2, 2, 2, 458, 467, 7, 40, 2, 2, 459, 464, 5, 154, 78, 2, 460, 461, 7, 34, 2, 2, 461, 463, 5, 154, 78, 2, 462, 460, 3, 2, 2, 2, 463, 466, 3, 2, 2, 2, 464, 462, 3, 2, 2, 2, 464, 465, 3, 2, 2, 2, 465, 468, 3, 2, 2, 2, 466, 464, 3, 2, 2, 2, 467, 459, 3, 2, 2, 2, 467, 468, 3, 2, 2, 2, 468, 470, 3, 2, 2, 2, 469, 471, 7, 34, 2, 2, 470, 469, 3, 2, 2, 2, 470, 471, 3, 2, 2, 2, 471, 472, 3, 2, 2, 2, 472, 473, 7, 41, 2, 2, 473, 93, 3, 2, 2, 2, 474, 483, 7, 43, 2, 2, 475, 480, 5, 96, 49, 2, 476, 477, 7, 34, 2, 2, 477, 479, 5, 96, 49, 2, 478, 476, 3, 2, 2, 2, 479, 482, 3, 2, 2, 2, 480, 478, 3, 2, 2, 2, 480, 481, 3, 2, 2, 2, 481, 484, 3, 2, 2, 2, 482, 480, 3, 2, 2, 2, 483, 475, 3, 2, 2, 2, 483, 484, 3, 2, 2, 2, 484, 486, 3, 2, 2, 2, 485, 487, 7, 34, 2, 2, 486, 485, 3, 2, 2, 2, 486, 487, 3, 2, 2, 2, 487, 488, 3, 2, 2, 2, 488, 489, 7, 44, 2, 2, 489, 95, 3, 2, 2, 2, 490, 491, 5, 80, 41, 2, 491, 492, 7, 37, 2, 2, 492, 493, 5, 154, 78, 2, 493, 97, 3, 2, 2, 2, 494, 495, 9, 7, 2, 2, 495, 99, 3, 2, 2, 2, 496, 497, 8, 51, 1, 2, 497, 508, 5, 68, 35, 2, 498, 499, 7, 24, 2, 2, 499, 500, 5, 100, 51, 2, 500, 502, 7, 38, 2, 2, 501, 503, 5, 102, 52, 2, 502, 501, 3, 2, 2, 2, 502, 503, 3, 2, 2, 2, 503, 504, 3, 2, 2, 2, 504, 505, 7, 39, 2, 2, 505, 506, 8, 51, 1, 2, 506, 508, 3, 2, 2, 2, 507, 496, 3, 2, 2, 2, 507, 498, 3, 2, 2, 2, 508, 530, 3, 2, 2, 2, 509, 510, 12, 7, 2, 2, 510, 512, 7, 38, 2, 2, 511, 513, 5, 102, 52, 2, 512, 511, 3, 2, 2, 2, 512, 513, 3, 2, 2, 2, 513, 514, 3, 2, 2, 2, 514, 515, 7, 39, 2, 2, 515, 529, 8, 51, 1, 2, 516, 517, 12, 5, 2, 2, 517, 518, 5, 104, 53, 2, 518, 519, 8, 51, 1, 2, 519, 529, 3, 2, 2, 2, 520, 521, 12, 4, 2, 2, 521, 522, 5, 106, 54, 2, 522, 523, 8, 51, 1, 2, 523, 529, 3, 2, 2, 2, 524, 525, 12, 3, 2, 2, 525, 526, 5, 108, 55, 2, 526, 527, 8, 51, 1, 2, 527, 529, 3, 2, 2, 2, 528, 509, 3, 2, 2, 2, 528, 516, 3, 2, 2, 2, 528, 520, 3, 2, 2, 2, 528, 524, 3, 2, 2, 2, 529, 532, 3, 2, 2, 2, 530, 528, 3, 2, 2, 2, 530, 531, 3, 2, 2, 2, 531, 101, 3, 2, 2, 2, 532, 530, 3, 2, 2, 2, 533, 538, 5, 150, 76, 2, 534, 535, 7, 34, 2, 2, 535, 537, 5, 150, 76, 2, 536, 534, 3, 2, 2, 2, 537, 540, 3, 2, 2, 2, 538, 536, 3, 2, 2, 2, 538, 539, 3, 2, 2, 2, 539, 103, 3, 2, 2, 2, 540, 538, 3, 2, 2, 2, 541, 542, 7, 75, 2, 2, 542, 543, 5, 78, 40, 2, 543, 105, 3, 2, 2, 2, 544, 545, 7, 40, 2, 2, 545, 546, 5, 154, 78, 2, 546, 547, 7, 41, 2, 2, 547, 107, 3, 2, 2, 2, 548, 552, 7, 40, 2, 2, 549, 550, 5, 154, 78, 2, 550, 551, 8, 55, 1, 2, 551, 553, 3, 2, 2, 2, 552, 549, 3, 2, 2, 2, 552, 553, 3, 2, 2, 2, 553, 554, 3, 2, 2, 2, 554, 558, 7, 37, 2, 2, 555, 556, 5, 154, 78, 2, 556, 557, 8, 55, 1, 2, 557, 559, 3, 2, 2, 2, 558, 555, 3, 2, 2, 2, 558, 559, 3, 2, 2, 2, 559, 560, 3, 2, 2, 2, 560, 561, 7, 41, 2, 2, 561, 109, 3, 2, 2, 2, 562, 565, 5, 100, 51, 2, 563, 565, 5, 112, 57, 2, 564, 562, 3, 2, 2, 2, 564, 563, 3, 2, 2, 2, 565, 111, 3, 2, 2, 2, 566, 567, 5, 100, 51, 2, 567, 568, 5, 120, 61, 2, 568, 113, 3, 2, 2, 2, 569, 573, 5, 110, 56, 2, 570, 573, 5, 116, 59, 2, 571, 573, 5, 118, 60, 2, 572, 569, 3, 2, 2, 2, 572, 570, 3, 2, 2, 2, 572, 571, 3, 2, 2, 2, 573, 115, 3, 2, 2, 2, 574, 575, 5, 120, 61, 2, 575, 576, 5, 110, 56, 2, 576, 117, 3, 2, 2, 2, 577, 578, 5, 122, 62, 2, 578, 579, 5, 110, 56, 2, 579, 119, 3, 2, 2, 2, 580, 581, 9, 8, 2, 2, 581, 121, 3, 2, 2, 2, 582, 583, 9, 9, 2, 2, 583, 123, 3, 2, 2, 2, 584, 590, 5, 114, 58, 2, 585, 586, 5, 114, 58, 2, 586, 587, 7, 9, 2, 2, 587, 588, 5, 156, 79, 2, 588, 590, 3, 2, 2, 2, 589, 584, 3, 2, 2, 2, 589, 585, 3, 2, 2, 2, 590, 125, 3, 2, 2, 2, 591, 592, 8, 64, 1, 2, 592, 593, 5, 124, 63, 2, 593, 599, 3, 2, 2, 2, 594, 595, 12, 3, 2, 2, 595, 596, 9, 10, 2, 2, 596, 598, 5, 124, 63, 2, 597, 594, 3, 2, 2, 2, 598, 601, 3, 2, 2, 2, 599, 597, 3, 2, 2, 2, 599, 600, 3, 2, 2, 2, 600, 127, 3, 2, 2, 2, 601, 599, 3, 2, 2, 2, 602, 603, 8, 65, 1, 2, 603, 604, 5, 126, 64, 2, 604, 610, 3, 2, 2, 2, 605, 606, 12, 3, 2, 2, 606, 607, 9, 11, 2, 2, 607, 609, 5, 126, 64, 2, 608, 605, 3, 2, 2, 2, 609, 612, 3, 2, 2, 2, 610, 608, 3, 2, 2, 2, 610, 611, 3, 2, 2, 2, 611, 129, 3, 2, 2, 2, 612, 610, 3, 2, 2, 2, 613, 614, 8, 66, 1, 2, 614, 615, 5, 128, 65, 2, 615, 622, 3, 2, 2, 2, 616, 617, 12, 3, 2, 2, 617, 618, 5, 132, 67, 2, 618, 619, 5, 138, 70, 2, 619, 621, 3, 2, 2, 2, 620, 616, 3, 2, 2, 2, 621, 624, 3, 2, 2, 2, 622, 620, 3, 2, 2, 2, 622, 623, 3, 2, 2, 2, 623, 131, 3, 2, 2, 2, 624, 622, 3, 2, 2, 2, 625, 626, 9, 12, 2, 2, 626, 133, 3, 2, 2, 2, 627, 628, 8, 68, 1, 2, 628, 629, 5, 130, 66, 2, 629, 635, 3, 2, 2, 2, 630, 631, 12, 3, 2, 2, 631, 632, 9, 13, 2, 2, 632, 634, 5, 130, 66, 2, 633, 630, 3, 2, 2, 2, 634, 637, 3, 2, 2, 2, 635, 633, 3, 2, 2, 2, 635, 636, 3, 2, 2, 2, 636, 135, 3, 2, 2, 2, 637, 635, 3, 2, 2, 2, 638, 639, 8, 69, 1, 2, 639, 640, 5, 134, 68, 2, 640, 646, 3, 2, 2, 2, 641, 642, 12, 3, 2, 2, 642, 643, 9, 14, 2, 2, 643, 645, 5, 134, 68, 2, 644, 641, 3, 2, 2, 2, 645, 648, 3, 2, 2, 2, 646, 644, 3, 2, 2, 2, 646, 647, 3, 2, 2, 2, 647, 137, 3, 2, 2, 2, 648, 646, 3, 2, 2, 2, 649, 650, 8, 70, 1, 2, 650, 651, 5, 136, 69, 2, 651, 657, 3, 2, 2, 2, 652, 653, 12, 3, 2, 2, 653, 654, 7, 68, 2, 2, 654, 656, 5, 136, 69, 2, 655, 652, 3, 2, 2, 2, 656, 659, 3, 2, 2, 2, 657, 655, 3, 2, 2, 2, 657, 658, 3, 2, 2, 2, 658, 139, 3, 2, 2, 2, 659, 657, 3, 2, 2, 2, 660, 661, 8, 71, 1, 2, 661, 662, 5, 138, 70, 2, 662, 668, 3, 2, 2, 2, 663, 664, 12, 3, 2, 2, 664, 665, 7, 70, 2, 2, 665, 667, 5, 138, 70, 2, 666, 663, 3, 2, 2, 2, 667, 670, 3, 2, 2, 2, 668, 666, 3, 2, 2, 2, 668, 669, 3, 2, 2, 2, 669, 141, 3, 2, 2, 2, 670, 668, 3, 2, 2, 2, 671, 672, 8, 72, 1, 2, 672, 673, 5, 140, 71, 2, 673, 679, 3, 2, 2, 2, 674, 675, 12, 3, 2, 2, 675, 676, 7, 69, 2, 2, 676, 678, 5, 140, 71, 2, 677, 674, 3, 2, 2, 2, 678, 681, 3, 2, 2, 2, 679, 677, 3, 2, 2, 2, 679, 680, 3, 2, 2, 2, 680, 143, 3, 2, 2, 2, 681, 679, 3, 2, 2, 2, 682, 683, 8, 73, 1, 2, 683, 684, 5, 142, 72, 2, 684, 690, 3, 2, 2, 2, 685, 686, 12, 3, 2, 2, 686, 687, 7, 53, 2, 2, 687, 689, 5, 142, 72, 2, 688, 685, 3, 2, 2, 2, 689, 692, 3, 2, 2, 2, 690, 688, 3, 2, 2, 2, 690, 691, 3, 2, 2, 2, 691, 145, 3, 2, 2, 2, 692, 690, 3, 2, 2, 2, 693, 694, 8, 74, 1, 2, 694, 695, 5, 144, 73, 2, 695, 701, 3, 2, 2, 2, 696, 697, 12, 3, 2, 2, 697, 698, 7, 54, 2, 2, 698, 700, 5, 144, 73, 2, 699, 696, 3, 2, 2, 2, 700, 703, 3, 2, 2, 2, 701, 699, 3, 2, 2, 2, 701, 702, 3, 2, 2, 2, 702, 147, 3, 2, 2, 2, 703, 701, 3, 2, 2, 2, 704, 712, 5, 146, 74, 2, 705, 706, 5, 146, 74, 2, 706, 707, 7, 36, 2, 2, 707, 708, 5, 148, 75, 2, 708, 709, 7, 37, 2, 2, 709, 710, 5, 148, 75, 2, 710, 712, 3, 2, 2, 2, 711, 704, 3, 2, 2, 2, 711, 705, 3, 2, 2, 2, 712, 149, 3, 2, 2, 2, 713, 719, 5, 148, 75, 2, 714, 715, 5, 100, 51, 2, 715, 716, 5, 152, 77, 2, 716, 717, 5, 150, 76, 2, 717, 719, 3, 2, 2, 2, 718, 713, 3, 2, 2, 2, 718, 714, 3, 2, 2, 2, 719, 151, 3, 2, 2, 2, 720, 721, 9, 15, 2, 2, 721, 153, 3, 2, 2, 2, 722, 727, 5, 150, 76, 2, 723, 724, 7, 34, 2, 2, 724, 726, 5, 150, 76, 2, 725, 723, 3, 2, 2, 2, 726, 729, 3, 2, 2, 2, 727, 725, 3, 2, 2, 2, 727, 728, 3, 2, 2, 2, 728, 155, 3, 2, 2, 2, 729, 727, 3, 2, 2, 2, 730, 734, 5, 158, 80, 2, 731, 734, 5, 160, 81, 2, 732, 734, 5, 162, 82, 2, 733, 730, 3, 2, 2, 2, 733, 731, 3, 2, 2, 2, 733, 732, 3, 2, 2, 2, 734, 157, 3, 2, 2, 2, 735, 736, 5, 164, 83, 2, 736, 159, 3, 2, 2, 2, 737, 738, 5, 164, 83, 2, 738, 739, 7, 64, 2, 2, 739, 740, 5, 156, 79, 2, 740, 741, 7, 66, 2, 2, 741, 161, 3, 2, 2, 2, 742, 743, 7, 30, 2, 2, 743, 744, 7, 38, 2, 2, 744, 745, 5, 164, 83, 2, 745, 746, 7, 39, 2, 2, 746, 163, 3, 2, 2, 2, 747, 748, 9, 16, 2, 2, 748, 165, 3, 2, 2, 2, 68, 167, 174, 181, 186, 194, 206, 218, 224, 231, 244, 251, 261, 279, 284, 295, 304, 314, 327, 332, 338, 342, 348, 354, 378, 392, 396, 404, 418, 426, 434, 438, 443, 446, 451, 454, 464, 467, 470, 480, 483, 486, 502, 507, 512, 528, 530, 538, 552, 558, 564, 572, 589, 599, 610, 622, 635, 646, 657, 668, 679, 690, 701, 711, 718, 727, 733] \ No newline at end of file +[3, 51485, 51898, 1421, 44986, 20307, 1543, 60043, 49729, 3, 88, 759, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 3, 2, 5, 2, 168, 10, 2, 3, 2, 3, 2, 3, 3, 6, 3, 173, 10, 3, 13, 3, 14, 3, 174, 3, 4, 3, 4, 3, 5, 6, 5, 180, 10, 5, 13, 5, 14, 5, 181, 3, 6, 3, 6, 3, 6, 5, 6, 187, 10, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 195, 10, 7, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 207, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 219, 10, 14, 3, 14, 3, 14, 3, 14, 3, 14, 5, 14, 225, 10, 14, 3, 15, 3, 15, 3, 15, 7, 15, 230, 10, 15, 12, 15, 14, 15, 233, 11, 15, 3, 16, 3, 16, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 243, 10, 17, 12, 17, 14, 17, 246, 11, 17, 3, 17, 3, 17, 3, 18, 3, 18, 5, 18, 252, 10, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 5, 20, 262, 10, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, 280, 10, 22, 3, 23, 3, 23, 3, 23, 5, 23, 285, 10, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 5, 25, 296, 10, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 305, 10, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 3, 27, 7, 27, 313, 10, 27, 12, 27, 14, 27, 316, 11, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 328, 10, 28, 3, 29, 3, 29, 3, 29, 5, 29, 333, 10, 29, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 339, 10, 30, 3, 30, 3, 30, 5, 30, 343, 10, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 349, 10, 30, 3, 30, 3, 30, 3, 30, 3, 30, 5, 30, 355, 10, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 5, 34, 379, 10, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 393, 10, 35, 3, 36, 3, 36, 5, 36, 397, 10, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 3, 36, 5, 36, 405, 10, 36, 3, 37, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 5, 41, 419, 10, 41, 3, 42, 3, 42, 3, 43, 3, 43, 7, 43, 425, 10, 43, 12, 43, 14, 43, 428, 11, 43, 3, 43, 3, 43, 3, 43, 7, 43, 433, 10, 43, 12, 43, 14, 43, 436, 11, 43, 3, 43, 5, 43, 439, 10, 43, 3, 44, 3, 44, 3, 44, 5, 44, 444, 10, 44, 3, 44, 5, 44, 447, 10, 44, 3, 45, 3, 45, 3, 45, 5, 45, 452, 10, 45, 3, 45, 5, 45, 455, 10, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 47, 7, 47, 463, 10, 47, 12, 47, 14, 47, 466, 11, 47, 5, 47, 468, 10, 47, 3, 47, 5, 47, 471, 10, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 7, 48, 479, 10, 48, 12, 48, 14, 48, 482, 11, 48, 5, 48, 484, 10, 48, 3, 48, 5, 48, 487, 10, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 5, 51, 503, 10, 51, 3, 51, 3, 51, 3, 51, 5, 51, 508, 10, 51, 3, 51, 3, 51, 3, 51, 5, 51, 513, 10, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 7, 51, 529, 10, 51, 12, 51, 14, 51, 532, 11, 51, 3, 52, 3, 52, 3, 52, 7, 52, 537, 10, 52, 12, 52, 14, 52, 540, 11, 52, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 553, 10, 55, 3, 55, 3, 55, 3, 55, 3, 55, 5, 55, 559, 10, 55, 3, 55, 3, 55, 3, 56, 3, 56, 5, 56, 565, 10, 56, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 58, 5, 58, 573, 10, 58, 3, 59, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 5, 63, 590, 10, 63, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 3, 64, 7, 64, 598, 10, 64, 12, 64, 14, 64, 601, 11, 64, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 3, 65, 7, 65, 609, 10, 65, 12, 65, 14, 65, 612, 11, 65, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 3, 66, 7, 66, 621, 10, 66, 12, 66, 14, 66, 624, 11, 66, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 3, 68, 7, 68, 634, 10, 68, 12, 68, 14, 68, 637, 11, 68, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 3, 69, 7, 69, 645, 10, 69, 12, 69, 14, 69, 648, 11, 69, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 3, 70, 7, 70, 656, 10, 70, 12, 70, 14, 70, 659, 11, 70, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 3, 71, 7, 71, 667, 10, 71, 12, 71, 14, 71, 670, 11, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 3, 72, 7, 72, 678, 10, 72, 12, 72, 14, 72, 681, 11, 72, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 7, 73, 689, 10, 73, 12, 73, 14, 73, 692, 11, 73, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 3, 74, 7, 74, 700, 10, 74, 12, 74, 14, 74, 703, 11, 74, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 3, 75, 5, 75, 712, 10, 75, 3, 76, 3, 76, 3, 76, 3, 76, 3, 76, 5, 76, 719, 10, 76, 3, 77, 3, 77, 3, 78, 3, 78, 3, 78, 7, 78, 726, 10, 78, 12, 78, 14, 78, 729, 11, 78, 3, 79, 3, 79, 3, 79, 5, 79, 734, 10, 79, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 7, 81, 743, 10, 81, 12, 81, 14, 81, 746, 11, 81, 5, 81, 748, 10, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 2, 2, 13, 100, 126, 128, 130, 134, 136, 138, 140, 142, 144, 146, 84, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 2, 58, 2, 60, 2, 62, 2, 64, 2, 66, 2, 68, 2, 70, 2, 72, 2, 74, 2, 76, 2, 78, 2, 80, 2, 82, 2, 84, 2, 86, 2, 88, 2, 90, 2, 92, 2, 94, 2, 96, 2, 98, 2, 100, 2, 102, 2, 104, 2, 106, 2, 108, 2, 110, 2, 112, 2, 114, 2, 116, 2, 118, 2, 120, 2, 122, 2, 124, 2, 126, 2, 128, 2, 130, 2, 132, 2, 134, 2, 136, 2, 138, 2, 140, 2, 142, 2, 144, 2, 146, 2, 148, 2, 150, 2, 152, 2, 154, 2, 156, 2, 158, 2, 160, 2, 162, 2, 164, 2, 2, 17, 3, 2, 7, 8, 3, 2, 14, 15, 3, 2, 28, 29, 3, 2, 78, 79, 4, 2, 77, 77, 80, 80, 3, 2, 31, 33, 4, 2, 46, 46, 48, 48, 6, 2, 45, 45, 47, 47, 55, 55, 71, 71, 3, 2, 49, 52, 4, 2, 45, 45, 47, 47, 3, 2, 72, 74, 3, 2, 64, 67, 3, 2, 62, 63, 3, 2, 56, 61, 4, 2, 31, 33, 76, 76, 2, 764, 2, 167, 3, 2, 2, 2, 4, 172, 3, 2, 2, 2, 6, 176, 3, 2, 2, 2, 8, 179, 3, 2, 2, 2, 10, 186, 3, 2, 2, 2, 12, 194, 3, 2, 2, 2, 14, 196, 3, 2, 2, 2, 16, 199, 3, 2, 2, 2, 18, 201, 3, 2, 2, 2, 20, 208, 3, 2, 2, 2, 22, 210, 3, 2, 2, 2, 24, 212, 3, 2, 2, 2, 26, 214, 3, 2, 2, 2, 28, 226, 3, 2, 2, 2, 30, 234, 3, 2, 2, 2, 32, 238, 3, 2, 2, 2, 34, 251, 3, 2, 2, 2, 36, 253, 3, 2, 2, 2, 38, 258, 3, 2, 2, 2, 40, 268, 3, 2, 2, 2, 42, 279, 3, 2, 2, 2, 44, 281, 3, 2, 2, 2, 46, 288, 3, 2, 2, 2, 48, 295, 3, 2, 2, 2, 50, 297, 3, 2, 2, 2, 52, 306, 3, 2, 2, 2, 54, 327, 3, 2, 2, 2, 56, 332, 3, 2, 2, 2, 58, 334, 3, 2, 2, 2, 60, 359, 3, 2, 2, 2, 62, 365, 3, 2, 2, 2, 64, 373, 3, 2, 2, 2, 66, 376, 3, 2, 2, 2, 68, 392, 3, 2, 2, 2, 70, 394, 3, 2, 2, 2, 72, 406, 3, 2, 2, 2, 74, 410, 3, 2, 2, 2, 76, 412, 3, 2, 2, 2, 78, 414, 3, 2, 2, 2, 80, 418, 3, 2, 2, 2, 82, 420, 3, 2, 2, 2, 84, 438, 3, 2, 2, 2, 86, 446, 3, 2, 2, 2, 88, 454, 3, 2, 2, 2, 90, 456, 3, 2, 2, 2, 92, 458, 3, 2, 2, 2, 94, 474, 3, 2, 2, 2, 96, 490, 3, 2, 2, 2, 98, 494, 3, 2, 2, 2, 100, 507, 3, 2, 2, 2, 102, 533, 3, 2, 2, 2, 104, 541, 3, 2, 2, 2, 106, 544, 3, 2, 2, 2, 108, 548, 3, 2, 2, 2, 110, 564, 3, 2, 2, 2, 112, 566, 3, 2, 2, 2, 114, 572, 3, 2, 2, 2, 116, 574, 3, 2, 2, 2, 118, 577, 3, 2, 2, 2, 120, 580, 3, 2, 2, 2, 122, 582, 3, 2, 2, 2, 124, 589, 3, 2, 2, 2, 126, 591, 3, 2, 2, 2, 128, 602, 3, 2, 2, 2, 130, 613, 3, 2, 2, 2, 132, 625, 3, 2, 2, 2, 134, 627, 3, 2, 2, 2, 136, 638, 3, 2, 2, 2, 138, 649, 3, 2, 2, 2, 140, 660, 3, 2, 2, 2, 142, 671, 3, 2, 2, 2, 144, 682, 3, 2, 2, 2, 146, 693, 3, 2, 2, 2, 148, 711, 3, 2, 2, 2, 150, 718, 3, 2, 2, 2, 152, 720, 3, 2, 2, 2, 154, 722, 3, 2, 2, 2, 156, 733, 3, 2, 2, 2, 158, 735, 3, 2, 2, 2, 160, 737, 3, 2, 2, 2, 162, 751, 3, 2, 2, 2, 164, 756, 3, 2, 2, 2, 166, 168, 5, 4, 3, 2, 167, 166, 3, 2, 2, 2, 167, 168, 3, 2, 2, 2, 168, 169, 3, 2, 2, 2, 169, 170, 7, 2, 2, 3, 170, 3, 3, 2, 2, 2, 171, 173, 5, 6, 4, 2, 172, 171, 3, 2, 2, 2, 173, 174, 3, 2, 2, 2, 174, 172, 3, 2, 2, 2, 174, 175, 3, 2, 2, 2, 175, 5, 3, 2, 2, 2, 176, 177, 5, 8, 5, 2, 177, 7, 3, 2, 2, 2, 178, 180, 5, 10, 6, 2, 179, 178, 3, 2, 2, 2, 180, 181, 3, 2, 2, 2, 181, 179, 3, 2, 2, 2, 181, 182, 3, 2, 2, 2, 182, 9, 3, 2, 2, 2, 183, 187, 5, 42, 22, 2, 184, 187, 5, 12, 7, 2, 185, 187, 7, 35, 2, 2, 186, 183, 3, 2, 2, 2, 186, 184, 3, 2, 2, 2, 186, 185, 3, 2, 2, 2, 187, 11, 3, 2, 2, 2, 188, 189, 5, 14, 8, 2, 189, 190, 7, 35, 2, 2, 190, 195, 3, 2, 2, 2, 191, 195, 5, 26, 14, 2, 192, 195, 5, 32, 17, 2, 193, 195, 5, 40, 21, 2, 194, 188, 3, 2, 2, 2, 194, 191, 3, 2, 2, 2, 194, 192, 3, 2, 2, 2, 194, 193, 3, 2, 2, 2, 195, 13, 3, 2, 2, 2, 196, 197, 5, 16, 9, 2, 197, 198, 5, 18, 10, 2, 198, 15, 3, 2, 2, 2, 199, 200, 9, 2, 2, 2, 200, 17, 3, 2, 2, 2, 201, 202, 5, 22, 12, 2, 202, 203, 7, 37, 2, 2, 203, 206, 5, 156, 79, 2, 204, 205, 7, 56, 2, 2, 205, 207, 5, 20, 11, 2, 206, 204, 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 19, 3, 2, 2, 2, 208, 209, 5, 150, 76, 2, 209, 21, 3, 2, 2, 2, 210, 211, 5, 24, 13, 2, 211, 23, 3, 2, 2, 2, 212, 213, 7, 76, 2, 2, 213, 25, 3, 2, 2, 2, 214, 215, 7, 22, 2, 2, 215, 216, 5, 22, 12, 2, 216, 218, 7, 38, 2, 2, 217, 219, 5, 28, 15, 2, 218, 217, 3, 2, 2, 2, 218, 219, 3, 2, 2, 2, 219, 220, 3, 2, 2, 2, 220, 221, 7, 39, 2, 2, 221, 222, 7, 25, 2, 2, 222, 224, 5, 156, 79, 2, 223, 225, 5, 44, 23, 2, 224, 223, 3, 2, 2, 2, 224, 225, 3, 2, 2, 2, 225, 27, 3, 2, 2, 2, 226, 231, 5, 30, 16, 2, 227, 228, 7, 34, 2, 2, 228, 230, 5, 30, 16, 2, 229, 227, 3, 2, 2, 2, 230, 233, 3, 2, 2, 2, 231, 229, 3, 2, 2, 2, 231, 232, 3, 2, 2, 2, 232, 29, 3, 2, 2, 2, 233, 231, 3, 2, 2, 2, 234, 235, 5, 22, 12, 2, 235, 236, 7, 37, 2, 2, 236, 237, 5, 156, 79, 2, 237, 31, 3, 2, 2, 2, 238, 239, 7, 27, 2, 2, 239, 240, 5, 22, 12, 2, 240, 244, 7, 43, 2, 2, 241, 243, 5, 34, 18, 2, 242, 241, 3, 2, 2, 2, 243, 246, 3, 2, 2, 2, 244, 242, 3, 2, 2, 2, 244, 245, 3, 2, 2, 2, 245, 247, 3, 2, 2, 2, 246, 244, 3, 2, 2, 2, 247, 248, 7, 44, 2, 2, 248, 33, 3, 2, 2, 2, 249, 252, 5, 36, 19, 2, 250, 252, 5, 38, 20, 2, 251, 249, 3, 2, 2, 2, 251, 250, 3, 2, 2, 2, 252, 35, 3, 2, 2, 2, 253, 254, 5, 22, 12, 2, 254, 255, 7, 37, 2, 2, 255, 256, 5, 156, 79, 2, 256, 257, 7, 35, 2, 2, 257, 37, 3, 2, 2, 2, 258, 259, 5, 22, 12, 2, 259, 261, 7, 38, 2, 2, 260, 262, 5, 28, 15, 2, 261, 260, 3, 2, 2, 2, 261, 262, 3, 2, 2, 2, 262, 263, 3, 2, 2, 2, 263, 264, 7, 39, 2, 2, 264, 265, 7, 37, 2, 2, 265, 266, 5, 156, 79, 2, 266, 267, 7, 35, 2, 2, 267, 39, 3, 2, 2, 2, 268, 269, 7, 26, 2, 2, 269, 270, 5, 22, 12, 2, 270, 271, 7, 43, 2, 2, 271, 272, 7, 44, 2, 2, 272, 41, 3, 2, 2, 2, 273, 280, 5, 46, 24, 2, 274, 280, 5, 48, 25, 2, 275, 280, 5, 56, 29, 2, 276, 280, 5, 64, 33, 2, 277, 280, 5, 66, 34, 2, 278, 280, 5, 44, 23, 2, 279, 273, 3, 2, 2, 2, 279, 274, 3, 2, 2, 2, 279, 275, 3, 2, 2, 2, 279, 276, 3, 2, 2, 2, 279, 277, 3, 2, 2, 2, 279, 278, 3, 2, 2, 2, 280, 43, 3, 2, 2, 2, 281, 282, 6, 23, 2, 2, 282, 284, 7, 43, 2, 2, 283, 285, 5, 8, 5, 2, 284, 283, 3, 2, 2, 2, 284, 285, 3, 2, 2, 2, 285, 286, 3, 2, 2, 2, 286, 287, 7, 44, 2, 2, 287, 45, 3, 2, 2, 2, 288, 289, 8, 24, 1, 2, 289, 290, 5, 154, 78, 2, 290, 291, 7, 35, 2, 2, 291, 292, 8, 24, 1, 2, 292, 47, 3, 2, 2, 2, 293, 296, 5, 50, 26, 2, 294, 296, 5, 52, 27, 2, 295, 293, 3, 2, 2, 2, 295, 294, 3, 2, 2, 2, 296, 49, 3, 2, 2, 2, 297, 298, 7, 18, 2, 2, 298, 299, 7, 38, 2, 2, 299, 300, 5, 154, 78, 2, 300, 301, 7, 39, 2, 2, 301, 304, 5, 42, 22, 2, 302, 303, 7, 19, 2, 2, 303, 305, 5, 42, 22, 2, 304, 302, 3, 2, 2, 2, 304, 305, 3, 2, 2, 2, 305, 51, 3, 2, 2, 2, 306, 307, 7, 11, 2, 2, 307, 308, 7, 38, 2, 2, 308, 309, 5, 154, 78, 2, 309, 310, 7, 39, 2, 2, 310, 314, 7, 43, 2, 2, 311, 313, 5, 54, 28, 2, 312, 311, 3, 2, 2, 2, 313, 316, 3, 2, 2, 2, 314, 312, 3, 2, 2, 2, 314, 315, 3, 2, 2, 2, 315, 317, 3, 2, 2, 2, 316, 314, 3, 2, 2, 2, 317, 318, 7, 44, 2, 2, 318, 53, 3, 2, 2, 2, 319, 320, 7, 12, 2, 2, 320, 321, 5, 154, 78, 2, 321, 322, 7, 37, 2, 2, 322, 323, 5, 42, 22, 2, 323, 328, 3, 2, 2, 2, 324, 325, 7, 13, 2, 2, 325, 326, 7, 37, 2, 2, 326, 328, 5, 42, 22, 2, 327, 319, 3, 2, 2, 2, 327, 324, 3, 2, 2, 2, 328, 55, 3, 2, 2, 2, 329, 333, 5, 58, 30, 2, 330, 333, 5, 60, 31, 2, 331, 333, 5, 62, 32, 2, 332, 329, 3, 2, 2, 2, 332, 330, 3, 2, 2, 2, 332, 331, 3, 2, 2, 2, 333, 57, 3, 2, 2, 2, 334, 335, 7, 20, 2, 2, 335, 342, 7, 38, 2, 2, 336, 339, 5, 14, 8, 2, 337, 339, 5, 154, 78, 2, 338, 336, 3, 2, 2, 2, 338, 337, 3, 2, 2, 2, 339, 340, 3, 2, 2, 2, 340, 341, 8, 30, 1, 2, 341, 343, 3, 2, 2, 2, 342, 338, 3, 2, 2, 2, 342, 343, 3, 2, 2, 2, 343, 344, 3, 2, 2, 2, 344, 348, 7, 35, 2, 2, 345, 346, 5, 154, 78, 2, 346, 347, 8, 30, 1, 2, 347, 349, 3, 2, 2, 2, 348, 345, 3, 2, 2, 2, 348, 349, 3, 2, 2, 2, 349, 350, 3, 2, 2, 2, 350, 354, 7, 35, 2, 2, 351, 352, 5, 154, 78, 2, 352, 353, 8, 30, 1, 2, 353, 355, 3, 2, 2, 2, 354, 351, 3, 2, 2, 2, 354, 355, 3, 2, 2, 2, 355, 356, 3, 2, 2, 2, 356, 357, 7, 39, 2, 2, 357, 358, 5, 42, 22, 2, 358, 59, 3, 2, 2, 2, 359, 360, 7, 17, 2, 2, 360, 361, 7, 38, 2, 2, 361, 362, 5, 154, 78, 2, 362, 363, 7, 39, 2, 2, 363, 364, 5, 42, 22, 2, 364, 61, 3, 2, 2, 2, 365, 366, 7, 16, 2, 2, 366, 367, 5, 42, 22, 2, 367, 368, 7, 17, 2, 2, 368, 369, 7, 38, 2, 2, 369, 370, 5, 154, 78, 2, 370, 371, 7, 39, 2, 2, 371, 372, 7, 35, 2, 2, 372, 63, 3, 2, 2, 2, 373, 374, 9, 3, 2, 2, 374, 375, 7, 35, 2, 2, 375, 65, 3, 2, 2, 2, 376, 378, 7, 23, 2, 2, 377, 379, 5, 154, 78, 2, 378, 377, 3, 2, 2, 2, 378, 379, 3, 2, 2, 2, 379, 380, 3, 2, 2, 2, 380, 381, 7, 35, 2, 2, 381, 67, 3, 2, 2, 2, 382, 393, 5, 72, 37, 2, 383, 393, 5, 70, 36, 2, 384, 393, 5, 92, 47, 2, 385, 393, 5, 94, 48, 2, 386, 393, 5, 74, 38, 2, 387, 393, 5, 76, 39, 2, 388, 393, 5, 82, 42, 2, 389, 393, 5, 84, 43, 2, 390, 393, 5, 90, 46, 2, 391, 393, 5, 98, 50, 2, 392, 382, 3, 2, 2, 2, 392, 383, 3, 2, 2, 2, 392, 384, 3, 2, 2, 2, 392, 385, 3, 2, 2, 2, 392, 386, 3, 2, 2, 2, 392, 387, 3, 2, 2, 2, 392, 388, 3, 2, 2, 2, 392, 389, 3, 2, 2, 2, 392, 390, 3, 2, 2, 2, 392, 391, 3, 2, 2, 2, 393, 69, 3, 2, 2, 2, 394, 396, 7, 38, 2, 2, 395, 397, 5, 28, 15, 2, 396, 395, 3, 2, 2, 2, 396, 397, 3, 2, 2, 2, 397, 398, 3, 2, 2, 2, 398, 399, 7, 39, 2, 2, 399, 400, 7, 37, 2, 2, 400, 401, 5, 156, 79, 2, 401, 404, 7, 25, 2, 2, 402, 405, 5, 154, 78, 2, 403, 405, 5, 44, 23, 2, 404, 402, 3, 2, 2, 2, 404, 403, 3, 2, 2, 2, 405, 71, 3, 2, 2, 2, 406, 407, 7, 38, 2, 2, 407, 408, 5, 154, 78, 2, 408, 409, 7, 39, 2, 2, 409, 73, 3, 2, 2, 2, 410, 411, 9, 4, 2, 2, 411, 75, 3, 2, 2, 2, 412, 413, 5, 78, 40, 2, 413, 77, 3, 2, 2, 2, 414, 415, 7, 76, 2, 2, 415, 79, 3, 2, 2, 2, 416, 419, 5, 78, 40, 2, 417, 419, 5, 82, 42, 2, 418, 416, 3, 2, 2, 2, 418, 417, 3, 2, 2, 2, 419, 81, 3, 2, 2, 2, 420, 421, 9, 5, 2, 2, 421, 83, 3, 2, 2, 2, 422, 426, 7, 83, 2, 2, 423, 425, 5, 86, 44, 2, 424, 423, 3, 2, 2, 2, 425, 428, 3, 2, 2, 2, 426, 424, 3, 2, 2, 2, 426, 427, 3, 2, 2, 2, 427, 429, 3, 2, 2, 2, 428, 426, 3, 2, 2, 2, 429, 439, 7, 85, 2, 2, 430, 434, 7, 84, 2, 2, 431, 433, 5, 88, 45, 2, 432, 431, 3, 2, 2, 2, 433, 436, 3, 2, 2, 2, 434, 432, 3, 2, 2, 2, 434, 435, 3, 2, 2, 2, 435, 437, 3, 2, 2, 2, 436, 434, 3, 2, 2, 2, 437, 439, 7, 87, 2, 2, 438, 422, 3, 2, 2, 2, 438, 430, 3, 2, 2, 2, 439, 85, 3, 2, 2, 2, 440, 447, 7, 86, 2, 2, 441, 443, 7, 3, 2, 2, 442, 444, 5, 154, 78, 2, 443, 442, 3, 2, 2, 2, 443, 444, 3, 2, 2, 2, 444, 445, 3, 2, 2, 2, 445, 447, 7, 42, 2, 2, 446, 440, 3, 2, 2, 2, 446, 441, 3, 2, 2, 2, 447, 87, 3, 2, 2, 2, 448, 455, 7, 88, 2, 2, 449, 451, 7, 3, 2, 2, 450, 452, 5, 154, 78, 2, 451, 450, 3, 2, 2, 2, 451, 452, 3, 2, 2, 2, 452, 453, 3, 2, 2, 2, 453, 455, 7, 42, 2, 2, 454, 448, 3, 2, 2, 2, 454, 449, 3, 2, 2, 2, 455, 89, 3, 2, 2, 2, 456, 457, 9, 6, 2, 2, 457, 91, 3, 2, 2, 2, 458, 467, 7, 40, 2, 2, 459, 464, 5, 154, 78, 2, 460, 461, 7, 34, 2, 2, 461, 463, 5, 154, 78, 2, 462, 460, 3, 2, 2, 2, 463, 466, 3, 2, 2, 2, 464, 462, 3, 2, 2, 2, 464, 465, 3, 2, 2, 2, 465, 468, 3, 2, 2, 2, 466, 464, 3, 2, 2, 2, 467, 459, 3, 2, 2, 2, 467, 468, 3, 2, 2, 2, 468, 470, 3, 2, 2, 2, 469, 471, 7, 34, 2, 2, 470, 469, 3, 2, 2, 2, 470, 471, 3, 2, 2, 2, 471, 472, 3, 2, 2, 2, 472, 473, 7, 41, 2, 2, 473, 93, 3, 2, 2, 2, 474, 483, 7, 43, 2, 2, 475, 480, 5, 96, 49, 2, 476, 477, 7, 34, 2, 2, 477, 479, 5, 96, 49, 2, 478, 476, 3, 2, 2, 2, 479, 482, 3, 2, 2, 2, 480, 478, 3, 2, 2, 2, 480, 481, 3, 2, 2, 2, 481, 484, 3, 2, 2, 2, 482, 480, 3, 2, 2, 2, 483, 475, 3, 2, 2, 2, 483, 484, 3, 2, 2, 2, 484, 486, 3, 2, 2, 2, 485, 487, 7, 34, 2, 2, 486, 485, 3, 2, 2, 2, 486, 487, 3, 2, 2, 2, 487, 488, 3, 2, 2, 2, 488, 489, 7, 44, 2, 2, 489, 95, 3, 2, 2, 2, 490, 491, 5, 80, 41, 2, 491, 492, 7, 37, 2, 2, 492, 493, 5, 154, 78, 2, 493, 97, 3, 2, 2, 2, 494, 495, 9, 7, 2, 2, 495, 99, 3, 2, 2, 2, 496, 497, 8, 51, 1, 2, 497, 508, 5, 68, 35, 2, 498, 499, 7, 24, 2, 2, 499, 500, 5, 100, 51, 2, 500, 502, 7, 38, 2, 2, 501, 503, 5, 102, 52, 2, 502, 501, 3, 2, 2, 2, 502, 503, 3, 2, 2, 2, 503, 504, 3, 2, 2, 2, 504, 505, 7, 39, 2, 2, 505, 506, 8, 51, 1, 2, 506, 508, 3, 2, 2, 2, 507, 496, 3, 2, 2, 2, 507, 498, 3, 2, 2, 2, 508, 530, 3, 2, 2, 2, 509, 510, 12, 7, 2, 2, 510, 512, 7, 38, 2, 2, 511, 513, 5, 102, 52, 2, 512, 511, 3, 2, 2, 2, 512, 513, 3, 2, 2, 2, 513, 514, 3, 2, 2, 2, 514, 515, 7, 39, 2, 2, 515, 529, 8, 51, 1, 2, 516, 517, 12, 5, 2, 2, 517, 518, 5, 104, 53, 2, 518, 519, 8, 51, 1, 2, 519, 529, 3, 2, 2, 2, 520, 521, 12, 4, 2, 2, 521, 522, 5, 106, 54, 2, 522, 523, 8, 51, 1, 2, 523, 529, 3, 2, 2, 2, 524, 525, 12, 3, 2, 2, 525, 526, 5, 108, 55, 2, 526, 527, 8, 51, 1, 2, 527, 529, 3, 2, 2, 2, 528, 509, 3, 2, 2, 2, 528, 516, 3, 2, 2, 2, 528, 520, 3, 2, 2, 2, 528, 524, 3, 2, 2, 2, 529, 532, 3, 2, 2, 2, 530, 528, 3, 2, 2, 2, 530, 531, 3, 2, 2, 2, 531, 101, 3, 2, 2, 2, 532, 530, 3, 2, 2, 2, 533, 538, 5, 150, 76, 2, 534, 535, 7, 34, 2, 2, 535, 537, 5, 150, 76, 2, 536, 534, 3, 2, 2, 2, 537, 540, 3, 2, 2, 2, 538, 536, 3, 2, 2, 2, 538, 539, 3, 2, 2, 2, 539, 103, 3, 2, 2, 2, 540, 538, 3, 2, 2, 2, 541, 542, 7, 75, 2, 2, 542, 543, 5, 78, 40, 2, 543, 105, 3, 2, 2, 2, 544, 545, 7, 40, 2, 2, 545, 546, 5, 154, 78, 2, 546, 547, 7, 41, 2, 2, 547, 107, 3, 2, 2, 2, 548, 552, 7, 40, 2, 2, 549, 550, 5, 154, 78, 2, 550, 551, 8, 55, 1, 2, 551, 553, 3, 2, 2, 2, 552, 549, 3, 2, 2, 2, 552, 553, 3, 2, 2, 2, 553, 554, 3, 2, 2, 2, 554, 558, 7, 37, 2, 2, 555, 556, 5, 154, 78, 2, 556, 557, 8, 55, 1, 2, 557, 559, 3, 2, 2, 2, 558, 555, 3, 2, 2, 2, 558, 559, 3, 2, 2, 2, 559, 560, 3, 2, 2, 2, 560, 561, 7, 41, 2, 2, 561, 109, 3, 2, 2, 2, 562, 565, 5, 100, 51, 2, 563, 565, 5, 112, 57, 2, 564, 562, 3, 2, 2, 2, 564, 563, 3, 2, 2, 2, 565, 111, 3, 2, 2, 2, 566, 567, 5, 100, 51, 2, 567, 568, 5, 120, 61, 2, 568, 113, 3, 2, 2, 2, 569, 573, 5, 110, 56, 2, 570, 573, 5, 116, 59, 2, 571, 573, 5, 118, 60, 2, 572, 569, 3, 2, 2, 2, 572, 570, 3, 2, 2, 2, 572, 571, 3, 2, 2, 2, 573, 115, 3, 2, 2, 2, 574, 575, 5, 120, 61, 2, 575, 576, 5, 110, 56, 2, 576, 117, 3, 2, 2, 2, 577, 578, 5, 122, 62, 2, 578, 579, 5, 110, 56, 2, 579, 119, 3, 2, 2, 2, 580, 581, 9, 8, 2, 2, 581, 121, 3, 2, 2, 2, 582, 583, 9, 9, 2, 2, 583, 123, 3, 2, 2, 2, 584, 590, 5, 114, 58, 2, 585, 586, 5, 114, 58, 2, 586, 587, 7, 9, 2, 2, 587, 588, 5, 156, 79, 2, 588, 590, 3, 2, 2, 2, 589, 584, 3, 2, 2, 2, 589, 585, 3, 2, 2, 2, 590, 125, 3, 2, 2, 2, 591, 592, 8, 64, 1, 2, 592, 593, 5, 124, 63, 2, 593, 599, 3, 2, 2, 2, 594, 595, 12, 3, 2, 2, 595, 596, 9, 10, 2, 2, 596, 598, 5, 124, 63, 2, 597, 594, 3, 2, 2, 2, 598, 601, 3, 2, 2, 2, 599, 597, 3, 2, 2, 2, 599, 600, 3, 2, 2, 2, 600, 127, 3, 2, 2, 2, 601, 599, 3, 2, 2, 2, 602, 603, 8, 65, 1, 2, 603, 604, 5, 126, 64, 2, 604, 610, 3, 2, 2, 2, 605, 606, 12, 3, 2, 2, 606, 607, 9, 11, 2, 2, 607, 609, 5, 126, 64, 2, 608, 605, 3, 2, 2, 2, 609, 612, 3, 2, 2, 2, 610, 608, 3, 2, 2, 2, 610, 611, 3, 2, 2, 2, 611, 129, 3, 2, 2, 2, 612, 610, 3, 2, 2, 2, 613, 614, 8, 66, 1, 2, 614, 615, 5, 128, 65, 2, 615, 622, 3, 2, 2, 2, 616, 617, 12, 3, 2, 2, 617, 618, 5, 132, 67, 2, 618, 619, 5, 138, 70, 2, 619, 621, 3, 2, 2, 2, 620, 616, 3, 2, 2, 2, 621, 624, 3, 2, 2, 2, 622, 620, 3, 2, 2, 2, 622, 623, 3, 2, 2, 2, 623, 131, 3, 2, 2, 2, 624, 622, 3, 2, 2, 2, 625, 626, 9, 12, 2, 2, 626, 133, 3, 2, 2, 2, 627, 628, 8, 68, 1, 2, 628, 629, 5, 130, 66, 2, 629, 635, 3, 2, 2, 2, 630, 631, 12, 3, 2, 2, 631, 632, 9, 13, 2, 2, 632, 634, 5, 130, 66, 2, 633, 630, 3, 2, 2, 2, 634, 637, 3, 2, 2, 2, 635, 633, 3, 2, 2, 2, 635, 636, 3, 2, 2, 2, 636, 135, 3, 2, 2, 2, 637, 635, 3, 2, 2, 2, 638, 639, 8, 69, 1, 2, 639, 640, 5, 134, 68, 2, 640, 646, 3, 2, 2, 2, 641, 642, 12, 3, 2, 2, 642, 643, 9, 14, 2, 2, 643, 645, 5, 134, 68, 2, 644, 641, 3, 2, 2, 2, 645, 648, 3, 2, 2, 2, 646, 644, 3, 2, 2, 2, 646, 647, 3, 2, 2, 2, 647, 137, 3, 2, 2, 2, 648, 646, 3, 2, 2, 2, 649, 650, 8, 70, 1, 2, 650, 651, 5, 136, 69, 2, 651, 657, 3, 2, 2, 2, 652, 653, 12, 3, 2, 2, 653, 654, 7, 68, 2, 2, 654, 656, 5, 136, 69, 2, 655, 652, 3, 2, 2, 2, 656, 659, 3, 2, 2, 2, 657, 655, 3, 2, 2, 2, 657, 658, 3, 2, 2, 2, 658, 139, 3, 2, 2, 2, 659, 657, 3, 2, 2, 2, 660, 661, 8, 71, 1, 2, 661, 662, 5, 138, 70, 2, 662, 668, 3, 2, 2, 2, 663, 664, 12, 3, 2, 2, 664, 665, 7, 70, 2, 2, 665, 667, 5, 138, 70, 2, 666, 663, 3, 2, 2, 2, 667, 670, 3, 2, 2, 2, 668, 666, 3, 2, 2, 2, 668, 669, 3, 2, 2, 2, 669, 141, 3, 2, 2, 2, 670, 668, 3, 2, 2, 2, 671, 672, 8, 72, 1, 2, 672, 673, 5, 140, 71, 2, 673, 679, 3, 2, 2, 2, 674, 675, 12, 3, 2, 2, 675, 676, 7, 69, 2, 2, 676, 678, 5, 140, 71, 2, 677, 674, 3, 2, 2, 2, 678, 681, 3, 2, 2, 2, 679, 677, 3, 2, 2, 2, 679, 680, 3, 2, 2, 2, 680, 143, 3, 2, 2, 2, 681, 679, 3, 2, 2, 2, 682, 683, 8, 73, 1, 2, 683, 684, 5, 142, 72, 2, 684, 690, 3, 2, 2, 2, 685, 686, 12, 3, 2, 2, 686, 687, 7, 53, 2, 2, 687, 689, 5, 142, 72, 2, 688, 685, 3, 2, 2, 2, 689, 692, 3, 2, 2, 2, 690, 688, 3, 2, 2, 2, 690, 691, 3, 2, 2, 2, 691, 145, 3, 2, 2, 2, 692, 690, 3, 2, 2, 2, 693, 694, 8, 74, 1, 2, 694, 695, 5, 144, 73, 2, 695, 701, 3, 2, 2, 2, 696, 697, 12, 3, 2, 2, 697, 698, 7, 54, 2, 2, 698, 700, 5, 144, 73, 2, 699, 696, 3, 2, 2, 2, 700, 703, 3, 2, 2, 2, 701, 699, 3, 2, 2, 2, 701, 702, 3, 2, 2, 2, 702, 147, 3, 2, 2, 2, 703, 701, 3, 2, 2, 2, 704, 712, 5, 146, 74, 2, 705, 706, 5, 146, 74, 2, 706, 707, 7, 36, 2, 2, 707, 708, 5, 148, 75, 2, 708, 709, 7, 37, 2, 2, 709, 710, 5, 148, 75, 2, 710, 712, 3, 2, 2, 2, 711, 704, 3, 2, 2, 2, 711, 705, 3, 2, 2, 2, 712, 149, 3, 2, 2, 2, 713, 719, 5, 148, 75, 2, 714, 715, 5, 100, 51, 2, 715, 716, 5, 152, 77, 2, 716, 717, 5, 150, 76, 2, 717, 719, 3, 2, 2, 2, 718, 713, 3, 2, 2, 2, 718, 714, 3, 2, 2, 2, 719, 151, 3, 2, 2, 2, 720, 721, 9, 15, 2, 2, 721, 153, 3, 2, 2, 2, 722, 727, 5, 150, 76, 2, 723, 724, 7, 34, 2, 2, 724, 726, 5, 150, 76, 2, 725, 723, 3, 2, 2, 2, 726, 729, 3, 2, 2, 2, 727, 725, 3, 2, 2, 2, 727, 728, 3, 2, 2, 2, 728, 155, 3, 2, 2, 2, 729, 727, 3, 2, 2, 2, 730, 734, 5, 158, 80, 2, 731, 734, 5, 160, 81, 2, 732, 734, 5, 162, 82, 2, 733, 730, 3, 2, 2, 2, 733, 731, 3, 2, 2, 2, 733, 732, 3, 2, 2, 2, 734, 157, 3, 2, 2, 2, 735, 736, 5, 164, 83, 2, 736, 159, 3, 2, 2, 2, 737, 738, 5, 164, 83, 2, 738, 747, 7, 64, 2, 2, 739, 744, 5, 156, 79, 2, 740, 741, 7, 34, 2, 2, 741, 743, 5, 156, 79, 2, 742, 740, 3, 2, 2, 2, 743, 746, 3, 2, 2, 2, 744, 742, 3, 2, 2, 2, 744, 745, 3, 2, 2, 2, 745, 748, 3, 2, 2, 2, 746, 744, 3, 2, 2, 2, 747, 739, 3, 2, 2, 2, 747, 748, 3, 2, 2, 2, 748, 749, 3, 2, 2, 2, 749, 750, 7, 66, 2, 2, 750, 161, 3, 2, 2, 2, 751, 752, 7, 30, 2, 2, 752, 753, 7, 38, 2, 2, 753, 754, 5, 164, 83, 2, 754, 755, 7, 39, 2, 2, 755, 163, 3, 2, 2, 2, 756, 757, 9, 16, 2, 2, 757, 165, 3, 2, 2, 2, 70, 167, 174, 181, 186, 194, 206, 218, 224, 231, 244, 251, 261, 279, 284, 295, 304, 314, 327, 332, 338, 342, 348, 354, 378, 392, 396, 404, 418, 426, 434, 438, 443, 446, 451, 454, 464, 467, 470, 480, 483, 486, 502, 507, 512, 528, 530, 538, 552, 558, 564, 572, 589, 599, 610, 622, 635, 646, 657, 668, 679, 690, 701, 711, 718, 727, 733, 744, 747] \ No newline at end of file diff --git a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts index 864cea126..dfae0bc54 100644 --- a/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts +++ b/kipper/core/src/compiler/lexer-parser/antlr/KipperParser.ts @@ -4598,6 +4598,7 @@ export class KipperParser extends KipperParserBase { this.state, ); this.enterRule(_localctx, 158, KipperParser.RULE_genericTypeSpecifierExpression); + let _la: number; try { this.enterOuterAlt(_localctx, 1); { @@ -4605,9 +4606,42 @@ export class KipperParser extends KipperParserBase { this.typeSpecifierIdentifier(); this.state = 736; this.match(KipperParser.Less); - this.state = 737; - this.typeSpecifierExpression(); - this.state = 738; + this.state = 745; + this._errHandler.sync(this); + _la = this._input.LA(1); + if ( + ((_la & ~0x1f) === 0 && + ((1 << _la) & + ((1 << KipperParser.Typeof) | + (1 << KipperParser.Void) | + (1 << KipperParser.Null) | + (1 << KipperParser.Undefined))) !== + 0) || + _la === KipperParser.Identifier + ) { + { + this.state = 737; + this.typeSpecifierExpression(); + this.state = 742; + this._errHandler.sync(this); + _la = this._input.LA(1); + while (_la === KipperParser.Comma) { + { + { + this.state = 738; + this.match(KipperParser.Comma); + this.state = 739; + this.typeSpecifierExpression(); + } + } + this.state = 744; + this._errHandler.sync(this); + _la = this._input.LA(1); + } + } + } + + this.state = 747; this.match(KipperParser.Greater); } } catch (re) { @@ -4633,13 +4667,13 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 740; + this.state = 749; this.match(KipperParser.Typeof); - this.state = 741; + this.state = 750; this.match(KipperParser.LeftParen); - this.state = 742; + this.state = 751; this.typeSpecifierIdentifier(); - this.state = 743; + this.state = 752; this.match(KipperParser.RightParen); } } catch (re) { @@ -4663,7 +4697,7 @@ export class KipperParser extends KipperParserBase { try { this.enterOuterAlt(_localctx, 1); { - this.state = 745; + this.state = 754; _la = this._input.LA(1); if ( !( @@ -4833,7 +4867,7 @@ export class KipperParser extends KipperParserBase { private static readonly _serializedATNSegments: number = 2; private static readonly _serializedATNSegment0: string = - "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03X\u02EE\x04\x02" + + "\x03\uC91D\uCABA\u058D\uAFBA\u4F53\u0607\uEA8B\uC241\x03X\u02F7\x04\x02" + "\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04\x07" + "\t\x07\x04\b\t\b\x04\t\t\t\x04\n\t\n\x04\v\t\v\x04\f\t\f\x04\r\t\r\x04" + "\x0E\t\x0E\x04\x0F\t\x0F\x04\x10\t\x10\x04\x11\t\x11\x04\x12\t\x12\x04" + @@ -4898,99 +4932,100 @@ export class KipperParser extends KipperParserBase { "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" + + "\x03Q\x03Q\x03Q\x07Q\u02E7\nQ\fQ\x0EQ\u02EA\vQ\x05Q\u02EC\nQ\x03Q\x03" + + "Q\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\x028\x02:\x02<\x02' + + ">\x02@\x02B\x02D\x02F\x02H\x02J\x02L\x02N\x02P\x02R\x02T\x02V\x02X\x02" + + "Z\x02\\\x02^\x02`\x02b\x02d\x02f\x02h\x02j\x02l\x02n\x02p\x02r\x02t\x02" + + "v\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\x02" + + "8=\x04\x02\x1F!LL\x02\u02FC\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\u02EF\x03\x02\x02\x02\xA4\u02F4\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\x9C" + + "O\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\x05" + + 'B"\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" + @@ -5093,58 +5128,58 @@ export class KipperParser extends KipperParserBase { '\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"; + "\u021Bg\x03\x02\x02\x02\u021C"; private static readonly _serializedATNSegment1: string = - "\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" + + "\u021A\x03\x02\x02\x02\u021D\u021E\x07K\x02\x02\u021E\u021F\x05N(\x02" + + "\u021Fi\x03\x02\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\u0238" + + "q\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" + + "\x05n8\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\x05" + + "r:\x02\u0249\u024A\x05r:\x02\u024A\u024B\x07\t\x02\x02\u024B\u024C\x05" + + "\x9CO\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\x80" + + "A\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\x82" + + "B\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\x86" + + "D\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\x07" + + "F\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" + @@ -5174,16 +5209,21 @@ export class KipperParser extends KipperParserBase { "\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\x9CO\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"; + "\x9F\x03\x02\x02\x02\u02E1\u02E2\x05\xA4S\x02\u02E2\u02EB\x07@\x02\x02" + + '\u02E3\u02E8\x05\x9CO\x02\u02E4\u02E5\x07"\x02\x02\u02E5\u02E7\x05\x9C' + + "O\x02\u02E6\u02E4\x03\x02\x02\x02\u02E7\u02EA\x03\x02\x02\x02\u02E8\u02E6" + + "\x03\x02\x02\x02\u02E8\u02E9\x03\x02\x02\x02\u02E9\u02EC\x03\x02\x02\x02" + + "\u02EA\u02E8\x03\x02\x02\x02\u02EB\u02E3\x03\x02\x02\x02\u02EB\u02EC\x03" + + "\x02\x02\x02\u02EC\u02ED\x03\x02\x02\x02\u02ED\u02EE\x07B\x02\x02\u02EE" + + "\xA1\x03\x02\x02\x02\u02EF\u02F0\x07\x1E\x02\x02\u02F0\u02F1\x07&\x02" + + "\x02\u02F1\u02F2\x05\xA4S\x02\u02F2\u02F3\x07'\x02\x02\u02F3\xA3\x03" + + "\x02\x02\x02\u02F4\u02F5\t\x10\x02\x02\u02F5\xA5\x03\x02\x02\x02F\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\u02E8\u02EB"; public static readonly _serializedATN: string = Utils.join( [KipperParser._serializedATNSegment0, KipperParser._serializedATNSegment1], "", @@ -9207,12 +9247,27 @@ export class GenericTypeSpecifierExpressionContext extends KipperParserRuleConte public Less(): TerminalNode { return this.getToken(KipperParser.Less, 0); } - public typeSpecifierExpression(): TypeSpecifierExpressionContext { - return this.getRuleContext(0, TypeSpecifierExpressionContext); - } public Greater(): TerminalNode { return this.getToken(KipperParser.Greater, 0); } + public typeSpecifierExpression(): TypeSpecifierExpressionContext[]; + public typeSpecifierExpression(i: number): TypeSpecifierExpressionContext; + public typeSpecifierExpression(i?: number): TypeSpecifierExpressionContext | TypeSpecifierExpressionContext[] { + if (i === undefined) { + return this.getRuleContexts(TypeSpecifierExpressionContext); + } else { + return this.getRuleContext(i, TypeSpecifierExpressionContext); + } + } + public Comma(): TerminalNode[]; + public Comma(i: number): TerminalNode; + public Comma(i?: number): TerminalNode | TerminalNode[] { + if (i === undefined) { + return this.getTokens(KipperParser.Comma); + } else { + return this.getToken(KipperParser.Comma, i); + } + } constructor(parent: ParserRuleContext | undefined, invokingState: number) { super(parent, invokingState); } From f15a0c89048374229026936e05d0674106de4f3f Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Mon, 15 Jul 2024 18:26:03 +0200 Subject: [PATCH 42/57] minor (#499): Added tests for arrays and enhanced some of the existing tests --- test/module/core/compiler.test.ts | 8 +- test/module/core/core-functionality.test.ts | 33 +++---- .../invalid-amount-of-arguments.ts | 4 +- .../semantic-errors/invalid-assignment.ts | 4 +- .../invalid-relational-comparison.ts | 4 +- .../reserved-identifier-overwrite.ts | 4 +- .../semantic-errors/undefined-constant.ts | 4 +- .../semantic-errors/undefined-reference.ts | 4 +- .../invalid-unary-exp-operand.ts | 12 +-- .../syntax-errors/missing-function-body.ts | 4 +- ...rgument-type-error.ts => argument-type.ts} | 6 +- .../type-errors/arithmetic-operation.ts | 24 ++--- .../errors/type-errors/assignment-type.ts | 8 +- .../can-not-use-non-generic-as-generic.ts | 29 ++++++ .../type-errors/generic-argument-type.ts | 94 +++++++++++++++++++ .../errors/type-errors/invalid-conversion.ts | 16 ++-- .../errors/type-errors/invalid-key-type.ts | 8 +- .../invalid-number-of-generic-arguments.ts | 52 ++++++++++ .../errors/type-errors/invalid-unary-exp.ts | 4 +- .../core/errors/type-errors/readonly-write.ts | 4 +- .../errors/type-errors/value-not-indexable.ts | 8 +- test/module/core/logger.test.ts | 2 +- test/module/core/not-implemented.test.ts | 1 - .../module/core/warnings/useless-statement.ts | 18 ++-- 24 files changed, 262 insertions(+), 93 deletions(-) rename test/module/core/errors/type-errors/{argument-type-error.ts => argument-type.ts} (91%) create mode 100644 test/module/core/errors/type-errors/can-not-use-non-generic-as-generic.ts create mode 100644 test/module/core/errors/type-errors/generic-argument-type.ts create mode 100644 test/module/core/errors/type-errors/invalid-number-of-generic-arguments.ts diff --git a/test/module/core/compiler.test.ts b/test/module/core/compiler.test.ts index f41d8712d..2697c61aa 100644 --- a/test/module/core/compiler.test.ts +++ b/test/module/core/compiler.test.ts @@ -218,7 +218,7 @@ describe("KipperCompiler", () => { it("Successful Compilation", async () => { const result = await compiler.compile("var x: num = 1;", { target: defaultTarget }); assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected defined programCtx"); + assert.isDefined(result?.programCtx, "Expected defined programCtx"); assert.equal(result!!.warnings.length, 0, "Expected no warnings"); assert.equal(result!!.errors.length, 0, "Expected no errors"); }); @@ -238,7 +238,7 @@ describe("KipperCompiler", () => { it("One error", async () => { const result = await compiler.compile("var x: num =", { target: defaultTarget }); assert.isDefined(result, "Expected defined compilation result"); - assert.isUndefined(result!!.programCtx, "Expected undefined programCtx (syntax error)"); + assert.isUndefined(result?.programCtx, "Expected undefined programCtx (syntax error)"); assert.equal(result!!.warnings.length, 0, "Expected no warnings"); assert.equal(result!!.errors.length, 1, "Expected an error to be reported"); assert.equal(result.errors[0].constructor.name, "LexerOrParserSyntaxError", "Expected different error"); @@ -261,7 +261,7 @@ describe("KipperCompiler", () => { it("One error", async () => { const result = await compiler.compile("const x: num;", { target: defaultTarget }); assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected undefined programCtx (semantic error)"); + assert.isDefined(result?.programCtx, "Expected undefined programCtx (semantic error)"); assert.equal(result!!.warnings.length, 0, "Expected no warnings"); assert.equal(result!!.errors.length, 1, "Expected an error to be reported"); assert.equal(result.errors[0].constructor.name, "UndefinedConstantError", "Expected different error"); @@ -272,7 +272,7 @@ describe("KipperCompiler", () => { target: defaultTarget, }); assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected undefined programCtx (semantic error)"); + assert.isDefined(result?.programCtx, "Expected undefined programCtx (semantic error)"); assert.equal(result!!.warnings.length, 0, "Expected no warnings"); assert.equal(result!!.errors.length, 3, "Expected three errors to be reported"); for (const error of result!!.errors) { diff --git a/test/module/core/core-functionality.test.ts b/test/module/core/core-functionality.test.ts index 49c0f54f2..772c60822 100644 --- a/test/module/core/core-functionality.test.ts +++ b/test/module/core/core-functionality.test.ts @@ -903,7 +903,6 @@ describe("Core functionality", () => { describe("Slice notation ", () => { describe("str", () => { - it("Simple slice with both start and end", async () => { const fileContent = 'var x: str = "1234"[1:2]; print(x);'; const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); @@ -975,57 +974,57 @@ describe("Core functionality", () => { describe("array", () => { it("Simple slice with both start and end", async () => { - const fileContent = 'var x: Array = [1, 2, 3, 4][1:2]; print(x[0] as str);'; - const instance: KipperCompileResult = await compiler.compile(fileContent, {target: defaultTarget}); + const fileContent = "var x: Array = [1, 2, 3, 4][1:2]; print(x[0] as str);"; + const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); assert.include( instance.write(), - 'let x: Array = __kipper.slice([1, 2, 3, 4], 1, 2);', + "let x: Array = __kipper.slice([1, 2, 3, 4], 1, 2);", "Expected different TypeScript code", ); }); it("Simple slice with only start", async () => { - const fileContent = 'var x: Array = [1, 2, 3, 4][1:]; print(x[0] as str);'; - const instance: KipperCompileResult = await compiler.compile(fileContent, {target: defaultTarget}); + const fileContent = "var x: Array = [1, 2, 3, 4][1:]; print(x[0] as str);"; + const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); assert.include( instance.write(), - 'let x: Array = __kipper.slice([1, 2, 3, 4], 1, undefined);', + "let x: Array = __kipper.slice([1, 2, 3, 4], 1, undefined);", "Expected different TypeScript code", ); }); it("Simple slice with only end", async () => { - const fileContent = 'var x: Array = [1, 2, 3, 4][:2]; print(x[0] as str);'; - const instance: KipperCompileResult = await compiler.compile(fileContent, {target: defaultTarget}); + const fileContent = "var x: Array = [1, 2, 3, 4][:2]; print(x[0] as str);"; + const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); assert.include( instance.write(), - 'let x: Array = __kipper.slice([1, 2, 3, 4], undefined, 2);', + "let x: Array = __kipper.slice([1, 2, 3, 4], undefined, 2);", "Expected different TypeScript code", ); }); it("Simple slice with neither start nor end", async () => { - const fileContent = 'var x: Array = [1, 2, 3, 4][:]; print(x[0] as str);'; - const instance: KipperCompileResult = await compiler.compile(fileContent, {target: defaultTarget}); + const fileContent = "var x: Array = [1, 2, 3, 4][:]; print(x[0] as str);"; + const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); assert.deepEqual(instance.programCtx?.errors, [], "Expected no compilation errors"); assert(instance.programCtx?.stream.stringContent === fileContent, "Expected matching streams"); assert.include( instance.write(), - 'let x: Array = __kipper.slice([1, 2, 3, 4], undefined, undefined);', + "let x: Array = __kipper.slice([1, 2, 3, 4], undefined, undefined);", "Expected different TypeScript code", ); }); @@ -1306,17 +1305,13 @@ describe("Core functionality", () => { describe("Arrays", () => { it("Simple array declaration", async () => { const fileContent = `var x: Array = [1, 2, 3];`; - const instance: KipperCompileResult = await compiler.compile(fileContent, {target: defaultTarget}); + const instance: KipperCompileResult = await compiler.compile(fileContent, { target: defaultTarget }); assert.isDefined(instance.programCtx); assert.deepEqual(instance.programCtx?.errors.length, 0, "Expected no compilation errors"); const code = instance.write(); - assert.include( - code, - "let x: Array = [1, 2, 3];", - "Invalid TypeScript code (Expected different output)", - ); + assert.include(code, "let x: Array = [1, 2, 3];", "Invalid TypeScript code (Expected different output)"); }); it("Assign array to array", async () => { diff --git a/test/module/core/errors/semantic-errors/invalid-amount-of-arguments.ts b/test/module/core/errors/semantic-errors/invalid-amount-of-arguments.ts index a28ed67de..b605c4c12 100644 --- a/test/module/core/errors/semantic-errors/invalid-amount-of-arguments.ts +++ b/test/module/core/errors/semantic-errors/invalid-amount-of-arguments.ts @@ -62,7 +62,7 @@ describe("InvalidAmountOfArgumentsError", () => { assert.fail(`Expected no '${(e).name}'`); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); diff --git a/test/module/core/errors/semantic-errors/invalid-assignment.ts b/test/module/core/errors/semantic-errors/invalid-assignment.ts index 452de8439..d3bbd9997 100644 --- a/test/module/core/errors/semantic-errors/invalid-assignment.ts +++ b/test/module/core/errors/semantic-errors/invalid-assignment.ts @@ -42,8 +42,8 @@ describe("InvalidAssignmentError", () => { assert.fail("Expected no 'InvalidAssignmentError'"); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); }); diff --git a/test/module/core/errors/semantic-errors/invalid-relational-comparison.ts b/test/module/core/errors/semantic-errors/invalid-relational-comparison.ts index db1823e1a..ebcd5331a 100644 --- a/test/module/core/errors/semantic-errors/invalid-relational-comparison.ts +++ b/test/module/core/errors/semantic-errors/invalid-relational-comparison.ts @@ -28,7 +28,7 @@ describe("InvalidRelationalComparisonTypeError", () => { assert.fail(`Expected no '${(e).name}'`); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); diff --git a/test/module/core/errors/semantic-errors/reserved-identifier-overwrite.ts b/test/module/core/errors/semantic-errors/reserved-identifier-overwrite.ts index dd6a2e39e..f255d1650 100644 --- a/test/module/core/errors/semantic-errors/reserved-identifier-overwrite.ts +++ b/test/module/core/errors/semantic-errors/reserved-identifier-overwrite.ts @@ -24,7 +24,7 @@ describe("ReservedIdentifierOverwriteError", () => { assert.fail(`Expected no '${(e).name}'`); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); diff --git a/test/module/core/errors/semantic-errors/undefined-constant.ts b/test/module/core/errors/semantic-errors/undefined-constant.ts index 502497dd0..0fbd4f7f0 100644 --- a/test/module/core/errors/semantic-errors/undefined-constant.ts +++ b/test/module/core/errors/semantic-errors/undefined-constant.ts @@ -24,7 +24,7 @@ describe("UndefinedConstantError", () => { assert.fail(`Expected no '${(e).name}'`); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); diff --git a/test/module/core/errors/semantic-errors/undefined-reference.ts b/test/module/core/errors/semantic-errors/undefined-reference.ts index 385741d3b..246bea5f0 100644 --- a/test/module/core/errors/semantic-errors/undefined-reference.ts +++ b/test/module/core/errors/semantic-errors/undefined-reference.ts @@ -53,7 +53,7 @@ describe("UndefinedReferenceError", () => { assert.fail(`Expected no '${(e).name}'`); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); diff --git a/test/module/core/errors/syntax-errors/invalid-unary-exp-operand.ts b/test/module/core/errors/syntax-errors/invalid-unary-exp-operand.ts index fe57075d9..d043b27ef 100644 --- a/test/module/core/errors/syntax-errors/invalid-unary-exp-operand.ts +++ b/test/module/core/errors/syntax-errors/invalid-unary-exp-operand.ts @@ -79,8 +79,8 @@ describe("InvalidUnaryExpressionOperandError", () => { assert.fail("Expected no 'InvalidUnaryExpressionOperandError'"); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); it("Identifier in Tangled Expression", async () => { @@ -91,8 +91,8 @@ describe("InvalidUnaryExpressionOperandError", () => { assert.fail("Expected no 'InvalidUnaryExpressionOperandError'"); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); it("Identifier in Tangled Expression (Nested)", async () => { @@ -103,8 +103,8 @@ describe("InvalidUnaryExpressionOperandError", () => { assert.fail("Expected no 'InvalidUnaryExpressionOperandError'"); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); }); diff --git a/test/module/core/errors/syntax-errors/missing-function-body.ts b/test/module/core/errors/syntax-errors/missing-function-body.ts index c7f4cb8a5..825a81a6b 100644 --- a/test/module/core/errors/syntax-errors/missing-function-body.ts +++ b/test/module/core/errors/syntax-errors/missing-function-body.ts @@ -24,7 +24,7 @@ describe("MissingFunctionBodyError", () => { assert.fail(`Expected no '${(e).name}'`); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); diff --git a/test/module/core/errors/type-errors/argument-type-error.ts b/test/module/core/errors/type-errors/argument-type.ts similarity index 91% rename from test/module/core/errors/type-errors/argument-type-error.ts rename to test/module/core/errors/type-errors/argument-type.ts index 57d4e4695..e2585dd26 100644 --- a/test/module/core/errors/type-errors/argument-type-error.ts +++ b/test/module/core/errors/type-errors/argument-type.ts @@ -53,10 +53,10 @@ describe("ArgumentAssignmentTypeError", () => { defaultConfig, ); } catch (e) { - assert.fail("Expected no error"); + assert.fail("Expected no error. Reicev"); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); diff --git a/test/module/core/errors/type-errors/arithmetic-operation.ts b/test/module/core/errors/type-errors/arithmetic-operation.ts index bb2c5e929..fa0e65bf4 100644 --- a/test/module/core/errors/type-errors/arithmetic-operation.ts +++ b/test/module/core/errors/type-errors/arithmetic-operation.ts @@ -340,8 +340,8 @@ describe("ArithmeticOperationTypeError", () => { assert.fail("Expected no 'ArithmeticOperationTypeError'"); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); @@ -357,8 +357,8 @@ describe("ArithmeticOperationTypeError", () => { assert.fail("Expected no 'ArithmeticOperationTypeError'"); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); @@ -374,8 +374,8 @@ describe("ArithmeticOperationTypeError", () => { assert.fail("Expected no 'ArithmeticOperationTypeError'"); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); it("num", async () => { @@ -386,8 +386,8 @@ describe("ArithmeticOperationTypeError", () => { assert.fail("Expected no 'ArithmeticOperationTypeError'"); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); @@ -400,8 +400,8 @@ describe("ArithmeticOperationTypeError", () => { assert.fail("Expected no 'ArithmeticOperationTypeError'"); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); it("num", async () => { @@ -412,8 +412,8 @@ describe("ArithmeticOperationTypeError", () => { assert.fail("Expected no 'ArithmeticOperationTypeError'"); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); }); diff --git a/test/module/core/errors/type-errors/assignment-type.ts b/test/module/core/errors/type-errors/assignment-type.ts index acbcc8e78..89dbbb29a 100644 --- a/test/module/core/errors/type-errors/assignment-type.ts +++ b/test/module/core/errors/type-errors/assignment-type.ts @@ -130,8 +130,8 @@ describe("AssignmentTypeError", () => { assert.fail("Expected no 'TypeError'"); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); it("num = num", async () => { @@ -145,8 +145,8 @@ describe("AssignmentTypeError", () => { assert.fail("Expected no 'TypeError'"); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); }); diff --git a/test/module/core/errors/type-errors/can-not-use-non-generic-as-generic.ts b/test/module/core/errors/type-errors/can-not-use-non-generic-as-generic.ts new file mode 100644 index 000000000..c9dc63c00 --- /dev/null +++ b/test/module/core/errors/type-errors/can-not-use-non-generic-as-generic.ts @@ -0,0 +1,29 @@ +import { KipperCompiler, type KipperCompileResult, type KipperError } from "@kipper/core"; +import { defaultConfig, ensureTracebackDataExists } from "../index"; +import { assert } from "chai"; + +describe("CanNotUseNonGenericAsGenericTypeError", () => { + it("Error", async () => { + try { + await new KipperCompiler().compile("var x: num;", defaultConfig); + } catch (e) { + assert.equal((e).constructor.name, "CanNotUseNonGenericAsGenericTypeError"); + assert((e).name === "TypeError", "Expected different error"); + ensureTracebackDataExists(e); + return; + } + assert.fail("Expected 'CanNotUseNonGenericAsGenericTypeError'"); + }); + + it("NoError", async () => { + let result: KipperCompileResult | undefined = undefined; + try { + result = await new KipperCompiler().compile(`var x: Array;`, defaultConfig); + } catch (e) { + assert.fail(`Expected no error. Received '${e}'.`); + } + assert.isDefined(result, "Expected defined compilation result"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); + }); +}); diff --git a/test/module/core/errors/type-errors/generic-argument-type.ts b/test/module/core/errors/type-errors/generic-argument-type.ts new file mode 100644 index 000000000..72a4eced3 --- /dev/null +++ b/test/module/core/errors/type-errors/generic-argument-type.ts @@ -0,0 +1,94 @@ +import { defaultConfig, ensureTracebackDataExists } from "../index"; +import { assert } from "chai"; +import type { KipperCompileResult, KipperError } from "@kipper/core"; +import { KipperCompiler } from "@kipper/core"; + +describe("GenericArgumentTypeError", () => { + describe("Error", () => { + it("Array = Array", async () => { + try { + await new KipperCompiler().compile("var x: Array = ['0'];", defaultConfig); + } catch (e) { + assert.equal((e).cause?.constructor.name, "GenericArgumentTypeError", "Expected different error"); + assert((e).cause?.name === "TypeError", "Expected different error"); + ensureTracebackDataExists(e); + return; + } + assert.fail("Expected 'TypeError'"); + }); + + it("Array = Array", async () => { + try { + await new KipperCompiler().compile("var x: Array = ['0'];", defaultConfig); + } catch (e) { + assert.equal((e).cause?.constructor.name, "GenericArgumentTypeError", "Expected different error"); + assert((e).cause?.name === "TypeError", "Expected different error"); + ensureTracebackDataExists(e); + return; + } + assert.fail("Expected 'TypeError'"); + }); + + it("Array = Array", async () => { + try { + await new KipperCompiler().compile("var y: Array = []; var x: Array = y;", defaultConfig); + } catch (e) { + assert.equal((e).cause?.constructor.name, "GenericArgumentTypeError", "Expected different error"); + assert((e).cause?.name === "TypeError", "Expected different error"); + ensureTracebackDataExists(e); + return; + } + assert.fail("Expected 'TypeError'"); + }); + }); + + describe("NoError", () => { + it("Array = Array", async () => { + let result: KipperCompileResult | undefined = undefined; + try { + result = await new KipperCompiler().compile(`var x: Array = [0];`, defaultConfig); + } catch (e) { + assert.fail(`Expected no error. Received '${e}'.`); + } + assert.isDefined(result, "Expected defined compilation result"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); + }); + + it("Array = Array", async () => { + let result: KipperCompileResult | undefined = undefined; + try { + result = await new KipperCompiler().compile(`var x: Array = ['0'];`, defaultConfig); + } catch (e) { + assert.fail(`Expected no error. Received '${e}'.`); + } + assert.isDefined(result, "Expected defined compilation result"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); + }); + + it("Array = Array", async () => { + let result: KipperCompileResult | undefined = undefined; + try { + result = await new KipperCompiler().compile(`var x: Array = [];`, defaultConfig); + } catch (e) { + assert.fail(`Expected no error. Received '${e}'.`); + } + assert.isDefined(result, "Expected defined compilation result"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); + }); + + it("Array = Array", async () => { + let result: KipperCompileResult | undefined = undefined; + try { + result = await new KipperCompiler().compile(`var x: Array = [];`, defaultConfig); + } catch (e) { + assert.fail(`Expected no error. Received '${e}'.`); + } + assert.isDefined(result, "Expected defined compilation result"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); + }); + }); +}); diff --git a/test/module/core/errors/type-errors/invalid-conversion.ts b/test/module/core/errors/type-errors/invalid-conversion.ts index 2138b0d2b..74c521888 100644 --- a/test/module/core/errors/type-errors/invalid-conversion.ts +++ b/test/module/core/errors/type-errors/invalid-conversion.ts @@ -90,8 +90,8 @@ describe("InvalidConversionTypeError", () => { assert.fail("Expected no 'InvalidConversionTypeError'"); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); it("str as num", async () => { @@ -105,8 +105,8 @@ describe("InvalidConversionTypeError", () => { assert.fail("Expected no 'InvalidConversionTypeError'"); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); it("bool as str", async () => { @@ -120,8 +120,8 @@ describe("InvalidConversionTypeError", () => { assert.fail("Expected no 'InvalidConversionTypeError'"); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); it("bool as num", async () => { @@ -135,8 +135,8 @@ describe("InvalidConversionTypeError", () => { assert.fail("Expected no 'InvalidConversionTypeError'"); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); }); diff --git a/test/module/core/errors/type-errors/invalid-key-type.ts b/test/module/core/errors/type-errors/invalid-key-type.ts index 6eee024af..5e8f9f360 100644 --- a/test/module/core/errors/type-errors/invalid-key-type.ts +++ b/test/module/core/errors/type-errors/invalid-key-type.ts @@ -39,8 +39,8 @@ describe("InvalidKeyTypeError", () => { assert.fail(`Expected no '${(e).name}'`); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); it("Slice Notation Member Access", async () => { @@ -51,8 +51,8 @@ describe("InvalidKeyTypeError", () => { assert.fail(`Expected no '${(e).name}'`); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); }); diff --git a/test/module/core/errors/type-errors/invalid-number-of-generic-arguments.ts b/test/module/core/errors/type-errors/invalid-number-of-generic-arguments.ts new file mode 100644 index 000000000..86ab25034 --- /dev/null +++ b/test/module/core/errors/type-errors/invalid-number-of-generic-arguments.ts @@ -0,0 +1,52 @@ +import { defaultConfig, ensureTracebackDataExists } from "../index"; +import { assert } from "chai"; +import type { KipperCompileResult, KipperError } from "@kipper/core"; +import { KipperCompiler } from "@kipper/core"; + +describe("InvalidAmountOfGenericArgumentsError", () => { + describe("Error", () => { + it("Too many generic arguments", async () => { + try { + await new KipperCompiler().compile("var x: Array;", defaultConfig); + } catch (e) { + assert.equal( + (e).constructor.name, + "InvalidAmountOfGenericArgumentsError", + "Expected different error", + ); + assert((e).name === "TypeError", "Expected different error"); + ensureTracebackDataExists(e); + return; + } + assert.fail("Expected 'InvalidAmountOfGenericArgumentsError'"); + }); + + it("Too few generic arguments", async () => { + try { + await new KipperCompiler().compile("var x: Array<>;", defaultConfig); + } catch (e) { + assert.equal( + (e).constructor.name, + "InvalidAmountOfGenericArgumentsError", + "Expected different error", + ); + assert((e).name === "TypeError", "Expected different error"); + ensureTracebackDataExists(e); + return; + } + assert.fail("Expected 'InvalidAmountOfGenericArgumentsError'"); + }); + }); + + it("NoError", async () => { + let result: KipperCompileResult | undefined = undefined; + try { + result = await new KipperCompiler().compile(`var x: Array;`, defaultConfig); + } catch (e) { + assert.fail(`Expected no error. Received '${e}'.`); + } + assert.isDefined(result, "Expected defined compilation result"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); + }); +}); diff --git a/test/module/core/errors/type-errors/invalid-unary-exp.ts b/test/module/core/errors/type-errors/invalid-unary-exp.ts index 7ad4585b6..8bb951199 100644 --- a/test/module/core/errors/type-errors/invalid-unary-exp.ts +++ b/test/module/core/errors/type-errors/invalid-unary-exp.ts @@ -38,7 +38,7 @@ describe("InvalidUnaryExpressionTypeError", () => { assert.fail(`Expected no '${(e).name}'`); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); diff --git a/test/module/core/errors/type-errors/readonly-write.ts b/test/module/core/errors/type-errors/readonly-write.ts index 8fc8d0ceb..410195c0d 100644 --- a/test/module/core/errors/type-errors/readonly-write.ts +++ b/test/module/core/errors/type-errors/readonly-write.ts @@ -24,7 +24,7 @@ describe("ReadOnlyWriteTypeError", () => { assert.fail(`Expected no '${(e).name}'`); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); diff --git a/test/module/core/errors/type-errors/value-not-indexable.ts b/test/module/core/errors/type-errors/value-not-indexable.ts index 63d4b8aa7..ddcd7e209 100644 --- a/test/module/core/errors/type-errors/value-not-indexable.ts +++ b/test/module/core/errors/type-errors/value-not-indexable.ts @@ -39,8 +39,8 @@ describe("ValueNotIndexableTypeError", () => { assert.fail(`Expected no '${(e).name}'`); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); it("Slice Notation Member Access", async () => { @@ -51,8 +51,8 @@ describe("ValueNotIndexableTypeError", () => { assert.fail(`Expected no '${(e).name}'`); } assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); }); }); }); diff --git a/test/module/core/logger.test.ts b/test/module/core/logger.test.ts index 4219c2b0c..a2890bdfb 100644 --- a/test/module/core/logger.test.ts +++ b/test/module/core/logger.test.ts @@ -78,7 +78,7 @@ describe("KipperLogger", () => { target: defaultTarget, }); assert.isDefined(result, "Expected defined compilation result"); - assert.isUndefined(result!!.programCtx, "Expected programCtx to be undefined (syntax error)"); + assert.isUndefined(result?.programCtx, "Expected programCtx to be undefined (syntax error)"); assert.equal(result!!.errors.length, 1, "Expected one stored error"); assert.equal(result.errors[0].constructor.name, "LexerOrParserSyntaxError", "Expected different error"); diff --git a/test/module/core/not-implemented.test.ts b/test/module/core/not-implemented.test.ts index d8af531fa..df55806ef 100644 --- a/test/module/core/not-implemented.test.ts +++ b/test/module/core/not-implemented.test.ts @@ -20,7 +20,6 @@ describe("NotImplemented", () => { assert.fail("Expected NotImplementedError"); }); - it("Conditional Expression with union types", async () => { try { await new KipperCompiler().compile("var x: num = true ? 1 : '2';", { diff --git a/test/module/core/warnings/useless-statement.ts b/test/module/core/warnings/useless-statement.ts index ed366a17b..974a56ef8 100644 --- a/test/module/core/warnings/useless-statement.ts +++ b/test/module/core/warnings/useless-statement.ts @@ -71,27 +71,27 @@ describe("UselessExpressionStatementWarning", () => { let result = await new KipperCompiler().compile("var x: num = 5; x = 5;", defaultConfig); assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); - assert.isEmpty(result!!.programCtx!!.warnings, "Expected no warnings"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); + assert.isEmpty(result?.programCtx!!.warnings, "Expected no warnings"); }); it("Function call", async () => { let result = await new KipperCompiler().compile("def f() -> void { }; f();", defaultConfig); assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); - assert.isEmpty(result!!.programCtx!!.warnings, "Expected no warnings"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); + assert.isEmpty(result?.programCtx!!.warnings, "Expected no warnings"); }); it("Child has side effects", async () => { let result = await new KipperCompiler().compile("var x: num = 5; 5 + (x += 5);", defaultConfig); assert.isDefined(result, "Expected defined compilation result"); - assert.isDefined(result!!.programCtx, "Expected programCtx to be defined"); - assert.isFalse(result!!.programCtx!!.hasFailed, "Expected no errors"); - assert.isEmpty(result!!.programCtx!!.warnings, "Expected no warnings"); + assert.isDefined(result?.programCtx, "Expected programCtx to be defined"); + assert.isFalse(result?.programCtx?.hasFailed, "Expected no errors"); + assert.isEmpty(result?.programCtx!!.warnings, "Expected no warnings"); }); }); }); From 29033d80ae9287ca15bf34dbfb7131ac58c6db13 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Tue, 16 Jul 2024 09:44:51 +0200 Subject: [PATCH 43/57] other: Updated CHANGELOG.md --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbdad7884..ce3675d25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,12 @@ To use development versions of Kipper download the - New errors: - `TypeCanNotBeUsedForTypeCheckingError`, which is thrown when a type is used for type checking, but is not a valid type. This is an error indicating an invalid logic that should be fixed. + - `GenericArgumentTypeError`, which is thrown when a generic argument is used with an invalid type. This is an error + indicating an invalid logic that should be fixed. + - `InvalidAmountOfGenericArgumentsError`, which is thrown when an invalid amount of generic arguments is used. This is + an error indicating an invalid logic that should be fixed. + - `CanNotUseNonGenericAsGenericTypeError`, which is thrown when a non-generic type is used as a generic type. This is + an error indicating an invalid logic that should be fixed. - New interfaces: - `InterfaceDeclarationSemantics`, which represents the semantics of an interface declaration. - `InterfaceDeclarationTypeSemantics`, which represents the type semantics of an interface declaration. @@ -47,6 +53,8 @@ To use development versions of Kipper download the - `TypeDeclarationSemantics`, which represents the semantics of a type declaration. - `TypeDeclarationTypeSemantics`, which represents the type semantics of a type declaration. - `CompilableType`, which represents a type that can be compiled. +- New functions: + - `KipperTypeChecker.validArrayExpression`, which ensures that an array expression is valid. ### Changed From 9ebb742879722a66952f41cca451e5bbf47017eb Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Tue, 16 Jul 2024 09:45:31 +0200 Subject: [PATCH 44/57] other: Added versioning to function `KipperTypeChecker.validArrayExpression` --- kipper/core/src/compiler/semantics/analyser/type-checker.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/kipper/core/src/compiler/semantics/analyser/type-checker.ts b/kipper/core/src/compiler/semantics/analyser/type-checker.ts index 3f0e848a1..ed2bc0a95 100644 --- a/kipper/core/src/compiler/semantics/analyser/type-checker.ts +++ b/kipper/core/src/compiler/semantics/analyser/type-checker.ts @@ -731,6 +731,7 @@ export class KipperTypeChecker extends KipperSemanticsAsserter { * * This for now only checks that the types of the array elements are always the same. * @param param The array primary expression to check. + * @since 0.12.0 */ validArrayExpression(param: ArrayPrimaryExpression) { const children = param.getSemanticData().value; From 62bd0810641c31a1c650f9b2d627277f687251f5 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Tue, 16 Jul 2024 09:47:01 +0200 Subject: [PATCH 45/57] other: Updated CHANGELOG.md --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce3675d25..8a459bc8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ To use development versions of Kipper download the the entire core type system has been reworked and adjusted to also support custom types as well as complex types (objects, arrays etc.). This does not inheritely add functionality but serves as the stepping stone for the implementation of all custom types in the future. ([#524](https://github.com/Kipper-Lang/Kipper/issues/524)) +- Implemented the generic `Array` type and single-type array initializers. + ([#499](https://github.com/Kipper-Lang/Kipper/issues/499)) - New module: - `semantics/runtime-built-ins`, which contains runtime built-in functions, variables and types. - `semantics/runtime-internals`, which contains the runtime internal functions. @@ -51,7 +53,7 @@ To use development versions of Kipper download the - `ClassDeclarationTypeSemantics`, which represents the type semantics of a class declaration. - `TypeDeclaration`, which represents a type declaration. This is an abstract base class for all type declarations. - `TypeDeclarationSemantics`, which represents the semantics of a type declaration. - - `TypeDeclarationTypeSemantics`, which represents the type semantics of a type declaration. + - `TypeDeclarationTyp`KipperTypeChecker.validArrayExpression`eSemantics`, which represents the type semantics of a type declaration. - `CompilableType`, which represents a type that can be compiled. - New functions: - `KipperTypeChecker.validArrayExpression`, which ensures that an array expression is valid. From 35a36e8969f44210ec2408c2776a772125d22e23 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Tue, 16 Jul 2024 09:58:34 +0200 Subject: [PATCH 46/57] other: Updated CHANGELOG.md --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b2dd33f0..9fd8b6a64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,9 @@ To use development versions of Kipper download the [`next` tag release](https://www.npmjs.com/package/kipper?activeTab=versions), which will include the specified changes. ### Added -- Added semantic checking and code generation for PrimaryObjectExpression and ObjectProperty + +- Added semantic checking and code generation for object literals and object properties. + ([#526](https://github.com/Kipper-Lang/Kipper/issues/526)) - Implemented internal representation for custom types such as objects, interfaces and classes. This change means that the entire core type system has been reworked and adjusted to also support custom types as well as complex types (objects, arrays etc.). This does not inheritely add functionality but serves as the stepping stone for the From b6cfeb7bea6480dabc0cf258477caf5fd96b1e04 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Tue, 16 Jul 2024 10:32:03 +0200 Subject: [PATCH 47/57] fix (#526): Fixed code generation style mismatches --- .../src/evaluated-kipper-config-file.ts | 2 +- kipper/core/src/compiler/ast/ast-generator.ts | 2 +- kipper/target-js/src/code-generator.ts | 27 +++++-------------- kipper/target-ts/src/code-generator.ts | 14 +++++----- 4 files changed, 16 insertions(+), 29 deletions(-) diff --git a/kipper/config/src/evaluated-kipper-config-file.ts b/kipper/config/src/evaluated-kipper-config-file.ts index 532ecf6c1..f09c6093c 100644 --- a/kipper/config/src/evaluated-kipper-config-file.ts +++ b/kipper/config/src/evaluated-kipper-config-file.ts @@ -1,4 +1,4 @@ -import type { EvaluatedConfigValue } from "./abstract"; +import { 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/src/compiler/ast/ast-generator.ts b/kipper/core/src/compiler/ast/ast-generator.ts index cab6759b0..49e6d85f6 100644 --- a/kipper/core/src/compiler/ast/ast-generator.ts +++ b/kipper/core/src/compiler/ast/ast-generator.ts @@ -211,7 +211,7 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi this.programCtx.logger.debug( `Created AST node of type '${this.currentNode.constructor.name}' for context '${ctx.astSyntaxKind}'` + - `(Loc: ${ctx.start.line}:${ctx.start.charPositionInLine})`, + `(Loc: ${ctx.start.line}:${ctx.start.charPositionInLine})`, ); } diff --git a/kipper/target-js/src/code-generator.ts b/kipper/target-js/src/code-generator.ts index 9c24c1017..80a6116bd 100644 --- a/kipper/target-js/src/code-generator.ts +++ b/kipper/target-js/src/code-generator.ts @@ -449,28 +449,15 @@ export class JavaScriptTargetCodeGenerator extends KipperTargetCodeGenerator { objectPrimaryExpression = async (node: ObjectPrimaryExpression): Promise => { const semanticData = node.getSemanticData(); const keyValuePairs = semanticData.keyValuePairs; - let keyValuePairsCodeString = await this.getStringifiedKeyValuePairs(keyValuePairs); + const translatedKeyValuePairs = await Promise.all( + keyValuePairs.map(async (pair) => { + return [...(await pair.translateCtxAndChildren()), ",", "\n"]; + }), + ); - return ["{", ...keyValuePairsCodeString, "}", ";"]; + return ["{", "\n", ...indentLines(translatedKeyValuePairs).flat(), "}"]; }; - protected async getStringifiedKeyValuePairs(keyValuePairs: Array): Promise { - let keyValuePairsCode: Array = []; - - for (let pair of keyValuePairs) { - let pairCode = await pair.translateCtxAndChildren(); - keyValuePairsCode.push(pairCode[0] + ",\n"); - } - - let code = keyValuePairsCode.join(""); - - if (code.endsWith(",\n")) { - code = code.slice(0, -2); - } - - return code; - } - /** * Translates a {@link ObjectProperty} into the JavaScript language. * @since 0.11.0 @@ -483,7 +470,7 @@ export class JavaScriptTargetCodeGenerator extends KipperTargetCodeGenerator { const translatedExpression = (await expression.translateCtxAndChildren()).join(""); // Return the concatenated result - return [` ${identifier}: ${translatedExpression}`]; + return [identifier, ": ", translatedExpression]; }; /** diff --git a/kipper/target-ts/src/code-generator.ts b/kipper/target-ts/src/code-generator.ts index 14ac6566a..5a55fb27c 100644 --- a/kipper/target-ts/src/code-generator.ts +++ b/kipper/target-ts/src/code-generator.ts @@ -7,9 +7,6 @@ import type { InterfaceDeclaration, InterfacePropertyDeclaration, ObjectPrimaryExpression, - ParameterDeclaration, - TranslatedCodeLine, - VariableDeclaration, InterfaceMethodDeclaration, TranslatedExpression, ParameterDeclaration, @@ -17,9 +14,8 @@ import type { VariableDeclaration, } from "@kipper/core"; import { createTSFunctionSignature, getTSFunctionSignature } from "./tools"; -import { JavaScriptTargetCodeGenerator } from "@kipper/target-js"; +import { indentLines, 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. @@ -137,9 +133,13 @@ export class TypeScriptTargetCodeGenerator extends JavaScriptTargetCodeGenerator override objectPrimaryExpression = async (node: ObjectPrimaryExpression): Promise => { const semanticData = node.getSemanticData(); const keyValuePairs = semanticData.keyValuePairs; - let keyValuePairsCodeString = await this.getStringifiedKeyValuePairs(keyValuePairs); + const translatedKeyValuePairs = await Promise.all( + keyValuePairs.map(async (pair) => { + return [...(await pair.translateCtxAndChildren()), ",", "\n"]; + }), + ); // Return the object primary expression - return ["{\n", ...keyValuePairsCodeString, "\n}"]; + return ["{", "\n", ...indentLines(translatedKeyValuePairs).flat(), "}"]; }; } From 535c633bcf2f3fed5a67984df573ba6417aac872 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Tue, 16 Jul 2024 10:32:14 +0200 Subject: [PATCH 48/57] other: Fixed failing tests --- test/module/core/core-functionality.test.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/module/core/core-functionality.test.ts b/test/module/core/core-functionality.test.ts index 5ff3960f2..4a1c83d32 100644 --- a/test/module/core/core-functionality.test.ts +++ b/test/module/core/core-functionality.test.ts @@ -1527,8 +1527,7 @@ describe("Core functionality", () => { assert.isDefined(instance.programCtx); assert.equal(instance.programCtx!!.errors.length, 0, "Expected no compilation errors"); let written = instance.write(); - assert.include(written, "{\n x: 1,\n y: '2'\n};", "Invalid TypeScript code (Expected different output)"); + assert.include(written, "{\n x: 1,\n y: '2',\n};", "Invalid TypeScript code (Expected different output)"); }); - }); }); From 7d3d2e986105819165dde9468cb6b503cd96d7d6 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Tue, 16 Jul 2024 10:32:21 +0200 Subject: [PATCH 49/57] other: Updated CHANGELOG.md --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fd8b6a64..fdcdc41f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,13 +19,13 @@ To use development versions of Kipper download the ### Added - Added semantic checking and code generation for object literals and object properties. - ([#526](https://github.com/Kipper-Lang/Kipper/issues/526)) + ([#526](https://github.com/Kipper-Lang/Kipper/issues/526)) - Implemented internal representation for custom types such as objects, interfaces and classes. This change means that the entire core type system has been reworked and adjusted to also support custom types as well as complex types (objects, arrays etc.). This does not inheritely add functionality but serves as the stepping stone for the implementation of all custom types in the future. ([#524](https://github.com/Kipper-Lang/Kipper/issues/524)) - Implemented the generic `Array` type and single-type array initializers. - ([#499](https://github.com/Kipper-Lang/Kipper/issues/499)) + ([#499](https://github.com/Kipper-Lang/Kipper/issues/499)) - New module: - `semantics/runtime-built-ins`, which contains runtime built-in functions, variables and types. - `semantics/runtime-internals`, which contains the runtime internal functions. @@ -45,9 +45,9 @@ To use development versions of Kipper download the - `GenericArgumentTypeError`, which is thrown when a generic argument is used with an invalid type. This is an error indicating an invalid logic that should be fixed. - `InvalidAmountOfGenericArgumentsError`, which is thrown when an invalid amount of generic arguments is used. This is - an error indicating an invalid logic that should be fixed. + an error indicating an invalid logic that should be fixed. - `CanNotUseNonGenericAsGenericTypeError`, which is thrown when a non-generic type is used as a generic type. This is - an error indicating an invalid logic that should be fixed. + an error indicating an invalid logic that should be fixed. - New interfaces: - `InterfaceDeclarationSemantics`, which represents the semantics of an interface declaration. - `InterfaceDeclarationTypeSemantics`, which represents the type semantics of an interface declaration. From 4293b6011596c02e8047c463d7b9ad8ebb3b70dc Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Wed, 17 Jul 2024 09:49:37 +0200 Subject: [PATCH 50/57] other: Prettified with Prettier v3 --- kipper/cli/src/commands/compile.ts | 2 +- .../config/src/abstract/config-interpreter.ts | 44 +++++++++++-------- kipper/config/src/errors.ts | 5 ++- kipper/core/src/compiler/ast/ast-generator.ts | 4 +- .../semantics/symbol-table/global-scope.ts | 5 ++- test/web-bundle-test.html | 2 +- 6 files changed, 38 insertions(+), 24 deletions(-) diff --git a/kipper/cli/src/commands/compile.ts b/kipper/cli/src/commands/compile.ts index cfbb8723e..faf6f12f6 100644 --- a/kipper/cli/src/commands/compile.ts +++ b/kipper/cli/src/commands/compile.ts @@ -119,7 +119,7 @@ export default class Compile extends Command { const { stream, outDir } = await getParseStream(args, flags, preExistingConfig); const target: KipperCompileTarget = flags["target"] ? getTarget(flags["target"]) - : preExistingCompileConfig?.target ?? getTarget("js"); + : (preExistingCompileConfig?.target ?? getTarget("js")); // Output const encoding = flags["encoding"] || "utf8"; diff --git a/kipper/config/src/abstract/config-interpreter.ts b/kipper/config/src/abstract/config-interpreter.ts index 8009911f8..e0866b9a8 100644 --- a/kipper/config/src/abstract/config-interpreter.ts +++ b/kipper/config/src/abstract/config-interpreter.ts @@ -52,24 +52,32 @@ export type Config = { [key in keyof Scheme]: Scheme[key] extends { type: "string"; required: true } ? string : Scheme[key] extends { type: "string"; required: false } - ? string | undefined - : Scheme[key] extends { type: "number"; required: true } - ? number - : Scheme[key] extends { type: "number"; required: false } - ? number | undefined - : Scheme[key] extends { type: "boolean"; required: true } - ? boolean - : Scheme[key] extends { type: "boolean"; required: false } - ? boolean | undefined - : Scheme[key] extends { type: "array"; itemType: infer T; required: true } - ? T[] - : Scheme[key] extends { type: "array"; itemType: infer T; required: false } - ? T[] | undefined - : Scheme[key] extends { type: "object"; properties: infer P extends ConfigInterpreterScheme; required: true } - ? Config

- : Scheme[key] extends { type: "object"; properties: infer P extends ConfigInterpreterScheme; required: false } - ? Config

| undefined - : never; + ? string | undefined + : Scheme[key] extends { type: "number"; required: true } + ? number + : Scheme[key] extends { type: "number"; required: false } + ? number | undefined + : Scheme[key] extends { type: "boolean"; required: true } + ? boolean + : Scheme[key] extends { type: "boolean"; required: false } + ? boolean | undefined + : Scheme[key] extends { type: "array"; itemType: infer T; required: true } + ? T[] + : Scheme[key] extends { type: "array"; itemType: infer T; required: false } + ? T[] | undefined + : Scheme[key] extends { + type: "object"; + properties: infer P extends ConfigInterpreterScheme; + required: true; + } + ? Config

+ : Scheme[key] extends { + type: "object"; + properties: infer P extends ConfigInterpreterScheme; + required: false; + } + ? Config

| undefined + : never; }; /** diff --git a/kipper/config/src/errors.ts b/kipper/config/src/errors.ts index 43f6e56d1..7de99fa63 100644 --- a/kipper/config/src/errors.ts +++ b/kipper/config/src/errors.ts @@ -9,7 +9,10 @@ export type ConfigErrorMetaData = { fileName: string; refChain: string[] }; * @since 0.11.0 */ export class ConfigError { - public constructor(public message: string, public meta?: ConfigErrorMetaData) { + public constructor( + public message: string, + public meta?: ConfigErrorMetaData, + ) { this.message = `${message}${meta ? ` (${[...meta.refChain, meta.fileName].join(" -> ")})` : ""}`; } } diff --git a/kipper/core/src/compiler/ast/ast-generator.ts b/kipper/core/src/compiler/ast/ast-generator.ts index ffdca57e9..49e6d85f6 100644 --- a/kipper/core/src/compiler/ast/ast-generator.ts +++ b/kipper/core/src/compiler/ast/ast-generator.ts @@ -201,7 +201,7 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi 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.", + " definition.", ); } this._currentPrimaryNode = this.expressionFactory.create(ctx, this.currentNode); @@ -211,7 +211,7 @@ export class KipperFileASTGenerator implements KipperParserListener, ParseTreeLi this.programCtx.logger.debug( `Created AST node of type '${this.currentNode.constructor.name}' for context '${ctx.astSyntaxKind}'` + - `(Loc: ${ctx.start.line}:${ctx.start.charPositionInLine})`, + `(Loc: ${ctx.start.line}:${ctx.start.charPositionInLine})`, ); } diff --git a/kipper/core/src/compiler/semantics/symbol-table/global-scope.ts b/kipper/core/src/compiler/semantics/symbol-table/global-scope.ts index 913df1ca1..6751b55df 100644 --- a/kipper/core/src/compiler/semantics/symbol-table/global-scope.ts +++ b/kipper/core/src/compiler/semantics/symbol-table/global-scope.ts @@ -16,7 +16,10 @@ import type { UniverseScope } from "./universum-scope"; * @since 0.8.0 */ export class GlobalScope extends Scope { - constructor(public readonly ctx: RootASTNode, public readonly universe: UniverseScope) { + constructor( + public readonly ctx: RootASTNode, + public readonly universe: UniverseScope, + ) { super(); } diff --git a/test/web-bundle-test.html b/test/web-bundle-test.html index 31c787000..9670c8248 100644 --- a/test/web-bundle-test.html +++ b/test/web-bundle-test.html @@ -1,4 +1,4 @@ - + From 1b9fb48fb2ce12cd76286c6571742bd19d5b78ec Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Wed, 17 Jul 2024 09:57:31 +0200 Subject: [PATCH 51/57] other: Fixed ESLint errors --- kipper/config/src/abstract/config-interpreter.ts | 1 + kipper/config/src/evaluated-kipper-config-file.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/kipper/config/src/abstract/config-interpreter.ts b/kipper/config/src/abstract/config-interpreter.ts index e0866b9a8..4ccd4b18d 100644 --- a/kipper/config/src/abstract/config-interpreter.ts +++ b/kipper/config/src/abstract/config-interpreter.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-mixed-spaces-and-tabs */ import type { ConfigFile } from "./config-file"; import type { ConfigErrorMetaData } from "../errors"; import { ConfigValidationError, UnknownFieldError } from "../errors"; 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"; From 977f7dbace4237581061d0b7bd994e077e57413e Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Wed, 17 Jul 2024 10:03:35 +0200 Subject: [PATCH 52/57] release: Bumped Kipper project version to 0.12.0-alpha.0 --- CITATION.cff | 8 ++++---- kipper/cli/src/index.ts | 2 +- kipper/config/src/index.ts | 2 +- kipper/core/src/index.ts | 2 +- kipper/index.ts | 2 +- kipper/target-js/src/index.ts | 2 +- kipper/target-ts/src/index.ts | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 46151c56b..3677c8f37 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -13,8 +13,8 @@ authors: identifiers: - type: url value: >- - https://github.com/Kipper-Lang/Kipper/releases/tag/v0.11.0 - description: The GitHub release URL of tag 0.11.0 + https://github.com/Kipper-Lang/Kipper/releases/tag/v0.12.0-alpha.0 + description: The GitHub release URL of tag 0.12.0-alpha.0 repository-code: 'https://github.com/Kipper-Lang/Kipper/' url: 'https://kipper-lang.org' abstract: >- @@ -31,6 +31,6 @@ keywords: - oop-programming - type-safety license: GPL-3.0-or-later -license-url: 'https://github.com/Kipper-Lang/Kipper/blob/v0.11.0/LICENSE' -version: 0.11.0 +license-url: 'https://github.com/Kipper-Lang/Kipper/blob/v0.12.0-alpha.0/LICENSE' +version: 0.12.0-alpha.0 date-released: '2024-07-01' diff --git a/kipper/cli/src/index.ts b/kipper/cli/src/index.ts index 0e9b87970..4d1afb9d2 100644 --- a/kipper/cli/src/index.ts +++ b/kipper/cli/src/index.ts @@ -13,7 +13,7 @@ export * from "./output/compile"; // eslint-disable-next-line no-unused-vars export const name = "@kipper/cli"; // eslint-disable-next-line no-unused-vars -export const version = "0.11.0"; +export const version = "0.12.0-alpha.0"; // eslint-disable-next-line no-unused-vars export const author = "Luna Klatzer"; // eslint-disable-next-line no-unused-vars diff --git a/kipper/config/src/index.ts b/kipper/config/src/index.ts index 49f0132b5..10d30b923 100644 --- a/kipper/config/src/index.ts +++ b/kipper/config/src/index.ts @@ -12,7 +12,7 @@ export * from "./evaluated-kipper-config-file"; // eslint-disable-next-line no-unused-vars export const name = "@kipper/config"; // eslint-disable-next-line no-unused-vars -export const version = "0.11.0"; +export const version = "0.12.0-alpha.0"; // eslint-disable-next-line no-unused-vars export const author = "Luna Klatzer"; // eslint-disable-next-line no-unused-vars diff --git a/kipper/core/src/index.ts b/kipper/core/src/index.ts index 70e2c60a0..3af4f00c0 100644 --- a/kipper/core/src/index.ts +++ b/kipper/core/src/index.ts @@ -17,7 +17,7 @@ export * as utils from "./tools"; // eslint-disable-next-line no-unused-vars export const name = "@kipper/core"; // eslint-disable-next-line no-unused-vars -export const version = "0.11.0"; +export const version = "0.12.0-alpha.0"; // eslint-disable-next-line no-unused-vars export const author = "Luna Klatzer"; // eslint-disable-next-line no-unused-vars diff --git a/kipper/index.ts b/kipper/index.ts index 54e6348f5..93623706d 100644 --- a/kipper/index.ts +++ b/kipper/index.ts @@ -13,7 +13,7 @@ export * from "@kipper/target-ts"; // eslint-disable-next-line no-unused-vars export const name = "kipper"; // eslint-disable-next-line no-unused-vars -export const version = "0.11.0"; +export const version = "0.12.0-alpha.0"; // eslint-disable-next-line no-unused-vars export const author = "Luna Klatzer"; // eslint-disable-next-line no-unused-vars diff --git a/kipper/target-js/src/index.ts b/kipper/target-js/src/index.ts index 6983186a7..ee7840991 100644 --- a/kipper/target-js/src/index.ts +++ b/kipper/target-js/src/index.ts @@ -13,7 +13,7 @@ export * from "./tools"; // eslint-disable-next-line no-unused-vars export const name = "@kipper/target-js"; // eslint-disable-next-line no-unused-vars -export const version = "0.11.0"; +export const version = "0.12.0-alpha.0"; // eslint-disable-next-line no-unused-vars export const author = "Luna Klatzer"; // eslint-disable-next-line no-unused-vars diff --git a/kipper/target-ts/src/index.ts b/kipper/target-ts/src/index.ts index f77677afd..9e2b935d8 100644 --- a/kipper/target-ts/src/index.ts +++ b/kipper/target-ts/src/index.ts @@ -13,7 +13,7 @@ export * from "./tools"; // eslint-disable-next-line no-unused-vars export const name = "@kipper/target-ts"; // eslint-disable-next-line no-unused-vars -export const version = "0.11.0"; +export const version = "0.12.0-alpha.0"; // eslint-disable-next-line no-unused-vars export const author = "Luna Klatzer"; // eslint-disable-next-line no-unused-vars From 171392f0f43174da58da35917ed2c9f7867e3921 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Wed, 17 Jul 2024 10:17:50 +0200 Subject: [PATCH 53/57] minor: Reverted oclif back to version `3.4.6` --- kipper/cli/README.md | 21 ++-- kipper/cli/package.json | 10 +- kipper/cli/pnpm-lock.yaml | 243 +++++++++++++++++++++++++++++--------- 3 files changed, 202 insertions(+), 72 deletions(-) diff --git a/kipper/cli/README.md b/kipper/cli/README.md index 05acf655d..c7dbf9cb4 100644 --- a/kipper/cli/README.md +++ b/kipper/cli/README.md @@ -22,10 +22,9 @@ and the [Kipper website](https://kipper-lang.org)._ [![DOI](https://zenodo.org/badge/411260595.svg)](https://zenodo.org/badge/latestdoi/411260595) - -- [Kipper CLI - `@kipper/cli` 🦊✨](#kipper-cli---kippercli-) -- [Usage](#usage) -- [Commands](#commands) +* [Kipper CLI - `@kipper/cli` 🦊✨](#kipper-cli---kippercli-) +* [Usage](#usage) +* [Commands](#commands) ## General Information @@ -40,7 +39,6 @@ and the [Kipper website](https://kipper-lang.org)._ # Usage - ```sh-session $ npm install -g @kipper/cli $ kipper COMMAND @@ -52,18 +50,16 @@ USAGE $ kipper COMMAND ... ``` - # Commands - -- [`kipper compile [FILE]`](#kipper-compile-file) -- [`kipper help [COMMAND]`](#kipper-help-command) -- [`kipper new [LOCATION]`](#kipper-new-location) -- [`kipper run [FILE]`](#kipper-run-file) -- [`kipper version`](#kipper-version) +* [`kipper compile [FILE]`](#kipper-compile-file) +* [`kipper help [COMMAND]`](#kipper-help-command) +* [`kipper new [LOCATION]`](#kipper-new-location) +* [`kipper run [FILE]`](#kipper-run-file) +* [`kipper version`](#kipper-version) ## `kipper compile [FILE]` @@ -206,7 +202,6 @@ USAGE ``` _See code: [src/commands/version.ts](https://github.com/Kipper-Lang/Kipper/blob/v0.11.0/kipper/cli/src/commands/version.ts)_ - ## Contributing to Kipper diff --git a/kipper/cli/package.json b/kipper/cli/package.json index 5f3ea13fa..5ea8d662e 100644 --- a/kipper/cli/package.json +++ b/kipper/cli/package.json @@ -4,7 +4,8 @@ "version": "0.11.0", "author": "Luna-Klatzer @Luna-Klatzer", "bin": { - "kipper": "./bin/run" + "kipper": "./bin/run", + "kip": "./bin/run" }, "dependencies": { "@kipper/config": "workspace:~", @@ -36,10 +37,15 @@ "os-tmpdir": "2.0.0", "pseudomap": "1.0.2", "typescript": "5.1.3", - "oclif": "3.17.2", + "oclif": "3.4.6", "semver": "7.6.2", "prettier": "3.3.3" }, + "overrides": { + "pnpm": { + "@oclif/core": "$@oclif/core" + } + }, "engines": { "node": "16.x || 18.x || 20.x || 22.x", "pnpm": "8" diff --git a/kipper/cli/pnpm-lock.yaml b/kipper/cli/pnpm-lock.yaml index 95403064a..e8d40b171 100644 --- a/kipper/cli/pnpm-lock.yaml +++ b/kipper/cli/pnpm-lock.yaml @@ -74,8 +74,8 @@ devDependencies: specifier: 3.0.2 version: 3.0.2 oclif: - specifier: 3.17.2 - version: 3.17.2(@types/node@20.14.9)(typescript@5.1.3) + specifier: 3.4.6 + version: 3.4.6(@types/node@20.14.9)(typescript@5.1.3) os-tmpdir: specifier: 2.0.0 version: 2.0.0 @@ -473,6 +473,40 @@ packages: - supports-color dev: false + /@oclif/core@1.26.2: + resolution: {integrity: sha512-6jYuZgXvHfOIc9GIaS4T3CIKGTjPmfAxuMcbCbMRKJJl4aq/4xeRlEz0E8/hz8HxvxZBGvN2GwAUHlrGWQVrVw==} + engines: {node: '>=14.0.0'} + dependencies: + '@oclif/linewrap': 1.0.0 + '@oclif/screen': 3.0.8 + ansi-escapes: 4.3.2 + ansi-styles: 4.3.0 + cardinal: 2.1.1 + chalk: 4.1.2 + clean-stack: 3.0.1 + cli-progress: 3.12.0 + debug: 4.3.5(supports-color@8.1.1) + ejs: 3.1.8 + fs-extra: 9.1.0 + get-package-type: 0.1.0 + globby: 11.1.0 + hyperlinker: 1.0.0 + indent-string: 4.0.0 + is-wsl: 2.2.0 + js-yaml: 3.14.1 + natural-orderby: 2.0.3 + object-treeify: 1.1.33 + password-prompt: 1.1.2 + semver: 7.6.2 + string-width: 4.2.3 + strip-ansi: 6.0.1 + supports-color: 8.1.1 + supports-hyperlinks: 2.2.0 + tslib: 2.6.2 + widest-line: 3.1.0 + wrap-ansi: 7.0.0 + dev: true + /@oclif/core@2.16.0(@types/node@20.14.9)(typescript@5.1.3): resolution: {integrity: sha512-dL6atBH0zCZl1A1IXCKJgLPrM/wR7K+Wi401E/IvqsK8m2iCHW+0TEOGrans/cuN3oTW+uxIyJFHJ8Im0k4qBw==} engines: {node: '>=14.0.0'} @@ -552,7 +586,6 @@ packages: /@oclif/linewrap@1.0.0: resolution: {integrity: sha512-Ups2dShK52xXa8w6iBWLgcjPJWjais6KPJQq3gQ/88AY6BXoTX+MIGFPrWQO1KLMiQfoTpcLnUwloN4brrVUHw==} - dev: false /@oclif/parser@3.8.17: resolution: {integrity: sha512-l04iSd0xoh/16TGVpXb81Gg3z7tlQGrEup16BrVLsZBK6SEYpYHRJZnM32BwZrHI97ZSFfuSwVlzoo6HdsaK8A==} @@ -627,24 +660,11 @@ packages: - '@types/node' - supports-color - typescript - dev: false - /@oclif/plugin-warn-if-update-available@2.1.1(@types/node@20.14.9)(typescript@5.1.3): - resolution: {integrity: sha512-y7eSzT6R5bmTIJbiMMXgOlbBpcWXGlVhNeQJBLBCCy1+90Wbjyqf6uvY0i2WcO4sh/THTJ20qCW80j3XUlgDTA==} + /@oclif/screen@3.0.8: + resolution: {integrity: sha512-yx6KAqlt3TAHBduS2fMQtJDL2ufIHnDRArrJEOoTTuizxqmjLT+psGYOHpmMl3gvQpFJ11Hs76guUUktzAF9Bg==} engines: {node: '>=12.0.0'} - dependencies: - '@oclif/core': 2.16.0(@types/node@20.14.9)(typescript@5.1.3) - chalk: 4.1.2 - debug: 4.3.5(supports-color@8.1.1) - http-call: 5.3.0 - lodash.template: 4.5.0 - semver: 7.6.2 - transitivePeerDependencies: - - '@swc/core' - - '@swc/wasm' - - '@types/node' - - supports-color - - typescript + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. dev: true /@oclif/test@2.5.6(@types/node@20.14.9)(typescript@5.1.3): @@ -1009,6 +1029,16 @@ packages: dependencies: type-fest: 0.21.3 + /ansi-regex@2.1.1: + resolution: {integrity: sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==} + engines: {node: '>=0.10.0'} + dev: true + + /ansi-regex@3.0.1: + resolution: {integrity: sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==} + engines: {node: '>=4'} + dev: true + /ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -1018,6 +1048,11 @@ packages: engines: {node: '>=12'} dev: true + /ansi-styles@2.2.1: + resolution: {integrity: sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==} + engines: {node: '>=0.10.0'} + dev: true + /ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} @@ -1091,19 +1126,12 @@ packages: resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} engines: {node: '>=8'} - /async-retry@1.3.3: - resolution: {integrity: sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==} - dependencies: - retry: 0.13.1 - dev: true - /async@3.2.4: resolution: {integrity: sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==} /at-least-node@1.0.0: resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==} engines: {node: '>= 4.0.0'} - dev: false /available-typed-arrays@1.0.7: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} @@ -1313,10 +1341,22 @@ packages: /cardinal@2.1.1: resolution: {integrity: sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw==} + hasBin: true dependencies: ansicolors: 0.3.2 redeyed: 2.1.1 + /chalk@1.1.3: + resolution: {integrity: sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==} + engines: {node: '>=0.10.0'} + dependencies: + ansi-styles: 2.2.1 + escape-string-regexp: 1.0.5 + has-ansi: 2.0.0 + strip-ansi: 3.0.1 + supports-color: 2.0.0 + dev: true + /chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -1352,6 +1392,11 @@ packages: dependencies: escape-string-regexp: 4.0.0 + /cli-boxes@1.0.0: + resolution: {integrity: sha512-3Fo5wu8Ytle8q9iCzS4D2MWVL2X7JVWRiS1BnXbTFDhS9c/REkM9vd1AmabsoZoY5/dGi5TT9iKL8Kb6DeBRQg==} + engines: {node: '>=0.10.0'} + dev: true + /cli-cursor@3.1.0: resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} engines: {node: '>=8'} @@ -1437,6 +1482,11 @@ packages: mkdirp-infer-owner: 2.0.0 dev: true + /code-point-at@1.1.0: + resolution: {integrity: sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==} + engines: {node: '>=0.10.0'} + dev: true + /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: @@ -1658,6 +1708,7 @@ packages: /ejs@3.1.8: resolution: {integrity: sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==} engines: {node: '>=0.10.0'} + hasBin: true dependencies: jake: 10.8.5 @@ -1728,6 +1779,7 @@ packages: /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} + hasBin: true /event-target-shim@5.0.1: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} @@ -1901,7 +1953,6 @@ packages: graceful-fs: 4.2.10 jsonfile: 6.1.0 universalify: 2.0.0 - dev: false /fs-minipass@2.1.0: resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} @@ -1976,6 +2027,11 @@ packages: resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} engines: {node: '>=8.0.0'} + /get-stdin@4.0.1: + resolution: {integrity: sha512-F5aQMywwJ2n85s4hJPTT9RPxGmubonuB10MNYo17/xph174n2MIR33HRguhzVag10O/npM7SPk73LMZNP+FaWw==} + engines: {node: '>=0.10.0'} + dev: true + /get-stream@5.2.0: resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} engines: {node: '>=8'} @@ -2084,6 +2140,13 @@ packages: engines: {node: '>=8.0.0'} dev: true + /has-ansi@2.0.0: + resolution: {integrity: sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==} + engines: {node: '>=0.10.0'} + dependencies: + ansi-regex: 2.1.1 + dev: true + /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} @@ -2367,6 +2430,18 @@ packages: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} + /is-fullwidth-code-point@1.0.0: + resolution: {integrity: sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==} + engines: {node: '>=0.10.0'} + dependencies: + number-is-nan: 1.0.1 + dev: true + + /is-fullwidth-code-point@2.0.0: + resolution: {integrity: sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==} + engines: {node: '>=4'} + dev: true + /is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} @@ -2477,6 +2552,7 @@ packages: /jake@10.8.5: resolution: {integrity: sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==} engines: {node: '>=10'} + hasBin: true dependencies: async: 3.2.4 chalk: 4.1.2 @@ -2494,6 +2570,7 @@ packages: /js-yaml@3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} + hasBin: true dependencies: argparse: 1.0.10 esprima: 4.0.1 @@ -2537,7 +2614,6 @@ packages: universalify: 2.0.0 optionalDependencies: graceful-fs: 4.2.10 - dev: false /jsonparse@1.3.1: resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} @@ -2586,23 +2662,6 @@ packages: p-locate: 5.0.0 dev: true - /lodash._reinterpolate@3.0.0: - resolution: {integrity: sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA==} - dev: true - - /lodash.template@4.5.0: - resolution: {integrity: sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==} - dependencies: - lodash._reinterpolate: 3.0.0 - lodash.templatesettings: 4.2.0 - dev: true - - /lodash.templatesettings@4.2.0: - resolution: {integrity: sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==} - dependencies: - lodash._reinterpolate: 3.0.0 - dev: true - /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} @@ -3222,6 +3281,11 @@ packages: set-blocking: 2.0.0 dev: true + /number-is-nan@1.0.1: + resolution: {integrity: sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==} + engines: {node: '>=0.10.0'} + dev: true + /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -3231,16 +3295,15 @@ packages: resolution: {integrity: sha512-EFVjAYfzWqWsBMRHPMAXLCDIJnpMhdWAqR7xG6M6a2cs6PMFpl/+Z20w9zDW4vkxOFfddegBKq9Rehd0bxWE7A==} engines: {node: '>= 10'} - /oclif@3.17.2(@types/node@20.14.9)(typescript@5.1.3): - resolution: {integrity: sha512-+vFXxgmR7dGGz+g6YiqSZu2LXVkBMaS9/rhtsLGkYw45e53CW/3kBgPRnOvxcTDM3Td9JPeBD2JWxXnPKGQW3A==} + /oclif@3.4.6(@types/node@20.14.9)(typescript@5.1.3): + resolution: {integrity: sha512-YyGMDil2JpfC9OcB76Gtcd5LqwwOeAgb8S7mVHf/6Qecjqor8QbbvcSwZvB1e1TqjlD1JUhDPqBiFeVe/WOdWg==} engines: {node: '>=12.0.0'} hasBin: true dependencies: - '@oclif/core': 2.16.0(@types/node@20.14.9)(typescript@5.1.3) + '@oclif/core': 1.26.2 '@oclif/plugin-help': 5.2.20(@types/node@20.14.9)(typescript@5.1.3) '@oclif/plugin-not-found': 2.4.3(@types/node@20.14.9)(typescript@5.1.3) - '@oclif/plugin-warn-if-update-available': 2.1.1(@types/node@20.14.9)(typescript@5.1.3) - async-retry: 1.3.3 + '@oclif/plugin-warn-if-update-available': 2.0.37(@types/node@20.14.9)(typescript@5.1.3) aws-sdk: 2.1648.0 concurrently: 7.6.0 debug: 4.3.5(supports-color@8.1.1) @@ -3251,10 +3314,10 @@ packages: lodash: 4.17.21 normalize-package-data: 3.0.3 semver: 7.6.2 - shelljs: 0.8.5 tslib: 2.6.2 yeoman-environment: 3.19.3 yeoman-generator: 5.10.0(yeoman-environment@3.19.3) + yosay: 2.0.2 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' @@ -3439,6 +3502,10 @@ packages: - supports-color dev: true + /pad-component@0.0.1: + resolution: {integrity: sha512-8EKVBxCRSvLnsX1p2LlSFSH3c2/wuhY9/BXXWu8boL78FbVKqn2L5SpURt1x5iw6Gq8PTqJ7MdPoe5nCtX3I+g==} + dev: true + /parse-conflict-json@2.0.2: resolution: {integrity: sha512-jDbRGb00TAPFsKWCpZZOT93SxVP9nONOSgES3AevqRq/CHvavEBvKAjxX9p5Y5F0RZLxH9Ufd9+RwtCsa+lFDA==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} @@ -3797,11 +3864,6 @@ packages: engines: {node: '>= 4'} dev: true - /retry@0.13.1: - resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==} - engines: {node: '>= 4'} - dev: true - /reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} @@ -4074,6 +4136,23 @@ packages: - supports-color dev: true + /string-width@1.0.2: + resolution: {integrity: sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==} + engines: {node: '>=0.10.0'} + dependencies: + code-point-at: 1.1.0 + is-fullwidth-code-point: 1.0.0 + strip-ansi: 3.0.1 + dev: true + + /string-width@2.1.1: + resolution: {integrity: sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==} + engines: {node: '>=4'} + dependencies: + is-fullwidth-code-point: 2.0.0 + strip-ansi: 4.0.0 + dev: true + /string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -4107,6 +4186,20 @@ packages: safe-buffer: 5.2.1 dev: true + /strip-ansi@3.0.1: + resolution: {integrity: sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==} + engines: {node: '>=0.10.0'} + dependencies: + ansi-regex: 2.1.1 + dev: true + + /strip-ansi@4.0.0: + resolution: {integrity: sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==} + engines: {node: '>=4'} + dependencies: + ansi-regex: 3.0.1 + dev: true + /strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -4152,6 +4245,11 @@ packages: engines: {node: '>=6'} dev: true + /supports-color@2.0.0: + resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} + engines: {node: '>=0.8.0'} + dev: true + /supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -4183,6 +4281,13 @@ packages: engines: {node: '>= 0.4'} dev: true + /taketalk@1.0.0: + resolution: {integrity: sha512-kS7E53It6HA8S1FVFBWP7HDwgTiJtkmYk7TsowGlizzVrivR1Mf9mgjXHY1k7rOfozRVMZSfwjB3bevO4QEqpg==} + dependencies: + get-stdin: 4.0.1 + minimist: 1.2.8 + dev: true + /tar@6.2.1: resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} engines: {node: '>=10'} @@ -4375,7 +4480,6 @@ packages: /universalify@2.0.0: resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==} engines: {node: '>= 10.0.0'} - dev: false /untildify@4.0.0: resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} @@ -4494,6 +4598,7 @@ packages: /which@1.3.1: resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} + hasBin: true dependencies: isexe: 2.0.0 @@ -4527,6 +4632,14 @@ packages: /wordwrap@1.0.0: resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} + /wrap-ansi@2.1.0: + resolution: {integrity: sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==} + engines: {node: '>=0.10.0'} + dependencies: + string-width: 1.0.2 + strip-ansi: 3.0.1 + dev: true + /wrap-ansi@6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} @@ -4714,3 +4827,19 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} dev: true + + /yosay@2.0.2: + resolution: {integrity: sha512-avX6nz2esp7IMXGag4gu6OyQBsMh/SEn+ZybGu3yKPlOTE6z9qJrzG/0X5vCq/e0rPFy0CUYCze0G5hL310ibA==} + engines: {node: '>=4'} + hasBin: true + dependencies: + ansi-regex: 2.1.1 + ansi-styles: 3.2.1 + chalk: 1.1.3 + cli-boxes: 1.0.0 + pad-component: 0.0.1 + string-width: 2.1.1 + strip-ansi: 3.0.1 + taketalk: 1.0.0 + wrap-ansi: 2.1.0 + dev: true From de9bd6cfcd197926751c432c9188004d9fe23333 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Wed, 17 Jul 2024 10:19:14 +0200 Subject: [PATCH 54/57] other: Updated CLI README.md --- kipper/cli/README.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/kipper/cli/README.md b/kipper/cli/README.md index c7dbf9cb4..05acf655d 100644 --- a/kipper/cli/README.md +++ b/kipper/cli/README.md @@ -22,9 +22,10 @@ and the [Kipper website](https://kipper-lang.org)._ [![DOI](https://zenodo.org/badge/411260595.svg)](https://zenodo.org/badge/latestdoi/411260595) -* [Kipper CLI - `@kipper/cli` 🦊✨](#kipper-cli---kippercli-) -* [Usage](#usage) -* [Commands](#commands) + +- [Kipper CLI - `@kipper/cli` 🦊✨](#kipper-cli---kippercli-) +- [Usage](#usage) +- [Commands](#commands) ## General Information @@ -39,6 +40,7 @@ and the [Kipper website](https://kipper-lang.org)._ # Usage + ```sh-session $ npm install -g @kipper/cli $ kipper COMMAND @@ -50,16 +52,18 @@ USAGE $ kipper COMMAND ... ``` + # Commands -* [`kipper compile [FILE]`](#kipper-compile-file) -* [`kipper help [COMMAND]`](#kipper-help-command) -* [`kipper new [LOCATION]`](#kipper-new-location) -* [`kipper run [FILE]`](#kipper-run-file) -* [`kipper version`](#kipper-version) + +- [`kipper compile [FILE]`](#kipper-compile-file) +- [`kipper help [COMMAND]`](#kipper-help-command) +- [`kipper new [LOCATION]`](#kipper-new-location) +- [`kipper run [FILE]`](#kipper-run-file) +- [`kipper version`](#kipper-version) ## `kipper compile [FILE]` @@ -202,6 +206,7 @@ USAGE ``` _See code: [src/commands/version.ts](https://github.com/Kipper-Lang/Kipper/blob/v0.11.0/kipper/cli/src/commands/version.ts)_ + ## Contributing to Kipper From 148167e37eb45b9b3bc4698005498b1b746bda1e Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Wed, 17 Jul 2024 10:21:16 +0200 Subject: [PATCH 55/57] other: Added `@oclif/core` to the CLI devDependencies --- kipper/cli/package.json | 1 + kipper/cli/pnpm-lock.yaml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/kipper/cli/package.json b/kipper/cli/package.json index 5ea8d662e..284d3f3f9 100644 --- a/kipper/cli/package.json +++ b/kipper/cli/package.json @@ -37,6 +37,7 @@ "os-tmpdir": "2.0.0", "pseudomap": "1.0.2", "typescript": "5.1.3", + "@oclif/core": "1.26.2", "oclif": "3.4.6", "semver": "7.6.2", "prettier": "3.3.3" diff --git a/kipper/cli/pnpm-lock.yaml b/kipper/cli/pnpm-lock.yaml index e8d40b171..dab3114d4 100644 --- a/kipper/cli/pnpm-lock.yaml +++ b/kipper/cli/pnpm-lock.yaml @@ -52,6 +52,9 @@ dependencies: version: 3.3.4 devDependencies: + '@oclif/core': + specifier: 1.26.2 + version: 1.26.2 '@oclif/test': specifier: 2.5.6 version: 2.5.6(@types/node@20.14.9)(typescript@5.1.3) From 20a4f6c791570e8ba37a3a6d69879bd3d129cf65 Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Wed, 17 Jul 2024 10:22:32 +0200 Subject: [PATCH 56/57] other: Fixed pnpm-lock.yaml files --- kipper/cli/pnpm-lock.yaml | 54 --------------------------------- kipper/core/pnpm-lock.yaml | 1 - kipper/target-js/pnpm-lock.yaml | 1 - kipper/target-ts/pnpm-lock.yaml | 1 - kipper/web/pnpm-lock.yaml | 1 - pnpm-lock.yaml | 5 --- 6 files changed, 63 deletions(-) diff --git a/kipper/cli/pnpm-lock.yaml b/kipper/cli/pnpm-lock.yaml index dab3114d4..ca326edc6 100644 --- a/kipper/cli/pnpm-lock.yaml +++ b/kipper/cli/pnpm-lock.yaml @@ -190,7 +190,6 @@ packages: /@npmcli/arborist@4.3.1: resolution: {integrity: sha512-yMRgZVDpwWjplorzt9SFSaakWx6QIK248Nw4ZFgkrAy/GvJaFRaSZzE6nD7JBK5r8g/+PTxFq5Wj/sfciE7x+A==} engines: {node: ^12.13.0 || ^14.15.0 || >=16} - hasBin: true dependencies: '@isaacs/string-locale-compare': 1.1.0 '@npmcli/installed-package-contents': 1.0.7 @@ -285,7 +284,6 @@ packages: /@npmcli/installed-package-contents@1.0.7: resolution: {integrity: sha512-9rufe0wnJusCQoLpV9ZPKIVP55itrM5BxOXs10DmdbRfgWtHy1LDyskbwRnBghuB0PrF7pNPOqREVtpz4HqzKw==} engines: {node: '>= 10'} - hasBin: true dependencies: npm-bundled: 1.1.2 npm-normalize-package-bin: 1.0.1 @@ -294,7 +292,6 @@ packages: /@npmcli/installed-package-contents@2.1.0: resolution: {integrity: sha512-c8UuGLeZpm69BryRykLuKRyKFZYJsZSCT4aVY5ds4omyZqJ172ApzgfKJ5eV/r3HgLdUYgFVe54KSFVjKoe27w==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hasBin: true dependencies: npm-bundled: 3.0.1 npm-normalize-package-bin: 3.0.1 @@ -326,7 +323,6 @@ packages: /@npmcli/move-file@1.1.2: resolution: {integrity: sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==} engines: {node: '>=10'} - deprecated: This functionality has been moved to @npmcli/fs dependencies: mkdirp: 1.0.4 rimraf: 3.0.2 @@ -335,7 +331,6 @@ packages: /@npmcli/move-file@2.0.1: resolution: {integrity: sha512-mJd2Z5TjYWq/ttPLLGqArdtnC74J6bOzg4rMDnN+p1xTacZ2yPRCk2y0oSWQtygLR9YVQXgOcONrwtnk3JupxQ==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - deprecated: This functionality has been moved to @npmcli/fs dependencies: mkdirp: 1.0.4 rimraf: 3.0.2 @@ -434,7 +429,6 @@ packages: /@oclif/config@1.18.17: resolution: {integrity: sha512-k77qyeUvjU8qAJ3XK3fr/QVAqsZO8QOBuESnfeM5HHtPNLSyfVcwiMM2zveSW5xRdLSG3MfV8QnLVkuyCL2ENg==} engines: {node: '>=8.0.0'} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. dependencies: '@oclif/errors': 1.3.6 '@oclif/parser': 3.8.17 @@ -449,7 +443,6 @@ packages: /@oclif/config@1.18.2: resolution: {integrity: sha512-cE3qfHWv8hGRCP31j7fIS7BfCflm/BNZ2HNqHexH+fDrdF2f1D5S8VmXWLC77ffv3oDvWyvE9AZeR0RfmHCCaA==} engines: {node: '>=8.0.0'} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. dependencies: '@oclif/errors': 1.3.6 '@oclif/parser': 3.8.17 @@ -464,7 +457,6 @@ packages: /@oclif/config@1.18.6: resolution: {integrity: sha512-OWhCpdu4QqggOPX1YPZ4XVmLLRX+lhGjXV6RNA7sogOwLqlEmSslnN/lhR5dkhcWZbKWBQH29YCrB3LDPRu/IA==} engines: {node: '>=8.0.0'} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. dependencies: '@oclif/errors': 1.3.6 '@oclif/parser': 3.8.17 @@ -593,7 +585,6 @@ packages: /@oclif/parser@3.8.17: resolution: {integrity: sha512-l04iSd0xoh/16TGVpXb81Gg3z7tlQGrEup16BrVLsZBK6SEYpYHRJZnM32BwZrHI97ZSFfuSwVlzoo6HdsaK8A==} engines: {node: '>=8.0.0'} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. dependencies: '@oclif/errors': 1.3.6 '@oclif/linewrap': 1.0.0 @@ -667,7 +658,6 @@ packages: /@oclif/screen@3.0.8: resolution: {integrity: sha512-yx6KAqlt3TAHBduS2fMQtJDL2ufIHnDRArrJEOoTTuizxqmjLT+psGYOHpmMl3gvQpFJ11Hs76guUUktzAF9Bg==} engines: {node: '>=12.0.0'} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. dev: true /@oclif/test@2.5.6(@types/node@20.14.9)(typescript@5.1.3): @@ -1084,7 +1074,6 @@ packages: /are-we-there-yet@2.0.0: resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} engines: {node: '>=10'} - deprecated: This package is no longer supported. dependencies: delegates: 1.0.0 readable-stream: 3.6.2 @@ -1093,7 +1082,6 @@ packages: /are-we-there-yet@3.0.1: resolution: {integrity: sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - deprecated: This package is no longer supported. dependencies: delegates: 1.0.0 readable-stream: 3.6.2 @@ -1344,7 +1332,6 @@ packages: /cardinal@2.1.1: resolution: {integrity: sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw==} - hasBin: true dependencies: ansicolors: 0.3.2 redeyed: 2.1.1 @@ -1511,7 +1498,6 @@ packages: /color-support@1.1.3: resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} - hasBin: true dev: true /colors@1.0.3: @@ -1538,7 +1524,6 @@ packages: /concurrently@7.6.0: resolution: {integrity: sha512-BKtRgvcJGeZ4XttiDiNcFiRlxoAeZOseqUvyYRUp/Vtd+9p1ULmeoSqGsDA+2ivdeDFpqrJvGvmI+StKfKl5hw==} engines: {node: ^12.20.0 || ^14.13.0 || >=16.0.0} - hasBin: true dependencies: chalk: 4.1.2 date-fns: 2.30.0 @@ -1639,7 +1624,6 @@ packages: /debuglog@1.0.1: resolution: {integrity: sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw==} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. dev: true /decompress-response@6.0.0: @@ -1711,7 +1695,6 @@ packages: /ejs@3.1.8: resolution: {integrity: sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==} engines: {node: '>=0.10.0'} - hasBin: true dependencies: jake: 10.8.5 @@ -1782,7 +1765,6 @@ packages: /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} - hasBin: true /event-target-shim@5.0.1: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} @@ -1833,7 +1815,6 @@ packages: /fancy-test@2.0.42: resolution: {integrity: sha512-TX8YTALYAmExny+f+G24MFxWry3Pk09+9uykwRjfwjibRxJ9ZjJzrnHYVBZK46XQdyli7d+rQc5U/KK7V6uLsw==} engines: {node: '>=12.0.0'} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. dependencies: '@types/chai': 4.3.16 '@types/lodash': 4.17.6 @@ -1982,7 +1963,6 @@ packages: /gauge@3.0.2: resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} engines: {node: '>=10'} - deprecated: This package is no longer supported. dependencies: aproba: 2.0.0 color-support: 1.1.3 @@ -1998,7 +1978,6 @@ packages: /gauge@4.0.4: resolution: {integrity: sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - deprecated: This package is no longer supported. dependencies: aproba: 2.0.0 color-support: 1.1.3 @@ -2092,7 +2071,6 @@ packages: /glob@8.1.0: resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} engines: {node: '>=12'} - deprecated: Glob versions prior to v9 are no longer supported dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -2427,7 +2405,6 @@ packages: /is-docker@2.2.1: resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==} engines: {node: '>=8'} - hasBin: true /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} @@ -2555,7 +2532,6 @@ packages: /jake@10.8.5: resolution: {integrity: sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==} engines: {node: '>=10'} - hasBin: true dependencies: async: 3.2.4 chalk: 4.1.2 @@ -2573,7 +2549,6 @@ packages: /js-yaml@3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} - hasBin: true dependencies: argparse: 1.0.10 esprima: 4.0.1 @@ -3029,7 +3004,6 @@ packages: /node-gyp@8.4.1: resolution: {integrity: sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==} engines: {node: '>= 10.12.0'} - hasBin: true dependencies: env-paths: 2.2.1 glob: 7.2.3 @@ -3049,7 +3023,6 @@ packages: /node-gyp@9.4.1: resolution: {integrity: sha512-OQkWKbjQKbGkMf/xqI1jjy3oCTgMKJac58G2+bjZb3fza6gW2YrCSdMQYaoTb70crvE//Gngr4f0AgVHmqHvBQ==} engines: {node: ^12.13 || ^14.13 || >=16} - hasBin: true dependencies: env-paths: 2.2.1 exponential-backoff: 3.1.1 @@ -3077,7 +3050,6 @@ packages: /nopt@5.0.0: resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} engines: {node: '>=6'} - hasBin: true dependencies: abbrev: 1.1.1 dev: true @@ -3085,7 +3057,6 @@ packages: /nopt@6.0.0: resolution: {integrity: sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - hasBin: true dependencies: abbrev: 1.1.1 dev: true @@ -3192,7 +3163,6 @@ packages: /npm-packlist@3.0.0: resolution: {integrity: sha512-L/cbzmutAwII5glUcf2DBRNY/d0TFd4e/FnaZigJV6JD85RHZXJFGwCndjMWiiViiWSsWt3tiOLpI3ByTnIdFQ==} engines: {node: '>=10'} - hasBin: true dependencies: glob: 7.2.3 ignore-walk: 4.0.1 @@ -3265,7 +3235,6 @@ packages: /npmlog@5.0.1: resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} - deprecated: This package is no longer supported. dependencies: are-we-there-yet: 2.0.0 console-control-strings: 1.1.0 @@ -3276,7 +3245,6 @@ packages: /npmlog@6.0.2: resolution: {integrity: sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - deprecated: This package is no longer supported. dependencies: are-we-there-yet: 3.0.1 console-control-strings: 1.1.0 @@ -3301,7 +3269,6 @@ packages: /oclif@3.4.6(@types/node@20.14.9)(typescript@5.1.3): resolution: {integrity: sha512-YyGMDil2JpfC9OcB76Gtcd5LqwwOeAgb8S7mVHf/6Qecjqor8QbbvcSwZvB1e1TqjlD1JUhDPqBiFeVe/WOdWg==} engines: {node: '>=12.0.0'} - hasBin: true dependencies: '@oclif/core': 1.26.2 '@oclif/plugin-help': 5.2.20(@types/node@20.14.9)(typescript@5.1.3) @@ -3366,7 +3333,6 @@ packages: /os-tmpdir@2.0.0: resolution: {integrity: sha512-wZojVQP1fR3zW/Z9YLGJz4etXiu5d2tm4D6R4w2FTx1BAx9F1T+tEBb4+0deWQoskF1xe9zgBr/9mYwE+KY3xw==} engines: {node: '>=0.10.0'} - deprecated: This is not needed anymore. `require('os').tmpdir()` in Node.js 4 and up is good. dev: true /p-cancelable@2.1.1: @@ -3451,7 +3417,6 @@ packages: /pacote@12.0.3: resolution: {integrity: sha512-CdYEl03JDrRO3x18uHjBYA9TyoW8gy+ThVcypcDkxPtKlw76e4ejhYB6i9lJ+/cebbjpqPW/CijjqxwDTts8Ow==} engines: {node: ^12.13.0 || ^14.15.0 || >=16} - hasBin: true dependencies: '@npmcli/git': 2.1.0 '@npmcli/installed-package-contents': 1.0.7 @@ -3480,7 +3445,6 @@ packages: /pacote@15.2.0: resolution: {integrity: sha512-rJVZeIwHTUta23sIZgEIM62WYwbmGbThdbnkt81ravBplQv+HjyroqnLRNH2+sLJHcGZmLRmhPwACqhfTcOmnA==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hasBin: true dependencies: '@npmcli/git': 4.1.0 '@npmcli/installed-package-contents': 2.1.0 @@ -3619,7 +3583,6 @@ packages: /prettier@3.3.3: resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} engines: {node: '>=14'} - hasBin: true dev: true /pretty-bytes@5.6.0: @@ -3693,7 +3656,6 @@ packages: /querystring@0.2.0: resolution: {integrity: sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==} engines: {node: '>=0.4.x'} - deprecated: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. dev: true /queue-microtask@1.2.3: @@ -3728,7 +3690,6 @@ packages: /read-package-json@6.0.4: resolution: {integrity: sha512-AEtWXYfopBj2z5N5PbkAOeNHRPUg5q+Nen7QLxV8M2zJq1ym6/lCz3fYNTCXe19puu2d06jfHhrP7v/S2PtMMw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - deprecated: This package is no longer supported. Please use @npmcli/package-json instead. dependencies: glob: 10.4.2 json-parse-even-better-errors: 3.0.2 @@ -3798,7 +3759,6 @@ packages: /readdir-scoped-modules@1.1.0: resolution: {integrity: sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==} - deprecated: This functionality has been moved to @npmcli/fs dependencies: debuglog: 1.0.1 dezalgo: 1.0.4 @@ -3842,7 +3802,6 @@ packages: /resolve@1.22.8: resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} - hasBin: true dependencies: is-core-module: 2.14.0 path-parse: 1.0.7 @@ -3873,8 +3832,6 @@ packages: /rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported - hasBin: true dependencies: glob: 7.2.3 dev: true @@ -3928,12 +3885,10 @@ packages: /semver@5.7.1: resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} - hasBin: true /semver@7.6.2: resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} engines: {node: '>=10'} - hasBin: true /set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} @@ -3980,7 +3935,6 @@ packages: /shelljs@0.8.5: resolution: {integrity: sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==} engines: {node: '>=4'} - hasBin: true dependencies: glob: 7.2.3 interpret: 1.4.0 @@ -3998,7 +3952,6 @@ packages: /sigstore@1.9.0: resolution: {integrity: sha512-0Zjz0oe37d08VeOtBIuB6cRriqXse2e8w+7yIy2XSXjshRKxbc2KkhXjL229jXSxEm7UbcjS76wcJDGQddVI9A==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hasBin: true dependencies: '@sigstore/bundle': 1.1.0 '@sigstore/protobuf-specs': 0.2.1 @@ -4340,7 +4293,6 @@ packages: /tree-kill@1.2.2: resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} - hasBin: true dev: true /treeverse@1.0.4: @@ -4349,7 +4301,6 @@ packages: /ts-node@10.9.2(@types/node@20.14.9)(typescript@5.1.3): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} - hasBin: true peerDependencies: '@swc/core': '>=1.2.50' '@swc/wasm': '>=1.2.50' @@ -4512,7 +4463,6 @@ packages: /uuid@8.0.0: resolution: {integrity: sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==} - hasBin: true dev: true /v8-compile-cache-lib@3.0.1: @@ -4601,7 +4551,6 @@ packages: /which@1.3.1: resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} - hasBin: true dependencies: isexe: 2.0.0 @@ -4615,7 +4564,6 @@ packages: /which@3.0.1: resolution: {integrity: sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - hasBin: true dependencies: isexe: 2.0.0 dev: true @@ -4746,7 +4694,6 @@ packages: /yeoman-environment@3.19.3: resolution: {integrity: sha512-/+ODrTUHtlDPRH9qIC0JREH8+7nsRcjDl3Bxn2Xo/rvAaVvixH5275jHwg0C85g4QsF4P6M2ojfScPPAl+pLAg==} engines: {node: '>=12.10.0'} - hasBin: true dependencies: '@npmcli/arborist': 4.3.1 are-we-there-yet: 2.0.0 @@ -4834,7 +4781,6 @@ packages: /yosay@2.0.2: resolution: {integrity: sha512-avX6nz2esp7IMXGag4gu6OyQBsMh/SEn+ZybGu3yKPlOTE6z9qJrzG/0X5vCq/e0rPFy0CUYCze0G5hL310ibA==} engines: {node: '>=4'} - hasBin: true dependencies: ansi-regex: 2.1.1 ansi-styles: 3.2.1 diff --git a/kipper/core/pnpm-lock.yaml b/kipper/core/pnpm-lock.yaml index 179c4e427..5b76e2ef3 100644 --- a/kipper/core/pnpm-lock.yaml +++ b/kipper/core/pnpm-lock.yaml @@ -241,7 +241,6 @@ packages: /prettier@3.3.3: resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} engines: {node: '>=14'} - hasBin: true dev: true /queue-microtask@1.2.3: diff --git a/kipper/target-js/pnpm-lock.yaml b/kipper/target-js/pnpm-lock.yaml index 2b373210f..988078785 100644 --- a/kipper/target-js/pnpm-lock.yaml +++ b/kipper/target-js/pnpm-lock.yaml @@ -32,7 +32,6 @@ packages: /prettier@3.3.3: resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} engines: {node: '>=14'} - hasBin: true dev: true /tslib@2.6.2: diff --git a/kipper/target-ts/pnpm-lock.yaml b/kipper/target-ts/pnpm-lock.yaml index 16e3e9dc2..a140032c6 100644 --- a/kipper/target-ts/pnpm-lock.yaml +++ b/kipper/target-ts/pnpm-lock.yaml @@ -35,7 +35,6 @@ packages: /prettier@3.3.3: resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} engines: {node: '>=14'} - hasBin: true dev: true /tslib@2.6.2: diff --git a/kipper/web/pnpm-lock.yaml b/kipper/web/pnpm-lock.yaml index 1558af509..c85e80731 100644 --- a/kipper/web/pnpm-lock.yaml +++ b/kipper/web/pnpm-lock.yaml @@ -923,7 +923,6 @@ packages: /prettier@3.3.3: resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} engines: {node: '>=14'} - hasBin: true dev: true /process-nextick-args@2.0.1: diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2e3638bbd..9ab144053 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1318,7 +1318,6 @@ packages: /coverage-badge-creator@1.0.19: resolution: {integrity: sha512-D49WcKmhusMp0KtdINdiDW4VzTAKWv3IHFr/jLwsKtvnFgXj+uuu6Td+XcrsXVUfThkueU1cZxWluJexcOaiXA==} - hasBin: true dev: true /create-ecdh@4.0.4: @@ -2909,7 +2908,6 @@ packages: /prettier@3.3.3: resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} engines: {node: '>=14'} - hasBin: true dev: true /process-nextick-args@2.0.1: @@ -3429,7 +3427,6 @@ packages: /ts-mocha@10.0.0(mocha@10.6.0): resolution: {integrity: sha512-VRfgDO+iiuJFlNB18tzOfypJ21xn2xbuZyDvJvqpTbWgkAgD17ONGr8t+Tl8rcBtOBdjXp5e/Rk+d39f7XBHRw==} engines: {node: '>= 6.X.X'} - hasBin: true peerDependencies: mocha: ^3.X.X || ^4.X.X || ^5.X.X || ^6.X.X || ^7.X.X || ^8.X.X || ^9.X.X || ^10.X.X dependencies: @@ -3441,7 +3438,6 @@ packages: /ts-node@10.9.2(@types/node@18.16.16)(typescript@5.1.3): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} - hasBin: true peerDependencies: '@swc/core': '>=1.2.50' '@swc/wasm': '>=1.2.50' @@ -3591,7 +3587,6 @@ packages: /update-browserslist-db@1.0.13(browserslist@4.23.0): resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} - hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: From 01005958da6d5bc5a1e3b4a54a321d9b64a6858e Mon Sep 17 00:00:00 2001 From: Luna-Klatzer Date: Wed, 17 Jul 2024 10:23:35 +0200 Subject: [PATCH 57/57] Release 0.12.0-alpha.0 --- kipper/cli/README.md | 33 +++++++++++--------------- kipper/cli/package.json | 44 +++++++++++++++++------------------ kipper/config/package.json | 2 +- kipper/core/package.json | 2 +- kipper/target-js/package.json | 2 +- kipper/target-ts/package.json | 2 +- kipper/web/package.json | 2 +- package.json | 2 +- 8 files changed, 42 insertions(+), 47 deletions(-) diff --git a/kipper/cli/README.md b/kipper/cli/README.md index 05acf655d..a850d6ef4 100644 --- a/kipper/cli/README.md +++ b/kipper/cli/README.md @@ -22,10 +22,9 @@ and the [Kipper website](https://kipper-lang.org)._ [![DOI](https://zenodo.org/badge/411260595.svg)](https://zenodo.org/badge/latestdoi/411260595) - -- [Kipper CLI - `@kipper/cli` 🦊✨](#kipper-cli---kippercli-) -- [Usage](#usage) -- [Commands](#commands) +* [Kipper CLI - `@kipper/cli` 🦊✨](#kipper-cli---kippercli-) +* [Usage](#usage) +* [Commands](#commands) ## General Information @@ -40,30 +39,27 @@ and the [Kipper website](https://kipper-lang.org)._ # Usage - ```sh-session $ npm install -g @kipper/cli $ kipper COMMAND running command... $ kipper (--version) -@kipper/cli/0.11.0 linux-x64 node-v20.10.0 +@kipper/cli/0.12.0-alpha.0 linux-x64 node-v20.10.0 $ kipper --help [COMMAND] USAGE $ kipper COMMAND ... ``` - # Commands - -- [`kipper compile [FILE]`](#kipper-compile-file) -- [`kipper help [COMMAND]`](#kipper-help-command) -- [`kipper new [LOCATION]`](#kipper-new-location) -- [`kipper run [FILE]`](#kipper-run-file) -- [`kipper version`](#kipper-version) +* [`kipper compile [FILE]`](#kipper-compile-file) +* [`kipper help [COMMAND]`](#kipper-help-command) +* [`kipper new [LOCATION]`](#kipper-new-location) +* [`kipper run [FILE]`](#kipper-run-file) +* [`kipper version`](#kipper-version) ## `kipper compile [FILE]` @@ -115,7 +111,7 @@ EXAMPLES kipper compile -t ts ./path/to/file.kip -o build/ -e utf16le --warnings --log-timestamp ``` -_See code: [src/commands/compile.ts](https://github.com/Kipper-Lang/Kipper/blob/v0.11.0/kipper/cli/src/commands/compile.ts)_ +_See code: [src/commands/compile.ts](https://github.com/Kipper-Lang/Kipper/blob/v0.12.0-alpha.0/kipper/cli/src/commands/compile.ts)_ ## `kipper help [COMMAND]` @@ -132,7 +128,7 @@ OPTIONS --all see all commands in CLI ``` -_See code: [src/commands/help.ts](https://github.com/Kipper-Lang/Kipper/blob/v0.11.0/kipper/cli/src/commands/help.ts)_ +_See code: [src/commands/help.ts](https://github.com/Kipper-Lang/Kipper/blob/v0.12.0-alpha.0/kipper/cli/src/commands/help.ts)_ ## `kipper new [LOCATION]` @@ -149,7 +145,7 @@ OPTIONS -d, --default Use the default settings for the new project. Skips the setup wizard. ``` -_See code: [src/commands/new.ts](https://github.com/Kipper-Lang/Kipper/blob/v0.11.0/kipper/cli/src/commands/new.ts)_ +_See code: [src/commands/new.ts](https://github.com/Kipper-Lang/Kipper/blob/v0.12.0-alpha.0/kipper/cli/src/commands/new.ts)_ ## `kipper run [FILE]` @@ -194,7 +190,7 @@ EXAMPLES kipper run -t ts -o build/ -e utf8 -s "print('Hello, World!');" --warnings --log-timestamp ``` -_See code: [src/commands/run.ts](https://github.com/Kipper-Lang/Kipper/blob/v0.11.0/kipper/cli/src/commands/run.ts)_ +_See code: [src/commands/run.ts](https://github.com/Kipper-Lang/Kipper/blob/v0.12.0-alpha.0/kipper/cli/src/commands/run.ts)_ ## `kipper version` @@ -205,8 +201,7 @@ USAGE $ kipper version ``` -_See code: [src/commands/version.ts](https://github.com/Kipper-Lang/Kipper/blob/v0.11.0/kipper/cli/src/commands/version.ts)_ - +_See code: [src/commands/version.ts](https://github.com/Kipper-Lang/Kipper/blob/v0.12.0-alpha.0/kipper/cli/src/commands/version.ts)_ ## Contributing to Kipper diff --git a/kipper/cli/package.json b/kipper/cli/package.json index 284d3f3f9..c04370b19 100644 --- a/kipper/cli/package.json +++ b/kipper/cli/package.json @@ -1,11 +1,11 @@ { "name": "@kipper/cli", "description": "The Kipper Command Line Interface (CLI).", - "version": "0.11.0", + "version": "0.12.0-alpha.0", "author": "Luna-Klatzer @Luna-Klatzer", "bin": { "kipper": "./bin/run", - "kip": "./bin/run" + "kip": "./bin/run" }, "dependencies": { "@kipper/config": "workspace:~", @@ -13,40 +13,40 @@ "@kipper/target-js": "workspace:~", "@kipper/target-ts": "workspace:~", "@oclif/command": "1.8.36", - "@oclif/config": "1.18.17", + "@oclif/config": "1.18.17", "@oclif/plugin-help": "3.3.1", "@oclif/parser": "3.8.17", "@oclif/errors": "1.3.6", - "@oclif/plugin-warn-if-update-available": "2.0.37", - "tslib": "~2.6.2", - "tslog": "3.3.4", - "ts-node": "10.9.2", - "chalk": "4.1.2", - "inquirer": "7.3.3" + "@oclif/plugin-warn-if-update-available": "2.0.37", + "tslib": "~2.6.2", + "tslog": "3.3.4", + "ts-node": "10.9.2", + "chalk": "4.1.2", + "inquirer": "7.3.3" }, "devDependencies": { "@types/node": "20.14.9", "@types/sinon": "17.0.3", - "@types/inquirer": "7.3.3", - "@sinonjs/fake-timers": "11.2.2", - "@oclif/test": "2.5.6", - "json-parse-even-better-errors": "3.0.2", + "@types/inquirer": "7.3.3", + "@sinonjs/fake-timers": "11.2.2", + "@oclif/test": "2.5.6", + "json-parse-even-better-errors": "3.0.2", "ts-node": "10.9.2", - "copyfiles": "2.4.1", + "copyfiles": "2.4.1", "rimraf": "5.0.7", "os-tmpdir": "2.0.0", "pseudomap": "1.0.2", "typescript": "5.1.3", - "@oclif/core": "1.26.2", + "@oclif/core": "1.26.2", "oclif": "3.4.6", "semver": "7.6.2", - "prettier": "3.3.3" - }, - "overrides": { - "pnpm": { - "@oclif/core": "$@oclif/core" - } - }, + "prettier": "3.3.3" + }, + "overrides": { + "pnpm": { + "@oclif/core": "$@oclif/core" + } + }, "engines": { "node": "16.x || 18.x || 20.x || 22.x", "pnpm": "8" diff --git a/kipper/config/package.json b/kipper/config/package.json index 0dfe724b0..38f74a7da 100644 --- a/kipper/config/package.json +++ b/kipper/config/package.json @@ -1,7 +1,7 @@ { "name": "@kipper/config", "description": "The config file support package adding support for kip-config.json/kipper-config.json 🦊", - "version": "0.11.0", + "version": "0.12.0-alpha.0", "author": "Luna-Klatzer @Luna-Klatzer", "dependencies": { "is-plain-object": "5.0.0", diff --git a/kipper/core/package.json b/kipper/core/package.json index 66d8f6a96..6ce4962c5 100644 --- a/kipper/core/package.json +++ b/kipper/core/package.json @@ -1,7 +1,7 @@ { "name": "@kipper/core", "description": "The core implementation of the Kipper compiler 🦊", - "version": "0.11.0", + "version": "0.12.0-alpha.0", "author": "Luna-Klatzer @Luna-Klatzer", "dependencies": { "antlr4ts": "^0.5.0-alpha.4", diff --git a/kipper/target-js/package.json b/kipper/target-js/package.json index 3dc7f7899..fa1619ded 100644 --- a/kipper/target-js/package.json +++ b/kipper/target-js/package.json @@ -1,7 +1,7 @@ { "name": "@kipper/target-js", "description": "The JavaScript target for the Kipper compiler 🦊", - "version": "0.11.0", + "version": "0.12.0-alpha.0", "author": "Luna-Klatzer @Luna-Klatzer", "dependencies": { "@kipper/core": "workspace:~", diff --git a/kipper/target-ts/package.json b/kipper/target-ts/package.json index 24b505906..f745c3e34 100644 --- a/kipper/target-ts/package.json +++ b/kipper/target-ts/package.json @@ -1,7 +1,7 @@ { "name": "@kipper/target-ts", "description": "The TypeScript target for the Kipper compiler 🦊", - "version": "0.11.0", + "version": "0.12.0-alpha.0", "author": "Luna-Klatzer @Luna-Klatzer", "dependencies": { "@kipper/target-js": "workspace:~", diff --git a/kipper/web/package.json b/kipper/web/package.json index 5b792af48..756a6b0d0 100644 --- a/kipper/web/package.json +++ b/kipper/web/package.json @@ -1,7 +1,7 @@ { "name": "@kipper/web", "description": "The standalone web-module for the Kipper compiler 🦊", - "version": "0.11.0", + "version": "0.12.0-alpha.0", "author": "Luna-Klatzer @Luna-Klatzer", "devDependencies": { "@kipper/target-js": "workspace:~", diff --git a/package.json b/package.json index 6b4e73b87..09bed61dc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "kipper", "description": "The Kipper programming language and compiler 🦊", - "version": "0.11.0", + "version": "0.12.0-alpha.0", "author": "Luna-Klatzer @Luna-Klatzer", "dependencies": { "@kipper/cli": "workspace:~",