Search in sources :

Example 1 with XmOptionLocal

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;
}
Also used : Context(claw.tatsu.common.Context) IXmOption(xcodeml.util.IXmOption) Configuration(claw.wani.x2t.configuration.Configuration) XmOptionLocal(xcodeml.util.XmOptionLocal)

Aggregations

Context (claw.tatsu.common.Context)1 Configuration (claw.wani.x2t.configuration.Configuration)1 IXmOption (xcodeml.util.IXmOption)1 XmOptionLocal (xcodeml.util.XmOptionLocal)1