@Test public void testNoStartProd() { ASTCDCompilationUnit noStartProd = this.parse("de", "monticore", "codegen", "ast", "NoStartProd"); Optional<ASTCDClass> astcdClass = decorator.decorate(noStartProd); assertFalse(astcdClass.isPresent()); }
@Override public Optional<ASTCDClass> decorate(ASTCDCompilationUnit input) { Optional<String> startProdAstFullName = symbolTableService.getStartProdASTFullName(input.getCDDefinition()); if (startProdAstFullName.isPresent()) { String astFullName = startProdAstFullName.get(); String modelLoaderClassName = symbolTableService.getModelLoaderClassSimpleName(); String globalScopeInterfaceName = symbolTableService.getGlobalScopeInterfaceFullName(); String stcName = symbolTableService.getSymbolTableCreatorDelegatorFullName(); ASTMCGenericType iModelLoader = getMCTypeFacade().createBasicGenericTypeOf( I_MODEL_LOADER, astFullName, globalScopeInterfaceName); ASTModifier modifier = PUBLIC.build(); symbolTableService.addDeprecatedStereotype(modifier, Optional.of("Will be moved")); ASTCDClass modelLoaderClass = CD4AnalysisMill.cDClassBuilder() .setName(modelLoaderClassName) .setModifier(modifier) .addInterface(iModelLoader) .addCDConstructor(createConstructor(modelLoaderClassName, stcName, astFullName)) .addCDAttribute(createAStProviderAttribute(astFullName)) .addCDAttribute(createSymbolTableCreatorAttribute(stcName)) .addCDAttribute(createStringAttribute("modelFileExtension")) .addAllCDMethods(createModelLoaderMethod(astFullName, globalScopeInterfaceName, modelLoaderClassName)) .build(); return Optional.ofNullable(modelLoaderClass); } return Optional.empty(); }
ModelLoaderDecorator extends AbstractCreator<ASTCDCompilationUnit, Optional<ASTCDClass>> { @Override public Optional<ASTCDClass> decorate(ASTCDCompilationUnit input) { Optional<String> startProdAstFullName = symbolTableService.getStartProdASTFullName(input.getCDDefinition()); if (startProdAstFullName.isPresent()) { String astFullName = startProdAstFullName.get(); String modelLoaderClassName = symbolTableService.getModelLoaderClassSimpleName(); String globalScopeInterfaceName = symbolTableService.getGlobalScopeInterfaceFullName(); String stcName = symbolTableService.getSymbolTableCreatorDelegatorFullName(); ASTMCGenericType iModelLoader = getMCTypeFacade().createBasicGenericTypeOf( I_MODEL_LOADER, astFullName, globalScopeInterfaceName); ASTModifier modifier = PUBLIC.build(); symbolTableService.addDeprecatedStereotype(modifier, Optional.of("Will be moved")); ASTCDClass modelLoaderClass = CD4AnalysisMill.cDClassBuilder() .setName(modelLoaderClassName) .setModifier(modifier) .addInterface(iModelLoader) .addCDConstructor(createConstructor(modelLoaderClassName, stcName, astFullName)) .addCDAttribute(createAStProviderAttribute(astFullName)) .addCDAttribute(createSymbolTableCreatorAttribute(stcName)) .addCDAttribute(createStringAttribute("modelFileExtension")) .addAllCDMethods(createModelLoaderMethod(astFullName, globalScopeInterfaceName, modelLoaderClassName)) .build(); return Optional.ofNullable(modelLoaderClass); } return Optional.empty(); } }
ModelLoaderDecorator extends AbstractCreator<ASTCDCompilationUnit, Optional<ASTCDClass>> { @Override public Optional<ASTCDClass> decorate(ASTCDCompilationUnit input) { Optional<String> startProdAstFullName = symbolTableService.getStartProdASTFullName(input.getCDDefinition()); if (startProdAstFullName.isPresent()) { String astFullName = startProdAstFullName.get(); String modelLoaderClassName = symbolTableService.getModelLoaderClassSimpleName(); String globalScopeInterfaceName = symbolTableService.getGlobalScopeInterfaceFullName(); String stcName = symbolTableService.getSymbolTableCreatorDelegatorFullName(); ASTMCGenericType iModelLoader = getMCTypeFacade().createBasicGenericTypeOf( I_MODEL_LOADER, astFullName, globalScopeInterfaceName); ASTModifier modifier = PUBLIC.build(); symbolTableService.addDeprecatedStereotype(modifier, Optional.of("Will be moved")); ASTCDClass modelLoaderClass = CD4AnalysisMill.cDClassBuilder() .setName(modelLoaderClassName) .setModifier(modifier) .addInterface(iModelLoader) .addCDConstructor(createConstructor(modelLoaderClassName, stcName, astFullName)) .addCDAttribute(createAStProviderAttribute(astFullName)) .addCDAttribute(createSymbolTableCreatorAttribute(stcName)) .addCDAttribute(createStringAttribute("modelFileExtension")) .addAllCDMethods(createModelLoaderMethod(astFullName, globalScopeInterfaceName, modelLoaderClassName)) .build(); return Optional.ofNullable(modelLoaderClass); } return Optional.empty(); } ModelLoaderDecorator(final GlobalExtensionManagement glex,
                              final SymbolTableService symbolTableService,
                              final AccessorDecorator accessorDecorator); }
