i3
|
00001 /* A Bison parser, made by GNU Bison 2.5. */ 00002 00003 /* Bison implementation for Yacc-like parsers in C 00004 00005 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. 00006 00007 This program is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00019 00020 /* As a special exception, you may create a larger work that contains 00021 part or all of the Bison parser skeleton and distribute that work 00022 under terms of your choice, so long as that work isn't itself a 00023 parser generator using the skeleton or a modified version thereof 00024 as a parser skeleton. Alternatively, if you modify or redistribute 00025 the parser skeleton itself, you may (at your option) remove this 00026 special exception, which will cause the skeleton and the resulting 00027 Bison output files to be licensed under the GNU General Public 00028 License without this special exception. 00029 00030 This special exception was added by the Free Software Foundation in 00031 version 2.2 of Bison. */ 00032 00033 /* C LALR(1) parser skeleton written by Richard Stallman, by 00034 simplifying the original so-called "semantic" parser. */ 00035 00036 /* All symbols defined below should begin with yy or YY, to avoid 00037 infringing on user name space. This should be done even for local 00038 variables, as they might otherwise be expanded by user macros. 00039 There are some unavoidable exceptions within include files to 00040 define necessary library symbols; they are noted "INFRINGES ON 00041 USER NAME SPACE" below. */ 00042 00043 /* Identify Bison output. */ 00044 #define YYBISON 1 00045 00046 /* Bison version. */ 00047 #define YYBISON_VERSION "2.5" 00048 00049 /* Skeleton name. */ 00050 #define YYSKELETON_NAME "yacc.c" 00051 00052 /* Pure parsers. */ 00053 #define YYPURE 0 00054 00055 /* Push parsers. */ 00056 #define YYPUSH 0 00057 00058 /* Pull parsers. */ 00059 #define YYPULL 1 00060 00061 /* Using locations. */ 00062 #define YYLSP_NEEDED 0 00063 00064 00065 00066 /* Copy the first part of user declarations. */ 00067 00068 /* Line 268 of yacc.c */ 00069 #line 1 "src/cfgparse.y" 00070 00071 /* 00072 * vim:ts=4:sw=4:expandtab 00073 * 00074 */ 00075 #include <sys/types.h> 00076 #include <sys/stat.h> 00077 #include <sys/wait.h> 00078 #include <unistd.h> 00079 #include <fcntl.h> 00080 00081 #include "all.h" 00082 00083 static pid_t configerror_pid = -1; 00084 00085 static Match current_match; 00086 static Barconfig current_bar; 00087 /* The pattern which was specified by the user, for example -misc-fixed-*. We 00088 * store this in a separate variable because in the i3 config struct we just 00089 * store the i3Font. */ 00090 static char *font_pattern; 00091 00092 typedef struct yy_buffer_state *YY_BUFFER_STATE; 00093 extern int yylex(struct context *context); 00094 extern int yyparse(void); 00095 extern int yylex_destroy(void); 00096 extern FILE *yyin; 00097 YY_BUFFER_STATE yy_scan_string(const char *); 00098 00099 static struct bindings_head *current_bindings; 00100 static struct context *context; 00101 00102 /* We don’t need yydebug for now, as we got decent error messages using 00103 * yyerror(). Should you ever want to extend the parser, it might be handy 00104 * to just comment it in again, so it stays here. */ 00105 //int yydebug = 1; 00106 00107 void yyerror(const char *error_message) { 00108 context->has_errors = true; 00109 00110 ELOG("\n"); 00111 ELOG("CONFIG: %s\n", error_message); 00112 ELOG("CONFIG: in file \"%s\", line %d:\n", 00113 context->filename, context->line_number); 00114 ELOG("CONFIG: %s\n", context->line_copy); 00115 char buffer[context->last_column+1]; 00116 buffer[context->last_column] = '\0'; 00117 for (int c = 1; c <= context->last_column; c++) 00118 buffer[c-1] = (c >= context->first_column ? '^' : ' '); 00119 ELOG("CONFIG: %s\n", buffer); 00120 ELOG("\n"); 00121 } 00122 00123 int yywrap(void) { 00124 return 1; 00125 } 00126 00127 /* 00128 * Goes through each line of buf (separated by \n) and checks for statements / 00129 * commands which only occur in i3 v4 configuration files. If it finds any, it 00130 * returns version 4, otherwise it returns version 3. 00131 * 00132 */ 00133 static int detect_version(char *buf) { 00134 char *walk = buf; 00135 char *line = buf; 00136 while (*walk != '\0') { 00137 if (*walk != '\n') { 00138 walk++; 00139 continue; 00140 } 00141 00142 /* check for some v4-only statements */ 00143 if (strncasecmp(line, "bindcode", strlen("bindcode")) == 0 || 00144 strncasecmp(line, "force_focus_wrapping", strlen("force_focus_wrapping")) == 0 || 00145 strncasecmp(line, "# i3 config file (v4)", strlen("# i3 config file (v4)")) == 0 || 00146 strncasecmp(line, "workspace_layout", strlen("workspace_layout")) == 0) { 00147 printf("deciding for version 4 due to this line: %.*s\n", (int)(walk-line), line); 00148 return 4; 00149 } 00150 00151 /* if this is a bind statement, we can check the command */ 00152 if (strncasecmp(line, "bind", strlen("bind")) == 0) { 00153 char *bind = strchr(line, ' '); 00154 if (bind == NULL) 00155 goto next; 00156 while ((*bind == ' ' || *bind == '\t') && *bind != '\0') 00157 bind++; 00158 if (*bind == '\0') 00159 goto next; 00160 if ((bind = strchr(bind, ' ')) == NULL) 00161 goto next; 00162 while ((*bind == ' ' || *bind == '\t') && *bind != '\0') 00163 bind++; 00164 if (*bind == '\0') 00165 goto next; 00166 if (strncasecmp(bind, "layout", strlen("layout")) == 0 || 00167 strncasecmp(bind, "floating", strlen("floating")) == 0 || 00168 strncasecmp(bind, "workspace", strlen("workspace")) == 0 || 00169 strncasecmp(bind, "focus left", strlen("focus left")) == 0 || 00170 strncasecmp(bind, "focus right", strlen("focus right")) == 0 || 00171 strncasecmp(bind, "focus up", strlen("focus up")) == 0 || 00172 strncasecmp(bind, "focus down", strlen("focus down")) == 0 || 00173 strncasecmp(bind, "border normal", strlen("border normal")) == 0 || 00174 strncasecmp(bind, "border 1pixel", strlen("border 1pixel")) == 0 || 00175 strncasecmp(bind, "border borderless", strlen("border borderless")) == 0 || 00176 strncasecmp(bind, "--no-startup-id", strlen("--no-startup-id")) == 0 || 00177 strncasecmp(bind, "bar", strlen("bar")) == 0) { 00178 printf("deciding for version 4 due to this line: %.*s\n", (int)(walk-line), line); 00179 return 4; 00180 } 00181 } 00182 00183 next: 00184 /* advance to the next line */ 00185 walk++; 00186 line = walk; 00187 } 00188 00189 return 3; 00190 } 00191 00192 /* 00193 * Calls i3-migrate-config-to-v4 to migrate a configuration file (input 00194 * buffer). 00195 * 00196 * Returns the converted config file or NULL if there was an error (for 00197 * example the script could not be found in $PATH or the i3 executable’s 00198 * directory). 00199 * 00200 */ 00201 static char *migrate_config(char *input, off_t size) { 00202 int writepipe[2]; 00203 int readpipe[2]; 00204 00205 if (pipe(writepipe) != 0 || 00206 pipe(readpipe) != 0) { 00207 warn("migrate_config: Could not create pipes"); 00208 return NULL; 00209 } 00210 00211 pid_t pid = fork(); 00212 if (pid == -1) { 00213 warn("Could not fork()"); 00214 return NULL; 00215 } 00216 00217 /* child */ 00218 if (pid == 0) { 00219 /* close writing end of writepipe, connect reading side to stdin */ 00220 close(writepipe[1]); 00221 dup2(writepipe[0], 0); 00222 00223 /* close reading end of readpipe, connect writing side to stdout */ 00224 close(readpipe[0]); 00225 dup2(readpipe[1], 1); 00226 00227 static char *argv[] = { 00228 NULL, /* will be replaced by the executable path */ 00229 NULL 00230 }; 00231 exec_i3_utility("i3-migrate-config-to-v4", argv); 00232 } 00233 00234 /* parent */ 00235 00236 /* close reading end of the writepipe (connected to the script’s stdin) */ 00237 close(writepipe[0]); 00238 00239 /* write the whole config file to the pipe, the script will read everything 00240 * immediately */ 00241 int written = 0; 00242 int ret; 00243 while (written < size) { 00244 if ((ret = write(writepipe[1], input + written, size - written)) < 0) { 00245 warn("Could not write to pipe"); 00246 return NULL; 00247 } 00248 written += ret; 00249 } 00250 close(writepipe[1]); 00251 00252 /* close writing end of the readpipe (connected to the script’s stdout) */ 00253 close(readpipe[1]); 00254 00255 /* read the script’s output */ 00256 int conv_size = 65535; 00257 char *converted = malloc(conv_size); 00258 int read_bytes = 0; 00259 do { 00260 if (read_bytes == conv_size) { 00261 conv_size += 65535; 00262 converted = realloc(converted, conv_size); 00263 } 00264 ret = read(readpipe[0], converted + read_bytes, conv_size - read_bytes); 00265 if (ret == -1) { 00266 warn("Cannot read from pipe"); 00267 FREE(converted); 00268 return NULL; 00269 } 00270 read_bytes += ret; 00271 } while (ret > 0); 00272 00273 /* get the returncode */ 00274 int status; 00275 wait(&status); 00276 if (!WIFEXITED(status)) { 00277 fprintf(stderr, "Child did not terminate normally, using old config file (will lead to broken behaviour)\n"); 00278 return NULL; 00279 } 00280 00281 int returncode = WEXITSTATUS(status); 00282 if (returncode != 0) { 00283 fprintf(stderr, "Migration process exit code was != 0\n"); 00284 if (returncode == 2) { 00285 fprintf(stderr, "could not start the migration script\n"); 00286 /* TODO: script was not found. tell the user to fix his system or create a v4 config */ 00287 } else if (returncode == 1) { 00288 fprintf(stderr, "This already was a v4 config. Please add the following line to your config file:\n"); 00289 fprintf(stderr, "# i3 config file (v4)\n"); 00290 /* TODO: nag the user with a message to include a hint for i3 in his config file */ 00291 } 00292 return NULL; 00293 } 00294 00295 return converted; 00296 } 00297 00298 /* 00299 * Handler which will be called when we get a SIGCHLD for the nagbar, meaning 00300 * it exited (or could not be started, depending on the exit code). 00301 * 00302 */ 00303 static void nagbar_exited(EV_P_ ev_child *watcher, int revents) { 00304 ev_child_stop(EV_A_ watcher); 00305 if (!WIFEXITED(watcher->rstatus)) { 00306 fprintf(stderr, "ERROR: i3-nagbar did not exit normally.\n"); 00307 return; 00308 } 00309 00310 int exitcode = WEXITSTATUS(watcher->rstatus); 00311 printf("i3-nagbar process exited with status %d\n", exitcode); 00312 if (exitcode == 2) { 00313 fprintf(stderr, "ERROR: i3-nagbar could not be found. Is it correctly installed on your system?\n"); 00314 } 00315 00316 configerror_pid = -1; 00317 } 00318 00319 /* We need ev >= 4 for the following code. Since it is not *that* important (it 00320 * only makes sure that there are no i3-nagbar instances left behind) we still 00321 * support old systems with libev 3. */ 00322 #if EV_VERSION_MAJOR >= 4 00323 /* 00324 * Cleanup handler. Will be called when i3 exits. Kills i3-nagbar with signal 00325 * SIGKILL (9) to make sure there are no left-over i3-nagbar processes. 00326 * 00327 */ 00328 static void nagbar_cleanup(EV_P_ ev_cleanup *watcher, int revent) { 00329 if (configerror_pid != -1) { 00330 LOG("Sending SIGKILL (9) to i3-nagbar with PID %d\n", configerror_pid); 00331 kill(configerror_pid, SIGKILL); 00332 } 00333 } 00334 #endif 00335 00336 /* 00337 * Starts an i3-nagbar process which alerts the user that his configuration 00338 * file contains one or more errors. Also offers two buttons: One to launch an 00339 * $EDITOR on the config file and another one to launch a $PAGER on the error 00340 * logfile. 00341 * 00342 */ 00343 static void start_configerror_nagbar(const char *config_path) { 00344 if (only_check_config) 00345 return; 00346 00347 fprintf(stderr, "Starting i3-nagbar due to configuration errors\n"); 00348 configerror_pid = fork(); 00349 if (configerror_pid == -1) { 00350 warn("Could not fork()"); 00351 return; 00352 } 00353 00354 /* child */ 00355 if (configerror_pid == 0) { 00356 char *editaction, 00357 *pageraction; 00358 sasprintf(&editaction, "i3-sensible-terminal -e sh -c \"i3-sensible-editor \\\"%s\\\" && i3-msg reload\"", config_path); 00359 sasprintf(&pageraction, "i3-sensible-terminal -e i3-sensible-pager \"%s\"", errorfilename); 00360 char *argv[] = { 00361 NULL, /* will be replaced by the executable path */ 00362 "-t", 00363 (context->has_errors ? "error" : "warning"), 00364 "-m", 00365 (context->has_errors ? 00366 "You have an error in your i3 config file!" : 00367 "Your config is outdated. Please fix the warnings to make sure everything works."), 00368 "-b", 00369 "edit config", 00370 editaction, 00371 (errorfilename ? "-b" : NULL), 00372 (context->has_errors ? "show errors" : "show warnings"), 00373 pageraction, 00374 NULL 00375 }; 00376 exec_i3_utility("i3-nagbar", argv); 00377 } 00378 00379 /* parent */ 00380 /* install a child watcher */ 00381 ev_child *child = smalloc(sizeof(ev_child)); 00382 ev_child_init(child, &nagbar_exited, configerror_pid, 0); 00383 ev_child_start(main_loop, child); 00384 00385 /* We need ev >= 4 for the following code. Since it is not *that* important (it 00386 * only makes sure that there are no i3-nagbar instances left behind) we still 00387 * support old systems with libev 3. */ 00388 #if EV_VERSION_MAJOR >= 4 00389 /* install a cleanup watcher (will be called when i3 exits and i3-nagbar is 00390 * still running) */ 00391 ev_cleanup *cleanup = smalloc(sizeof(ev_cleanup)); 00392 ev_cleanup_init(cleanup, nagbar_cleanup); 00393 ev_cleanup_start(main_loop, cleanup); 00394 #endif 00395 } 00396 00397 /* 00398 * Kills the configerror i3-nagbar process, if any. 00399 * 00400 * Called when reloading/restarting. 00401 * 00402 * If wait_for_it is set (restarting), this function will waitpid(), otherwise, 00403 * ev is assumed to handle it (reloading). 00404 * 00405 */ 00406 void kill_configerror_nagbar(bool wait_for_it) { 00407 if (configerror_pid == -1) 00408 return; 00409 00410 if (kill(configerror_pid, SIGTERM) == -1) 00411 warn("kill(configerror_nagbar) failed"); 00412 00413 if (!wait_for_it) 00414 return; 00415 00416 /* When restarting, we don’t enter the ev main loop anymore and after the 00417 * exec(), our old pid is no longer watched. So, ev won’t handle SIGCHLD 00418 * for us and we would end up with a <defunct> process. Therefore we 00419 * waitpid() here. */ 00420 waitpid(configerror_pid, NULL, 0); 00421 } 00422 00423 /* 00424 * Checks for duplicate key bindings (the same keycode or keysym is configured 00425 * more than once). If a duplicate binding is found, a message is printed to 00426 * stderr and the has_errors variable is set to true, which will start 00427 * i3-nagbar. 00428 * 00429 */ 00430 static void check_for_duplicate_bindings(struct context *context) { 00431 Binding *bind, *current; 00432 TAILQ_FOREACH(current, bindings, bindings) { 00433 TAILQ_FOREACH(bind, bindings, bindings) { 00434 /* Abort when we reach the current keybinding, only check the 00435 * bindings before */ 00436 if (bind == current) 00437 break; 00438 00439 /* Check if one is using keysym while the other is using bindsym. 00440 * If so, skip. */ 00441 /* XXX: It should be checked at a later place (when translating the 00442 * keysym to keycodes) if there are any duplicates */ 00443 if ((bind->symbol == NULL && current->symbol != NULL) || 00444 (bind->symbol != NULL && current->symbol == NULL)) 00445 continue; 00446 00447 /* If bind is NULL, current has to be NULL, too (see above). 00448 * If the keycodes differ, it can't be a duplicate. */ 00449 if (bind->symbol != NULL && 00450 strcasecmp(bind->symbol, current->symbol) != 0) 00451 continue; 00452 00453 /* Check if the keycodes or modifiers are different. If so, they 00454 * can't be duplicate */ 00455 if (bind->keycode != current->keycode || 00456 bind->mods != current->mods) 00457 continue; 00458 context->has_errors = true; 00459 if (current->keycode != 0) { 00460 ELOG("Duplicate keybinding in config file:\n modmask %d with keycode %d, command \"%s\"\n", 00461 current->mods, current->keycode, current->command); 00462 } else { 00463 ELOG("Duplicate keybinding in config file:\n modmask %d with keysym %s, command \"%s\"\n", 00464 current->mods, current->symbol, current->command); 00465 } 00466 } 00467 } 00468 } 00469 00470 static void migrate_i3bar_exec(struct Autostart *exec) { 00471 ELOG("**********************************************************************\n"); 00472 ELOG("IGNORING exec command: %s\n", exec->command); 00473 ELOG("It contains \"i3bar\". Since i3 v4.1, i3bar will be automatically started\n"); 00474 ELOG("for each 'bar' configuration block in your i3 config. Please remove the exec\n"); 00475 ELOG("line and add the following to your i3 config:\n"); 00476 ELOG("\n"); 00477 ELOG(" bar {\n"); 00478 ELOG(" status_command i3status\n"); 00479 ELOG(" }\n"); 00480 ELOG("**********************************************************************\n"); 00481 00482 /* Generate a dummy bar configuration */ 00483 Barconfig *bar_config = scalloc(sizeof(Barconfig)); 00484 /* The hard-coded ID is not a problem. It does not conflict with the 00485 * auto-generated bar IDs and having multiple hard-coded IDs is irrelevant 00486 * – they all just contain status_command = i3status */ 00487 bar_config->id = sstrdup("migrate-bar"); 00488 bar_config->status_command = sstrdup("i3status"); 00489 TAILQ_INSERT_TAIL(&barconfigs, bar_config, configs); 00490 00491 /* Trigger an i3-nagbar */ 00492 context->has_warnings = true; 00493 } 00494 00495 void parse_file(const char *f) { 00496 SLIST_HEAD(variables_head, Variable) variables = SLIST_HEAD_INITIALIZER(&variables); 00497 int fd, ret, read_bytes = 0; 00498 struct stat stbuf; 00499 char *buf; 00500 FILE *fstr; 00501 char buffer[1026], key[512], value[512]; 00502 00503 if ((fd = open(f, O_RDONLY)) == -1) 00504 die("Could not open configuration file: %s\n", strerror(errno)); 00505 00506 if (fstat(fd, &stbuf) == -1) 00507 die("Could not fstat file: %s\n", strerror(errno)); 00508 00509 buf = scalloc((stbuf.st_size + 1) * sizeof(char)); 00510 while (read_bytes < stbuf.st_size) { 00511 if ((ret = read(fd, buf + read_bytes, (stbuf.st_size - read_bytes))) < 0) 00512 die("Could not read(): %s\n", strerror(errno)); 00513 read_bytes += ret; 00514 } 00515 00516 if (lseek(fd, 0, SEEK_SET) == (off_t)-1) 00517 die("Could not lseek: %s\n", strerror(errno)); 00518 00519 if ((fstr = fdopen(fd, "r")) == NULL) 00520 die("Could not fdopen: %s\n", strerror(errno)); 00521 00522 while (!feof(fstr)) { 00523 if (fgets(buffer, 1024, fstr) == NULL) { 00524 if (feof(fstr)) 00525 break; 00526 die("Could not read configuration file\n"); 00527 } 00528 00529 /* sscanf implicitly strips whitespace. Also, we skip comments and empty lines. */ 00530 if (sscanf(buffer, "%s %[^\n]", key, value) < 1 || 00531 key[0] == '#' || strlen(key) < 3) 00532 continue; 00533 00534 if (strcasecmp(key, "set") == 0) { 00535 if (value[0] != '$') { 00536 ELOG("Malformed variable assignment, name has to start with $\n"); 00537 continue; 00538 } 00539 00540 /* get key/value for this variable */ 00541 char *v_key = value, *v_value; 00542 if (strstr(value, " ") == NULL && strstr(value, "\t") == NULL) { 00543 ELOG("Malformed variable assignment, need a value\n"); 00544 continue; 00545 } 00546 00547 if (!(v_value = strstr(value, " "))) 00548 v_value = strstr(value, "\t"); 00549 00550 *(v_value++) = '\0'; 00551 while (*v_value == '\t' || *v_value == ' ') 00552 v_value++; 00553 00554 struct Variable *new = scalloc(sizeof(struct Variable)); 00555 new->key = sstrdup(v_key); 00556 new->value = sstrdup(v_value); 00557 SLIST_INSERT_HEAD(&variables, new, variables); 00558 DLOG("Got new variable %s = %s\n", v_key, v_value); 00559 continue; 00560 } 00561 } 00562 fclose(fstr); 00563 00564 /* For every custom variable, see how often it occurs in the file and 00565 * how much extra bytes it requires when replaced. */ 00566 struct Variable *current, *nearest; 00567 int extra_bytes = 0; 00568 /* We need to copy the buffer because we need to invalidate the 00569 * variables (otherwise we will count them twice, which is bad when 00570 * 'extra' is negative) */ 00571 char *bufcopy = sstrdup(buf); 00572 SLIST_FOREACH(current, &variables, variables) { 00573 int extra = (strlen(current->value) - strlen(current->key)); 00574 char *next; 00575 for (next = bufcopy; 00576 next < (bufcopy + stbuf.st_size) && 00577 (next = strcasestr(next, current->key)) != NULL; 00578 next += strlen(current->key)) { 00579 *next = '_'; 00580 extra_bytes += extra; 00581 } 00582 } 00583 FREE(bufcopy); 00584 00585 /* Then, allocate a new buffer and copy the file over to the new one, 00586 * but replace occurences of our variables */ 00587 char *walk = buf, *destwalk; 00588 char *new = smalloc((stbuf.st_size + extra_bytes + 1) * sizeof(char)); 00589 destwalk = new; 00590 while (walk < (buf + stbuf.st_size)) { 00591 /* Find the next variable */ 00592 SLIST_FOREACH(current, &variables, variables) 00593 current->next_match = strcasestr(walk, current->key); 00594 nearest = NULL; 00595 int distance = stbuf.st_size; 00596 SLIST_FOREACH(current, &variables, variables) { 00597 if (current->next_match == NULL) 00598 continue; 00599 if ((current->next_match - walk) < distance) { 00600 distance = (current->next_match - walk); 00601 nearest = current; 00602 } 00603 } 00604 if (nearest == NULL) { 00605 /* If there are no more variables, we just copy the rest */ 00606 strncpy(destwalk, walk, (buf + stbuf.st_size) - walk); 00607 destwalk += (buf + stbuf.st_size) - walk; 00608 *destwalk = '\0'; 00609 break; 00610 } else { 00611 /* Copy until the next variable, then copy its value */ 00612 strncpy(destwalk, walk, distance); 00613 strncpy(destwalk + distance, nearest->value, strlen(nearest->value)); 00614 walk += distance + strlen(nearest->key); 00615 destwalk += distance + strlen(nearest->value); 00616 } 00617 } 00618 00619 /* analyze the string to find out whether this is an old config file (3.x) 00620 * or a new config file (4.x). If it’s old, we run the converter script. */ 00621 int version = detect_version(buf); 00622 if (version == 3) { 00623 /* We need to convert this v3 configuration */ 00624 char *converted = migrate_config(new, stbuf.st_size); 00625 if (converted != NULL) { 00626 ELOG("\n"); 00627 ELOG("****************************************************************\n"); 00628 ELOG("NOTE: Automatically converted configuration file from v3 to v4.\n"); 00629 ELOG("\n"); 00630 ELOG("Please convert your config file to v4. You can use this command:\n"); 00631 ELOG(" mv %s %s.O\n", f, f); 00632 ELOG(" i3-migrate-config-to-v4 %s.O > %s\n", f, f); 00633 ELOG("****************************************************************\n"); 00634 ELOG("\n"); 00635 free(new); 00636 new = converted; 00637 } else { 00638 printf("\n"); 00639 printf("**********************************************************************\n"); 00640 printf("ERROR: Could not convert config file. Maybe i3-migrate-config-to-v4\n"); 00641 printf("was not correctly installed on your system?\n"); 00642 printf("**********************************************************************\n"); 00643 printf("\n"); 00644 } 00645 } 00646 00647 /* now lex/parse it */ 00648 yy_scan_string(new); 00649 00650 context = scalloc(sizeof(struct context)); 00651 context->filename = f; 00652 00653 if (yyparse() != 0) { 00654 fprintf(stderr, "Could not parse configfile\n"); 00655 exit(1); 00656 } 00657 00658 check_for_duplicate_bindings(context); 00659 00660 /* XXX: The following code will be removed in i3 v4.3 (three releases from 00661 * now, as of 2011-10-22) */ 00662 /* Check for any exec or exec_always lines starting i3bar. We remove these 00663 * and add a bar block instead. Additionally, a i3-nagbar warning (not an 00664 * error) will be displayed so that users update their config file. */ 00665 struct Autostart *exec, *next; 00666 for (exec = TAILQ_FIRST(&autostarts); exec; ) { 00667 next = TAILQ_NEXT(exec, autostarts); 00668 if (strstr(exec->command, "i3bar") != NULL) { 00669 migrate_i3bar_exec(exec); 00670 TAILQ_REMOVE(&autostarts, exec, autostarts); 00671 } 00672 exec = next; 00673 } 00674 00675 for (exec = TAILQ_FIRST(&autostarts_always); exec; ) { 00676 next = TAILQ_NEXT(exec, autostarts_always); 00677 if (strstr(exec->command, "i3bar") != NULL) { 00678 migrate_i3bar_exec(exec); 00679 TAILQ_REMOVE(&autostarts_always, exec, autostarts_always); 00680 } 00681 exec = next; 00682 } 00683 00684 if (context->has_errors || context->has_warnings) { 00685 ELOG("FYI: You are using i3 version " I3_VERSION "\n"); 00686 if (version == 3) 00687 ELOG("Please convert your configfile first, then fix any remaining errors (see above).\n"); 00688 start_configerror_nagbar(f); 00689 } 00690 00691 yylex_destroy(); 00692 FREE(context->line_copy); 00693 free(context); 00694 FREE(font_pattern); 00695 free(new); 00696 free(buf); 00697 00698 while (!SLIST_EMPTY(&variables)) { 00699 current = SLIST_FIRST(&variables); 00700 FREE(current->key); 00701 FREE(current->value); 00702 SLIST_REMOVE_HEAD(&variables, variables); 00703 FREE(current); 00704 } 00705 } 00706 00707 00708 00709 /* Line 268 of yacc.c */ 00710 #line 711 "src/cfgparse.tab.c" 00711 00712 /* Enabling traces. */ 00713 #ifndef YYDEBUG 00714 # define YYDEBUG 1 00715 #endif 00716 00717 /* Enabling verbose error messages. */ 00718 #ifdef YYERROR_VERBOSE 00719 # undef YYERROR_VERBOSE 00720 # define YYERROR_VERBOSE 1 00721 #else 00722 # define YYERROR_VERBOSE 1 00723 #endif 00724 00725 /* Enabling the token table. */ 00726 #ifndef YYTOKEN_TABLE 00727 # define YYTOKEN_TABLE 0 00728 #endif 00729 00730 00731 /* Tokens. */ 00732 #ifndef YYTOKENTYPE 00733 # define YYTOKENTYPE 00734 /* Put the tokens into the symbol table, so that GDB and other debuggers 00735 know about them. */ 00736 enum yytokentype { 00737 NUMBER = 258, 00738 WORD = 259, 00739 STR = 260, 00740 STR_NG = 261, 00741 HEXCOLOR = 262, 00742 OUTPUT = 263, 00743 TOKBINDCODE = 264, 00744 TOKTERMINAL = 265, 00745 TOKCOMMENT = 266, 00746 TOKFONT = 267, 00747 TOKBINDSYM = 268, 00748 MODIFIER = 269, 00749 TOKCONTROL = 270, 00750 TOKSHIFT = 271, 00751 TOKFLOATING_MODIFIER = 272, 00752 TOKFLOATING_MAXIMUM_SIZE = 273, 00753 TOKFLOATING_MINIMUM_SIZE = 274, 00754 QUOTEDSTRING = 275, 00755 TOKWORKSPACE = 276, 00756 TOKOUTPUT = 277, 00757 TOKASSIGN = 278, 00758 TOKSET = 279, 00759 TOKIPCSOCKET = 280, 00760 TOKRESTARTSTATE = 281, 00761 TOKEXEC = 282, 00762 TOKEXEC_ALWAYS = 283, 00763 TOKSINGLECOLOR = 284, 00764 TOKCOLOR = 285, 00765 TOKARROW = 286, 00766 TOKMODE = 287, 00767 TOK_BAR = 288, 00768 TOK_ORIENTATION = 289, 00769 TOK_HORIZ = 290, 00770 TOK_VERT = 291, 00771 TOK_AUTO = 292, 00772 TOK_WORKSPACE_LAYOUT = 293, 00773 TOKNEWWINDOW = 294, 00774 TOKNEWFLOAT = 295, 00775 TOK_NORMAL = 296, 00776 TOK_NONE = 297, 00777 TOK_1PIXEL = 298, 00778 TOKFOCUSFOLLOWSMOUSE = 299, 00779 TOK_FORCE_FOCUS_WRAPPING = 300, 00780 TOK_FORCE_XINERAMA = 301, 00781 TOK_FAKE_OUTPUTS = 302, 00782 TOK_WORKSPACE_AUTO_BAF = 303, 00783 TOKWORKSPACEBAR = 304, 00784 TOK_DEFAULT = 305, 00785 TOK_STACKING = 306, 00786 TOK_TABBED = 307, 00787 TOKSTACKLIMIT = 308, 00788 TOK_POPUP_DURING_FULLSCREEN = 309, 00789 TOK_IGNORE = 310, 00790 TOK_LEAVE_FULLSCREEN = 311, 00791 TOK_FOR_WINDOW = 312, 00792 TOK_BAR_OUTPUT = 313, 00793 TOK_BAR_TRAY_OUTPUT = 314, 00794 TOK_BAR_SOCKET_PATH = 315, 00795 TOK_BAR_MODE = 316, 00796 TOK_BAR_HIDE = 317, 00797 TOK_BAR_DOCK = 318, 00798 TOK_BAR_MODIFIER = 319, 00799 TOK_BAR_CONTROL = 320, 00800 TOK_BAR_SHIFT = 321, 00801 TOK_BAR_MOD1 = 322, 00802 TOK_BAR_MOD2 = 323, 00803 TOK_BAR_MOD3 = 324, 00804 TOK_BAR_MOD4 = 325, 00805 TOK_BAR_MOD5 = 326, 00806 TOK_BAR_POSITION = 327, 00807 TOK_BAR_BOTTOM = 328, 00808 TOK_BAR_TOP = 329, 00809 TOK_BAR_STATUS_COMMAND = 330, 00810 TOK_BAR_I3BAR_COMMAND = 331, 00811 TOK_BAR_FONT = 332, 00812 TOK_BAR_WORKSPACE_BUTTONS = 333, 00813 TOK_BAR_VERBOSE = 334, 00814 TOK_BAR_COLORS = 335, 00815 TOK_BAR_COLOR_BACKGROUND = 336, 00816 TOK_BAR_COLOR_STATUSLINE = 337, 00817 TOK_BAR_COLOR_FOCUSED_WORKSPACE = 338, 00818 TOK_BAR_COLOR_ACTIVE_WORKSPACE = 339, 00819 TOK_BAR_COLOR_INACTIVE_WORKSPACE = 340, 00820 TOK_BAR_COLOR_URGENT_WORKSPACE = 341, 00821 TOK_NO_STARTUP_ID = 342, 00822 TOK_MARK = 343, 00823 TOK_CLASS = 344, 00824 TOK_INSTANCE = 345, 00825 TOK_WINDOW_ROLE = 346, 00826 TOK_ID = 347, 00827 TOK_CON_ID = 348, 00828 TOK_TITLE = 349, 00829 TOK_URGENT = 350 00830 }; 00831 #endif 00832 00833 00834 00835 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 00836 typedef union YYSTYPE 00837 { 00838 00839 /* Line 293 of yacc.c */ 00840 #line 643 "src/cfgparse.y" 00841 00842 int number; 00843 char *string; 00844 uint32_t *single_color; 00845 struct Colortriple *color; 00846 Match *match; 00847 struct Binding *binding; 00848 00849 00850 00851 /* Line 293 of yacc.c */ 00852 #line 853 "src/cfgparse.tab.c" 00853 } YYSTYPE; 00854 # define YYSTYPE_IS_TRIVIAL 1 00855 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 00856 # define YYSTYPE_IS_DECLARED 1 00857 #endif 00858 00859 00860 /* Copy the second part of user declarations. */ 00861 00862 00863 /* Line 343 of yacc.c */ 00864 #line 865 "src/cfgparse.tab.c" 00865 00866 #ifdef short 00867 # undef short 00868 #endif 00869 00870 #ifdef YYTYPE_UINT8 00871 typedef YYTYPE_UINT8 yytype_uint8; 00872 #else 00873 typedef unsigned char yytype_uint8; 00874 #endif 00875 00876 #ifdef YYTYPE_INT8 00877 typedef YYTYPE_INT8 yytype_int8; 00878 #elif (defined __STDC__ || defined __C99__FUNC__ \ 00879 || defined __cplusplus || defined _MSC_VER) 00880 typedef signed char yytype_int8; 00881 #else 00882 typedef short int yytype_int8; 00883 #endif 00884 00885 #ifdef YYTYPE_UINT16 00886 typedef YYTYPE_UINT16 yytype_uint16; 00887 #else 00888 typedef unsigned short int yytype_uint16; 00889 #endif 00890 00891 #ifdef YYTYPE_INT16 00892 typedef YYTYPE_INT16 yytype_int16; 00893 #else 00894 typedef short int yytype_int16; 00895 #endif 00896 00897 #ifndef YYSIZE_T 00898 # ifdef __SIZE_TYPE__ 00899 # define YYSIZE_T __SIZE_TYPE__ 00900 # elif defined size_t 00901 # define YYSIZE_T size_t 00902 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 00903 || defined __cplusplus || defined _MSC_VER) 00904 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 00905 # define YYSIZE_T size_t 00906 # else 00907 # define YYSIZE_T unsigned int 00908 # endif 00909 #endif 00910 00911 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 00912 00913 #ifndef YY_ 00914 # if defined YYENABLE_NLS && YYENABLE_NLS 00915 # if ENABLE_NLS 00916 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 00917 # define YY_(msgid) dgettext ("bison-runtime", msgid) 00918 # endif 00919 # endif 00920 # ifndef YY_ 00921 # define YY_(msgid) msgid 00922 # endif 00923 #endif 00924 00925 /* Suppress unused-variable warnings by "using" E. */ 00926 #if ! defined lint || defined __GNUC__ 00927 # define YYUSE(e) ((void) (e)) 00928 #else 00929 # define YYUSE(e) /* empty */ 00930 #endif 00931 00932 /* Identity function, used to suppress warnings about constant conditions. */ 00933 #ifndef lint 00934 # define YYID(n) (n) 00935 #else 00936 #if (defined __STDC__ || defined __C99__FUNC__ \ 00937 || defined __cplusplus || defined _MSC_VER) 00938 static int 00939 YYID (int yyi) 00940 #else 00941 static int 00942 YYID (yyi) 00943 int yyi; 00944 #endif 00945 { 00946 return yyi; 00947 } 00948 #endif 00949 00950 #if ! defined yyoverflow || YYERROR_VERBOSE 00951 00952 /* The parser invokes alloca or malloc; define the necessary symbols. */ 00953 00954 # ifdef YYSTACK_USE_ALLOCA 00955 # if YYSTACK_USE_ALLOCA 00956 # ifdef __GNUC__ 00957 # define YYSTACK_ALLOC __builtin_alloca 00958 # elif defined __BUILTIN_VA_ARG_INCR 00959 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 00960 # elif defined _AIX 00961 # define YYSTACK_ALLOC __alloca 00962 # elif defined _MSC_VER 00963 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 00964 # define alloca _alloca 00965 # else 00966 # define YYSTACK_ALLOC alloca 00967 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 00968 || defined __cplusplus || defined _MSC_VER) 00969 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 00970 # ifndef EXIT_SUCCESS 00971 # define EXIT_SUCCESS 0 00972 # endif 00973 # endif 00974 # endif 00975 # endif 00976 # endif 00977 00978 # ifdef YYSTACK_ALLOC 00979 /* Pacify GCC's `empty if-body' warning. */ 00980 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 00981 # ifndef YYSTACK_ALLOC_MAXIMUM 00982 /* The OS might guarantee only one guard page at the bottom of the stack, 00983 and a page size can be as small as 4096 bytes. So we cannot safely 00984 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 00985 to allow for a few compiler-allocated temporary stack slots. */ 00986 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 00987 # endif 00988 # else 00989 # define YYSTACK_ALLOC YYMALLOC 00990 # define YYSTACK_FREE YYFREE 00991 # ifndef YYSTACK_ALLOC_MAXIMUM 00992 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 00993 # endif 00994 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 00995 && ! ((defined YYMALLOC || defined malloc) \ 00996 && (defined YYFREE || defined free))) 00997 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 00998 # ifndef EXIT_SUCCESS 00999 # define EXIT_SUCCESS 0 01000 # endif 01001 # endif 01002 # ifndef YYMALLOC 01003 # define YYMALLOC malloc 01004 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 01005 || defined __cplusplus || defined _MSC_VER) 01006 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 01007 # endif 01008 # endif 01009 # ifndef YYFREE 01010 # define YYFREE free 01011 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 01012 || defined __cplusplus || defined _MSC_VER) 01013 void free (void *); /* INFRINGES ON USER NAME SPACE */ 01014 # endif 01015 # endif 01016 # endif 01017 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 01018 01019 01020 #if (! defined yyoverflow \ 01021 && (! defined __cplusplus \ 01022 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 01023 01024 /* A type that is properly aligned for any stack member. */ 01025 union yyalloc 01026 { 01027 yytype_int16 yyss_alloc; 01028 YYSTYPE yyvs_alloc; 01029 }; 01030 01031 /* The size of the maximum gap between one aligned stack and the next. */ 01032 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 01033 01034 /* The size of an array large to enough to hold all stacks, each with 01035 N elements. */ 01036 # define YYSTACK_BYTES(N) \ 01037 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 01038 + YYSTACK_GAP_MAXIMUM) 01039 01040 # define YYCOPY_NEEDED 1 01041 01042 /* Relocate STACK from its old location to the new one. The 01043 local variables YYSIZE and YYSTACKSIZE give the old and new number of 01044 elements in the stack, and YYPTR gives the new location of the 01045 stack. Advance YYPTR to a properly aligned location for the next 01046 stack. */ 01047 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 01048 do \ 01049 { \ 01050 YYSIZE_T yynewbytes; \ 01051 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 01052 Stack = &yyptr->Stack_alloc; \ 01053 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 01054 yyptr += yynewbytes / sizeof (*yyptr); \ 01055 } \ 01056 while (YYID (0)) 01057 01058 #endif 01059 01060 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 01061 /* Copy COUNT objects from FROM to TO. The source and destination do 01062 not overlap. */ 01063 # ifndef YYCOPY 01064 # if defined __GNUC__ && 1 < __GNUC__ 01065 # define YYCOPY(To, From, Count) \ 01066 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 01067 # else 01068 # define YYCOPY(To, From, Count) \ 01069 do \ 01070 { \ 01071 YYSIZE_T yyi; \ 01072 for (yyi = 0; yyi < (Count); yyi++) \ 01073 (To)[yyi] = (From)[yyi]; \ 01074 } \ 01075 while (YYID (0)) 01076 # endif 01077 # endif 01078 #endif /* !YYCOPY_NEEDED */ 01079 01080 /* YYFINAL -- State number of the termination state. */ 01081 #define YYFINAL 2 01082 /* YYLAST -- Last index in YYTABLE. */ 01083 #define YYLAST 225 01084 01085 /* YYNTOKENS -- Number of terminals. */ 01086 #define YYNTOKENS 102 01087 /* YYNNTS -- Number of nonterminals. */ 01088 #define YYNNTS 80 01089 /* YYNRULES -- Number of rules. */ 01090 #define YYNRULES 177 01091 /* YYNRULES -- Number of states. */ 01092 #define YYNSTATES 268 01093 01094 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 01095 #define YYUNDEFTOK 2 01096 #define YYMAXUTOK 350 01097 01098 #define YYTRANSLATE(YYX) \ 01099 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 01100 01101 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 01102 static const yytype_uint8 yytranslate[] = 01103 { 01104 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01105 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01106 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01107 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01108 2, 2, 2, 101, 2, 2, 2, 2, 2, 2, 01109 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01110 2, 98, 2, 2, 2, 2, 2, 2, 2, 2, 01111 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01112 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01113 2, 96, 2, 97, 2, 2, 2, 2, 2, 2, 01114 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01115 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01116 2, 2, 2, 99, 2, 100, 2, 2, 2, 2, 01117 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01118 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01119 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01120 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01121 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01122 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01123 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01124 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01125 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01126 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01127 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01128 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01129 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 01130 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 01131 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 01132 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 01133 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 01134 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 01135 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 01136 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 01137 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 01138 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 01139 95 01140 }; 01141 01142 #if YYDEBUG 01143 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 01144 YYRHS. */ 01145 static const yytype_uint16 yyprhs[] = 01146 { 01147 0, 0, 3, 4, 7, 10, 12, 14, 16, 18, 01148 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 01149 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 01150 60, 62, 64, 66, 68, 70, 72, 74, 77, 80, 01151 84, 88, 92, 93, 97, 99, 101, 104, 106, 110, 01152 114, 118, 122, 126, 130, 134, 138, 140, 142, 144, 01153 146, 152, 153, 156, 158, 160, 165, 166, 169, 171, 01154 173, 175, 177, 179, 181, 183, 185, 187, 189, 191, 01155 193, 195, 197, 199, 201, 203, 205, 207, 210, 213, 01156 216, 219, 222, 224, 226, 229, 231, 233, 236, 238, 01157 240, 242, 244, 246, 248, 250, 253, 256, 259, 262, 01158 267, 270, 273, 277, 282, 286, 291, 295, 300, 304, 01159 309, 314, 319, 322, 325, 327, 329, 331, 334, 339, 01160 341, 343, 345, 348, 351, 353, 355, 357, 359, 361, 01161 364, 367, 370, 373, 376, 379, 385, 389, 390, 392, 01162 394, 396, 398, 402, 406, 408, 410, 413, 416, 420, 01163 424, 425, 427, 430, 433, 436, 441, 447, 449, 450, 01164 452, 456, 459, 461, 463, 465, 468, 470 01165 }; 01166 01167 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 01168 static const yytype_int16 yyrhs[] = 01169 { 01170 103, 0, -1, -1, 103, 1, -1, 103, 104, -1, 01171 107, -1, 111, -1, 119, -1, 122, -1, 146, -1, 01172 147, -1, 148, -1, 149, -1, 151, -1, 153, -1, 01173 154, -1, 157, -1, 158, -1, 159, -1, 160, -1, 01174 161, -1, 162, -1, 163, -1, 166, -1, 168, -1, 01175 169, -1, 170, -1, 171, -1, 175, -1, 176, -1, 01176 173, -1, 174, -1, 105, -1, 180, -1, 11, -1, 01177 5, -1, 108, -1, 9, 109, -1, 13, 110, -1, 01178 178, 3, 106, -1, 178, 118, 106, -1, 57, 112, 01179 106, -1, -1, 113, 115, 114, -1, 96, -1, 97, 01180 -1, 115, 116, -1, 116, -1, 89, 98, 5, -1, 01181 90, 98, 5, -1, 91, 98, 5, -1, 93, 98, 01182 5, -1, 92, 98, 5, -1, 88, 98, 5, -1, 01183 94, 98, 5, -1, 95, 98, 5, -1, 20, -1, 01184 3, -1, 4, -1, 3, -1, 32, 20, 99, 120, 01185 100, -1, -1, 120, 121, -1, 105, -1, 108, -1, 01186 33, 99, 123, 100, -1, -1, 123, 124, -1, 105, 01187 -1, 125, -1, 126, -1, 127, -1, 128, -1, 129, 01188 -1, 131, -1, 133, -1, 135, -1, 136, -1, 137, 01189 -1, 138, -1, 139, -1, 140, -1, 141, -1, 142, 01190 -1, 143, -1, 144, -1, 145, -1, 75, 5, -1, 01191 76, 5, -1, 58, 5, -1, 59, 5, -1, 72, 01192 130, -1, 74, -1, 73, -1, 61, 132, -1, 62, 01193 -1, 63, -1, 64, 134, -1, 65, -1, 66, -1, 01194 67, -1, 68, -1, 69, -1, 70, -1, 71, -1, 01195 77, 5, -1, 78, 156, -1, 79, 156, -1, 60, 01196 5, -1, 80, 99, 123, 100, -1, 81, 7, -1, 01197 82, 7, -1, 83, 7, 7, -1, 83, 7, 7, 01198 7, -1, 84, 7, 7, -1, 84, 7, 7, 7, 01199 -1, 85, 7, 7, -1, 85, 7, 7, 7, -1, 01200 86, 7, 7, -1, 86, 7, 7, 7, -1, 18, 01201 3, 4, 3, -1, 19, 3, 4, 3, -1, 17, 01202 178, -1, 34, 150, -1, 35, -1, 36, -1, 37, 01203 -1, 38, 152, -1, 38, 53, 53, 3, -1, 50, 01204 -1, 51, -1, 52, -1, 39, 155, -1, 40, 155, 01205 -1, 41, -1, 42, -1, 43, -1, 3, -1, 4, 01206 -1, 44, 156, -1, 45, 156, -1, 46, 156, -1, 01207 47, 5, -1, 48, 156, -1, 49, 156, -1, 21, 01208 117, 22, 8, 164, -1, 21, 3, 165, -1, -1, 01209 165, -1, 20, -1, 5, -1, 4, -1, 23, 167, 01210 5, -1, 23, 112, 5, -1, 20, -1, 6, -1, 01211 25, 5, -1, 26, 5, -1, 27, 172, 5, -1, 01212 28, 172, 5, -1, -1, 87, -1, 10, 5, -1, 01213 12, 5, -1, 29, 177, -1, 30, 177, 177, 177, 01214 -1, 30, 177, 177, 177, 177, -1, 7, -1, -1, 01215 179, -1, 178, 101, 179, -1, 178, 101, -1, 14, 01216 -1, 15, -1, 16, -1, 54, 181, -1, 55, -1, 01217 56, -1 01218 }; 01219 01220 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 01221 static const yytype_uint16 yyrline[] = 01222 { 01223 0, 774, 774, 775, 776, 780, 781, 782, 783, 784, 01224 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 01225 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 01226 805, 806, 807, 808, 812, 816, 820, 827, 828, 832, 01227 846, 860, 875, 876, 883, 891, 898, 899, 903, 909, 01228 915, 921, 936, 951, 957, 963, 980, 981, 985, 986, 01229 993, 1016, 1018, 1022, 1023, 1035, 1062, 1064, 1068, 1069, 01230 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 01231 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1090, 1099, 1108, 01232 1119, 1128, 1136, 1137, 1141, 1149, 1150, 1154, 1161, 1162, 01233 1163, 1164, 1165, 1166, 1167, 1171, 1180, 1190, 1198, 1207, 01234 1216, 1224, 1232, 1239, 1250, 1257, 1268, 1275, 1285, 1292, 01235 1302, 1312, 1322, 1330, 1338, 1339, 1340, 1344, 1368, 1389, 01236 1390, 1391, 1395, 1403, 1411, 1412, 1413, 1417, 1421, 1433, 01237 1441, 1449, 1457, 1465, 1473, 1481, 1515, 1533, 1534, 1538, 01238 1539, 1540, 1544, 1606, 1622, 1623, 1627, 1634, 1641, 1651, 01239 1661, 1662, 1666, 1674, 1685, 1693, 1701, 1713, 1722, 1723, 01240 1724, 1725, 1729, 1730, 1731, 1735, 1743, 1744 01241 }; 01242 #endif 01243 01244 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 01245 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 01246 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 01247 static const char *const yytname[] = 01248 { 01249 "$end", "error", "$undefined", "\"<number>\"", "\"<word>\"", 01250 "\"<string>\"", "\"<string (non-greedy)>\"", "\"#<hex>\"", 01251 "\"<RandR output>\"", "TOKBINDCODE", "TOKTERMINAL", "\"<comment>\"", 01252 "\"font\"", "\"bindsym\"", "\"<modifier>\"", "\"control\"", "\"shift\"", 01253 "\"floating_modifier\"", "\"floating_maximum_size\"", 01254 "\"floating_minimum_size\"", "\"<quoted string>\"", "\"workspace\"", 01255 "\"output\"", "\"assign\"", "TOKSET", "\"ipc_socket\"", 01256 "\"restart_state\"", "\"exec\"", "\"exec_always\"", "TOKSINGLECOLOR", 01257 "TOKCOLOR", "\"\\342\\206\\222\"", "\"mode\"", "\"bar\"", 01258 "\"default_orientation\"", "\"horizontal\"", "\"vertical\"", "\"auto\"", 01259 "\"workspace_layout\"", "\"new_window\"", "\"new_float\"", "\"normal\"", 01260 "\"none\"", "\"1pixel\"", "\"focus_follows_mouse\"", 01261 "\"force_focus_wrapping\"", "\"force_xinerama\"", "\"fake_outputs\"", 01262 "\"workspace_auto_back_and_forth\"", "\"workspace_bar\"", "\"default\"", 01263 "\"stacking\"", "\"tabbed\"", "\"stack-limit\"", 01264 "\"popup_during_fullscreen\"", "\"ignore\"", "\"leave_fullscreen\"", 01265 "\"for_window\"", "\"output (bar)\"", "\"tray_output\"", 01266 "\"socket_path\"", "\"mode (bar)\"", "\"hide\"", "\"dock\"", 01267 "\"modifier (bar)\"", "\"shift (bar)\"", "\"control (bar)\"", "\"Mod1\"", 01268 "\"Mod2\"", "\"Mod3\"", "\"Mod4\"", "\"Mod5\"", "\"position\"", 01269 "\"bottom\"", "\"top\"", "\"status_command\"", "\"i3bar_command\"", 01270 "\"font (bar)\"", "\"workspace_buttons\"", "\"verbose\"", "\"colors\"", 01271 "\"background\"", "\"statusline\"", "\"focused_workspace\"", 01272 "\"active_workspace\"", "\"inactive_workspace\"", "\"urgent_workspace\"", 01273 "\"--no-startup-id\"", "\"mark\"", "\"class\"", "\"instance\"", 01274 "\"window_role\"", "\"id\"", "\"con_id\"", "\"title\"", "\"urgent\"", 01275 "'['", "']'", "'='", "'{'", "'}'", "'+'", "$accept", "lines", "line", 01276 "comment", "command", "bindline", "binding", "bindcode", "bindsym", 01277 "for_window", "match", "matchstart", "matchend", "criteria", "criterion", 01278 "qstring_or_number", "word_or_number", "mode", "modelines", "modeline", 01279 "bar", "barlines", "barline", "bar_status_command", "bar_i3bar_command", 01280 "bar_output", "bar_tray_output", "bar_position", "bar_position_position", 01281 "bar_mode", "bar_mode_mode", "bar_modifier", "bar_modifier_modifier", 01282 "bar_font", "bar_workspace_buttons", "bar_verbose", "bar_socket_path", 01283 "bar_colors", "bar_color_background", "bar_color_statusline", 01284 "bar_color_focused_workspace", "bar_color_active_workspace", 01285 "bar_color_inactive_workspace", "bar_color_urgent_workspace", 01286 "floating_maximum_size", "floating_minimum_size", "floating_modifier", 01287 "orientation", "direction", "workspace_layout", "layout_mode", 01288 "new_window", "new_float", "border_style", "bool", "focus_follows_mouse", 01289 "force_focus_wrapping", "force_xinerama", "fake_outputs", 01290 "workspace_back_and_forth", "workspace_bar", "workspace", 01291 "optional_workspace_name", "workspace_name", "assign", "window_class", 01292 "ipcsocket", "restart_state", "exec", "exec_always", 01293 "optional_no_startup_id", "terminal", "font", "single_color", "color", 01294 "colorpixel", "binding_modifiers", "binding_modifier", 01295 "popup_during_fullscreen", "popup_setting", 0 01296 }; 01297 #endif 01298 01299 # ifdef YYPRINT 01300 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 01301 token YYLEX-NUM. */ 01302 static const yytype_uint16 yytoknum[] = 01303 { 01304 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 01305 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 01306 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 01307 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 01308 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 01309 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 01310 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 01311 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 01312 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 01313 345, 346, 347, 348, 349, 350, 91, 93, 61, 123, 01314 125, 43 01315 }; 01316 # endif 01317 01318 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 01319 static const yytype_uint8 yyr1[] = 01320 { 01321 0, 102, 103, 103, 103, 104, 104, 104, 104, 104, 01322 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 01323 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 01324 104, 104, 104, 104, 105, 106, 107, 108, 108, 109, 01325 110, 111, 112, 112, 113, 114, 115, 115, 116, 116, 01326 116, 116, 116, 116, 116, 116, 117, 117, 118, 118, 01327 119, 120, 120, 121, 121, 122, 123, 123, 124, 124, 01328 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 01329 124, 124, 124, 124, 124, 124, 124, 125, 126, 127, 01330 128, 129, 130, 130, 131, 132, 132, 133, 134, 134, 01331 134, 134, 134, 134, 134, 135, 136, 137, 138, 139, 01332 140, 141, 142, 142, 143, 143, 144, 144, 145, 145, 01333 146, 147, 148, 149, 150, 150, 150, 151, 151, 152, 01334 152, 152, 153, 154, 155, 155, 155, 156, 156, 157, 01335 158, 159, 160, 161, 162, 163, 163, 164, 164, 165, 01336 165, 165, 166, 166, 167, 167, 168, 169, 170, 171, 01337 172, 172, 173, 174, 175, 176, 176, 177, 178, 178, 01338 178, 178, 179, 179, 179, 180, 181, 181 01339 }; 01340 01341 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 01342 static const yytype_uint8 yyr2[] = 01343 { 01344 0, 2, 0, 2, 2, 1, 1, 1, 1, 1, 01345 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 01346 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 01347 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 01348 3, 3, 0, 3, 1, 1, 2, 1, 3, 3, 01349 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 01350 5, 0, 2, 1, 1, 4, 0, 2, 1, 1, 01351 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 01352 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 01353 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 01354 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 01355 2, 2, 3, 4, 3, 4, 3, 4, 3, 4, 01356 4, 4, 2, 2, 1, 1, 1, 2, 4, 1, 01357 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 01358 2, 2, 2, 2, 2, 5, 3, 0, 1, 1, 01359 1, 1, 3, 3, 1, 1, 2, 2, 3, 3, 01360 0, 1, 2, 2, 2, 4, 5, 1, 0, 1, 01361 3, 2, 1, 1, 1, 2, 1, 1 01362 }; 01363 01364 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. 01365 Performed when YYTABLE doesn't specify something else to do. Zero 01366 means the default is an error. */ 01367 static const yytype_uint8 yydefact[] = 01368 { 01369 2, 0, 1, 3, 168, 0, 34, 0, 168, 168, 01370 0, 0, 0, 42, 0, 0, 160, 160, 0, 0, 01371 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 01372 0, 0, 0, 42, 4, 32, 5, 36, 6, 7, 01373 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 01374 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 01375 30, 31, 28, 29, 33, 172, 173, 174, 37, 0, 01376 169, 162, 163, 38, 0, 122, 0, 0, 57, 56, 01377 0, 155, 154, 44, 0, 0, 0, 156, 157, 161, 01378 0, 0, 167, 164, 0, 0, 66, 124, 125, 126, 01379 123, 129, 130, 131, 0, 127, 134, 135, 136, 132, 01380 133, 137, 138, 139, 140, 141, 142, 143, 144, 176, 01381 177, 175, 0, 0, 171, 59, 58, 0, 0, 0, 01382 151, 150, 149, 146, 0, 153, 0, 0, 0, 0, 01383 0, 0, 0, 0, 0, 47, 152, 158, 159, 0, 01384 61, 0, 0, 35, 41, 39, 170, 40, 120, 121, 01385 147, 0, 0, 0, 0, 0, 0, 0, 0, 45, 01386 43, 46, 165, 0, 0, 0, 0, 0, 0, 0, 01387 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 01388 0, 0, 65, 68, 67, 69, 70, 71, 72, 73, 01389 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 01390 84, 85, 86, 128, 145, 148, 53, 48, 49, 50, 01391 52, 51, 54, 55, 166, 60, 63, 64, 62, 89, 01392 90, 108, 95, 96, 94, 98, 99, 100, 101, 102, 01393 103, 104, 97, 93, 92, 91, 87, 88, 105, 106, 01394 107, 66, 110, 111, 0, 0, 0, 0, 0, 112, 01395 114, 116, 118, 109, 113, 115, 117, 119 01396 }; 01397 01398 /* YYDEFGOTO[NTERM-NUM]. */ 01399 static const yytype_int16 yydefgoto[] = 01400 { 01401 -1, 1, 34, 193, 154, 36, 37, 68, 73, 38, 01402 84, 85, 170, 144, 145, 80, 127, 39, 173, 228, 01403 40, 151, 194, 195, 196, 197, 198, 199, 245, 200, 01404 234, 201, 242, 202, 203, 204, 205, 206, 207, 208, 01405 209, 210, 211, 212, 41, 42, 43, 44, 100, 45, 01406 105, 46, 47, 109, 113, 48, 49, 50, 51, 52, 01407 53, 54, 214, 133, 55, 86, 56, 57, 58, 59, 01408 90, 60, 61, 62, 63, 93, 69, 70, 64, 121 01409 }; 01410 01411 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 01412 STATE-NUM. */ 01413 #define YYPACT_NINF -83 01414 static const yytype_int16 yypact[] = 01415 { 01416 -83, 150, -83, -83, 43, 10, -83, 72, 43, 43, 01417 77, 78, 11, 6, 89, 94, -77, -77, 96, 96, 01418 85, 9, 25, -23, 31, 31, 40, 40, 40, 105, 01419 40, 40, -9, 15, -83, -83, -83, -83, -83, -83, 01420 -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, 01421 -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, 01422 -83, -83, -83, -83, -83, -83, -83, -83, -83, 5, 01423 -83, -83, -83, -83, 3, 23, 121, 122, 12, -83, 01424 106, -83, -83, -83, 124, -39, 125, -83, -83, -83, 01425 126, 127, -83, -83, 96, 28, -83, -83, -83, -83, 01426 -83, -83, -83, -83, 81, -83, -83, -83, -83, -83, 01427 -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, 01428 -83, -83, 130, 130, 43, -83, -83, 130, 133, 135, 01429 -83, -83, -83, -83, 131, -83, 42, 44, 45, 46, 01430 47, 48, 49, 50, -55, -83, -83, -83, -83, 96, 01431 -83, 7, 138, -83, -83, -83, -83, -83, -83, -83, 01432 12, 144, 147, 148, 149, 159, 160, 161, 165, -83, 01433 -83, -83, 96, 0, 169, 176, 180, 1, -46, -4, 01434 181, 182, 186, 40, 40, 56, 185, 193, 194, 195, 01435 196, 198, -83, -83, -83, -83, -83, -83, -83, -83, 01436 -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, 01437 -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, 01438 -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, 01439 -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, 01440 -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, 01441 -83, -83, -83, -83, 199, 201, 202, 203, 37, 204, 01442 205, 206, 207, -83, -83, -83, -83, -83 01443 }; 01444 01445 /* YYPGOTO[NTERM-NUM]. */ 01446 static const yytype_int16 yypgoto[] = 01447 { 01448 -83, -83, -83, -1, -82, -83, 20, -83, -83, -83, 01449 183, -83, -83, -83, 71, -83, -83, -83, -83, -83, 01450 -83, -34, -83, -83, -83, -83, -83, -83, -83, -83, 01451 -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, 01452 -83, -83, -83, -83, -83, -83, -83, -83, -83, -83, 01453 -83, -83, -83, 197, -26, -83, -83, -83, -83, -83, 01454 -83, -83, -83, 58, -83, -83, -83, -83, -83, -83, 01455 208, -83, -83, -83, -83, -16, 67, 95, -83, -83 01456 }; 01457 01458 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 01459 positive, shift that token. If negative, reduce the rule which 01460 number is the opposite. If YYTABLE_NINF, syntax error. */ 01461 #define YYTABLE_NINF -1 01462 static const yytype_uint16 yytable[] = 01463 { 01464 35, 114, 115, 94, 117, 118, 125, 126, 123, 4, 01465 89, 6, 81, 8, 78, 71, 130, 131, 6, 235, 01466 236, 237, 238, 239, 240, 241, 82, 101, 102, 103, 01467 104, 79, 132, 136, 137, 138, 139, 140, 141, 142, 01468 143, 155, 169, 111, 112, 157, 119, 120, 6, 136, 01469 137, 138, 139, 140, 141, 142, 143, 65, 66, 67, 01470 97, 98, 99, 232, 233, 174, 175, 176, 177, 243, 01471 244, 178, 106, 107, 108, 74, 75, 72, 149, 179, 01472 76, 77, 180, 181, 182, 183, 184, 185, 186, 187, 01473 188, 189, 190, 191, 87, 174, 175, 176, 177, 88, 01474 225, 178, 83, 92, 124, 95, 124, 192, 96, 179, 01475 116, 83, 180, 181, 182, 183, 184, 185, 186, 187, 01476 188, 189, 190, 191, 124, 128, 129, 150, 134, 135, 01477 146, 147, 148, 172, 152, 153, 158, 263, 159, 160, 01478 161, 213, 162, 163, 164, 165, 166, 167, 168, 216, 01479 2, 3, 217, 218, 219, 251, 224, 249, 250, 4, 01480 5, 6, 7, 8, 220, 221, 222, 9, 10, 11, 01481 223, 12, 226, 13, 229, 14, 15, 16, 17, 18, 01482 19, 230, 20, 21, 22, 231, 246, 247, 23, 24, 01483 25, 248, 252, 227, 26, 27, 28, 29, 30, 31, 01484 253, 254, 255, 256, 32, 257, 259, 33, 260, 261, 01485 262, 264, 265, 266, 267, 171, 122, 258, 215, 156, 01486 0, 0, 110, 0, 0, 91 01487 }; 01488 01489 #define yypact_value_is_default(yystate) \ 01490 ((yystate) == (-83)) 01491 01492 #define yytable_value_is_error(yytable_value) \ 01493 YYID (0) 01494 01495 static const yytype_int16 yycheck[] = 01496 { 01497 1, 27, 28, 19, 30, 31, 3, 4, 3, 9, 01498 87, 11, 6, 13, 3, 5, 4, 5, 11, 65, 01499 66, 67, 68, 69, 70, 71, 20, 50, 51, 52, 01500 53, 20, 20, 88, 89, 90, 91, 92, 93, 94, 01501 95, 123, 97, 3, 4, 127, 55, 56, 11, 88, 01502 89, 90, 91, 92, 93, 94, 95, 14, 15, 16, 01503 35, 36, 37, 62, 63, 58, 59, 60, 61, 73, 01504 74, 64, 41, 42, 43, 8, 9, 5, 94, 72, 01505 3, 3, 75, 76, 77, 78, 79, 80, 81, 82, 01506 83, 84, 85, 86, 5, 58, 59, 60, 61, 5, 01507 100, 64, 96, 7, 101, 20, 101, 100, 99, 72, 01508 5, 96, 75, 76, 77, 78, 79, 80, 81, 82, 01509 83, 84, 85, 86, 101, 4, 4, 99, 22, 5, 01510 5, 5, 5, 149, 53, 5, 3, 100, 3, 8, 01511 98, 3, 98, 98, 98, 98, 98, 98, 98, 5, 01512 0, 1, 5, 5, 5, 99, 172, 183, 184, 9, 01513 10, 11, 12, 13, 5, 5, 5, 17, 18, 19, 01514 5, 21, 173, 23, 5, 25, 26, 27, 28, 29, 01515 30, 5, 32, 33, 34, 5, 5, 5, 38, 39, 01516 40, 5, 7, 173, 44, 45, 46, 47, 48, 49, 01517 7, 7, 7, 7, 54, 7, 7, 57, 7, 7, 01518 7, 7, 7, 7, 7, 144, 33, 251, 160, 124, 01519 -1, -1, 25, -1, -1, 17 01520 }; 01521 01522 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 01523 symbol of state STATE-NUM. */ 01524 static const yytype_uint8 yystos[] = 01525 { 01526 0, 103, 0, 1, 9, 10, 11, 12, 13, 17, 01527 18, 19, 21, 23, 25, 26, 27, 28, 29, 30, 01528 32, 33, 34, 38, 39, 40, 44, 45, 46, 47, 01529 48, 49, 54, 57, 104, 105, 107, 108, 111, 119, 01530 122, 146, 147, 148, 149, 151, 153, 154, 157, 158, 01531 159, 160, 161, 162, 163, 166, 168, 169, 170, 171, 01532 173, 174, 175, 176, 180, 14, 15, 16, 109, 178, 01533 179, 5, 5, 110, 178, 178, 3, 3, 3, 20, 01534 117, 6, 20, 96, 112, 113, 167, 5, 5, 87, 01535 172, 172, 7, 177, 177, 20, 99, 35, 36, 37, 01536 150, 50, 51, 52, 53, 152, 41, 42, 43, 155, 01537 155, 3, 4, 156, 156, 156, 5, 156, 156, 55, 01538 56, 181, 112, 3, 101, 3, 4, 118, 4, 4, 01539 4, 5, 20, 165, 22, 5, 88, 89, 90, 91, 01540 92, 93, 94, 95, 115, 116, 5, 5, 5, 177, 01541 99, 123, 53, 5, 106, 106, 179, 106, 3, 3, 01542 8, 98, 98, 98, 98, 98, 98, 98, 98, 97, 01543 114, 116, 177, 120, 58, 59, 60, 61, 64, 72, 01544 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 01545 85, 86, 100, 105, 124, 125, 126, 127, 128, 129, 01546 131, 133, 135, 136, 137, 138, 139, 140, 141, 142, 01547 143, 144, 145, 3, 164, 165, 5, 5, 5, 5, 01548 5, 5, 5, 5, 177, 100, 105, 108, 121, 5, 01549 5, 5, 62, 63, 132, 65, 66, 67, 68, 69, 01550 70, 71, 134, 73, 74, 130, 5, 5, 5, 156, 01551 156, 99, 7, 7, 7, 7, 7, 7, 123, 7, 01552 7, 7, 7, 100, 7, 7, 7, 7 01553 }; 01554 01555 #define yyerrok (yyerrstatus = 0) 01556 #define yyclearin (yychar = YYEMPTY) 01557 #define YYEMPTY (-2) 01558 #define YYEOF 0 01559 01560 #define YYACCEPT goto yyacceptlab 01561 #define YYABORT goto yyabortlab 01562 #define YYERROR goto yyerrorlab 01563 01564 01565 /* Like YYERROR except do call yyerror. This remains here temporarily 01566 to ease the transition to the new meaning of YYERROR, for GCC. 01567 Once GCC version 2 has supplanted version 1, this can go. However, 01568 YYFAIL appears to be in use. Nevertheless, it is formally deprecated 01569 in Bison 2.4.2's NEWS entry, where a plan to phase it out is 01570 discussed. */ 01571 01572 #define YYFAIL goto yyerrlab 01573 #if defined YYFAIL 01574 /* This is here to suppress warnings from the GCC cpp's 01575 -Wunused-macros. Normally we don't worry about that warning, but 01576 some users do, and we want to make it easy for users to remove 01577 YYFAIL uses, which will produce warnings from Bison 2.5. */ 01578 #endif 01579 01580 #define YYRECOVERING() (!!yyerrstatus) 01581 01582 #define YYBACKUP(Token, Value) \ 01583 do \ 01584 if (yychar == YYEMPTY && yylen == 1) \ 01585 { \ 01586 yychar = (Token); \ 01587 yylval = (Value); \ 01588 YYPOPSTACK (1); \ 01589 goto yybackup; \ 01590 } \ 01591 else \ 01592 { \ 01593 yyerror (YY_("syntax error: cannot back up")); \ 01594 YYERROR; \ 01595 } \ 01596 while (YYID (0)) 01597 01598 01599 #define YYTERROR 1 01600 #define YYERRCODE 256 01601 01602 01603 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 01604 If N is 0, then set CURRENT to the empty location which ends 01605 the previous symbol: RHS[0] (always defined). */ 01606 01607 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 01608 #ifndef YYLLOC_DEFAULT 01609 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 01610 do \ 01611 if (YYID (N)) \ 01612 { \ 01613 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 01614 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 01615 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 01616 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 01617 } \ 01618 else \ 01619 { \ 01620 (Current).first_line = (Current).last_line = \ 01621 YYRHSLOC (Rhs, 0).last_line; \ 01622 (Current).first_column = (Current).last_column = \ 01623 YYRHSLOC (Rhs, 0).last_column; \ 01624 } \ 01625 while (YYID (0)) 01626 #endif 01627 01628 01629 /* This macro is provided for backward compatibility. */ 01630 01631 #ifndef YY_LOCATION_PRINT 01632 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 01633 #endif 01634 01635 01636 /* YYLEX -- calling `yylex' with the right arguments. */ 01637 01638 #ifdef YYLEX_PARAM 01639 # define YYLEX yylex (YYLEX_PARAM) 01640 #else 01641 # define YYLEX yylex (context) 01642 #endif 01643 01644 /* Enable debugging if requested. */ 01645 #if YYDEBUG 01646 01647 # ifndef YYFPRINTF 01648 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 01649 # define YYFPRINTF fprintf 01650 # endif 01651 01652 # define YYDPRINTF(Args) \ 01653 do { \ 01654 if (yydebug) \ 01655 YYFPRINTF Args; \ 01656 } while (YYID (0)) 01657 01658 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 01659 do { \ 01660 if (yydebug) \ 01661 { \ 01662 YYFPRINTF (stderr, "%s ", Title); \ 01663 yy_symbol_print (stderr, \ 01664 Type, Value); \ 01665 YYFPRINTF (stderr, "\n"); \ 01666 } \ 01667 } while (YYID (0)) 01668 01669 01670 /*--------------------------------. 01671 | Print this symbol on YYOUTPUT. | 01672 `--------------------------------*/ 01673 01674 /*ARGSUSED*/ 01675 #if (defined __STDC__ || defined __C99__FUNC__ \ 01676 || defined __cplusplus || defined _MSC_VER) 01677 static void 01678 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 01679 #else 01680 static void 01681 yy_symbol_value_print (yyoutput, yytype, yyvaluep) 01682 FILE *yyoutput; 01683 int yytype; 01684 YYSTYPE const * const yyvaluep; 01685 #endif 01686 { 01687 if (!yyvaluep) 01688 return; 01689 # ifdef YYPRINT 01690 if (yytype < YYNTOKENS) 01691 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 01692 # else 01693 YYUSE (yyoutput); 01694 # endif 01695 switch (yytype) 01696 { 01697 default: 01698 break; 01699 } 01700 } 01701 01702 01703 /*--------------------------------. 01704 | Print this symbol on YYOUTPUT. | 01705 `--------------------------------*/ 01706 01707 #if (defined __STDC__ || defined __C99__FUNC__ \ 01708 || defined __cplusplus || defined _MSC_VER) 01709 static void 01710 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 01711 #else 01712 static void 01713 yy_symbol_print (yyoutput, yytype, yyvaluep) 01714 FILE *yyoutput; 01715 int yytype; 01716 YYSTYPE const * const yyvaluep; 01717 #endif 01718 { 01719 if (yytype < YYNTOKENS) 01720 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 01721 else 01722 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 01723 01724 yy_symbol_value_print (yyoutput, yytype, yyvaluep); 01725 YYFPRINTF (yyoutput, ")"); 01726 } 01727 01728 /*------------------------------------------------------------------. 01729 | yy_stack_print -- Print the state stack from its BOTTOM up to its | 01730 | TOP (included). | 01731 `------------------------------------------------------------------*/ 01732 01733 #if (defined __STDC__ || defined __C99__FUNC__ \ 01734 || defined __cplusplus || defined _MSC_VER) 01735 static void 01736 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 01737 #else 01738 static void 01739 yy_stack_print (yybottom, yytop) 01740 yytype_int16 *yybottom; 01741 yytype_int16 *yytop; 01742 #endif 01743 { 01744 YYFPRINTF (stderr, "Stack now"); 01745 for (; yybottom <= yytop; yybottom++) 01746 { 01747 int yybot = *yybottom; 01748 YYFPRINTF (stderr, " %d", yybot); 01749 } 01750 YYFPRINTF (stderr, "\n"); 01751 } 01752 01753 # define YY_STACK_PRINT(Bottom, Top) \ 01754 do { \ 01755 if (yydebug) \ 01756 yy_stack_print ((Bottom), (Top)); \ 01757 } while (YYID (0)) 01758 01759 01760 /*------------------------------------------------. 01761 | Report that the YYRULE is going to be reduced. | 01762 `------------------------------------------------*/ 01763 01764 #if (defined __STDC__ || defined __C99__FUNC__ \ 01765 || defined __cplusplus || defined _MSC_VER) 01766 static void 01767 yy_reduce_print (YYSTYPE *yyvsp, int yyrule) 01768 #else 01769 static void 01770 yy_reduce_print (yyvsp, yyrule) 01771 YYSTYPE *yyvsp; 01772 int yyrule; 01773 #endif 01774 { 01775 int yynrhs = yyr2[yyrule]; 01776 int yyi; 01777 unsigned long int yylno = yyrline[yyrule]; 01778 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 01779 yyrule - 1, yylno); 01780 /* The symbols being reduced. */ 01781 for (yyi = 0; yyi < yynrhs; yyi++) 01782 { 01783 YYFPRINTF (stderr, " $%d = ", yyi + 1); 01784 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 01785 &(yyvsp[(yyi + 1) - (yynrhs)]) 01786 ); 01787 YYFPRINTF (stderr, "\n"); 01788 } 01789 } 01790 01791 # define YY_REDUCE_PRINT(Rule) \ 01792 do { \ 01793 if (yydebug) \ 01794 yy_reduce_print (yyvsp, Rule); \ 01795 } while (YYID (0)) 01796 01797 /* Nonzero means print parse trace. It is left uninitialized so that 01798 multiple parsers can coexist. */ 01799 int yydebug; 01800 #else /* !YYDEBUG */ 01801 # define YYDPRINTF(Args) 01802 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 01803 # define YY_STACK_PRINT(Bottom, Top) 01804 # define YY_REDUCE_PRINT(Rule) 01805 #endif /* !YYDEBUG */ 01806 01807 01808 /* YYINITDEPTH -- initial size of the parser's stacks. */ 01809 #ifndef YYINITDEPTH 01810 # define YYINITDEPTH 200 01811 #endif 01812 01813 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 01814 if the built-in stack extension method is used). 01815 01816 Do not make this value too large; the results are undefined if 01817 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 01818 evaluated with infinite-precision integer arithmetic. */ 01819 01820 #ifndef YYMAXDEPTH 01821 # define YYMAXDEPTH 10000 01822 #endif 01823 01824 01825 #if YYERROR_VERBOSE 01826 01827 # ifndef yystrlen 01828 # if defined __GLIBC__ && defined _STRING_H 01829 # define yystrlen strlen 01830 # else 01831 /* Return the length of YYSTR. */ 01832 #if (defined __STDC__ || defined __C99__FUNC__ \ 01833 || defined __cplusplus || defined _MSC_VER) 01834 static YYSIZE_T 01835 yystrlen (const char *yystr) 01836 #else 01837 static YYSIZE_T 01838 yystrlen (yystr) 01839 const char *yystr; 01840 #endif 01841 { 01842 YYSIZE_T yylen; 01843 for (yylen = 0; yystr[yylen]; yylen++) 01844 continue; 01845 return yylen; 01846 } 01847 # endif 01848 # endif 01849 01850 # ifndef yystpcpy 01851 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 01852 # define yystpcpy stpcpy 01853 # else 01854 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 01855 YYDEST. */ 01856 #if (defined __STDC__ || defined __C99__FUNC__ \ 01857 || defined __cplusplus || defined _MSC_VER) 01858 static char * 01859 yystpcpy (char *yydest, const char *yysrc) 01860 #else 01861 static char * 01862 yystpcpy (yydest, yysrc) 01863 char *yydest; 01864 const char *yysrc; 01865 #endif 01866 { 01867 char *yyd = yydest; 01868 const char *yys = yysrc; 01869 01870 while ((*yyd++ = *yys++) != '\0') 01871 continue; 01872 01873 return yyd - 1; 01874 } 01875 # endif 01876 # endif 01877 01878 # ifndef yytnamerr 01879 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary 01880 quotes and backslashes, so that it's suitable for yyerror. The 01881 heuristic is that double-quoting is unnecessary unless the string 01882 contains an apostrophe, a comma, or backslash (other than 01883 backslash-backslash). YYSTR is taken from yytname. If YYRES is 01884 null, do not copy; instead, return the length of what the result 01885 would have been. */ 01886 static YYSIZE_T 01887 yytnamerr (char *yyres, const char *yystr) 01888 { 01889 if (*yystr == '"') 01890 { 01891 YYSIZE_T yyn = 0; 01892 char const *yyp = yystr; 01893 01894 for (;;) 01895 switch (*++yyp) 01896 { 01897 case '\'': 01898 case ',': 01899 goto do_not_strip_quotes; 01900 01901 case '\\': 01902 if (*++yyp != '\\') 01903 goto do_not_strip_quotes; 01904 /* Fall through. */ 01905 default: 01906 if (yyres) 01907 yyres[yyn] = *yyp; 01908 yyn++; 01909 break; 01910 01911 case '"': 01912 if (yyres) 01913 yyres[yyn] = '\0'; 01914 return yyn; 01915 } 01916 do_not_strip_quotes: ; 01917 } 01918 01919 if (! yyres) 01920 return yystrlen (yystr); 01921 01922 return yystpcpy (yyres, yystr) - yyres; 01923 } 01924 # endif 01925 01926 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message 01927 about the unexpected token YYTOKEN for the state stack whose top is 01928 YYSSP. 01929 01930 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is 01931 not large enough to hold the message. In that case, also set 01932 *YYMSG_ALLOC to the required number of bytes. Return 2 if the 01933 required number of bytes is too large to store. */ 01934 static int 01935 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 01936 yytype_int16 *yyssp, int yytoken) 01937 { 01938 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); 01939 YYSIZE_T yysize = yysize0; 01940 YYSIZE_T yysize1; 01941 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 01942 /* Internationalized format string. */ 01943 const char *yyformat = 0; 01944 /* Arguments of yyformat. */ 01945 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 01946 /* Number of reported tokens (one for the "unexpected", one per 01947 "expected"). */ 01948 int yycount = 0; 01949 01950 /* There are many possibilities here to consider: 01951 - Assume YYFAIL is not used. It's too flawed to consider. See 01952 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> 01953 for details. YYERROR is fine as it does not invoke this 01954 function. 01955 - If this state is a consistent state with a default action, then 01956 the only way this function was invoked is if the default action 01957 is an error action. In that case, don't check for expected 01958 tokens because there are none. 01959 - The only way there can be no lookahead present (in yychar) is if 01960 this state is a consistent state with a default action. Thus, 01961 detecting the absence of a lookahead is sufficient to determine 01962 that there is no unexpected or expected token to report. In that 01963 case, just report a simple "syntax error". 01964 - Don't assume there isn't a lookahead just because this state is a 01965 consistent state with a default action. There might have been a 01966 previous inconsistent state, consistent state with a non-default 01967 action, or user semantic action that manipulated yychar. 01968 - Of course, the expected token list depends on states to have 01969 correct lookahead information, and it depends on the parser not 01970 to perform extra reductions after fetching a lookahead from the 01971 scanner and before detecting a syntax error. Thus, state merging 01972 (from LALR or IELR) and default reductions corrupt the expected 01973 token list. However, the list is correct for canonical LR with 01974 one exception: it will still contain any token that will not be 01975 accepted due to an error action in a later state. 01976 */ 01977 if (yytoken != YYEMPTY) 01978 { 01979 int yyn = yypact[*yyssp]; 01980 yyarg[yycount++] = yytname[yytoken]; 01981 if (!yypact_value_is_default (yyn)) 01982 { 01983 /* Start YYX at -YYN if negative to avoid negative indexes in 01984 YYCHECK. In other words, skip the first -YYN actions for 01985 this state because they are default actions. */ 01986 int yyxbegin = yyn < 0 ? -yyn : 0; 01987 /* Stay within bounds of both yycheck and yytname. */ 01988 int yychecklim = YYLAST - yyn + 1; 01989 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 01990 int yyx; 01991 01992 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 01993 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR 01994 && !yytable_value_is_error (yytable[yyx + yyn])) 01995 { 01996 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 01997 { 01998 yycount = 1; 01999 yysize = yysize0; 02000 break; 02001 } 02002 yyarg[yycount++] = yytname[yyx]; 02003 yysize1 = yysize + yytnamerr (0, yytname[yyx]); 02004 if (! (yysize <= yysize1 02005 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 02006 return 2; 02007 yysize = yysize1; 02008 } 02009 } 02010 } 02011 02012 switch (yycount) 02013 { 02014 # define YYCASE_(N, S) \ 02015 case N: \ 02016 yyformat = S; \ 02017 break 02018 YYCASE_(0, YY_("syntax error")); 02019 YYCASE_(1, YY_("syntax error, unexpected %s")); 02020 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 02021 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 02022 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 02023 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 02024 # undef YYCASE_ 02025 } 02026 02027 yysize1 = yysize + yystrlen (yyformat); 02028 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 02029 return 2; 02030 yysize = yysize1; 02031 02032 if (*yymsg_alloc < yysize) 02033 { 02034 *yymsg_alloc = 2 * yysize; 02035 if (! (yysize <= *yymsg_alloc 02036 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) 02037 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; 02038 return 1; 02039 } 02040 02041 /* Avoid sprintf, as that infringes on the user's name space. 02042 Don't have undefined behavior even if the translation 02043 produced a string with the wrong number of "%s"s. */ 02044 { 02045 char *yyp = *yymsg; 02046 int yyi = 0; 02047 while ((*yyp = *yyformat) != '\0') 02048 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) 02049 { 02050 yyp += yytnamerr (yyp, yyarg[yyi++]); 02051 yyformat += 2; 02052 } 02053 else 02054 { 02055 yyp++; 02056 yyformat++; 02057 } 02058 } 02059 return 0; 02060 } 02061 #endif /* YYERROR_VERBOSE */ 02062 02063 /*-----------------------------------------------. 02064 | Release the memory associated to this symbol. | 02065 `-----------------------------------------------*/ 02066 02067 /*ARGSUSED*/ 02068 #if (defined __STDC__ || defined __C99__FUNC__ \ 02069 || defined __cplusplus || defined _MSC_VER) 02070 static void 02071 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 02072 #else 02073 static void 02074 yydestruct (yymsg, yytype, yyvaluep) 02075 const char *yymsg; 02076 int yytype; 02077 YYSTYPE *yyvaluep; 02078 #endif 02079 { 02080 YYUSE (yyvaluep); 02081 02082 if (!yymsg) 02083 yymsg = "Deleting"; 02084 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 02085 02086 switch (yytype) 02087 { 02088 02089 default: 02090 break; 02091 } 02092 } 02093 02094 02095 /* Prevent warnings from -Wmissing-prototypes. */ 02096 #ifdef YYPARSE_PARAM 02097 #if defined __STDC__ || defined __cplusplus 02098 int yyparse (void *YYPARSE_PARAM); 02099 #else 02100 int yyparse (); 02101 #endif 02102 #else /* ! YYPARSE_PARAM */ 02103 #if defined __STDC__ || defined __cplusplus 02104 int yyparse (void); 02105 #else 02106 int yyparse (); 02107 #endif 02108 #endif /* ! YYPARSE_PARAM */ 02109 02110 02111 /* The lookahead symbol. */ 02112 int yychar; 02113 02114 /* The semantic value of the lookahead symbol. */ 02115 YYSTYPE yylval; 02116 02117 /* Number of syntax errors so far. */ 02118 int yynerrs; 02119 02120 02121 /*----------. 02122 | yyparse. | 02123 `----------*/ 02124 02125 #ifdef YYPARSE_PARAM 02126 #if (defined __STDC__ || defined __C99__FUNC__ \ 02127 || defined __cplusplus || defined _MSC_VER) 02128 int 02129 yyparse (void *YYPARSE_PARAM) 02130 #else 02131 int 02132 yyparse (YYPARSE_PARAM) 02133 void *YYPARSE_PARAM; 02134 #endif 02135 #else /* ! YYPARSE_PARAM */ 02136 #if (defined __STDC__ || defined __C99__FUNC__ \ 02137 || defined __cplusplus || defined _MSC_VER) 02138 int 02139 yyparse (void) 02140 #else 02141 int 02142 yyparse () 02143 02144 #endif 02145 #endif 02146 { 02147 int yystate; 02148 /* Number of tokens to shift before error messages enabled. */ 02149 int yyerrstatus; 02150 02151 /* The stacks and their tools: 02152 `yyss': related to states. 02153 `yyvs': related to semantic values. 02154 02155 Refer to the stacks thru separate pointers, to allow yyoverflow 02156 to reallocate them elsewhere. */ 02157 02158 /* The state stack. */ 02159 yytype_int16 yyssa[YYINITDEPTH]; 02160 yytype_int16 *yyss; 02161 yytype_int16 *yyssp; 02162 02163 /* The semantic value stack. */ 02164 YYSTYPE yyvsa[YYINITDEPTH]; 02165 YYSTYPE *yyvs; 02166 YYSTYPE *yyvsp; 02167 02168 YYSIZE_T yystacksize; 02169 02170 int yyn; 02171 int yyresult; 02172 /* Lookahead token as an internal (translated) token number. */ 02173 int yytoken; 02174 /* The variables used to return semantic value and location from the 02175 action routines. */ 02176 YYSTYPE yyval; 02177 02178 #if YYERROR_VERBOSE 02179 /* Buffer for error messages, and its allocated size. */ 02180 char yymsgbuf[128]; 02181 char *yymsg = yymsgbuf; 02182 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 02183 #endif 02184 02185 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 02186 02187 /* The number of symbols on the RHS of the reduced rule. 02188 Keep to zero when no symbol should be popped. */ 02189 int yylen = 0; 02190 02191 yytoken = 0; 02192 yyss = yyssa; 02193 yyvs = yyvsa; 02194 yystacksize = YYINITDEPTH; 02195 02196 YYDPRINTF ((stderr, "Starting parse\n")); 02197 02198 yystate = 0; 02199 yyerrstatus = 0; 02200 yynerrs = 0; 02201 yychar = YYEMPTY; /* Cause a token to be read. */ 02202 02203 /* Initialize stack pointers. 02204 Waste one element of value and location stack 02205 so that they stay on the same level as the state stack. 02206 The wasted elements are never initialized. */ 02207 yyssp = yyss; 02208 yyvsp = yyvs; 02209 02210 goto yysetstate; 02211 02212 /*------------------------------------------------------------. 02213 | yynewstate -- Push a new state, which is found in yystate. | 02214 `------------------------------------------------------------*/ 02215 yynewstate: 02216 /* In all cases, when you get here, the value and location stacks 02217 have just been pushed. So pushing a state here evens the stacks. */ 02218 yyssp++; 02219 02220 yysetstate: 02221 *yyssp = yystate; 02222 02223 if (yyss + yystacksize - 1 <= yyssp) 02224 { 02225 /* Get the current used size of the three stacks, in elements. */ 02226 YYSIZE_T yysize = yyssp - yyss + 1; 02227 02228 #ifdef yyoverflow 02229 { 02230 /* Give user a chance to reallocate the stack. Use copies of 02231 these so that the &'s don't force the real ones into 02232 memory. */ 02233 YYSTYPE *yyvs1 = yyvs; 02234 yytype_int16 *yyss1 = yyss; 02235 02236 /* Each stack pointer address is followed by the size of the 02237 data in use in that stack, in bytes. This used to be a 02238 conditional around just the two extra args, but that might 02239 be undefined if yyoverflow is a macro. */ 02240 yyoverflow (YY_("memory exhausted"), 02241 &yyss1, yysize * sizeof (*yyssp), 02242 &yyvs1, yysize * sizeof (*yyvsp), 02243 &yystacksize); 02244 02245 yyss = yyss1; 02246 yyvs = yyvs1; 02247 } 02248 #else /* no yyoverflow */ 02249 # ifndef YYSTACK_RELOCATE 02250 goto yyexhaustedlab; 02251 # else 02252 /* Extend the stack our own way. */ 02253 if (YYMAXDEPTH <= yystacksize) 02254 goto yyexhaustedlab; 02255 yystacksize *= 2; 02256 if (YYMAXDEPTH < yystacksize) 02257 yystacksize = YYMAXDEPTH; 02258 02259 { 02260 yytype_int16 *yyss1 = yyss; 02261 union yyalloc *yyptr = 02262 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 02263 if (! yyptr) 02264 goto yyexhaustedlab; 02265 YYSTACK_RELOCATE (yyss_alloc, yyss); 02266 YYSTACK_RELOCATE (yyvs_alloc, yyvs); 02267 # undef YYSTACK_RELOCATE 02268 if (yyss1 != yyssa) 02269 YYSTACK_FREE (yyss1); 02270 } 02271 # endif 02272 #endif /* no yyoverflow */ 02273 02274 yyssp = yyss + yysize - 1; 02275 yyvsp = yyvs + yysize - 1; 02276 02277 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 02278 (unsigned long int) yystacksize)); 02279 02280 if (yyss + yystacksize - 1 <= yyssp) 02281 YYABORT; 02282 } 02283 02284 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 02285 02286 if (yystate == YYFINAL) 02287 YYACCEPT; 02288 02289 goto yybackup; 02290 02291 /*-----------. 02292 | yybackup. | 02293 `-----------*/ 02294 yybackup: 02295 02296 /* Do appropriate processing given the current state. Read a 02297 lookahead token if we need one and don't already have one. */ 02298 02299 /* First try to decide what to do without reference to lookahead token. */ 02300 yyn = yypact[yystate]; 02301 if (yypact_value_is_default (yyn)) 02302 goto yydefault; 02303 02304 /* Not known => get a lookahead token if don't already have one. */ 02305 02306 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 02307 if (yychar == YYEMPTY) 02308 { 02309 YYDPRINTF ((stderr, "Reading a token: ")); 02310 yychar = YYLEX; 02311 } 02312 02313 if (yychar <= YYEOF) 02314 { 02315 yychar = yytoken = YYEOF; 02316 YYDPRINTF ((stderr, "Now at end of input.\n")); 02317 } 02318 else 02319 { 02320 yytoken = YYTRANSLATE (yychar); 02321 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 02322 } 02323 02324 /* If the proper action on seeing token YYTOKEN is to reduce or to 02325 detect an error, take that action. */ 02326 yyn += yytoken; 02327 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 02328 goto yydefault; 02329 yyn = yytable[yyn]; 02330 if (yyn <= 0) 02331 { 02332 if (yytable_value_is_error (yyn)) 02333 goto yyerrlab; 02334 yyn = -yyn; 02335 goto yyreduce; 02336 } 02337 02338 /* Count tokens shifted since error; after three, turn off error 02339 status. */ 02340 if (yyerrstatus) 02341 yyerrstatus--; 02342 02343 /* Shift the lookahead token. */ 02344 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 02345 02346 /* Discard the shifted token. */ 02347 yychar = YYEMPTY; 02348 02349 yystate = yyn; 02350 *++yyvsp = yylval; 02351 02352 goto yynewstate; 02353 02354 02355 /*-----------------------------------------------------------. 02356 | yydefault -- do the default action for the current state. | 02357 `-----------------------------------------------------------*/ 02358 yydefault: 02359 yyn = yydefact[yystate]; 02360 if (yyn == 0) 02361 goto yyerrlab; 02362 goto yyreduce; 02363 02364 02365 /*-----------------------------. 02366 | yyreduce -- Do a reduction. | 02367 `-----------------------------*/ 02368 yyreduce: 02369 /* yyn is the number of a rule to reduce with. */ 02370 yylen = yyr2[yyn]; 02371 02372 /* If YYLEN is nonzero, implement the default value of the action: 02373 `$$ = $1'. 02374 02375 Otherwise, the following line sets YYVAL to garbage. 02376 This behavior is undocumented and Bison 02377 users should not rely upon it. Assigning to YYVAL 02378 unconditionally makes the parser a bit smaller, and it avoids a 02379 GCC warning that YYVAL may be used uninitialized. */ 02380 yyval = yyvsp[1-yylen]; 02381 02382 02383 YY_REDUCE_PRINT (yyn); 02384 switch (yyn) 02385 { 02386 case 36: 02387 02388 /* Line 1806 of yacc.c */ 02389 #line 821 "src/cfgparse.y" 02390 { 02391 TAILQ_INSERT_TAIL(bindings, (yyvsp[(1) - (1)].binding), bindings); 02392 } 02393 break; 02394 02395 case 37: 02396 02397 /* Line 1806 of yacc.c */ 02398 #line 827 "src/cfgparse.y" 02399 { (yyval.binding) = (yyvsp[(2) - (2)].binding); } 02400 break; 02401 02402 case 38: 02403 02404 /* Line 1806 of yacc.c */ 02405 #line 828 "src/cfgparse.y" 02406 { (yyval.binding) = (yyvsp[(2) - (2)].binding); } 02407 break; 02408 02409 case 39: 02410 02411 /* Line 1806 of yacc.c */ 02412 #line 833 "src/cfgparse.y" 02413 { 02414 printf("\tFound keycode binding mod%d with key %d and command %s\n", (yyvsp[(1) - (3)].number), (yyvsp[(2) - (3)].number), (yyvsp[(3) - (3)].string)); 02415 Binding *new = scalloc(sizeof(Binding)); 02416 02417 new->keycode = (yyvsp[(2) - (3)].number); 02418 new->mods = (yyvsp[(1) - (3)].number); 02419 new->command = (yyvsp[(3) - (3)].string); 02420 02421 (yyval.binding) = new; 02422 } 02423 break; 02424 02425 case 40: 02426 02427 /* Line 1806 of yacc.c */ 02428 #line 847 "src/cfgparse.y" 02429 { 02430 printf("\tFound keysym binding mod%d with key %s and command %s\n", (yyvsp[(1) - (3)].number), (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].string)); 02431 Binding *new = scalloc(sizeof(Binding)); 02432 02433 new->symbol = (yyvsp[(2) - (3)].string); 02434 new->mods = (yyvsp[(1) - (3)].number); 02435 new->command = (yyvsp[(3) - (3)].string); 02436 02437 (yyval.binding) = new; 02438 } 02439 break; 02440 02441 case 41: 02442 02443 /* Line 1806 of yacc.c */ 02444 #line 861 "src/cfgparse.y" 02445 { 02446 if (match_is_empty(¤t_match)) { 02447 ELOG("Match is empty, ignoring this for_window statement\n"); 02448 break; 02449 } 02450 printf("\t should execute command %s for the criteria mentioned above\n", (yyvsp[(3) - (3)].string)); 02451 Assignment *assignment = scalloc(sizeof(Assignment)); 02452 assignment->type = A_COMMAND; 02453 assignment->match = current_match; 02454 assignment->dest.command = (yyvsp[(3) - (3)].string); 02455 TAILQ_INSERT_TAIL(&assignments, assignment, assignments); 02456 } 02457 break; 02458 02459 case 43: 02460 02461 /* Line 1806 of yacc.c */ 02462 #line 877 "src/cfgparse.y" 02463 { 02464 printf("match parsed\n"); 02465 } 02466 break; 02467 02468 case 44: 02469 02470 /* Line 1806 of yacc.c */ 02471 #line 884 "src/cfgparse.y" 02472 { 02473 printf("start\n"); 02474 match_init(¤t_match); 02475 } 02476 break; 02477 02478 case 45: 02479 02480 /* Line 1806 of yacc.c */ 02481 #line 892 "src/cfgparse.y" 02482 { 02483 printf("match specification finished\n"); 02484 } 02485 break; 02486 02487 case 48: 02488 02489 /* Line 1806 of yacc.c */ 02490 #line 904 "src/cfgparse.y" 02491 { 02492 printf("criteria: class = %s\n", (yyvsp[(3) - (3)].string)); 02493 current_match.class = regex_new((yyvsp[(3) - (3)].string)); 02494 free((yyvsp[(3) - (3)].string)); 02495 } 02496 break; 02497 02498 case 49: 02499 02500 /* Line 1806 of yacc.c */ 02501 #line 910 "src/cfgparse.y" 02502 { 02503 printf("criteria: instance = %s\n", (yyvsp[(3) - (3)].string)); 02504 current_match.instance = regex_new((yyvsp[(3) - (3)].string)); 02505 free((yyvsp[(3) - (3)].string)); 02506 } 02507 break; 02508 02509 case 50: 02510 02511 /* Line 1806 of yacc.c */ 02512 #line 916 "src/cfgparse.y" 02513 { 02514 printf("criteria: window_role = %s\n", (yyvsp[(3) - (3)].string)); 02515 current_match.role = regex_new((yyvsp[(3) - (3)].string)); 02516 free((yyvsp[(3) - (3)].string)); 02517 } 02518 break; 02519 02520 case 51: 02521 02522 /* Line 1806 of yacc.c */ 02523 #line 922 "src/cfgparse.y" 02524 { 02525 printf("criteria: id = %s\n", (yyvsp[(3) - (3)].string)); 02526 char *end; 02527 long parsed = strtol((yyvsp[(3) - (3)].string), &end, 10); 02528 if (parsed == LONG_MIN || 02529 parsed == LONG_MAX || 02530 parsed < 0 || 02531 (end && *end != '\0')) { 02532 ELOG("Could not parse con id \"%s\"\n", (yyvsp[(3) - (3)].string)); 02533 } else { 02534 current_match.con_id = (Con*)parsed; 02535 printf("id as int = %p\n", current_match.con_id); 02536 } 02537 } 02538 break; 02539 02540 case 52: 02541 02542 /* Line 1806 of yacc.c */ 02543 #line 937 "src/cfgparse.y" 02544 { 02545 printf("criteria: window id = %s\n", (yyvsp[(3) - (3)].string)); 02546 char *end; 02547 long parsed = strtol((yyvsp[(3) - (3)].string), &end, 10); 02548 if (parsed == LONG_MIN || 02549 parsed == LONG_MAX || 02550 parsed < 0 || 02551 (end && *end != '\0')) { 02552 ELOG("Could not parse window id \"%s\"\n", (yyvsp[(3) - (3)].string)); 02553 } else { 02554 current_match.id = parsed; 02555 printf("window id as int = %d\n", current_match.id); 02556 } 02557 } 02558 break; 02559 02560 case 53: 02561 02562 /* Line 1806 of yacc.c */ 02563 #line 952 "src/cfgparse.y" 02564 { 02565 printf("criteria: mark = %s\n", (yyvsp[(3) - (3)].string)); 02566 current_match.mark = regex_new((yyvsp[(3) - (3)].string)); 02567 free((yyvsp[(3) - (3)].string)); 02568 } 02569 break; 02570 02571 case 54: 02572 02573 /* Line 1806 of yacc.c */ 02574 #line 958 "src/cfgparse.y" 02575 { 02576 printf("criteria: title = %s\n", (yyvsp[(3) - (3)].string)); 02577 current_match.title = regex_new((yyvsp[(3) - (3)].string)); 02578 free((yyvsp[(3) - (3)].string)); 02579 } 02580 break; 02581 02582 case 55: 02583 02584 /* Line 1806 of yacc.c */ 02585 #line 964 "src/cfgparse.y" 02586 { 02587 printf("criteria: urgent = %s\n", (yyvsp[(3) - (3)].string)); 02588 if (strcasecmp((yyvsp[(3) - (3)].string), "latest") == 0 || 02589 strcasecmp((yyvsp[(3) - (3)].string), "newest") == 0 || 02590 strcasecmp((yyvsp[(3) - (3)].string), "recent") == 0 || 02591 strcasecmp((yyvsp[(3) - (3)].string), "last") == 0) { 02592 current_match.urgent = U_LATEST; 02593 } else if (strcasecmp((yyvsp[(3) - (3)].string), "oldest") == 0 || 02594 strcasecmp((yyvsp[(3) - (3)].string), "first") == 0) { 02595 current_match.urgent = U_OLDEST; 02596 } 02597 free((yyvsp[(3) - (3)].string)); 02598 } 02599 break; 02600 02601 case 57: 02602 02603 /* Line 1806 of yacc.c */ 02604 #line 981 "src/cfgparse.y" 02605 { sasprintf(&(yyval.string), "%d", (yyvsp[(1) - (1)].number)); } 02606 break; 02607 02608 case 59: 02609 02610 /* Line 1806 of yacc.c */ 02611 #line 987 "src/cfgparse.y" 02612 { 02613 sasprintf(&(yyval.string), "%d", (yyvsp[(1) - (1)].number)); 02614 } 02615 break; 02616 02617 case 60: 02618 02619 /* Line 1806 of yacc.c */ 02620 #line 994 "src/cfgparse.y" 02621 { 02622 if (strcasecmp((yyvsp[(2) - (5)].string), "default") == 0) { 02623 printf("You cannot use the name \"default\" for your mode\n"); 02624 exit(1); 02625 } 02626 printf("\t now in mode %s\n", (yyvsp[(2) - (5)].string)); 02627 printf("\t current bindings = %p\n", current_bindings); 02628 Binding *binding; 02629 TAILQ_FOREACH(binding, current_bindings, bindings) { 02630 printf("got binding on mods %d, keycode %d, symbol %s, command %s\n", 02631 binding->mods, binding->keycode, binding->symbol, binding->command); 02632 } 02633 02634 struct Mode *mode = scalloc(sizeof(struct Mode)); 02635 mode->name = (yyvsp[(2) - (5)].string); 02636 mode->bindings = current_bindings; 02637 current_bindings = NULL; 02638 SLIST_INSERT_HEAD(&modes, mode, modes); 02639 } 02640 break; 02641 02642 case 64: 02643 02644 /* Line 1806 of yacc.c */ 02645 #line 1024 "src/cfgparse.y" 02646 { 02647 if (current_bindings == NULL) { 02648 current_bindings = scalloc(sizeof(struct bindings_head)); 02649 TAILQ_INIT(current_bindings); 02650 } 02651 02652 TAILQ_INSERT_TAIL(current_bindings, (yyvsp[(1) - (1)].binding), bindings); 02653 } 02654 break; 02655 02656 case 65: 02657 02658 /* Line 1806 of yacc.c */ 02659 #line 1036 "src/cfgparse.y" 02660 { 02661 printf("\t new bar configuration finished, saving.\n"); 02662 /* Generate a unique ID for this bar */ 02663 current_bar.id = sstrdup("bar-XXXXXX"); 02664 /* This works similar to mktemp in that it replaces the last six X with 02665 * random letters, but without the restriction that the given buffer 02666 * has to contain a valid path name. */ 02667 char *x = current_bar.id + strlen("bar-"); 02668 while (*x != '\0') { 02669 *(x++) = (rand() % 26) + 'a'; 02670 } 02671 02672 /* If no font was explicitly set, we use the i3 font as default */ 02673 if (!current_bar.font && font_pattern) 02674 current_bar.font = sstrdup(font_pattern); 02675 02676 /* Copy the current (static) structure into a dynamically allocated 02677 * one, then cleanup our static one. */ 02678 Barconfig *bar_config = scalloc(sizeof(Barconfig)); 02679 memcpy(bar_config, ¤t_bar, sizeof(Barconfig)); 02680 TAILQ_INSERT_TAIL(&barconfigs, bar_config, configs); 02681 02682 memset(¤t_bar, '\0', sizeof(Barconfig)); 02683 } 02684 break; 02685 02686 case 87: 02687 02688 /* Line 1806 of yacc.c */ 02689 #line 1091 "src/cfgparse.y" 02690 { 02691 DLOG("should add status command %s\n", (yyvsp[(2) - (2)].string)); 02692 FREE(current_bar.status_command); 02693 current_bar.status_command = (yyvsp[(2) - (2)].string); 02694 } 02695 break; 02696 02697 case 88: 02698 02699 /* Line 1806 of yacc.c */ 02700 #line 1100 "src/cfgparse.y" 02701 { 02702 DLOG("should add i3bar_command %s\n", (yyvsp[(2) - (2)].string)); 02703 FREE(current_bar.i3bar_command); 02704 current_bar.i3bar_command = (yyvsp[(2) - (2)].string); 02705 } 02706 break; 02707 02708 case 89: 02709 02710 /* Line 1806 of yacc.c */ 02711 #line 1109 "src/cfgparse.y" 02712 { 02713 DLOG("bar output %s\n", (yyvsp[(2) - (2)].string)); 02714 int new_outputs = current_bar.num_outputs + 1; 02715 current_bar.outputs = srealloc(current_bar.outputs, sizeof(char*) * new_outputs); 02716 current_bar.outputs[current_bar.num_outputs] = (yyvsp[(2) - (2)].string); 02717 current_bar.num_outputs = new_outputs; 02718 } 02719 break; 02720 02721 case 90: 02722 02723 /* Line 1806 of yacc.c */ 02724 #line 1120 "src/cfgparse.y" 02725 { 02726 DLOG("tray %s\n", (yyvsp[(2) - (2)].string)); 02727 FREE(current_bar.tray_output); 02728 current_bar.tray_output = (yyvsp[(2) - (2)].string); 02729 } 02730 break; 02731 02732 case 91: 02733 02734 /* Line 1806 of yacc.c */ 02735 #line 1129 "src/cfgparse.y" 02736 { 02737 DLOG("position %d\n", (yyvsp[(2) - (2)].number)); 02738 current_bar.position = (yyvsp[(2) - (2)].number); 02739 } 02740 break; 02741 02742 case 92: 02743 02744 /* Line 1806 of yacc.c */ 02745 #line 1136 "src/cfgparse.y" 02746 { (yyval.number) = P_TOP; } 02747 break; 02748 02749 case 93: 02750 02751 /* Line 1806 of yacc.c */ 02752 #line 1137 "src/cfgparse.y" 02753 { (yyval.number) = P_BOTTOM; } 02754 break; 02755 02756 case 94: 02757 02758 /* Line 1806 of yacc.c */ 02759 #line 1142 "src/cfgparse.y" 02760 { 02761 DLOG("mode %d\n", (yyvsp[(2) - (2)].number)); 02762 current_bar.mode = (yyvsp[(2) - (2)].number); 02763 } 02764 break; 02765 02766 case 95: 02767 02768 /* Line 1806 of yacc.c */ 02769 #line 1149 "src/cfgparse.y" 02770 { (yyval.number) = M_HIDE; } 02771 break; 02772 02773 case 96: 02774 02775 /* Line 1806 of yacc.c */ 02776 #line 1150 "src/cfgparse.y" 02777 { (yyval.number) = M_DOCK; } 02778 break; 02779 02780 case 97: 02781 02782 /* Line 1806 of yacc.c */ 02783 #line 1155 "src/cfgparse.y" 02784 { 02785 DLOG("modifier %d\n", (yyvsp[(2) - (2)].number)); 02786 current_bar.modifier = (yyvsp[(2) - (2)].number); 02787 } 02788 break; 02789 02790 case 98: 02791 02792 /* Line 1806 of yacc.c */ 02793 #line 1161 "src/cfgparse.y" 02794 { (yyval.number) = M_CONTROL; } 02795 break; 02796 02797 case 99: 02798 02799 /* Line 1806 of yacc.c */ 02800 #line 1162 "src/cfgparse.y" 02801 { (yyval.number) = M_SHIFT; } 02802 break; 02803 02804 case 100: 02805 02806 /* Line 1806 of yacc.c */ 02807 #line 1163 "src/cfgparse.y" 02808 { (yyval.number) = M_MOD1; } 02809 break; 02810 02811 case 101: 02812 02813 /* Line 1806 of yacc.c */ 02814 #line 1164 "src/cfgparse.y" 02815 { (yyval.number) = M_MOD2; } 02816 break; 02817 02818 case 102: 02819 02820 /* Line 1806 of yacc.c */ 02821 #line 1165 "src/cfgparse.y" 02822 { (yyval.number) = M_MOD3; } 02823 break; 02824 02825 case 103: 02826 02827 /* Line 1806 of yacc.c */ 02828 #line 1166 "src/cfgparse.y" 02829 { (yyval.number) = M_MOD4; } 02830 break; 02831 02832 case 104: 02833 02834 /* Line 1806 of yacc.c */ 02835 #line 1167 "src/cfgparse.y" 02836 { (yyval.number) = M_MOD5; } 02837 break; 02838 02839 case 105: 02840 02841 /* Line 1806 of yacc.c */ 02842 #line 1172 "src/cfgparse.y" 02843 { 02844 DLOG("font %s\n", (yyvsp[(2) - (2)].string)); 02845 FREE(current_bar.font); 02846 current_bar.font = (yyvsp[(2) - (2)].string); 02847 } 02848 break; 02849 02850 case 106: 02851 02852 /* Line 1806 of yacc.c */ 02853 #line 1181 "src/cfgparse.y" 02854 { 02855 DLOG("workspace_buttons = %d\n", (yyvsp[(2) - (2)].number)); 02856 /* We store this inverted to make the default setting right when 02857 * initializing the struct with zero. */ 02858 current_bar.hide_workspace_buttons = !((yyvsp[(2) - (2)].number)); 02859 } 02860 break; 02861 02862 case 107: 02863 02864 /* Line 1806 of yacc.c */ 02865 #line 1191 "src/cfgparse.y" 02866 { 02867 DLOG("verbose = %d\n", (yyvsp[(2) - (2)].number)); 02868 current_bar.verbose = (yyvsp[(2) - (2)].number); 02869 } 02870 break; 02871 02872 case 108: 02873 02874 /* Line 1806 of yacc.c */ 02875 #line 1199 "src/cfgparse.y" 02876 { 02877 DLOG("socket_path = %s\n", (yyvsp[(2) - (2)].string)); 02878 FREE(current_bar.socket_path); 02879 current_bar.socket_path = (yyvsp[(2) - (2)].string); 02880 } 02881 break; 02882 02883 case 109: 02884 02885 /* Line 1806 of yacc.c */ 02886 #line 1208 "src/cfgparse.y" 02887 { 02888 /* At the moment, the TOK_BAR_COLORS token is only to make the config 02889 * friendlier for humans. We might change this in the future if it gets 02890 * more complex. */ 02891 } 02892 break; 02893 02894 case 110: 02895 02896 /* Line 1806 of yacc.c */ 02897 #line 1217 "src/cfgparse.y" 02898 { 02899 DLOG("background = %s\n", (yyvsp[(2) - (2)].string)); 02900 current_bar.colors.background = (yyvsp[(2) - (2)].string); 02901 } 02902 break; 02903 02904 case 111: 02905 02906 /* Line 1806 of yacc.c */ 02907 #line 1225 "src/cfgparse.y" 02908 { 02909 DLOG("statusline = %s\n", (yyvsp[(2) - (2)].string)); 02910 current_bar.colors.statusline = (yyvsp[(2) - (2)].string); 02911 } 02912 break; 02913 02914 case 112: 02915 02916 /* Line 1806 of yacc.c */ 02917 #line 1233 "src/cfgparse.y" 02918 { 02919 /* Old syntax: text / background */ 02920 DLOG("focused_ws = %s, %s (old)\n", (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].string)); 02921 current_bar.colors.focused_workspace_bg = (yyvsp[(3) - (3)].string); 02922 current_bar.colors.focused_workspace_text = (yyvsp[(2) - (3)].string); 02923 } 02924 break; 02925 02926 case 113: 02927 02928 /* Line 1806 of yacc.c */ 02929 #line 1240 "src/cfgparse.y" 02930 { 02931 /* New syntax: border / background / text */ 02932 DLOG("focused_ws = %s, %s and %s\n", (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].string), (yyvsp[(4) - (4)].string)); 02933 current_bar.colors.focused_workspace_border = (yyvsp[(2) - (4)].string); 02934 current_bar.colors.focused_workspace_bg = (yyvsp[(3) - (4)].string); 02935 current_bar.colors.focused_workspace_text = (yyvsp[(4) - (4)].string); 02936 } 02937 break; 02938 02939 case 114: 02940 02941 /* Line 1806 of yacc.c */ 02942 #line 1251 "src/cfgparse.y" 02943 { 02944 /* Old syntax: text / background */ 02945 DLOG("active_ws = %s, %s (old)\n", (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].string)); 02946 current_bar.colors.active_workspace_bg = (yyvsp[(3) - (3)].string); 02947 current_bar.colors.active_workspace_text = (yyvsp[(2) - (3)].string); 02948 } 02949 break; 02950 02951 case 115: 02952 02953 /* Line 1806 of yacc.c */ 02954 #line 1258 "src/cfgparse.y" 02955 { 02956 /* New syntax: border / background / text */ 02957 DLOG("active_ws = %s, %s and %s\n", (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].string), (yyvsp[(4) - (4)].string)); 02958 current_bar.colors.active_workspace_border = (yyvsp[(2) - (4)].string); 02959 current_bar.colors.active_workspace_bg = (yyvsp[(3) - (4)].string); 02960 current_bar.colors.active_workspace_text = (yyvsp[(4) - (4)].string); 02961 } 02962 break; 02963 02964 case 116: 02965 02966 /* Line 1806 of yacc.c */ 02967 #line 1269 "src/cfgparse.y" 02968 { 02969 /* Old syntax: text / background */ 02970 DLOG("inactive_ws = %s, %s (old)\n", (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].string)); 02971 current_bar.colors.inactive_workspace_bg = (yyvsp[(3) - (3)].string); 02972 current_bar.colors.inactive_workspace_text = (yyvsp[(2) - (3)].string); 02973 } 02974 break; 02975 02976 case 117: 02977 02978 /* Line 1806 of yacc.c */ 02979 #line 1276 "src/cfgparse.y" 02980 { 02981 DLOG("inactive_ws = %s, %s and %s\n", (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].string), (yyvsp[(4) - (4)].string)); 02982 current_bar.colors.inactive_workspace_border = (yyvsp[(2) - (4)].string); 02983 current_bar.colors.inactive_workspace_bg = (yyvsp[(3) - (4)].string); 02984 current_bar.colors.inactive_workspace_text = (yyvsp[(4) - (4)].string); 02985 } 02986 break; 02987 02988 case 118: 02989 02990 /* Line 1806 of yacc.c */ 02991 #line 1286 "src/cfgparse.y" 02992 { 02993 /* Old syntax: text / background */ 02994 DLOG("urgent_ws = %s, %s (old)\n", (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].string)); 02995 current_bar.colors.urgent_workspace_bg = (yyvsp[(3) - (3)].string); 02996 current_bar.colors.urgent_workspace_text = (yyvsp[(2) - (3)].string); 02997 } 02998 break; 02999 03000 case 119: 03001 03002 /* Line 1806 of yacc.c */ 03003 #line 1293 "src/cfgparse.y" 03004 { 03005 DLOG("urgent_ws = %s, %s and %s\n", (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].string), (yyvsp[(4) - (4)].string)); 03006 current_bar.colors.urgent_workspace_border = (yyvsp[(2) - (4)].string); 03007 current_bar.colors.urgent_workspace_bg = (yyvsp[(3) - (4)].string); 03008 current_bar.colors.urgent_workspace_text = (yyvsp[(4) - (4)].string); 03009 } 03010 break; 03011 03012 case 120: 03013 03014 /* Line 1806 of yacc.c */ 03015 #line 1303 "src/cfgparse.y" 03016 { 03017 printf("floating_maximum_width = %d\n", (yyvsp[(2) - (4)].number)); 03018 printf("floating_maximum_height = %d\n", (yyvsp[(4) - (4)].number)); 03019 config.floating_maximum_width = (yyvsp[(2) - (4)].number); 03020 config.floating_maximum_height = (yyvsp[(4) - (4)].number); 03021 } 03022 break; 03023 03024 case 121: 03025 03026 /* Line 1806 of yacc.c */ 03027 #line 1313 "src/cfgparse.y" 03028 { 03029 printf("floating_minimum_width = %d\n", (yyvsp[(2) - (4)].number)); 03030 printf("floating_minimum_height = %d\n", (yyvsp[(4) - (4)].number)); 03031 config.floating_minimum_width = (yyvsp[(2) - (4)].number); 03032 config.floating_minimum_height = (yyvsp[(4) - (4)].number); 03033 } 03034 break; 03035 03036 case 122: 03037 03038 /* Line 1806 of yacc.c */ 03039 #line 1323 "src/cfgparse.y" 03040 { 03041 DLOG("floating modifier = %d\n", (yyvsp[(2) - (2)].number)); 03042 config.floating_modifier = (yyvsp[(2) - (2)].number); 03043 } 03044 break; 03045 03046 case 123: 03047 03048 /* Line 1806 of yacc.c */ 03049 #line 1331 "src/cfgparse.y" 03050 { 03051 DLOG("New containers should start with split direction %d\n", (yyvsp[(2) - (2)].number)); 03052 config.default_orientation = (yyvsp[(2) - (2)].number); 03053 } 03054 break; 03055 03056 case 124: 03057 03058 /* Line 1806 of yacc.c */ 03059 #line 1338 "src/cfgparse.y" 03060 { (yyval.number) = HORIZ; } 03061 break; 03062 03063 case 125: 03064 03065 /* Line 1806 of yacc.c */ 03066 #line 1339 "src/cfgparse.y" 03067 { (yyval.number) = VERT; } 03068 break; 03069 03070 case 126: 03071 03072 /* Line 1806 of yacc.c */ 03073 #line 1340 "src/cfgparse.y" 03074 { (yyval.number) = NO_ORIENTATION; } 03075 break; 03076 03077 case 127: 03078 03079 /* Line 1806 of yacc.c */ 03080 #line 1345 "src/cfgparse.y" 03081 { 03082 DLOG("new containers will be in mode %d\n", (yyvsp[(2) - (2)].number)); 03083 config.default_layout = (yyvsp[(2) - (2)].number); 03084 03085 #if 0 03086 /* We also need to change the layout of the already existing 03087 * workspaces here. Workspaces may exist at this point because 03088 * of the other directives which are modifying workspaces 03089 * (setting the preferred screen or name). While the workspace 03090 * objects are already created, they have never been used. 03091 * Thus, the user very likely awaits the default container mode 03092 * to trigger in this case, regardless of where it is inside 03093 * his configuration file. */ 03094 Workspace *ws; 03095 TAILQ_FOREACH(ws, workspaces, workspaces) { 03096 if (ws->table == NULL) 03097 continue; 03098 switch_layout_mode(global_conn, 03099 ws->table[0][0], 03100 config.container_mode); 03101 } 03102 #endif 03103 } 03104 break; 03105 03106 case 128: 03107 03108 /* Line 1806 of yacc.c */ 03109 #line 1369 "src/cfgparse.y" 03110 { 03111 DLOG("stack-limit %d with val %d\n", (yyvsp[(3) - (4)].number), (yyvsp[(4) - (4)].number)); 03112 config.container_stack_limit = (yyvsp[(3) - (4)].number); 03113 config.container_stack_limit_value = (yyvsp[(4) - (4)].number); 03114 03115 #if 0 03116 /* See the comment above */ 03117 Workspace *ws; 03118 TAILQ_FOREACH(ws, workspaces, workspaces) { 03119 if (ws->table == NULL) 03120 continue; 03121 Container *con = ws->table[0][0]; 03122 con->stack_limit = config.container_stack_limit; 03123 con->stack_limit_value = config.container_stack_limit_value; 03124 } 03125 #endif 03126 } 03127 break; 03128 03129 case 129: 03130 03131 /* Line 1806 of yacc.c */ 03132 #line 1389 "src/cfgparse.y" 03133 { (yyval.number) = L_DEFAULT; } 03134 break; 03135 03136 case 130: 03137 03138 /* Line 1806 of yacc.c */ 03139 #line 1390 "src/cfgparse.y" 03140 { (yyval.number) = L_STACKED; } 03141 break; 03142 03143 case 131: 03144 03145 /* Line 1806 of yacc.c */ 03146 #line 1391 "src/cfgparse.y" 03147 { (yyval.number) = L_TABBED; } 03148 break; 03149 03150 case 132: 03151 03152 /* Line 1806 of yacc.c */ 03153 #line 1396 "src/cfgparse.y" 03154 { 03155 DLOG("new windows should start with border style %d\n", (yyvsp[(2) - (2)].number)); 03156 config.default_border = (yyvsp[(2) - (2)].number); 03157 } 03158 break; 03159 03160 case 133: 03161 03162 /* Line 1806 of yacc.c */ 03163 #line 1404 "src/cfgparse.y" 03164 { 03165 DLOG("new floating windows should start with border style %d\n", (yyvsp[(2) - (2)].number)); 03166 config.default_floating_border = (yyvsp[(2) - (2)].number); 03167 } 03168 break; 03169 03170 case 134: 03171 03172 /* Line 1806 of yacc.c */ 03173 #line 1411 "src/cfgparse.y" 03174 { (yyval.number) = BS_NORMAL; } 03175 break; 03176 03177 case 135: 03178 03179 /* Line 1806 of yacc.c */ 03180 #line 1412 "src/cfgparse.y" 03181 { (yyval.number) = BS_NONE; } 03182 break; 03183 03184 case 136: 03185 03186 /* Line 1806 of yacc.c */ 03187 #line 1413 "src/cfgparse.y" 03188 { (yyval.number) = BS_1PIXEL; } 03189 break; 03190 03191 case 137: 03192 03193 /* Line 1806 of yacc.c */ 03194 #line 1418 "src/cfgparse.y" 03195 { 03196 (yyval.number) = ((yyvsp[(1) - (1)].number) == 1); 03197 } 03198 break; 03199 03200 case 138: 03201 03202 /* Line 1806 of yacc.c */ 03203 #line 1422 "src/cfgparse.y" 03204 { 03205 DLOG("checking word \"%s\"\n", (yyvsp[(1) - (1)].string)); 03206 (yyval.number) = (strcasecmp((yyvsp[(1) - (1)].string), "yes") == 0 || 03207 strcasecmp((yyvsp[(1) - (1)].string), "true") == 0 || 03208 strcasecmp((yyvsp[(1) - (1)].string), "on") == 0 || 03209 strcasecmp((yyvsp[(1) - (1)].string), "enable") == 0 || 03210 strcasecmp((yyvsp[(1) - (1)].string), "active") == 0); 03211 } 03212 break; 03213 03214 case 139: 03215 03216 /* Line 1806 of yacc.c */ 03217 #line 1434 "src/cfgparse.y" 03218 { 03219 DLOG("focus follows mouse = %d\n", (yyvsp[(2) - (2)].number)); 03220 config.disable_focus_follows_mouse = !((yyvsp[(2) - (2)].number)); 03221 } 03222 break; 03223 03224 case 140: 03225 03226 /* Line 1806 of yacc.c */ 03227 #line 1442 "src/cfgparse.y" 03228 { 03229 DLOG("force focus wrapping = %d\n", (yyvsp[(2) - (2)].number)); 03230 config.force_focus_wrapping = (yyvsp[(2) - (2)].number); 03231 } 03232 break; 03233 03234 case 141: 03235 03236 /* Line 1806 of yacc.c */ 03237 #line 1450 "src/cfgparse.y" 03238 { 03239 DLOG("force xinerama = %d\n", (yyvsp[(2) - (2)].number)); 03240 config.force_xinerama = (yyvsp[(2) - (2)].number); 03241 } 03242 break; 03243 03244 case 142: 03245 03246 /* Line 1806 of yacc.c */ 03247 #line 1458 "src/cfgparse.y" 03248 { 03249 DLOG("fake outputs = %s\n", (yyvsp[(2) - (2)].string)); 03250 config.fake_outputs = (yyvsp[(2) - (2)].string); 03251 } 03252 break; 03253 03254 case 143: 03255 03256 /* Line 1806 of yacc.c */ 03257 #line 1466 "src/cfgparse.y" 03258 { 03259 DLOG("automatic workspace back-and-forth = %d\n", (yyvsp[(2) - (2)].number)); 03260 config.workspace_auto_back_and_forth = (yyvsp[(2) - (2)].number); 03261 } 03262 break; 03263 03264 case 144: 03265 03266 /* Line 1806 of yacc.c */ 03267 #line 1474 "src/cfgparse.y" 03268 { 03269 DLOG("workspace bar = %d\n", (yyvsp[(2) - (2)].number)); 03270 config.disable_workspace_bar = !((yyvsp[(2) - (2)].number)); 03271 } 03272 break; 03273 03274 case 145: 03275 03276 /* Line 1806 of yacc.c */ 03277 #line 1482 "src/cfgparse.y" 03278 { 03279 char *ws_name = (yyvsp[(2) - (5)].string); 03280 03281 if ((yyvsp[(5) - (5)].string) != NULL) { 03282 ELOG("The old (v3) syntax workspace <number> output <output> <name> is deprecated.\n"); 03283 ELOG("Please use the new syntax: workspace \"<workspace>\" output <output>\n"); 03284 ELOG("In your case, the following should work:\n"); 03285 ELOG(" workspace \"%s\" output %s\n", (yyvsp[(5) - (5)].string), (yyvsp[(4) - (5)].string)); 03286 ws_name = (yyvsp[(5) - (5)].string); 03287 context->has_warnings = true; 03288 } 03289 03290 DLOG("Assigning workspace \"%s\" to output \"%s\"\n", ws_name, (yyvsp[(4) - (5)].string)); 03291 /* Check for earlier assignments of the same workspace so that we 03292 * don’t have assignments of a single workspace to different 03293 * outputs */ 03294 struct Workspace_Assignment *assignment; 03295 bool duplicate = false; 03296 TAILQ_FOREACH(assignment, &ws_assignments, ws_assignments) { 03297 if (strcasecmp(assignment->name, ws_name) == 0) { 03298 ELOG("You have a duplicate workspace assignment for workspace \"%s\"\n", 03299 ws_name); 03300 assignment->output = (yyvsp[(4) - (5)].string); 03301 duplicate = true; 03302 } 03303 } 03304 if (!duplicate) { 03305 assignment = scalloc(sizeof(struct Workspace_Assignment)); 03306 assignment->name = ws_name; 03307 assignment->output = (yyvsp[(4) - (5)].string); 03308 TAILQ_INSERT_TAIL(&ws_assignments, assignment, ws_assignments); 03309 } 03310 } 03311 break; 03312 03313 case 146: 03314 03315 /* Line 1806 of yacc.c */ 03316 #line 1516 "src/cfgparse.y" 03317 { 03318 int ws_num = (yyvsp[(2) - (3)].number); 03319 if (ws_num < 1) { 03320 DLOG("Invalid workspace assignment, workspace number %d out of range\n", ws_num); 03321 } else { 03322 DLOG("workspace name to: %s\n", (yyvsp[(3) - (3)].string)); 03323 #if 0 03324 if ((yyvsp[(3) - (3)].string) != NULL) { 03325 workspace_set_name(workspace_get(ws_num - 1), (yyvsp[(3) - (3)].string)); 03326 free((yyvsp[(3) - (3)].string)); 03327 } 03328 #endif 03329 } 03330 } 03331 break; 03332 03333 case 147: 03334 03335 /* Line 1806 of yacc.c */ 03336 #line 1533 "src/cfgparse.y" 03337 { (yyval.string) = NULL; } 03338 break; 03339 03340 case 148: 03341 03342 /* Line 1806 of yacc.c */ 03343 #line 1534 "src/cfgparse.y" 03344 { (yyval.string) = (yyvsp[(1) - (1)].string); } 03345 break; 03346 03347 case 149: 03348 03349 /* Line 1806 of yacc.c */ 03350 #line 1538 "src/cfgparse.y" 03351 { (yyval.string) = (yyvsp[(1) - (1)].string); } 03352 break; 03353 03354 case 150: 03355 03356 /* Line 1806 of yacc.c */ 03357 #line 1539 "src/cfgparse.y" 03358 { (yyval.string) = (yyvsp[(1) - (1)].string); } 03359 break; 03360 03361 case 151: 03362 03363 /* Line 1806 of yacc.c */ 03364 #line 1540 "src/cfgparse.y" 03365 { (yyval.string) = (yyvsp[(1) - (1)].string); } 03366 break; 03367 03368 case 152: 03369 03370 /* Line 1806 of yacc.c */ 03371 #line 1545 "src/cfgparse.y" 03372 { 03373 /* This is the old, deprecated form of assignments. It’s provided for 03374 * compatibility in version (4.1, 4.2, 4.3) and will be removed 03375 * afterwards. It triggers an i3-nagbar warning starting from 4.1. */ 03376 ELOG("You are using the old assign syntax (without criteria). " 03377 "Please see the User's Guide for the new syntax and fix " 03378 "your config file.\n"); 03379 context->has_warnings = true; 03380 printf("assignment of %s to *%s*\n", (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].string)); 03381 char *workspace = (yyvsp[(3) - (3)].string); 03382 char *criteria = (yyvsp[(2) - (3)].string); 03383 03384 Assignment *assignment = scalloc(sizeof(Assignment)); 03385 Match *match = &(assignment->match); 03386 match_init(match); 03387 03388 char *separator = NULL; 03389 if ((separator = strchr(criteria, '/')) != NULL) { 03390 *(separator++) = '\0'; 03391 char *pattern; 03392 sasprintf(&pattern, "(?i)%s", separator); 03393 match->title = regex_new(pattern); 03394 free(pattern); 03395 printf(" title = %s\n", separator); 03396 } 03397 if (*criteria != '\0') { 03398 char *pattern; 03399 sasprintf(&pattern, "(?i)%s", criteria); 03400 match->class = regex_new(pattern); 03401 free(pattern); 03402 printf(" class = %s\n", criteria); 03403 } 03404 free(criteria); 03405 03406 /* Compatibility with older versions: If the assignment target starts 03407 * with ~, we create the equivalent of: 03408 * 03409 * for_window [class="foo"] floating enable 03410 */ 03411 if (*workspace == '~') { 03412 workspace++; 03413 if (*workspace == '\0') { 03414 /* This assignment was *only* for floating */ 03415 assignment->type = A_COMMAND; 03416 assignment->dest.command = sstrdup("floating enable"); 03417 TAILQ_INSERT_TAIL(&assignments, assignment, assignments); 03418 break; 03419 } else { 03420 /* Create a new assignment and continue afterwards */ 03421 Assignment *floating = scalloc(sizeof(Assignment)); 03422 match_copy(&(floating->match), match); 03423 floating->type = A_COMMAND; 03424 floating->dest.command = sstrdup("floating enable"); 03425 TAILQ_INSERT_TAIL(&assignments, floating, assignments); 03426 } 03427 } 03428 03429 assignment->type = A_TO_WORKSPACE; 03430 assignment->dest.workspace = workspace; 03431 TAILQ_INSERT_TAIL(&assignments, assignment, assignments); 03432 } 03433 break; 03434 03435 case 153: 03436 03437 /* Line 1806 of yacc.c */ 03438 #line 1607 "src/cfgparse.y" 03439 { 03440 if (match_is_empty(¤t_match)) { 03441 ELOG("Match is empty, ignoring this assignment\n"); 03442 break; 03443 } 03444 printf("new assignment, using above criteria, to workspace %s\n", (yyvsp[(3) - (3)].string)); 03445 Assignment *assignment = scalloc(sizeof(Assignment)); 03446 assignment->match = current_match; 03447 assignment->type = A_TO_WORKSPACE; 03448 assignment->dest.workspace = (yyvsp[(3) - (3)].string); 03449 TAILQ_INSERT_TAIL(&assignments, assignment, assignments); 03450 } 03451 break; 03452 03453 case 156: 03454 03455 /* Line 1806 of yacc.c */ 03456 #line 1628 "src/cfgparse.y" 03457 { 03458 config.ipc_socket_path = (yyvsp[(2) - (2)].string); 03459 } 03460 break; 03461 03462 case 157: 03463 03464 /* Line 1806 of yacc.c */ 03465 #line 1635 "src/cfgparse.y" 03466 { 03467 config.restart_state_path = (yyvsp[(2) - (2)].string); 03468 } 03469 break; 03470 03471 case 158: 03472 03473 /* Line 1806 of yacc.c */ 03474 #line 1642 "src/cfgparse.y" 03475 { 03476 struct Autostart *new = smalloc(sizeof(struct Autostart)); 03477 new->command = (yyvsp[(3) - (3)].string); 03478 new->no_startup_id = (yyvsp[(2) - (3)].number); 03479 TAILQ_INSERT_TAIL(&autostarts, new, autostarts); 03480 } 03481 break; 03482 03483 case 159: 03484 03485 /* Line 1806 of yacc.c */ 03486 #line 1652 "src/cfgparse.y" 03487 { 03488 struct Autostart *new = smalloc(sizeof(struct Autostart)); 03489 new->command = (yyvsp[(3) - (3)].string); 03490 new->no_startup_id = (yyvsp[(2) - (3)].number); 03491 TAILQ_INSERT_TAIL(&autostarts_always, new, autostarts_always); 03492 } 03493 break; 03494 03495 case 160: 03496 03497 /* Line 1806 of yacc.c */ 03498 #line 1661 "src/cfgparse.y" 03499 { (yyval.number) = false; } 03500 break; 03501 03502 case 161: 03503 03504 /* Line 1806 of yacc.c */ 03505 #line 1662 "src/cfgparse.y" 03506 { (yyval.number) = true; } 03507 break; 03508 03509 case 162: 03510 03511 /* Line 1806 of yacc.c */ 03512 #line 1667 "src/cfgparse.y" 03513 { 03514 ELOG("The terminal option is DEPRECATED and has no effect. " 03515 "Please remove it from your configuration file.\n"); 03516 } 03517 break; 03518 03519 case 163: 03520 03521 /* Line 1806 of yacc.c */ 03522 #line 1675 "src/cfgparse.y" 03523 { 03524 config.font = load_font((yyvsp[(2) - (2)].string), true); 03525 set_font(&config.font); 03526 printf("font %s\n", (yyvsp[(2) - (2)].string)); 03527 FREE(font_pattern); 03528 font_pattern = (yyvsp[(2) - (2)].string); 03529 } 03530 break; 03531 03532 case 164: 03533 03534 /* Line 1806 of yacc.c */ 03535 #line 1686 "src/cfgparse.y" 03536 { 03537 uint32_t *dest = (yyvsp[(1) - (2)].single_color); 03538 *dest = (yyvsp[(2) - (2)].number); 03539 } 03540 break; 03541 03542 case 165: 03543 03544 /* Line 1806 of yacc.c */ 03545 #line 1694 "src/cfgparse.y" 03546 { 03547 struct Colortriple *dest = (yyvsp[(1) - (4)].color); 03548 03549 dest->border = (yyvsp[(2) - (4)].number); 03550 dest->background = (yyvsp[(3) - (4)].number); 03551 dest->text = (yyvsp[(4) - (4)].number); 03552 } 03553 break; 03554 03555 case 166: 03556 03557 /* Line 1806 of yacc.c */ 03558 #line 1702 "src/cfgparse.y" 03559 { 03560 struct Colortriple *dest = (yyvsp[(1) - (5)].color); 03561 03562 dest->border = (yyvsp[(2) - (5)].number); 03563 dest->background = (yyvsp[(3) - (5)].number); 03564 dest->text = (yyvsp[(4) - (5)].number); 03565 dest->indicator = (yyvsp[(5) - (5)].number); 03566 } 03567 break; 03568 03569 case 167: 03570 03571 /* Line 1806 of yacc.c */ 03572 #line 1714 "src/cfgparse.y" 03573 { 03574 (yyval.number) = get_colorpixel((yyvsp[(1) - (1)].string)); 03575 free((yyvsp[(1) - (1)].string)); 03576 } 03577 break; 03578 03579 case 168: 03580 03581 /* Line 1806 of yacc.c */ 03582 #line 1722 "src/cfgparse.y" 03583 { (yyval.number) = 0; } 03584 break; 03585 03586 case 170: 03587 03588 /* Line 1806 of yacc.c */ 03589 #line 1724 "src/cfgparse.y" 03590 { (yyval.number) = (yyvsp[(1) - (3)].number) | (yyvsp[(3) - (3)].number); } 03591 break; 03592 03593 case 171: 03594 03595 /* Line 1806 of yacc.c */ 03596 #line 1725 "src/cfgparse.y" 03597 { (yyval.number) = (yyvsp[(1) - (2)].number); } 03598 break; 03599 03600 case 172: 03601 03602 /* Line 1806 of yacc.c */ 03603 #line 1729 "src/cfgparse.y" 03604 { (yyval.number) = (yyvsp[(1) - (1)].number); } 03605 break; 03606 03607 case 173: 03608 03609 /* Line 1806 of yacc.c */ 03610 #line 1730 "src/cfgparse.y" 03611 { (yyval.number) = BIND_CONTROL; } 03612 break; 03613 03614 case 174: 03615 03616 /* Line 1806 of yacc.c */ 03617 #line 1731 "src/cfgparse.y" 03618 { (yyval.number) = BIND_SHIFT; } 03619 break; 03620 03621 case 175: 03622 03623 /* Line 1806 of yacc.c */ 03624 #line 1736 "src/cfgparse.y" 03625 { 03626 DLOG("popup_during_fullscreen setting: %d\n", (yyvsp[(2) - (2)].number)); 03627 config.popup_during_fullscreen = (yyvsp[(2) - (2)].number); 03628 } 03629 break; 03630 03631 case 176: 03632 03633 /* Line 1806 of yacc.c */ 03634 #line 1743 "src/cfgparse.y" 03635 { (yyval.number) = PDF_IGNORE; } 03636 break; 03637 03638 case 177: 03639 03640 /* Line 1806 of yacc.c */ 03641 #line 1744 "src/cfgparse.y" 03642 { (yyval.number) = PDF_LEAVE_FULLSCREEN; } 03643 break; 03644 03645 03646 03647 /* Line 1806 of yacc.c */ 03648 #line 3649 "src/cfgparse.tab.c" 03649 default: break; 03650 } 03651 /* User semantic actions sometimes alter yychar, and that requires 03652 that yytoken be updated with the new translation. We take the 03653 approach of translating immediately before every use of yytoken. 03654 One alternative is translating here after every semantic action, 03655 but that translation would be missed if the semantic action invokes 03656 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 03657 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 03658 incorrect destructor might then be invoked immediately. In the 03659 case of YYERROR or YYBACKUP, subsequent parser actions might lead 03660 to an incorrect destructor call or verbose syntax error message 03661 before the lookahead is translated. */ 03662 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 03663 03664 YYPOPSTACK (yylen); 03665 yylen = 0; 03666 YY_STACK_PRINT (yyss, yyssp); 03667 03668 *++yyvsp = yyval; 03669 03670 /* Now `shift' the result of the reduction. Determine what state 03671 that goes to, based on the state we popped back to and the rule 03672 number reduced by. */ 03673 03674 yyn = yyr1[yyn]; 03675 03676 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 03677 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 03678 yystate = yytable[yystate]; 03679 else 03680 yystate = yydefgoto[yyn - YYNTOKENS]; 03681 03682 goto yynewstate; 03683 03684 03685 /*------------------------------------. 03686 | yyerrlab -- here on detecting error | 03687 `------------------------------------*/ 03688 yyerrlab: 03689 /* Make sure we have latest lookahead translation. See comments at 03690 user semantic actions for why this is necessary. */ 03691 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 03692 03693 /* If not already recovering from an error, report this error. */ 03694 if (!yyerrstatus) 03695 { 03696 ++yynerrs; 03697 #if ! YYERROR_VERBOSE 03698 yyerror (YY_("syntax error")); 03699 #else 03700 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 03701 yyssp, yytoken) 03702 { 03703 char const *yymsgp = YY_("syntax error"); 03704 int yysyntax_error_status; 03705 yysyntax_error_status = YYSYNTAX_ERROR; 03706 if (yysyntax_error_status == 0) 03707 yymsgp = yymsg; 03708 else if (yysyntax_error_status == 1) 03709 { 03710 if (yymsg != yymsgbuf) 03711 YYSTACK_FREE (yymsg); 03712 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); 03713 if (!yymsg) 03714 { 03715 yymsg = yymsgbuf; 03716 yymsg_alloc = sizeof yymsgbuf; 03717 yysyntax_error_status = 2; 03718 } 03719 else 03720 { 03721 yysyntax_error_status = YYSYNTAX_ERROR; 03722 yymsgp = yymsg; 03723 } 03724 } 03725 yyerror (yymsgp); 03726 if (yysyntax_error_status == 2) 03727 goto yyexhaustedlab; 03728 } 03729 # undef YYSYNTAX_ERROR 03730 #endif 03731 } 03732 03733 03734 03735 if (yyerrstatus == 3) 03736 { 03737 /* If just tried and failed to reuse lookahead token after an 03738 error, discard it. */ 03739 03740 if (yychar <= YYEOF) 03741 { 03742 /* Return failure if at end of input. */ 03743 if (yychar == YYEOF) 03744 YYABORT; 03745 } 03746 else 03747 { 03748 yydestruct ("Error: discarding", 03749 yytoken, &yylval); 03750 yychar = YYEMPTY; 03751 } 03752 } 03753 03754 /* Else will try to reuse lookahead token after shifting the error 03755 token. */ 03756 goto yyerrlab1; 03757 03758 03759 /*---------------------------------------------------. 03760 | yyerrorlab -- error raised explicitly by YYERROR. | 03761 `---------------------------------------------------*/ 03762 yyerrorlab: 03763 03764 /* Pacify compilers like GCC when the user code never invokes 03765 YYERROR and the label yyerrorlab therefore never appears in user 03766 code. */ 03767 if (/*CONSTCOND*/ 0) 03768 goto yyerrorlab; 03769 03770 /* Do not reclaim the symbols of the rule which action triggered 03771 this YYERROR. */ 03772 YYPOPSTACK (yylen); 03773 yylen = 0; 03774 YY_STACK_PRINT (yyss, yyssp); 03775 yystate = *yyssp; 03776 goto yyerrlab1; 03777 03778 03779 /*-------------------------------------------------------------. 03780 | yyerrlab1 -- common code for both syntax error and YYERROR. | 03781 `-------------------------------------------------------------*/ 03782 yyerrlab1: 03783 yyerrstatus = 3; /* Each real token shifted decrements this. */ 03784 03785 for (;;) 03786 { 03787 yyn = yypact[yystate]; 03788 if (!yypact_value_is_default (yyn)) 03789 { 03790 yyn += YYTERROR; 03791 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 03792 { 03793 yyn = yytable[yyn]; 03794 if (0 < yyn) 03795 break; 03796 } 03797 } 03798 03799 /* Pop the current state because it cannot handle the error token. */ 03800 if (yyssp == yyss) 03801 YYABORT; 03802 03803 03804 yydestruct ("Error: popping", 03805 yystos[yystate], yyvsp); 03806 YYPOPSTACK (1); 03807 yystate = *yyssp; 03808 YY_STACK_PRINT (yyss, yyssp); 03809 } 03810 03811 *++yyvsp = yylval; 03812 03813 03814 /* Shift the error token. */ 03815 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 03816 03817 yystate = yyn; 03818 goto yynewstate; 03819 03820 03821 /*-------------------------------------. 03822 | yyacceptlab -- YYACCEPT comes here. | 03823 `-------------------------------------*/ 03824 yyacceptlab: 03825 yyresult = 0; 03826 goto yyreturn; 03827 03828 /*-----------------------------------. 03829 | yyabortlab -- YYABORT comes here. | 03830 `-----------------------------------*/ 03831 yyabortlab: 03832 yyresult = 1; 03833 goto yyreturn; 03834 03835 #if !defined(yyoverflow) || YYERROR_VERBOSE 03836 /*-------------------------------------------------. 03837 | yyexhaustedlab -- memory exhaustion comes here. | 03838 `-------------------------------------------------*/ 03839 yyexhaustedlab: 03840 yyerror (YY_("memory exhausted")); 03841 yyresult = 2; 03842 /* Fall through. */ 03843 #endif 03844 03845 yyreturn: 03846 if (yychar != YYEMPTY) 03847 { 03848 /* Make sure we have latest lookahead translation. See comments at 03849 user semantic actions for why this is necessary. */ 03850 yytoken = YYTRANSLATE (yychar); 03851 yydestruct ("Cleanup: discarding lookahead", 03852 yytoken, &yylval); 03853 } 03854 /* Do not reclaim the symbols of the rule which action triggered 03855 this YYABORT or YYACCEPT. */ 03856 YYPOPSTACK (yylen); 03857 YY_STACK_PRINT (yyss, yyssp); 03858 while (yyssp != yyss) 03859 { 03860 yydestruct ("Cleanup: popping", 03861 yystos[*yyssp], yyvsp); 03862 YYPOPSTACK (1); 03863 } 03864 #ifndef yyoverflow 03865 if (yyss != yyssa) 03866 YYSTACK_FREE (yyss); 03867 #endif 03868 #if YYERROR_VERBOSE 03869 if (yymsg != yymsgbuf) 03870 YYSTACK_FREE (yymsg); 03871 #endif 03872 /* Make sure YYID is used. */ 03873 return YYID (yyresult); 03874 } 03875 03876 03877