use of de.be4.classicalb.core.parser.CachingDefinitionFileProvider in project probparsers by bendisposto.
the class RulesParseUnit method parse.
public void parse() {
if (this.bCompoundException != null) {
return;
}
try {
bParser = null;
if (machineFile != null) {
bParser = new BParser(machineFile.getPath());
bParser.setDirectory(machineFile.getParentFile());
} else {
bParser = new BParser();
}
ParseOptions parseOptions = new ParseOptions();
parseOptions.setGrammar(RulesGrammar.getInstance());
bParser.setParseOptions(parseOptions);
start = bParser.parse(content, debugOuput, new CachingDefinitionFileProvider());
refFinder = new RulesReferencesFinder(machineFile, start);
refFinder.findReferencedMachines();
this.machineReferences = refFinder.getReferences();
this.machineName = refFinder.getName();
this.rulesMachineChecker = new RulesMachineChecker(machineFile, bParser.getFileName(), machineReferences, start);
rulesMachineChecker.runChecks();
this.operationList.addAll(rulesMachineChecker.getOperations());
} catch (BCompoundException e) {
// store parser exceptions
this.bCompoundException = e;
}
}
use of de.be4.classicalb.core.parser.CachingDefinitionFileProvider in project prob2 by bendisposto.
the class ClassicalBFactory method create.
public ExtractedModel<ClassicalBModel> create(final Start model) {
ClassicalBModel classicalBModel = modelCreator.get();
BParser bparser = new BParser();
final RecursiveMachineLoader rml = parseAllMachines(model, ".", new File(""), new CachingDefinitionFileProvider(), bparser);
classicalBModel = classicalBModel.create(model, rml, new File("from_string"), bparser);
return new ExtractedModel<>(classicalBModel, classicalBModel.getMainMachine());
}
Aggregations