Commit ba08a508 authored by Alexandru Dura's avatar Alexandru Dura
Browse files

Passing the 1st pretty printing test

parent 7548dc81
......@@ -2,6 +2,7 @@ public class EarleyRule implements Comparable<EarleyRule> {
int body[];
int head;
public EarleyRule(int head, int body[]) {
this.head = head;
this.body = body;
}
......
......@@ -16,6 +16,8 @@ public class EarleyParserTest {
EarleyParser parser = new EarleyParser();
parser.addCategory(num);
parser.addCategory(var);
parser.addCategory(plus);
parser.addCategory(times);
parser.addCategory(s);
parser.addCategory(p);
parser.addCategory(t);
......@@ -31,6 +33,7 @@ public class EarleyParserTest {
System.out.println(parser);
assertEquals("Abc", parser.toString());
assertEquals("s -> s <+> p \ns -> p \np -> p <*> t \np -> t \nt -> <VAR> \nt -> <NUM> \n",
parser.toString());
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment