diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-04-03 15:36:43 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-04-03 15:36:43 +0000 |
| commit | 2d81fb038b0690e73518a644ce73ff8c44565707 (patch) | |
| tree | 6adbfca08f73eb9a741d3109464dd39b22ea8da0 /openbox/parse.y | |
| parent | ff113a7eea59f8e94d47f3d9f156fb895897e36f (diff) | |
try accomidate more versions of bison
Diffstat (limited to 'openbox/parse.y')
| -rw-r--r-- | openbox/parse.y | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/openbox/parse.y b/openbox/parse.y index e9b469e0..bc77fd9a 100644 --- a/openbox/parse.y +++ b/openbox/parse.y @@ -1,10 +1,26 @@ %{ -#include "parse.h" +#include <glib.h> #ifdef HAVE_STDIO_H # include <stdio.h> #endif +%} + +%union ParseToken { + float real; + int integer; + char *string; + char *identifier; + gboolean bool; + char character; +} + +%{ +#include "parse.h" + extern int yylex(); +/*extern int yyparse();*/ +/*void yyerror(char *err);*/ extern int yylineno; extern FILE *yyin; @@ -17,15 +33,6 @@ void parse_token(ParseTokenType type, union ParseToken token); void parse_set_section(char *section); %} -%union ParseToken { - float real; - int integer; - char *string; - char *identifier; - gboolean bool; - char character; -} - %token <real> REAL %token <integer> INTEGER %token <string> STRING @@ -47,7 +54,7 @@ sections: ; lines: - | lines tokens '\n' { t.character = $3; parse_token(TOKEN_NEWLINE, t); } + | lines tokens '\n' { t.character = $3; parse_token($3, t); } ; tokens: @@ -56,17 +63,17 @@ tokens: ; token: - REAL { t.real = $1; parse_token(TOKEN_REAL, t); } - | INTEGER { t.integer = $1; parse_token(TOKEN_INTEGER, t); } - | STRING { t.string = $1; parse_token(TOKEN_STRING, t); } - | IDENTIFIER { t.identifier = $1; parse_token(TOKEN_IDENTIFIER, t); } - | BOOL { t.bool = $1; parse_token(TOKEN_BOOL, t); } - | '(' { t.character = $1; parse_token(TOKEN_LBRACKET, t); } - | ')' { t.character = $1; parse_token(TOKEN_RBRACKET, t); } - | '{' { t.character = $1; parse_token(TOKEN_LBRACE, t); } - | '}' { t.character = $1; parse_token(TOKEN_RBRACE, t); } - | '=' { t.character = $1; parse_token(TOKEN_EQUALS, t); } - | ',' { t.character = $1; parse_token(TOKEN_COMMA, t); } + REAL { t.real = $1; parse_token(REAL, t); } + | INTEGER { t.integer = $1; parse_token(INTEGER, t); } + | STRING { t.string = $1; parse_token(STRING, t); } + | IDENTIFIER { t.identifier = $1; parse_token(IDENTIFIER, t); } + | BOOL { t.bool = $1; parse_token(BOOL, t); } + | '(' { t.character = $1; parse_token($1, t); } + | ')' { t.character = $1; parse_token($1, t); } + | '{' { t.character = $1; parse_token($1, t); } + | '}' { t.character = $1; parse_token($1, t); } + | '=' { t.character = $1; parse_token($1, t); } + | ',' { t.character = $1; parse_token($1, t); } ; %% |
