def enterClassDeclaration(self, ctx: JavaParserLabeled.ClassDeclarationContext): print(ctx.IDENTIFIER().getText()) if self.objective_class == ctx.IDENTIFIER().getText(): print("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&") print(ctx.CLASS().getText()) self.token_stream_rewriter.replaceRange(from_idx=0, to_idx=0, text="abstract " + ctx.CLASS().getText())
def enterClassDeclaration(self, ctx: JavaParserLabeled.ClassDeclarationContext): print("Propagation started, please wait...") class_identifier = ctx.IDENTIFIER().getText() if class_identifier in self.propagated_class_name: self.is_class = True else: self.is_class = False if class_identifier in self.propagated_class_name: self.token_stream_rewriter.replaceRange( from_idx=ctx.start.tokenIndex, to_idx=ctx.typeType().stop.tokenIndex, text=ctx.CLASS().getText() + ' ' + ctx.IDENTIFIER().getText())