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() { 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 QUOTEDSTRING = 273, 00753 TOKWORKSPACE = 274, 00754 TOKOUTPUT = 275, 00755 TOKASSIGN = 276, 00756 TOKSET = 277, 00757 TOKIPCSOCKET = 278, 00758 TOKRESTARTSTATE = 279, 00759 TOKEXEC = 280, 00760 TOKEXEC_ALWAYS = 281, 00761 TOKSINGLECOLOR = 282, 00762 TOKCOLOR = 283, 00763 TOKARROW = 284, 00764 TOKMODE = 285, 00765 TOK_BAR = 286, 00766 TOK_ORIENTATION = 287, 00767 TOK_HORIZ = 288, 00768 TOK_VERT = 289, 00769 TOK_AUTO = 290, 00770 TOK_WORKSPACE_LAYOUT = 291, 00771 TOKNEWWINDOW = 292, 00772 TOKNEWFLOAT = 293, 00773 TOK_NORMAL = 294, 00774 TOK_NONE = 295, 00775 TOK_1PIXEL = 296, 00776 TOKFOCUSFOLLOWSMOUSE = 297, 00777 TOK_FORCE_FOCUS_WRAPPING = 298, 00778 TOK_FORCE_XINERAMA = 299, 00779 TOK_WORKSPACE_AUTO_BAF = 300, 00780 TOKWORKSPACEBAR = 301, 00781 TOK_DEFAULT = 302, 00782 TOK_STACKING = 303, 00783 TOK_TABBED = 304, 00784 TOKSTACKLIMIT = 305, 00785 TOK_POPUP_DURING_FULLSCREEN = 306, 00786 TOK_IGNORE = 307, 00787 TOK_LEAVE_FULLSCREEN = 308, 00788 TOK_FOR_WINDOW = 309, 00789 TOK_BAR_OUTPUT = 310, 00790 TOK_BAR_TRAY_OUTPUT = 311, 00791 TOK_BAR_SOCKET_PATH = 312, 00792 TOK_BAR_MODE = 313, 00793 TOK_BAR_HIDE = 314, 00794 TOK_BAR_DOCK = 315, 00795 TOK_BAR_POSITION = 316, 00796 TOK_BAR_BOTTOM = 317, 00797 TOK_BAR_TOP = 318, 00798 TOK_BAR_STATUS_COMMAND = 319, 00799 TOK_BAR_FONT = 320, 00800 TOK_BAR_WORKSPACE_BUTTONS = 321, 00801 TOK_BAR_VERBOSE = 322, 00802 TOK_BAR_COLORS = 323, 00803 TOK_BAR_COLOR_BACKGROUND = 324, 00804 TOK_BAR_COLOR_STATUSLINE = 325, 00805 TOK_BAR_COLOR_FOCUSED_WORKSPACE = 326, 00806 TOK_BAR_COLOR_ACTIVE_WORKSPACE = 327, 00807 TOK_BAR_COLOR_INACTIVE_WORKSPACE = 328, 00808 TOK_BAR_COLOR_URGENT_WORKSPACE = 329, 00809 TOK_NO_STARTUP_ID = 330, 00810 TOK_MARK = 331, 00811 TOK_CLASS = 332, 00812 TOK_INSTANCE = 333, 00813 TOK_WINDOW_ROLE = 334, 00814 TOK_ID = 335, 00815 TOK_CON_ID = 336, 00816 TOK_TITLE = 337 00817 }; 00818 #endif 00819 00820 00821 00822 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 00823 typedef union YYSTYPE 00824 { 00825 00826 /* Line 293 of yacc.c */ 00827 #line 643 "src/cfgparse.y" 00828 00829 int number; 00830 char *string; 00831 uint32_t *single_color; 00832 struct Colortriple *color; 00833 Match *match; 00834 struct Binding *binding; 00835 00836 00837 00838 /* Line 293 of yacc.c */ 00839 #line 840 "src/cfgparse.tab.c" 00840 } YYSTYPE; 00841 # define YYSTYPE_IS_TRIVIAL 1 00842 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 00843 # define YYSTYPE_IS_DECLARED 1 00844 #endif 00845 00846 00847 /* Copy the second part of user declarations. */ 00848 00849 00850 /* Line 343 of yacc.c */ 00851 #line 852 "src/cfgparse.tab.c" 00852 00853 #ifdef short 00854 # undef short 00855 #endif 00856 00857 #ifdef YYTYPE_UINT8 00858 typedef YYTYPE_UINT8 yytype_uint8; 00859 #else 00860 typedef unsigned char yytype_uint8; 00861 #endif 00862 00863 #ifdef YYTYPE_INT8 00864 typedef YYTYPE_INT8 yytype_int8; 00865 #elif (defined __STDC__ || defined __C99__FUNC__ \ 00866 || defined __cplusplus || defined _MSC_VER) 00867 typedef signed char yytype_int8; 00868 #else 00869 typedef short int yytype_int8; 00870 #endif 00871 00872 #ifdef YYTYPE_UINT16 00873 typedef YYTYPE_UINT16 yytype_uint16; 00874 #else 00875 typedef unsigned short int yytype_uint16; 00876 #endif 00877 00878 #ifdef YYTYPE_INT16 00879 typedef YYTYPE_INT16 yytype_int16; 00880 #else 00881 typedef short int yytype_int16; 00882 #endif 00883 00884 #ifndef YYSIZE_T 00885 # ifdef __SIZE_TYPE__ 00886 # define YYSIZE_T __SIZE_TYPE__ 00887 # elif defined size_t 00888 # define YYSIZE_T size_t 00889 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 00890 || defined __cplusplus || defined _MSC_VER) 00891 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 00892 # define YYSIZE_T size_t 00893 # else 00894 # define YYSIZE_T unsigned int 00895 # endif 00896 #endif 00897 00898 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 00899 00900 #ifndef YY_ 00901 # if defined YYENABLE_NLS && YYENABLE_NLS 00902 # if ENABLE_NLS 00903 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 00904 # define YY_(msgid) dgettext ("bison-runtime", msgid) 00905 # endif 00906 # endif 00907 # ifndef YY_ 00908 # define YY_(msgid) msgid 00909 # endif 00910 #endif 00911 00912 /* Suppress unused-variable warnings by "using" E. */ 00913 #if ! defined lint || defined __GNUC__ 00914 # define YYUSE(e) ((void) (e)) 00915 #else 00916 # define YYUSE(e) /* empty */ 00917 #endif 00918 00919 /* Identity function, used to suppress warnings about constant conditions. */ 00920 #ifndef lint 00921 # define YYID(n) (n) 00922 #else 00923 #if (defined __STDC__ || defined __C99__FUNC__ \ 00924 || defined __cplusplus || defined _MSC_VER) 00925 static int 00926 YYID (int yyi) 00927 #else 00928 static int 00929 YYID (yyi) 00930 int yyi; 00931 #endif 00932 { 00933 return yyi; 00934 } 00935 #endif 00936 00937 #if ! defined yyoverflow || YYERROR_VERBOSE 00938 00939 /* The parser invokes alloca or malloc; define the necessary symbols. */ 00940 00941 # ifdef YYSTACK_USE_ALLOCA 00942 # if YYSTACK_USE_ALLOCA 00943 # ifdef __GNUC__ 00944 # define YYSTACK_ALLOC __builtin_alloca 00945 # elif defined __BUILTIN_VA_ARG_INCR 00946 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 00947 # elif defined _AIX 00948 # define YYSTACK_ALLOC __alloca 00949 # elif defined _MSC_VER 00950 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 00951 # define alloca _alloca 00952 # else 00953 # define YYSTACK_ALLOC alloca 00954 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 00955 || defined __cplusplus || defined _MSC_VER) 00956 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 00957 # ifndef EXIT_SUCCESS 00958 # define EXIT_SUCCESS 0 00959 # endif 00960 # endif 00961 # endif 00962 # endif 00963 # endif 00964 00965 # ifdef YYSTACK_ALLOC 00966 /* Pacify GCC's `empty if-body' warning. */ 00967 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 00968 # ifndef YYSTACK_ALLOC_MAXIMUM 00969 /* The OS might guarantee only one guard page at the bottom of the stack, 00970 and a page size can be as small as 4096 bytes. So we cannot safely 00971 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 00972 to allow for a few compiler-allocated temporary stack slots. */ 00973 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 00974 # endif 00975 # else 00976 # define YYSTACK_ALLOC YYMALLOC 00977 # define YYSTACK_FREE YYFREE 00978 # ifndef YYSTACK_ALLOC_MAXIMUM 00979 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 00980 # endif 00981 # if (defined __cplusplus && ! defined EXIT_SUCCESS \ 00982 && ! ((defined YYMALLOC || defined malloc) \ 00983 && (defined YYFREE || defined free))) 00984 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 00985 # ifndef EXIT_SUCCESS 00986 # define EXIT_SUCCESS 0 00987 # endif 00988 # endif 00989 # ifndef YYMALLOC 00990 # define YYMALLOC malloc 00991 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 00992 || defined __cplusplus || defined _MSC_VER) 00993 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 00994 # endif 00995 # endif 00996 # ifndef YYFREE 00997 # define YYFREE free 00998 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 00999 || defined __cplusplus || defined _MSC_VER) 01000 void free (void *); /* INFRINGES ON USER NAME SPACE */ 01001 # endif 01002 # endif 01003 # endif 01004 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 01005 01006 01007 #if (! defined yyoverflow \ 01008 && (! defined __cplusplus \ 01009 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 01010 01011 /* A type that is properly aligned for any stack member. */ 01012 union yyalloc 01013 { 01014 yytype_int16 yyss_alloc; 01015 YYSTYPE yyvs_alloc; 01016 }; 01017 01018 /* The size of the maximum gap between one aligned stack and the next. */ 01019 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 01020 01021 /* The size of an array large to enough to hold all stacks, each with 01022 N elements. */ 01023 # define YYSTACK_BYTES(N) \ 01024 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 01025 + YYSTACK_GAP_MAXIMUM) 01026 01027 # define YYCOPY_NEEDED 1 01028 01029 /* Relocate STACK from its old location to the new one. The 01030 local variables YYSIZE and YYSTACKSIZE give the old and new number of 01031 elements in the stack, and YYPTR gives the new location of the 01032 stack. Advance YYPTR to a properly aligned location for the next 01033 stack. */ 01034 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 01035 do \ 01036 { \ 01037 YYSIZE_T yynewbytes; \ 01038 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 01039 Stack = &yyptr->Stack_alloc; \ 01040 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 01041 yyptr += yynewbytes / sizeof (*yyptr); \ 01042 } \ 01043 while (YYID (0)) 01044 01045 #endif 01046 01047 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED 01048 /* Copy COUNT objects from FROM to TO. The source and destination do 01049 not overlap. */ 01050 # ifndef YYCOPY 01051 # if defined __GNUC__ && 1 < __GNUC__ 01052 # define YYCOPY(To, From, Count) \ 01053 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 01054 # else 01055 # define YYCOPY(To, From, Count) \ 01056 do \ 01057 { \ 01058 YYSIZE_T yyi; \ 01059 for (yyi = 0; yyi < (Count); yyi++) \ 01060 (To)[yyi] = (From)[yyi]; \ 01061 } \ 01062 while (YYID (0)) 01063 # endif 01064 # endif 01065 #endif /* !YYCOPY_NEEDED */ 01066 01067 /* YYFINAL -- State number of the termination state. */ 01068 #define YYFINAL 2 01069 /* YYLAST -- Last index in YYTABLE. */ 01070 #define YYLAST 190 01071 01072 /* YYNTOKENS -- Number of terminals. */ 01073 #define YYNTOKENS 89 01074 /* YYNNTS -- Number of nonterminals. */ 01075 #define YYNNTS 74 01076 /* YYNRULES -- Number of rules. */ 01077 #define YYNRULES 154 01078 /* YYNRULES -- Number of states. */ 01079 #define YYNSTATES 234 01080 01081 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 01082 #define YYUNDEFTOK 2 01083 #define YYMAXUTOK 337 01084 01085 #define YYTRANSLATE(YYX) \ 01086 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 01087 01088 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 01089 static const yytype_uint8 yytranslate[] = 01090 { 01091 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01092 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01093 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01094 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01095 2, 2, 2, 88, 2, 2, 2, 2, 2, 2, 01096 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01097 2, 85, 2, 2, 2, 2, 2, 2, 2, 2, 01098 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01099 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01100 2, 83, 2, 84, 2, 2, 2, 2, 2, 2, 01101 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01102 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01103 2, 2, 2, 86, 2, 87, 2, 2, 2, 2, 01104 2, 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, 2, 2, 2, 2, 2, 2, 2, 01109 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01110 2, 2, 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, 2, 2, 2, 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, 2, 2, 2, 1, 2, 3, 4, 01117 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 01118 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 01119 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 01120 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 01121 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 01122 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 01123 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 01124 75, 76, 77, 78, 79, 80, 81, 82 01125 }; 01126 01127 #if YYDEBUG 01128 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 01129 YYRHS. */ 01130 static const yytype_uint16 yyprhs[] = 01131 { 01132 0, 0, 3, 4, 7, 10, 12, 14, 16, 18, 01133 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 01134 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 01135 60, 62, 64, 66, 68, 71, 74, 78, 82, 86, 01136 87, 91, 93, 95, 98, 100, 104, 108, 112, 116, 01137 120, 124, 128, 130, 132, 134, 136, 142, 143, 146, 01138 148, 150, 155, 156, 159, 161, 163, 165, 167, 169, 01139 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 01140 191, 193, 196, 199, 202, 205, 207, 209, 212, 214, 01141 216, 219, 222, 225, 228, 233, 236, 239, 243, 247, 01142 251, 255, 258, 261, 263, 265, 267, 270, 275, 277, 01143 279, 281, 284, 287, 289, 291, 293, 295, 297, 300, 01144 303, 306, 309, 312, 318, 322, 323, 325, 327, 329, 01145 331, 335, 339, 341, 343, 346, 349, 353, 357, 358, 01146 360, 363, 366, 369, 374, 376, 377, 379, 383, 386, 01147 388, 390, 392, 395, 397 01148 }; 01149 01150 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 01151 static const yytype_int16 yyrhs[] = 01152 { 01153 90, 0, -1, -1, 90, 1, -1, 90, 91, -1, 01154 94, -1, 98, -1, 106, -1, 109, -1, 130, -1, 01155 131, -1, 133, -1, 135, -1, 136, -1, 139, -1, 01156 140, -1, 141, -1, 142, -1, 143, -1, 144, -1, 01157 147, -1, 149, -1, 150, -1, 151, -1, 152, -1, 01158 156, -1, 157, -1, 154, -1, 155, -1, 92, -1, 01159 161, -1, 11, -1, 5, -1, 95, -1, 9, 96, 01160 -1, 13, 97, -1, 159, 3, 93, -1, 159, 105, 01161 93, -1, 54, 99, 93, -1, -1, 100, 102, 101, 01162 -1, 83, -1, 84, -1, 102, 103, -1, 103, -1, 01163 77, 85, 5, -1, 78, 85, 5, -1, 79, 85, 01164 5, -1, 81, 85, 5, -1, 80, 85, 5, -1, 01165 76, 85, 5, -1, 82, 85, 5, -1, 18, -1, 01166 3, -1, 4, -1, 3, -1, 30, 18, 86, 107, 01167 87, -1, -1, 107, 108, -1, 92, -1, 95, -1, 01168 31, 86, 110, 87, -1, -1, 110, 111, -1, 92, 01169 -1, 112, -1, 113, -1, 114, -1, 115, -1, 117, 01170 -1, 119, -1, 120, -1, 121, -1, 122, -1, 123, 01171 -1, 124, -1, 125, -1, 126, -1, 127, -1, 128, 01172 -1, 129, -1, 64, 5, -1, 55, 5, -1, 56, 01173 5, -1, 61, 116, -1, 63, -1, 62, -1, 58, 01174 118, -1, 59, -1, 60, -1, 65, 5, -1, 66, 01175 138, -1, 67, 138, -1, 57, 5, -1, 68, 86, 01176 110, 87, -1, 69, 7, -1, 70, 7, -1, 71, 01177 7, 7, -1, 72, 7, 7, -1, 73, 7, 7, 01178 -1, 74, 7, 7, -1, 17, 159, -1, 32, 132, 01179 -1, 33, -1, 34, -1, 35, -1, 36, 134, -1, 01180 36, 50, 50, 3, -1, 47, -1, 48, -1, 49, 01181 -1, 37, 137, -1, 38, 137, -1, 39, -1, 40, 01182 -1, 41, -1, 3, -1, 4, -1, 42, 138, -1, 01183 43, 138, -1, 44, 138, -1, 45, 138, -1, 46, 01184 138, -1, 19, 104, 20, 8, 145, -1, 19, 3, 01185 146, -1, -1, 146, -1, 18, -1, 5, -1, 4, 01186 -1, 21, 148, 5, -1, 21, 99, 5, -1, 18, 01187 -1, 6, -1, 23, 5, -1, 24, 5, -1, 25, 01188 153, 5, -1, 26, 153, 5, -1, -1, 75, -1, 01189 10, 5, -1, 12, 5, -1, 27, 158, -1, 28, 01190 158, 158, 158, -1, 7, -1, -1, 160, -1, 159, 01191 88, 160, -1, 159, 88, -1, 14, -1, 15, -1, 01192 16, -1, 51, 162, -1, 52, -1, 53, -1 01193 }; 01194 01195 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 01196 static const yytype_uint16 yyrline[] = 01197 { 01198 0, 760, 760, 761, 762, 766, 767, 768, 769, 770, 01199 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 01200 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 01201 791, 795, 799, 803, 810, 811, 815, 829, 843, 858, 01202 859, 866, 874, 881, 882, 886, 892, 898, 904, 919, 01203 934, 940, 949, 950, 954, 955, 962, 985, 987, 991, 01204 992, 1004, 1031, 1033, 1037, 1038, 1039, 1040, 1041, 1042, 01205 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 01206 1053, 1057, 1066, 1077, 1086, 1094, 1095, 1099, 1107, 1108, 01207 1112, 1121, 1131, 1139, 1148, 1157, 1165, 1173, 1182, 1191, 01208 1200, 1209, 1217, 1225, 1226, 1227, 1231, 1255, 1276, 1277, 01209 1278, 1282, 1290, 1298, 1299, 1300, 1304, 1308, 1320, 1328, 01210 1336, 1344, 1352, 1360, 1394, 1412, 1413, 1417, 1418, 1419, 01211 1423, 1485, 1501, 1502, 1506, 1513, 1520, 1530, 1540, 1541, 01212 1545, 1553, 1563, 1571, 1582, 1591, 1592, 1593, 1594, 1598, 01213 1599, 1600, 1604, 1612, 1613 01214 }; 01215 #endif 01216 01217 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 01218 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 01219 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 01220 static const char *const yytname[] = 01221 { 01222 "$end", "error", "$undefined", "\"<number>\"", "\"<word>\"", 01223 "\"<string>\"", "\"<string (non-greedy)>\"", "\"#<hex>\"", 01224 "\"<RandR output>\"", "TOKBINDCODE", "TOKTERMINAL", "\"<comment>\"", 01225 "\"font\"", "\"bindsym\"", "\"<modifier>\"", "\"control\"", "\"shift\"", 01226 "\"floating_modifier\"", "\"<quoted string>\"", "\"workspace\"", 01227 "\"output\"", "\"assign\"", "TOKSET", "\"ipc_socket\"", 01228 "\"restart_state\"", "\"exec\"", "\"exec_always\"", "TOKSINGLECOLOR", 01229 "TOKCOLOR", "\"\\342\\206\\222\"", "\"mode\"", "\"bar\"", 01230 "\"default_orientation\"", "\"horizontal\"", "\"vertical\"", "\"auto\"", 01231 "\"workspace_layout\"", "\"new_window\"", "\"new_float\"", "\"normal\"", 01232 "\"none\"", "\"1pixel\"", "\"focus_follows_mouse\"", 01233 "\"force_focus_wrapping\"", "\"force_xinerama\"", 01234 "\"workspace_auto_back_and_forth\"", "\"workspace_bar\"", "\"default\"", 01235 "\"stacking\"", "\"tabbed\"", "\"stack-limit\"", 01236 "\"popup_during_fullscreen\"", "\"ignore\"", "\"leave_fullscreen\"", 01237 "\"for_window\"", "\"output (bar)\"", "\"tray_output\"", 01238 "\"socket_path\"", "\"mode (bar)\"", "\"hide\"", "\"dock\"", 01239 "\"position\"", "\"bottom\"", "\"top\"", "\"status_command\"", 01240 "\"font (bar)\"", "\"workspace_buttons\"", "\"verbose\"", "\"colors\"", 01241 "\"background\"", "\"statusline\"", "\"focused_workspace\"", 01242 "\"active_workspace\"", "\"inactive_workspace\"", "\"urgent_workspace\"", 01243 "\"--no-startup-id\"", "\"mark\"", "\"class\"", "\"instance\"", 01244 "\"window_role\"", "\"id\"", "\"con_id\"", "\"title\"", "'['", "']'", 01245 "'='", "'{'", "'}'", "'+'", "$accept", "lines", "line", "comment", 01246 "command", "bindline", "binding", "bindcode", "bindsym", "for_window", 01247 "match", "matchstart", "matchend", "criteria", "criterion", 01248 "qstring_or_number", "word_or_number", "mode", "modelines", "modeline", 01249 "bar", "barlines", "barline", "bar_status_command", "bar_output", 01250 "bar_tray_output", "bar_position", "bar_position_position", "bar_mode", 01251 "bar_mode_mode", "bar_font", "bar_workspace_buttons", "bar_verbose", 01252 "bar_socket_path", "bar_colors", "bar_color_background", 01253 "bar_color_statusline", "bar_color_focused_workspace", 01254 "bar_color_active_workspace", "bar_color_inactive_workspace", 01255 "bar_color_urgent_workspace", "floating_modifier", "orientation", 01256 "direction", "workspace_layout", "layout_mode", "new_window", 01257 "new_float", "border_style", "bool", "focus_follows_mouse", 01258 "force_focus_wrapping", "force_xinerama", "workspace_back_and_forth", 01259 "workspace_bar", "workspace", "optional_workspace_name", 01260 "workspace_name", "assign", "window_class", "ipcsocket", "restart_state", 01261 "exec", "exec_always", "optional_no_startup_id", "terminal", "font", 01262 "single_color", "color", "colorpixel", "binding_modifiers", 01263 "binding_modifier", "popup_during_fullscreen", "popup_setting", 0 01264 }; 01265 #endif 01266 01267 # ifdef YYPRINT 01268 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 01269 token YYLEX-NUM. */ 01270 static const yytype_uint16 yytoknum[] = 01271 { 01272 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 01273 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 01274 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 01275 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 01276 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 01277 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 01278 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 01279 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 01280 335, 336, 337, 91, 93, 61, 123, 125, 43 01281 }; 01282 # endif 01283 01284 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 01285 static const yytype_uint8 yyr1[] = 01286 { 01287 0, 89, 90, 90, 90, 91, 91, 91, 91, 91, 01288 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 01289 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 01290 91, 92, 93, 94, 95, 95, 96, 97, 98, 99, 01291 99, 100, 101, 102, 102, 103, 103, 103, 103, 103, 01292 103, 103, 104, 104, 105, 105, 106, 107, 107, 108, 01293 108, 109, 110, 110, 111, 111, 111, 111, 111, 111, 01294 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 01295 111, 112, 113, 114, 115, 116, 116, 117, 118, 118, 01296 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 01297 129, 130, 131, 132, 132, 132, 133, 133, 134, 134, 01298 134, 135, 136, 137, 137, 137, 138, 138, 139, 140, 01299 141, 142, 143, 144, 144, 145, 145, 146, 146, 146, 01300 147, 147, 148, 148, 149, 150, 151, 152, 153, 153, 01301 154, 155, 156, 157, 158, 159, 159, 159, 159, 160, 01302 160, 160, 161, 162, 162 01303 }; 01304 01305 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 01306 static const yytype_uint8 yyr2[] = 01307 { 01308 0, 2, 0, 2, 2, 1, 1, 1, 1, 1, 01309 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 01310 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 01311 1, 1, 1, 1, 2, 2, 3, 3, 3, 0, 01312 3, 1, 1, 2, 1, 3, 3, 3, 3, 3, 01313 3, 3, 1, 1, 1, 1, 5, 0, 2, 1, 01314 1, 4, 0, 2, 1, 1, 1, 1, 1, 1, 01315 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 01316 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 01317 2, 2, 2, 2, 4, 2, 2, 3, 3, 3, 01318 3, 2, 2, 1, 1, 1, 2, 4, 1, 1, 01319 1, 2, 2, 1, 1, 1, 1, 1, 2, 2, 01320 2, 2, 2, 5, 3, 0, 1, 1, 1, 1, 01321 3, 3, 1, 1, 2, 2, 3, 3, 0, 1, 01322 2, 2, 2, 4, 1, 0, 1, 3, 2, 1, 01323 1, 1, 2, 1, 1 01324 }; 01325 01326 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. 01327 Performed when YYTABLE doesn't specify something else to do. Zero 01328 means the default is an error. */ 01329 static const yytype_uint8 yydefact[] = 01330 { 01331 2, 0, 1, 3, 145, 0, 31, 0, 145, 145, 01332 0, 39, 0, 0, 138, 138, 0, 0, 0, 0, 01333 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 01334 39, 4, 29, 5, 33, 6, 7, 8, 9, 10, 01335 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 01336 21, 22, 23, 24, 27, 28, 25, 26, 30, 149, 01337 150, 151, 34, 0, 146, 140, 141, 35, 0, 101, 01338 53, 52, 0, 133, 132, 41, 0, 0, 0, 134, 01339 135, 139, 0, 0, 144, 142, 0, 0, 62, 103, 01340 104, 105, 102, 108, 109, 110, 0, 106, 113, 114, 01341 115, 111, 112, 116, 117, 118, 119, 120, 121, 122, 01342 153, 154, 152, 0, 0, 148, 55, 54, 0, 129, 01343 128, 127, 124, 0, 131, 0, 0, 0, 0, 0, 01344 0, 0, 0, 44, 130, 136, 137, 0, 57, 0, 01345 0, 32, 38, 36, 147, 37, 125, 0, 0, 0, 01346 0, 0, 0, 0, 42, 40, 43, 143, 0, 0, 01347 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 01348 0, 0, 0, 0, 0, 61, 64, 63, 65, 66, 01349 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 01350 77, 78, 79, 80, 107, 123, 126, 50, 45, 46, 01351 47, 49, 48, 51, 56, 59, 60, 58, 82, 83, 01352 93, 88, 89, 87, 86, 85, 84, 81, 90, 91, 01353 92, 62, 95, 96, 0, 0, 0, 0, 0, 97, 01354 98, 99, 100, 94 01355 }; 01356 01357 /* YYDEFGOTO[NTERM-NUM]. */ 01358 static const yytype_int16 yydefgoto[] = 01359 { 01360 -1, 1, 31, 176, 142, 33, 34, 62, 67, 35, 01361 76, 77, 155, 132, 133, 72, 118, 36, 158, 207, 01362 37, 139, 177, 178, 179, 180, 181, 216, 182, 213, 01363 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 01364 193, 38, 39, 92, 40, 97, 41, 42, 101, 105, 01365 43, 44, 45, 46, 47, 48, 195, 122, 49, 78, 01366 50, 51, 52, 53, 82, 54, 55, 56, 57, 85, 01367 63, 64, 58, 112 01368 }; 01369 01370 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 01371 STATE-NUM. */ 01372 #define YYPACT_NINF -99 01373 static const yytype_int16 yypact[] = 01374 { 01375 -99, 128, -99, -99, 37, 16, -99, 18, 37, 37, 01376 7, 6, 31, 44, -13, -13, 52, 52, 47, 2, 01377 -16, -2, 15, 15, 23, 23, 23, 23, 23, 8, 01378 -10, -99, -99, -99, -99, -99, -99, -99, -99, -99, 01379 -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, 01380 -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, 01381 -99, -99, -99, 5, -99, -99, -99, -99, 3, 13, 01382 10, -99, 66, -99, -99, -99, 85, -38, 87, -99, 01383 -99, -99, 94, 97, -99, -99, 52, 28, -99, -99, 01384 -99, -99, -99, -99, -99, -99, 65, -99, -99, -99, 01385 -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, 01386 -99, -99, -99, 111, 111, 37, -99, -99, 111, -99, 01387 -99, -99, -99, 109, -99, 33, 34, 35, 36, 38, 01388 42, 45, -47, -99, -99, -99, -99, 52, -99, 11, 01389 119, -99, -99, -99, -99, -99, 10, 126, 127, 129, 01390 130, 131, 139, 141, -99, -99, -99, -99, 0, 143, 01391 145, 156, 4, -5, 157, 158, 23, 23, 81, 117, 01392 161, 162, 168, 169, 170, -99, -99, -99, -99, -99, 01393 -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, 01394 -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, 01395 -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, 01396 -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, 01397 -99, -99, -99, -99, 171, 173, 174, 176, 39, -99, 01398 -99, -99, -99, -99 01399 }; 01400 01401 /* YYPGOTO[NTERM-NUM]. */ 01402 static const yytype_int16 yypgoto[] = 01403 { 01404 -99, -99, -99, -1, -98, -99, -25, -99, -99, -99, 01405 154, -99, -99, -99, 53, -99, -99, -99, -99, -99, 01406 -99, -35, -99, -99, -99, -99, -99, -99, -99, -99, 01407 -99, -99, -99, -99, -99, -99, -99, -99, -99, -99, 01408 -99, -99, -99, -99, -99, -99, -99, -99, 164, -24, 01409 -99, -99, -99, -99, -99, -99, -99, 43, -99, -99, 01410 -99, -99, -99, -99, 175, -99, -99, -99, -99, -12, 01411 62, 73, -99, -99 01412 }; 01413 01414 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 01415 positive, shift that token. If negative, reduce the rule which 01416 number is the opposite. If YYTABLE_NINF, syntax error. */ 01417 #define YYTABLE_NINF -1 01418 static const yytype_uint8 yytable[] = 01419 { 01420 32, 106, 107, 108, 109, 86, 116, 117, 114, 4, 01421 70, 6, 73, 8, 119, 120, 143, 89, 90, 91, 01422 145, 65, 6, 66, 74, 71, 103, 104, 121, 125, 01423 126, 127, 128, 129, 130, 131, 79, 154, 125, 126, 01424 127, 128, 129, 130, 131, 93, 94, 95, 96, 80, 01425 6, 59, 60, 61, 98, 99, 100, 214, 215, 84, 01426 110, 111, 81, 211, 212, 87, 159, 160, 161, 162, 01427 68, 69, 163, 75, 137, 164, 165, 166, 167, 168, 01428 169, 170, 171, 172, 173, 174, 123, 204, 88, 75, 01429 124, 115, 134, 115, 159, 160, 161, 162, 175, 135, 01430 163, 115, 136, 164, 165, 166, 167, 168, 169, 170, 01431 171, 172, 173, 174, 138, 140, 141, 146, 147, 148, 01432 149, 150, 194, 151, 222, 157, 233, 152, 2, 3, 01433 153, 197, 198, 206, 199, 200, 201, 4, 5, 6, 01434 7, 8, 219, 220, 202, 9, 203, 10, 208, 11, 01435 209, 12, 13, 14, 15, 16, 17, 205, 18, 19, 01436 20, 210, 217, 218, 21, 22, 23, 221, 223, 224, 01437 24, 25, 26, 27, 28, 225, 226, 227, 229, 29, 01438 230, 231, 30, 232, 113, 156, 228, 102, 144, 196, 01439 83 01440 }; 01441 01442 #define yypact_value_is_default(yystate) \ 01443 ((yystate) == (-99)) 01444 01445 #define yytable_value_is_error(yytable_value) \ 01446 YYID (0) 01447 01448 static const yytype_uint8 yycheck[] = 01449 { 01450 1, 25, 26, 27, 28, 17, 3, 4, 3, 9, 01451 3, 11, 6, 13, 4, 5, 114, 33, 34, 35, 01452 118, 5, 11, 5, 18, 18, 3, 4, 18, 76, 01453 77, 78, 79, 80, 81, 82, 5, 84, 76, 77, 01454 78, 79, 80, 81, 82, 47, 48, 49, 50, 5, 01455 11, 14, 15, 16, 39, 40, 41, 62, 63, 7, 01456 52, 53, 75, 59, 60, 18, 55, 56, 57, 58, 01457 8, 9, 61, 83, 86, 64, 65, 66, 67, 68, 01458 69, 70, 71, 72, 73, 74, 20, 87, 86, 83, 01459 5, 88, 5, 88, 55, 56, 57, 58, 87, 5, 01460 61, 88, 5, 64, 65, 66, 67, 68, 69, 70, 01461 71, 72, 73, 74, 86, 50, 5, 8, 85, 85, 01462 85, 85, 3, 85, 7, 137, 87, 85, 0, 1, 01463 85, 5, 5, 158, 5, 5, 5, 9, 10, 11, 01464 12, 13, 166, 167, 5, 17, 5, 19, 5, 21, 01465 5, 23, 24, 25, 26, 27, 28, 158, 30, 31, 01466 32, 5, 5, 5, 36, 37, 38, 86, 7, 7, 01467 42, 43, 44, 45, 46, 7, 7, 7, 7, 51, 01468 7, 7, 54, 7, 30, 132, 221, 23, 115, 146, 01469 15 01470 }; 01471 01472 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 01473 symbol of state STATE-NUM. */ 01474 static const yytype_uint8 yystos[] = 01475 { 01476 0, 90, 0, 1, 9, 10, 11, 12, 13, 17, 01477 19, 21, 23, 24, 25, 26, 27, 28, 30, 31, 01478 32, 36, 37, 38, 42, 43, 44, 45, 46, 51, 01479 54, 91, 92, 94, 95, 98, 106, 109, 130, 131, 01480 133, 135, 136, 139, 140, 141, 142, 143, 144, 147, 01481 149, 150, 151, 152, 154, 155, 156, 157, 161, 14, 01482 15, 16, 96, 159, 160, 5, 5, 97, 159, 159, 01483 3, 18, 104, 6, 18, 83, 99, 100, 148, 5, 01484 5, 75, 153, 153, 7, 158, 158, 18, 86, 33, 01485 34, 35, 132, 47, 48, 49, 50, 134, 39, 40, 01486 41, 137, 137, 3, 4, 138, 138, 138, 138, 138, 01487 52, 53, 162, 99, 3, 88, 3, 4, 105, 4, 01488 5, 18, 146, 20, 5, 76, 77, 78, 79, 80, 01489 81, 82, 102, 103, 5, 5, 5, 158, 86, 110, 01490 50, 5, 93, 93, 160, 93, 8, 85, 85, 85, 01491 85, 85, 85, 85, 84, 101, 103, 158, 107, 55, 01492 56, 57, 58, 61, 64, 65, 66, 67, 68, 69, 01493 70, 71, 72, 73, 74, 87, 92, 111, 112, 113, 01494 114, 115, 117, 119, 120, 121, 122, 123, 124, 125, 01495 126, 127, 128, 129, 3, 145, 146, 5, 5, 5, 01496 5, 5, 5, 5, 87, 92, 95, 108, 5, 5, 01497 5, 59, 60, 118, 62, 63, 116, 5, 5, 138, 01498 138, 86, 7, 7, 7, 7, 7, 7, 110, 7, 01499 7, 7, 7, 87 01500 }; 01501 01502 #define yyerrok (yyerrstatus = 0) 01503 #define yyclearin (yychar = YYEMPTY) 01504 #define YYEMPTY (-2) 01505 #define YYEOF 0 01506 01507 #define YYACCEPT goto yyacceptlab 01508 #define YYABORT goto yyabortlab 01509 #define YYERROR goto yyerrorlab 01510 01511 01512 /* Like YYERROR except do call yyerror. This remains here temporarily 01513 to ease the transition to the new meaning of YYERROR, for GCC. 01514 Once GCC version 2 has supplanted version 1, this can go. However, 01515 YYFAIL appears to be in use. Nevertheless, it is formally deprecated 01516 in Bison 2.4.2's NEWS entry, where a plan to phase it out is 01517 discussed. */ 01518 01519 #define YYFAIL goto yyerrlab 01520 #if defined YYFAIL 01521 /* This is here to suppress warnings from the GCC cpp's 01522 -Wunused-macros. Normally we don't worry about that warning, but 01523 some users do, and we want to make it easy for users to remove 01524 YYFAIL uses, which will produce warnings from Bison 2.5. */ 01525 #endif 01526 01527 #define YYRECOVERING() (!!yyerrstatus) 01528 01529 #define YYBACKUP(Token, Value) \ 01530 do \ 01531 if (yychar == YYEMPTY && yylen == 1) \ 01532 { \ 01533 yychar = (Token); \ 01534 yylval = (Value); \ 01535 YYPOPSTACK (1); \ 01536 goto yybackup; \ 01537 } \ 01538 else \ 01539 { \ 01540 yyerror (YY_("syntax error: cannot back up")); \ 01541 YYERROR; \ 01542 } \ 01543 while (YYID (0)) 01544 01545 01546 #define YYTERROR 1 01547 #define YYERRCODE 256 01548 01549 01550 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 01551 If N is 0, then set CURRENT to the empty location which ends 01552 the previous symbol: RHS[0] (always defined). */ 01553 01554 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 01555 #ifndef YYLLOC_DEFAULT 01556 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 01557 do \ 01558 if (YYID (N)) \ 01559 { \ 01560 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 01561 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 01562 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 01563 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 01564 } \ 01565 else \ 01566 { \ 01567 (Current).first_line = (Current).last_line = \ 01568 YYRHSLOC (Rhs, 0).last_line; \ 01569 (Current).first_column = (Current).last_column = \ 01570 YYRHSLOC (Rhs, 0).last_column; \ 01571 } \ 01572 while (YYID (0)) 01573 #endif 01574 01575 01576 /* This macro is provided for backward compatibility. */ 01577 01578 #ifndef YY_LOCATION_PRINT 01579 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 01580 #endif 01581 01582 01583 /* YYLEX -- calling `yylex' with the right arguments. */ 01584 01585 #ifdef YYLEX_PARAM 01586 # define YYLEX yylex (YYLEX_PARAM) 01587 #else 01588 # define YYLEX yylex (context) 01589 #endif 01590 01591 /* Enable debugging if requested. */ 01592 #if YYDEBUG 01593 01594 # ifndef YYFPRINTF 01595 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 01596 # define YYFPRINTF fprintf 01597 # endif 01598 01599 # define YYDPRINTF(Args) \ 01600 do { \ 01601 if (yydebug) \ 01602 YYFPRINTF Args; \ 01603 } while (YYID (0)) 01604 01605 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 01606 do { \ 01607 if (yydebug) \ 01608 { \ 01609 YYFPRINTF (stderr, "%s ", Title); \ 01610 yy_symbol_print (stderr, \ 01611 Type, Value); \ 01612 YYFPRINTF (stderr, "\n"); \ 01613 } \ 01614 } while (YYID (0)) 01615 01616 01617 /*--------------------------------. 01618 | Print this symbol on YYOUTPUT. | 01619 `--------------------------------*/ 01620 01621 /*ARGSUSED*/ 01622 #if (defined __STDC__ || defined __C99__FUNC__ \ 01623 || defined __cplusplus || defined _MSC_VER) 01624 static void 01625 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 01626 #else 01627 static void 01628 yy_symbol_value_print (yyoutput, yytype, yyvaluep) 01629 FILE *yyoutput; 01630 int yytype; 01631 YYSTYPE const * const yyvaluep; 01632 #endif 01633 { 01634 if (!yyvaluep) 01635 return; 01636 # ifdef YYPRINT 01637 if (yytype < YYNTOKENS) 01638 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 01639 # else 01640 YYUSE (yyoutput); 01641 # endif 01642 switch (yytype) 01643 { 01644 default: 01645 break; 01646 } 01647 } 01648 01649 01650 /*--------------------------------. 01651 | Print this symbol on YYOUTPUT. | 01652 `--------------------------------*/ 01653 01654 #if (defined __STDC__ || defined __C99__FUNC__ \ 01655 || defined __cplusplus || defined _MSC_VER) 01656 static void 01657 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 01658 #else 01659 static void 01660 yy_symbol_print (yyoutput, yytype, yyvaluep) 01661 FILE *yyoutput; 01662 int yytype; 01663 YYSTYPE const * const yyvaluep; 01664 #endif 01665 { 01666 if (yytype < YYNTOKENS) 01667 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 01668 else 01669 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 01670 01671 yy_symbol_value_print (yyoutput, yytype, yyvaluep); 01672 YYFPRINTF (yyoutput, ")"); 01673 } 01674 01675 /*------------------------------------------------------------------. 01676 | yy_stack_print -- Print the state stack from its BOTTOM up to its | 01677 | TOP (included). | 01678 `------------------------------------------------------------------*/ 01679 01680 #if (defined __STDC__ || defined __C99__FUNC__ \ 01681 || defined __cplusplus || defined _MSC_VER) 01682 static void 01683 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 01684 #else 01685 static void 01686 yy_stack_print (yybottom, yytop) 01687 yytype_int16 *yybottom; 01688 yytype_int16 *yytop; 01689 #endif 01690 { 01691 YYFPRINTF (stderr, "Stack now"); 01692 for (; yybottom <= yytop; yybottom++) 01693 { 01694 int yybot = *yybottom; 01695 YYFPRINTF (stderr, " %d", yybot); 01696 } 01697 YYFPRINTF (stderr, "\n"); 01698 } 01699 01700 # define YY_STACK_PRINT(Bottom, Top) \ 01701 do { \ 01702 if (yydebug) \ 01703 yy_stack_print ((Bottom), (Top)); \ 01704 } while (YYID (0)) 01705 01706 01707 /*------------------------------------------------. 01708 | Report that the YYRULE is going to be reduced. | 01709 `------------------------------------------------*/ 01710 01711 #if (defined __STDC__ || defined __C99__FUNC__ \ 01712 || defined __cplusplus || defined _MSC_VER) 01713 static void 01714 yy_reduce_print (YYSTYPE *yyvsp, int yyrule) 01715 #else 01716 static void 01717 yy_reduce_print (yyvsp, yyrule) 01718 YYSTYPE *yyvsp; 01719 int yyrule; 01720 #endif 01721 { 01722 int yynrhs = yyr2[yyrule]; 01723 int yyi; 01724 unsigned long int yylno = yyrline[yyrule]; 01725 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 01726 yyrule - 1, yylno); 01727 /* The symbols being reduced. */ 01728 for (yyi = 0; yyi < yynrhs; yyi++) 01729 { 01730 YYFPRINTF (stderr, " $%d = ", yyi + 1); 01731 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 01732 &(yyvsp[(yyi + 1) - (yynrhs)]) 01733 ); 01734 YYFPRINTF (stderr, "\n"); 01735 } 01736 } 01737 01738 # define YY_REDUCE_PRINT(Rule) \ 01739 do { \ 01740 if (yydebug) \ 01741 yy_reduce_print (yyvsp, Rule); \ 01742 } while (YYID (0)) 01743 01744 /* Nonzero means print parse trace. It is left uninitialized so that 01745 multiple parsers can coexist. */ 01746 int yydebug; 01747 #else /* !YYDEBUG */ 01748 # define YYDPRINTF(Args) 01749 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 01750 # define YY_STACK_PRINT(Bottom, Top) 01751 # define YY_REDUCE_PRINT(Rule) 01752 #endif /* !YYDEBUG */ 01753 01754 01755 /* YYINITDEPTH -- initial size of the parser's stacks. */ 01756 #ifndef YYINITDEPTH 01757 # define YYINITDEPTH 200 01758 #endif 01759 01760 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 01761 if the built-in stack extension method is used). 01762 01763 Do not make this value too large; the results are undefined if 01764 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 01765 evaluated with infinite-precision integer arithmetic. */ 01766 01767 #ifndef YYMAXDEPTH 01768 # define YYMAXDEPTH 10000 01769 #endif 01770 01771 01772 #if YYERROR_VERBOSE 01773 01774 # ifndef yystrlen 01775 # if defined __GLIBC__ && defined _STRING_H 01776 # define yystrlen strlen 01777 # else 01778 /* Return the length of YYSTR. */ 01779 #if (defined __STDC__ || defined __C99__FUNC__ \ 01780 || defined __cplusplus || defined _MSC_VER) 01781 static YYSIZE_T 01782 yystrlen (const char *yystr) 01783 #else 01784 static YYSIZE_T 01785 yystrlen (yystr) 01786 const char *yystr; 01787 #endif 01788 { 01789 YYSIZE_T yylen; 01790 for (yylen = 0; yystr[yylen]; yylen++) 01791 continue; 01792 return yylen; 01793 } 01794 # endif 01795 # endif 01796 01797 # ifndef yystpcpy 01798 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 01799 # define yystpcpy stpcpy 01800 # else 01801 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 01802 YYDEST. */ 01803 #if (defined __STDC__ || defined __C99__FUNC__ \ 01804 || defined __cplusplus || defined _MSC_VER) 01805 static char * 01806 yystpcpy (char *yydest, const char *yysrc) 01807 #else 01808 static char * 01809 yystpcpy (yydest, yysrc) 01810 char *yydest; 01811 const char *yysrc; 01812 #endif 01813 { 01814 char *yyd = yydest; 01815 const char *yys = yysrc; 01816 01817 while ((*yyd++ = *yys++) != '\0') 01818 continue; 01819 01820 return yyd - 1; 01821 } 01822 # endif 01823 # endif 01824 01825 # ifndef yytnamerr 01826 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary 01827 quotes and backslashes, so that it's suitable for yyerror. The 01828 heuristic is that double-quoting is unnecessary unless the string 01829 contains an apostrophe, a comma, or backslash (other than 01830 backslash-backslash). YYSTR is taken from yytname. If YYRES is 01831 null, do not copy; instead, return the length of what the result 01832 would have been. */ 01833 static YYSIZE_T 01834 yytnamerr (char *yyres, const char *yystr) 01835 { 01836 if (*yystr == '"') 01837 { 01838 YYSIZE_T yyn = 0; 01839 char const *yyp = yystr; 01840 01841 for (;;) 01842 switch (*++yyp) 01843 { 01844 case '\'': 01845 case ',': 01846 goto do_not_strip_quotes; 01847 01848 case '\\': 01849 if (*++yyp != '\\') 01850 goto do_not_strip_quotes; 01851 /* Fall through. */ 01852 default: 01853 if (yyres) 01854 yyres[yyn] = *yyp; 01855 yyn++; 01856 break; 01857 01858 case '"': 01859 if (yyres) 01860 yyres[yyn] = '\0'; 01861 return yyn; 01862 } 01863 do_not_strip_quotes: ; 01864 } 01865 01866 if (! yyres) 01867 return yystrlen (yystr); 01868 01869 return yystpcpy (yyres, yystr) - yyres; 01870 } 01871 # endif 01872 01873 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message 01874 about the unexpected token YYTOKEN for the state stack whose top is 01875 YYSSP. 01876 01877 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is 01878 not large enough to hold the message. In that case, also set 01879 *YYMSG_ALLOC to the required number of bytes. Return 2 if the 01880 required number of bytes is too large to store. */ 01881 static int 01882 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 01883 yytype_int16 *yyssp, int yytoken) 01884 { 01885 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); 01886 YYSIZE_T yysize = yysize0; 01887 YYSIZE_T yysize1; 01888 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 01889 /* Internationalized format string. */ 01890 const char *yyformat = 0; 01891 /* Arguments of yyformat. */ 01892 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 01893 /* Number of reported tokens (one for the "unexpected", one per 01894 "expected"). */ 01895 int yycount = 0; 01896 01897 /* There are many possibilities here to consider: 01898 - Assume YYFAIL is not used. It's too flawed to consider. See 01899 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> 01900 for details. YYERROR is fine as it does not invoke this 01901 function. 01902 - If this state is a consistent state with a default action, then 01903 the only way this function was invoked is if the default action 01904 is an error action. In that case, don't check for expected 01905 tokens because there are none. 01906 - The only way there can be no lookahead present (in yychar) is if 01907 this state is a consistent state with a default action. Thus, 01908 detecting the absence of a lookahead is sufficient to determine 01909 that there is no unexpected or expected token to report. In that 01910 case, just report a simple "syntax error". 01911 - Don't assume there isn't a lookahead just because this state is a 01912 consistent state with a default action. There might have been a 01913 previous inconsistent state, consistent state with a non-default 01914 action, or user semantic action that manipulated yychar. 01915 - Of course, the expected token list depends on states to have 01916 correct lookahead information, and it depends on the parser not 01917 to perform extra reductions after fetching a lookahead from the 01918 scanner and before detecting a syntax error. Thus, state merging 01919 (from LALR or IELR) and default reductions corrupt the expected 01920 token list. However, the list is correct for canonical LR with 01921 one exception: it will still contain any token that will not be 01922 accepted due to an error action in a later state. 01923 */ 01924 if (yytoken != YYEMPTY) 01925 { 01926 int yyn = yypact[*yyssp]; 01927 yyarg[yycount++] = yytname[yytoken]; 01928 if (!yypact_value_is_default (yyn)) 01929 { 01930 /* Start YYX at -YYN if negative to avoid negative indexes in 01931 YYCHECK. In other words, skip the first -YYN actions for 01932 this state because they are default actions. */ 01933 int yyxbegin = yyn < 0 ? -yyn : 0; 01934 /* Stay within bounds of both yycheck and yytname. */ 01935 int yychecklim = YYLAST - yyn + 1; 01936 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 01937 int yyx; 01938 01939 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 01940 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR 01941 && !yytable_value_is_error (yytable[yyx + yyn])) 01942 { 01943 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 01944 { 01945 yycount = 1; 01946 yysize = yysize0; 01947 break; 01948 } 01949 yyarg[yycount++] = yytname[yyx]; 01950 yysize1 = yysize + yytnamerr (0, yytname[yyx]); 01951 if (! (yysize <= yysize1 01952 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 01953 return 2; 01954 yysize = yysize1; 01955 } 01956 } 01957 } 01958 01959 switch (yycount) 01960 { 01961 # define YYCASE_(N, S) \ 01962 case N: \ 01963 yyformat = S; \ 01964 break 01965 YYCASE_(0, YY_("syntax error")); 01966 YYCASE_(1, YY_("syntax error, unexpected %s")); 01967 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 01968 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 01969 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 01970 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 01971 # undef YYCASE_ 01972 } 01973 01974 yysize1 = yysize + yystrlen (yyformat); 01975 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 01976 return 2; 01977 yysize = yysize1; 01978 01979 if (*yymsg_alloc < yysize) 01980 { 01981 *yymsg_alloc = 2 * yysize; 01982 if (! (yysize <= *yymsg_alloc 01983 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) 01984 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; 01985 return 1; 01986 } 01987 01988 /* Avoid sprintf, as that infringes on the user's name space. 01989 Don't have undefined behavior even if the translation 01990 produced a string with the wrong number of "%s"s. */ 01991 { 01992 char *yyp = *yymsg; 01993 int yyi = 0; 01994 while ((*yyp = *yyformat) != '\0') 01995 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) 01996 { 01997 yyp += yytnamerr (yyp, yyarg[yyi++]); 01998 yyformat += 2; 01999 } 02000 else 02001 { 02002 yyp++; 02003 yyformat++; 02004 } 02005 } 02006 return 0; 02007 } 02008 #endif /* YYERROR_VERBOSE */ 02009 02010 /*-----------------------------------------------. 02011 | Release the memory associated to this symbol. | 02012 `-----------------------------------------------*/ 02013 02014 /*ARGSUSED*/ 02015 #if (defined __STDC__ || defined __C99__FUNC__ \ 02016 || defined __cplusplus || defined _MSC_VER) 02017 static void 02018 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 02019 #else 02020 static void 02021 yydestruct (yymsg, yytype, yyvaluep) 02022 const char *yymsg; 02023 int yytype; 02024 YYSTYPE *yyvaluep; 02025 #endif 02026 { 02027 YYUSE (yyvaluep); 02028 02029 if (!yymsg) 02030 yymsg = "Deleting"; 02031 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 02032 02033 switch (yytype) 02034 { 02035 02036 default: 02037 break; 02038 } 02039 } 02040 02041 02042 /* Prevent warnings from -Wmissing-prototypes. */ 02043 #ifdef YYPARSE_PARAM 02044 #if defined __STDC__ || defined __cplusplus 02045 int yyparse (void *YYPARSE_PARAM); 02046 #else 02047 int yyparse (); 02048 #endif 02049 #else /* ! YYPARSE_PARAM */ 02050 #if defined __STDC__ || defined __cplusplus 02051 int yyparse (void); 02052 #else 02053 int yyparse (); 02054 #endif 02055 #endif /* ! YYPARSE_PARAM */ 02056 02057 02058 /* The lookahead symbol. */ 02059 int yychar; 02060 02061 /* The semantic value of the lookahead symbol. */ 02062 YYSTYPE yylval; 02063 02064 /* Number of syntax errors so far. */ 02065 int yynerrs; 02066 02067 02068 /*----------. 02069 | yyparse. | 02070 `----------*/ 02071 02072 #ifdef YYPARSE_PARAM 02073 #if (defined __STDC__ || defined __C99__FUNC__ \ 02074 || defined __cplusplus || defined _MSC_VER) 02075 int 02076 yyparse (void *YYPARSE_PARAM) 02077 #else 02078 int 02079 yyparse (YYPARSE_PARAM) 02080 void *YYPARSE_PARAM; 02081 #endif 02082 #else /* ! YYPARSE_PARAM */ 02083 #if (defined __STDC__ || defined __C99__FUNC__ \ 02084 || defined __cplusplus || defined _MSC_VER) 02085 int 02086 yyparse (void) 02087 #else 02088 int 02089 yyparse () 02090 02091 #endif 02092 #endif 02093 { 02094 int yystate; 02095 /* Number of tokens to shift before error messages enabled. */ 02096 int yyerrstatus; 02097 02098 /* The stacks and their tools: 02099 `yyss': related to states. 02100 `yyvs': related to semantic values. 02101 02102 Refer to the stacks thru separate pointers, to allow yyoverflow 02103 to reallocate them elsewhere. */ 02104 02105 /* The state stack. */ 02106 yytype_int16 yyssa[YYINITDEPTH]; 02107 yytype_int16 *yyss; 02108 yytype_int16 *yyssp; 02109 02110 /* The semantic value stack. */ 02111 YYSTYPE yyvsa[YYINITDEPTH]; 02112 YYSTYPE *yyvs; 02113 YYSTYPE *yyvsp; 02114 02115 YYSIZE_T yystacksize; 02116 02117 int yyn; 02118 int yyresult; 02119 /* Lookahead token as an internal (translated) token number. */ 02120 int yytoken; 02121 /* The variables used to return semantic value and location from the 02122 action routines. */ 02123 YYSTYPE yyval; 02124 02125 #if YYERROR_VERBOSE 02126 /* Buffer for error messages, and its allocated size. */ 02127 char yymsgbuf[128]; 02128 char *yymsg = yymsgbuf; 02129 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 02130 #endif 02131 02132 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 02133 02134 /* The number of symbols on the RHS of the reduced rule. 02135 Keep to zero when no symbol should be popped. */ 02136 int yylen = 0; 02137 02138 yytoken = 0; 02139 yyss = yyssa; 02140 yyvs = yyvsa; 02141 yystacksize = YYINITDEPTH; 02142 02143 YYDPRINTF ((stderr, "Starting parse\n")); 02144 02145 yystate = 0; 02146 yyerrstatus = 0; 02147 yynerrs = 0; 02148 yychar = YYEMPTY; /* Cause a token to be read. */ 02149 02150 /* Initialize stack pointers. 02151 Waste one element of value and location stack 02152 so that they stay on the same level as the state stack. 02153 The wasted elements are never initialized. */ 02154 yyssp = yyss; 02155 yyvsp = yyvs; 02156 02157 goto yysetstate; 02158 02159 /*------------------------------------------------------------. 02160 | yynewstate -- Push a new state, which is found in yystate. | 02161 `------------------------------------------------------------*/ 02162 yynewstate: 02163 /* In all cases, when you get here, the value and location stacks 02164 have just been pushed. So pushing a state here evens the stacks. */ 02165 yyssp++; 02166 02167 yysetstate: 02168 *yyssp = yystate; 02169 02170 if (yyss + yystacksize - 1 <= yyssp) 02171 { 02172 /* Get the current used size of the three stacks, in elements. */ 02173 YYSIZE_T yysize = yyssp - yyss + 1; 02174 02175 #ifdef yyoverflow 02176 { 02177 /* Give user a chance to reallocate the stack. Use copies of 02178 these so that the &'s don't force the real ones into 02179 memory. */ 02180 YYSTYPE *yyvs1 = yyvs; 02181 yytype_int16 *yyss1 = yyss; 02182 02183 /* Each stack pointer address is followed by the size of the 02184 data in use in that stack, in bytes. This used to be a 02185 conditional around just the two extra args, but that might 02186 be undefined if yyoverflow is a macro. */ 02187 yyoverflow (YY_("memory exhausted"), 02188 &yyss1, yysize * sizeof (*yyssp), 02189 &yyvs1, yysize * sizeof (*yyvsp), 02190 &yystacksize); 02191 02192 yyss = yyss1; 02193 yyvs = yyvs1; 02194 } 02195 #else /* no yyoverflow */ 02196 # ifndef YYSTACK_RELOCATE 02197 goto yyexhaustedlab; 02198 # else 02199 /* Extend the stack our own way. */ 02200 if (YYMAXDEPTH <= yystacksize) 02201 goto yyexhaustedlab; 02202 yystacksize *= 2; 02203 if (YYMAXDEPTH < yystacksize) 02204 yystacksize = YYMAXDEPTH; 02205 02206 { 02207 yytype_int16 *yyss1 = yyss; 02208 union yyalloc *yyptr = 02209 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 02210 if (! yyptr) 02211 goto yyexhaustedlab; 02212 YYSTACK_RELOCATE (yyss_alloc, yyss); 02213 YYSTACK_RELOCATE (yyvs_alloc, yyvs); 02214 # undef YYSTACK_RELOCATE 02215 if (yyss1 != yyssa) 02216 YYSTACK_FREE (yyss1); 02217 } 02218 # endif 02219 #endif /* no yyoverflow */ 02220 02221 yyssp = yyss + yysize - 1; 02222 yyvsp = yyvs + yysize - 1; 02223 02224 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 02225 (unsigned long int) yystacksize)); 02226 02227 if (yyss + yystacksize - 1 <= yyssp) 02228 YYABORT; 02229 } 02230 02231 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 02232 02233 if (yystate == YYFINAL) 02234 YYACCEPT; 02235 02236 goto yybackup; 02237 02238 /*-----------. 02239 | yybackup. | 02240 `-----------*/ 02241 yybackup: 02242 02243 /* Do appropriate processing given the current state. Read a 02244 lookahead token if we need one and don't already have one. */ 02245 02246 /* First try to decide what to do without reference to lookahead token. */ 02247 yyn = yypact[yystate]; 02248 if (yypact_value_is_default (yyn)) 02249 goto yydefault; 02250 02251 /* Not known => get a lookahead token if don't already have one. */ 02252 02253 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 02254 if (yychar == YYEMPTY) 02255 { 02256 YYDPRINTF ((stderr, "Reading a token: ")); 02257 yychar = YYLEX; 02258 } 02259 02260 if (yychar <= YYEOF) 02261 { 02262 yychar = yytoken = YYEOF; 02263 YYDPRINTF ((stderr, "Now at end of input.\n")); 02264 } 02265 else 02266 { 02267 yytoken = YYTRANSLATE (yychar); 02268 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 02269 } 02270 02271 /* If the proper action on seeing token YYTOKEN is to reduce or to 02272 detect an error, take that action. */ 02273 yyn += yytoken; 02274 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 02275 goto yydefault; 02276 yyn = yytable[yyn]; 02277 if (yyn <= 0) 02278 { 02279 if (yytable_value_is_error (yyn)) 02280 goto yyerrlab; 02281 yyn = -yyn; 02282 goto yyreduce; 02283 } 02284 02285 /* Count tokens shifted since error; after three, turn off error 02286 status. */ 02287 if (yyerrstatus) 02288 yyerrstatus--; 02289 02290 /* Shift the lookahead token. */ 02291 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 02292 02293 /* Discard the shifted token. */ 02294 yychar = YYEMPTY; 02295 02296 yystate = yyn; 02297 *++yyvsp = yylval; 02298 02299 goto yynewstate; 02300 02301 02302 /*-----------------------------------------------------------. 02303 | yydefault -- do the default action for the current state. | 02304 `-----------------------------------------------------------*/ 02305 yydefault: 02306 yyn = yydefact[yystate]; 02307 if (yyn == 0) 02308 goto yyerrlab; 02309 goto yyreduce; 02310 02311 02312 /*-----------------------------. 02313 | yyreduce -- Do a reduction. | 02314 `-----------------------------*/ 02315 yyreduce: 02316 /* yyn is the number of a rule to reduce with. */ 02317 yylen = yyr2[yyn]; 02318 02319 /* If YYLEN is nonzero, implement the default value of the action: 02320 `$$ = $1'. 02321 02322 Otherwise, the following line sets YYVAL to garbage. 02323 This behavior is undocumented and Bison 02324 users should not rely upon it. Assigning to YYVAL 02325 unconditionally makes the parser a bit smaller, and it avoids a 02326 GCC warning that YYVAL may be used uninitialized. */ 02327 yyval = yyvsp[1-yylen]; 02328 02329 02330 YY_REDUCE_PRINT (yyn); 02331 switch (yyn) 02332 { 02333 case 33: 02334 02335 /* Line 1806 of yacc.c */ 02336 #line 804 "src/cfgparse.y" 02337 { 02338 TAILQ_INSERT_TAIL(bindings, (yyvsp[(1) - (1)].binding), bindings); 02339 } 02340 break; 02341 02342 case 34: 02343 02344 /* Line 1806 of yacc.c */ 02345 #line 810 "src/cfgparse.y" 02346 { (yyval.binding) = (yyvsp[(2) - (2)].binding); } 02347 break; 02348 02349 case 35: 02350 02351 /* Line 1806 of yacc.c */ 02352 #line 811 "src/cfgparse.y" 02353 { (yyval.binding) = (yyvsp[(2) - (2)].binding); } 02354 break; 02355 02356 case 36: 02357 02358 /* Line 1806 of yacc.c */ 02359 #line 816 "src/cfgparse.y" 02360 { 02361 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)); 02362 Binding *new = scalloc(sizeof(Binding)); 02363 02364 new->keycode = (yyvsp[(2) - (3)].number); 02365 new->mods = (yyvsp[(1) - (3)].number); 02366 new->command = (yyvsp[(3) - (3)].string); 02367 02368 (yyval.binding) = new; 02369 } 02370 break; 02371 02372 case 37: 02373 02374 /* Line 1806 of yacc.c */ 02375 #line 830 "src/cfgparse.y" 02376 { 02377 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)); 02378 Binding *new = scalloc(sizeof(Binding)); 02379 02380 new->symbol = (yyvsp[(2) - (3)].string); 02381 new->mods = (yyvsp[(1) - (3)].number); 02382 new->command = (yyvsp[(3) - (3)].string); 02383 02384 (yyval.binding) = new; 02385 } 02386 break; 02387 02388 case 38: 02389 02390 /* Line 1806 of yacc.c */ 02391 #line 844 "src/cfgparse.y" 02392 { 02393 if (match_is_empty(¤t_match)) { 02394 ELOG("Match is empty, ignoring this for_window statement\n"); 02395 break; 02396 } 02397 printf("\t should execute command %s for the criteria mentioned above\n", (yyvsp[(3) - (3)].string)); 02398 Assignment *assignment = scalloc(sizeof(Assignment)); 02399 assignment->type = A_COMMAND; 02400 assignment->match = current_match; 02401 assignment->dest.command = (yyvsp[(3) - (3)].string); 02402 TAILQ_INSERT_TAIL(&assignments, assignment, assignments); 02403 } 02404 break; 02405 02406 case 40: 02407 02408 /* Line 1806 of yacc.c */ 02409 #line 860 "src/cfgparse.y" 02410 { 02411 printf("match parsed\n"); 02412 } 02413 break; 02414 02415 case 41: 02416 02417 /* Line 1806 of yacc.c */ 02418 #line 867 "src/cfgparse.y" 02419 { 02420 printf("start\n"); 02421 match_init(¤t_match); 02422 } 02423 break; 02424 02425 case 42: 02426 02427 /* Line 1806 of yacc.c */ 02428 #line 875 "src/cfgparse.y" 02429 { 02430 printf("match specification finished\n"); 02431 } 02432 break; 02433 02434 case 45: 02435 02436 /* Line 1806 of yacc.c */ 02437 #line 887 "src/cfgparse.y" 02438 { 02439 printf("criteria: class = %s\n", (yyvsp[(3) - (3)].string)); 02440 current_match.class = regex_new((yyvsp[(3) - (3)].string)); 02441 free((yyvsp[(3) - (3)].string)); 02442 } 02443 break; 02444 02445 case 46: 02446 02447 /* Line 1806 of yacc.c */ 02448 #line 893 "src/cfgparse.y" 02449 { 02450 printf("criteria: instance = %s\n", (yyvsp[(3) - (3)].string)); 02451 current_match.instance = regex_new((yyvsp[(3) - (3)].string)); 02452 free((yyvsp[(3) - (3)].string)); 02453 } 02454 break; 02455 02456 case 47: 02457 02458 /* Line 1806 of yacc.c */ 02459 #line 899 "src/cfgparse.y" 02460 { 02461 printf("criteria: window_role = %s\n", (yyvsp[(3) - (3)].string)); 02462 current_match.role = regex_new((yyvsp[(3) - (3)].string)); 02463 free((yyvsp[(3) - (3)].string)); 02464 } 02465 break; 02466 02467 case 48: 02468 02469 /* Line 1806 of yacc.c */ 02470 #line 905 "src/cfgparse.y" 02471 { 02472 printf("criteria: id = %s\n", (yyvsp[(3) - (3)].string)); 02473 char *end; 02474 long parsed = strtol((yyvsp[(3) - (3)].string), &end, 10); 02475 if (parsed == LONG_MIN || 02476 parsed == LONG_MAX || 02477 parsed < 0 || 02478 (end && *end != '\0')) { 02479 ELOG("Could not parse con id \"%s\"\n", (yyvsp[(3) - (3)].string)); 02480 } else { 02481 current_match.con_id = (Con*)parsed; 02482 printf("id as int = %p\n", current_match.con_id); 02483 } 02484 } 02485 break; 02486 02487 case 49: 02488 02489 /* Line 1806 of yacc.c */ 02490 #line 920 "src/cfgparse.y" 02491 { 02492 printf("criteria: window id = %s\n", (yyvsp[(3) - (3)].string)); 02493 char *end; 02494 long parsed = strtol((yyvsp[(3) - (3)].string), &end, 10); 02495 if (parsed == LONG_MIN || 02496 parsed == LONG_MAX || 02497 parsed < 0 || 02498 (end && *end != '\0')) { 02499 ELOG("Could not parse window id \"%s\"\n", (yyvsp[(3) - (3)].string)); 02500 } else { 02501 current_match.id = parsed; 02502 printf("window id as int = %d\n", current_match.id); 02503 } 02504 } 02505 break; 02506 02507 case 50: 02508 02509 /* Line 1806 of yacc.c */ 02510 #line 935 "src/cfgparse.y" 02511 { 02512 printf("criteria: mark = %s\n", (yyvsp[(3) - (3)].string)); 02513 current_match.mark = regex_new((yyvsp[(3) - (3)].string)); 02514 free((yyvsp[(3) - (3)].string)); 02515 } 02516 break; 02517 02518 case 51: 02519 02520 /* Line 1806 of yacc.c */ 02521 #line 941 "src/cfgparse.y" 02522 { 02523 printf("criteria: title = %s\n", (yyvsp[(3) - (3)].string)); 02524 current_match.title = regex_new((yyvsp[(3) - (3)].string)); 02525 free((yyvsp[(3) - (3)].string)); 02526 } 02527 break; 02528 02529 case 53: 02530 02531 /* Line 1806 of yacc.c */ 02532 #line 950 "src/cfgparse.y" 02533 { sasprintf(&(yyval.string), "%d", (yyvsp[(1) - (1)].number)); } 02534 break; 02535 02536 case 55: 02537 02538 /* Line 1806 of yacc.c */ 02539 #line 956 "src/cfgparse.y" 02540 { 02541 sasprintf(&(yyval.string), "%d", (yyvsp[(1) - (1)].number)); 02542 } 02543 break; 02544 02545 case 56: 02546 02547 /* Line 1806 of yacc.c */ 02548 #line 963 "src/cfgparse.y" 02549 { 02550 if (strcasecmp((yyvsp[(2) - (5)].string), "default") == 0) { 02551 printf("You cannot use the name \"default\" for your mode\n"); 02552 exit(1); 02553 } 02554 printf("\t now in mode %s\n", (yyvsp[(2) - (5)].string)); 02555 printf("\t current bindings = %p\n", current_bindings); 02556 Binding *binding; 02557 TAILQ_FOREACH(binding, current_bindings, bindings) { 02558 printf("got binding on mods %d, keycode %d, symbol %s, command %s\n", 02559 binding->mods, binding->keycode, binding->symbol, binding->command); 02560 } 02561 02562 struct Mode *mode = scalloc(sizeof(struct Mode)); 02563 mode->name = (yyvsp[(2) - (5)].string); 02564 mode->bindings = current_bindings; 02565 current_bindings = NULL; 02566 SLIST_INSERT_HEAD(&modes, mode, modes); 02567 } 02568 break; 02569 02570 case 60: 02571 02572 /* Line 1806 of yacc.c */ 02573 #line 993 "src/cfgparse.y" 02574 { 02575 if (current_bindings == NULL) { 02576 current_bindings = scalloc(sizeof(struct bindings_head)); 02577 TAILQ_INIT(current_bindings); 02578 } 02579 02580 TAILQ_INSERT_TAIL(current_bindings, (yyvsp[(1) - (1)].binding), bindings); 02581 } 02582 break; 02583 02584 case 61: 02585 02586 /* Line 1806 of yacc.c */ 02587 #line 1005 "src/cfgparse.y" 02588 { 02589 printf("\t new bar configuration finished, saving.\n"); 02590 /* Generate a unique ID for this bar */ 02591 current_bar.id = sstrdup("bar-XXXXXX"); 02592 /* This works similar to mktemp in that it replaces the last six X with 02593 * random letters, but without the restriction that the given buffer 02594 * has to contain a valid path name. */ 02595 char *x = current_bar.id + strlen("bar-"); 02596 while (*x != '\0') { 02597 *(x++) = (rand() % 26) + 'a'; 02598 } 02599 02600 /* If no font was explicitly set, we use the i3 font as default */ 02601 if (!current_bar.font && font_pattern) 02602 current_bar.font = sstrdup(font_pattern); 02603 02604 /* Copy the current (static) structure into a dynamically allocated 02605 * one, then cleanup our static one. */ 02606 Barconfig *bar_config = scalloc(sizeof(Barconfig)); 02607 memcpy(bar_config, ¤t_bar, sizeof(Barconfig)); 02608 TAILQ_INSERT_TAIL(&barconfigs, bar_config, configs); 02609 02610 memset(¤t_bar, '\0', sizeof(Barconfig)); 02611 } 02612 break; 02613 02614 case 81: 02615 02616 /* Line 1806 of yacc.c */ 02617 #line 1058 "src/cfgparse.y" 02618 { 02619 DLOG("should add status command %s\n", (yyvsp[(2) - (2)].string)); 02620 FREE(current_bar.status_command); 02621 current_bar.status_command = (yyvsp[(2) - (2)].string); 02622 } 02623 break; 02624 02625 case 82: 02626 02627 /* Line 1806 of yacc.c */ 02628 #line 1067 "src/cfgparse.y" 02629 { 02630 DLOG("bar output %s\n", (yyvsp[(2) - (2)].string)); 02631 int new_outputs = current_bar.num_outputs + 1; 02632 current_bar.outputs = srealloc(current_bar.outputs, sizeof(char*) * new_outputs); 02633 current_bar.outputs[current_bar.num_outputs] = (yyvsp[(2) - (2)].string); 02634 current_bar.num_outputs = new_outputs; 02635 } 02636 break; 02637 02638 case 83: 02639 02640 /* Line 1806 of yacc.c */ 02641 #line 1078 "src/cfgparse.y" 02642 { 02643 DLOG("tray %s\n", (yyvsp[(2) - (2)].string)); 02644 FREE(current_bar.tray_output); 02645 current_bar.tray_output = (yyvsp[(2) - (2)].string); 02646 } 02647 break; 02648 02649 case 84: 02650 02651 /* Line 1806 of yacc.c */ 02652 #line 1087 "src/cfgparse.y" 02653 { 02654 DLOG("position %d\n", (yyvsp[(2) - (2)].number)); 02655 current_bar.position = (yyvsp[(2) - (2)].number); 02656 } 02657 break; 02658 02659 case 85: 02660 02661 /* Line 1806 of yacc.c */ 02662 #line 1094 "src/cfgparse.y" 02663 { (yyval.number) = P_TOP; } 02664 break; 02665 02666 case 86: 02667 02668 /* Line 1806 of yacc.c */ 02669 #line 1095 "src/cfgparse.y" 02670 { (yyval.number) = P_BOTTOM; } 02671 break; 02672 02673 case 87: 02674 02675 /* Line 1806 of yacc.c */ 02676 #line 1100 "src/cfgparse.y" 02677 { 02678 DLOG("mode %d\n", (yyvsp[(2) - (2)].number)); 02679 current_bar.mode = (yyvsp[(2) - (2)].number); 02680 } 02681 break; 02682 02683 case 88: 02684 02685 /* Line 1806 of yacc.c */ 02686 #line 1107 "src/cfgparse.y" 02687 { (yyval.number) = M_HIDE; } 02688 break; 02689 02690 case 89: 02691 02692 /* Line 1806 of yacc.c */ 02693 #line 1108 "src/cfgparse.y" 02694 { (yyval.number) = M_DOCK; } 02695 break; 02696 02697 case 90: 02698 02699 /* Line 1806 of yacc.c */ 02700 #line 1113 "src/cfgparse.y" 02701 { 02702 DLOG("font %s\n", (yyvsp[(2) - (2)].string)); 02703 FREE(current_bar.font); 02704 current_bar.font = (yyvsp[(2) - (2)].string); 02705 } 02706 break; 02707 02708 case 91: 02709 02710 /* Line 1806 of yacc.c */ 02711 #line 1122 "src/cfgparse.y" 02712 { 02713 DLOG("workspace_buttons = %d\n", (yyvsp[(2) - (2)].number)); 02714 /* We store this inverted to make the default setting right when 02715 * initializing the struct with zero. */ 02716 current_bar.hide_workspace_buttons = !((yyvsp[(2) - (2)].number)); 02717 } 02718 break; 02719 02720 case 92: 02721 02722 /* Line 1806 of yacc.c */ 02723 #line 1132 "src/cfgparse.y" 02724 { 02725 DLOG("verbose = %d\n", (yyvsp[(2) - (2)].number)); 02726 current_bar.verbose = (yyvsp[(2) - (2)].number); 02727 } 02728 break; 02729 02730 case 93: 02731 02732 /* Line 1806 of yacc.c */ 02733 #line 1140 "src/cfgparse.y" 02734 { 02735 DLOG("socket_path = %s\n", (yyvsp[(2) - (2)].string)); 02736 FREE(current_bar.socket_path); 02737 current_bar.socket_path = (yyvsp[(2) - (2)].string); 02738 } 02739 break; 02740 02741 case 94: 02742 02743 /* Line 1806 of yacc.c */ 02744 #line 1149 "src/cfgparse.y" 02745 { 02746 /* At the moment, the TOK_BAR_COLORS token is only to make the config 02747 * friendlier for humans. We might change this in the future if it gets 02748 * more complex. */ 02749 } 02750 break; 02751 02752 case 95: 02753 02754 /* Line 1806 of yacc.c */ 02755 #line 1158 "src/cfgparse.y" 02756 { 02757 DLOG("background = %s\n", (yyvsp[(2) - (2)].string)); 02758 current_bar.colors.background = (yyvsp[(2) - (2)].string); 02759 } 02760 break; 02761 02762 case 96: 02763 02764 /* Line 1806 of yacc.c */ 02765 #line 1166 "src/cfgparse.y" 02766 { 02767 DLOG("statusline = %s\n", (yyvsp[(2) - (2)].string)); 02768 current_bar.colors.statusline = (yyvsp[(2) - (2)].string); 02769 } 02770 break; 02771 02772 case 97: 02773 02774 /* Line 1806 of yacc.c */ 02775 #line 1174 "src/cfgparse.y" 02776 { 02777 DLOG("focused_ws = %s and %s\n", (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].string)); 02778 current_bar.colors.focused_workspace_text = (yyvsp[(2) - (3)].string); 02779 current_bar.colors.focused_workspace_bg = (yyvsp[(3) - (3)].string); 02780 } 02781 break; 02782 02783 case 98: 02784 02785 /* Line 1806 of yacc.c */ 02786 #line 1183 "src/cfgparse.y" 02787 { 02788 DLOG("active_ws = %s and %s\n", (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].string)); 02789 current_bar.colors.active_workspace_text = (yyvsp[(2) - (3)].string); 02790 current_bar.colors.active_workspace_bg = (yyvsp[(3) - (3)].string); 02791 } 02792 break; 02793 02794 case 99: 02795 02796 /* Line 1806 of yacc.c */ 02797 #line 1192 "src/cfgparse.y" 02798 { 02799 DLOG("inactive_ws = %s and %s\n", (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].string)); 02800 current_bar.colors.inactive_workspace_text = (yyvsp[(2) - (3)].string); 02801 current_bar.colors.inactive_workspace_bg = (yyvsp[(3) - (3)].string); 02802 } 02803 break; 02804 02805 case 100: 02806 02807 /* Line 1806 of yacc.c */ 02808 #line 1201 "src/cfgparse.y" 02809 { 02810 DLOG("urgent_ws = %s and %s\n", (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].string)); 02811 current_bar.colors.urgent_workspace_text = (yyvsp[(2) - (3)].string); 02812 current_bar.colors.urgent_workspace_bg = (yyvsp[(3) - (3)].string); 02813 } 02814 break; 02815 02816 case 101: 02817 02818 /* Line 1806 of yacc.c */ 02819 #line 1210 "src/cfgparse.y" 02820 { 02821 DLOG("floating modifier = %d\n", (yyvsp[(2) - (2)].number)); 02822 config.floating_modifier = (yyvsp[(2) - (2)].number); 02823 } 02824 break; 02825 02826 case 102: 02827 02828 /* Line 1806 of yacc.c */ 02829 #line 1218 "src/cfgparse.y" 02830 { 02831 DLOG("New containers should start with split direction %d\n", (yyvsp[(2) - (2)].number)); 02832 config.default_orientation = (yyvsp[(2) - (2)].number); 02833 } 02834 break; 02835 02836 case 103: 02837 02838 /* Line 1806 of yacc.c */ 02839 #line 1225 "src/cfgparse.y" 02840 { (yyval.number) = HORIZ; } 02841 break; 02842 02843 case 104: 02844 02845 /* Line 1806 of yacc.c */ 02846 #line 1226 "src/cfgparse.y" 02847 { (yyval.number) = VERT; } 02848 break; 02849 02850 case 105: 02851 02852 /* Line 1806 of yacc.c */ 02853 #line 1227 "src/cfgparse.y" 02854 { (yyval.number) = NO_ORIENTATION; } 02855 break; 02856 02857 case 106: 02858 02859 /* Line 1806 of yacc.c */ 02860 #line 1232 "src/cfgparse.y" 02861 { 02862 DLOG("new containers will be in mode %d\n", (yyvsp[(2) - (2)].number)); 02863 config.default_layout = (yyvsp[(2) - (2)].number); 02864 02865 #if 0 02866 /* We also need to change the layout of the already existing 02867 * workspaces here. Workspaces may exist at this point because 02868 * of the other directives which are modifying workspaces 02869 * (setting the preferred screen or name). While the workspace 02870 * objects are already created, they have never been used. 02871 * Thus, the user very likely awaits the default container mode 02872 * to trigger in this case, regardless of where it is inside 02873 * his configuration file. */ 02874 Workspace *ws; 02875 TAILQ_FOREACH(ws, workspaces, workspaces) { 02876 if (ws->table == NULL) 02877 continue; 02878 switch_layout_mode(global_conn, 02879 ws->table[0][0], 02880 config.container_mode); 02881 } 02882 #endif 02883 } 02884 break; 02885 02886 case 107: 02887 02888 /* Line 1806 of yacc.c */ 02889 #line 1256 "src/cfgparse.y" 02890 { 02891 DLOG("stack-limit %d with val %d\n", (yyvsp[(3) - (4)].number), (yyvsp[(4) - (4)].number)); 02892 config.container_stack_limit = (yyvsp[(3) - (4)].number); 02893 config.container_stack_limit_value = (yyvsp[(4) - (4)].number); 02894 02895 #if 0 02896 /* See the comment above */ 02897 Workspace *ws; 02898 TAILQ_FOREACH(ws, workspaces, workspaces) { 02899 if (ws->table == NULL) 02900 continue; 02901 Container *con = ws->table[0][0]; 02902 con->stack_limit = config.container_stack_limit; 02903 con->stack_limit_value = config.container_stack_limit_value; 02904 } 02905 #endif 02906 } 02907 break; 02908 02909 case 108: 02910 02911 /* Line 1806 of yacc.c */ 02912 #line 1276 "src/cfgparse.y" 02913 { (yyval.number) = L_DEFAULT; } 02914 break; 02915 02916 case 109: 02917 02918 /* Line 1806 of yacc.c */ 02919 #line 1277 "src/cfgparse.y" 02920 { (yyval.number) = L_STACKED; } 02921 break; 02922 02923 case 110: 02924 02925 /* Line 1806 of yacc.c */ 02926 #line 1278 "src/cfgparse.y" 02927 { (yyval.number) = L_TABBED; } 02928 break; 02929 02930 case 111: 02931 02932 /* Line 1806 of yacc.c */ 02933 #line 1283 "src/cfgparse.y" 02934 { 02935 DLOG("new windows should start with border style %d\n", (yyvsp[(2) - (2)].number)); 02936 config.default_border = (yyvsp[(2) - (2)].number); 02937 } 02938 break; 02939 02940 case 112: 02941 02942 /* Line 1806 of yacc.c */ 02943 #line 1291 "src/cfgparse.y" 02944 { 02945 DLOG("new floating windows should start with border style %d\n", (yyvsp[(2) - (2)].number)); 02946 config.default_floating_border = (yyvsp[(2) - (2)].number); 02947 } 02948 break; 02949 02950 case 113: 02951 02952 /* Line 1806 of yacc.c */ 02953 #line 1298 "src/cfgparse.y" 02954 { (yyval.number) = BS_NORMAL; } 02955 break; 02956 02957 case 114: 02958 02959 /* Line 1806 of yacc.c */ 02960 #line 1299 "src/cfgparse.y" 02961 { (yyval.number) = BS_NONE; } 02962 break; 02963 02964 case 115: 02965 02966 /* Line 1806 of yacc.c */ 02967 #line 1300 "src/cfgparse.y" 02968 { (yyval.number) = BS_1PIXEL; } 02969 break; 02970 02971 case 116: 02972 02973 /* Line 1806 of yacc.c */ 02974 #line 1305 "src/cfgparse.y" 02975 { 02976 (yyval.number) = ((yyvsp[(1) - (1)].number) == 1); 02977 } 02978 break; 02979 02980 case 117: 02981 02982 /* Line 1806 of yacc.c */ 02983 #line 1309 "src/cfgparse.y" 02984 { 02985 DLOG("checking word \"%s\"\n", (yyvsp[(1) - (1)].string)); 02986 (yyval.number) = (strcasecmp((yyvsp[(1) - (1)].string), "yes") == 0 || 02987 strcasecmp((yyvsp[(1) - (1)].string), "true") == 0 || 02988 strcasecmp((yyvsp[(1) - (1)].string), "on") == 0 || 02989 strcasecmp((yyvsp[(1) - (1)].string), "enable") == 0 || 02990 strcasecmp((yyvsp[(1) - (1)].string), "active") == 0); 02991 } 02992 break; 02993 02994 case 118: 02995 02996 /* Line 1806 of yacc.c */ 02997 #line 1321 "src/cfgparse.y" 02998 { 02999 DLOG("focus follows mouse = %d\n", (yyvsp[(2) - (2)].number)); 03000 config.disable_focus_follows_mouse = !((yyvsp[(2) - (2)].number)); 03001 } 03002 break; 03003 03004 case 119: 03005 03006 /* Line 1806 of yacc.c */ 03007 #line 1329 "src/cfgparse.y" 03008 { 03009 DLOG("force focus wrapping = %d\n", (yyvsp[(2) - (2)].number)); 03010 config.force_focus_wrapping = (yyvsp[(2) - (2)].number); 03011 } 03012 break; 03013 03014 case 120: 03015 03016 /* Line 1806 of yacc.c */ 03017 #line 1337 "src/cfgparse.y" 03018 { 03019 DLOG("force xinerama = %d\n", (yyvsp[(2) - (2)].number)); 03020 config.force_xinerama = (yyvsp[(2) - (2)].number); 03021 } 03022 break; 03023 03024 case 121: 03025 03026 /* Line 1806 of yacc.c */ 03027 #line 1345 "src/cfgparse.y" 03028 { 03029 DLOG("automatic workspace back-and-forth = %d\n", (yyvsp[(2) - (2)].number)); 03030 config.workspace_auto_back_and_forth = (yyvsp[(2) - (2)].number); 03031 } 03032 break; 03033 03034 case 122: 03035 03036 /* Line 1806 of yacc.c */ 03037 #line 1353 "src/cfgparse.y" 03038 { 03039 DLOG("workspace bar = %d\n", (yyvsp[(2) - (2)].number)); 03040 config.disable_workspace_bar = !((yyvsp[(2) - (2)].number)); 03041 } 03042 break; 03043 03044 case 123: 03045 03046 /* Line 1806 of yacc.c */ 03047 #line 1361 "src/cfgparse.y" 03048 { 03049 char *ws_name = (yyvsp[(2) - (5)].string); 03050 03051 if ((yyvsp[(5) - (5)].string) != NULL) { 03052 ELOG("The old (v3) syntax workspace <number> output <output> <name> is deprecated.\n"); 03053 ELOG("Please use the new syntax: workspace \"<workspace>\" output <output>\n"); 03054 ELOG("In your case, the following should work:\n"); 03055 ELOG(" workspace \"%s\" output %s\n", (yyvsp[(5) - (5)].string), (yyvsp[(4) - (5)].string)); 03056 ws_name = (yyvsp[(5) - (5)].string); 03057 context->has_warnings = true; 03058 } 03059 03060 DLOG("Assigning workspace \"%s\" to output \"%s\"\n", ws_name, (yyvsp[(4) - (5)].string)); 03061 /* Check for earlier assignments of the same workspace so that we 03062 * don’t have assignments of a single workspace to different 03063 * outputs */ 03064 struct Workspace_Assignment *assignment; 03065 bool duplicate = false; 03066 TAILQ_FOREACH(assignment, &ws_assignments, ws_assignments) { 03067 if (strcasecmp(assignment->name, ws_name) == 0) { 03068 ELOG("You have a duplicate workspace assignment for workspace \"%s\"\n", 03069 ws_name); 03070 assignment->output = (yyvsp[(4) - (5)].string); 03071 duplicate = true; 03072 } 03073 } 03074 if (!duplicate) { 03075 assignment = scalloc(sizeof(struct Workspace_Assignment)); 03076 assignment->name = ws_name; 03077 assignment->output = (yyvsp[(4) - (5)].string); 03078 TAILQ_INSERT_TAIL(&ws_assignments, assignment, ws_assignments); 03079 } 03080 } 03081 break; 03082 03083 case 124: 03084 03085 /* Line 1806 of yacc.c */ 03086 #line 1395 "src/cfgparse.y" 03087 { 03088 int ws_num = (yyvsp[(2) - (3)].number); 03089 if (ws_num < 1) { 03090 DLOG("Invalid workspace assignment, workspace number %d out of range\n", ws_num); 03091 } else { 03092 DLOG("workspace name to: %s\n", (yyvsp[(3) - (3)].string)); 03093 #if 0 03094 if ((yyvsp[(3) - (3)].string) != NULL) { 03095 workspace_set_name(workspace_get(ws_num - 1), (yyvsp[(3) - (3)].string)); 03096 free((yyvsp[(3) - (3)].string)); 03097 } 03098 #endif 03099 } 03100 } 03101 break; 03102 03103 case 125: 03104 03105 /* Line 1806 of yacc.c */ 03106 #line 1412 "src/cfgparse.y" 03107 { (yyval.string) = NULL; } 03108 break; 03109 03110 case 126: 03111 03112 /* Line 1806 of yacc.c */ 03113 #line 1413 "src/cfgparse.y" 03114 { (yyval.string) = (yyvsp[(1) - (1)].string); } 03115 break; 03116 03117 case 127: 03118 03119 /* Line 1806 of yacc.c */ 03120 #line 1417 "src/cfgparse.y" 03121 { (yyval.string) = (yyvsp[(1) - (1)].string); } 03122 break; 03123 03124 case 128: 03125 03126 /* Line 1806 of yacc.c */ 03127 #line 1418 "src/cfgparse.y" 03128 { (yyval.string) = (yyvsp[(1) - (1)].string); } 03129 break; 03130 03131 case 129: 03132 03133 /* Line 1806 of yacc.c */ 03134 #line 1419 "src/cfgparse.y" 03135 { (yyval.string) = (yyvsp[(1) - (1)].string); } 03136 break; 03137 03138 case 130: 03139 03140 /* Line 1806 of yacc.c */ 03141 #line 1424 "src/cfgparse.y" 03142 { 03143 /* This is the old, deprecated form of assignments. It’s provided for 03144 * compatibility in version (4.1, 4.2, 4.3) and will be removed 03145 * afterwards. It triggers an i3-nagbar warning starting from 4.1. */ 03146 ELOG("You are using the old assign syntax (without criteria). " 03147 "Please see the User's Guide for the new syntax and fix " 03148 "your config file.\n"); 03149 context->has_warnings = true; 03150 printf("assignment of %s to *%s*\n", (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].string)); 03151 char *workspace = (yyvsp[(3) - (3)].string); 03152 char *criteria = (yyvsp[(2) - (3)].string); 03153 03154 Assignment *assignment = scalloc(sizeof(Assignment)); 03155 Match *match = &(assignment->match); 03156 match_init(match); 03157 03158 char *separator = NULL; 03159 if ((separator = strchr(criteria, '/')) != NULL) { 03160 *(separator++) = '\0'; 03161 char *pattern; 03162 sasprintf(&pattern, "(?i)%s", separator); 03163 match->title = regex_new(pattern); 03164 free(pattern); 03165 printf(" title = %s\n", separator); 03166 } 03167 if (*criteria != '\0') { 03168 char *pattern; 03169 sasprintf(&pattern, "(?i)%s", criteria); 03170 match->class = regex_new(pattern); 03171 free(pattern); 03172 printf(" class = %s\n", criteria); 03173 } 03174 free(criteria); 03175 03176 /* Compatibility with older versions: If the assignment target starts 03177 * with ~, we create the equivalent of: 03178 * 03179 * for_window [class="foo"] floating enable 03180 */ 03181 if (*workspace == '~') { 03182 workspace++; 03183 if (*workspace == '\0') { 03184 /* This assignment was *only* for floating */ 03185 assignment->type = A_COMMAND; 03186 assignment->dest.command = sstrdup("floating enable"); 03187 TAILQ_INSERT_TAIL(&assignments, assignment, assignments); 03188 break; 03189 } else { 03190 /* Create a new assignment and continue afterwards */ 03191 Assignment *floating = scalloc(sizeof(Assignment)); 03192 match_copy(&(floating->match), match); 03193 floating->type = A_COMMAND; 03194 floating->dest.command = sstrdup("floating enable"); 03195 TAILQ_INSERT_TAIL(&assignments, floating, assignments); 03196 } 03197 } 03198 03199 assignment->type = A_TO_WORKSPACE; 03200 assignment->dest.workspace = workspace; 03201 TAILQ_INSERT_TAIL(&assignments, assignment, assignments); 03202 } 03203 break; 03204 03205 case 131: 03206 03207 /* Line 1806 of yacc.c */ 03208 #line 1486 "src/cfgparse.y" 03209 { 03210 if (match_is_empty(¤t_match)) { 03211 ELOG("Match is empty, ignoring this assignment\n"); 03212 break; 03213 } 03214 printf("new assignment, using above criteria, to workspace %s\n", (yyvsp[(3) - (3)].string)); 03215 Assignment *assignment = scalloc(sizeof(Assignment)); 03216 assignment->match = current_match; 03217 assignment->type = A_TO_WORKSPACE; 03218 assignment->dest.workspace = (yyvsp[(3) - (3)].string); 03219 TAILQ_INSERT_TAIL(&assignments, assignment, assignments); 03220 } 03221 break; 03222 03223 case 134: 03224 03225 /* Line 1806 of yacc.c */ 03226 #line 1507 "src/cfgparse.y" 03227 { 03228 config.ipc_socket_path = (yyvsp[(2) - (2)].string); 03229 } 03230 break; 03231 03232 case 135: 03233 03234 /* Line 1806 of yacc.c */ 03235 #line 1514 "src/cfgparse.y" 03236 { 03237 config.restart_state_path = (yyvsp[(2) - (2)].string); 03238 } 03239 break; 03240 03241 case 136: 03242 03243 /* Line 1806 of yacc.c */ 03244 #line 1521 "src/cfgparse.y" 03245 { 03246 struct Autostart *new = smalloc(sizeof(struct Autostart)); 03247 new->command = (yyvsp[(3) - (3)].string); 03248 new->no_startup_id = (yyvsp[(2) - (3)].number); 03249 TAILQ_INSERT_TAIL(&autostarts, new, autostarts); 03250 } 03251 break; 03252 03253 case 137: 03254 03255 /* Line 1806 of yacc.c */ 03256 #line 1531 "src/cfgparse.y" 03257 { 03258 struct Autostart *new = smalloc(sizeof(struct Autostart)); 03259 new->command = (yyvsp[(3) - (3)].string); 03260 new->no_startup_id = (yyvsp[(2) - (3)].number); 03261 TAILQ_INSERT_TAIL(&autostarts_always, new, autostarts_always); 03262 } 03263 break; 03264 03265 case 138: 03266 03267 /* Line 1806 of yacc.c */ 03268 #line 1540 "src/cfgparse.y" 03269 { (yyval.number) = false; } 03270 break; 03271 03272 case 139: 03273 03274 /* Line 1806 of yacc.c */ 03275 #line 1541 "src/cfgparse.y" 03276 { (yyval.number) = true; } 03277 break; 03278 03279 case 140: 03280 03281 /* Line 1806 of yacc.c */ 03282 #line 1546 "src/cfgparse.y" 03283 { 03284 ELOG("The terminal option is DEPRECATED and has no effect. " 03285 "Please remove it from your configuration file.\n"); 03286 } 03287 break; 03288 03289 case 141: 03290 03291 /* Line 1806 of yacc.c */ 03292 #line 1554 "src/cfgparse.y" 03293 { 03294 config.font = load_font((yyvsp[(2) - (2)].string), true); 03295 printf("font %s\n", (yyvsp[(2) - (2)].string)); 03296 FREE(font_pattern); 03297 font_pattern = (yyvsp[(2) - (2)].string); 03298 } 03299 break; 03300 03301 case 142: 03302 03303 /* Line 1806 of yacc.c */ 03304 #line 1564 "src/cfgparse.y" 03305 { 03306 uint32_t *dest = (yyvsp[(1) - (2)].single_color); 03307 *dest = (yyvsp[(2) - (2)].number); 03308 } 03309 break; 03310 03311 case 143: 03312 03313 /* Line 1806 of yacc.c */ 03314 #line 1572 "src/cfgparse.y" 03315 { 03316 struct Colortriple *dest = (yyvsp[(1) - (4)].color); 03317 03318 dest->border = (yyvsp[(2) - (4)].number); 03319 dest->background = (yyvsp[(3) - (4)].number); 03320 dest->text = (yyvsp[(4) - (4)].number); 03321 } 03322 break; 03323 03324 case 144: 03325 03326 /* Line 1806 of yacc.c */ 03327 #line 1583 "src/cfgparse.y" 03328 { 03329 (yyval.number) = get_colorpixel((yyvsp[(1) - (1)].string)); 03330 free((yyvsp[(1) - (1)].string)); 03331 } 03332 break; 03333 03334 case 145: 03335 03336 /* Line 1806 of yacc.c */ 03337 #line 1591 "src/cfgparse.y" 03338 { (yyval.number) = 0; } 03339 break; 03340 03341 case 147: 03342 03343 /* Line 1806 of yacc.c */ 03344 #line 1593 "src/cfgparse.y" 03345 { (yyval.number) = (yyvsp[(1) - (3)].number) | (yyvsp[(3) - (3)].number); } 03346 break; 03347 03348 case 148: 03349 03350 /* Line 1806 of yacc.c */ 03351 #line 1594 "src/cfgparse.y" 03352 { (yyval.number) = (yyvsp[(1) - (2)].number); } 03353 break; 03354 03355 case 149: 03356 03357 /* Line 1806 of yacc.c */ 03358 #line 1598 "src/cfgparse.y" 03359 { (yyval.number) = (yyvsp[(1) - (1)].number); } 03360 break; 03361 03362 case 150: 03363 03364 /* Line 1806 of yacc.c */ 03365 #line 1599 "src/cfgparse.y" 03366 { (yyval.number) = BIND_CONTROL; } 03367 break; 03368 03369 case 151: 03370 03371 /* Line 1806 of yacc.c */ 03372 #line 1600 "src/cfgparse.y" 03373 { (yyval.number) = BIND_SHIFT; } 03374 break; 03375 03376 case 152: 03377 03378 /* Line 1806 of yacc.c */ 03379 #line 1605 "src/cfgparse.y" 03380 { 03381 DLOG("popup_during_fullscreen setting: %d\n", (yyvsp[(2) - (2)].number)); 03382 config.popup_during_fullscreen = (yyvsp[(2) - (2)].number); 03383 } 03384 break; 03385 03386 case 153: 03387 03388 /* Line 1806 of yacc.c */ 03389 #line 1612 "src/cfgparse.y" 03390 { (yyval.number) = PDF_IGNORE; } 03391 break; 03392 03393 case 154: 03394 03395 /* Line 1806 of yacc.c */ 03396 #line 1613 "src/cfgparse.y" 03397 { (yyval.number) = PDF_LEAVE_FULLSCREEN; } 03398 break; 03399 03400 03401 03402 /* Line 1806 of yacc.c */ 03403 #line 3404 "src/cfgparse.tab.c" 03404 default: break; 03405 } 03406 /* User semantic actions sometimes alter yychar, and that requires 03407 that yytoken be updated with the new translation. We take the 03408 approach of translating immediately before every use of yytoken. 03409 One alternative is translating here after every semantic action, 03410 but that translation would be missed if the semantic action invokes 03411 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 03412 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 03413 incorrect destructor might then be invoked immediately. In the 03414 case of YYERROR or YYBACKUP, subsequent parser actions might lead 03415 to an incorrect destructor call or verbose syntax error message 03416 before the lookahead is translated. */ 03417 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 03418 03419 YYPOPSTACK (yylen); 03420 yylen = 0; 03421 YY_STACK_PRINT (yyss, yyssp); 03422 03423 *++yyvsp = yyval; 03424 03425 /* Now `shift' the result of the reduction. Determine what state 03426 that goes to, based on the state we popped back to and the rule 03427 number reduced by. */ 03428 03429 yyn = yyr1[yyn]; 03430 03431 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 03432 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 03433 yystate = yytable[yystate]; 03434 else 03435 yystate = yydefgoto[yyn - YYNTOKENS]; 03436 03437 goto yynewstate; 03438 03439 03440 /*------------------------------------. 03441 | yyerrlab -- here on detecting error | 03442 `------------------------------------*/ 03443 yyerrlab: 03444 /* Make sure we have latest lookahead translation. See comments at 03445 user semantic actions for why this is necessary. */ 03446 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 03447 03448 /* If not already recovering from an error, report this error. */ 03449 if (!yyerrstatus) 03450 { 03451 ++yynerrs; 03452 #if ! YYERROR_VERBOSE 03453 yyerror (YY_("syntax error")); 03454 #else 03455 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 03456 yyssp, yytoken) 03457 { 03458 char const *yymsgp = YY_("syntax error"); 03459 int yysyntax_error_status; 03460 yysyntax_error_status = YYSYNTAX_ERROR; 03461 if (yysyntax_error_status == 0) 03462 yymsgp = yymsg; 03463 else if (yysyntax_error_status == 1) 03464 { 03465 if (yymsg != yymsgbuf) 03466 YYSTACK_FREE (yymsg); 03467 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); 03468 if (!yymsg) 03469 { 03470 yymsg = yymsgbuf; 03471 yymsg_alloc = sizeof yymsgbuf; 03472 yysyntax_error_status = 2; 03473 } 03474 else 03475 { 03476 yysyntax_error_status = YYSYNTAX_ERROR; 03477 yymsgp = yymsg; 03478 } 03479 } 03480 yyerror (yymsgp); 03481 if (yysyntax_error_status == 2) 03482 goto yyexhaustedlab; 03483 } 03484 # undef YYSYNTAX_ERROR 03485 #endif 03486 } 03487 03488 03489 03490 if (yyerrstatus == 3) 03491 { 03492 /* If just tried and failed to reuse lookahead token after an 03493 error, discard it. */ 03494 03495 if (yychar <= YYEOF) 03496 { 03497 /* Return failure if at end of input. */ 03498 if (yychar == YYEOF) 03499 YYABORT; 03500 } 03501 else 03502 { 03503 yydestruct ("Error: discarding", 03504 yytoken, &yylval); 03505 yychar = YYEMPTY; 03506 } 03507 } 03508 03509 /* Else will try to reuse lookahead token after shifting the error 03510 token. */ 03511 goto yyerrlab1; 03512 03513 03514 /*---------------------------------------------------. 03515 | yyerrorlab -- error raised explicitly by YYERROR. | 03516 `---------------------------------------------------*/ 03517 yyerrorlab: 03518 03519 /* Pacify compilers like GCC when the user code never invokes 03520 YYERROR and the label yyerrorlab therefore never appears in user 03521 code. */ 03522 if (/*CONSTCOND*/ 0) 03523 goto yyerrorlab; 03524 03525 /* Do not reclaim the symbols of the rule which action triggered 03526 this YYERROR. */ 03527 YYPOPSTACK (yylen); 03528 yylen = 0; 03529 YY_STACK_PRINT (yyss, yyssp); 03530 yystate = *yyssp; 03531 goto yyerrlab1; 03532 03533 03534 /*-------------------------------------------------------------. 03535 | yyerrlab1 -- common code for both syntax error and YYERROR. | 03536 `-------------------------------------------------------------*/ 03537 yyerrlab1: 03538 yyerrstatus = 3; /* Each real token shifted decrements this. */ 03539 03540 for (;;) 03541 { 03542 yyn = yypact[yystate]; 03543 if (!yypact_value_is_default (yyn)) 03544 { 03545 yyn += YYTERROR; 03546 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 03547 { 03548 yyn = yytable[yyn]; 03549 if (0 < yyn) 03550 break; 03551 } 03552 } 03553 03554 /* Pop the current state because it cannot handle the error token. */ 03555 if (yyssp == yyss) 03556 YYABORT; 03557 03558 03559 yydestruct ("Error: popping", 03560 yystos[yystate], yyvsp); 03561 YYPOPSTACK (1); 03562 yystate = *yyssp; 03563 YY_STACK_PRINT (yyss, yyssp); 03564 } 03565 03566 *++yyvsp = yylval; 03567 03568 03569 /* Shift the error token. */ 03570 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 03571 03572 yystate = yyn; 03573 goto yynewstate; 03574 03575 03576 /*-------------------------------------. 03577 | yyacceptlab -- YYACCEPT comes here. | 03578 `-------------------------------------*/ 03579 yyacceptlab: 03580 yyresult = 0; 03581 goto yyreturn; 03582 03583 /*-----------------------------------. 03584 | yyabortlab -- YYABORT comes here. | 03585 `-----------------------------------*/ 03586 yyabortlab: 03587 yyresult = 1; 03588 goto yyreturn; 03589 03590 #if !defined(yyoverflow) || YYERROR_VERBOSE 03591 /*-------------------------------------------------. 03592 | yyexhaustedlab -- memory exhaustion comes here. | 03593 `-------------------------------------------------*/ 03594 yyexhaustedlab: 03595 yyerror (YY_("memory exhausted")); 03596 yyresult = 2; 03597 /* Fall through. */ 03598 #endif 03599 03600 yyreturn: 03601 if (yychar != YYEMPTY) 03602 { 03603 /* Make sure we have latest lookahead translation. See comments at 03604 user semantic actions for why this is necessary. */ 03605 yytoken = YYTRANSLATE (yychar); 03606 yydestruct ("Cleanup: discarding lookahead", 03607 yytoken, &yylval); 03608 } 03609 /* Do not reclaim the symbols of the rule which action triggered 03610 this YYABORT or YYACCEPT. */ 03611 YYPOPSTACK (yylen); 03612 YY_STACK_PRINT (yyss, yyssp); 03613 while (yyssp != yyss) 03614 { 03615 yydestruct ("Cleanup: popping", 03616 yystos[*yyssp], yyvsp); 03617 YYPOPSTACK (1); 03618 } 03619 #ifndef yyoverflow 03620 if (yyss != yyssa) 03621 YYSTACK_FREE (yyss); 03622 #endif 03623 #if YYERROR_VERBOSE 03624 if (yymsg != yymsgbuf) 03625 YYSTACK_FREE (yymsg); 03626 #endif 03627 /* Make sure YYID is used. */ 03628 return YYID (yyresult); 03629 } 03630 03631 03632