Ejemplo n.º 1
0
 def enterPackageDeclaration(
         self, ctx: JavaParserLabeled.PackageDeclarationContext):
     package_name = ctx.getText()[7:-1]
     print(package_name)
     if package_name != self.source_package:
         raise ValueError(
             f"The package {package_name} in the file isn't equal to the source package!"
         )
Ejemplo n.º 2
0
 def enterPackageDeclaration(
         self, ctx: JavaParserLabeled.PackageDeclarationContext):
     self.in_some_package = True
     if self.package_identifier is not None:
         print(ctx.qualifiedName())
         print(ctx.getText())
         if self.package_identifier == ctx.qualifiedName().getText():
             self.in_selected_package = True
             print("Package Found")
Ejemplo n.º 3
0
 def enterPackageDeclaration(
         self, ctx: JavaParserLabeled.PackageDeclarationContext):
     if self.target_package in ctx.getText():
         self.detected_package = True
     self.import_end = ctx.stop