13 static union ParseToken t;
16 void parse_token(ParseTokenType type, union ParseToken token);
17 void parse_set_section(char *section);
30 %token <integer> INTEGER
31 %token <string> STRING
32 %token <identifier> IDENTIFIER
34 %token <character> '('
35 %token <character> ')'
36 %token <character> '{'
37 %token <character> '}'
38 %token <character> '='
39 %token <character> ','
40 %token <character> '\n'
46 | sections '[' IDENTIFIER ']' { parse_set_section($3); } '\n' lines
50 | lines tokens '\n' { t.character = $3; parse_token(TOKEN_NEWLINE, t); }
59 REAL { t.real = $1; parse_token(TOKEN_REAL, t); }
60 | INTEGER { t.integer = $1; parse_token(TOKEN_INTEGER, t); }
61 | STRING { t.string = $1; parse_token(TOKEN_STRING, t); }
62 | IDENTIFIER { t.identifier = $1; parse_token(TOKEN_IDENTIFIER, t); }
63 | BOOL { t.bool = $1; parse_token(TOKEN_BOOL, t); }
64 | '(' { t.character = $1; parse_token(TOKEN_LBRACKET, t); }
65 | ')' { t.character = $1; parse_token(TOKEN_RBRACKET, t); }
66 | '{' { t.character = $1; parse_token(TOKEN_LBRACE, t); }
67 | '}' { t.character = $1; parse_token(TOKEN_RBRACE, t); }
68 | '=' { t.character = $1; parse_token(TOKEN_EQUALS, t); }
69 | ',' { t.character = $1; parse_token(TOKEN_COMMA, t); }
74 void yyerror(char *err) {
75 g_message("%s:%d: %s", path, yylineno, err);
80 /* try the user's rc */
81 path = g_build_filename(g_get_home_dir(), ".openbox", "rc3", NULL);
82 if ((yyin = fopen(path, "r")) == NULL) {
84 /* try the system wide rc */
85 path = g_build_filename(RCDIR, "rc3", NULL);
86 if ((yyin = fopen(path, "r")) == NULL) {
87 g_warning("No rc2 file found!");