use of org.metaborg.spoofax.meta.core.pluto.stamp.Sdf2ParenthesizeStamper in project spoofax by metaborg.
the class Sdf2ParenthesizeLegacy method build.
@Override
public None build(Input input) throws IOException {
requireBuild(input.origin);
if (SpoofaxContext.BETTER_STAMPERS) {
require(input.inputFile, new Sdf2ParenthesizeStamper(input.context));
} else {
require(input.inputFile);
}
// @formatter:off
final Arguments arguments = new Arguments().addFile("-i", input.inputFile).add("-m", input.inputModule).add("--lang", input.inputModule).add("--omod", input.outputModule).addFile("-o", input.outputFile).add("--main-strategy", "io-" + input.inputModule + "-parenthesize").add("--rule-prefix", input.inputModule).add("--sig-module", "signatures/-");
final ExecutionResult result = new StrategoExecutor().withToolsContext().withStrategy(main_sdf2parenthesize_0_0.instance).withTracker(newResourceTracker(Pattern.quote("[ sdf2parenthesize | info ]") + ".*", Pattern.quote("Invoking native tool") + ".*")).withName("sdf2parenthesize").executeCLI(arguments);
if (!result.success) {
FileCommands.writeToFile(input.outputFile, "module " + input.inputModule + "\nrules\n\n parenthesize-" + input.inputModule + " = id");
}
// @formatter:on
provide(input.outputFile);
return None.val;
}
Aggregations