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