From: Dana Jansens Date: Thu, 3 Apr 2003 15:36:43 +0000 (+0000) Subject: try accomidate more versions of bison X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=2d81fb038b0690e73518a644ce73ff8c44565707;p=chaz%2Fopenbox try accomidate more versions of bison --- 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 #ifdef HAVE_STDIO_H # include #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 %token INTEGER %token 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); } ; %%