Some basic auto{conf,make} stuff..
[liboconfig.git] / src / parser.y
index 82e89a9..ca0844e 100644 (file)
@@ -2,6 +2,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include "oconfig.h"
+#include "scanner.h"
 
 struct statement_list_s
 {
@@ -51,6 +52,7 @@ static void dump_ci (oconfig_item_t *ci, int shift);
 %type <ci> option
 %type <ci> statement
 %type <sl> statement_list
+%type <ci> entire_file
 
 %%
 string:
@@ -163,33 +165,12 @@ statement_list:
 entire_file:
        statement_list
        {
-        int i;
-        for (i = 0; i < $1.statement_num; i++)
-               dump_ci ($1.statement + i, 0);
+        $$.children = $1.statement;
+        $$.children_num = $1.statement.num;
        }
        ;
 
 %%
-#include "lex.yy.c"
-
-/*
-void yyerror (char *s)
-{
-       fprintf (stderr, "%s\n", s);
-}
-
-int yylex (void)
-{
-       return (getc (stdin));
-}
-*/
-
-int main (int argc, char **argv)
-{
-       yyparse ();
-       return (0);
-}
-
 static char *unquote (const char *orig)
 {
        char *ret = strdup (orig);