Skip to content
Snippets Groups Projects
Commit f26f7af2 authored by Noah Heuser's avatar Noah Heuser
Browse files

removed false commas in Grammar toString()

parent cd90724d
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,7 @@ public abstract class Grammar {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("G = (V, T, R, " + this.getStart() + "),\\n");
sb.append("G = (V, T, R, " + this.getStart() + ")\\n");
sb.append("V = {");
for (int i = 0; i < this.getVars().length; i++) {
sb.append(this.getVars()[i]);
......@@ -61,7 +61,7 @@ public abstract class Grammar {
sb.append(", ");
}
}
sb.append("},\\n");
sb.append("}\\n");
sb.append("T = {");
for (int i = 97; i < 97 + this.getAlphaSize(); i++) {
sb.append((char) i);
......@@ -69,7 +69,7 @@ public abstract class Grammar {
sb.append(", ");
}
}
sb.append("},\\n");
sb.append("}\\n");
sb.append("R = {");
Iterator<Entry<String, List<List<String>>>> it = this.getRules().entrySet().iterator();
while (it.hasNext()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment