this.extraPackage = extraPackage;
}
@Override
public void execute() throws BuildException {
ParserBean host;
try (InputStream is = new FileInputStream(original)) {
host = new CupSkinParser().parse(new InputStreamReader(is), original.getName());
} catch (Exception e) {
throw new BuildException(e);
}
Location newFCLoc = null;
try {
newFCLoc = host.getGrammar(CopperElementName.newName("_" + hostGrammar))
.getGrammarElement(CopperElementName.newName(newFC)).getLocation();
host.setStartSymbol(CopperElementReference.ref(CopperElementName.newName("_" + hostGrammar), newFC, newFCLoc));
} catch (ParseException e) {
throw new BuildException(e);
}
host.setClassName(newName);
host.setPackageDecl(newPackage);
if (!extraPackage.isEmpty())
host.setPreambleCode("import "+extraPackage+";"+host.getPreambleCode());
ParserCompilerParameters pcp = new ParserCompilerParameters();
pcp.setOutputFile(target);
pcp.setOutputType(CopperIOType.FILE);