/** * Antlr4 listener for walking through a parser tree and processing its content. * @since 0.0.3 */ import type { ASTDeclarationKind, ASTExpressionKind, ASTNodeParserContext, ASTStatementKind, ParserDeclarationContext, ParserExpressionContext, ParserStatementContext, } from "./common"; import type { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener"; import type { ActualAdditiveExpressionContext, ActualAssignmentExpressionContext, ActualBitwiseAndExpressionContext, ActualBitwiseOrExpressionContext, ActualBitwiseShiftExpressionContext, ActualBitwiseXorExpressionContext, ActualCastOrConvertExpressionContext, ActualConditionalExpressionContext, ActualEqualityExpressionContext, ActualLogicalAndExpressionContext, ActualLogicalOrExpressionContext, ActualMultiplicativeExpressionContext, ActualRelationalExpressionContext, ArrayPrimaryExpressionContext, BoolPrimaryExpressionContext, BracketNotationMemberAccessExpressionContext, ClassConstructorDeclarationContext, ClassDeclarationContext, ClassMethodDeclarationContext, ClassPropertyDeclarationContext, CompilationUnitContext, CompoundStatementContext, DeclarationContext, DeclaratorContext, DirectDeclaratorContext, DotNotationMemberAccessExpressionContext, DoWhileLoopIterationStatementContext, ExplicitCallFunctionCallExpressionContext, ExpressionContext, ExpressionStatementContext, ExternalItemContext, ForLoopIterationStatementContext, FStringPrimaryExpressionContext, FunctionCallExpressionContext, FunctionDeclarationContext, GenericTypeSpecifierExpressionContext, IdentifierPrimaryExpressionContext, IdentifierTypeSpecifierExpressionContext, IfStatementContext, IncrementOrDecrementPostfixExpressionContext, IncrementOrDecrementUnaryExpressionContext, InitDeclaratorContext, InitializerContext, InstanceOfExpressionContext, InterfaceDeclarationContext, InterfaceMethodDeclarationContext, InterfacePropertyDeclarationContext, JumpStatementContext, KipperParserListener, KipperParserRuleContext, LambdaPrimaryExpressionContext, LogicalAndExpressionContext, MatchesExpressionContext, NewInstantiationExpressionContext, NumberPrimaryExpressionContext, ObjectPrimaryExpressionContext, ObjectPropertyContext, OperatorModifiedUnaryExpressionContext, ParameterDeclarationContext, ParameterListContext, PassOnLogicalAndExpressionContext, ReturnStatementContext, SliceNotationMemberAccessExpressionContext, StorageTypeSpecifierContext, StringPrimaryExpressionContext, SwitchLabeledStatementContext, SwitchStatementContext, TangledPrimaryExpressionContext, TypeofExpressionContext, TypeofTypeSpecifierExpressionContext, TypeSpecifierExpressionContext, VariableDeclarationContext, VoidOrNullOrUndefinedPrimaryExpressionContext, WhileLoopIterationStatementContext, } from "../lexer-parser"; import type { KipperProgramContext } from "../program-ctx"; import type { CompilableASTNode } from "./compilable-ast-node"; import type { ParserRuleContext } from "antlr4ts/ParserRuleContext"; import { Declaration, Expression, RootASTNode, Statement } from "./nodes"; import { DeclarationASTNodeFactory, ExpressionASTNodeFactory, StatementASTNodeFactory } from "./factories"; import { KipperInternalError } from "../../errors"; /** * The AST generator, which acts as a listener for a {@link KipperProgramContext}, which walks through a parse tree * generated by the {@link KipperParser} and generates an abstract syntax tree based on the parse tree. * @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`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterDotNotationMemberAccessExpression: (ctx: DotNotationMemberAccessExpressionContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by the `dotNotationMemberAccessExpression` * Labeled alternative in `KipperParser.computedPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitDotNotationMemberAccessExpression: (ctx: DotNotationMemberAccessExpressionContext) => void = this.handleExitingTreeNode; /** * Enter a parse tree produced by the `bracketNotationMemberAccessExpression` * Labeled alternative in `KipperParser.computedPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterBracketNotationMemberAccessExpression: (ctx: BracketNotationMemberAccessExpressionContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by the `bracketNotationMemberAccessExpression` * Labeled alternative in `KipperParser.computedPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitBracketNotationMemberAccessExpression: (ctx: BracketNotationMemberAccessExpressionContext) => void = this.handleExitingTreeNode; /** * Enter a parse tree produced by the `sliceNotationMemberAccessExpression` * Labeled alternative in `KipperParser.computedPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}).. */ public enterSliceNotationMemberAccessExpression: (ctx: SliceNotationMemberAccessExpressionContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by the `sliceNotationMemberAccessExpression` * Labeled alternative in `KipperParser.computedPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ 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`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}).. */ public enterExplicitCallFunctionCallExpression: (ctx: ExplicitCallFunctionCallExpressionContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by the `explicitCallFunctionCallExpression` * Labeled alternative in `KipperParser.computedPrimaryExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}).. */ 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`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterActualCastOrConvertExpression: (ctx: ActualCastOrConvertExpressionContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by the `actualCastOrConvertExpression` * labeled alternative in `KipperParser.castOrConvertExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ 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`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterActualMultiplicativeExpression: (ctx: ActualMultiplicativeExpressionContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by the `actualMultiplicativeExpression` * Labeled alternative in `KipperParser.multiplicativeExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitActualMultiplicativeExpression: (ctx: ActualMultiplicativeExpressionContext) => void = this.handleExitingTreeNode; // 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; /** * Enter a parse tree produced by `KipperParser.instanceOfExpression`. */ public enterActualInstanceOfExpression: (ctx: InstanceOfExpressionContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by `KipperParser.instanceOfExpression`. */ public exitActualInstanceOfExpression: (ctx: InstanceOfExpressionContext) => 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`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterActualRelationalExpression: (ctx: ActualRelationalExpressionContext) => void = this.handleEnteringTreeNode; /** * 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 `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 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 the `actualLogicalAndExpression` * Labeled alternative in `KipperParser.logicalAndExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ 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; /** * 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; /** * 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; /** * Exit a parse tree produced by the KipperParser.bitwiseShiftExpression */ public exitActualBitwiseShiftExpression: (ctx: ActualBitwiseShiftExpressionContext) => void = this.handleExitingTreeNode; /** * Enter a parse tree produced by the KipperParser.typeofExpression */ public enterTypeofExpression: (ctx: TypeofExpressionContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by the KipperParser.typeofExpression */ public exitTypeofExpression: (ctx: TypeofExpressionContext) => void = this.handleExitingTreeNode; /** * Enter a parse tree produced by the KipperParser.matchesExpression */ public enterActualMatchesExpression: (ctx: MatchesExpressionContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by the KipperParser.matchesExpression */ public exitActualMatchesExpression: (ctx: MatchesExpressionContext) => 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`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterActualConditionalExpression: (ctx: ActualConditionalExpressionContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by the `actualConditionalExpression` * Labeled alternative in `KipperParser.conditionalExpression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ 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`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterActualAssignmentExpression: (ctx: ActualAssignmentExpressionContext) => void = this.handleEnteringTreeNode; /** * 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.expression`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ 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 '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; /** * 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`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterSwitchStatement: (ctx: SwitchStatementContext) => void = this.handleEnteringTreeNode; /** * 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 */ public enterDoWhileLoopIterationStatement: (ctx: DoWhileLoopIterationStatementContext) => void = this.handleEnteringTreeNode; /** * 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; /** * 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; /** * 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.interfaceDeclaration`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterInterfaceDeclaration: (ctx: InterfaceDeclarationContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by `KipperParser.interfaceDeclaration`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitInterfaceDeclaration: (ctx: InterfaceDeclarationContext) => void = this.handleExitingTreeNode; /** * Enter a parse tree produced by `KipperParser.interfacePropertyDeclaration`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterInterfacePropertyDeclaration: (ctx: InterfacePropertyDeclarationContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by `KipperParser.interfacePropertyDeclaration`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitInterfacePropertyDeclaration: (ctx: InterfacePropertyDeclarationContext) => void = this.handleExitingTreeNode; /** * Enter a parse tree produced by `KipperParser.interfaceMethodDeclaration`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterInterfaceMethodDeclaration: (ctx: InterfaceMethodDeclarationContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by `KipperParser.interfaceMethodDeclaration`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitInterfaceMethodDeclaration: (ctx: InterfaceMethodDeclarationContext) => 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; /** * Enter a parse tree produced by `KipperParser.newInstantiationExpression`. */ public enterNewInstantiationExpression: (ctx: NewInstantiationExpressionContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by `KipperParser.newInstantiationExpression`. */ public exitNewInstantiationExpression: (ctx: NewInstantiationExpressionContext) => void = this.handleExitingTreeNode; /** * Enter a parse tree produced by `KipperParser.classProperty`. */ public enterClassPropertyDeclaration: (ctx: ClassPropertyDeclarationContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by `KipperParser.classProperty`. */ public exitClassPropertyDeclaration: (ctx: ClassPropertyDeclarationContext) => void = this.handleExitingTreeNode; /** * Enter a parse tree produced by `KipperParser.classMethod`. */ public enterClassMethodDeclaration: (ctx: ClassMethodDeclarationContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by `KipperParser.classMethod`. */ public exitClassMethodDeclaration: (ctx: ClassMethodDeclarationContext) => void = this.handleExitingTreeNode; /** * Enter a parse tree produced by `KipperParser.classConstructor`. */ public enterClassConstructorDeclaration: (ctx: ClassConstructorDeclarationContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by `KipperParser.classConstructor`. */ public exitClassConstructorDeclaration: (ctx: ClassConstructorDeclarationContext) => void = this.handleExitingTreeNode; // ------------------------------------------------------------------------------------------------------------------- // Other // ------------------------------------------------------------------------------------------------------------------- /** * Enter a parse tree produced by `KipperParser.storageTypeSpecifier`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterStorageTypeSpecifier?(ctx: StorageTypeSpecifierContext): void; /** * Exit a parse tree produced by `KipperParser.storageTypeSpecifier`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitStorageTypeSpecifier?(ctx: StorageTypeSpecifierContext): void; /** * Enter a parse tree produced by `KipperParser.initDeclarator`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterInitDeclarator?(ctx: InitDeclaratorContext): void; /** * Exit a parse tree produced by `KipperParser.initDeclarator`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitInitDeclarator?(ctx: InitDeclaratorContext): void; /** * Enter a parse tree produced by `KipperParser.identifierTypeSpecifier`. * @param ctx the parse tree */ public enterIdentifierTypeSpecifierExpression: (ctx: IdentifierTypeSpecifierExpressionContext) => void = this.handleEnteringTreeNode; /** * 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 */ public enterGenericTypeSpecifierExpression: (ctx: GenericTypeSpecifierExpressionContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by `KipperParser.genericTypeSpecifier`. * @param ctx the parse tree */ public exitGenericTypeSpecifierExpression: (ctx: GenericTypeSpecifierExpressionContext) => void = this.handleExitingTreeNode; /** * Enter a parse tree produced by `KipperParser.typeofTypeSpecifier`. * @param ctx the parse tree */ public enterTypeofTypeSpecifierExpression: (ctx: TypeofTypeSpecifierExpressionContext) => void = this.handleEnteringTreeNode; /** * Exit a parse tree produced by `KipperParser.typeofTypeSpecifier`. * @param ctx the parse tree */ public exitTypeofTypeSpecifierExpression: (ctx: TypeofTypeSpecifierExpressionContext) => void = this.handleExitingTreeNode; /** * Enter a parse tree produced by `KipperParser.typeSpecifier`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterTypeSpecifierExpression?(ctx: TypeSpecifierExpressionContext): void; /** * Exit a parse tree produced by `KipperParser.typeSpecifier`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitTypeSpecifierExpression?(ctx: TypeSpecifierExpressionContext): void; /** * Enter a parse tree produced by `KipperParser.declarator`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterDeclarator?(ctx: DeclaratorContext): void; /** * Exit a parse tree produced by `KipperParser.declarator`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitDeclarator?(ctx: DeclaratorContext): void; /** * Enter a parse tree produced by `KipperParser.directDeclarator`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterDirectDeclarator?(ctx: DirectDeclaratorContext): void; /** * Exit a parse tree produced by `KipperParser.directDeclarator`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitDirectDeclarator?(ctx: DirectDeclaratorContext): void; /** * Enter a parse tree produced by `KipperParser.parameterList`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterParameterList?(ctx: ParameterListContext): void; // Unspecific parent -> skip /** * Exit a parse tree produced by `KipperParser.parameterList`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitParameterList?(ctx: ParameterListContext): void; // Unspecific parent -> skip /** * Enter a parse tree produced by `KipperParser.initializer`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public enterInitializer?(ctx: InitializerContext): void; // Unspecific parent -> skip /** * Exit a parse tree produced by `KipperParser.initializer`. * @param ctx The parse tree (instance of {@link KipperParserRuleContext}). */ public exitInitializer?(ctx: InitializerContext): void; // Unspecific parent -> skip }