i3
cfgparse.tab.c
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 2.5. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* As a special exception, you may create a larger work that contains
21  part or all of the Bison parser skeleton and distribute that work
22  under terms of your choice, so long as that work isn't itself a
23  parser generator using the skeleton or a modified version thereof
24  as a parser skeleton. Alternatively, if you modify or redistribute
25  the parser skeleton itself, you may (at your option) remove this
26  special exception, which will cause the skeleton and the resulting
27  Bison output files to be licensed under the GNU General Public
28  License without this special exception.
29 
30  This special exception was added by the Free Software Foundation in
31  version 2.2 of Bison. */
32 
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34  simplifying the original so-called "semantic" parser. */
35 
36 /* All symbols defined below should begin with yy or YY, to avoid
37  infringing on user name space. This should be done even for local
38  variables, as they might otherwise be expanded by user macros.
39  There are some unavoidable exceptions within include files to
40  define necessary library symbols; they are noted "INFRINGES ON
41  USER NAME SPACE" below. */
42 
43 /* Identify Bison output. */
44 #define YYBISON 1
45 
46 /* Bison version. */
47 #define YYBISON_VERSION "2.5"
48 
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51 
52 /* Pure parsers. */
53 #define YYPURE 0
54 
55 /* Push parsers. */
56 #define YYPUSH 0
57 
58 /* Pull parsers. */
59 #define YYPULL 1
60 
61 /* Using locations. */
62 #define YYLSP_NEEDED 0
63 
64 
65 
66 /* Copy the first part of user declarations. */
67 
68 /* Line 268 of yacc.c */
69 #line 1 "src/cfgparse.y"
70 
71 /*
72  * vim:ts=4:sw=4:expandtab
73  *
74  */
75 #include <sys/types.h>
76 #include <sys/stat.h>
77 #include <sys/wait.h>
78 #include <unistd.h>
79 #include <fcntl.h>
80 
81 #include "all.h"
82 
83 static pid_t configerror_pid = -1;
84 
87 /* The pattern which was specified by the user, for example -misc-fixed-*. We
88  * store this in a separate variable because in the i3 config struct we just
89  * store the i3Font. */
90 static char *font_pattern;
91 
93 extern int yylex(struct context *context);
94 extern int yyparse(void);
95 extern int yylex_destroy(void);
96 extern FILE *yyin;
97 YY_BUFFER_STATE yy_scan_string(const char *);
98 
99 static struct bindings_head *current_bindings;
100 static struct context *context;
101 
102 /* We don’t need yydebug for now, as we got decent error messages using
103  * yyerror(). Should you ever want to extend the parser, it might be handy
104  * to just comment it in again, so it stays here. */
105 //int yydebug = 1;
106 
107 void yyerror(const char *error_message) {
108  context->has_errors = true;
109 
110  ELOG("\n");
111  ELOG("CONFIG: %s\n", error_message);
112  ELOG("CONFIG: in file \"%s\", line %d:\n",
113  context->filename, context->line_number);
114  ELOG("CONFIG: %s\n", context->line_copy);
115  char buffer[context->last_column+1];
116  buffer[context->last_column] = '\0';
117  for (int c = 1; c <= context->last_column; c++)
118  buffer[c-1] = (c >= context->first_column ? '^' : ' ');
119  ELOG("CONFIG: %s\n", buffer);
120  ELOG("\n");
121 }
122 
123 int yywrap(void) {
124  return 1;
125 }
126 
127 /*
128  * Goes through each line of buf (separated by \n) and checks for statements /
129  * commands which only occur in i3 v4 configuration files. If it finds any, it
130  * returns version 4, otherwise it returns version 3.
131  *
132  */
133 static int detect_version(char *buf) {
134  char *walk = buf;
135  char *line = buf;
136  while (*walk != '\0') {
137  if (*walk != '\n') {
138  walk++;
139  continue;
140  }
141 
142  /* check for some v4-only statements */
143  if (strncasecmp(line, "bindcode", strlen("bindcode")) == 0 ||
144  strncasecmp(line, "force_focus_wrapping", strlen("force_focus_wrapping")) == 0 ||
145  strncasecmp(line, "# i3 config file (v4)", strlen("# i3 config file (v4)")) == 0 ||
146  strncasecmp(line, "workspace_layout", strlen("workspace_layout")) == 0) {
147  printf("deciding for version 4 due to this line: %.*s\n", (int)(walk-line), line);
148  return 4;
149  }
150 
151  /* if this is a bind statement, we can check the command */
152  if (strncasecmp(line, "bind", strlen("bind")) == 0) {
153  char *bind = strchr(line, ' ');
154  if (bind == NULL)
155  goto next;
156  while ((*bind == ' ' || *bind == '\t') && *bind != '\0')
157  bind++;
158  if (*bind == '\0')
159  goto next;
160  if ((bind = strchr(bind, ' ')) == NULL)
161  goto next;
162  while ((*bind == ' ' || *bind == '\t') && *bind != '\0')
163  bind++;
164  if (*bind == '\0')
165  goto next;
166  if (strncasecmp(bind, "layout", strlen("layout")) == 0 ||
167  strncasecmp(bind, "floating", strlen("floating")) == 0 ||
168  strncasecmp(bind, "workspace", strlen("workspace")) == 0 ||
169  strncasecmp(bind, "focus left", strlen("focus left")) == 0 ||
170  strncasecmp(bind, "focus right", strlen("focus right")) == 0 ||
171  strncasecmp(bind, "focus up", strlen("focus up")) == 0 ||
172  strncasecmp(bind, "focus down", strlen("focus down")) == 0 ||
173  strncasecmp(bind, "border normal", strlen("border normal")) == 0 ||
174  strncasecmp(bind, "border 1pixel", strlen("border 1pixel")) == 0 ||
175  strncasecmp(bind, "border borderless", strlen("border borderless")) == 0 ||
176  strncasecmp(bind, "--no-startup-id", strlen("--no-startup-id")) == 0 ||
177  strncasecmp(bind, "bar", strlen("bar")) == 0) {
178  printf("deciding for version 4 due to this line: %.*s\n", (int)(walk-line), line);
179  return 4;
180  }
181  }
182 
183 next:
184  /* advance to the next line */
185  walk++;
186  line = walk;
187  }
188 
189  return 3;
190 }
191 
192 /*
193  * Calls i3-migrate-config-to-v4 to migrate a configuration file (input
194  * buffer).
195  *
196  * Returns the converted config file or NULL if there was an error (for
197  * example the script could not be found in $PATH or the i3 executable’s
198  * directory).
199  *
200  */
201 static char *migrate_config(char *input, off_t size) {
202  int writepipe[2];
203  int readpipe[2];
204 
205  if (pipe(writepipe) != 0 ||
206  pipe(readpipe) != 0) {
207  warn("migrate_config: Could not create pipes");
208  return NULL;
209  }
210 
211  pid_t pid = fork();
212  if (pid == -1) {
213  warn("Could not fork()");
214  return NULL;
215  }
216 
217  /* child */
218  if (pid == 0) {
219  /* close writing end of writepipe, connect reading side to stdin */
220  close(writepipe[1]);
221  dup2(writepipe[0], 0);
222 
223  /* close reading end of readpipe, connect writing side to stdout */
224  close(readpipe[0]);
225  dup2(readpipe[1], 1);
226 
227  static char *argv[] = {
228  NULL, /* will be replaced by the executable path */
229  NULL
230  };
231  exec_i3_utility("i3-migrate-config-to-v4", argv);
232  }
233 
234  /* parent */
235 
236  /* close reading end of the writepipe (connected to the script’s stdin) */
237  close(writepipe[0]);
238 
239  /* write the whole config file to the pipe, the script will read everything
240  * immediately */
241  int written = 0;
242  int ret;
243  while (written < size) {
244  if ((ret = write(writepipe[1], input + written, size - written)) < 0) {
245  warn("Could not write to pipe");
246  return NULL;
247  }
248  written += ret;
249  }
250  close(writepipe[1]);
251 
252  /* close writing end of the readpipe (connected to the script’s stdout) */
253  close(readpipe[1]);
254 
255  /* read the script’s output */
256  int conv_size = 65535;
257  char *converted = malloc(conv_size);
258  int read_bytes = 0;
259  do {
260  if (read_bytes == conv_size) {
261  conv_size += 65535;
262  converted = realloc(converted, conv_size);
263  }
264  ret = read(readpipe[0], converted + read_bytes, conv_size - read_bytes);
265  if (ret == -1) {
266  warn("Cannot read from pipe");
267  FREE(converted);
268  return NULL;
269  }
270  read_bytes += ret;
271  } while (ret > 0);
272 
273  /* get the returncode */
274  int status;
275  wait(&status);
276  if (!WIFEXITED(status)) {
277  fprintf(stderr, "Child did not terminate normally, using old config file (will lead to broken behaviour)\n");
278  return NULL;
279  }
280 
281  int returncode = WEXITSTATUS(status);
282  if (returncode != 0) {
283  fprintf(stderr, "Migration process exit code was != 0\n");
284  if (returncode == 2) {
285  fprintf(stderr, "could not start the migration script\n");
286  /* TODO: script was not found. tell the user to fix his system or create a v4 config */
287  } else if (returncode == 1) {
288  fprintf(stderr, "This already was a v4 config. Please add the following line to your config file:\n");
289  fprintf(stderr, "# i3 config file (v4)\n");
290  /* TODO: nag the user with a message to include a hint for i3 in his config file */
291  }
292  return NULL;
293  }
294 
295  return converted;
296 }
297 
298 /*
299  * Handler which will be called when we get a SIGCHLD for the nagbar, meaning
300  * it exited (or could not be started, depending on the exit code).
301  *
302  */
303 static void nagbar_exited(EV_P_ ev_child *watcher, int revents) {
304  ev_child_stop(EV_A_ watcher);
305  if (!WIFEXITED(watcher->rstatus)) {
306  fprintf(stderr, "ERROR: i3-nagbar did not exit normally.\n");
307  return;
308  }
309 
310  int exitcode = WEXITSTATUS(watcher->rstatus);
311  printf("i3-nagbar process exited with status %d\n", exitcode);
312  if (exitcode == 2) {
313  fprintf(stderr, "ERROR: i3-nagbar could not be found. Is it correctly installed on your system?\n");
314  }
315 
316  configerror_pid = -1;
317 }
318 
319 /* We need ev >= 4 for the following code. Since it is not *that* important (it
320  * only makes sure that there are no i3-nagbar instances left behind) we still
321  * support old systems with libev 3. */
322 #if EV_VERSION_MAJOR >= 4
323 /*
324  * Cleanup handler. Will be called when i3 exits. Kills i3-nagbar with signal
325  * SIGKILL (9) to make sure there are no left-over i3-nagbar processes.
326  *
327  */
328 static void nagbar_cleanup(EV_P_ ev_cleanup *watcher, int revent) {
329  if (configerror_pid != -1) {
330  LOG("Sending SIGKILL (9) to i3-nagbar with PID %d\n", configerror_pid);
331  kill(configerror_pid, SIGKILL);
332  }
333 }
334 #endif
335 
336 /*
337  * Starts an i3-nagbar process which alerts the user that his configuration
338  * file contains one or more errors. Also offers two buttons: One to launch an
339  * $EDITOR on the config file and another one to launch a $PAGER on the error
340  * logfile.
341  *
342  */
343 static void start_configerror_nagbar(const char *config_path) {
344  if (only_check_config)
345  return;
346 
347  fprintf(stderr, "Starting i3-nagbar due to configuration errors\n");
348  configerror_pid = fork();
349  if (configerror_pid == -1) {
350  warn("Could not fork()");
351  return;
352  }
353 
354  /* child */
355  if (configerror_pid == 0) {
356  char *editaction,
357  *pageraction;
358  sasprintf(&editaction, "i3-sensible-terminal -e sh -c \"i3-sensible-editor \\\"%s\\\" && i3-msg reload\"", config_path);
359  sasprintf(&pageraction, "i3-sensible-terminal -e i3-sensible-pager \"%s\"", errorfilename);
360  char *argv[] = {
361  NULL, /* will be replaced by the executable path */
362  "-t",
363  (context->has_errors ? "error" : "warning"),
364  "-m",
365  (context->has_errors ?
366  "You have an error in your i3 config file!" :
367  "Your config is outdated. Please fix the warnings to make sure everything works."),
368  "-b",
369  "edit config",
370  editaction,
371  (errorfilename ? "-b" : NULL),
372  (context->has_errors ? "show errors" : "show warnings"),
373  pageraction,
374  NULL
375  };
376  exec_i3_utility("i3-nagbar", argv);
377  }
378 
379  /* parent */
380  /* install a child watcher */
381  ev_child *child = smalloc(sizeof(ev_child));
382  ev_child_init(child, &nagbar_exited, configerror_pid, 0);
383  ev_child_start(main_loop, child);
384 
385 /* We need ev >= 4 for the following code. Since it is not *that* important (it
386  * only makes sure that there are no i3-nagbar instances left behind) we still
387  * support old systems with libev 3. */
388 #if EV_VERSION_MAJOR >= 4
389  /* install a cleanup watcher (will be called when i3 exits and i3-nagbar is
390  * still running) */
391  ev_cleanup *cleanup = smalloc(sizeof(ev_cleanup));
392  ev_cleanup_init(cleanup, nagbar_cleanup);
393  ev_cleanup_start(main_loop, cleanup);
394 #endif
395 }
396 
397 /*
398  * Kills the configerror i3-nagbar process, if any.
399  *
400  * Called when reloading/restarting.
401  *
402  * If wait_for_it is set (restarting), this function will waitpid(), otherwise,
403  * ev is assumed to handle it (reloading).
404  *
405  */
406 void kill_configerror_nagbar(bool wait_for_it) {
407  if (configerror_pid == -1)
408  return;
409 
410  if (kill(configerror_pid, SIGTERM) == -1)
411  warn("kill(configerror_nagbar) failed");
412 
413  if (!wait_for_it)
414  return;
415 
416  /* When restarting, we don’t enter the ev main loop anymore and after the
417  * exec(), our old pid is no longer watched. So, ev won’t handle SIGCHLD
418  * for us and we would end up with a <defunct> process. Therefore we
419  * waitpid() here. */
420  waitpid(configerror_pid, NULL, 0);
421 }
422 
423 /*
424  * Checks for duplicate key bindings (the same keycode or keysym is configured
425  * more than once). If a duplicate binding is found, a message is printed to
426  * stderr and the has_errors variable is set to true, which will start
427  * i3-nagbar.
428  *
429  */
430 static void check_for_duplicate_bindings(struct context *context) {
431  Binding *bind, *current;
432  TAILQ_FOREACH(current, bindings, bindings) {
434  /* Abort when we reach the current keybinding, only check the
435  * bindings before */
436  if (bind == current)
437  break;
438 
439  /* Check if one is using keysym while the other is using bindsym.
440  * If so, skip. */
441  /* XXX: It should be checked at a later place (when translating the
442  * keysym to keycodes) if there are any duplicates */
443  if ((bind->symbol == NULL && current->symbol != NULL) ||
444  (bind->symbol != NULL && current->symbol == NULL))
445  continue;
446 
447  /* If bind is NULL, current has to be NULL, too (see above).
448  * If the keycodes differ, it can't be a duplicate. */
449  if (bind->symbol != NULL &&
450  strcasecmp(bind->symbol, current->symbol) != 0)
451  continue;
452 
453  /* Check if the keycodes or modifiers are different. If so, they
454  * can't be duplicate */
455  if (bind->keycode != current->keycode ||
456  bind->mods != current->mods)
457  continue;
458  context->has_errors = true;
459  if (current->keycode != 0) {
460  ELOG("Duplicate keybinding in config file:\n modmask %d with keycode %d, command \"%s\"\n",
461  current->mods, current->keycode, current->command);
462  } else {
463  ELOG("Duplicate keybinding in config file:\n modmask %d with keysym %s, command \"%s\"\n",
464  current->mods, current->symbol, current->command);
465  }
466  }
467  }
468 }
469 
470 static void migrate_i3bar_exec(struct Autostart *exec) {
471  ELOG("**********************************************************************\n");
472  ELOG("IGNORING exec command: %s\n", exec->command);
473  ELOG("It contains \"i3bar\". Since i3 v4.1, i3bar will be automatically started\n");
474  ELOG("for each 'bar' configuration block in your i3 config. Please remove the exec\n");
475  ELOG("line and add the following to your i3 config:\n");
476  ELOG("\n");
477  ELOG(" bar {\n");
478  ELOG(" status_command i3status\n");
479  ELOG(" }\n");
480  ELOG("**********************************************************************\n");
481 
482  /* Generate a dummy bar configuration */
483  Barconfig *bar_config = scalloc(sizeof(Barconfig));
484  /* The hard-coded ID is not a problem. It does not conflict with the
485  * auto-generated bar IDs and having multiple hard-coded IDs is irrelevant
486  * – they all just contain status_command = i3status */
487  bar_config->id = sstrdup("migrate-bar");
488  bar_config->status_command = sstrdup("i3status");
489  TAILQ_INSERT_TAIL(&barconfigs, bar_config, configs);
490 
491  /* Trigger an i3-nagbar */
492  context->has_warnings = true;
493 }
494 
495 void parse_file(const char *f) {
496  SLIST_HEAD(variables_head, Variable) variables = SLIST_HEAD_INITIALIZER(&variables);
497  int fd, ret, read_bytes = 0;
498  struct stat stbuf;
499  char *buf;
500  FILE *fstr;
501  char buffer[1026], key[512], value[512];
502 
503  if ((fd = open(f, O_RDONLY)) == -1)
504  die("Could not open configuration file: %s\n", strerror(errno));
505 
506  if (fstat(fd, &stbuf) == -1)
507  die("Could not fstat file: %s\n", strerror(errno));
508 
509  buf = scalloc((stbuf.st_size + 1) * sizeof(char));
510  while (read_bytes < stbuf.st_size) {
511  if ((ret = read(fd, buf + read_bytes, (stbuf.st_size - read_bytes))) < 0)
512  die("Could not read(): %s\n", strerror(errno));
513  read_bytes += ret;
514  }
515 
516  if (lseek(fd, 0, SEEK_SET) == (off_t)-1)
517  die("Could not lseek: %s\n", strerror(errno));
518 
519  if ((fstr = fdopen(fd, "r")) == NULL)
520  die("Could not fdopen: %s\n", strerror(errno));
521 
522  while (!feof(fstr)) {
523  if (fgets(buffer, 1024, fstr) == NULL) {
524  if (feof(fstr))
525  break;
526  die("Could not read configuration file\n");
527  }
528 
529  /* sscanf implicitly strips whitespace. Also, we skip comments and empty lines. */
530  if (sscanf(buffer, "%s %[^\n]", key, value) < 1 ||
531  key[0] == '#' || strlen(key) < 3)
532  continue;
533 
534  if (strcasecmp(key, "set") == 0) {
535  if (value[0] != '$') {
536  ELOG("Malformed variable assignment, name has to start with $\n");
537  continue;
538  }
539 
540  /* get key/value for this variable */
541  char *v_key = value, *v_value;
542  if (strstr(value, " ") == NULL && strstr(value, "\t") == NULL) {
543  ELOG("Malformed variable assignment, need a value\n");
544  continue;
545  }
546 
547  if (!(v_value = strstr(value, " ")))
548  v_value = strstr(value, "\t");
549 
550  *(v_value++) = '\0';
551  while (*v_value == '\t' || *v_value == ' ')
552  v_value++;
553 
554  struct Variable *new = scalloc(sizeof(struct Variable));
555  new->key = sstrdup(v_key);
556  new->value = sstrdup(v_value);
557  SLIST_INSERT_HEAD(&variables, new, variables);
558  DLOG("Got new variable %s = %s\n", v_key, v_value);
559  continue;
560  }
561  }
562  fclose(fstr);
563 
564  /* For every custom variable, see how often it occurs in the file and
565  * how much extra bytes it requires when replaced. */
566  struct Variable *current, *nearest;
567  int extra_bytes = 0;
568  /* We need to copy the buffer because we need to invalidate the
569  * variables (otherwise we will count them twice, which is bad when
570  * 'extra' is negative) */
571  char *bufcopy = sstrdup(buf);
572  SLIST_FOREACH(current, &variables, variables) {
573  int extra = (strlen(current->value) - strlen(current->key));
574  char *next;
575  for (next = bufcopy;
576  next < (bufcopy + stbuf.st_size) &&
577  (next = strcasestr(next, current->key)) != NULL;
578  next += strlen(current->key)) {
579  *next = '_';
580  extra_bytes += extra;
581  }
582  }
583  FREE(bufcopy);
584 
585  /* Then, allocate a new buffer and copy the file over to the new one,
586  * but replace occurences of our variables */
587  char *walk = buf, *destwalk;
588  char *new = smalloc((stbuf.st_size + extra_bytes + 1) * sizeof(char));
589  destwalk = new;
590  while (walk < (buf + stbuf.st_size)) {
591  /* Find the next variable */
592  SLIST_FOREACH(current, &variables, variables)
593  current->next_match = strcasestr(walk, current->key);
594  nearest = NULL;
595  int distance = stbuf.st_size;
596  SLIST_FOREACH(current, &variables, variables) {
597  if (current->next_match == NULL)
598  continue;
599  if ((current->next_match - walk) < distance) {
600  distance = (current->next_match - walk);
601  nearest = current;
602  }
603  }
604  if (nearest == NULL) {
605  /* If there are no more variables, we just copy the rest */
606  strncpy(destwalk, walk, (buf + stbuf.st_size) - walk);
607  destwalk += (buf + stbuf.st_size) - walk;
608  *destwalk = '\0';
609  break;
610  } else {
611  /* Copy until the next variable, then copy its value */
612  strncpy(destwalk, walk, distance);
613  strncpy(destwalk + distance, nearest->value, strlen(nearest->value));
614  walk += distance + strlen(nearest->key);
615  destwalk += distance + strlen(nearest->value);
616  }
617  }
618 
619  /* analyze the string to find out whether this is an old config file (3.x)
620  * or a new config file (4.x). If it’s old, we run the converter script. */
621  int version = detect_version(buf);
622  if (version == 3) {
623  /* We need to convert this v3 configuration */
624  char *converted = migrate_config(new, stbuf.st_size);
625  if (converted != NULL) {
626  ELOG("\n");
627  ELOG("****************************************************************\n");
628  ELOG("NOTE: Automatically converted configuration file from v3 to v4.\n");
629  ELOG("\n");
630  ELOG("Please convert your config file to v4. You can use this command:\n");
631  ELOG(" mv %s %s.O\n", f, f);
632  ELOG(" i3-migrate-config-to-v4 %s.O > %s\n", f, f);
633  ELOG("****************************************************************\n");
634  ELOG("\n");
635  free(new);
636  new = converted;
637  } else {
638  printf("\n");
639  printf("**********************************************************************\n");
640  printf("ERROR: Could not convert config file. Maybe i3-migrate-config-to-v4\n");
641  printf("was not correctly installed on your system?\n");
642  printf("**********************************************************************\n");
643  printf("\n");
644  }
645  }
646 
647  /* now lex/parse it */
648  yy_scan_string(new);
649 
650  context = scalloc(sizeof(struct context));
651  context->filename = f;
652 
653  if (yyparse() != 0) {
654  fprintf(stderr, "Could not parse configfile\n");
655  exit(1);
656  }
657 
659 
660  /* XXX: The following code will be removed in i3 v4.3 (three releases from
661  * now, as of 2011-10-22) */
662  /* Check for any exec or exec_always lines starting i3bar. We remove these
663  * and add a bar block instead. Additionally, a i3-nagbar warning (not an
664  * error) will be displayed so that users update their config file. */
665  struct Autostart *exec, *next;
666  for (exec = TAILQ_FIRST(&autostarts); exec; ) {
667  next = TAILQ_NEXT(exec, autostarts);
668  if (strstr(exec->command, "i3bar") != NULL) {
669  migrate_i3bar_exec(exec);
671  }
672  exec = next;
673  }
674 
675  for (exec = TAILQ_FIRST(&autostarts_always); exec; ) {
676  next = TAILQ_NEXT(exec, autostarts_always);
677  if (strstr(exec->command, "i3bar") != NULL) {
678  migrate_i3bar_exec(exec);
680  }
681  exec = next;
682  }
683 
684  if (context->has_errors || context->has_warnings) {
685  ELOG("FYI: You are using i3 version " I3_VERSION "\n");
686  if (version == 3)
687  ELOG("Please convert your configfile first, then fix any remaining errors (see above).\n");
689  }
690 
691  yylex_destroy();
692  FREE(context->line_copy);
693  free(context);
695  free(new);
696  free(buf);
697 
698  while (!SLIST_EMPTY(&variables)) {
699  current = SLIST_FIRST(&variables);
700  FREE(current->key);
701  FREE(current->value);
702  SLIST_REMOVE_HEAD(&variables, variables);
703  FREE(current);
704  }
705 }
706 
707 
708 
709 /* Line 268 of yacc.c */
710 #line 711 "src/cfgparse.tab.c"
711 
712 /* Enabling traces. */
713 #ifndef YYDEBUG
714 # define YYDEBUG 1
715 #endif
716 
717 /* Enabling verbose error messages. */
718 #ifdef YYERROR_VERBOSE
719 # undef YYERROR_VERBOSE
720 # define YYERROR_VERBOSE 1
721 #else
722 # define YYERROR_VERBOSE 1
723 #endif
724 
725 /* Enabling the token table. */
726 #ifndef YYTOKEN_TABLE
727 # define YYTOKEN_TABLE 0
728 #endif
729 
730 
731 /* Tokens. */
732 #ifndef YYTOKENTYPE
733 # define YYTOKENTYPE
734  /* Put the tokens into the symbol table, so that GDB and other debuggers
735  know about them. */
736  enum yytokentype {
737  NUMBER = 258,
738  WORD = 259,
739  STR = 260,
740  STR_NG = 261,
741  HEXCOLOR = 262,
742  OUTPUT = 263,
743  TOKBINDCODE = 264,
744  TOKTERMINAL = 265,
745  TOKCOMMENT = 266,
746  TOKFONT = 267,
747  TOKBINDSYM = 268,
748  MODIFIER = 269,
749  TOKCONTROL = 270,
750  TOKSHIFT = 271,
756  TOKOUTPUT = 277,
757  TOKASSIGN = 278,
758  TOKSET = 279,
761  TOKEXEC = 282,
764  TOKCOLOR = 285,
765  TOKARROW = 286,
766  TOKMODE = 287,
767  TOK_BAR = 288,
769  TOK_HORIZ = 290,
770  TOK_VERT = 291,
771  TOK_AUTO = 292,
774  TOKNEWFLOAT = 295,
775  TOK_NORMAL = 296,
776  TOK_NONE = 297,
777  TOK_1PIXEL = 298,
784  TOK_DEFAULT = 305,
786  TOK_TABBED = 307,
789  TOK_IGNORE = 310,
808  TOK_BAR_TOP = 329,
822  TOK_MARK = 343,
823  TOK_CLASS = 344,
826  TOK_ID = 347,
827  TOK_CON_ID = 348,
828  TOK_TITLE = 349,
830  };
831 #endif
832 
833 
834 
835 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
836 typedef union YYSTYPE
837 {
838 
839 /* Line 293 of yacc.c */
840 #line 643 "src/cfgparse.y"
841 
842  int number;
843  char *string;
844  uint32_t *single_color;
847  struct Binding *binding;
848 
849 
850 
851 /* Line 293 of yacc.c */
852 #line 853 "src/cfgparse.tab.c"
853 } YYSTYPE;
854 # define YYSTYPE_IS_TRIVIAL 1
855 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
856 # define YYSTYPE_IS_DECLARED 1
857 #endif
858 
859 
860 /* Copy the second part of user declarations. */
861 
862 
863 /* Line 343 of yacc.c */
864 #line 865 "src/cfgparse.tab.c"
865 
866 #ifdef short
867 # undef short
868 #endif
869 
870 #ifdef YYTYPE_UINT8
871 typedef YYTYPE_UINT8 yytype_uint8;
872 #else
873 typedef unsigned char yytype_uint8;
874 #endif
875 
876 #ifdef YYTYPE_INT8
877 typedef YYTYPE_INT8 yytype_int8;
878 #elif (defined __STDC__ || defined __C99__FUNC__ \
879  || defined __cplusplus || defined _MSC_VER)
880 typedef signed char yytype_int8;
881 #else
882 typedef short int yytype_int8;
883 #endif
884 
885 #ifdef YYTYPE_UINT16
886 typedef YYTYPE_UINT16 yytype_uint16;
887 #else
888 typedef unsigned short int yytype_uint16;
889 #endif
890 
891 #ifdef YYTYPE_INT16
892 typedef YYTYPE_INT16 yytype_int16;
893 #else
894 typedef short int yytype_int16;
895 #endif
896 
897 #ifndef YYSIZE_T
898 # ifdef __SIZE_TYPE__
899 # define YYSIZE_T __SIZE_TYPE__
900 # elif defined size_t
901 # define YYSIZE_T size_t
902 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
903  || defined __cplusplus || defined _MSC_VER)
904 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
905 # define YYSIZE_T size_t
906 # else
907 # define YYSIZE_T unsigned int
908 # endif
909 #endif
910 
911 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
912 
913 #ifndef YY_
914 # if defined YYENABLE_NLS && YYENABLE_NLS
915 # if ENABLE_NLS
916 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
917 # define YY_(msgid) dgettext ("bison-runtime", msgid)
918 # endif
919 # endif
920 # ifndef YY_
921 # define YY_(msgid) msgid
922 # endif
923 #endif
924 
925 /* Suppress unused-variable warnings by "using" E. */
926 #if ! defined lint || defined __GNUC__
927 # define YYUSE(e) ((void) (e))
928 #else
929 # define YYUSE(e) /* empty */
930 #endif
931 
932 /* Identity function, used to suppress warnings about constant conditions. */
933 #ifndef lint
934 # define YYID(n) (n)
935 #else
936 #if (defined __STDC__ || defined __C99__FUNC__ \
937  || defined __cplusplus || defined _MSC_VER)
938 static int
939 YYID (int yyi)
940 #else
941 static int
942 YYID (yyi)
943  int yyi;
944 #endif
945 {
946  return yyi;
947 }
948 #endif
949 
950 #if ! defined yyoverflow || YYERROR_VERBOSE
951 
952 /* The parser invokes alloca or malloc; define the necessary symbols. */
953 
954 # ifdef YYSTACK_USE_ALLOCA
955 # if YYSTACK_USE_ALLOCA
956 # ifdef __GNUC__
957 # define YYSTACK_ALLOC __builtin_alloca
958 # elif defined __BUILTIN_VA_ARG_INCR
959 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
960 # elif defined _AIX
961 # define YYSTACK_ALLOC __alloca
962 # elif defined _MSC_VER
963 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
964 # define alloca _alloca
965 # else
966 # define YYSTACK_ALLOC alloca
967 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
968  || defined __cplusplus || defined _MSC_VER)
969 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
970 # ifndef EXIT_SUCCESS
971 # define EXIT_SUCCESS 0
972 # endif
973 # endif
974 # endif
975 # endif
976 # endif
977 
978 # ifdef YYSTACK_ALLOC
979  /* Pacify GCC's `empty if-body' warning. */
980 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
981 # ifndef YYSTACK_ALLOC_MAXIMUM
982  /* The OS might guarantee only one guard page at the bottom of the stack,
983  and a page size can be as small as 4096 bytes. So we cannot safely
984  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
985  to allow for a few compiler-allocated temporary stack slots. */
986 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
987 # endif
988 # else
989 # define YYSTACK_ALLOC YYMALLOC
990 # define YYSTACK_FREE YYFREE
991 # ifndef YYSTACK_ALLOC_MAXIMUM
992 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
993 # endif
994 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
995  && ! ((defined YYMALLOC || defined malloc) \
996  && (defined YYFREE || defined free)))
997 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
998 # ifndef EXIT_SUCCESS
999 # define EXIT_SUCCESS 0
1000 # endif
1001 # endif
1002 # ifndef YYMALLOC
1003 # define YYMALLOC malloc
1004 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
1005  || defined __cplusplus || defined _MSC_VER)
1006 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1007 # endif
1008 # endif
1009 # ifndef YYFREE
1010 # define YYFREE free
1011 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
1012  || defined __cplusplus || defined _MSC_VER)
1013 void free (void *); /* INFRINGES ON USER NAME SPACE */
1014 # endif
1015 # endif
1016 # endif
1017 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1018 
1019 
1020 #if (! defined yyoverflow \
1021  && (! defined __cplusplus \
1022  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1023 
1024 /* A type that is properly aligned for any stack member. */
1025 union yyalloc
1026 {
1027  yytype_int16 yyss_alloc;
1029 };
1030 
1031 /* The size of the maximum gap between one aligned stack and the next. */
1032 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1033 
1034 /* The size of an array large to enough to hold all stacks, each with
1035  N elements. */
1036 # define YYSTACK_BYTES(N) \
1037  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1038  + YYSTACK_GAP_MAXIMUM)
1039 
1040 # define YYCOPY_NEEDED 1
1041 
1042 /* Relocate STACK from its old location to the new one. The
1043  local variables YYSIZE and YYSTACKSIZE give the old and new number of
1044  elements in the stack, and YYPTR gives the new location of the
1045  stack. Advance YYPTR to a properly aligned location for the next
1046  stack. */
1047 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
1048  do \
1049  { \
1050  YYSIZE_T yynewbytes; \
1051  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
1052  Stack = &yyptr->Stack_alloc; \
1053  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1054  yyptr += yynewbytes / sizeof (*yyptr); \
1055  } \
1056  while (YYID (0))
1057 
1058 #endif
1059 
1060 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
1061 /* Copy COUNT objects from FROM to TO. The source and destination do
1062  not overlap. */
1063 # ifndef YYCOPY
1064 # if defined __GNUC__ && 1 < __GNUC__
1065 # define YYCOPY(To, From, Count) \
1066  __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1067 # else
1068 # define YYCOPY(To, From, Count) \
1069  do \
1070  { \
1071  YYSIZE_T yyi; \
1072  for (yyi = 0; yyi < (Count); yyi++) \
1073  (To)[yyi] = (From)[yyi]; \
1074  } \
1075  while (YYID (0))
1076 # endif
1077 # endif
1078 #endif /* !YYCOPY_NEEDED */
1079 
1080 /* YYFINAL -- State number of the termination state. */
1081 #define YYFINAL 2
1082 /* YYLAST -- Last index in YYTABLE. */
1083 #define YYLAST 225
1084 
1085 /* YYNTOKENS -- Number of terminals. */
1086 #define YYNTOKENS 102
1087 /* YYNNTS -- Number of nonterminals. */
1088 #define YYNNTS 80
1089 /* YYNRULES -- Number of rules. */
1090 #define YYNRULES 177
1091 /* YYNRULES -- Number of states. */
1092 #define YYNSTATES 268
1093 
1094 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1095 #define YYUNDEFTOK 2
1096 #define YYMAXUTOK 350
1097 
1098 #define YYTRANSLATE(YYX) \
1099  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1100 
1101 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1102 static const yytype_uint8 yytranslate[] =
1103 {
1104  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1105  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1106  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1107  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1108  2, 2, 2, 101, 2, 2, 2, 2, 2, 2,
1109  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1110  2, 98, 2, 2, 2, 2, 2, 2, 2, 2,
1111  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1112  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1113  2, 96, 2, 97, 2, 2, 2, 2, 2, 2,
1114  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1115  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1116  2, 2, 2, 99, 2, 100, 2, 2, 2, 2,
1117  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1118  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1119  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1120  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1121  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1122  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1123  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1124  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1125  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1126  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1127  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1128  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1129  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1130  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1131  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1132  25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1133  35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1134  45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1135  55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1136  65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1137  75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1138  85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1139  95
1140 };
1141 
1142 #if YYDEBUG
1143 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1144  YYRHS. */
1145 static const yytype_uint16 yyprhs[] =
1146 {
1147  0, 0, 3, 4, 7, 10, 12, 14, 16, 18,
1148  20, 22, 24, 26, 28, 30, 32, 34, 36, 38,
1149  40, 42, 44, 46, 48, 50, 52, 54, 56, 58,
1150  60, 62, 64, 66, 68, 70, 72, 74, 77, 80,
1151  84, 88, 92, 93, 97, 99, 101, 104, 106, 110,
1152  114, 118, 122, 126, 130, 134, 138, 140, 142, 144,
1153  146, 152, 153, 156, 158, 160, 165, 166, 169, 171,
1154  173, 175, 177, 179, 181, 183, 185, 187, 189, 191,
1155  193, 195, 197, 199, 201, 203, 205, 207, 210, 213,
1156  216, 219, 222, 224, 226, 229, 231, 233, 236, 238,
1157  240, 242, 244, 246, 248, 250, 253, 256, 259, 262,
1158  267, 270, 273, 277, 282, 286, 291, 295, 300, 304,
1159  309, 314, 319, 322, 325, 327, 329, 331, 334, 339,
1160  341, 343, 345, 348, 351, 353, 355, 357, 359, 361,
1161  364, 367, 370, 373, 376, 379, 385, 389, 390, 392,
1162  394, 396, 398, 402, 406, 408, 410, 413, 416, 420,
1163  424, 425, 427, 430, 433, 436, 441, 447, 449, 450,
1164  452, 456, 459, 461, 463, 465, 468, 470
1165 };
1166 
1167 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1168 static const yytype_int16 yyrhs[] =
1169 {
1170  103, 0, -1, -1, 103, 1, -1, 103, 104, -1,
1171  107, -1, 111, -1, 119, -1, 122, -1, 146, -1,
1172  147, -1, 148, -1, 149, -1, 151, -1, 153, -1,
1173  154, -1, 157, -1, 158, -1, 159, -1, 160, -1,
1174  161, -1, 162, -1, 163, -1, 166, -1, 168, -1,
1175  169, -1, 170, -1, 171, -1, 175, -1, 176, -1,
1176  173, -1, 174, -1, 105, -1, 180, -1, 11, -1,
1177  5, -1, 108, -1, 9, 109, -1, 13, 110, -1,
1178  178, 3, 106, -1, 178, 118, 106, -1, 57, 112,
1179  106, -1, -1, 113, 115, 114, -1, 96, -1, 97,
1180  -1, 115, 116, -1, 116, -1, 89, 98, 5, -1,
1181  90, 98, 5, -1, 91, 98, 5, -1, 93, 98,
1182  5, -1, 92, 98, 5, -1, 88, 98, 5, -1,
1183  94, 98, 5, -1, 95, 98, 5, -1, 20, -1,
1184  3, -1, 4, -1, 3, -1, 32, 20, 99, 120,
1185  100, -1, -1, 120, 121, -1, 105, -1, 108, -1,
1186  33, 99, 123, 100, -1, -1, 123, 124, -1, 105,
1187  -1, 125, -1, 126, -1, 127, -1, 128, -1, 129,
1188  -1, 131, -1, 133, -1, 135, -1, 136, -1, 137,
1189  -1, 138, -1, 139, -1, 140, -1, 141, -1, 142,
1190  -1, 143, -1, 144, -1, 145, -1, 75, 5, -1,
1191  76, 5, -1, 58, 5, -1, 59, 5, -1, 72,
1192  130, -1, 74, -1, 73, -1, 61, 132, -1, 62,
1193  -1, 63, -1, 64, 134, -1, 65, -1, 66, -1,
1194  67, -1, 68, -1, 69, -1, 70, -1, 71, -1,
1195  77, 5, -1, 78, 156, -1, 79, 156, -1, 60,
1196  5, -1, 80, 99, 123, 100, -1, 81, 7, -1,
1197  82, 7, -1, 83, 7, 7, -1, 83, 7, 7,
1198  7, -1, 84, 7, 7, -1, 84, 7, 7, 7,
1199  -1, 85, 7, 7, -1, 85, 7, 7, 7, -1,
1200  86, 7, 7, -1, 86, 7, 7, 7, -1, 18,
1201  3, 4, 3, -1, 19, 3, 4, 3, -1, 17,
1202  178, -1, 34, 150, -1, 35, -1, 36, -1, 37,
1203  -1, 38, 152, -1, 38, 53, 53, 3, -1, 50,
1204  -1, 51, -1, 52, -1, 39, 155, -1, 40, 155,
1205  -1, 41, -1, 42, -1, 43, -1, 3, -1, 4,
1206  -1, 44, 156, -1, 45, 156, -1, 46, 156, -1,
1207  47, 5, -1, 48, 156, -1, 49, 156, -1, 21,
1208  117, 22, 8, 164, -1, 21, 3, 165, -1, -1,
1209  165, -1, 20, -1, 5, -1, 4, -1, 23, 167,
1210  5, -1, 23, 112, 5, -1, 20, -1, 6, -1,
1211  25, 5, -1, 26, 5, -1, 27, 172, 5, -1,
1212  28, 172, 5, -1, -1, 87, -1, 10, 5, -1,
1213  12, 5, -1, 29, 177, -1, 30, 177, 177, 177,
1214  -1, 30, 177, 177, 177, 177, -1, 7, -1, -1,
1215  179, -1, 178, 101, 179, -1, 178, 101, -1, 14,
1216  -1, 15, -1, 16, -1, 54, 181, -1, 55, -1,
1217  56, -1
1218 };
1219 
1220 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1221 static const yytype_uint16 yyrline[] =
1222 {
1223  0, 774, 774, 775, 776, 780, 781, 782, 783, 784,
1224  785, 786, 787, 788, 789, 790, 791, 792, 793, 794,
1225  795, 796, 797, 798, 799, 800, 801, 802, 803, 804,
1226  805, 806, 807, 808, 812, 816, 820, 827, 828, 832,
1227  846, 860, 875, 876, 883, 891, 898, 899, 903, 909,
1228  915, 921, 936, 951, 957, 963, 980, 981, 985, 986,
1229  993, 1016, 1018, 1022, 1023, 1035, 1062, 1064, 1068, 1069,
1230  1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079,
1231  1080, 1081, 1082, 1083, 1084, 1085, 1086, 1090, 1099, 1108,
1232  1119, 1128, 1136, 1137, 1141, 1149, 1150, 1154, 1161, 1162,
1233  1163, 1164, 1165, 1166, 1167, 1171, 1180, 1190, 1198, 1207,
1234  1216, 1224, 1232, 1239, 1250, 1257, 1268, 1275, 1285, 1292,
1235  1302, 1312, 1322, 1330, 1338, 1339, 1340, 1344, 1368, 1389,
1236  1390, 1391, 1395, 1403, 1411, 1412, 1413, 1417, 1421, 1433,
1237  1441, 1449, 1457, 1465, 1473, 1481, 1515, 1533, 1534, 1538,
1238  1539, 1540, 1544, 1606, 1622, 1623, 1627, 1634, 1641, 1651,
1239  1661, 1662, 1666, 1674, 1685, 1693, 1701, 1713, 1722, 1723,
1240  1724, 1725, 1729, 1730, 1731, 1735, 1743, 1744
1241 };
1242 #endif
1243 
1244 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1245 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1246  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1247 static const char *const yytname[] =
1248 {
1249  "$end", "error", "$undefined", "\"<number>\"", "\"<word>\"",
1250  "\"<string>\"", "\"<string (non-greedy)>\"", "\"#<hex>\"",
1251  "\"<RandR output>\"", "TOKBINDCODE", "TOKTERMINAL", "\"<comment>\"",
1252  "\"font\"", "\"bindsym\"", "\"<modifier>\"", "\"control\"", "\"shift\"",
1253  "\"floating_modifier\"", "\"floating_maximum_size\"",
1254  "\"floating_minimum_size\"", "\"<quoted string>\"", "\"workspace\"",
1255  "\"output\"", "\"assign\"", "TOKSET", "\"ipc_socket\"",
1256  "\"restart_state\"", "\"exec\"", "\"exec_always\"", "TOKSINGLECOLOR",
1257  "TOKCOLOR", "\"\\342\\206\\222\"", "\"mode\"", "\"bar\"",
1258  "\"default_orientation\"", "\"horizontal\"", "\"vertical\"", "\"auto\"",
1259  "\"workspace_layout\"", "\"new_window\"", "\"new_float\"", "\"normal\"",
1260  "\"none\"", "\"1pixel\"", "\"focus_follows_mouse\"",
1261  "\"force_focus_wrapping\"", "\"force_xinerama\"", "\"fake_outputs\"",
1262  "\"workspace_auto_back_and_forth\"", "\"workspace_bar\"", "\"default\"",
1263  "\"stacking\"", "\"tabbed\"", "\"stack-limit\"",
1264  "\"popup_during_fullscreen\"", "\"ignore\"", "\"leave_fullscreen\"",
1265  "\"for_window\"", "\"output (bar)\"", "\"tray_output\"",
1266  "\"socket_path\"", "\"mode (bar)\"", "\"hide\"", "\"dock\"",
1267  "\"modifier (bar)\"", "\"shift (bar)\"", "\"control (bar)\"", "\"Mod1\"",
1268  "\"Mod2\"", "\"Mod3\"", "\"Mod4\"", "\"Mod5\"", "\"position\"",
1269  "\"bottom\"", "\"top\"", "\"status_command\"", "\"i3bar_command\"",
1270  "\"font (bar)\"", "\"workspace_buttons\"", "\"verbose\"", "\"colors\"",
1271  "\"background\"", "\"statusline\"", "\"focused_workspace\"",
1272  "\"active_workspace\"", "\"inactive_workspace\"", "\"urgent_workspace\"",
1273  "\"--no-startup-id\"", "\"mark\"", "\"class\"", "\"instance\"",
1274  "\"window_role\"", "\"id\"", "\"con_id\"", "\"title\"", "\"urgent\"",
1275  "'['", "']'", "'='", "'{'", "'}'", "'+'", "$accept", "lines", "line",
1276  "comment", "command", "bindline", "binding", "bindcode", "bindsym",
1277  "for_window", "match", "matchstart", "matchend", "criteria", "criterion",
1278  "qstring_or_number", "word_or_number", "mode", "modelines", "modeline",
1279  "bar", "barlines", "barline", "bar_status_command", "bar_i3bar_command",
1280  "bar_output", "bar_tray_output", "bar_position", "bar_position_position",
1281  "bar_mode", "bar_mode_mode", "bar_modifier", "bar_modifier_modifier",
1282  "bar_font", "bar_workspace_buttons", "bar_verbose", "bar_socket_path",
1283  "bar_colors", "bar_color_background", "bar_color_statusline",
1284  "bar_color_focused_workspace", "bar_color_active_workspace",
1285  "bar_color_inactive_workspace", "bar_color_urgent_workspace",
1286  "floating_maximum_size", "floating_minimum_size", "floating_modifier",
1287  "orientation", "direction", "workspace_layout", "layout_mode",
1288  "new_window", "new_float", "border_style", "bool", "focus_follows_mouse",
1289  "force_focus_wrapping", "force_xinerama", "fake_outputs",
1290  "workspace_back_and_forth", "workspace_bar", "workspace",
1291  "optional_workspace_name", "workspace_name", "assign", "window_class",
1292  "ipcsocket", "restart_state", "exec", "exec_always",
1293  "optional_no_startup_id", "terminal", "font", "single_color", "color",
1294  "colorpixel", "binding_modifiers", "binding_modifier",
1295  "popup_during_fullscreen", "popup_setting", 0
1296 };
1297 #endif
1298 
1299 # ifdef YYPRINT
1300 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1301  token YYLEX-NUM. */
1302 static const yytype_uint16 yytoknum[] =
1303 {
1304  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1305  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1306  275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1307  285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1308  295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1309  305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1310  315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1311  325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1312  335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1313  345, 346, 347, 348, 349, 350, 91, 93, 61, 123,
1314  125, 43
1315 };
1316 # endif
1317 
1318 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1319 static const yytype_uint8 yyr1[] =
1320 {
1321  0, 102, 103, 103, 103, 104, 104, 104, 104, 104,
1322  104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
1323  104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
1324  104, 104, 104, 104, 105, 106, 107, 108, 108, 109,
1325  110, 111, 112, 112, 113, 114, 115, 115, 116, 116,
1326  116, 116, 116, 116, 116, 116, 117, 117, 118, 118,
1327  119, 120, 120, 121, 121, 122, 123, 123, 124, 124,
1328  124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
1329  124, 124, 124, 124, 124, 124, 124, 125, 126, 127,
1330  128, 129, 130, 130, 131, 132, 132, 133, 134, 134,
1331  134, 134, 134, 134, 134, 135, 136, 137, 138, 139,
1332  140, 141, 142, 142, 143, 143, 144, 144, 145, 145,
1333  146, 147, 148, 149, 150, 150, 150, 151, 151, 152,
1334  152, 152, 153, 154, 155, 155, 155, 156, 156, 157,
1335  158, 159, 160, 161, 162, 163, 163, 164, 164, 165,
1336  165, 165, 166, 166, 167, 167, 168, 169, 170, 171,
1337  172, 172, 173, 174, 175, 176, 176, 177, 178, 178,
1338  178, 178, 179, 179, 179, 180, 181, 181
1339 };
1340 
1341 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1342 static const yytype_uint8 yyr2[] =
1343 {
1344  0, 2, 0, 2, 2, 1, 1, 1, 1, 1,
1345  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1346  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1347  1, 1, 1, 1, 1, 1, 1, 2, 2, 3,
1348  3, 3, 0, 3, 1, 1, 2, 1, 3, 3,
1349  3, 3, 3, 3, 3, 3, 1, 1, 1, 1,
1350  5, 0, 2, 1, 1, 4, 0, 2, 1, 1,
1351  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1352  1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
1353  2, 2, 1, 1, 2, 1, 1, 2, 1, 1,
1354  1, 1, 1, 1, 1, 2, 2, 2, 2, 4,
1355  2, 2, 3, 4, 3, 4, 3, 4, 3, 4,
1356  4, 4, 2, 2, 1, 1, 1, 2, 4, 1,
1357  1, 1, 2, 2, 1, 1, 1, 1, 1, 2,
1358  2, 2, 2, 2, 2, 5, 3, 0, 1, 1,
1359  1, 1, 3, 3, 1, 1, 2, 2, 3, 3,
1360  0, 1, 2, 2, 2, 4, 5, 1, 0, 1,
1361  3, 2, 1, 1, 1, 2, 1, 1
1362 };
1363 
1364 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
1365  Performed when YYTABLE doesn't specify something else to do. Zero
1366  means the default is an error. */
1367 static const yytype_uint8 yydefact[] =
1368 {
1369  2, 0, 1, 3, 168, 0, 34, 0, 168, 168,
1370  0, 0, 0, 42, 0, 0, 160, 160, 0, 0,
1371  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1372  0, 0, 0, 42, 4, 32, 5, 36, 6, 7,
1373  8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
1374  18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
1375  30, 31, 28, 29, 33, 172, 173, 174, 37, 0,
1376  169, 162, 163, 38, 0, 122, 0, 0, 57, 56,
1377  0, 155, 154, 44, 0, 0, 0, 156, 157, 161,
1378  0, 0, 167, 164, 0, 0, 66, 124, 125, 126,
1379  123, 129, 130, 131, 0, 127, 134, 135, 136, 132,
1380  133, 137, 138, 139, 140, 141, 142, 143, 144, 176,
1381  177, 175, 0, 0, 171, 59, 58, 0, 0, 0,
1382  151, 150, 149, 146, 0, 153, 0, 0, 0, 0,
1383  0, 0, 0, 0, 0, 47, 152, 158, 159, 0,
1384  61, 0, 0, 35, 41, 39, 170, 40, 120, 121,
1385  147, 0, 0, 0, 0, 0, 0, 0, 0, 45,
1386  43, 46, 165, 0, 0, 0, 0, 0, 0, 0,
1387  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1388  0, 0, 65, 68, 67, 69, 70, 71, 72, 73,
1389  74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
1390  84, 85, 86, 128, 145, 148, 53, 48, 49, 50,
1391  52, 51, 54, 55, 166, 60, 63, 64, 62, 89,
1392  90, 108, 95, 96, 94, 98, 99, 100, 101, 102,
1393  103, 104, 97, 93, 92, 91, 87, 88, 105, 106,
1394  107, 66, 110, 111, 0, 0, 0, 0, 0, 112,
1395  114, 116, 118, 109, 113, 115, 117, 119
1396 };
1397 
1398 /* YYDEFGOTO[NTERM-NUM]. */
1399 static const yytype_int16 yydefgoto[] =
1400 {
1401  -1, 1, 34, 193, 154, 36, 37, 68, 73, 38,
1402  84, 85, 170, 144, 145, 80, 127, 39, 173, 228,
1403  40, 151, 194, 195, 196, 197, 198, 199, 245, 200,
1404  234, 201, 242, 202, 203, 204, 205, 206, 207, 208,
1405  209, 210, 211, 212, 41, 42, 43, 44, 100, 45,
1406  105, 46, 47, 109, 113, 48, 49, 50, 51, 52,
1407  53, 54, 214, 133, 55, 86, 56, 57, 58, 59,
1408  90, 60, 61, 62, 63, 93, 69, 70, 64, 121
1409 };
1410 
1411 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1412  STATE-NUM. */
1413 #define YYPACT_NINF -83
1414 static const yytype_int16 yypact[] =
1415 {
1416  -83, 150, -83, -83, 43, 10, -83, 72, 43, 43,
1417  77, 78, 11, 6, 89, 94, -77, -77, 96, 96,
1418  85, 9, 25, -23, 31, 31, 40, 40, 40, 105,
1419  40, 40, -9, 15, -83, -83, -83, -83, -83, -83,
1420  -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
1421  -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
1422  -83, -83, -83, -83, -83, -83, -83, -83, -83, 5,
1423  -83, -83, -83, -83, 3, 23, 121, 122, 12, -83,
1424  106, -83, -83, -83, 124, -39, 125, -83, -83, -83,
1425  126, 127, -83, -83, 96, 28, -83, -83, -83, -83,
1426  -83, -83, -83, -83, 81, -83, -83, -83, -83, -83,
1427  -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
1428  -83, -83, 130, 130, 43, -83, -83, 130, 133, 135,
1429  -83, -83, -83, -83, 131, -83, 42, 44, 45, 46,
1430  47, 48, 49, 50, -55, -83, -83, -83, -83, 96,
1431  -83, 7, 138, -83, -83, -83, -83, -83, -83, -83,
1432  12, 144, 147, 148, 149, 159, 160, 161, 165, -83,
1433  -83, -83, 96, 0, 169, 176, 180, 1, -46, -4,
1434  181, 182, 186, 40, 40, 56, 185, 193, 194, 195,
1435  196, 198, -83, -83, -83, -83, -83, -83, -83, -83,
1436  -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
1437  -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
1438  -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
1439  -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
1440  -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
1441  -83, -83, -83, -83, 199, 201, 202, 203, 37, 204,
1442  205, 206, 207, -83, -83, -83, -83, -83
1443 };
1444 
1445 /* YYPGOTO[NTERM-NUM]. */
1446 static const yytype_int16 yypgoto[] =
1447 {
1448  -83, -83, -83, -1, -82, -83, 20, -83, -83, -83,
1449  183, -83, -83, -83, 71, -83, -83, -83, -83, -83,
1450  -83, -34, -83, -83, -83, -83, -83, -83, -83, -83,
1451  -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
1452  -83, -83, -83, -83, -83, -83, -83, -83, -83, -83,
1453  -83, -83, -83, 197, -26, -83, -83, -83, -83, -83,
1454  -83, -83, -83, 58, -83, -83, -83, -83, -83, -83,
1455  208, -83, -83, -83, -83, -16, 67, 95, -83, -83
1456 };
1457 
1458 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1459  positive, shift that token. If negative, reduce the rule which
1460  number is the opposite. If YYTABLE_NINF, syntax error. */
1461 #define YYTABLE_NINF -1
1462 static const yytype_uint16 yytable[] =
1463 {
1464  35, 114, 115, 94, 117, 118, 125, 126, 123, 4,
1465  89, 6, 81, 8, 78, 71, 130, 131, 6, 235,
1466  236, 237, 238, 239, 240, 241, 82, 101, 102, 103,
1467  104, 79, 132, 136, 137, 138, 139, 140, 141, 142,
1468  143, 155, 169, 111, 112, 157, 119, 120, 6, 136,
1469  137, 138, 139, 140, 141, 142, 143, 65, 66, 67,
1470  97, 98, 99, 232, 233, 174, 175, 176, 177, 243,
1471  244, 178, 106, 107, 108, 74, 75, 72, 149, 179,
1472  76, 77, 180, 181, 182, 183, 184, 185, 186, 187,
1473  188, 189, 190, 191, 87, 174, 175, 176, 177, 88,
1474  225, 178, 83, 92, 124, 95, 124, 192, 96, 179,
1475  116, 83, 180, 181, 182, 183, 184, 185, 186, 187,
1476  188, 189, 190, 191, 124, 128, 129, 150, 134, 135,
1477  146, 147, 148, 172, 152, 153, 158, 263, 159, 160,
1478  161, 213, 162, 163, 164, 165, 166, 167, 168, 216,
1479  2, 3, 217, 218, 219, 251, 224, 249, 250, 4,
1480  5, 6, 7, 8, 220, 221, 222, 9, 10, 11,
1481  223, 12, 226, 13, 229, 14, 15, 16, 17, 18,
1482  19, 230, 20, 21, 22, 231, 246, 247, 23, 24,
1483  25, 248, 252, 227, 26, 27, 28, 29, 30, 31,
1484  253, 254, 255, 256, 32, 257, 259, 33, 260, 261,
1485  262, 264, 265, 266, 267, 171, 122, 258, 215, 156,
1486  0, 0, 110, 0, 0, 91
1487 };
1488 
1489 #define yypact_value_is_default(yystate) \
1490  ((yystate) == (-83))
1491 
1492 #define yytable_value_is_error(yytable_value) \
1493  YYID (0)
1494 
1495 static const yytype_int16 yycheck[] =
1496 {
1497  1, 27, 28, 19, 30, 31, 3, 4, 3, 9,
1498  87, 11, 6, 13, 3, 5, 4, 5, 11, 65,
1499  66, 67, 68, 69, 70, 71, 20, 50, 51, 52,
1500  53, 20, 20, 88, 89, 90, 91, 92, 93, 94,
1501  95, 123, 97, 3, 4, 127, 55, 56, 11, 88,
1502  89, 90, 91, 92, 93, 94, 95, 14, 15, 16,
1503  35, 36, 37, 62, 63, 58, 59, 60, 61, 73,
1504  74, 64, 41, 42, 43, 8, 9, 5, 94, 72,
1505  3, 3, 75, 76, 77, 78, 79, 80, 81, 82,
1506  83, 84, 85, 86, 5, 58, 59, 60, 61, 5,
1507  100, 64, 96, 7, 101, 20, 101, 100, 99, 72,
1508  5, 96, 75, 76, 77, 78, 79, 80, 81, 82,
1509  83, 84, 85, 86, 101, 4, 4, 99, 22, 5,
1510  5, 5, 5, 149, 53, 5, 3, 100, 3, 8,
1511  98, 3, 98, 98, 98, 98, 98, 98, 98, 5,
1512  0, 1, 5, 5, 5, 99, 172, 183, 184, 9,
1513  10, 11, 12, 13, 5, 5, 5, 17, 18, 19,
1514  5, 21, 173, 23, 5, 25, 26, 27, 28, 29,
1515  30, 5, 32, 33, 34, 5, 5, 5, 38, 39,
1516  40, 5, 7, 173, 44, 45, 46, 47, 48, 49,
1517  7, 7, 7, 7, 54, 7, 7, 57, 7, 7,
1518  7, 7, 7, 7, 7, 144, 33, 251, 160, 124,
1519  -1, -1, 25, -1, -1, 17
1520 };
1521 
1522 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1523  symbol of state STATE-NUM. */
1524 static const yytype_uint8 yystos[] =
1525 {
1526  0, 103, 0, 1, 9, 10, 11, 12, 13, 17,
1527  18, 19, 21, 23, 25, 26, 27, 28, 29, 30,
1528  32, 33, 34, 38, 39, 40, 44, 45, 46, 47,
1529  48, 49, 54, 57, 104, 105, 107, 108, 111, 119,
1530  122, 146, 147, 148, 149, 151, 153, 154, 157, 158,
1531  159, 160, 161, 162, 163, 166, 168, 169, 170, 171,
1532  173, 174, 175, 176, 180, 14, 15, 16, 109, 178,
1533  179, 5, 5, 110, 178, 178, 3, 3, 3, 20,
1534  117, 6, 20, 96, 112, 113, 167, 5, 5, 87,
1535  172, 172, 7, 177, 177, 20, 99, 35, 36, 37,
1536  150, 50, 51, 52, 53, 152, 41, 42, 43, 155,
1537  155, 3, 4, 156, 156, 156, 5, 156, 156, 55,
1538  56, 181, 112, 3, 101, 3, 4, 118, 4, 4,
1539  4, 5, 20, 165, 22, 5, 88, 89, 90, 91,
1540  92, 93, 94, 95, 115, 116, 5, 5, 5, 177,
1541  99, 123, 53, 5, 106, 106, 179, 106, 3, 3,
1542  8, 98, 98, 98, 98, 98, 98, 98, 98, 97,
1543  114, 116, 177, 120, 58, 59, 60, 61, 64, 72,
1544  75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1545  85, 86, 100, 105, 124, 125, 126, 127, 128, 129,
1546  131, 133, 135, 136, 137, 138, 139, 140, 141, 142,
1547  143, 144, 145, 3, 164, 165, 5, 5, 5, 5,
1548  5, 5, 5, 5, 177, 100, 105, 108, 121, 5,
1549  5, 5, 62, 63, 132, 65, 66, 67, 68, 69,
1550  70, 71, 134, 73, 74, 130, 5, 5, 5, 156,
1551  156, 99, 7, 7, 7, 7, 7, 7, 123, 7,
1552  7, 7, 7, 100, 7, 7, 7, 7
1553 };
1554 
1555 #define yyerrok (yyerrstatus = 0)
1556 #define yyclearin (yychar = YYEMPTY)
1557 #define YYEMPTY (-2)
1558 #define YYEOF 0
1559 
1560 #define YYACCEPT goto yyacceptlab
1561 #define YYABORT goto yyabortlab
1562 #define YYERROR goto yyerrorlab
1563 
1564 
1565 /* Like YYERROR except do call yyerror. This remains here temporarily
1566  to ease the transition to the new meaning of YYERROR, for GCC.
1567  Once GCC version 2 has supplanted version 1, this can go. However,
1568  YYFAIL appears to be in use. Nevertheless, it is formally deprecated
1569  in Bison 2.4.2's NEWS entry, where a plan to phase it out is
1570  discussed. */
1571 
1572 #define YYFAIL goto yyerrlab
1573 #if defined YYFAIL
1574  /* This is here to suppress warnings from the GCC cpp's
1575  -Wunused-macros. Normally we don't worry about that warning, but
1576  some users do, and we want to make it easy for users to remove
1577  YYFAIL uses, which will produce warnings from Bison 2.5. */
1578 #endif
1579 
1580 #define YYRECOVERING() (!!yyerrstatus)
1581 
1582 #define YYBACKUP(Token, Value) \
1583 do \
1584  if (yychar == YYEMPTY && yylen == 1) \
1585  { \
1586  yychar = (Token); \
1587  yylval = (Value); \
1588  YYPOPSTACK (1); \
1589  goto yybackup; \
1590  } \
1591  else \
1592  { \
1593  yyerror (YY_("syntax error: cannot back up")); \
1594  YYERROR; \
1595  } \
1596 while (YYID (0))
1597 
1598 
1599 #define YYTERROR 1
1600 #define YYERRCODE 256
1601 
1602 
1603 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1604  If N is 0, then set CURRENT to the empty location which ends
1605  the previous symbol: RHS[0] (always defined). */
1606 
1607 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1608 #ifndef YYLLOC_DEFAULT
1609 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1610  do \
1611  if (YYID (N)) \
1612  { \
1613  (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1614  (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1615  (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1616  (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1617  } \
1618  else \
1619  { \
1620  (Current).first_line = (Current).last_line = \
1621  YYRHSLOC (Rhs, 0).last_line; \
1622  (Current).first_column = (Current).last_column = \
1623  YYRHSLOC (Rhs, 0).last_column; \
1624  } \
1625  while (YYID (0))
1626 #endif
1627 
1628 
1629 /* This macro is provided for backward compatibility. */
1630 
1631 #ifndef YY_LOCATION_PRINT
1632 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1633 #endif
1634 
1635 
1636 /* YYLEX -- calling `yylex' with the right arguments. */
1637 
1638 #ifdef YYLEX_PARAM
1639 # define YYLEX yylex (YYLEX_PARAM)
1640 #else
1641 # define YYLEX yylex (context)
1642 #endif
1643 
1644 /* Enable debugging if requested. */
1645 #if YYDEBUG
1646 
1647 # ifndef YYFPRINTF
1648 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1649 # define YYFPRINTF fprintf
1650 # endif
1651 
1652 # define YYDPRINTF(Args) \
1653 do { \
1654  if (yydebug) \
1655  YYFPRINTF Args; \
1656 } while (YYID (0))
1657 
1658 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1659 do { \
1660  if (yydebug) \
1661  { \
1662  YYFPRINTF (stderr, "%s ", Title); \
1663  yy_symbol_print (stderr, \
1664  Type, Value); \
1665  YYFPRINTF (stderr, "\n"); \
1666  } \
1667 } while (YYID (0))
1668 
1669 
1670 /*--------------------------------.
1671 | Print this symbol on YYOUTPUT. |
1672 `--------------------------------*/
1673 
1674 /*ARGSUSED*/
1675 #if (defined __STDC__ || defined __C99__FUNC__ \
1676  || defined __cplusplus || defined _MSC_VER)
1677 static void
1678 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1679 #else
1680 static void
1681 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1682  FILE *yyoutput;
1683  int yytype;
1684  YYSTYPE const * const yyvaluep;
1685 #endif
1686 {
1687  if (!yyvaluep)
1688  return;
1689 # ifdef YYPRINT
1690  if (yytype < YYNTOKENS)
1691  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1692 # else
1693  YYUSE (yyoutput);
1694 # endif
1695  switch (yytype)
1696  {
1697  default:
1698  break;
1699  }
1700 }
1701 
1702 
1703 /*--------------------------------.
1704 | Print this symbol on YYOUTPUT. |
1705 `--------------------------------*/
1706 
1707 #if (defined __STDC__ || defined __C99__FUNC__ \
1708  || defined __cplusplus || defined _MSC_VER)
1709 static void
1710 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1711 #else
1712 static void
1713 yy_symbol_print (yyoutput, yytype, yyvaluep)
1714  FILE *yyoutput;
1715  int yytype;
1716  YYSTYPE const * const yyvaluep;
1717 #endif
1718 {
1719  if (yytype < YYNTOKENS)
1720  YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1721  else
1722  YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1723 
1724  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1725  YYFPRINTF (yyoutput, ")");
1726 }
1727 
1728 /*------------------------------------------------------------------.
1729 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1730 | TOP (included). |
1731 `------------------------------------------------------------------*/
1732 
1733 #if (defined __STDC__ || defined __C99__FUNC__ \
1734  || defined __cplusplus || defined _MSC_VER)
1735 static void
1736 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1737 #else
1738 static void
1739 yy_stack_print (yybottom, yytop)
1740  yytype_int16 *yybottom;
1741  yytype_int16 *yytop;
1742 #endif
1743 {
1744  YYFPRINTF (stderr, "Stack now");
1745  for (; yybottom <= yytop; yybottom++)
1746  {
1747  int yybot = *yybottom;
1748  YYFPRINTF (stderr, " %d", yybot);
1749  }
1750  YYFPRINTF (stderr, "\n");
1751 }
1752 
1753 # define YY_STACK_PRINT(Bottom, Top) \
1754 do { \
1755  if (yydebug) \
1756  yy_stack_print ((Bottom), (Top)); \
1757 } while (YYID (0))
1758 
1759 
1760 /*------------------------------------------------.
1761 | Report that the YYRULE is going to be reduced. |
1762 `------------------------------------------------*/
1763 
1764 #if (defined __STDC__ || defined __C99__FUNC__ \
1765  || defined __cplusplus || defined _MSC_VER)
1766 static void
1767 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1768 #else
1769 static void
1770 yy_reduce_print (yyvsp, yyrule)
1771  YYSTYPE *yyvsp;
1772  int yyrule;
1773 #endif
1774 {
1775  int yynrhs = yyr2[yyrule];
1776  int yyi;
1777  unsigned long int yylno = yyrline[yyrule];
1778  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1779  yyrule - 1, yylno);
1780  /* The symbols being reduced. */
1781  for (yyi = 0; yyi < yynrhs; yyi++)
1782  {
1783  YYFPRINTF (stderr, " $%d = ", yyi + 1);
1784  yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1785  &(yyvsp[(yyi + 1) - (yynrhs)])
1786  );
1787  YYFPRINTF (stderr, "\n");
1788  }
1789 }
1790 
1791 # define YY_REDUCE_PRINT(Rule) \
1792 do { \
1793  if (yydebug) \
1794  yy_reduce_print (yyvsp, Rule); \
1795 } while (YYID (0))
1796 
1797 /* Nonzero means print parse trace. It is left uninitialized so that
1798  multiple parsers can coexist. */
1800 #else /* !YYDEBUG */
1801 # define YYDPRINTF(Args)
1802 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1803 # define YY_STACK_PRINT(Bottom, Top)
1804 # define YY_REDUCE_PRINT(Rule)
1805 #endif /* !YYDEBUG */
1806 
1807 
1808 /* YYINITDEPTH -- initial size of the parser's stacks. */
1809 #ifndef YYINITDEPTH
1810 # define YYINITDEPTH 200
1811 #endif
1812 
1813 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1814  if the built-in stack extension method is used).
1815 
1816  Do not make this value too large; the results are undefined if
1817  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1818  evaluated with infinite-precision integer arithmetic. */
1819 
1820 #ifndef YYMAXDEPTH
1821 # define YYMAXDEPTH 10000
1822 #endif
1823 
1824 
1825 #if YYERROR_VERBOSE
1826 
1827 # ifndef yystrlen
1828 # if defined __GLIBC__ && defined _STRING_H
1829 # define yystrlen strlen
1830 # else
1831 /* Return the length of YYSTR. */
1832 #if (defined __STDC__ || defined __C99__FUNC__ \
1833  || defined __cplusplus || defined _MSC_VER)
1834 static YYSIZE_T
1835 yystrlen (const char *yystr)
1836 #else
1837 static YYSIZE_T
1838 yystrlen (yystr)
1839  const char *yystr;
1840 #endif
1841 {
1842  YYSIZE_T yylen;
1843  for (yylen = 0; yystr[yylen]; yylen++)
1844  continue;
1845  return yylen;
1846 }
1847 # endif
1848 # endif
1849 
1850 # ifndef yystpcpy
1851 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1852 # define yystpcpy stpcpy
1853 # else
1854 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1855  YYDEST. */
1856 #if (defined __STDC__ || defined __C99__FUNC__ \
1857  || defined __cplusplus || defined _MSC_VER)
1858 static char *
1859 yystpcpy (char *yydest, const char *yysrc)
1860 #else
1861 static char *
1862 yystpcpy (yydest, yysrc)
1863  char *yydest;
1864  const char *yysrc;
1865 #endif
1866 {
1867  char *yyd = yydest;
1868  const char *yys = yysrc;
1869 
1870  while ((*yyd++ = *yys++) != '\0')
1871  continue;
1872 
1873  return yyd - 1;
1874 }
1875 # endif
1876 # endif
1877 
1878 # ifndef yytnamerr
1879 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1880  quotes and backslashes, so that it's suitable for yyerror. The
1881  heuristic is that double-quoting is unnecessary unless the string
1882  contains an apostrophe, a comma, or backslash (other than
1883  backslash-backslash). YYSTR is taken from yytname. If YYRES is
1884  null, do not copy; instead, return the length of what the result
1885  would have been. */
1886 static YYSIZE_T
1887 yytnamerr (char *yyres, const char *yystr)
1888 {
1889  if (*yystr == '"')
1890  {
1891  YYSIZE_T yyn = 0;
1892  char const *yyp = yystr;
1893 
1894  for (;;)
1895  switch (*++yyp)
1896  {
1897  case '\'':
1898  case ',':
1899  goto do_not_strip_quotes;
1900 
1901  case '\\':
1902  if (*++yyp != '\\')
1903  goto do_not_strip_quotes;
1904  /* Fall through. */
1905  default:
1906  if (yyres)
1907  yyres[yyn] = *yyp;
1908  yyn++;
1909  break;
1910 
1911  case '"':
1912  if (yyres)
1913  yyres[yyn] = '\0';
1914  return yyn;
1915  }
1916  do_not_strip_quotes: ;
1917  }
1918 
1919  if (! yyres)
1920  return yystrlen (yystr);
1921 
1922  return yystpcpy (yyres, yystr) - yyres;
1923 }
1924 # endif
1925 
1926 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1927  about the unexpected token YYTOKEN for the state stack whose top is
1928  YYSSP.
1929 
1930  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1931  not large enough to hold the message. In that case, also set
1932  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1933  required number of bytes is too large to store. */
1934 static int
1935 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1936  yytype_int16 *yyssp, int yytoken)
1937 {
1938  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1939  YYSIZE_T yysize = yysize0;
1940  YYSIZE_T yysize1;
1941  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1942  /* Internationalized format string. */
1943  const char *yyformat = 0;
1944  /* Arguments of yyformat. */
1945  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1946  /* Number of reported tokens (one for the "unexpected", one per
1947  "expected"). */
1948  int yycount = 0;
1949 
1950  /* There are many possibilities here to consider:
1951  - Assume YYFAIL is not used. It's too flawed to consider. See
1952  <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1953  for details. YYERROR is fine as it does not invoke this
1954  function.
1955  - If this state is a consistent state with a default action, then
1956  the only way this function was invoked is if the default action
1957  is an error action. In that case, don't check for expected
1958  tokens because there are none.
1959  - The only way there can be no lookahead present (in yychar) is if
1960  this state is a consistent state with a default action. Thus,
1961  detecting the absence of a lookahead is sufficient to determine
1962  that there is no unexpected or expected token to report. In that
1963  case, just report a simple "syntax error".
1964  - Don't assume there isn't a lookahead just because this state is a
1965  consistent state with a default action. There might have been a
1966  previous inconsistent state, consistent state with a non-default
1967  action, or user semantic action that manipulated yychar.
1968  - Of course, the expected token list depends on states to have
1969  correct lookahead information, and it depends on the parser not
1970  to perform extra reductions after fetching a lookahead from the
1971  scanner and before detecting a syntax error. Thus, state merging
1972  (from LALR or IELR) and default reductions corrupt the expected
1973  token list. However, the list is correct for canonical LR with
1974  one exception: it will still contain any token that will not be
1975  accepted due to an error action in a later state.
1976  */
1977  if (yytoken != YYEMPTY)
1978  {
1979  int yyn = yypact[*yyssp];
1980  yyarg[yycount++] = yytname[yytoken];
1981  if (!yypact_value_is_default (yyn))
1982  {
1983  /* Start YYX at -YYN if negative to avoid negative indexes in
1984  YYCHECK. In other words, skip the first -YYN actions for
1985  this state because they are default actions. */
1986  int yyxbegin = yyn < 0 ? -yyn : 0;
1987  /* Stay within bounds of both yycheck and yytname. */
1988  int yychecklim = YYLAST - yyn + 1;
1989  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1990  int yyx;
1991 
1992  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1993  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1994  && !yytable_value_is_error (yytable[yyx + yyn]))
1995  {
1996  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1997  {
1998  yycount = 1;
1999  yysize = yysize0;
2000  break;
2001  }
2002  yyarg[yycount++] = yytname[yyx];
2003  yysize1 = yysize + yytnamerr (0, yytname[yyx]);
2004  if (! (yysize <= yysize1
2005  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
2006  return 2;
2007  yysize = yysize1;
2008  }
2009  }
2010  }
2011 
2012  switch (yycount)
2013  {
2014 # define YYCASE_(N, S) \
2015  case N: \
2016  yyformat = S; \
2017  break
2018  YYCASE_(0, YY_("syntax error"));
2019  YYCASE_(1, YY_("syntax error, unexpected %s"));
2020  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
2021  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
2022  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
2023  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
2024 # undef YYCASE_
2025  }
2026 
2027  yysize1 = yysize + yystrlen (yyformat);
2028  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
2029  return 2;
2030  yysize = yysize1;
2031 
2032  if (*yymsg_alloc < yysize)
2033  {
2034  *yymsg_alloc = 2 * yysize;
2035  if (! (yysize <= *yymsg_alloc
2036  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
2037  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
2038  return 1;
2039  }
2040 
2041  /* Avoid sprintf, as that infringes on the user's name space.
2042  Don't have undefined behavior even if the translation
2043  produced a string with the wrong number of "%s"s. */
2044  {
2045  char *yyp = *yymsg;
2046  int yyi = 0;
2047  while ((*yyp = *yyformat) != '\0')
2048  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
2049  {
2050  yyp += yytnamerr (yyp, yyarg[yyi++]);
2051  yyformat += 2;
2052  }
2053  else
2054  {
2055  yyp++;
2056  yyformat++;
2057  }
2058  }
2059  return 0;
2060 }
2061 #endif /* YYERROR_VERBOSE */
2062 
2063 /*-----------------------------------------------.
2064 | Release the memory associated to this symbol. |
2065 `-----------------------------------------------*/
2066 
2067 /*ARGSUSED*/
2068 #if (defined __STDC__ || defined __C99__FUNC__ \
2069  || defined __cplusplus || defined _MSC_VER)
2070 static void
2071 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
2072 #else
2073 static void
2074 yydestruct (yymsg, yytype, yyvaluep)
2075  const char *yymsg;
2076  int yytype;
2077  YYSTYPE *yyvaluep;
2078 #endif
2079 {
2080  YYUSE (yyvaluep);
2081 
2082  if (!yymsg)
2083  yymsg = "Deleting";
2084  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2085 
2086  switch (yytype)
2087  {
2088 
2089  default:
2090  break;
2091  }
2092 }
2093 
2094 
2095 /* Prevent warnings from -Wmissing-prototypes. */
2096 #ifdef YYPARSE_PARAM
2097 #if defined __STDC__ || defined __cplusplus
2098 int yyparse (void *YYPARSE_PARAM);
2099 #else
2100 int yyparse ();
2101 #endif
2102 #else /* ! YYPARSE_PARAM */
2103 #if defined __STDC__ || defined __cplusplus
2104 int yyparse (void);
2105 #else
2106 int yyparse ();
2107 #endif
2108 #endif /* ! YYPARSE_PARAM */
2109 
2110 
2111 /* The lookahead symbol. */
2113 
2114 /* The semantic value of the lookahead symbol. */
2116 
2117 /* Number of syntax errors so far. */
2119 
2120 
2121 /*----------.
2122 | yyparse. |
2123 `----------*/
2124 
2125 #ifdef YYPARSE_PARAM
2126 #if (defined __STDC__ || defined __C99__FUNC__ \
2127  || defined __cplusplus || defined _MSC_VER)
2128 int
2129 yyparse (void *YYPARSE_PARAM)
2130 #else
2131 int
2132 yyparse (YYPARSE_PARAM)
2133  void *YYPARSE_PARAM;
2134 #endif
2135 #else /* ! YYPARSE_PARAM */
2136 #if (defined __STDC__ || defined __C99__FUNC__ \
2137  || defined __cplusplus || defined _MSC_VER)
2138 int
2139 yyparse (void)
2140 #else
2141 int
2143 
2144 #endif
2145 #endif
2146 {
2147  int yystate;
2148  /* Number of tokens to shift before error messages enabled. */
2149  int yyerrstatus;
2150 
2151  /* The stacks and their tools:
2152  `yyss': related to states.
2153  `yyvs': related to semantic values.
2154 
2155  Refer to the stacks thru separate pointers, to allow yyoverflow
2156  to reallocate them elsewhere. */
2157 
2158  /* The state stack. */
2159  yytype_int16 yyssa[YYINITDEPTH];
2160  yytype_int16 *yyss;
2161  yytype_int16 *yyssp;
2162 
2163  /* The semantic value stack. */
2164  YYSTYPE yyvsa[YYINITDEPTH];
2165  YYSTYPE *yyvs;
2166  YYSTYPE *yyvsp;
2167 
2168  YYSIZE_T yystacksize;
2169 
2170  int yyn;
2171  int yyresult;
2172  /* Lookahead token as an internal (translated) token number. */
2173  int yytoken;
2174  /* The variables used to return semantic value and location from the
2175  action routines. */
2176  YYSTYPE yyval;
2177 
2178 #if YYERROR_VERBOSE
2179  /* Buffer for error messages, and its allocated size. */
2180  char yymsgbuf[128];
2181  char *yymsg = yymsgbuf;
2182  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2183 #endif
2184 
2185 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
2186 
2187  /* The number of symbols on the RHS of the reduced rule.
2188  Keep to zero when no symbol should be popped. */
2189  int yylen = 0;
2190 
2191  yytoken = 0;
2192  yyss = yyssa;
2193  yyvs = yyvsa;
2194  yystacksize = YYINITDEPTH;
2195 
2196  YYDPRINTF ((stderr, "Starting parse\n"));
2197 
2198  yystate = 0;
2199  yyerrstatus = 0;
2200  yynerrs = 0;
2201  yychar = YYEMPTY; /* Cause a token to be read. */
2202 
2203  /* Initialize stack pointers.
2204  Waste one element of value and location stack
2205  so that they stay on the same level as the state stack.
2206  The wasted elements are never initialized. */
2207  yyssp = yyss;
2208  yyvsp = yyvs;
2209 
2210  goto yysetstate;
2211 
2212 /*------------------------------------------------------------.
2213 | yynewstate -- Push a new state, which is found in yystate. |
2214 `------------------------------------------------------------*/
2215  yynewstate:
2216  /* In all cases, when you get here, the value and location stacks
2217  have just been pushed. So pushing a state here evens the stacks. */
2218  yyssp++;
2219 
2220  yysetstate:
2221  *yyssp = yystate;
2222 
2223  if (yyss + yystacksize - 1 <= yyssp)
2224  {
2225  /* Get the current used size of the three stacks, in elements. */
2226  YYSIZE_T yysize = yyssp - yyss + 1;
2227 
2228 #ifdef yyoverflow
2229  {
2230  /* Give user a chance to reallocate the stack. Use copies of
2231  these so that the &'s don't force the real ones into
2232  memory. */
2233  YYSTYPE *yyvs1 = yyvs;
2234  yytype_int16 *yyss1 = yyss;
2235 
2236  /* Each stack pointer address is followed by the size of the
2237  data in use in that stack, in bytes. This used to be a
2238  conditional around just the two extra args, but that might
2239  be undefined if yyoverflow is a macro. */
2240  yyoverflow (YY_("memory exhausted"),
2241  &yyss1, yysize * sizeof (*yyssp),
2242  &yyvs1, yysize * sizeof (*yyvsp),
2243  &yystacksize);
2244 
2245  yyss = yyss1;
2246  yyvs = yyvs1;
2247  }
2248 #else /* no yyoverflow */
2249 # ifndef YYSTACK_RELOCATE
2250  goto yyexhaustedlab;
2251 # else
2252  /* Extend the stack our own way. */
2253  if (YYMAXDEPTH <= yystacksize)
2254  goto yyexhaustedlab;
2255  yystacksize *= 2;
2256  if (YYMAXDEPTH < yystacksize)
2257  yystacksize = YYMAXDEPTH;
2258 
2259  {
2260  yytype_int16 *yyss1 = yyss;
2261  union yyalloc *yyptr =
2262  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2263  if (! yyptr)
2264  goto yyexhaustedlab;
2265  YYSTACK_RELOCATE (yyss_alloc, yyss);
2266  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
2267 # undef YYSTACK_RELOCATE
2268  if (yyss1 != yyssa)
2269  YYSTACK_FREE (yyss1);
2270  }
2271 # endif
2272 #endif /* no yyoverflow */
2273 
2274  yyssp = yyss + yysize - 1;
2275  yyvsp = yyvs + yysize - 1;
2276 
2277  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2278  (unsigned long int) yystacksize));
2279 
2280  if (yyss + yystacksize - 1 <= yyssp)
2281  YYABORT;
2282  }
2283 
2284  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2285 
2286  if (yystate == YYFINAL)
2287  YYACCEPT;
2288 
2289  goto yybackup;
2290 
2291 /*-----------.
2292 | yybackup. |
2293 `-----------*/
2294 yybackup:
2295 
2296  /* Do appropriate processing given the current state. Read a
2297  lookahead token if we need one and don't already have one. */
2298 
2299  /* First try to decide what to do without reference to lookahead token. */
2300  yyn = yypact[yystate];
2301  if (yypact_value_is_default (yyn))
2302  goto yydefault;
2303 
2304  /* Not known => get a lookahead token if don't already have one. */
2305 
2306  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2307  if (yychar == YYEMPTY)
2308  {
2309  YYDPRINTF ((stderr, "Reading a token: "));
2310  yychar = YYLEX;
2311  }
2312 
2313  if (yychar <= YYEOF)
2314  {
2315  yychar = yytoken = YYEOF;
2316  YYDPRINTF ((stderr, "Now at end of input.\n"));
2317  }
2318  else
2319  {
2320  yytoken = YYTRANSLATE (yychar);
2321  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2322  }
2323 
2324  /* If the proper action on seeing token YYTOKEN is to reduce or to
2325  detect an error, take that action. */
2326  yyn += yytoken;
2327  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2328  goto yydefault;
2329  yyn = yytable[yyn];
2330  if (yyn <= 0)
2331  {
2332  if (yytable_value_is_error (yyn))
2333  goto yyerrlab;
2334  yyn = -yyn;
2335  goto yyreduce;
2336  }
2337 
2338  /* Count tokens shifted since error; after three, turn off error
2339  status. */
2340  if (yyerrstatus)
2341  yyerrstatus--;
2342 
2343  /* Shift the lookahead token. */
2344  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2345 
2346  /* Discard the shifted token. */
2347  yychar = YYEMPTY;
2348 
2349  yystate = yyn;
2350  *++yyvsp = yylval;
2351 
2352  goto yynewstate;
2353 
2354 
2355 /*-----------------------------------------------------------.
2356 | yydefault -- do the default action for the current state. |
2357 `-----------------------------------------------------------*/
2358 yydefault:
2359  yyn = yydefact[yystate];
2360  if (yyn == 0)
2361  goto yyerrlab;
2362  goto yyreduce;
2363 
2364 
2365 /*-----------------------------.
2366 | yyreduce -- Do a reduction. |
2367 `-----------------------------*/
2368 yyreduce:
2369  /* yyn is the number of a rule to reduce with. */
2370  yylen = yyr2[yyn];
2371 
2372  /* If YYLEN is nonzero, implement the default value of the action:
2373  `$$ = $1'.
2374 
2375  Otherwise, the following line sets YYVAL to garbage.
2376  This behavior is undocumented and Bison
2377  users should not rely upon it. Assigning to YYVAL
2378  unconditionally makes the parser a bit smaller, and it avoids a
2379  GCC warning that YYVAL may be used uninitialized. */
2380  yyval = yyvsp[1-yylen];
2381 
2382 
2383  YY_REDUCE_PRINT (yyn);
2384  switch (yyn)
2385  {
2386  case 36:
2387 
2388 /* Line 1806 of yacc.c */
2389 #line 821 "src/cfgparse.y"
2390  {
2391  TAILQ_INSERT_TAIL(bindings, (yyvsp[(1) - (1)].binding), bindings);
2392  }
2393  break;
2394 
2395  case 37:
2396 
2397 /* Line 1806 of yacc.c */
2398 #line 827 "src/cfgparse.y"
2399  { (yyval.binding) = (yyvsp[(2) - (2)].binding); }
2400  break;
2401 
2402  case 38:
2403 
2404 /* Line 1806 of yacc.c */
2405 #line 828 "src/cfgparse.y"
2406  { (yyval.binding) = (yyvsp[(2) - (2)].binding); }
2407  break;
2408 
2409  case 39:
2410 
2411 /* Line 1806 of yacc.c */
2412 #line 833 "src/cfgparse.y"
2413  {
2414  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));
2415  Binding *new = scalloc(sizeof(Binding));
2416 
2417  new->keycode = (yyvsp[(2) - (3)].number);
2418  new->mods = (yyvsp[(1) - (3)].number);
2419  new->command = (yyvsp[(3) - (3)].string);
2420 
2421  (yyval.binding) = new;
2422  }
2423  break;
2424 
2425  case 40:
2426 
2427 /* Line 1806 of yacc.c */
2428 #line 847 "src/cfgparse.y"
2429  {
2430  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));
2431  Binding *new = scalloc(sizeof(Binding));
2432 
2433  new->symbol = (yyvsp[(2) - (3)].string);
2434  new->mods = (yyvsp[(1) - (3)].number);
2435  new->command = (yyvsp[(3) - (3)].string);
2436 
2437  (yyval.binding) = new;
2438  }
2439  break;
2440 
2441  case 41:
2442 
2443 /* Line 1806 of yacc.c */
2444 #line 861 "src/cfgparse.y"
2445  {
2446  if (match_is_empty(&current_match)) {
2447  ELOG("Match is empty, ignoring this for_window statement\n");
2448  break;
2449  }
2450  printf("\t should execute command %s for the criteria mentioned above\n", (yyvsp[(3) - (3)].string));
2451  Assignment *assignment = scalloc(sizeof(Assignment));
2452  assignment->type = A_COMMAND;
2453  assignment->match = current_match;
2454  assignment->dest.command = (yyvsp[(3) - (3)].string);
2455  TAILQ_INSERT_TAIL(&assignments, assignment, assignments);
2456  }
2457  break;
2458 
2459  case 43:
2460 
2461 /* Line 1806 of yacc.c */
2462 #line 877 "src/cfgparse.y"
2463  {
2464  printf("match parsed\n");
2465  }
2466  break;
2467 
2468  case 44:
2469 
2470 /* Line 1806 of yacc.c */
2471 #line 884 "src/cfgparse.y"
2472  {
2473  printf("start\n");
2474  match_init(&current_match);
2475  }
2476  break;
2477 
2478  case 45:
2479 
2480 /* Line 1806 of yacc.c */
2481 #line 892 "src/cfgparse.y"
2482  {
2483  printf("match specification finished\n");
2484  }
2485  break;
2486 
2487  case 48:
2488 
2489 /* Line 1806 of yacc.c */
2490 #line 904 "src/cfgparse.y"
2491  {
2492  printf("criteria: class = %s\n", (yyvsp[(3) - (3)].string));
2493  current_match.class = regex_new((yyvsp[(3) - (3)].string));
2494  free((yyvsp[(3) - (3)].string));
2495  }
2496  break;
2497 
2498  case 49:
2499 
2500 /* Line 1806 of yacc.c */
2501 #line 910 "src/cfgparse.y"
2502  {
2503  printf("criteria: instance = %s\n", (yyvsp[(3) - (3)].string));
2504  current_match.instance = regex_new((yyvsp[(3) - (3)].string));
2505  free((yyvsp[(3) - (3)].string));
2506  }
2507  break;
2508 
2509  case 50:
2510 
2511 /* Line 1806 of yacc.c */
2512 #line 916 "src/cfgparse.y"
2513  {
2514  printf("criteria: window_role = %s\n", (yyvsp[(3) - (3)].string));
2515  current_match.role = regex_new((yyvsp[(3) - (3)].string));
2516  free((yyvsp[(3) - (3)].string));
2517  }
2518  break;
2519 
2520  case 51:
2521 
2522 /* Line 1806 of yacc.c */
2523 #line 922 "src/cfgparse.y"
2524  {
2525  printf("criteria: id = %s\n", (yyvsp[(3) - (3)].string));
2526  char *end;
2527  long parsed = strtol((yyvsp[(3) - (3)].string), &end, 10);
2528  if (parsed == LONG_MIN ||
2529  parsed == LONG_MAX ||
2530  parsed < 0 ||
2531  (end && *end != '\0')) {
2532  ELOG("Could not parse con id \"%s\"\n", (yyvsp[(3) - (3)].string));
2533  } else {
2534  current_match.con_id = (Con*)parsed;
2535  printf("id as int = %p\n", current_match.con_id);
2536  }
2537  }
2538  break;
2539 
2540  case 52:
2541 
2542 /* Line 1806 of yacc.c */
2543 #line 937 "src/cfgparse.y"
2544  {
2545  printf("criteria: window id = %s\n", (yyvsp[(3) - (3)].string));
2546  char *end;
2547  long parsed = strtol((yyvsp[(3) - (3)].string), &end, 10);
2548  if (parsed == LONG_MIN ||
2549  parsed == LONG_MAX ||
2550  parsed < 0 ||
2551  (end && *end != '\0')) {
2552  ELOG("Could not parse window id \"%s\"\n", (yyvsp[(3) - (3)].string));
2553  } else {
2554  current_match.id = parsed;
2555  printf("window id as int = %d\n", current_match.id);
2556  }
2557  }
2558  break;
2559 
2560  case 53:
2561 
2562 /* Line 1806 of yacc.c */
2563 #line 952 "src/cfgparse.y"
2564  {
2565  printf("criteria: mark = %s\n", (yyvsp[(3) - (3)].string));
2566  current_match.mark = regex_new((yyvsp[(3) - (3)].string));
2567  free((yyvsp[(3) - (3)].string));
2568  }
2569  break;
2570 
2571  case 54:
2572 
2573 /* Line 1806 of yacc.c */
2574 #line 958 "src/cfgparse.y"
2575  {
2576  printf("criteria: title = %s\n", (yyvsp[(3) - (3)].string));
2577  current_match.title = regex_new((yyvsp[(3) - (3)].string));
2578  free((yyvsp[(3) - (3)].string));
2579  }
2580  break;
2581 
2582  case 55:
2583 
2584 /* Line 1806 of yacc.c */
2585 #line 964 "src/cfgparse.y"
2586  {
2587  printf("criteria: urgent = %s\n", (yyvsp[(3) - (3)].string));
2588  if (strcasecmp((yyvsp[(3) - (3)].string), "latest") == 0 ||
2589  strcasecmp((yyvsp[(3) - (3)].string), "newest") == 0 ||
2590  strcasecmp((yyvsp[(3) - (3)].string), "recent") == 0 ||
2591  strcasecmp((yyvsp[(3) - (3)].string), "last") == 0) {
2592  current_match.urgent = U_LATEST;
2593  } else if (strcasecmp((yyvsp[(3) - (3)].string), "oldest") == 0 ||
2594  strcasecmp((yyvsp[(3) - (3)].string), "first") == 0) {
2595  current_match.urgent = U_OLDEST;
2596  }
2597  free((yyvsp[(3) - (3)].string));
2598  }
2599  break;
2600 
2601  case 57:
2602 
2603 /* Line 1806 of yacc.c */
2604 #line 981 "src/cfgparse.y"
2605  { sasprintf(&(yyval.string), "%d", (yyvsp[(1) - (1)].number)); }
2606  break;
2607 
2608  case 59:
2609 
2610 /* Line 1806 of yacc.c */
2611 #line 987 "src/cfgparse.y"
2612  {
2613  sasprintf(&(yyval.string), "%d", (yyvsp[(1) - (1)].number));
2614  }
2615  break;
2616 
2617  case 60:
2618 
2619 /* Line 1806 of yacc.c */
2620 #line 994 "src/cfgparse.y"
2621  {
2622  if (strcasecmp((yyvsp[(2) - (5)].string), "default") == 0) {
2623  printf("You cannot use the name \"default\" for your mode\n");
2624  exit(1);
2625  }
2626  printf("\t now in mode %s\n", (yyvsp[(2) - (5)].string));
2627  printf("\t current bindings = %p\n", current_bindings);
2628  Binding *binding;
2630  printf("got binding on mods %d, keycode %d, symbol %s, command %s\n",
2631  binding->mods, binding->keycode, binding->symbol, binding->command);
2632  }
2633 
2634  struct Mode *mode = scalloc(sizeof(struct Mode));
2635  mode->name = (yyvsp[(2) - (5)].string);
2636  mode->bindings = current_bindings;
2637  current_bindings = NULL;
2638  SLIST_INSERT_HEAD(&modes, mode, modes);
2639  }
2640  break;
2641 
2642  case 64:
2643 
2644 /* Line 1806 of yacc.c */
2645 #line 1024 "src/cfgparse.y"
2646  {
2647  if (current_bindings == NULL) {
2648  current_bindings = scalloc(sizeof(struct bindings_head));
2650  }
2651 
2652  TAILQ_INSERT_TAIL(current_bindings, (yyvsp[(1) - (1)].binding), bindings);
2653  }
2654  break;
2655 
2656  case 65:
2657 
2658 /* Line 1806 of yacc.c */
2659 #line 1036 "src/cfgparse.y"
2660  {
2661  printf("\t new bar configuration finished, saving.\n");
2662  /* Generate a unique ID for this bar */
2663  current_bar.id = sstrdup("bar-XXXXXX");
2664  /* This works similar to mktemp in that it replaces the last six X with
2665  * random letters, but without the restriction that the given buffer
2666  * has to contain a valid path name. */
2667  char *x = current_bar.id + strlen("bar-");
2668  while (*x != '\0') {
2669  *(x++) = (rand() % 26) + 'a';
2670  }
2671 
2672  /* If no font was explicitly set, we use the i3 font as default */
2673  if (!current_bar.font && font_pattern)
2674  current_bar.font = sstrdup(font_pattern);
2675 
2676  /* Copy the current (static) structure into a dynamically allocated
2677  * one, then cleanup our static one. */
2678  Barconfig *bar_config = scalloc(sizeof(Barconfig));
2679  memcpy(bar_config, &current_bar, sizeof(Barconfig));
2680  TAILQ_INSERT_TAIL(&barconfigs, bar_config, configs);
2681 
2682  memset(&current_bar, '\0', sizeof(Barconfig));
2683  }
2684  break;
2685 
2686  case 87:
2687 
2688 /* Line 1806 of yacc.c */
2689 #line 1091 "src/cfgparse.y"
2690  {
2691  DLOG("should add status command %s\n", (yyvsp[(2) - (2)].string));
2692  FREE(current_bar.status_command);
2693  current_bar.status_command = (yyvsp[(2) - (2)].string);
2694  }
2695  break;
2696 
2697  case 88:
2698 
2699 /* Line 1806 of yacc.c */
2700 #line 1100 "src/cfgparse.y"
2701  {
2702  DLOG("should add i3bar_command %s\n", (yyvsp[(2) - (2)].string));
2703  FREE(current_bar.i3bar_command);
2704  current_bar.i3bar_command = (yyvsp[(2) - (2)].string);
2705  }
2706  break;
2707 
2708  case 89:
2709 
2710 /* Line 1806 of yacc.c */
2711 #line 1109 "src/cfgparse.y"
2712  {
2713  DLOG("bar output %s\n", (yyvsp[(2) - (2)].string));
2714  int new_outputs = current_bar.num_outputs + 1;
2715  current_bar.outputs = srealloc(current_bar.outputs, sizeof(char*) * new_outputs);
2716  current_bar.outputs[current_bar.num_outputs] = (yyvsp[(2) - (2)].string);
2717  current_bar.num_outputs = new_outputs;
2718  }
2719  break;
2720 
2721  case 90:
2722 
2723 /* Line 1806 of yacc.c */
2724 #line 1120 "src/cfgparse.y"
2725  {
2726  DLOG("tray %s\n", (yyvsp[(2) - (2)].string));
2727  FREE(current_bar.tray_output);
2728  current_bar.tray_output = (yyvsp[(2) - (2)].string);
2729  }
2730  break;
2731 
2732  case 91:
2733 
2734 /* Line 1806 of yacc.c */
2735 #line 1129 "src/cfgparse.y"
2736  {
2737  DLOG("position %d\n", (yyvsp[(2) - (2)].number));
2738  current_bar.position = (yyvsp[(2) - (2)].number);
2739  }
2740  break;
2741 
2742  case 92:
2743 
2744 /* Line 1806 of yacc.c */
2745 #line 1136 "src/cfgparse.y"
2746  { (yyval.number) = P_TOP; }
2747  break;
2748 
2749  case 93:
2750 
2751 /* Line 1806 of yacc.c */
2752 #line 1137 "src/cfgparse.y"
2753  { (yyval.number) = P_BOTTOM; }
2754  break;
2755 
2756  case 94:
2757 
2758 /* Line 1806 of yacc.c */
2759 #line 1142 "src/cfgparse.y"
2760  {
2761  DLOG("mode %d\n", (yyvsp[(2) - (2)].number));
2762  current_bar.mode = (yyvsp[(2) - (2)].number);
2763  }
2764  break;
2765 
2766  case 95:
2767 
2768 /* Line 1806 of yacc.c */
2769 #line 1149 "src/cfgparse.y"
2770  { (yyval.number) = M_HIDE; }
2771  break;
2772 
2773  case 96:
2774 
2775 /* Line 1806 of yacc.c */
2776 #line 1150 "src/cfgparse.y"
2777  { (yyval.number) = M_DOCK; }
2778  break;
2779 
2780  case 97:
2781 
2782 /* Line 1806 of yacc.c */
2783 #line 1155 "src/cfgparse.y"
2784  {
2785  DLOG("modifier %d\n", (yyvsp[(2) - (2)].number));
2786  current_bar.modifier = (yyvsp[(2) - (2)].number);
2787  }
2788  break;
2789 
2790  case 98:
2791 
2792 /* Line 1806 of yacc.c */
2793 #line 1161 "src/cfgparse.y"
2794  { (yyval.number) = M_CONTROL; }
2795  break;
2796 
2797  case 99:
2798 
2799 /* Line 1806 of yacc.c */
2800 #line 1162 "src/cfgparse.y"
2801  { (yyval.number) = M_SHIFT; }
2802  break;
2803 
2804  case 100:
2805 
2806 /* Line 1806 of yacc.c */
2807 #line 1163 "src/cfgparse.y"
2808  { (yyval.number) = M_MOD1; }
2809  break;
2810 
2811  case 101:
2812 
2813 /* Line 1806 of yacc.c */
2814 #line 1164 "src/cfgparse.y"
2815  { (yyval.number) = M_MOD2; }
2816  break;
2817 
2818  case 102:
2819 
2820 /* Line 1806 of yacc.c */
2821 #line 1165 "src/cfgparse.y"
2822  { (yyval.number) = M_MOD3; }
2823  break;
2824 
2825  case 103:
2826 
2827 /* Line 1806 of yacc.c */
2828 #line 1166 "src/cfgparse.y"
2829  { (yyval.number) = M_MOD4; }
2830  break;
2831 
2832  case 104:
2833 
2834 /* Line 1806 of yacc.c */
2835 #line 1167 "src/cfgparse.y"
2836  { (yyval.number) = M_MOD5; }
2837  break;
2838 
2839  case 105:
2840 
2841 /* Line 1806 of yacc.c */
2842 #line 1172 "src/cfgparse.y"
2843  {
2844  DLOG("font %s\n", (yyvsp[(2) - (2)].string));
2845  FREE(current_bar.font);
2846  current_bar.font = (yyvsp[(2) - (2)].string);
2847  }
2848  break;
2849 
2850  case 106:
2851 
2852 /* Line 1806 of yacc.c */
2853 #line 1181 "src/cfgparse.y"
2854  {
2855  DLOG("workspace_buttons = %d\n", (yyvsp[(2) - (2)].number));
2856  /* We store this inverted to make the default setting right when
2857  * initializing the struct with zero. */
2858  current_bar.hide_workspace_buttons = !((yyvsp[(2) - (2)].number));
2859  }
2860  break;
2861 
2862  case 107:
2863 
2864 /* Line 1806 of yacc.c */
2865 #line 1191 "src/cfgparse.y"
2866  {
2867  DLOG("verbose = %d\n", (yyvsp[(2) - (2)].number));
2868  current_bar.verbose = (yyvsp[(2) - (2)].number);
2869  }
2870  break;
2871 
2872  case 108:
2873 
2874 /* Line 1806 of yacc.c */
2875 #line 1199 "src/cfgparse.y"
2876  {
2877  DLOG("socket_path = %s\n", (yyvsp[(2) - (2)].string));
2878  FREE(current_bar.socket_path);
2879  current_bar.socket_path = (yyvsp[(2) - (2)].string);
2880  }
2881  break;
2882 
2883  case 109:
2884 
2885 /* Line 1806 of yacc.c */
2886 #line 1208 "src/cfgparse.y"
2887  {
2888  /* At the moment, the TOK_BAR_COLORS token is only to make the config
2889  * friendlier for humans. We might change this in the future if it gets
2890  * more complex. */
2891  }
2892  break;
2893 
2894  case 110:
2895 
2896 /* Line 1806 of yacc.c */
2897 #line 1217 "src/cfgparse.y"
2898  {
2899  DLOG("background = %s\n", (yyvsp[(2) - (2)].string));
2900  current_bar.colors.background = (yyvsp[(2) - (2)].string);
2901  }
2902  break;
2903 
2904  case 111:
2905 
2906 /* Line 1806 of yacc.c */
2907 #line 1225 "src/cfgparse.y"
2908  {
2909  DLOG("statusline = %s\n", (yyvsp[(2) - (2)].string));
2910  current_bar.colors.statusline = (yyvsp[(2) - (2)].string);
2911  }
2912  break;
2913 
2914  case 112:
2915 
2916 /* Line 1806 of yacc.c */
2917 #line 1233 "src/cfgparse.y"
2918  {
2919  /* Old syntax: text / background */
2920  DLOG("focused_ws = %s, %s (old)\n", (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].string));
2921  current_bar.colors.focused_workspace_bg = (yyvsp[(3) - (3)].string);
2922  current_bar.colors.focused_workspace_text = (yyvsp[(2) - (3)].string);
2923  }
2924  break;
2925 
2926  case 113:
2927 
2928 /* Line 1806 of yacc.c */
2929 #line 1240 "src/cfgparse.y"
2930  {
2931  /* New syntax: border / background / text */
2932  DLOG("focused_ws = %s, %s and %s\n", (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].string), (yyvsp[(4) - (4)].string));
2933  current_bar.colors.focused_workspace_border = (yyvsp[(2) - (4)].string);
2934  current_bar.colors.focused_workspace_bg = (yyvsp[(3) - (4)].string);
2935  current_bar.colors.focused_workspace_text = (yyvsp[(4) - (4)].string);
2936  }
2937  break;
2938 
2939  case 114:
2940 
2941 /* Line 1806 of yacc.c */
2942 #line 1251 "src/cfgparse.y"
2943  {
2944  /* Old syntax: text / background */
2945  DLOG("active_ws = %s, %s (old)\n", (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].string));
2946  current_bar.colors.active_workspace_bg = (yyvsp[(3) - (3)].string);
2947  current_bar.colors.active_workspace_text = (yyvsp[(2) - (3)].string);
2948  }
2949  break;
2950 
2951  case 115:
2952 
2953 /* Line 1806 of yacc.c */
2954 #line 1258 "src/cfgparse.y"
2955  {
2956  /* New syntax: border / background / text */
2957  DLOG("active_ws = %s, %s and %s\n", (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].string), (yyvsp[(4) - (4)].string));
2958  current_bar.colors.active_workspace_border = (yyvsp[(2) - (4)].string);
2959  current_bar.colors.active_workspace_bg = (yyvsp[(3) - (4)].string);
2960  current_bar.colors.active_workspace_text = (yyvsp[(4) - (4)].string);
2961  }
2962  break;
2963 
2964  case 116:
2965 
2966 /* Line 1806 of yacc.c */
2967 #line 1269 "src/cfgparse.y"
2968  {
2969  /* Old syntax: text / background */
2970  DLOG("inactive_ws = %s, %s (old)\n", (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].string));
2971  current_bar.colors.inactive_workspace_bg = (yyvsp[(3) - (3)].string);
2972  current_bar.colors.inactive_workspace_text = (yyvsp[(2) - (3)].string);
2973  }
2974  break;
2975 
2976  case 117:
2977 
2978 /* Line 1806 of yacc.c */
2979 #line 1276 "src/cfgparse.y"
2980  {
2981  DLOG("inactive_ws = %s, %s and %s\n", (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].string), (yyvsp[(4) - (4)].string));
2982  current_bar.colors.inactive_workspace_border = (yyvsp[(2) - (4)].string);
2983  current_bar.colors.inactive_workspace_bg = (yyvsp[(3) - (4)].string);
2984  current_bar.colors.inactive_workspace_text = (yyvsp[(4) - (4)].string);
2985  }
2986  break;
2987 
2988  case 118:
2989 
2990 /* Line 1806 of yacc.c */
2991 #line 1286 "src/cfgparse.y"
2992  {
2993  /* Old syntax: text / background */
2994  DLOG("urgent_ws = %s, %s (old)\n", (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].string));
2995  current_bar.colors.urgent_workspace_bg = (yyvsp[(3) - (3)].string);
2996  current_bar.colors.urgent_workspace_text = (yyvsp[(2) - (3)].string);
2997  }
2998  break;
2999 
3000  case 119:
3001 
3002 /* Line 1806 of yacc.c */
3003 #line 1293 "src/cfgparse.y"
3004  {
3005  DLOG("urgent_ws = %s, %s and %s\n", (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].string), (yyvsp[(4) - (4)].string));
3006  current_bar.colors.urgent_workspace_border = (yyvsp[(2) - (4)].string);
3007  current_bar.colors.urgent_workspace_bg = (yyvsp[(3) - (4)].string);
3008  current_bar.colors.urgent_workspace_text = (yyvsp[(4) - (4)].string);
3009  }
3010  break;
3011 
3012  case 120:
3013 
3014 /* Line 1806 of yacc.c */
3015 #line 1303 "src/cfgparse.y"
3016  {
3017  printf("floating_maximum_width = %d\n", (yyvsp[(2) - (4)].number));
3018  printf("floating_maximum_height = %d\n", (yyvsp[(4) - (4)].number));
3019  config.floating_maximum_width = (yyvsp[(2) - (4)].number);
3020  config.floating_maximum_height = (yyvsp[(4) - (4)].number);
3021  }
3022  break;
3023 
3024  case 121:
3025 
3026 /* Line 1806 of yacc.c */
3027 #line 1313 "src/cfgparse.y"
3028  {
3029  printf("floating_minimum_width = %d\n", (yyvsp[(2) - (4)].number));
3030  printf("floating_minimum_height = %d\n", (yyvsp[(4) - (4)].number));
3031  config.floating_minimum_width = (yyvsp[(2) - (4)].number);
3032  config.floating_minimum_height = (yyvsp[(4) - (4)].number);
3033  }
3034  break;
3035 
3036  case 122:
3037 
3038 /* Line 1806 of yacc.c */
3039 #line 1323 "src/cfgparse.y"
3040  {
3041  DLOG("floating modifier = %d\n", (yyvsp[(2) - (2)].number));
3042  config.floating_modifier = (yyvsp[(2) - (2)].number);
3043  }
3044  break;
3045 
3046  case 123:
3047 
3048 /* Line 1806 of yacc.c */
3049 #line 1331 "src/cfgparse.y"
3050  {
3051  DLOG("New containers should start with split direction %d\n", (yyvsp[(2) - (2)].number));
3052  config.default_orientation = (yyvsp[(2) - (2)].number);
3053  }
3054  break;
3055 
3056  case 124:
3057 
3058 /* Line 1806 of yacc.c */
3059 #line 1338 "src/cfgparse.y"
3060  { (yyval.number) = HORIZ; }
3061  break;
3062 
3063  case 125:
3064 
3065 /* Line 1806 of yacc.c */
3066 #line 1339 "src/cfgparse.y"
3067  { (yyval.number) = VERT; }
3068  break;
3069 
3070  case 126:
3071 
3072 /* Line 1806 of yacc.c */
3073 #line 1340 "src/cfgparse.y"
3074  { (yyval.number) = NO_ORIENTATION; }
3075  break;
3076 
3077  case 127:
3078 
3079 /* Line 1806 of yacc.c */
3080 #line 1345 "src/cfgparse.y"
3081  {
3082  DLOG("new containers will be in mode %d\n", (yyvsp[(2) - (2)].number));
3083  config.default_layout = (yyvsp[(2) - (2)].number);
3084 
3085 #if 0
3086  /* We also need to change the layout of the already existing
3087  * workspaces here. Workspaces may exist at this point because
3088  * of the other directives which are modifying workspaces
3089  * (setting the preferred screen or name). While the workspace
3090  * objects are already created, they have never been used.
3091  * Thus, the user very likely awaits the default container mode
3092  * to trigger in this case, regardless of where it is inside
3093  * his configuration file. */
3094  Workspace *ws;
3095  TAILQ_FOREACH(ws, workspaces, workspaces) {
3096  if (ws->table == NULL)
3097  continue;
3098  switch_layout_mode(global_conn,
3099  ws->table[0][0],
3100  config.container_mode);
3101  }
3102 #endif
3103  }
3104  break;
3105 
3106  case 128:
3107 
3108 /* Line 1806 of yacc.c */
3109 #line 1369 "src/cfgparse.y"
3110  {
3111  DLOG("stack-limit %d with val %d\n", (yyvsp[(3) - (4)].number), (yyvsp[(4) - (4)].number));
3112  config.container_stack_limit = (yyvsp[(3) - (4)].number);
3113  config.container_stack_limit_value = (yyvsp[(4) - (4)].number);
3114 
3115 #if 0
3116  /* See the comment above */
3117  Workspace *ws;
3118  TAILQ_FOREACH(ws, workspaces, workspaces) {
3119  if (ws->table == NULL)
3120  continue;
3121  Container *con = ws->table[0][0];
3122  con->stack_limit = config.container_stack_limit;
3123  con->stack_limit_value = config.container_stack_limit_value;
3124  }
3125 #endif
3126  }
3127  break;
3128 
3129  case 129:
3130 
3131 /* Line 1806 of yacc.c */
3132 #line 1389 "src/cfgparse.y"
3133  { (yyval.number) = L_DEFAULT; }
3134  break;
3135 
3136  case 130:
3137 
3138 /* Line 1806 of yacc.c */
3139 #line 1390 "src/cfgparse.y"
3140  { (yyval.number) = L_STACKED; }
3141  break;
3142 
3143  case 131:
3144 
3145 /* Line 1806 of yacc.c */
3146 #line 1391 "src/cfgparse.y"
3147  { (yyval.number) = L_TABBED; }
3148  break;
3149 
3150  case 132:
3151 
3152 /* Line 1806 of yacc.c */
3153 #line 1396 "src/cfgparse.y"
3154  {
3155  DLOG("new windows should start with border style %d\n", (yyvsp[(2) - (2)].number));
3156  config.default_border = (yyvsp[(2) - (2)].number);
3157  }
3158  break;
3159 
3160  case 133:
3161 
3162 /* Line 1806 of yacc.c */
3163 #line 1404 "src/cfgparse.y"
3164  {
3165  DLOG("new floating windows should start with border style %d\n", (yyvsp[(2) - (2)].number));
3166  config.default_floating_border = (yyvsp[(2) - (2)].number);
3167  }
3168  break;
3169 
3170  case 134:
3171 
3172 /* Line 1806 of yacc.c */
3173 #line 1411 "src/cfgparse.y"
3174  { (yyval.number) = BS_NORMAL; }
3175  break;
3176 
3177  case 135:
3178 
3179 /* Line 1806 of yacc.c */
3180 #line 1412 "src/cfgparse.y"
3181  { (yyval.number) = BS_NONE; }
3182  break;
3183 
3184  case 136:
3185 
3186 /* Line 1806 of yacc.c */
3187 #line 1413 "src/cfgparse.y"
3188  { (yyval.number) = BS_1PIXEL; }
3189  break;
3190 
3191  case 137:
3192 
3193 /* Line 1806 of yacc.c */
3194 #line 1418 "src/cfgparse.y"
3195  {
3196  (yyval.number) = ((yyvsp[(1) - (1)].number) == 1);
3197  }
3198  break;
3199 
3200  case 138:
3201 
3202 /* Line 1806 of yacc.c */
3203 #line 1422 "src/cfgparse.y"
3204  {
3205  DLOG("checking word \"%s\"\n", (yyvsp[(1) - (1)].string));
3206  (yyval.number) = (strcasecmp((yyvsp[(1) - (1)].string), "yes") == 0 ||
3207  strcasecmp((yyvsp[(1) - (1)].string), "true") == 0 ||
3208  strcasecmp((yyvsp[(1) - (1)].string), "on") == 0 ||
3209  strcasecmp((yyvsp[(1) - (1)].string), "enable") == 0 ||
3210  strcasecmp((yyvsp[(1) - (1)].string), "active") == 0);
3211  }
3212  break;
3213 
3214  case 139:
3215 
3216 /* Line 1806 of yacc.c */
3217 #line 1434 "src/cfgparse.y"
3218  {
3219  DLOG("focus follows mouse = %d\n", (yyvsp[(2) - (2)].number));
3220  config.disable_focus_follows_mouse = !((yyvsp[(2) - (2)].number));
3221  }
3222  break;
3223 
3224  case 140:
3225 
3226 /* Line 1806 of yacc.c */
3227 #line 1442 "src/cfgparse.y"
3228  {
3229  DLOG("force focus wrapping = %d\n", (yyvsp[(2) - (2)].number));
3230  config.force_focus_wrapping = (yyvsp[(2) - (2)].number);
3231  }
3232  break;
3233 
3234  case 141:
3235 
3236 /* Line 1806 of yacc.c */
3237 #line 1450 "src/cfgparse.y"
3238  {
3239  DLOG("force xinerama = %d\n", (yyvsp[(2) - (2)].number));
3240  config.force_xinerama = (yyvsp[(2) - (2)].number);
3241  }
3242  break;
3243 
3244  case 142:
3245 
3246 /* Line 1806 of yacc.c */
3247 #line 1458 "src/cfgparse.y"
3248  {
3249  DLOG("fake outputs = %s\n", (yyvsp[(2) - (2)].string));
3250  config.fake_outputs = (yyvsp[(2) - (2)].string);
3251  }
3252  break;
3253 
3254  case 143:
3255 
3256 /* Line 1806 of yacc.c */
3257 #line 1466 "src/cfgparse.y"
3258  {
3259  DLOG("automatic workspace back-and-forth = %d\n", (yyvsp[(2) - (2)].number));
3260  config.workspace_auto_back_and_forth = (yyvsp[(2) - (2)].number);
3261  }
3262  break;
3263 
3264  case 144:
3265 
3266 /* Line 1806 of yacc.c */
3267 #line 1474 "src/cfgparse.y"
3268  {
3269  DLOG("workspace bar = %d\n", (yyvsp[(2) - (2)].number));
3270  config.disable_workspace_bar = !((yyvsp[(2) - (2)].number));
3271  }
3272  break;
3273 
3274  case 145:
3275 
3276 /* Line 1806 of yacc.c */
3277 #line 1482 "src/cfgparse.y"
3278  {
3279  char *ws_name = (yyvsp[(2) - (5)].string);
3280 
3281  if ((yyvsp[(5) - (5)].string) != NULL) {
3282  ELOG("The old (v3) syntax workspace <number> output <output> <name> is deprecated.\n");
3283  ELOG("Please use the new syntax: workspace \"<workspace>\" output <output>\n");
3284  ELOG("In your case, the following should work:\n");
3285  ELOG(" workspace \"%s\" output %s\n", (yyvsp[(5) - (5)].string), (yyvsp[(4) - (5)].string));
3286  ws_name = (yyvsp[(5) - (5)].string);
3287  context->has_warnings = true;
3288  }
3289 
3290  DLOG("Assigning workspace \"%s\" to output \"%s\"\n", ws_name, (yyvsp[(4) - (5)].string));
3291  /* Check for earlier assignments of the same workspace so that we
3292  * don’t have assignments of a single workspace to different
3293  * outputs */
3294  struct Workspace_Assignment *assignment;
3295  bool duplicate = false;
3297  if (strcasecmp(assignment->name, ws_name) == 0) {
3298  ELOG("You have a duplicate workspace assignment for workspace \"%s\"\n",
3299  ws_name);
3300  assignment->output = (yyvsp[(4) - (5)].string);
3301  duplicate = true;
3302  }
3303  }
3304  if (!duplicate) {
3305  assignment = scalloc(sizeof(struct Workspace_Assignment));
3306  assignment->name = ws_name;
3307  assignment->output = (yyvsp[(4) - (5)].string);
3309  }
3310  }
3311  break;
3312 
3313  case 146:
3314 
3315 /* Line 1806 of yacc.c */
3316 #line 1516 "src/cfgparse.y"
3317  {
3318  int ws_num = (yyvsp[(2) - (3)].number);
3319  if (ws_num < 1) {
3320  DLOG("Invalid workspace assignment, workspace number %d out of range\n", ws_num);
3321  } else {
3322  DLOG("workspace name to: %s\n", (yyvsp[(3) - (3)].string));
3323 #if 0
3324  if ((yyvsp[(3) - (3)].string) != NULL) {
3325  workspace_set_name(workspace_get(ws_num - 1), (yyvsp[(3) - (3)].string));
3326  free((yyvsp[(3) - (3)].string));
3327  }
3328 #endif
3329  }
3330  }
3331  break;
3332 
3333  case 147:
3334 
3335 /* Line 1806 of yacc.c */
3336 #line 1533 "src/cfgparse.y"
3337  { (yyval.string) = NULL; }
3338  break;
3339 
3340  case 148:
3341 
3342 /* Line 1806 of yacc.c */
3343 #line 1534 "src/cfgparse.y"
3344  { (yyval.string) = (yyvsp[(1) - (1)].string); }
3345  break;
3346 
3347  case 149:
3348 
3349 /* Line 1806 of yacc.c */
3350 #line 1538 "src/cfgparse.y"
3351  { (yyval.string) = (yyvsp[(1) - (1)].string); }
3352  break;
3353 
3354  case 150:
3355 
3356 /* Line 1806 of yacc.c */
3357 #line 1539 "src/cfgparse.y"
3358  { (yyval.string) = (yyvsp[(1) - (1)].string); }
3359  break;
3360 
3361  case 151:
3362 
3363 /* Line 1806 of yacc.c */
3364 #line 1540 "src/cfgparse.y"
3365  { (yyval.string) = (yyvsp[(1) - (1)].string); }
3366  break;
3367 
3368  case 152:
3369 
3370 /* Line 1806 of yacc.c */
3371 #line 1545 "src/cfgparse.y"
3372  {
3373  /* This is the old, deprecated form of assignments. It’s provided for
3374  * compatibility in version (4.1, 4.2, 4.3) and will be removed
3375  * afterwards. It triggers an i3-nagbar warning starting from 4.1. */
3376  ELOG("You are using the old assign syntax (without criteria). "
3377  "Please see the User's Guide for the new syntax and fix "
3378  "your config file.\n");
3379  context->has_warnings = true;
3380  printf("assignment of %s to *%s*\n", (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].string));
3381  char *workspace = (yyvsp[(3) - (3)].string);
3382  char *criteria = (yyvsp[(2) - (3)].string);
3383 
3384  Assignment *assignment = scalloc(sizeof(Assignment));
3385  Match *match = &(assignment->match);
3386  match_init(match);
3387 
3388  char *separator = NULL;
3389  if ((separator = strchr(criteria, '/')) != NULL) {
3390  *(separator++) = '\0';
3391  char *pattern;
3392  sasprintf(&pattern, "(?i)%s", separator);
3393  match->title = regex_new(pattern);
3394  free(pattern);
3395  printf(" title = %s\n", separator);
3396  }
3397  if (*criteria != '\0') {
3398  char *pattern;
3399  sasprintf(&pattern, "(?i)%s", criteria);
3400  match->class = regex_new(pattern);
3401  free(pattern);
3402  printf(" class = %s\n", criteria);
3403  }
3404  free(criteria);
3405 
3406  /* Compatibility with older versions: If the assignment target starts
3407  * with ~, we create the equivalent of:
3408  *
3409  * for_window [class="foo"] floating enable
3410  */
3411  if (*workspace == '~') {
3412  workspace++;
3413  if (*workspace == '\0') {
3414  /* This assignment was *only* for floating */
3415  assignment->type = A_COMMAND;
3416  assignment->dest.command = sstrdup("floating enable");
3417  TAILQ_INSERT_TAIL(&assignments, assignment, assignments);
3418  break;
3419  } else {
3420  /* Create a new assignment and continue afterwards */
3421  Assignment *floating = scalloc(sizeof(Assignment));
3422  match_copy(&(floating->match), match);
3423  floating->type = A_COMMAND;
3424  floating->dest.command = sstrdup("floating enable");
3426  }
3427  }
3428 
3429  assignment->type = A_TO_WORKSPACE;
3430  assignment->dest.workspace = workspace;
3431  TAILQ_INSERT_TAIL(&assignments, assignment, assignments);
3432  }
3433  break;
3434 
3435  case 153:
3436 
3437 /* Line 1806 of yacc.c */
3438 #line 1607 "src/cfgparse.y"
3439  {
3440  if (match_is_empty(&current_match)) {
3441  ELOG("Match is empty, ignoring this assignment\n");
3442  break;
3443  }
3444  printf("new assignment, using above criteria, to workspace %s\n", (yyvsp[(3) - (3)].string));
3445  Assignment *assignment = scalloc(sizeof(Assignment));
3446  assignment->match = current_match;
3447  assignment->type = A_TO_WORKSPACE;
3448  assignment->dest.workspace = (yyvsp[(3) - (3)].string);
3449  TAILQ_INSERT_TAIL(&assignments, assignment, assignments);
3450  }
3451  break;
3452 
3453  case 156:
3454 
3455 /* Line 1806 of yacc.c */
3456 #line 1628 "src/cfgparse.y"
3457  {
3458  config.ipc_socket_path = (yyvsp[(2) - (2)].string);
3459  }
3460  break;
3461 
3462  case 157:
3463 
3464 /* Line 1806 of yacc.c */
3465 #line 1635 "src/cfgparse.y"
3466  {
3467  config.restart_state_path = (yyvsp[(2) - (2)].string);
3468  }
3469  break;
3470 
3471  case 158:
3472 
3473 /* Line 1806 of yacc.c */
3474 #line 1642 "src/cfgparse.y"
3475  {
3476  struct Autostart *new = smalloc(sizeof(struct Autostart));
3477  new->command = (yyvsp[(3) - (3)].string);
3478  new->no_startup_id = (yyvsp[(2) - (3)].number);
3480  }
3481  break;
3482 
3483  case 159:
3484 
3485 /* Line 1806 of yacc.c */
3486 #line 1652 "src/cfgparse.y"
3487  {
3488  struct Autostart *new = smalloc(sizeof(struct Autostart));
3489  new->command = (yyvsp[(3) - (3)].string);
3490  new->no_startup_id = (yyvsp[(2) - (3)].number);
3492  }
3493  break;
3494 
3495  case 160:
3496 
3497 /* Line 1806 of yacc.c */
3498 #line 1661 "src/cfgparse.y"
3499  { (yyval.number) = false; }
3500  break;
3501 
3502  case 161:
3503 
3504 /* Line 1806 of yacc.c */
3505 #line 1662 "src/cfgparse.y"
3506  { (yyval.number) = true; }
3507  break;
3508 
3509  case 162:
3510 
3511 /* Line 1806 of yacc.c */
3512 #line 1667 "src/cfgparse.y"
3513  {
3514  ELOG("The terminal option is DEPRECATED and has no effect. "
3515  "Please remove it from your configuration file.\n");
3516  }
3517  break;
3518 
3519  case 163:
3520 
3521 /* Line 1806 of yacc.c */
3522 #line 1675 "src/cfgparse.y"
3523  {
3524  config.font = load_font((yyvsp[(2) - (2)].string), true);
3525  set_font(&config.font);
3526  printf("font %s\n", (yyvsp[(2) - (2)].string));
3527  FREE(font_pattern);
3528  font_pattern = (yyvsp[(2) - (2)].string);
3529  }
3530  break;
3531 
3532  case 164:
3533 
3534 /* Line 1806 of yacc.c */
3535 #line 1686 "src/cfgparse.y"
3536  {
3537  uint32_t *dest = (yyvsp[(1) - (2)].single_color);
3538  *dest = (yyvsp[(2) - (2)].number);
3539  }
3540  break;
3541 
3542  case 165:
3543 
3544 /* Line 1806 of yacc.c */
3545 #line 1694 "src/cfgparse.y"
3546  {
3547  struct Colortriple *dest = (yyvsp[(1) - (4)].color);
3548 
3549  dest->border = (yyvsp[(2) - (4)].number);
3550  dest->background = (yyvsp[(3) - (4)].number);
3551  dest->text = (yyvsp[(4) - (4)].number);
3552  }
3553  break;
3554 
3555  case 166:
3556 
3557 /* Line 1806 of yacc.c */
3558 #line 1702 "src/cfgparse.y"
3559  {
3560  struct Colortriple *dest = (yyvsp[(1) - (5)].color);
3561 
3562  dest->border = (yyvsp[(2) - (5)].number);
3563  dest->background = (yyvsp[(3) - (5)].number);
3564  dest->text = (yyvsp[(4) - (5)].number);
3565  dest->indicator = (yyvsp[(5) - (5)].number);
3566  }
3567  break;
3568 
3569  case 167:
3570 
3571 /* Line 1806 of yacc.c */
3572 #line 1714 "src/cfgparse.y"
3573  {
3574  (yyval.number) = get_colorpixel((yyvsp[(1) - (1)].string));
3575  free((yyvsp[(1) - (1)].string));
3576  }
3577  break;
3578 
3579  case 168:
3580 
3581 /* Line 1806 of yacc.c */
3582 #line 1722 "src/cfgparse.y"
3583  { (yyval.number) = 0; }
3584  break;
3585 
3586  case 170:
3587 
3588 /* Line 1806 of yacc.c */
3589 #line 1724 "src/cfgparse.y"
3590  { (yyval.number) = (yyvsp[(1) - (3)].number) | (yyvsp[(3) - (3)].number); }
3591  break;
3592 
3593  case 171:
3594 
3595 /* Line 1806 of yacc.c */
3596 #line 1725 "src/cfgparse.y"
3597  { (yyval.number) = (yyvsp[(1) - (2)].number); }
3598  break;
3599 
3600  case 172:
3601 
3602 /* Line 1806 of yacc.c */
3603 #line 1729 "src/cfgparse.y"
3604  { (yyval.number) = (yyvsp[(1) - (1)].number); }
3605  break;
3606 
3607  case 173:
3608 
3609 /* Line 1806 of yacc.c */
3610 #line 1730 "src/cfgparse.y"
3611  { (yyval.number) = BIND_CONTROL; }
3612  break;
3613 
3614  case 174:
3615 
3616 /* Line 1806 of yacc.c */
3617 #line 1731 "src/cfgparse.y"
3618  { (yyval.number) = BIND_SHIFT; }
3619  break;
3620 
3621  case 175:
3622 
3623 /* Line 1806 of yacc.c */
3624 #line 1736 "src/cfgparse.y"
3625  {
3626  DLOG("popup_during_fullscreen setting: %d\n", (yyvsp[(2) - (2)].number));
3627  config.popup_during_fullscreen = (yyvsp[(2) - (2)].number);
3628  }
3629  break;
3630 
3631  case 176:
3632 
3633 /* Line 1806 of yacc.c */
3634 #line 1743 "src/cfgparse.y"
3635  { (yyval.number) = PDF_IGNORE; }
3636  break;
3637 
3638  case 177:
3639 
3640 /* Line 1806 of yacc.c */
3641 #line 1744 "src/cfgparse.y"
3642  { (yyval.number) = PDF_LEAVE_FULLSCREEN; }
3643  break;
3644 
3645 
3646 
3647 /* Line 1806 of yacc.c */
3648 #line 3649 "src/cfgparse.tab.c"
3649  default: break;
3650  }
3651  /* User semantic actions sometimes alter yychar, and that requires
3652  that yytoken be updated with the new translation. We take the
3653  approach of translating immediately before every use of yytoken.
3654  One alternative is translating here after every semantic action,
3655  but that translation would be missed if the semantic action invokes
3656  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3657  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3658  incorrect destructor might then be invoked immediately. In the
3659  case of YYERROR or YYBACKUP, subsequent parser actions might lead
3660  to an incorrect destructor call or verbose syntax error message
3661  before the lookahead is translated. */
3662  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
3663 
3664  YYPOPSTACK (yylen);
3665  yylen = 0;
3666  YY_STACK_PRINT (yyss, yyssp);
3667 
3668  *++yyvsp = yyval;
3669 
3670  /* Now `shift' the result of the reduction. Determine what state
3671  that goes to, based on the state we popped back to and the rule
3672  number reduced by. */
3673 
3674  yyn = yyr1[yyn];
3675 
3676  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
3677  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3678  yystate = yytable[yystate];
3679  else
3680  yystate = yydefgoto[yyn - YYNTOKENS];
3681 
3682  goto yynewstate;
3683 
3684 
3685 /*------------------------------------.
3686 | yyerrlab -- here on detecting error |
3687 `------------------------------------*/
3688 yyerrlab:
3689  /* Make sure we have latest lookahead translation. See comments at
3690  user semantic actions for why this is necessary. */
3691  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
3692 
3693  /* If not already recovering from an error, report this error. */
3694  if (!yyerrstatus)
3695  {
3696  ++yynerrs;
3697 #if ! YYERROR_VERBOSE
3698  yyerror (YY_("syntax error"));
3699 #else
3700 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3701  yyssp, yytoken)
3702  {
3703  char const *yymsgp = YY_("syntax error");
3704  int yysyntax_error_status;
3705  yysyntax_error_status = YYSYNTAX_ERROR;
3706  if (yysyntax_error_status == 0)
3707  yymsgp = yymsg;
3708  else if (yysyntax_error_status == 1)
3709  {
3710  if (yymsg != yymsgbuf)
3711  YYSTACK_FREE (yymsg);
3712  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
3713  if (!yymsg)
3714  {
3715  yymsg = yymsgbuf;
3716  yymsg_alloc = sizeof yymsgbuf;
3717  yysyntax_error_status = 2;
3718  }
3719  else
3720  {
3721  yysyntax_error_status = YYSYNTAX_ERROR;
3722  yymsgp = yymsg;
3723  }
3724  }
3725  yyerror (yymsgp);
3726  if (yysyntax_error_status == 2)
3727  goto yyexhaustedlab;
3728  }
3729 # undef YYSYNTAX_ERROR
3730 #endif
3731  }
3732 
3733 
3734 
3735  if (yyerrstatus == 3)
3736  {
3737  /* If just tried and failed to reuse lookahead token after an
3738  error, discard it. */
3739 
3740  if (yychar <= YYEOF)
3741  {
3742  /* Return failure if at end of input. */
3743  if (yychar == YYEOF)
3744  YYABORT;
3745  }
3746  else
3747  {
3748  yydestruct ("Error: discarding",
3749  yytoken, &yylval);
3750  yychar = YYEMPTY;
3751  }
3752  }
3753 
3754  /* Else will try to reuse lookahead token after shifting the error
3755  token. */
3756  goto yyerrlab1;
3757 
3758 
3759 /*---------------------------------------------------.
3760 | yyerrorlab -- error raised explicitly by YYERROR. |
3761 `---------------------------------------------------*/
3762 yyerrorlab:
3763 
3764  /* Pacify compilers like GCC when the user code never invokes
3765  YYERROR and the label yyerrorlab therefore never appears in user
3766  code. */
3767  if (/*CONSTCOND*/ 0)
3768  goto yyerrorlab;
3769 
3770  /* Do not reclaim the symbols of the rule which action triggered
3771  this YYERROR. */
3772  YYPOPSTACK (yylen);
3773  yylen = 0;
3774  YY_STACK_PRINT (yyss, yyssp);
3775  yystate = *yyssp;
3776  goto yyerrlab1;
3777 
3778 
3779 /*-------------------------------------------------------------.
3780 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3781 `-------------------------------------------------------------*/
3782 yyerrlab1:
3783  yyerrstatus = 3; /* Each real token shifted decrements this. */
3784 
3785  for (;;)
3786  {
3787  yyn = yypact[yystate];
3788  if (!yypact_value_is_default (yyn))
3789  {
3790  yyn += YYTERROR;
3791  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3792  {
3793  yyn = yytable[yyn];
3794  if (0 < yyn)
3795  break;
3796  }
3797  }
3798 
3799  /* Pop the current state because it cannot handle the error token. */
3800  if (yyssp == yyss)
3801  YYABORT;
3802 
3803 
3804  yydestruct ("Error: popping",
3805  yystos[yystate], yyvsp);
3806  YYPOPSTACK (1);
3807  yystate = *yyssp;
3808  YY_STACK_PRINT (yyss, yyssp);
3809  }
3810 
3811  *++yyvsp = yylval;
3812 
3813 
3814  /* Shift the error token. */
3815  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3816 
3817  yystate = yyn;
3818  goto yynewstate;
3819 
3820 
3821 /*-------------------------------------.
3822 | yyacceptlab -- YYACCEPT comes here. |
3823 `-------------------------------------*/
3824 yyacceptlab:
3825  yyresult = 0;
3826  goto yyreturn;
3827 
3828 /*-----------------------------------.
3829 | yyabortlab -- YYABORT comes here. |
3830 `-----------------------------------*/
3831 yyabortlab:
3832  yyresult = 1;
3833  goto yyreturn;
3834 
3835 #if !defined(yyoverflow) || YYERROR_VERBOSE
3836 /*-------------------------------------------------.
3837 | yyexhaustedlab -- memory exhaustion comes here. |
3838 `-------------------------------------------------*/
3839 yyexhaustedlab:
3840  yyerror (YY_("memory exhausted"));
3841  yyresult = 2;
3842  /* Fall through. */
3843 #endif
3844 
3845 yyreturn:
3846  if (yychar != YYEMPTY)
3847  {
3848  /* Make sure we have latest lookahead translation. See comments at
3849  user semantic actions for why this is necessary. */
3850  yytoken = YYTRANSLATE (yychar);
3851  yydestruct ("Cleanup: discarding lookahead",
3852  yytoken, &yylval);
3853  }
3854  /* Do not reclaim the symbols of the rule which action triggered
3855  this YYABORT or YYACCEPT. */
3856  YYPOPSTACK (yylen);
3857  YY_STACK_PRINT (yyss, yyssp);
3858  while (yyssp != yyss)
3859  {
3860  yydestruct ("Cleanup: popping",
3861  yystos[*yyssp], yyvsp);
3862  YYPOPSTACK (1);
3863  }
3864 #ifndef yyoverflow
3865  if (yyss != yyssa)
3866  YYSTACK_FREE (yyss);
3867 #endif
3868 #if YYERROR_VERBOSE
3869  if (yymsg != yymsgbuf)
3870  YYSTACK_FREE (yymsg);
3871 #endif
3872  /* Make sure YYID is used. */
3873  return YYID (yyresult);
3874 }
3875 
3876 
3877