use of xcodeml.util.XmOptionLocal in project claw-compiler by C2SM-RCM.
the class ClawX2T method createCfg.
public static Configuration createCfg(ConfigurationOptions opts) throws Exception {
// Set decompiler options
IXmOption xmOption = new XmOptionLocal();
if (opts.suppressPreprocLineDirectives()) {
xmOption.setIsSuppressLineDirective(true);
}
if (opts.showDebugOutput()) {
xmOption.setDebugOutput(true);
}
if (opts.addParenToBinaryOpts()) {
xmOption.setAddPar(true);
}
// Prepare configuration
final Context transContext = new Context(System.err, xmOption);
final Configuration cfg = Configuration.load(opts.configDirPath(), opts.configFilePath(), opts.modelConfigFilePath(), opts.targetPlatform(), opts.accDirectiveLanguage(), opts.maxFortranLineLength(), transContext, opts.transSetPaths());
for (String keyValue : opts.cfgKeysOverrides()) {
String key = keyValue.substring(0, keyValue.indexOf(":"));
String value = keyValue.substring(keyValue.indexOf(":") + 1);
cfg.overrideConfigurationParameter(key, value);
}
if (opts.exitOnPureFunction()) {
cfg.setForcePure();
}
return cfg;
}
Aggregations