use of util.Ast2String in project probparsers by bendisposto.
the class ParseTestUtil method parse.
private static String parse(final String input) throws BCompoundException {
final BParser parser = new BParser();
final Start ast = parser.parse(input, false);
final Ast2String ast2String = new Ast2String();
ast.apply(ast2String);
return ast2String.toString();
}
use of util.Ast2String 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 util.Ast2String 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 util.Ast2String 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;
}
use of util.Ast2String in project probparsers by bendisposto.
the class SubstitutionTest method getTreeAsString.
private String getTreeAsString(final String testMachine) throws BCompoundException {
// System.out.println("Parsing \"" + testMachine + "\"");
final BParser parser = new BParser("testcase");
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;
}
Aggregations