@Test public void testDeriveSymbolCD() { MontiCoreScript mc = new MontiCoreScript(); Grammar_WithConceptsGlobalScope symbolTable = TestHelper.createGlobalScope(modelPath); mc.createSymbolsFromAST(symbolTable, grammar); CD4AnalysisGlobalScope cd4AGlobalScope = mc.createCD4AGlobalScope(modelPath); ASTCDCompilationUnit cdCompilationUnit = mc.deriveSymbolCD(grammar, cd4AGlobalScope); assertNotNull(cdCompilationUnit); assertNotNull(cdCompilationUnit.getCDDefinition()); assertEquals("Statechart", cdCompilationUnit.getCDDefinition().getName()); assertEquals(0, cdCompilationUnit.getCDDefinition().sizeCDClasss()); ASTCDCompilationUnit symbolCDOfParsedGrammar = mc.getSymbolCDOfParsedGrammar(grammar); assertNotNull(symbolCDOfParsedGrammar); assertNotNull(symbolCDOfParsedGrammar.getCDDefinition()); assertEquals("Statechart", symbolCDOfParsedGrammar.getCDDefinition().getName()); assertEquals(0, symbolCDOfParsedGrammar.getCDDefinition().sizeCDClasss()); }
public ASTCDCompilationUnit deriveSymbolCD(ASTMCGrammar astGrammar, CD4AnalysisGlobalScope cdScope) { Optional<ASTCDCompilationUnit> ast = TransformationHelper.getCDforGrammar(cdScope, astGrammar); ASTCDCompilationUnit astCD = ast.orElse(transformAndCreateSymbolTableForSymbolCD(astGrammar, cdScope)); createCDSymbolsForSuperGrammarsForSymbolCD(astGrammar, cdScope); storeSymbolCDForGrammar(astGrammar, astCD); return astCD; }
MontiCoreScript extends Script implements GroovyRunner { public ASTCDCompilationUnit deriveSymbolCD(ASTMCGrammar astGrammar, CD4AnalysisGlobalScope cdScope) { Optional<ASTCDCompilationUnit> ast = TransformationHelper.getCDforGrammar(cdScope, astGrammar); ASTCDCompilationUnit astCD = ast.orElse(transformAndCreateSymbolTableForSymbolCD(astGrammar, cdScope)); createCDSymbolsForSuperGrammarsForSymbolCD(astGrammar, cdScope); storeSymbolCDForGrammar(astGrammar, astCD); return astCD; } }
MontiCoreScript extends Script implements GroovyRunner { public ASTCDCompilationUnit deriveSymbolCD(ASTMCGrammar astGrammar, CD4AnalysisGlobalScope cdScope) { Optional<ASTCDCompilationUnit> ast = TransformationHelper.getCDforGrammar(cdScope, astGrammar); ASTCDCompilationUnit astCD = ast.orElse(transformAndCreateSymbolTableForSymbolCD(astGrammar, cdScope)); createCDSymbolsForSuperGrammarsForSymbolCD(astGrammar, cdScope); storeSymbolCDForGrammar(astGrammar, astCD); return astCD; }  }
MontiCoreScript extends Script implements GroovyRunner { public ASTCDCompilationUnit deriveSymbolCD(ASTMCGrammar astGrammar, CD4AnalysisGlobalScope cdScope) { Optional<ASTCDCompilationUnit> ast = TransformationHelper.getCDforGrammar(cdScope, astGrammar); ASTCDCompilationUnit astCD = ast.orElse(transformAndCreateSymbolTableForSymbolCD(astGrammar, cdScope)); createCDSymbolsForSuperGrammarsForSymbolCD(astGrammar, cdScope); storeSymbolCDForGrammar(astGrammar, astCD); return astCD; }  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 deriveSymbolCD(ASTMCGrammar astGrammar, CD4AnalysisGlobalScope cdScope) { Optional<ASTCDCompilationUnit> ast = TransformationHelper.getCDforGrammar(cdScope, astGrammar); ASTCDCompilationUnit astCD = ast.orElse(transformAndCreateSymbolTableForSymbolCD(astGrammar, cdScope)); createCDSymbolsForSuperGrammarsForSymbolCD(astGrammar, cdScope); storeSymbolCDForGrammar(astGrammar, astCD); return astCD; }  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();  }