Search in sources :

Example 11 with Ast2String

use of util.Ast2String in project probparsers by bendisposto.

the class Ticket295 method getTreeAsString.

private String getTreeAsString(final Start startNode) throws BException {
    final Ast2String ast2String = new Ast2String();
    startNode.apply(ast2String);
    final String string = ast2String.toString();
    return string;
}
Also used : Ast2String(util.Ast2String) Ast2String(util.Ast2String)

Example 12 with Ast2String

use of util.Ast2String in project probparsers by bendisposto.

the class LetPredicateTest method getTreeAsString.

private String getTreeAsString(final String testMachine) throws BCompoundException {
    final Start startNode = parser.parse(testMachine, false);
    final Ast2String ast2String = new Ast2String();
    startNode.apply(ast2String);
    return ast2String.toString();
}
Also used : Start(de.be4.classicalb.core.parser.node.Start) Ast2String(util.Ast2String)

Example 13 with Ast2String

use of util.Ast2String in project probparsers by bendisposto.

the class StructuralTest 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();
    return string;
}
Also used : Start(de.be4.classicalb.core.parser.node.Start) Ast2String(util.Ast2String) Ast2String(util.Ast2String)

Example 14 with Ast2String

use of util.Ast2String in project probparsers by bendisposto.

the class SyntaxErrorsDetectedOnTokenStreamTest 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();
    return string;
}
Also used : Start(de.be4.classicalb.core.parser.node.Start) Ast2String(util.Ast2String) Ast2String(util.Ast2String)

Example 15 with Ast2String

use of util.Ast2String in project probparsers by bendisposto.

the class PrimedIdentifierTest method getTreeAsString.

private String getTreeAsString(final String testMachine) throws BCompoundException {
    final Start startNode = parser.parse(testMachine, false);
    final Ast2String ast2String = new Ast2String();
    startNode.apply(ast2String);
    return ast2String.toString();
}
Also used : Start(de.be4.classicalb.core.parser.node.Start) Ast2String(util.Ast2String)

Aggregations

Ast2String (util.Ast2String)20 Start (de.be4.classicalb.core.parser.node.Start)19 BParser (de.be4.classicalb.core.parser.BParser)8 Definitions (de.be4.classicalb.core.parser.Definitions)2