8 BIND_SHIFT = XCB_MOD_MASK_SHIFT, /* (1 << 0) */
9 BIND_CONTROL = XCB_MOD_MASK_CONTROL, /* (1 << 2) */
10 BIND_MOD1 = XCB_MOD_MASK_1, /* (1 << 3) */
11 BIND_MOD2 = XCB_MOD_MASK_2, /* (1 << 4) */
12 BIND_MOD3 = XCB_MOD_MASK_3, /* (1 << 5) */
13 BIND_MOD4 = XCB_MOD_MASK_4, /* (1 << 6) */
14 BIND_MOD5 = XCB_MOD_MASK_5, /* (1 << 7) */
15 BIND_MODE_SWITCH = (1 << 8)
21 void yyerror(const char *str)
23 fprintf(stderr,"error: %s\n",str);
35 printf("parsing done\n");
49 %token <string>STRING_NG
50 %token <string>VARNAME
58 %token TOKFLOATING_MODIFIER
72 | lines WHITESPACE line
93 TOKBIND WHITESPACE binding_modifiers '+' NUMBER WHITESPACE command
95 printf("\tFound binding mod%d with key %d and command %s\n", $<number>3, $5, $<string>7);
100 TOKBINDSYM WHITESPACE binding_modifiers '+' WORD WHITESPACE command
102 printf("\tFound symbolic mod%d with key %s and command %s\n", $<number>3, $5, $<string>7);
107 TOKFLOATING_MODIFIER WHITESPACE binding_modifiers
109 printf("\tfloating modifier %d\n", $<number>3);
114 TOKWORKSPACE WHITESPACE NUMBER WHITESPACE TOKSCREEN WHITESPACE screen
116 printf("\t workspace %d to screen %d\n", $<number>3, $<number>7);
118 | TOKWORKSPACE WHITESPACE NUMBER WHITESPACE TOKSCREEN WHITESPACE screen WHITESPACE QUOTEDSTRING
120 printf("\t quoted: %s\n", $<string>9);
130 TOKASSIGN WHITESPACE window_class WHITESPACE optional_arrow NUMBER
132 printf("assignment of %s to %d\n", $<string>3, $<number>6);
143 | TOKARROW WHITESPACE
147 TOKSET WHITESPACE variable WHITESPACE STRING
149 printf("set %s to %s\n", $<string>3, $<string>5);
154 '$' WORD { asprintf(&$<string>$, "$%s", $<string>2); }
155 | '$' VARNAME { asprintf(&$<string>$, "$%s", $<string>2); }
159 TOKIPCSOCKET WHITESPACE STRING
161 printf("ipc %s\n", $<string>3);
166 TOKEXEC WHITESPACE STRING
168 printf("exec %s\n", $<string>3);
173 TOKCOLOR WHITESPACE '#' HEX
175 printf("color %s\n", $<string>4);
183 binding_modifiers '+' binding_modifier
185 $<number>$ = $<number>1 | $<number>3;
190 MODIFIER { $<number>$ = $<number>1; }
191 | TOKCONTROL { $<number>$ = BIND_CONTROL; }
192 | TOKSHIFT { $<number>$ = BIND_SHIFT; }