//STANDING NOTE: Make VERY sure that all JAModule passes before the java //errorcheck DO NOT TOUCH any AST nodes below CompilationUnit to avoid //the REWRITES //Inserts implicit module imports to modules aspect InsertImplicit { //add import jastadd$framwork to all modules public boolean Program.inserJAFrameworkModuleImport() { for (Iterator i = compilationUnitIterator(); i.hasNext(); ) { CompilationUnit cu = (CompilationUnit) i.next(); cu.inserJAFrameworkModuleImport(); } return true; } public boolean CompilationUnit.inserJAFrameworkModuleImport() {return true;} public boolean ModuleCompilationUnit.inserJAFrameworkModuleImport() { if (getHostProgram().options().hasOption(JastAddModules.JASTADD_FRAMEWORK_OPTION) && !getModuleName().equals(Program.JASTADD_FRAMEWORK_MODULE) && !isModuleInterface()) { ModuleImportDecl frameworkImport = new ImplicitModuleImportDecl( new ModuleImportTypeNorm(), new ModuleAccess(Program.JASTADD_FRAMEWORK_MODULE), new AsTypeNone(), new NullModuleAccess()); getModuleMemberDeclList().add(frameworkImport); } return true; } }