@Test public void testDecorateForASTPackage() { MontiCoreScript mc = new MontiCoreScript(); GlobalExtensionManagement glex = new GlobalExtensionManagement(); Grammar_WithConceptsGlobalScope symbolTable = TestHelper.createGlobalScope(modelPath); mc.createSymbolsFromAST(symbolTable, grammar); CD4AnalysisGlobalScope cd4AGlobalScope = mc.createCD4AGlobalScope(modelPath); ASTCDCompilationUnit cd = mc.deriveCD(grammar, glex, cd4AGlobalScope); IterablePath handcodedPath = IterablePath.from(new File("src/test/resources"), "java"); ASTCDCompilationUnit astPackageCD = mc.decorateForASTPackage(glex, cd4AGlobalScope, cd, handcodedPath); assertNotNull(astPackageCD); assertNotNull(astPackageCD.getCDDefinition()); assertEquals("Statechart", astPackageCD.getCDDefinition().getName()); assertEquals(18, astPackageCD.getCDDefinition().sizeCDClasss()); assertEquals("ASTStatechart", astPackageCD.getCDDefinition().getCDClass(0).getName()); assertEquals("ASTEntryAction", astPackageCD.getCDDefinition().getCDClass(1).getName()); assertEquals("ASTExitAction", astPackageCD.getCDDefinition().getCDClass(2).getName()); assertEquals("ASTState", astPackageCD.getCDDefinition().getCDClass(3).getName()); assertEquals("ASTTransition", astPackageCD.getCDDefinition().getCDClass(4).getName()); assertEquals("ASTArgument", astPackageCD.getCDDefinition().getCDClass(5).getName()); assertEquals("ASTCode", astPackageCD.getCDDefinition().getCDClass(6).getName()); assertEquals("ASTAbstractAnything", astPackageCD.getCDDefinition().getCDClass(7).getName()); assertEquals("ASTStatechartBuilder", astPackageCD.getCDDefinition().getCDClass(8).getName()); assertEquals("ASTEntryActionBuilder", astPackageCD.getCDDefinition().getCDClass(9).getName()); assertEquals("ASTExitActionBuilder", astPackageCD.getCDDefinition().getCDClass(10).getName()); assertEquals("ASTStateBuilder", astPackageCD.getCDDefinition().getCDClass(11).getName()); assertEquals("ASTTransitionBuilder", astPackageCD.getCDDefinition().getCDClass(12).getName()); assertEquals("ASTArgumentBuilder", astPackageCD.getCDDefinition().getCDClass(13).getName()); assertEquals("ASTCodeBuilder", astPackageCD.getCDDefinition().getCDClass(14).getName()); assertEquals("ASTAbstractAnythingBuilder", astPackageCD.getCDDefinition().getCDClass(15).getName()); assertEquals("StatechartNodeFactory", astPackageCD.getCDDefinition().getCDClass(16).getName()); assertEquals("ASTConstantsStatechart", astPackageCD.getCDDefinition().getCDClass(17).getName()); assertEquals(5, astPackageCD.getCDDefinition().sizeCDInterfaces()); assertEquals("ASTSCStructure", astPackageCD.getCDDefinition().getCDInterface(0).getName()); assertEquals("ASTBlockStatementExt", astPackageCD.getCDDefinition().getCDInterface(1).getName()); assertEquals("ASTExpressionExt", astPackageCD.getCDDefinition().getCDInterface(2).getName()); assertEquals("ASTClassbodyExt", astPackageCD.getCDDefinition().getCDInterface(3).getName()); assertEquals("ASTStatechartNode", astPackageCD.getCDDefinition().getCDInterface(4).getName()); assertEquals(1, astPackageCD.getCDDefinition().sizeCDEnums()); assertEquals("StatechartLiterals", astPackageCD.getCDDefinition().getCDEnum(0).getName()); }
public ASTCDCompilationUnit decorateForASTPackage(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope, ASTCDCompilationUnit astClassDiagram, IterablePath handCodedPath) { ASTCDCompilationUnit preparedCD = prepareCD(cdScope, astClassDiagram); return decorateWithAST(preparedCD, glex, handCodedPath); }
MontiCoreScript extends Script implements GroovyRunner { public ASTCDCompilationUnit decorateForASTPackage(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope, ASTCDCompilationUnit astClassDiagram, IterablePath handCodedPath) { ASTCDCompilationUnit preparedCD = prepareCD(cdScope, astClassDiagram); return decorateWithAST(preparedCD, glex, handCodedPath); } }
MontiCoreScript extends Script implements GroovyRunner { public ASTCDCompilationUnit decorateForASTPackage(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope, ASTCDCompilationUnit astClassDiagram, IterablePath handCodedPath) { ASTCDCompilationUnit preparedCD = prepareCD(cdScope, astClassDiagram); return decorateWithAST(preparedCD, glex, handCodedPath); }  }
MontiCoreScript extends Script implements GroovyRunner { public ASTCDCompilationUnit decorateForASTPackage(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope, ASTCDCompilationUnit astClassDiagram, IterablePath handCodedPath) { ASTCDCompilationUnit preparedCD = prepareCD(cdScope, astClassDiagram); return decorateWithAST(preparedCD, glex, handCodedPath); }  void run(Configuration configuration); void run_emf(Configuration configuration); @Override void run(String script, Configuration configuration); Optional<ASTMCGrammar> parseGrammar(Path grammar); List<ASTMCGrammar> parseGrammars(IterablePath grammarPath); void storeGrammarSymbol(ASTMCGrammar grammar, String location); void generateParser(GlobalExtensionManagement glex, ASTMCGrammar grammar,
                             Grammar_WithConceptsGlobalScope symbolTable,
                             IterablePath handcodedPath, File outputDirectory); void generateParser(GlobalExtensionManagement glex, ASTMCGrammar grammar,
                             Grammar_WithConceptsGlobalScope symbolTable,
                             IterablePath handcodedPath, File outputDirectory, boolean embeddedJavaCode, Languages lang); ASTMCGrammar createSymbolsFromAST(Grammar_WithConceptsGlobalScope globalScope, ASTMCGrammar ast); ASTCDCompilationUnit createSymbolsFromAST(CD4AnalysisGlobalScope globalScope,
                                                   ASTCDCompilationUnit ast); void runGrammarCoCos(ASTMCGrammar ast, Grammar_WithConceptsGlobalScope scope); ASTCDCompilationUnit getOrCreateCD(ASTMCGrammar astGrammar,
                                            GlobalExtensionManagement glex, CD4AnalysisGlobalScope symbolTable); ASTCDCompilationUnit deriveCD(ASTMCGrammar astGrammar,
                                       GlobalExtensionManagement glex,
                                       CD4AnalysisGlobalScope cdScope); ASTCDCompilationUnit deriveSymbolCD(ASTMCGrammar astGrammar,
                                             CD4AnalysisGlobalScope cdScope); ASTCDCompilationUnit deriveScopeCD(ASTMCGrammar astGrammar,
                                            CD4AnalysisGlobalScope cdScope); void reportCD(ASTCDCompilationUnit origCd, ASTCDCompilationUnit astCd,
                       ASTCDCompilationUnit symbolCd, ASTCDCompilationUnit scopeCd,
                       File outputDirectory); void reportCD(ASTCDCompilationUnit astCd, File outputDirectory); ASTCDCompilationUnit decorateForSymbolTablePackage(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope,
                                                            ASTCDCompilationUnit astClassDiagram, ASTCDCompilationUnit symbolClassDiagramm,
                                                            ASTCDCompilationUnit scopeClassDiagramm, IterablePath handCodedPath); ASTCDCompilationUnit decorateForVisitorPackage(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope,
                                                        ASTCDCompilationUnit astClassDiagram, IterablePath handCodedPath); ASTCDCompilationUnit decorateForCoCoPackage(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope,
                                                     ASTCDCompilationUnit astClassDiagram, IterablePath handCodedPath); ASTCDCompilationUnit decorateForODPackage(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope,
                                                   ASTCDCompilationUnit astClassDiagram, IterablePath handCodedPath); ASTCDCompilationUnit decorateMill(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope,
                                           ASTCDCompilationUnit cd, ASTCDCompilationUnit astClassDiagram,
                                           ASTCDCompilationUnit visitorCD, ASTCDCompilationUnit symbolCD,
                                           IterablePath handCodedPath); ASTCDCompilationUnit decorateAuxiliary(GlobalExtensionManagement glex, ICD4AnalysisGlobalScope cdScope,
                                                ASTCDCompilationUnit cd, ASTCDCompilationUnit astCD,
                                                IterablePath handCodedPath); ASTCDCompilationUnit addListSuffixToAttributeName(ASTCDCompilationUnit originalCD); ASTCDCompilationUnit decorateForASTPackage(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope,
                                                    ASTCDCompilationUnit astClassDiagram, IterablePath handCodedPath); ASTCDCompilationUnit decorateEmfForASTPackage(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope,
                                                       ASTCDCompilationUnit astClassDiagram, IterablePath handCodedPath); void generateFromCD(GlobalExtensionManagement glex, ASTCDCompilationUnit oldCD, ASTCDCompilationUnit decoratedCD,
                             File outputDirectory, IterablePath handcodedPath); void generateEmfFromCD(GlobalExtensionManagement glex, ASTCDCompilationUnit oldCD, ASTCDCompilationUnit decoratedCD,
                                File outputDirectory, IterablePath handcodedPath); CD4AnalysisGlobalScope createCD4AGlobalScope(ModelPath modelPath); Grammar_WithConceptsGlobalScope createMCGlobalScope(ModelPath modelPath); @Override Object run(); }
