aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2024-07-24 11:23:43 +0200
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2024-07-24 11:23:43 +0200
commit59852a307d7094dfe9d3844a45f73e8f4eb73354 (patch)
treec4bc0601ce8c354656c75f9ac8a05939ded49ca3
parent031bb53552b5b2675b1c3afb57a27b28cb5d379e (diff)
downloadproperties-59852a307d7094dfe9d3844a45f73e8f4eb73354.tar.gz
properties-59852a307d7094dfe9d3844a45f73e8f4eb73354.zip
Add rules to parse a single and multiple properties
-rw-r--r--properties.y12
1 files changed, 12 insertions, 0 deletions
diff --git a/properties.y b/properties.y
index a765c8a..dcb7fb2 100644
--- a/properties.y
+++ b/properties.y
@@ -15,6 +15,18 @@
%%
+properties: property
+ | properties property
+ ;
+
+property: KEY DIV value {
+ printf("<%s> ---> <%s>\n", $1.value, $3.value);
+ }
+ | KEY DIV {
+ printf("<%s> ---> NO VALUE\n", $1.value);
+ }
+ ;
+
value: VALUE {
$$.value = calloc(2, sizeof(char));
strcat($$.value, $1.value);