From acda95b596b667215356cc807d0c0aec9286e878 Mon Sep 17 00:00:00 2001 From: Alexander Milster Date: Tue, 11 Jul 2023 10:29:02 +0200 Subject: [PATCH] Simplified names for map functions in AbstractAntlrListener.java --- .../de/jplag/antlr/AbstractAntlrListener.java | 37 ++++---- .../antlr/testLanguage/TestListener.java | 13 ++- .../main/java/de/jplag/cpp2/CPPListener.java | 72 ++++++++-------- .../java/de/jplag/kotlin/KotlinListener.java | 86 +++++++++---------- 4 files changed, 102 insertions(+), 106 deletions(-) diff --git a/language-antlr-utils/src/main/java/de/jplag/antlr/AbstractAntlrListener.java b/language-antlr-utils/src/main/java/de/jplag/antlr/AbstractAntlrListener.java index 96fba3959..b80fdde6a 100644 --- a/language-antlr-utils/src/main/java/de/jplag/antlr/AbstractAntlrListener.java +++ b/language-antlr-utils/src/main/java/de/jplag/antlr/AbstractAntlrListener.java @@ -94,8 +94,8 @@ public void exitEveryRule(ParserRuleContext rule) { * @param The type of {@link ParserRuleContext} * @return The builder for the token */ - protected ContextTokenBuilder createStartMapping(Class antlrType, TokenType jplagType) { - return this.createStartMapping(antlrType, jplagType, it -> true); + protected ContextTokenBuilder mapEnter(Class antlrType, TokenType jplagType) { + return this.mapEnter(antlrType, jplagType, it -> true); } /** @@ -107,8 +107,7 @@ protected ContextTokenBuilder createStartMappin * @return The builder for the token */ @SuppressWarnings("unchecked") - protected ContextTokenBuilder createStartMapping(Class antlrType, TokenType jplagType, - Predicate condition) { + protected ContextTokenBuilder mapEnter(Class antlrType, TokenType jplagType, Predicate condition) { ContextTokenBuilder builder = initTypeBuilder(antlrType, jplagType, condition, ContextTokenBuilderType.START); this.startMappings.add((ContextTokenBuilder) builder); return builder; @@ -121,8 +120,8 @@ protected ContextTokenBuilder createStartMappin * @param The type of {@link ParserRuleContext} * @return The builder for the token */ - protected ContextTokenBuilder createStopMapping(Class antlrType, TokenType jplagType) { - return this.createStopMapping(antlrType, jplagType, it -> true); + protected ContextTokenBuilder mapExit(Class antlrType, TokenType jplagType) { + return this.mapExit(antlrType, jplagType, it -> true); } /** @@ -134,8 +133,7 @@ protected ContextTokenBuilder createStopMapping * @return The builder for the token */ @SuppressWarnings("unchecked") - protected ContextTokenBuilder createStopMapping(Class antlrType, TokenType jplagType, - Predicate condition) { + protected ContextTokenBuilder mapExit(Class antlrType, TokenType jplagType, Predicate condition) { ContextTokenBuilder builder = initTypeBuilder(antlrType, jplagType, condition, ContextTokenBuilderType.STOP); this.endMappings.add((ContextTokenBuilder) builder); return builder; @@ -149,8 +147,8 @@ protected ContextTokenBuilder createStopMapping * @param The type of {@link ParserRuleContext} * @return The builder for the token */ - protected ContextTokenBuilder createRangeMapping(Class antlrType, TokenType jplagType) { - return this.createRangeMapping(antlrType, jplagType, it -> true); + protected ContextTokenBuilder mapRange(Class antlrType, TokenType jplagType) { + return this.mapRange(antlrType, jplagType, it -> true); } /** @@ -163,8 +161,7 @@ protected ContextTokenBuilder createRangeMappin * @return The builder for the token */ @SuppressWarnings("unchecked") - protected ContextTokenBuilder createRangeMapping(Class antlrType, TokenType jplagType, - Predicate condition) { + protected ContextTokenBuilder mapRange(Class antlrType, TokenType jplagType, Predicate condition) { ContextTokenBuilder builder = initTypeBuilder(antlrType, jplagType, condition, ContextTokenBuilderType.RANGE); this.rangeMappings.add((ContextTokenBuilder) builder); return builder; @@ -178,8 +175,8 @@ protected ContextTokenBuilder createRangeMappin * @param The type of {@link ParserRuleContext} * @return The builder for the token */ - protected RangeBuilder createStartStopMapping(Class antlrType, TokenType startType, TokenType stopType) { - return createStartStopMapping(antlrType, startType, stopType, it -> true); + protected RangeBuilder mapEnterExit(Class antlrType, TokenType startType, TokenType stopType) { + return mapEnterExit(antlrType, startType, stopType, it -> true); } /** @@ -191,10 +188,10 @@ protected RangeBuilder createStartStopMapping(C * @param The type of {@link ParserRuleContext} * @return The builder for the token */ - protected RangeBuilder createStartStopMapping(Class antlrType, TokenType startType, TokenType stopType, + protected RangeBuilder mapEnterExit(Class antlrType, TokenType startType, TokenType stopType, Predicate condition) { - ContextTokenBuilder start = this.createStartMapping(antlrType, startType, condition); - ContextTokenBuilder end = this.createStopMapping(antlrType, stopType, condition); + ContextTokenBuilder start = this.mapEnter(antlrType, startType, condition); + ContextTokenBuilder end = this.mapExit(antlrType, stopType, condition); return new RangeBuilder<>(start, end); } @@ -204,8 +201,8 @@ protected RangeBuilder createStartStopMapping(C * @param jplagType The jplag token type * @return The builder for the token */ - protected TerminalTokenBuilder createTerminalMapping(int terminalType, TokenType jplagType) { - return this.createTerminalMapping(terminalType, jplagType, it -> true); + protected TerminalTokenBuilder mapTerminal(int terminalType, TokenType jplagType) { + return this.mapTerminal(terminalType, jplagType, it -> true); } /** @@ -215,7 +212,7 @@ protected TerminalTokenBuilder createTerminalMapping(int terminalType, TokenType * @param condition The condition under which the mapping applies * @return The builder for the token */ - protected TerminalTokenBuilder createTerminalMapping(int terminalType, TokenType jplagType, Predicate condition) { + protected TerminalTokenBuilder mapTerminal(int terminalType, TokenType jplagType, Predicate condition) { TerminalTokenBuilder builder = new TerminalTokenBuilder(jplagType, token -> token.getType() == terminalType && condition.test(token), this.collector, this.currentFile); this.terminalMapping.add(builder); diff --git a/language-antlr-utils/src/test/java/de/jplag/antlr/testLanguage/TestListener.java b/language-antlr-utils/src/test/java/de/jplag/antlr/testLanguage/TestListener.java index 37a936df6..49d30b023 100644 --- a/language-antlr-utils/src/test/java/de/jplag/antlr/testLanguage/TestListener.java +++ b/language-antlr-utils/src/test/java/de/jplag/antlr/testLanguage/TestListener.java @@ -20,17 +20,16 @@ public class TestListener extends AbstractAntlrListener { public TestListener(TokenCollector collector, File currentFile) { super(collector, currentFile, true); - createStartMapping(VarDefContext.class, VARDEF).addAsVariable(VariableScope.FILE, false, rule -> rule.VAR_NAME().getText()) + mapEnter(VarDefContext.class, VARDEF).addAsVariable(VariableScope.FILE, false, rule -> rule.VAR_NAME().getText()) .withSemantics(CodeSemantics.createKeep()); - createRangeMapping(CalcExpressionContext.class, ADDITION, rule -> rule.operator() != null && rule.operator().PLUS() != null) - .withControlSemantics(); - createRangeMapping(OperatorContext.class, SUBTRACTION, rule -> rule.MINUS() != null).withControlSemantics(); - createStartStopMapping(SubExpressionContext.class, SUB_EXPRESSION_BEGIN, SUB_EXPRESSION_END) + mapRange(CalcExpressionContext.class, ADDITION, rule -> rule.operator() != null && rule.operator().PLUS() != null).withControlSemantics(); + mapRange(OperatorContext.class, SUBTRACTION, rule -> rule.MINUS() != null).withControlSemantics(); + mapEnterExit(SubExpressionContext.class, SUB_EXPRESSION_BEGIN, SUB_EXPRESSION_END) // .addEndSemanticHandler(registry -> registry.addAllNonLocalVariablesAsReads()) // does not work here, because there is no class context. Is still here as an example. .addLocalScope().withControlSemantics(); - createTerminalMapping(TestParser.NUMBER, NUMBER).withSemantics(CodeSemantics.createKeep()); - createStartMapping(VarRefContext.class, VARREF).withSemantics(CodeSemantics.createKeep()); + mapTerminal(TestParser.NUMBER, NUMBER).withSemantics(CodeSemantics.createKeep()); + mapEnter(VarRefContext.class, VARREF).withSemantics(CodeSemantics.createKeep()); } } diff --git a/languages/cpp2/src/main/java/de/jplag/cpp2/CPPListener.java b/languages/cpp2/src/main/java/de/jplag/cpp2/CPPListener.java index 17ebe7046..90ef46b3b 100644 --- a/languages/cpp2/src/main/java/de/jplag/cpp2/CPPListener.java +++ b/languages/cpp2/src/main/java/de/jplag/cpp2/CPPListener.java @@ -24,50 +24,50 @@ public class CPPListener extends AbstractAntlrListener { public CPPListener(TokenCollector collector, File currentFile) { super(collector, currentFile); - createStartStopMapping(ClassSpecifierContext.class, UNION_BEGIN, UNION_END, rule -> rule.classHead().Union() != null); - createStartStopMapping(ClassSpecifierContext.class, CLASS_BEGIN, CLASS_END, + mapEnterExit(ClassSpecifierContext.class, UNION_BEGIN, UNION_END, rule -> rule.classHead().Union() != null); + mapEnterExit(ClassSpecifierContext.class, CLASS_BEGIN, CLASS_END, rule -> rule.classHead().classKey() != null && rule.classHead().classKey().Class() != null); - createStartStopMapping(ClassSpecifierContext.class, STRUCT_BEGIN, STRUCT_END, + mapEnterExit(ClassSpecifierContext.class, STRUCT_BEGIN, STRUCT_END, rule -> rule.classHead().classKey() != null && rule.classHead().classKey().Struct() != null); - createStartStopMapping(EnumSpecifierContext.class, ENUM_BEGIN, ENUM_END); + mapEnterExit(EnumSpecifierContext.class, ENUM_BEGIN, ENUM_END); - createStartStopMapping(FunctionDefinitionContext.class, FUNCTION_BEGIN, FUNCTION_END); + mapEnterExit(FunctionDefinitionContext.class, FUNCTION_BEGIN, FUNCTION_END); - createStartStopMapping(IterationStatementContext.class, DO_BEGIN, DO_END, rule -> rule.Do() != null); - createStartStopMapping(IterationStatementContext.class, FOR_BEGIN, FOR_END, rule -> rule.For() != null); - createStartStopMapping(IterationStatementContext.class, WHILE_BEGIN, WHILE_END, rule -> rule.While() != null && rule.Do() == null); + mapEnterExit(IterationStatementContext.class, DO_BEGIN, DO_END, rule -> rule.Do() != null); + mapEnterExit(IterationStatementContext.class, FOR_BEGIN, FOR_END, rule -> rule.For() != null); + mapEnterExit(IterationStatementContext.class, WHILE_BEGIN, WHILE_END, rule -> rule.While() != null && rule.Do() == null); - createStartStopMapping(SelectionStatementContext.class, SWITCH_BEGIN, SWITCH_END, rule -> rule.Switch() != null); - createStartStopMapping(SelectionStatementContext.class, IF_BEGIN, IF_END, rule -> rule.If() != null); - createTerminalMapping(CPP14Parser.Else, ELSE); + mapEnterExit(SelectionStatementContext.class, SWITCH_BEGIN, SWITCH_END, rule -> rule.Switch() != null); + mapEnterExit(SelectionStatementContext.class, IF_BEGIN, IF_END, rule -> rule.If() != null); + mapTerminal(CPP14Parser.Else, ELSE); - createStartMapping(LabeledStatementContext.class, CASE, rule -> rule.Case() != null); - createStartMapping(LabeledStatementContext.class, DEFAULT, rule -> rule.Default() != null); + mapEnter(LabeledStatementContext.class, CASE, rule -> rule.Case() != null); + mapEnter(LabeledStatementContext.class, DEFAULT, rule -> rule.Default() != null); - createStartMapping(TryBlockContext.class, TRY); - createStartStopMapping(HandlerContext.class, CATCH_BEGIN, CATCH_END); + mapEnter(TryBlockContext.class, TRY); + mapEnterExit(HandlerContext.class, CATCH_BEGIN, CATCH_END); - createStartMapping(JumpStatementContext.class, BREAK, rule -> rule.Break() != null); - createStartMapping(JumpStatementContext.class, CONTINUE, rule -> rule.Continue() != null); - createStartMapping(JumpStatementContext.class, GOTO, rule -> rule.Goto() != null); - createStartMapping(JumpStatementContext.class, RETURN, rule -> rule.Return() != null); + mapEnter(JumpStatementContext.class, BREAK, rule -> rule.Break() != null); + mapEnter(JumpStatementContext.class, CONTINUE, rule -> rule.Continue() != null); + mapEnter(JumpStatementContext.class, GOTO, rule -> rule.Goto() != null); + mapEnter(JumpStatementContext.class, RETURN, rule -> rule.Return() != null); - createStartMapping(ThrowExpressionContext.class, THROW); + mapEnter(ThrowExpressionContext.class, THROW); - createStartMapping(NewExpressionContext.class, NEWCLASS, rule -> rule.newInitializer() != null); - createStartMapping(NewExpressionContext.class, NEWARRAY, rule -> rule.newInitializer() == null); + mapEnter(NewExpressionContext.class, NEWCLASS, rule -> rule.newInitializer() != null); + mapEnter(NewExpressionContext.class, NEWARRAY, rule -> rule.newInitializer() == null); - createStartMapping(TemplateDeclarationContext.class, GENERIC); + mapEnter(TemplateDeclarationContext.class, GENERIC); - createStartMapping(AssignmentOperatorContext.class, ASSIGN); - createStartMapping(BraceOrEqualInitializerContext.class, ASSIGN, rule -> rule.Assign() != null); - createStartMapping(UnaryExpressionContext.class, ASSIGN, rule -> rule.PlusPlus() != null || rule.MinusMinus() != null); + mapEnter(AssignmentOperatorContext.class, ASSIGN); + mapEnter(BraceOrEqualInitializerContext.class, ASSIGN, rule -> rule.Assign() != null); + mapEnter(UnaryExpressionContext.class, ASSIGN, rule -> rule.PlusPlus() != null || rule.MinusMinus() != null); - createStartMapping(StaticAssertDeclarationContext.class, STATIC_ASSERT); - createStartMapping(EnumeratorDefinitionContext.class, VARDEF); - createStartStopMapping(BracedInitListContext.class, BRACED_INIT_BEGIN, BRACED_INIT_END); + mapEnter(StaticAssertDeclarationContext.class, STATIC_ASSERT); + mapEnter(EnumeratorDefinitionContext.class, VARDEF); + mapEnterExit(BracedInitListContext.class, BRACED_INIT_BEGIN, BRACED_INIT_END); - createStartMapping(SimpleTypeSpecifierContext.class, VARDEF, rule -> { + mapEnter(SimpleTypeSpecifierContext.class, VARDEF, rule -> { if (hasAncestor(rule, MemberdeclarationContext.class, FunctionDefinitionContext.class)) { return true; } @@ -82,7 +82,7 @@ public CPPListener(TokenCollector collector, File currentFile) { return false; }); - createStartMapping(SimpleDeclarationContext.class, APPLY, rule -> { + mapEnter(SimpleDeclarationContext.class, APPLY, rule -> { if (!hasAncestor(rule, FunctionBodyContext.class)) { return false; } @@ -91,12 +91,12 @@ public CPPListener(TokenCollector collector, File currentFile) { return noPointerInFunctionCallContext(noPointerDecl); }); - createStartMapping(InitDeclaratorContext.class, APPLY, rule -> rule.initializer() != null && rule.initializer().LeftParen() != null); - createStartMapping(ParameterDeclarationContext.class, VARDEF); - createStartMapping(ConditionalExpressionContext.class, QUESTIONMARK, rule -> rule.Question() != null); + mapEnter(InitDeclaratorContext.class, APPLY, rule -> rule.initializer() != null && rule.initializer().LeftParen() != null); + mapEnter(ParameterDeclarationContext.class, VARDEF); + mapEnter(ConditionalExpressionContext.class, QUESTIONMARK, rule -> rule.Question() != null); - createStartMapping(PostfixExpressionContext.class, APPLY, rule -> rule.LeftParen() != null); - createStartMapping(PostfixExpressionContext.class, ASSIGN, rule -> rule.PlusPlus() != null || rule.MinusMinus() != null); + mapEnter(PostfixExpressionContext.class, APPLY, rule -> rule.LeftParen() != null); + mapEnter(PostfixExpressionContext.class, ASSIGN, rule -> rule.PlusPlus() != null || rule.MinusMinus() != null); } /** diff --git a/languages/kotlin/src/main/java/de/jplag/kotlin/KotlinListener.java b/languages/kotlin/src/main/java/de/jplag/kotlin/KotlinListener.java index 432890600..bb308df61 100644 --- a/languages/kotlin/src/main/java/de/jplag/kotlin/KotlinListener.java +++ b/languages/kotlin/src/main/java/de/jplag/kotlin/KotlinListener.java @@ -103,49 +103,49 @@ public class KotlinListener extends AbstractAntlrListener { public KotlinListener(TokenCollector collector, File currentFile) { super(collector, currentFile); - this.createRangeMapping(PackageHeaderContext.class, PACKAGE); - this.createRangeMapping(ImportHeaderContext.class, IMPORT); - this.createStartMapping(ClassDeclarationContext.class, CLASS_DECLARATION); - this.createRangeMapping(ObjectDeclarationContext.class, OBJECT_DECLARATION); - this.createRangeMapping(CompanionObjectContext.class, COMPANION_DECLARATION); - this.createRangeMapping(TypeParameterContext.class, TYPE_PARAMETER); - this.createRangeMapping(PrimaryConstructorContext.class, CONSTRUCTOR); - this.createRangeMapping(ClassParameterContext.class, PROPERTY_DECLARATION); - this.createStartStopMapping(ClassBodyContext.class, CLASS_BODY_BEGIN, CLASS_BODY_END); - this.createStartStopMapping(EnumClassBodyContext.class, ENUM_CLASS_BODY_BEGIN, ENUM_CLASS_BODY_END); - this.createStartMapping(EnumEntryContext.class, ENUM_ENTRY); - this.createRangeMapping(SecondaryConstructorContext.class, CONSTRUCTOR); - this.createStartMapping(PropertyDeclarationContext.class, PROPERTY_DECLARATION); - this.createStartMapping(AnonymousInitializerContext.class, INITIALIZER); - this.createStartStopMapping(InitBlockContext.class, INITIALIZER_BODY_START, INITIALIZER_BODY_END); - this.createStartMapping(FunctionDeclarationContext.class, FUNCTION); - this.createStartMapping(GetterContext.class, GETTER); - this.createStartMapping(SetterContext.class, SETTER); - this.createRangeMapping(FunctionValueParameterContext.class, FUNCTION_PARAMETER); - this.createStartStopMapping(FunctionBodyContext.class, FUNCTION_BODY_BEGIN, FUNCTION_BODY_END); - this.createStartStopMapping(FunctionLiteralContext.class, FUNCTION_LITERAL_BEGIN, FUNCTION_LITERAL_END); - this.createStartStopMapping(ForExpressionContext.class, FOR_EXPRESSION_BEGIN, FOR_EXPRESSION_END); - this.createStartStopMapping(IfExpressionContext.class, IF_EXPRESSION_BEGIN, IF_EXPRESSION_END); - this.createStartStopMapping(WhileExpressionContext.class, WHILE_EXPRESSION_START, WHILE_EXPRESSION_END); - this.createStartStopMapping(DoWhileExpressionContext.class, DO_WHILE_EXPRESSION_START, DO_WHILE_EXPRESSION_END); - this.createStartMapping(TryExpressionContext.class, TRY_EXPRESSION); - this.createStartStopMapping(TryBodyContext.class, TRY_BODY_START, TRY_BODY_END); - this.createStartMapping(CatchStatementContext.class, CATCH); - this.createStartStopMapping(CatchBodyContext.class, CATCH_BODY_START, CATCH_BODY_END); - this.createStartMapping(FinallyStatementContext.class, FINALLY); - this.createStartStopMapping(FinallyBodyContext.class, FINALLY_BODY_START, FINALLY_BODY_END); - this.createStartStopMapping(WhenExpressionContext.class, WHEN_EXPRESSION_START, WHEN_EXPRESSION_END); - this.createStartMapping(WhenConditionContext.class, WHEN_CONDITION); - this.createStartStopMapping(ControlStructureBodyContext.class, CONTROL_STRUCTURE_BODY_START, CONTROL_STRUCTURE_BODY_END); - this.createStartMapping(VariableDeclarationContext.class, VARIABLE_DECLARATION); - this.createRangeMapping(ConstructorInvocationContext.class, CREATE_OBJECT); - this.createRangeMapping(CallSuffixContext.class, FUNCTION_INVOCATION); - this.createStartMapping(AssignmentOperatorContext.class, ASSIGNMENT); + this.mapRange(PackageHeaderContext.class, PACKAGE); + this.mapRange(ImportHeaderContext.class, IMPORT); + this.mapEnter(ClassDeclarationContext.class, CLASS_DECLARATION); + this.mapRange(ObjectDeclarationContext.class, OBJECT_DECLARATION); + this.mapRange(CompanionObjectContext.class, COMPANION_DECLARATION); + this.mapRange(TypeParameterContext.class, TYPE_PARAMETER); + this.mapRange(PrimaryConstructorContext.class, CONSTRUCTOR); + this.mapRange(ClassParameterContext.class, PROPERTY_DECLARATION); + this.mapEnterExit(ClassBodyContext.class, CLASS_BODY_BEGIN, CLASS_BODY_END); + this.mapEnterExit(EnumClassBodyContext.class, ENUM_CLASS_BODY_BEGIN, ENUM_CLASS_BODY_END); + this.mapEnter(EnumEntryContext.class, ENUM_ENTRY); + this.mapRange(SecondaryConstructorContext.class, CONSTRUCTOR); + this.mapEnter(PropertyDeclarationContext.class, PROPERTY_DECLARATION); + this.mapEnter(AnonymousInitializerContext.class, INITIALIZER); + this.mapEnterExit(InitBlockContext.class, INITIALIZER_BODY_START, INITIALIZER_BODY_END); + this.mapEnter(FunctionDeclarationContext.class, FUNCTION); + this.mapEnter(GetterContext.class, GETTER); + this.mapEnter(SetterContext.class, SETTER); + this.mapRange(FunctionValueParameterContext.class, FUNCTION_PARAMETER); + this.mapEnterExit(FunctionBodyContext.class, FUNCTION_BODY_BEGIN, FUNCTION_BODY_END); + this.mapEnterExit(FunctionLiteralContext.class, FUNCTION_LITERAL_BEGIN, FUNCTION_LITERAL_END); + this.mapEnterExit(ForExpressionContext.class, FOR_EXPRESSION_BEGIN, FOR_EXPRESSION_END); + this.mapEnterExit(IfExpressionContext.class, IF_EXPRESSION_BEGIN, IF_EXPRESSION_END); + this.mapEnterExit(WhileExpressionContext.class, WHILE_EXPRESSION_START, WHILE_EXPRESSION_END); + this.mapEnterExit(DoWhileExpressionContext.class, DO_WHILE_EXPRESSION_START, DO_WHILE_EXPRESSION_END); + this.mapEnter(TryExpressionContext.class, TRY_EXPRESSION); + this.mapEnterExit(TryBodyContext.class, TRY_BODY_START, TRY_BODY_END); + this.mapEnter(CatchStatementContext.class, CATCH); + this.mapEnterExit(CatchBodyContext.class, CATCH_BODY_START, CATCH_BODY_END); + this.mapEnter(FinallyStatementContext.class, FINALLY); + this.mapEnterExit(FinallyBodyContext.class, FINALLY_BODY_START, FINALLY_BODY_END); + this.mapEnterExit(WhenExpressionContext.class, WHEN_EXPRESSION_START, WHEN_EXPRESSION_END); + this.mapEnter(WhenConditionContext.class, WHEN_CONDITION); + this.mapEnterExit(ControlStructureBodyContext.class, CONTROL_STRUCTURE_BODY_START, CONTROL_STRUCTURE_BODY_END); + this.mapEnter(VariableDeclarationContext.class, VARIABLE_DECLARATION); + this.mapRange(ConstructorInvocationContext.class, CREATE_OBJECT); + this.mapRange(CallSuffixContext.class, FUNCTION_INVOCATION); + this.mapEnter(AssignmentOperatorContext.class, ASSIGNMENT); - this.createTerminalMapping(KotlinParser.THROW, THROW); - this.createTerminalMapping(KotlinParser.RETURN, RETURN); - this.createTerminalMapping(KotlinParser.CONTINUE, CONTINUE); - this.createTerminalMapping(KotlinParser.BREAK, BREAK); - this.createTerminalMapping(KotlinParser.BREAK_AT, BREAK); + this.mapTerminal(KotlinParser.THROW, THROW); + this.mapTerminal(KotlinParser.RETURN, RETURN); + this.mapTerminal(KotlinParser.CONTINUE, CONTINUE); + this.mapTerminal(KotlinParser.BREAK, BREAK); + this.mapTerminal(KotlinParser.BREAK_AT, BREAK); } }