@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> startProd = symbolTableService.getStartProdASTFullName(input.getCDDefinition()); if (startProd.isPresent()) { String astFullName = startProd.get(); String symbolTableCreatorDelegatorName = symbolTableService.getSymbolTableCreatorDelegatorSimpleName(); String symbolTableCreatorName = symbolTableService.getSymbolTableCreatorSimpleName(); String scopeInterface = symbolTableService.getScopeInterfaceFullName(); String globalScopeInterfaceName = symbolTableService.getGlobalScopeInterfaceFullName(); String simpleName = symbolTableService.getCDName(); String artifactScopeName = symbolTableService.getArtifactScopeInterfaceFullName(); String delegatorVisitorName = visitorService.getDelegatorVisitorFullName(); ASTMCBasicGenericType dequeType = getMCTypeFacade().createBasicGenericTypeOf(DEQUE_TYPE, scopeInterface); ASTCDClass symTabCreatorDelegator = CD4CodeMill.cDClassBuilder() .setName(symbolTableCreatorDelegatorName) .setModifier(PUBLIC.build()) .setSuperclass(getMCTypeFacade().createQualifiedType(delegatorVisitorName)) .addCDConstructor(createConstructor(symbolTableCreatorDelegatorName, globalScopeInterfaceName, symbolTableCreatorName, simpleName)) .addCDAttribute(createScopeStackAttribute(dequeType)) .addCDAttribute(createSymbolTableCreatorAttribute(symbolTableCreatorName)) .addCDAttribute(createGlobalScopeAttribute(globalScopeInterfaceName)) .addCDMethod(createCreateFromASTMethod(astFullName, artifactScopeName)) .build(); return Optional.ofNullable(symTabCreatorDelegator); } return Optional.empty(); }
SymbolTableCreatorDelegatorDecorator extends AbstractCreator<ASTCDCompilationUnit, Optional<ASTCDClass>> { @Override public Optional<ASTCDClass> decorate(ASTCDCompilationUnit input) { Optional<String> startProd = symbolTableService.getStartProdASTFullName(input.getCDDefinition()); if (startProd.isPresent()) { String astFullName = startProd.get(); String symbolTableCreatorDelegatorName = symbolTableService.getSymbolTableCreatorDelegatorSimpleName(); String symbolTableCreatorName = symbolTableService.getSymbolTableCreatorSimpleName(); String scopeInterface = symbolTableService.getScopeInterfaceFullName(); String globalScopeInterfaceName = symbolTableService.getGlobalScopeInterfaceFullName(); String simpleName = symbolTableService.getCDName(); String artifactScopeName = symbolTableService.getArtifactScopeInterfaceFullName(); String delegatorVisitorName = visitorService.getDelegatorVisitorFullName(); ASTMCBasicGenericType dequeType = getMCTypeFacade().createBasicGenericTypeOf(DEQUE_TYPE, scopeInterface); ASTCDClass symTabCreatorDelegator = CD4CodeMill.cDClassBuilder() .setName(symbolTableCreatorDelegatorName) .setModifier(PUBLIC.build()) .setSuperclass(getMCTypeFacade().createQualifiedType(delegatorVisitorName)) .addCDConstructor(createConstructor(symbolTableCreatorDelegatorName, globalScopeInterfaceName, symbolTableCreatorName, simpleName)) .addCDAttribute(createScopeStackAttribute(dequeType)) .addCDAttribute(createSymbolTableCreatorAttribute(symbolTableCreatorName)) .addCDAttribute(createGlobalScopeAttribute(globalScopeInterfaceName)) .addCDMethod(createCreateFromASTMethod(astFullName, artifactScopeName)) .build(); return Optional.ofNullable(symTabCreatorDelegator); } return Optional.empty(); } }
SymbolTableCreatorDelegatorDecorator extends AbstractCreator<ASTCDCompilationUnit, Optional<ASTCDClass>> { @Override public Optional<ASTCDClass> decorate(ASTCDCompilationUnit input) { Optional<String> startProd = symbolTableService.getStartProdASTFullName(input.getCDDefinition()); if (startProd.isPresent()) { String astFullName = startProd.get(); String symbolTableCreatorDelegatorName = symbolTableService.getSymbolTableCreatorDelegatorSimpleName(); String symbolTableCreatorName = symbolTableService.getSymbolTableCreatorSimpleName(); String scopeInterface = symbolTableService.getScopeInterfaceFullName(); String globalScopeInterfaceName = symbolTableService.getGlobalScopeInterfaceFullName(); String simpleName = symbolTableService.getCDName(); String artifactScopeName = symbolTableService.getArtifactScopeInterfaceFullName(); String delegatorVisitorName = visitorService.getDelegatorVisitorFullName(); ASTMCBasicGenericType dequeType = getMCTypeFacade().createBasicGenericTypeOf(DEQUE_TYPE, scopeInterface); ASTCDClass symTabCreatorDelegator = CD4CodeMill.cDClassBuilder() .setName(symbolTableCreatorDelegatorName) .setModifier(PUBLIC.build()) .setSuperclass(getMCTypeFacade().createQualifiedType(delegatorVisitorName)) .addCDConstructor(createConstructor(symbolTableCreatorDelegatorName, globalScopeInterfaceName, symbolTableCreatorName, simpleName)) .addCDAttribute(createScopeStackAttribute(dequeType)) .addCDAttribute(createSymbolTableCreatorAttribute(symbolTableCreatorName)) .addCDAttribute(createGlobalScopeAttribute(globalScopeInterfaceName)) .addCDMethod(createCreateFromASTMethod(astFullName, artifactScopeName)) .build(); return Optional.ofNullable(symTabCreatorDelegator); } return Optional.empty(); } SymbolTableCreatorDelegatorDecorator(final GlobalExtensionManagement glex,
                                              final SymbolTableService symbolTableService,
                                              final VisitorService visitorService); }
