Skip to content
Snippets Groups Projects
Commit b26ab680 authored by Jan Gruteser's avatar Jan Gruteser
Browse files

move creation of helper classes to constructor of BAstCreator

parent fcc1c05a
Branches
Tags
No related merge requests found
Pipeline #148578 passed
......@@ -85,17 +85,15 @@ public class BAstCreator extends BuiltInOPs implements TranslationGlobals, BBuil
return false;
}
public BAstCreator(ModuleNode moduleNode, ConfigfileEvaluator conEval, SpecAnalyser specAnalyser,
UsedExternalFunctions usedExternalFunctions, PredicateVsExpression predicateVsExpression,
BMacroHandler bMacroHandler, RecursiveFunctionHandler recursiveFunctionHandler) {
this.predicateVsExpression = predicateVsExpression;
this.bMacroHandler = bMacroHandler;
this.recursiveFunctionHandler = recursiveFunctionHandler;
public BAstCreator(ModuleNode moduleNode, ConfigfileEvaluator conEval, SpecAnalyser specAnalyser) {
this.conEval = conEval;
this.moduleNode = moduleNode;
this.specAnalyser = specAnalyser;
this.usedExternalFunctions = usedExternalFunctions;
this.usedExternalFunctions = new UsedExternalFunctions(moduleNode, specAnalyser);
this.predicateVsExpression = new PredicateVsExpression(moduleNode);
this.bMacroHandler = new BMacroHandler(specAnalyser, conEval);
this.recursiveFunctionHandler = new RecursiveFunctionHandler(specAnalyser);
if (conEval != null) {
this.bConstants = conEval.getbConstantList();
......
......@@ -180,7 +180,9 @@ public class Translator implements TranslationGlobals {
ConfigfileEvaluator conEval = null;
if (modelConfig != null) {
// evaluate config file (get overrides and assignments):
conEval = new ConfigfileEvaluator(modelConfig, moduleNode);
// apply overrides from config file:
ModuleOverrider.run(moduleNode, conEval);
specAnalyser = SpecAnalyser.createSpecAnalyser(moduleNode, conEval);
} else {
......@@ -190,11 +192,7 @@ public class Translator implements TranslationGlobals {
typechecker = new TypeChecker(moduleNode, conEval, specAnalyser);
typechecker.start();
SymbolRenamer.run(moduleNode, specAnalyser);
bAstCreator = new BAstCreator(moduleNode, conEval, specAnalyser,
new UsedExternalFunctions(moduleNode, specAnalyser),
new PredicateVsExpression(moduleNode),
new BMacroHandler(specAnalyser, conEval),
new RecursiveFunctionHandler(specAnalyser));
bAstCreator = new BAstCreator(moduleNode, conEval, specAnalyser);
this.moduleFiles = bAstCreator.getFilesOrderedById().stream()
.map(file -> new File(parentPath, file + ".tla")).collect(Collectors.toList());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment