From 59852a307d7094dfe9d3844a45f73e8f4eb73354 Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Wed, 24 Jul 2024 11:23:43 +0200 Subject: Add rules to parse a single and multiple properties --- properties.y | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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); -- cgit v1.2.3