23 void yyerror(char *err);
29 static union ParseToken t;
32 void parse_token(ParseTokenType type, union ParseToken token);
33 void parse_set_section(char *section);
37 %token <integer> INTEGER
38 %token <string> STRING
39 %token <identifier> IDENTIFIER
41 %token <character> '('
42 %token <character> ')'
43 %token <character> '{'
44 %token <character> '}'
45 %token <character> '='
46 %token <character> ','
47 %token <character> '\n'
53 | sections '[' IDENTIFIER ']' { parse_set_section($3); } '\n' lines
57 | lines tokens '\n' { t.character = $3; parse_token($3, t); }
66 REAL { t.real = $1; parse_token(REAL, t); }
67 | INTEGER { t.integer = $1; parse_token(INTEGER, t); }
68 | STRING { t.string = $1; parse_token(STRING, t); }
69 | IDENTIFIER { t.identifier = $1; parse_token(IDENTIFIER, t); }
70 | BOOL { t.bool = $1; parse_token(BOOL, t); }
71 | '(' { t.character = $1; parse_token($1, t); }
72 | ')' { t.character = $1; parse_token($1, t); }
73 | '{' { t.character = $1; parse_token($1, t); }
74 | '}' { t.character = $1; parse_token($1, t); }
75 | '=' { t.character = $1; parse_token($1, t); }
76 | ',' { t.character = $1; parse_token($1, t); }
81 void yyerror(char *err) {
82 g_message("%s:%d: %s", path, yylineno, err);
87 /* try the user's rc */
88 path = g_build_filename(g_get_home_dir(), ".openbox", "rc3", NULL);
89 if ((yyin = fopen(path, "r")) == NULL) {
91 /* try the system wide rc */
92 path = g_build_filename(RCDIR, "rc3", NULL);
93 if ((yyin = fopen(path, "r")) == NULL) {
94 g_warning("No rc2 file found!");