X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fparse.y;h=7e92efd6767dc8e6e703fab08ceee9b8b1066b2c;hb=cea19c78c1d3bccb356fce21cda4a2fc85afce1b;hp=125f18038dc02bee22cf9d1f9929232e10421a14;hpb=cbbf90a718ecc6836ef7a77b9040aebb9da348b8;p=chaz%2Fopenbox diff --git a/openbox/parse.y b/openbox/parse.y index 125f1803..7e92efd6 100644 --- a/openbox/parse.y +++ b/openbox/parse.y @@ -17,13 +17,15 @@ } %{ +#define NO_TAB_H #include "parse.h" +#undef NO_TAB_H extern int yylex(); extern int yyparse(); void yyerror(char *err); -extern int yylineno; +extern int lineno; extern FILE *yyin; static char *path; @@ -39,7 +41,7 @@ void parse_set_section(char *section); %token INTEGER %token STRING %token IDENTIFIER -%token BOOL +%token BOOLEAN %token '(' %token ')' %token '{' @@ -56,14 +58,14 @@ void parse_set_section(char *section); sections: | sections '[' IDENTIFIER ']' { parse_set_section($3); } '\n' - { ++yylineno; } lines + { ++lineno; } lines ; lines: | lines tokens { t.type='\n'; t.data.character='\n'; parse_token(&t); } '\n' - { ++yylineno; } + { ++lineno; } | lines IDENTIFIER '=' listtoken { parse_assign($2, &t); } '\n' - { ++yylineno; } + { ++lineno; } ; tokens: @@ -76,7 +78,7 @@ token: | INTEGER { t.type = TOKEN_INTEGER; t.data.integer = $1; } | STRING { t.type = TOKEN_STRING; t.data.string = $1; } | IDENTIFIER { t.type = TOKEN_IDENTIFIER; t.data.identifier = $1; } - | BOOL { t.type = TOKEN_BOOL; t.data.bool = $1; } + | BOOLEAN { t.type = TOKEN_BOOL; t.data.bool = $1; } | list { t.type = TOKEN_LIST; t.data.list = $1; } | '{' { t.type = $1; t.data.character = $1; } | '}' { t.type = $1; t.data.character = $1; } @@ -105,7 +107,7 @@ listtoken: | INTEGER { t.type = TOKEN_INTEGER; t.data.integer = $1; } | STRING { t.type = TOKEN_STRING; t.data.string = $1; } | IDENTIFIER { t.type = TOKEN_IDENTIFIER; t.data.identifier = $1; } - | BOOL { t.type = TOKEN_BOOL; t.data.bool = $1; } + | BOOLEAN { t.type = TOKEN_BOOL; t.data.bool = $1; } | list { t.type = TOKEN_LIST; t.data.list = $1; } | '{' { t.type = $1; t.data.character = $1; } | '}' { t.type = $1; t.data.character = $1; } @@ -115,8 +117,10 @@ listtoken: %% +int lineno; + void yyerror(char *err) { - g_message("%s:%d: %s", path, yylineno, err); + g_message("%s:%d: %s", path, lineno, err); } void parse_rc() @@ -134,7 +138,7 @@ void parse_rc() } } - yylineno = 1; + lineno = 1; yyparse();