Changeset 13608
- Timestamp:
- Sep 26, 2019 5:57:14 PM (2 months ago)
- Location:
- branches/dev-2468-2/Compiler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/dev-2468-2/Compiler/ModelicaCompiler/src/jastadd/UtilInterface.jrag
r13396 r13608 74 74 private File compilationOutputPath; 75 75 76 protected UtilInterface(ModelicaCompiler mc, OptionRegistry options, IErrorHandler eh, ExternalFunctionCache efc, File compilationOutputPath) {77 this.mc = mc;78 this.options = options;79 this.eh = eh;80 this.efc = efc;81 this.compilationOutputPath = compilationOutputPath;82 guidManager = new GUIDManager(ASTNode.vendorName(), options.getStringOption("compiler_version"));83 84 interfacers = new LinkedList<>();85 for (UtilInterface.Registrant registrant : registrants) {86 if (registrant.enabled(this)) {87 interfacers.add(registrant.getInterfacer(this));88 }89 }90 }91 92 76 public ModelicaCompiler getModelicaCompiler() { 93 77 return mc; … … 123 107 } 124 108 109 public static ModelicaCompiler ModelicaCompiler.create(UtilInterface uif) { 110 return new ModelicaCompiler(uif); 111 } 112 public ModelicaCompiler.ModelicaCompiler(UtilInterface uif) { 113 this.options = uif.getOptionRegistry(); 114 this.errorHandler = uif.getErrorHandler(); 115 this.externalFunctionCache = uif.getExternalFunctionCache(); 116 } 125 117 public static UtilInterface UtilInterface.create(ModelicaCompiler mc) { 126 118 return new UtilInterface(mc, mc.getOptions(), mc.getErrorHandler(), mc.getExternalFunctionCache(), null); 127 119 } 128 120 121 protected UtilInterface.UtilInterface(ModelicaCompiler mc, OptionRegistry options, IErrorHandler eh, ExternalFunctionCache efc, File compilationOutputPath) { 122 this.mc = mc; 123 this.options = options; 124 this.eh = eh; 125 this.efc = efc; 126 this.compilationOutputPath = compilationOutputPath; 127 guidManager = new GUIDManager(ASTNode.vendorName(), options.getStringOption("compiler_version")); 128 129 interfacers = new LinkedList<>(); 130 for (UtilInterface.Registrant registrant : registrants) { 131 if (registrant.enabled(this)) { 132 interfacers.add(registrant.getInterfacer(this)); 133 } 134 } 135 } 136 129 137 public static UtilInterface UtilInterface.create(OptionRegistry options) { 130 138 return new UtilInterface(null, options, new DefaultErrorHandler(), null, null); -
branches/dev-2468-2/Compiler/TestFramework/src/jastadd/TestCase.jrag
r13396 r13608 573 573 574 574 // Create a mock compiler to notify compilation listeners. 575 ModelicaCompiler.notifyCompilationStart(new ModelicaCompiler(uif.getOptionRegistry())); 575 ModelicaCompiler mc = ModelicaCompiler.create(uif); 576 uif = uif.create(mc); 577 ModelicaCompiler.notifyCompilationStart(mc); 576 578 577 579 // Parse
Note: See TracChangeset
for help on using the changeset viewer.