use of de.be4.classicalb.core.parser.exceptions.BCompoundException in project probparsers by bendisposto.
the class RulesMachineChecker method runChecks.
public void runChecks() throws BCompoundException {
start.apply(this);
if (!errorList.isEmpty()) {
final List<BException> bExceptionList = new ArrayList<>();
final String filePath = file == null ? "UnknownFile" : file.getAbsolutePath();
for (CheckException checkException : errorList) {
final BException bException = new BException(filePath, checkException);
bExceptionList.add(bException);
}
throw new BCompoundException(bExceptionList);
}
}
use of de.be4.classicalb.core.parser.exceptions.BCompoundException in project probparsers by bendisposto.
the class RulesParseUnit method readMachineFromFile.
public void readMachineFromFile(File file) {
this.machineFile = file;
try {
content = Utils.readFile(file);
this.machineFile = machineFile.getCanonicalFile();
} catch (IOException e) {
bCompoundException = new BCompoundException(new BException(file.getAbsolutePath(), e));
}
}
use of de.be4.classicalb.core.parser.exceptions.BCompoundException in project probparsers by bendisposto.
the class RulesReferencesFinder method findReferencedMachines.
public void findReferencedMachines() throws BCompoundException {
this.start.apply(this);
if (!errorList.isEmpty()) {
final List<BException> bExceptionList = new ArrayList<>();
for (CheckException checkException : errorList) {
final BException bException = new BException(mainFile.getAbsolutePath(), checkException);
bExceptionList.add(bException);
}
throw new BCompoundException(bExceptionList);
}
}
use of de.be4.classicalb.core.parser.exceptions.BCompoundException in project probparsers by bendisposto.
the class RulesProject method printPrologOutput.
public int printPrologOutput(final PrintStream out, final PrintStream err) {
if (!this.bExceptionList.isEmpty()) {
BCompoundException comp = new BCompoundException(bExceptionList);
PrologExceptionPrinter.printException(err, comp, parsingBehaviour.isUseIndention(), false);
return -2;
} else {
final IPrologTermOutput pout = new PrologTermOutput(new PrintWriter(out), false);
printProjectAsPrologTerm(pout);
pout.flush();
return 0;
}
}
use of de.be4.classicalb.core.parser.exceptions.BCompoundException in project probparsers by bendisposto.
the class RulesTransformation method runTransformation.
public void runTransformation() throws BCompoundException {
start.apply(this);
DefinitionInjector.injectDefinitions(start, iDefinitions);
MissingPositionsAdder.injectPositions(start);
if (!this.errorList.isEmpty()) {
List<BException> list = new ArrayList<>();
for (CheckException checkException : this.errorList) {
list.add(new BException(this.rulesMachineChecker.getFileName(), checkException));
}
throw new BCompoundException(list);
}
}
Aggregations