use of de.be4.eventb.core.parser.parser.Parser in project probparsers by bendisposto.
the class ErrorMessagesTest method getTreeAsString.
private String getTreeAsString(final String testMachine) throws BCompoundException {
// System.out.println("Parsing \"" + testMachine + "\"");
final BParser parser = new BParser("testcase");
parser.getOptions().setGrammar(RulesGrammar.getInstance());
final Start startNode = parser.parse(testMachine, false);
// startNode.apply(new ASTPrinter());
final Ast2String ast2String = new Ast2String();
startNode.apply(ast2String);
final String string = ast2String.toString();
// System.out.println(string);
return string;
}
use of de.be4.eventb.core.parser.parser.Parser in project probparsers by bendisposto.
the class ExploreSourcePositionTest method test.
@Test
public void test() throws BCompoundException, IOException {
final BParser parser = new BParser("m");
Start parse = parser.parseFile(new File("src/test/resources/LabelTest.mch"), false);
parse.apply(new ASTPrinter());
assertTrue(true);
}
use of de.be4.eventb.core.parser.parser.Parser in project probparsers by bendisposto.
the class ParsableMachineTest method testParsable.
@Test
public void testParsable() throws Exception {
final BParser parser = new BParser(machine.getName());
Start start = parser.parseFile(machine, false);
start.apply(new PositionTester());
assertNotNull(start);
}
use of de.be4.eventb.core.parser.parser.Parser in project probparsers by bendisposto.
the class SatProblem method getTreeAsStringOrg.
private String getTreeAsStringOrg(final String testMachine) throws BCompoundException {
final BParser parser = new BParser("testcase");
final Start startNode = parser.parse(testMachine, false);
final Ast2String ast2String = new Ast2String();
startNode.apply(ast2String);
final String string = ast2String.toString();
return string;
}
use of de.be4.eventb.core.parser.parser.Parser in project probparsers by bendisposto.
the class PredVarsTest method getTreeAsStringOrg.
private String getTreeAsStringOrg(final String testMachine) throws BCompoundException {
final BParser parser = new BParser("testcase");
final Start startNode = parser.parse(testMachine, false);
final Ast2String ast2String = new Ast2String();
startNode.apply(ast2String);
final String string = ast2String.toString();
return string;
}
Aggregations