Search in sources :

Example 46 with Node

use of suite.node.Node in project suite by stupidsing.

the class FormatterTest method testDump.

private void testDump(String s) {
    Node node = Suite.parse(s);
    assertEquals(s, Formatter.dump(node));
}
Also used : Node(suite.node.Node)

Example 47 with Node

use of suite.node.Node in project suite by stupidsing.

the class FormatterTest method testDisplay.

private void testDisplay(String s) {
    Node node = Suite.parse(s);
    assertEquals(s, Formatter.display(node));
}
Also used : Node(suite.node.Node)

Example 48 with Node

use of suite.node.Node in project suite by stupidsing.

the class IterativeParserTest method testParseException.

@Test
public void testParseException() {
    try {
        Node node = iterativeParser.parse("(a");
        System.out.println(node);
        assertNotNull(Tree.decompose(node).getLeft());
        throw new AssertionError();
    } catch (RuntimeException ex) {
    }
}
Also used : Node(suite.node.Node) Test(org.junit.Test)

Example 49 with Node

use of suite.node.Node in project suite by stupidsing.

the class IterativeParserTest method testParseFile.

@Test
public void testParseFile() {
    String in = FileUtil.read("src/main/ll/fc/fc.sl");
    Node node = iterativeParser.parse(in);
    System.out.println(new PrettyPrinter().prettyPrint(node));
    assertNotNull(Tree.decompose(node));
}
Also used : PrettyPrinter(suite.node.pp.PrettyPrinter) Node(suite.node.Node) Test(org.junit.Test)

Example 50 with Node

use of suite.node.Node in project suite by stupidsing.

the class ParserCompareTest method test.

private void test(String in) {
    Node n0 = iterativeParser.parse(in);
    Node n1 = recursiveParser.parse(in);
    assertEquals(n0, n1);
}
Also used : Node(suite.node.Node)

Aggregations

Node (suite.node.Node)139 Tree (suite.node.Tree)50 Reference (suite.node.Reference)41 Atom (suite.node.Atom)37 Int (suite.node.Int)33 ArrayList (java.util.ArrayList)32 Pair (suite.adt.pair.Pair)25 List (java.util.List)24 TermOp (suite.node.io.TermOp)21 Read (suite.streamlet.Read)21 Test (org.junit.Test)20 Map (java.util.Map)19 Suite (suite.Suite)18 Generalizer (suite.lp.doer.Generalizer)18 Fail (suite.util.Fail)18 Fun (suite.util.FunUtil.Fun)18 Str (suite.node.Str)17 Trail (suite.lp.Trail)16 RuleSet (suite.lp.kb.RuleSet)16 Tuple (suite.node.Tuple)16