ModelLoaderDecorator extends AbstractCreator<ASTCDCompilationUnit, Optional<ASTCDClass>> { @Override public Optional<ASTCDClass> decorate(ASTCDCompilationUnit input) { Optional<String> startProdAstFullName = symbolTableService.getStartProdASTFullName(input.getCDDefinition()); if (startProdAstFullName.isPresent()) { String astFullName = startProdAstFullName.get(); String modelLoaderClassName = symbolTableService.getModelLoaderClassSimpleName(); String globalScopeInterfaceName = symbolTableService.getGlobalScopeInterfaceFullName(); String stcName = symbolTableService.getSymbolTableCreatorDelegatorFullName(); ASTMCGenericType iModelLoader = getMCTypeFacade().createBasicGenericTypeOf( I_MODEL_LOADER, astFullName, globalScopeInterfaceName); ASTModifier modifier = PUBLIC.build(); symbolTableService.addDeprecatedStereotype(modifier, Optional.of("Will be moved")); ASTCDClass modelLoaderClass = CD4AnalysisMill.cDClassBuilder() .setName(modelLoaderClassName) .setModifier(modifier) .addInterface(iModelLoader) .addCDConstructor(createConstructor(modelLoaderClassName, stcName, astFullName)) .addCDAttribute(createAStProviderAttribute(astFullName)) .addCDAttribute(createSymbolTableCreatorAttribute(stcName)) .addCDAttribute(createStringAttribute("modelFileExtension")) .addAllCDMethods(createModelLoaderMethod(astFullName, globalScopeInterfaceName, modelLoaderClassName)) .build(); return Optional.ofNullable(modelLoaderClass); } return Optional.empty(); } ModelLoaderDecorator(final GlobalExtensionManagement glex,
                              final SymbolTableService symbolTableService,
                              final AccessorDecorator accessorDecorator); @Override Optional<ASTCDClass> decorate(ASTCDCompilationUnit input); }
ModelLoaderDecorator extends AbstractCreator<ASTCDCompilationUnit, Optional<ASTCDClass>> { @Override public Optional<ASTCDClass> decorate(ASTCDCompilationUnit input) { Optional<String> startProdAstFullName = symbolTableService.getStartProdASTFullName(input.getCDDefinition()); if (startProdAstFullName.isPresent()) { String astFullName = startProdAstFullName.get(); String modelLoaderClassName = symbolTableService.getModelLoaderClassSimpleName(); String globalScopeInterfaceName = symbolTableService.getGlobalScopeInterfaceFullName(); String stcName = symbolTableService.getSymbolTableCreatorDelegatorFullName(); ASTMCGenericType iModelLoader = getMCTypeFacade().createBasicGenericTypeOf( I_MODEL_LOADER, astFullName, globalScopeInterfaceName); ASTModifier modifier = PUBLIC.build(); symbolTableService.addDeprecatedStereotype(modifier, Optional.of("Will be moved")); ASTCDClass modelLoaderClass = CD4AnalysisMill.cDClassBuilder() .setName(modelLoaderClassName) .setModifier(modifier) .addInterface(iModelLoader) .addCDConstructor(createConstructor(modelLoaderClassName, stcName, astFullName)) .addCDAttribute(createAStProviderAttribute(astFullName)) .addCDAttribute(createSymbolTableCreatorAttribute(stcName)) .addCDAttribute(createStringAttribute("modelFileExtension")) .addAllCDMethods(createModelLoaderMethod(astFullName, globalScopeInterfaceName, modelLoaderClassName)) .build(); return Optional.ofNullable(modelLoaderClass); } return Optional.empty(); } ModelLoaderDecorator(final GlobalExtensionManagement glex,
                              final SymbolTableService symbolTableService,
                              final AccessorDecorator accessorDecorator); @Override Optional<ASTCDClass> decorate(ASTCDCompilationUnit input);  }