SymbolTableCreatorDelegatorDecorator extends AbstractCreator<ASTCDCompilationUnit, Optional<ASTCDClass>> { @Override public Optional<ASTCDClass> decorate(ASTCDCompilationUnit input) { Optional<String> startProd = symbolTableService.getStartProdASTFullName(input.getCDDefinition()); if (startProd.isPresent()) { String astFullName = startProd.get(); String symbolTableCreatorDelegatorName = symbolTableService.getSymbolTableCreatorDelegatorSimpleName(); String symbolTableCreatorName = symbolTableService.getSymbolTableCreatorSimpleName(); String scopeInterface = symbolTableService.getScopeInterfaceFullName(); String globalScopeInterfaceName = symbolTableService.getGlobalScopeInterfaceFullName(); String simpleName = symbolTableService.getCDName(); String artifactScopeName = symbolTableService.getArtifactScopeInterfaceFullName(); String delegatorVisitorName = visitorService.getDelegatorVisitorFullName(); ASTMCBasicGenericType dequeType = getMCTypeFacade().createBasicGenericTypeOf(DEQUE_TYPE, scopeInterface); ASTCDClass symTabCreatorDelegator = CD4CodeMill.cDClassBuilder() .setName(symbolTableCreatorDelegatorName) .setModifier(PUBLIC.build()) .setSuperclass(getMCTypeFacade().createQualifiedType(delegatorVisitorName)) .addCDConstructor(createConstructor(symbolTableCreatorDelegatorName, globalScopeInterfaceName, symbolTableCreatorName, simpleName)) .addCDAttribute(createScopeStackAttribute(dequeType)) .addCDAttribute(createSymbolTableCreatorAttribute(symbolTableCreatorName)) .addCDAttribute(createGlobalScopeAttribute(globalScopeInterfaceName)) .addCDMethod(createCreateFromASTMethod(astFullName, artifactScopeName)) .build(); return Optional.ofNullable(symTabCreatorDelegator); } return Optional.empty(); } SymbolTableCreatorDelegatorDecorator(final GlobalExtensionManagement glex,
                                              final SymbolTableService symbolTableService,
                                              final VisitorService visitorService); @Override Optional<ASTCDClass> decorate(ASTCDCompilationUnit input); }
SymbolTableCreatorDelegatorDecorator extends AbstractCreator<ASTCDCompilationUnit, Optional<ASTCDClass>> { @Override public Optional<ASTCDClass> decorate(ASTCDCompilationUnit input) { Optional<String> startProd = symbolTableService.getStartProdASTFullName(input.getCDDefinition()); if (startProd.isPresent()) { String astFullName = startProd.get(); String symbolTableCreatorDelegatorName = symbolTableService.getSymbolTableCreatorDelegatorSimpleName(); String symbolTableCreatorName = symbolTableService.getSymbolTableCreatorSimpleName(); String scopeInterface = symbolTableService.getScopeInterfaceFullName(); String globalScopeInterfaceName = symbolTableService.getGlobalScopeInterfaceFullName(); String simpleName = symbolTableService.getCDName(); String artifactScopeName = symbolTableService.getArtifactScopeInterfaceFullName(); String delegatorVisitorName = visitorService.getDelegatorVisitorFullName(); ASTMCBasicGenericType dequeType = getMCTypeFacade().createBasicGenericTypeOf(DEQUE_TYPE, scopeInterface); ASTCDClass symTabCreatorDelegator = CD4CodeMill.cDClassBuilder() .setName(symbolTableCreatorDelegatorName) .setModifier(PUBLIC.build()) .setSuperclass(getMCTypeFacade().createQualifiedType(delegatorVisitorName)) .addCDConstructor(createConstructor(symbolTableCreatorDelegatorName, globalScopeInterfaceName, symbolTableCreatorName, simpleName)) .addCDAttribute(createScopeStackAttribute(dequeType)) .addCDAttribute(createSymbolTableCreatorAttribute(symbolTableCreatorName)) .addCDAttribute(createGlobalScopeAttribute(globalScopeInterfaceName)) .addCDMethod(createCreateFromASTMethod(astFullName, artifactScopeName)) .build(); return Optional.ofNullable(symTabCreatorDelegator); } return Optional.empty(); } SymbolTableCreatorDelegatorDecorator(final GlobalExtensionManagement glex,
                                              final SymbolTableService symbolTableService,
                                              final VisitorService visitorService); @Override Optional<ASTCDClass> decorate(ASTCDCompilationUnit input);  }