aboutsummaryrefslogtreecommitdiff
path: root/src/main/model/html/HtmlParser.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/model/html/HtmlParser.java')
-rw-r--r--src/main/model/html/HtmlParser.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/model/html/HtmlParser.java b/src/main/model/html/HtmlParser.java
index d07a2ff..f0829f4 100644
--- a/src/main/model/html/HtmlParser.java
+++ b/src/main/model/html/HtmlParser.java
@@ -4,6 +4,8 @@ import java.util.*;
import model.util.Node;
import org.javatuples.*;
+import org.json.JSONObject;
+import persistance.JsonAble;
/**
* This class represents the state of and implements an LL(1) HTML parser.
@@ -18,7 +20,7 @@ import org.javatuples.*;
* SELF_CLOSING_TAG ::= 'img' | ...
* (note that \forall T \in SELF_CLOSING_TAG, T \notin TAG)
*/
-public class HtmlParser {
+public class HtmlParser implements JsonAble {
/**
* HTML is not nice to parse. We manage to get away with a relatively small number of parser states regardless.
@@ -343,6 +345,10 @@ public class HtmlParser {
return false;
}
}
+
+ public JSONObject serialize() {
+ return new JSONObject(this);
+ }
}
/*