16 static union ParseToken t;
19 void parse_token(ParseTokenType type, union ParseToken token);
20 void parse_set_section(char *section);
33 %token <integer> INTEGER
34 %token <string> STRING
35 %token <identifier> IDENTIFIER
37 %token <character> '('
38 %token <character> ')'
39 %token <character> '{'
40 %token <character> '}'
41 %token <character> '='
42 %token <character> ','
43 %token <character> '\n'
49 | sections '[' IDENTIFIER ']' { parse_set_section($3); } '\n' lines
53 | lines tokens '\n' { t.character = $3; parse_token(TOKEN_NEWLINE, t); }
62 REAL { t.real = $1; parse_token(TOKEN_REAL, t); }
63 | INTEGER { t.integer = $1; parse_token(TOKEN_INTEGER, t); }
64 | STRING { t.string = $1; parse_token(TOKEN_STRING, t); }
65 | IDENTIFIER { t.identifier = $1; parse_token(TOKEN_IDENTIFIER, t); }
66 | BOOL { t.bool = $1; parse_token(TOKEN_BOOL, t); }
67 | '(' { t.character = $1; parse_token(TOKEN_LBRACKET, t); }
68 | ')' { t.character = $1; parse_token(TOKEN_RBRACKET, t); }
69 | '{' { t.character = $1; parse_token(TOKEN_LBRACE, t); }
70 | '}' { t.character = $1; parse_token(TOKEN_RBRACE, t); }
71 | '=' { t.character = $1; parse_token(TOKEN_EQUALS, t); }
72 | ',' { t.character = $1; parse_token(TOKEN_COMMA, t); }
77 void yyerror(char *err) {
78 g_message("%s:%d: %s", path, yylineno, err);
83 /* try the user's rc */
84 path = g_build_filename(g_get_home_dir(), ".openbox", "rc3", NULL);
85 if ((yyin = fopen(path, "r")) == NULL) {
87 /* try the system wide rc */
88 path = g_build_filename(RCDIR, "rc3", NULL);
89 if ((yyin = fopen(path, "r")) == NULL) {
90 g_warning("No rc2 file found!");