MontiCoreScript extends Script implements GroovyRunner { public ASTCDCompilationUnit decorateForASTPackage(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope, ASTCDCompilationUnit astClassDiagram, IterablePath handCodedPath) { ASTCDCompilationUnit preparedCD = prepareCD(cdScope, astClassDiagram); return decorateWithAST(preparedCD, glex, handCodedPath); }  void run(Configuration configuration); void run_emf(Configuration configuration); @Override void run(String script, Configuration configuration); Optional<ASTMCGrammar> parseGrammar(Path grammar); List<ASTMCGrammar> parseGrammars(IterablePath grammarPath); void storeGrammarSymbol(ASTMCGrammar grammar, String location); void generateParser(GlobalExtensionManagement glex, ASTMCGrammar grammar,
                             Grammar_WithConceptsGlobalScope symbolTable,
                             IterablePath handcodedPath, File outputDirectory); void generateParser(GlobalExtensionManagement glex, ASTMCGrammar grammar,
                             Grammar_WithConceptsGlobalScope symbolTable,
                             IterablePath handcodedPath, File outputDirectory, boolean embeddedJavaCode, Languages lang); ASTMCGrammar createSymbolsFromAST(Grammar_WithConceptsGlobalScope globalScope, ASTMCGrammar ast); ASTCDCompilationUnit createSymbolsFromAST(CD4AnalysisGlobalScope globalScope,
                                                   ASTCDCompilationUnit ast); void runGrammarCoCos(ASTMCGrammar ast, Grammar_WithConceptsGlobalScope scope); ASTCDCompilationUnit getOrCreateCD(ASTMCGrammar astGrammar,
                                            GlobalExtensionManagement glex, CD4AnalysisGlobalScope symbolTable); ASTCDCompilationUnit deriveCD(ASTMCGrammar astGrammar,
                                       GlobalExtensionManagement glex,
                                       CD4AnalysisGlobalScope cdScope); ASTCDCompilationUnit deriveSymbolCD(ASTMCGrammar astGrammar,
                                             CD4AnalysisGlobalScope cdScope); ASTCDCompilationUnit deriveScopeCD(ASTMCGrammar astGrammar,
                                            CD4AnalysisGlobalScope cdScope); void reportCD(ASTCDCompilationUnit origCd, ASTCDCompilationUnit astCd,
                       ASTCDCompilationUnit symbolCd, ASTCDCompilationUnit scopeCd,
                       File outputDirectory); void reportCD(ASTCDCompilationUnit astCd, File outputDirectory); ASTCDCompilationUnit decorateForSymbolTablePackage(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope,
                                                            ASTCDCompilationUnit astClassDiagram, ASTCDCompilationUnit symbolClassDiagramm,
                                                            ASTCDCompilationUnit scopeClassDiagramm, IterablePath handCodedPath); ASTCDCompilationUnit decorateForVisitorPackage(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope,
                                                        ASTCDCompilationUnit astClassDiagram, IterablePath handCodedPath); ASTCDCompilationUnit decorateForCoCoPackage(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope,
                                                     ASTCDCompilationUnit astClassDiagram, IterablePath handCodedPath); ASTCDCompilationUnit decorateForODPackage(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope,
                                                   ASTCDCompilationUnit astClassDiagram, IterablePath handCodedPath); ASTCDCompilationUnit decorateMill(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope,
                                           ASTCDCompilationUnit cd, ASTCDCompilationUnit astClassDiagram,
                                           ASTCDCompilationUnit visitorCD, ASTCDCompilationUnit symbolCD,
                                           IterablePath handCodedPath); ASTCDCompilationUnit decorateAuxiliary(GlobalExtensionManagement glex, ICD4AnalysisGlobalScope cdScope,
                                                ASTCDCompilationUnit cd, ASTCDCompilationUnit astCD,
                                                IterablePath handCodedPath); ASTCDCompilationUnit addListSuffixToAttributeName(ASTCDCompilationUnit originalCD); ASTCDCompilationUnit decorateForASTPackage(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope,
                                                    ASTCDCompilationUnit astClassDiagram, IterablePath handCodedPath); ASTCDCompilationUnit decorateEmfForASTPackage(GlobalExtensionManagement glex, ICD4AnalysisScope cdScope,
                                                       ASTCDCompilationUnit astClassDiagram, IterablePath handCodedPath); void generateFromCD(GlobalExtensionManagement glex, ASTCDCompilationUnit oldCD, ASTCDCompilationUnit decoratedCD,
                             File outputDirectory, IterablePath handcodedPath); void generateEmfFromCD(GlobalExtensionManagement glex, ASTCDCompilationUnit oldCD, ASTCDCompilationUnit decoratedCD,
                                File outputDirectory, IterablePath handcodedPath); CD4AnalysisGlobalScope createCD4AGlobalScope(ModelPath modelPath); Grammar_WithConceptsGlobalScope createMCGlobalScope(ModelPath modelPath); @Override Object run();  }