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