Skip to content

Commit

Permalink
Merge branch 'dtsl-TOP' into 'dev'
Browse files Browse the repository at this point in the history
Fix hand-written-code-path for DSTL-infrastructure

See merge request monticore/monticore!1033
  • Loading branch information
MisterErwin committed Oct 2, 2024
2 parents 026b7d9 + 68349f0 commit 5fd8e42
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ public void generateDSTLanguage(ASTMCGrammar astGrammar, File grammarOut, MCPath
dstlgenUtil.generateDSTL(astGrammar, gext, dstlGlex, grammarOut);
}

public void generateDSTInfrastructure(ASTMCGrammar astTRGrammar, File out, MCPath modelPathHC) {
public void generateDSTInfrastructure(ASTMCGrammar astTRGrammar, File out, MCPath codePathHC) {
if(!astTRGrammar.getSymbol().getName().endsWith("TR") || astTRGrammar.getPackageList().stream().noneMatch(p -> p.equals("tr"))) {
Log.error("0xA1018 Unable to generate DST infrastructure on non-TR Grammar:" + astTRGrammar.getSymbol().getFullName());
return;
Expand All @@ -1373,13 +1373,13 @@ public void generateDSTInfrastructure(ASTMCGrammar astTRGrammar, File out, MCPat
// No D2, D3: TR Grammar is already present (see generateDSTLanguage)

// D4 Generate context conditions
dstlgenUtil.generateDSTLCoCos(astGrammar, dstlGenerator, modelPathHC, dstlGlex);
dstlgenUtil.generateDSTLCoCos(astGrammar, dstlGenerator, codePathHC, dstlGlex);

// D5 Generate DSTL to ODRule translator
dstlgenUtil.generateTranslator(astGrammar, dstlGenerator, modelPathHC);
dstlgenUtil.generateTranslator(astGrammar, dstlGenerator, codePathHC);

// D6 Generate TFGenTool class
dstlgenUtil.generateTFGenToolClass(astGrammar, dstlGenerator, modelPathHC);
dstlgenUtil.generateTFGenToolClass(astGrammar, dstlGenerator, codePathHC);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ while (grammarIterator.hasNext()) {

if (genDST) {
// Generate infrastructure for domain-specific transformation IFF this task is run on a TR grammar
generateDSTInfrastructure(astGrammar, out, modelPathHC)
generateDSTInfrastructure(astGrammar, out, handcodedPath)
} else {
// Generate a DSTL (ending in TR.mc4)
generateDSTLanguage(astGrammar, out, modelPathHC)
Expand All @@ -119,4 +119,4 @@ while (grammarIterator.hasNext()) {

if (toolName.isPresent()) {
generateLaunchScripts(glex, out, toolName.get())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ while (grammarIterator.hasNext()) {

if (genDST) {
// Generate infrastructure for domain-specific transformation IFF this task is run on a TR grammar
generateDSTInfrastructure(astGrammar, out, modelPathHC)
generateDSTInfrastructure(astGrammar, out, handcodedPath)
} else {
// Generate a DSTL (ending in TR.mc4)
generateDSTLanguage(astGrammar, out, modelPathHC)
Expand All @@ -124,4 +124,4 @@ if (toolName.isPresent()) {
generateLaunchScripts(glex, out, toolName.get())
}

reportManagerFactory.close()
reportManagerFactory.close()
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ while (grammarIterator.hasNext()) {

if (genDST) {
// Generate infrastructure for domain-specific transformation IFF this task is run on a TR grammar
generateDSTInfrastructure(astGrammar, out, modelPathHC)
generateDSTInfrastructure(astGrammar, out, handcodedPath)
} else {
// Generate a DSTL (ending in TR.mc4)
generateDSTLanguage(astGrammar, out, modelPathHC)
Expand All @@ -127,4 +127,4 @@ while (grammarIterator.hasNext()) {

if (toolName.isPresent()) {
generateLaunchScripts(glex, out, toolName.get())
}
}

0 comments on commit 5fd8e42

Please sign in to comment.