diff options
-rw-r--r-- | properties.l | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/properties.l b/properties.l index 73803fc..67a5c2a 100644 --- a/properties.l +++ b/properties.l @@ -10,54 +10,3 @@ . return VALUE; %% - -struct Properties { - char *key; - char *value; - struct Properties *next; -}; - -int -main(void) -{ - int token; - int next_token = KEY; - struct Properties properties; - properties.next = NULL; - - char *key; - char *value = calloc(2048, sizeof(char)); - int v = 0; - - do { - v = 0; - value = calloc(2048, sizeof(char)); - - token = yylex(); - - if (next_token == VALUE) { - if (token == VALUE) { - do { - *(value + v) = *yytext; - v++; - } while ((token = yylex()) == VALUE); - } - - next_token = KEY; - printf("%s --> %s|\n", key, value); - } - - if (token == KEY && next_token == KEY) { - next_token = DIV; - key = strdup(yytext); - } else if (token == DIV && next_token == DIV) { - next_token = VALUE; - } - } while (token != 0); - - while (properties.next != NULL) { - printf("%s ---> %s\n", properties.key, properties.value); - } - - return EXIT_SUCCESS; -} |