use of de.be4.eventbalg.core.parser.parser.Parser in project probparsers by bendisposto.
the class DropHaskellRegressionTests method test.
@Test
public void test() throws BCompoundException, IOException {
String name = "src/test/resources/parsable/InfiniteParityFunction.mch";
BParser parser = new BParser(name);
parser.parseFile(new File(name), false);
String code = "not(finite({x|x>2}))";
BParser parser2 = new BParser(name);
parser2.getDefinitions().addDefinitions(parser.getDefinitions());
Start parse = parser2.parse(BParser.FORMULA_PREFIX + " " + code, false, parser.getContentProvider());
assertNotNull(parse);
}
use of de.be4.eventbalg.core.parser.parser.Parser in project probparsers by bendisposto.
the class ParseableButProblematicOnWindowsUnixLF 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.eventbalg.core.parser.parser.Parser in project probparsers by bendisposto.
the class StringLiteralNotClosedTest 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.eventbalg.core.parser.parser.Parser in project probparsers by bendisposto.
the class SatProblem method getTreeAsString.
private String getTreeAsString(final String testMachine) throws BCompoundException, LexerException, IOException {
final BParser parser = new BParser("testcase");
Start ast = parser.eparse(testMachine, new Definitions());
final Ast2String ast2String = new Ast2String();
ast.apply(ast2String);
final String string = ast2String.toString();
return string;
}
use of de.be4.eventbalg.core.parser.parser.Parser in project probparsers by bendisposto.
the class PredVarsTest method getTreeAsString.
private String getTreeAsString(final String testMachine) throws BCompoundException, LexerException, IOException {
final BParser parser = new BParser("testcase");
Start ast = parser.eparse(testMachine, new Definitions());
final Ast2String ast2String = new Ast2String();
ast.apply(ast2String);
final String string = ast2String.toString();
return string;
}
Aggregations