aboutsummaryrefslogtreecommitdiff
path: root/src/main/model/css/CssTree.java
diff options
context:
space:
mode:
authorj-james2022-10-17 06:58:44 +0000
committerj-james2022-10-17 07:00:53 +0000
commit0caf1994dae8e88f7c219bedd87b65190b88aa89 (patch)
tree6b9302c64eb74194e8ed1f267ec711c038b514cd /src/main/model/css/CssTree.java
parent3e9bb5fae16c35938bc1f7f7669c12cc355c9331 (diff)
Implement LL(1) parsers for HTML and CSS
Diffstat (limited to 'src/main/model/css/CssTree.java')
-rw-r--r--src/main/model/css/CssTree.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/main/model/css/CssTree.java b/src/main/model/css/CssTree.java
new file mode 100644
index 0000000..1829327
--- /dev/null
+++ b/src/main/model/css/CssTree.java
@@ -0,0 +1,54 @@
+package model.css;
+
+import java.util.ArrayList;
+
+/**
+ * This isn't really a tree. Do I even need this class?
+ */
+public class CssTree {
+ public class CssProperty {
+ private String attribute;
+ private String value;
+
+ public CssProperty(String attribute, String value) {
+ this.attribute = attribute;
+ this.value = value;
+ }
+
+ public String getAttribute() {
+ return attribute;
+ }
+
+ public String getValue() {
+ return value;
+ }
+ }
+
+ public class CssRule {
+ private String selectors;
+ private ArrayList<CssProperty> properties;
+
+ public CssRule(String selectors, ArrayList<CssProperty> properties) {
+ this.selectors = selectors;
+ this.properties = properties;
+ }
+
+ public String getSelectors() {
+ return this.selectors;
+ }
+
+ public ArrayList<CssProperty> getProperties() {
+ return this.properties;
+ }
+ }
+
+ private ArrayList<CssRule> rules;
+
+ public CssTree(ArrayList<CssRule> rules) {
+ this.rules = rules;
+ }
+
+ public ArrayList<CssRule> getRules() {
+ return this.rules;
+ }
+}