• Main Page
  • Data Structures
  • Files
  • File List
  • Globals

src/cfgparse.tab.c

Go to the documentation of this file.
00001 /* A Bison parser, made by GNU Bison 2.4.3.  */
00002 
00003 /* Skeleton implementation for Bison's Yacc-like parsers in C
00004    
00005       Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
00006    2009, 2010 Free Software Foundation, Inc.
00007    
00008    This program is free software: you can redistribute it and/or modify
00009    it under the terms of the GNU General Public License as published by
00010    the Free Software Foundation, either version 3 of the License, or
00011    (at your option) any later version.
00012    
00013    This program is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016    GNU General Public License for more details.
00017    
00018    You should have received a copy of the GNU General Public License
00019    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00020 
00021 /* As a special exception, you may create a larger work that contains
00022    part or all of the Bison parser skeleton and distribute that work
00023    under terms of your choice, so long as that work isn't itself a
00024    parser generator using the skeleton or a modified version thereof
00025    as a parser skeleton.  Alternatively, if you modify or redistribute
00026    the parser skeleton itself, you may (at your option) remove this
00027    special exception, which will cause the skeleton and the resulting
00028    Bison output files to be licensed under the GNU General Public
00029    License without this special exception.
00030    
00031    This special exception was added by the Free Software Foundation in
00032    version 2.2 of Bison.  */
00033 
00034 /* C LALR(1) parser skeleton written by Richard Stallman, by
00035    simplifying the original so-called "semantic" parser.  */
00036 
00037 /* All symbols defined below should begin with yy or YY, to avoid
00038    infringing on user name space.  This should be done even for local
00039    variables, as they might otherwise be expanded by user macros.
00040    There are some unavoidable exceptions within include files to
00041    define necessary library symbols; they are noted "INFRINGES ON
00042    USER NAME SPACE" below.  */
00043 
00044 /* Identify Bison output.  */
00045 #define YYBISON 1
00046 
00047 /* Bison version.  */
00048 #define YYBISON_VERSION "2.4.3"
00049 
00050 /* Skeleton name.  */
00051 #define YYSKELETON_NAME "yacc.c"
00052 
00053 /* Pure parsers.  */
00054 #define YYPURE 0
00055 
00056 /* Push parsers.  */
00057 #define YYPUSH 0
00058 
00059 /* Pull parsers.  */
00060 #define YYPULL 1
00061 
00062 /* Using locations.  */
00063 #define YYLSP_NEEDED 0
00064 
00065 
00066 
00067 /* Copy the first part of user declarations.  */
00068 
00069 /* Line 189 of yacc.c  */
00070 #line 1 "src/cfgparse.y"
00071 
00072 /*
00073  * vim:ts=8:expandtab
00074  *
00075  */
00076 #include <stdio.h>
00077 #include <string.h>
00078 #include <xcb/xcb.h>
00079 #include <sys/types.h>
00080 #include <sys/stat.h>
00081 #include <unistd.h>
00082 #include <fcntl.h>
00083 #include <stdlib.h>
00084 #include <errno.h>
00085 
00086 #include "data.h"
00087 #include "config.h"
00088 #include "i3.h"
00089 #include "util.h"
00090 #include "queue.h"
00091 #include "table.h"
00092 #include "workspace.h"
00093 #include "xcb.h"
00094 #include "log.h"
00095 
00096 typedef struct yy_buffer_state *YY_BUFFER_STATE;
00097 extern int yylex(struct context *context);
00098 extern int yyparse(void);
00099 extern FILE *yyin;
00100 YY_BUFFER_STATE yy_scan_string(const char *);
00101 
00102 static struct bindings_head *current_bindings;
00103 static struct context *context;
00104 
00105 /* We don’t need yydebug for now, as we got decent error messages using
00106  * yyerror(). Should you ever want to extend the parser, it might be handy
00107  * to just comment it in again, so it stays here. */
00108 //int yydebug = 1;
00109 
00110 void yyerror(const char *error_message) {
00111         ELOG("\n");
00112         ELOG("CONFIG: %s\n", error_message);
00113         ELOG("CONFIG: in file \"%s\", line %d:\n",
00114                 context->filename, context->line_number);
00115         ELOG("CONFIG:   %s\n", context->line_copy);
00116         ELOG("CONFIG:   ");
00117         for (int c = 1; c <= context->last_column; c++)
00118                 if (c >= context->first_column)
00119                         printf("^");
00120                 else printf(" ");
00121         printf("\n");
00122         ELOG("\n");
00123 }
00124 
00125 int yywrap() {
00126         return 1;
00127 }
00128 
00129 void parse_file(const char *f) {
00130         SLIST_HEAD(variables_head, Variable) variables = SLIST_HEAD_INITIALIZER(&variables);
00131         int fd, ret, read_bytes = 0;
00132         struct stat stbuf;
00133         char *buf;
00134         FILE *fstr;
00135         char buffer[1026], key[512], value[512];
00136 
00137         if ((fd = open(f, O_RDONLY)) == -1)
00138                 die("Could not open configuration file: %s\n", strerror(errno));
00139 
00140         if (fstat(fd, &stbuf) == -1)
00141                 die("Could not fstat file: %s\n", strerror(errno));
00142 
00143         buf = scalloc((stbuf.st_size + 1) * sizeof(char));
00144         while (read_bytes < stbuf.st_size) {
00145                 if ((ret = read(fd, buf + read_bytes, (stbuf.st_size - read_bytes))) < 0)
00146                         die("Could not read(): %s\n", strerror(errno));
00147                 read_bytes += ret;
00148         }
00149 
00150         if (lseek(fd, 0, SEEK_SET) == (off_t)-1)
00151                 die("Could not lseek: %s\n", strerror(errno));
00152 
00153         if ((fstr = fdopen(fd, "r")) == NULL)
00154                 die("Could not fdopen: %s\n", strerror(errno));
00155 
00156         while (!feof(fstr)) {
00157                 if (fgets(buffer, 1024, fstr) == NULL) {
00158                         if (feof(fstr))
00159                                 break;
00160                         die("Could not read configuration file\n");
00161                 }
00162 
00163                 /* sscanf implicitly strips whitespace. Also, we skip comments and empty lines. */
00164                 if (sscanf(buffer, "%s %[^\n]", key, value) < 1 ||
00165                     key[0] == '#' || strlen(key) < 3)
00166                         continue;
00167 
00168                 if (strcasecmp(key, "set") == 0) {
00169                         if (value[0] != '$')
00170                                 die("Malformed variable assignment, name has to start with $\n");
00171 
00172                         /* get key/value for this variable */
00173                         char *v_key = value, *v_value;
00174                         if ((v_value = strstr(value, " ")) == NULL)
00175                                 die("Malformed variable assignment, need a value\n");
00176 
00177                         *(v_value++) = '\0';
00178 
00179                         struct Variable *new = scalloc(sizeof(struct Variable));
00180                         new->key = sstrdup(v_key);
00181                         new->value = sstrdup(v_value);
00182                         SLIST_INSERT_HEAD(&variables, new, variables);
00183                         DLOG("Got new variable %s = %s\n", v_key, v_value);
00184                         continue;
00185                 }
00186         }
00187 
00188         /* For every custom variable, see how often it occurs in the file and
00189          * how much extra bytes it requires when replaced. */
00190         struct Variable *current, *nearest;
00191         int extra_bytes = 0;
00192         SLIST_FOREACH(current, &variables, variables) {
00193                 int extra = (strlen(current->value) - strlen(current->key));
00194                 char *next;
00195                 for (next = buf;
00196                      (next = strcasestr(buf + (next - buf), current->key)) != NULL;
00197                      next += strlen(current->key))
00198                         extra_bytes += extra;
00199         }
00200 
00201         /* Then, allocate a new buffer and copy the file over to the new one,
00202          * but replace occurences of our variables */
00203         char *walk = buf, *destwalk;
00204         char *new = smalloc((stbuf.st_size + extra_bytes + 1) * sizeof(char));
00205         destwalk = new;
00206         while (walk < (buf + stbuf.st_size)) {
00207                 /* Find the next variable */
00208                 SLIST_FOREACH(current, &variables, variables)
00209                         current->next_match = strcasestr(walk, current->key);
00210                 nearest = NULL;
00211                 int distance = stbuf.st_size;
00212                 SLIST_FOREACH(current, &variables, variables) {
00213                         if (current->next_match == NULL)
00214                                 continue;
00215                         if ((current->next_match - walk) < distance) {
00216                                 distance = (current->next_match - walk);
00217                                 nearest = current;
00218                         }
00219                 }
00220                 if (nearest == NULL) {
00221                         /* If there are no more variables, we just copy the rest */
00222                         strncpy(destwalk, walk, (buf + stbuf.st_size) - walk);
00223                         destwalk += (buf + stbuf.st_size) - walk;
00224                         *destwalk = '\0';
00225                         break;
00226                 } else {
00227                         /* Copy until the next variable, then copy its value */
00228                         strncpy(destwalk, walk, distance);
00229                         strncpy(destwalk + distance, nearest->value, strlen(nearest->value));
00230                         walk += distance + strlen(nearest->key);
00231                         destwalk += distance + strlen(nearest->value);
00232                 }
00233         }
00234 
00235         yy_scan_string(new);
00236 
00237         context = scalloc(sizeof(struct context));
00238         context->filename = f;
00239 
00240         if (yyparse() != 0) {
00241                 fprintf(stderr, "Could not parse configfile\n");
00242                 exit(1);
00243         }
00244 
00245         FREE(context->line_copy);
00246         free(context);
00247         free(new);
00248         free(buf);
00249 
00250         while (!SLIST_EMPTY(&variables)) {
00251                 current = SLIST_FIRST(&variables);
00252                 FREE(current->key);
00253                 FREE(current->value);
00254                 SLIST_REMOVE_HEAD(&variables, variables);
00255                 FREE(current);
00256         }
00257         fclose(fstr);
00258         close(fd);
00259 }
00260 
00261 
00262 
00263 /* Line 189 of yacc.c  */
00264 #line 265 "src/cfgparse.tab.c"
00265 
00266 /* Enabling traces.  */
00267 #ifndef YYDEBUG
00268 # define YYDEBUG 1
00269 #endif
00270 
00271 /* Enabling verbose error messages.  */
00272 #ifdef YYERROR_VERBOSE
00273 # undef YYERROR_VERBOSE
00274 # define YYERROR_VERBOSE 1
00275 #else
00276 # define YYERROR_VERBOSE 1
00277 #endif
00278 
00279 /* Enabling the token table.  */
00280 #ifndef YYTOKEN_TABLE
00281 # define YYTOKEN_TABLE 0
00282 #endif
00283 
00284 
00285 /* Tokens.  */
00286 #ifndef YYTOKENTYPE
00287 # define YYTOKENTYPE
00288    /* Put the tokens into the symbol table, so that GDB and other debuggers
00289       know about them.  */
00290    enum yytokentype {
00291      NUMBER = 258,
00292      WORD = 259,
00293      STR = 260,
00294      STR_NG = 261,
00295      HEX = 262,
00296      OUTPUT = 263,
00297      TOKBIND = 264,
00298      TOKTERMINAL = 265,
00299      TOKCOMMENT = 266,
00300      TOKFONT = 267,
00301      TOKBINDSYM = 268,
00302      MODIFIER = 269,
00303      TOKCONTROL = 270,
00304      TOKSHIFT = 271,
00305      WHITESPACE = 272,
00306      TOKFLOATING_MODIFIER = 273,
00307      QUOTEDSTRING = 274,
00308      TOKWORKSPACE = 275,
00309      TOKOUTPUT = 276,
00310      TOKASSIGN = 277,
00311      TOKSET = 278,
00312      TOKIPCSOCKET = 279,
00313      TOKEXEC = 280,
00314      TOKCOLOR = 281,
00315      TOKARROW = 282,
00316      TOKMODE = 283,
00317      TOKNEWCONTAINER = 284,
00318      TOKNEWWINDOW = 285,
00319      TOKFOCUSFOLLOWSMOUSE = 286,
00320      TOKWORKSPACEBAR = 287,
00321      TOKCONTAINERMODE = 288,
00322      TOKSTACKLIMIT = 289
00323    };
00324 #endif
00325 
00326 
00327 
00328 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
00329 typedef union YYSTYPE
00330 {
00331 
00332 /* Line 214 of yacc.c  */
00333 #line 197 "src/cfgparse.y"
00334 
00335         int number;
00336         char *string;
00337         struct Colortriple *color;
00338         struct Assignment *assignment;
00339         struct Binding *binding;
00340 
00341 
00342 
00343 /* Line 214 of yacc.c  */
00344 #line 345 "src/cfgparse.tab.c"
00345 } YYSTYPE;
00346 # define YYSTYPE_IS_TRIVIAL 1
00347 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
00348 # define YYSTYPE_IS_DECLARED 1
00349 #endif
00350 
00351 
00352 /* Copy the second part of user declarations.  */
00353 
00354 
00355 /* Line 264 of yacc.c  */
00356 #line 357 "src/cfgparse.tab.c"
00357 
00358 #ifdef short
00359 # undef short
00360 #endif
00361 
00362 #ifdef YYTYPE_UINT8
00363 typedef YYTYPE_UINT8 yytype_uint8;
00364 #else
00365 typedef unsigned char yytype_uint8;
00366 #endif
00367 
00368 #ifdef YYTYPE_INT8
00369 typedef YYTYPE_INT8 yytype_int8;
00370 #elif (defined __STDC__ || defined __C99__FUNC__ \
00371      || defined __cplusplus || defined _MSC_VER)
00372 typedef signed char yytype_int8;
00373 #else
00374 typedef short int yytype_int8;
00375 #endif
00376 
00377 #ifdef YYTYPE_UINT16
00378 typedef YYTYPE_UINT16 yytype_uint16;
00379 #else
00380 typedef unsigned short int yytype_uint16;
00381 #endif
00382 
00383 #ifdef YYTYPE_INT16
00384 typedef YYTYPE_INT16 yytype_int16;
00385 #else
00386 typedef short int yytype_int16;
00387 #endif
00388 
00389 #ifndef YYSIZE_T
00390 # ifdef __SIZE_TYPE__
00391 #  define YYSIZE_T __SIZE_TYPE__
00392 # elif defined size_t
00393 #  define YYSIZE_T size_t
00394 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
00395      || defined __cplusplus || defined _MSC_VER)
00396 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
00397 #  define YYSIZE_T size_t
00398 # else
00399 #  define YYSIZE_T unsigned int
00400 # endif
00401 #endif
00402 
00403 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
00404 
00405 #ifndef YY_
00406 # if defined YYENABLE_NLS && YYENABLE_NLS
00407 #  if ENABLE_NLS
00408 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
00409 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
00410 #  endif
00411 # endif
00412 # ifndef YY_
00413 #  define YY_(msgid) msgid
00414 # endif
00415 #endif
00416 
00417 /* Suppress unused-variable warnings by "using" E.  */
00418 #if ! defined lint || defined __GNUC__
00419 # define YYUSE(e) ((void) (e))
00420 #else
00421 # define YYUSE(e) /* empty */
00422 #endif
00423 
00424 /* Identity function, used to suppress warnings about constant conditions.  */
00425 #ifndef lint
00426 # define YYID(n) (n)
00427 #else
00428 #if (defined __STDC__ || defined __C99__FUNC__ \
00429      || defined __cplusplus || defined _MSC_VER)
00430 static int
00431 YYID (int yyi)
00432 #else
00433 static int
00434 YYID (yyi)
00435     int yyi;
00436 #endif
00437 {
00438   return yyi;
00439 }
00440 #endif
00441 
00442 #if ! defined yyoverflow || YYERROR_VERBOSE
00443 
00444 /* The parser invokes alloca or malloc; define the necessary symbols.  */
00445 
00446 # ifdef YYSTACK_USE_ALLOCA
00447 #  if YYSTACK_USE_ALLOCA
00448 #   ifdef __GNUC__
00449 #    define YYSTACK_ALLOC __builtin_alloca
00450 #   elif defined __BUILTIN_VA_ARG_INCR
00451 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
00452 #   elif defined _AIX
00453 #    define YYSTACK_ALLOC __alloca
00454 #   elif defined _MSC_VER
00455 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
00456 #    define alloca _alloca
00457 #   else
00458 #    define YYSTACK_ALLOC alloca
00459 #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00460      || defined __cplusplus || defined _MSC_VER)
00461 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00462 #     ifndef _STDLIB_H
00463 #      define _STDLIB_H 1
00464 #     endif
00465 #    endif
00466 #   endif
00467 #  endif
00468 # endif
00469 
00470 # ifdef YYSTACK_ALLOC
00471    /* Pacify GCC's `empty if-body' warning.  */
00472 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
00473 #  ifndef YYSTACK_ALLOC_MAXIMUM
00474     /* The OS might guarantee only one guard page at the bottom of the stack,
00475        and a page size can be as small as 4096 bytes.  So we cannot safely
00476        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
00477        to allow for a few compiler-allocated temporary stack slots.  */
00478 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
00479 #  endif
00480 # else
00481 #  define YYSTACK_ALLOC YYMALLOC
00482 #  define YYSTACK_FREE YYFREE
00483 #  ifndef YYSTACK_ALLOC_MAXIMUM
00484 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
00485 #  endif
00486 #  if (defined __cplusplus && ! defined _STDLIB_H \
00487        && ! ((defined YYMALLOC || defined malloc) \
00488              && (defined YYFREE || defined free)))
00489 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
00490 #   ifndef _STDLIB_H
00491 #    define _STDLIB_H 1
00492 #   endif
00493 #  endif
00494 #  ifndef YYMALLOC
00495 #   define YYMALLOC malloc
00496 #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00497      || defined __cplusplus || defined _MSC_VER)
00498 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
00499 #   endif
00500 #  endif
00501 #  ifndef YYFREE
00502 #   define YYFREE free
00503 #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
00504      || defined __cplusplus || defined _MSC_VER)
00505 void free (void *); /* INFRINGES ON USER NAME SPACE */
00506 #   endif
00507 #  endif
00508 # endif
00509 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
00510 
00511 
00512 #if (! defined yyoverflow \
00513      && (! defined __cplusplus \
00514          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
00515 
00516 /* A type that is properly aligned for any stack member.  */
00517 union yyalloc
00518 {
00519   yytype_int16 yyss_alloc;
00520   YYSTYPE yyvs_alloc;
00521 };
00522 
00523 /* The size of the maximum gap between one aligned stack and the next.  */
00524 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
00525 
00526 /* The size of an array large to enough to hold all stacks, each with
00527    N elements.  */
00528 # define YYSTACK_BYTES(N) \
00529      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
00530       + YYSTACK_GAP_MAXIMUM)
00531 
00532 /* Copy COUNT objects from FROM to TO.  The source and destination do
00533    not overlap.  */
00534 # ifndef YYCOPY
00535 #  if defined __GNUC__ && 1 < __GNUC__
00536 #   define YYCOPY(To, From, Count) \
00537       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
00538 #  else
00539 #   define YYCOPY(To, From, Count)              \
00540       do                                        \
00541         {                                       \
00542           YYSIZE_T yyi;                         \
00543           for (yyi = 0; yyi < (Count); yyi++)   \
00544             (To)[yyi] = (From)[yyi];            \
00545         }                                       \
00546       while (YYID (0))
00547 #  endif
00548 # endif
00549 
00550 /* Relocate STACK from its old location to the new one.  The
00551    local variables YYSIZE and YYSTACKSIZE give the old and new number of
00552    elements in the stack, and YYPTR gives the new location of the
00553    stack.  Advance YYPTR to a properly aligned location for the next
00554    stack.  */
00555 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
00556     do                                                                  \
00557       {                                                                 \
00558         YYSIZE_T yynewbytes;                                            \
00559         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
00560         Stack = &yyptr->Stack_alloc;                                    \
00561         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
00562         yyptr += yynewbytes / sizeof (*yyptr);                          \
00563       }                                                                 \
00564     while (YYID (0))
00565 
00566 #endif
00567 
00568 /* YYFINAL -- State number of the termination state.  */
00569 #define YYFINAL  2
00570 /* YYLAST -- Last index in YYTABLE.  */
00571 #define YYLAST   117
00572 
00573 /* YYNTOKENS -- Number of terminals.  */
00574 #define YYNTOKENS  40
00575 /* YYNNTS -- Number of nonterminals.  */
00576 #define YYNNTS  34
00577 /* YYNRULES -- Number of rules.  */
00578 #define YYNRULES  71
00579 /* YYNRULES -- Number of states.  */
00580 #define YYNSTATES  128
00581 
00582 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
00583 #define YYUNDEFTOK  2
00584 #define YYMAXUTOK   289
00585 
00586 #define YYTRANSLATE(YYX)                                                \
00587   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
00588 
00589 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
00590 static const yytype_uint8 yytranslate[] =
00591 {
00592        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00593        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00594        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00595        2,     2,     2,     2,     2,    38,     2,     2,     2,     2,
00596        2,     2,     2,    39,     2,     2,     2,     2,     2,     2,
00597        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00598        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00599        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00600        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00601        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00602        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00603        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00604        2,     2,     2,    35,     2,    36,    37,     2,     2,     2,
00605        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00606        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00607        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00608        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00609        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00610        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00611        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00612        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00613        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00614        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00615        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00616        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00617        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
00618        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
00619       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
00620       25,    26,    27,    28,    29,    30,    31,    32,    33,    34
00621 };
00622 
00623 #if YYDEBUG
00624 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
00625    YYRHS.  */
00626 static const yytype_uint8 yyprhs[] =
00627 {
00628        0,     0,     3,     4,     8,    11,    14,    16,    18,    20,
00629       22,    24,    26,    28,    30,    32,    34,    36,    38,    40,
00630       42,    44,    46,    48,    50,    54,    58,    63,    68,    70,
00631       72,    80,    81,    84,    86,    88,    90,    94,    98,   106,
00632      110,   112,   114,   118,   122,   131,   137,   138,   141,   143,
00633      145,   147,   154,   156,   158,   161,   163,   165,   166,   169,
00634      173,   177,   181,   185,   193,   196,   197,   199,   203,   206,
00635      208,   210
00636 };
00637 
00638 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
00639 static const yytype_int8 yyrhs[] =
00640 {
00641       41,     0,    -1,    -1,    41,    17,    42,    -1,    41,     1,
00642       -1,    41,    42,    -1,    45,    -1,    50,    -1,    53,    -1,
00643       54,    -1,    55,    -1,    57,    -1,    58,    -1,    59,    -1,
00644       62,    -1,    66,    -1,    67,    -1,    70,    -1,    68,    -1,
00645       69,    -1,    43,    -1,    11,    -1,     5,    -1,    46,    -1,
00646        9,    17,    47,    -1,    13,    17,    48,    -1,    72,     3,
00647       17,    44,    -1,    72,    49,    17,    44,    -1,     4,    -1,
00648        3,    -1,    28,    17,    19,    17,    35,    51,    36,    -1,
00649       -1,    51,    52,    -1,    17,    -1,    43,    -1,    46,    -1,
00650       18,    17,    72,    -1,    29,    17,    33,    -1,    29,    17,
00651       34,    17,    34,    17,     3,    -1,    30,    17,     4,    -1,
00652        3,    -1,     4,    -1,    31,    17,    56,    -1,    32,    17,
00653       56,    -1,    20,    17,     3,    17,    21,    17,     8,    60,
00654       -1,    20,    17,     3,    17,    61,    -1,    -1,    17,    61,
00655       -1,    19,    -1,     5,    -1,     4,    -1,    22,    17,    64,
00656       17,    65,    63,    -1,     3,    -1,    37,    -1,    37,     3,
00657       -1,    19,    -1,     6,    -1,    -1,    27,    17,    -1,    24,
00658       17,     5,    -1,    25,    17,     5,    -1,    10,    17,     5,
00659       -1,    12,    17,     5,    -1,    26,    17,    71,    17,    71,
00660       17,    71,    -1,    38,     7,    -1,    -1,    73,    -1,    72,
00661       39,    73,    -1,    72,    39,    -1,    14,    -1,    15,    -1,
00662       16,    -1
00663 };
00664 
00665 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
00666 static const yytype_uint16 yyrline[] =
00667 {
00668        0,   240,   240,   241,   242,   243,   247,   248,   249,   250,
00669      251,   252,   253,   254,   255,   256,   257,   258,   259,   260,
00670      261,   265,   269,   273,   280,   281,   285,   299,   313,   314,
00671      321,   344,   346,   350,   351,   352,   364,   372,   394,   413,
00672      421,   425,   437,   445,   453,   467,   483,   484,   488,   489,
00673      490,   494,   507,   514,   520,   530,   531,   534,   536,   540,
00674      547,   556,   564,   573,   584,   596,   597,   598,   599,   603,
00675      604,   605
00676 };
00677 #endif
00678 
00679 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
00680 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
00681    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
00682 static const char *const yytname[] =
00683 {
00684   "$end", "error", "$undefined", "\"<number>\"", "\"<word>\"",
00685   "\"<string>\"", "\"<string (non-greedy)>\"", "\"<hex>\"",
00686   "\"<RandR output>\"", "TOKBIND", "TOKTERMINAL", "\"<comment>\"",
00687   "\"font\"", "\"bindsym\"", "\"<modifier>\"", "\"control\"", "\"shift\"",
00688   "\"<whitespace>\"", "\"floating_modifier\"", "\"<quoted string>\"",
00689   "\"workspace\"", "\"output\"", "\"assign\"", "TOKSET", "\"ipc_socket\"",
00690   "\"exec\"", "TOKCOLOR", "\"\\342\\206\\222\"", "\"mode\"",
00691   "\"new_container\"", "\"new_window\"", "\"focus_follows_mouse\"",
00692   "\"workspace_bar\"", "\"default/stacking/tabbed\"", "\"stack-limit\"",
00693   "'{'", "'}'", "'~'", "'#'", "'+'", "$accept", "lines", "line", "comment",
00694   "command", "bindline", "binding", "bind", "bindsym", "word_or_number",
00695   "mode", "modelines", "modeline", "floating_modifier", "new_container",
00696   "new_window", "bool", "focus_follows_mouse", "workspace_bar",
00697   "workspace", "optional_workspace_name", "workspace_name", "assign",
00698   "assign_target", "window_class", "optional_arrow", "ipcsocket", "exec",
00699   "terminal", "font", "color", "colorpixel", "binding_modifiers",
00700   "binding_modifier", 0
00701 };
00702 #endif
00703 
00704 # ifdef YYPRINT
00705 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
00706    token YYLEX-NUM.  */
00707 static const yytype_uint16 yytoknum[] =
00708 {
00709        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
00710      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
00711      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
00712      285,   286,   287,   288,   289,   123,   125,   126,    35,    43
00713 };
00714 # endif
00715 
00716 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
00717 static const yytype_uint8 yyr1[] =
00718 {
00719        0,    40,    41,    41,    41,    41,    42,    42,    42,    42,
00720       42,    42,    42,    42,    42,    42,    42,    42,    42,    42,
00721       42,    43,    44,    45,    46,    46,    47,    48,    49,    49,
00722       50,    51,    51,    52,    52,    52,    53,    54,    54,    55,
00723       56,    56,    57,    58,    59,    59,    60,    60,    61,    61,
00724       61,    62,    63,    63,    63,    64,    64,    65,    65,    66,
00725       67,    68,    69,    70,    71,    72,    72,    72,    72,    73,
00726       73,    73
00727 };
00728 
00729 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
00730 static const yytype_uint8 yyr2[] =
00731 {
00732        0,     2,     0,     3,     2,     2,     1,     1,     1,     1,
00733        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
00734        1,     1,     1,     1,     3,     3,     4,     4,     1,     1,
00735        7,     0,     2,     1,     1,     1,     3,     3,     7,     3,
00736        1,     1,     3,     3,     8,     5,     0,     2,     1,     1,
00737        1,     6,     1,     1,     2,     1,     1,     0,     2,     3,
00738        3,     3,     3,     7,     2,     0,     1,     3,     2,     1,
00739        1,     1
00740 };
00741 
00742 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
00743    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
00744    means the default is an error.  */
00745 static const yytype_uint8 yydefact[] =
00746 {
00747        2,     0,     1,     4,     0,     0,    21,     0,     0,     0,
00748        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00749        0,     5,    20,     6,    23,     7,     8,     9,    10,    11,
00750       12,    13,    14,    15,    16,    18,    19,    17,    65,     0,
00751        0,    65,     3,    65,     0,     0,     0,     0,     0,     0,
00752        0,     0,     0,     0,    69,    70,    71,    24,     0,    66,
00753       61,    62,    25,     0,    36,     0,    56,    55,     0,    59,
00754       60,     0,     0,     0,    37,     0,    39,    40,    41,    42,
00755       43,     0,    68,    29,    28,     0,     0,    57,    64,     0,
00756        0,     0,     0,    67,     0,    50,    49,    48,     0,    45,
00757        0,     0,     0,    31,     0,    22,    26,    27,     0,    58,
00758       52,    53,    51,     0,     0,     0,    46,    54,    63,    33,
00759       30,    34,    35,    32,    38,     0,    44,    47
00760 };
00761 
00762 /* YYDEFGOTO[NTERM-NUM].  */
00763 static const yytype_int8 yydefgoto[] =
00764 {
00765       -1,     1,    21,    22,   106,    23,    24,    57,    62,    85,
00766       25,   114,   123,    26,    27,    28,    79,    29,    30,    31,
00767      126,    99,    32,   112,    68,   101,    33,    34,    35,    36,
00768       37,    72,    58,    59
00769 };
00770 
00771 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
00772    STATE-NUM.  */
00773 #define YYPACT_NINF -86
00774 static const yytype_int8 yypact[] =
00775 {
00776      -86,    22,   -86,   -86,   -12,     9,   -86,    12,    24,    46,
00777       28,    32,    44,    48,    50,    52,    56,    64,    65,    66,
00778       67,   -86,   -86,   -86,   -86,   -86,   -86,   -86,   -86,   -86,
00779      -86,   -86,   -86,   -86,   -86,   -86,   -86,   -86,    -2,    10,
00780       14,    -2,   -86,    -2,    60,    11,    80,    81,    49,    69,
00781      -25,    85,    76,    76,   -86,   -86,   -86,   -86,    -1,   -86,
00782      -86,   -86,   -86,    -3,    51,    74,   -86,   -86,    75,   -86,
00783      -86,    86,    77,    78,   -86,    79,   -86,   -86,   -86,   -86,
00784      -86,    82,    -2,   -86,   -86,    83,     6,    70,   -86,    49,
00785       63,    68,    96,   -86,    96,   -86,   -86,   -86,    87,   -86,
00786       88,     0,    89,   -86,    90,   -86,   -86,   -86,    95,   -86,
00787      -86,   105,   -86,    49,     7,   106,    93,   -86,   -86,   -86,
00788      -86,   -86,   -86,   -86,   -86,     2,   -86,   -86
00789 };
00790 
00791 /* YYPGOTO[NTERM-NUM].  */
00792 static const yytype_int8 yypgoto[] =
00793 {
00794      -86,   -86,   102,     1,    18,   -86,     3,   -86,   -86,   -86,
00795      -86,   -86,   -86,   -86,   -86,   -86,    61,   -86,   -86,   -86,
00796      -86,    -9,   -86,   -86,   -86,   -86,   -86,   -86,   -86,   -86,
00797      -86,   -85,    19,    31
00798 };
00799 
00800 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
00801    positive, shift that token.  If negative, reduce the rule which
00802    number is the opposite.  If zero, do what YYDEFACT says.
00803    If YYTABLE_NINF, syntax error.  */
00804 #define YYTABLE_NINF -1
00805 static const yytype_uint8 yytable[] =
00806 {
00807       83,    84,    81,   110,   102,    38,    95,    96,    74,    75,
00808       95,    96,    54,    55,    56,    60,     4,    66,     6,    61,
00809        8,    97,     2,     3,   119,    97,    39,    98,   118,    40,
00810       67,     4,     5,     6,     7,     8,    82,   111,    82,     9,
00811       10,    41,    11,   120,    12,    43,    13,    14,    15,    44,
00812       16,    17,    18,    19,    20,     4,     5,     6,     7,     8,
00813       63,    45,    64,    65,    10,    46,    11,    47,    12,    48,
00814       13,    14,    15,    49,    16,    17,    18,    19,    20,    77,
00815       78,    50,    51,    52,    53,    69,    70,    71,    73,    76,
00816       82,    86,    87,    88,    89,    90,    91,   100,   103,    92,
00817       94,   105,   104,   116,   108,   109,   113,   115,   117,   124,
00818      125,    42,   107,    93,    80,   121,   127,   122
00819 };
00820 
00821 static const yytype_uint8 yycheck[] =
00822 {
00823        3,     4,     3,     3,    89,    17,     4,     5,    33,    34,
00824        4,     5,    14,    15,    16,     5,     9,     6,    11,     5,
00825       13,    19,     0,     1,    17,    19,    17,    21,   113,    17,
00826       19,     9,    10,    11,    12,    13,    39,    37,    39,    17,
00827       18,    17,    20,    36,    22,    17,    24,    25,    26,    17,
00828       28,    29,    30,    31,    32,     9,    10,    11,    12,    13,
00829       41,    17,    43,     3,    18,    17,    20,    17,    22,    17,
00830       24,    25,    26,    17,    28,    29,    30,    31,    32,     3,
00831        4,    17,    17,    17,    17,     5,     5,    38,    19,     4,
00832       39,    17,    17,     7,    17,    17,    17,    27,    35,    17,
00833       17,     5,    34,     8,    17,    17,    17,    17,     3,     3,
00834       17,     9,    94,    82,    53,   114,   125,   114
00835 };
00836 
00837 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
00838    symbol of state STATE-NUM.  */
00839 static const yytype_uint8 yystos[] =
00840 {
00841        0,    41,     0,     1,     9,    10,    11,    12,    13,    17,
00842       18,    20,    22,    24,    25,    26,    28,    29,    30,    31,
00843       32,    42,    43,    45,    46,    50,    53,    54,    55,    57,
00844       58,    59,    62,    66,    67,    68,    69,    70,    17,    17,
00845       17,    17,    42,    17,    17,    17,    17,    17,    17,    17,
00846       17,    17,    17,    17,    14,    15,    16,    47,    72,    73,
00847        5,     5,    48,    72,    72,     3,     6,    19,    64,     5,
00848        5,    38,    71,    19,    33,    34,     4,     3,     4,    56,
00849       56,     3,    39,     3,     4,    49,    17,    17,     7,    17,
00850       17,    17,    17,    73,    17,     4,     5,    19,    21,    61,
00851       27,    65,    71,    35,    34,     5,    44,    44,    17,    17,
00852        3,    37,    63,    17,    51,    17,     8,     3,    71,    17,
00853       36,    43,    46,    52,     3,    17,    60,    61
00854 };
00855 
00856 #define yyerrok         (yyerrstatus = 0)
00857 #define yyclearin       (yychar = YYEMPTY)
00858 #define YYEMPTY         (-2)
00859 #define YYEOF           0
00860 
00861 #define YYACCEPT        goto yyacceptlab
00862 #define YYABORT         goto yyabortlab
00863 #define YYERROR         goto yyerrorlab
00864 
00865 
00866 /* Like YYERROR except do call yyerror.  This remains here temporarily
00867    to ease the transition to the new meaning of YYERROR, for GCC.
00868    Once GCC version 2 has supplanted version 1, this can go.  However,
00869    YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
00870    in Bison 2.4.2's NEWS entry, where a plan to phase it out is
00871    discussed.  */
00872 
00873 #define YYFAIL          goto yyerrlab
00874 #if defined YYFAIL
00875   /* This is here to suppress warnings from the GCC cpp's
00876      -Wunused-macros.  Normally we don't worry about that warning, but
00877      some users do, and we want to make it easy for users to remove
00878      YYFAIL uses, which will produce warnings from Bison 2.5.  */
00879 #endif
00880 
00881 #define YYRECOVERING()  (!!yyerrstatus)
00882 
00883 #define YYBACKUP(Token, Value)                                  \
00884 do                                                              \
00885   if (yychar == YYEMPTY && yylen == 1)                          \
00886     {                                                           \
00887       yychar = (Token);                                         \
00888       yylval = (Value);                                         \
00889       yytoken = YYTRANSLATE (yychar);                           \
00890       YYPOPSTACK (1);                                           \
00891       goto yybackup;                                            \
00892     }                                                           \
00893   else                                                          \
00894     {                                                           \
00895       yyerror (YY_("syntax error: cannot back up")); \
00896       YYERROR;                                                  \
00897     }                                                           \
00898 while (YYID (0))
00899 
00900 
00901 #define YYTERROR        1
00902 #define YYERRCODE       256
00903 
00904 
00905 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
00906    If N is 0, then set CURRENT to the empty location which ends
00907    the previous symbol: RHS[0] (always defined).  */
00908 
00909 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
00910 #ifndef YYLLOC_DEFAULT
00911 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
00912     do                                                                  \
00913       if (YYID (N))                                                    \
00914         {                                                               \
00915           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
00916           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
00917           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
00918           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
00919         }                                                               \
00920       else                                                              \
00921         {                                                               \
00922           (Current).first_line   = (Current).last_line   =              \
00923             YYRHSLOC (Rhs, 0).last_line;                                \
00924           (Current).first_column = (Current).last_column =              \
00925             YYRHSLOC (Rhs, 0).last_column;                              \
00926         }                                                               \
00927     while (YYID (0))
00928 #endif
00929 
00930 
00931 /* YY_LOCATION_PRINT -- Print the location on the stream.
00932    This macro was not mandated originally: define only if we know
00933    we won't break user code: when these are the locations we know.  */
00934 
00935 #ifndef YY_LOCATION_PRINT
00936 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
00937 #  define YY_LOCATION_PRINT(File, Loc)                  \
00938      fprintf (File, "%d.%d-%d.%d",                      \
00939               (Loc).first_line, (Loc).first_column,     \
00940               (Loc).last_line,  (Loc).last_column)
00941 # else
00942 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
00943 # endif
00944 #endif
00945 
00946 
00947 /* YYLEX -- calling `yylex' with the right arguments.  */
00948 
00949 #ifdef YYLEX_PARAM
00950 # define YYLEX yylex (YYLEX_PARAM)
00951 #else
00952 # define YYLEX yylex (context)
00953 #endif
00954 
00955 /* Enable debugging if requested.  */
00956 #if YYDEBUG
00957 
00958 # ifndef YYFPRINTF
00959 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
00960 #  define YYFPRINTF fprintf
00961 # endif
00962 
00963 # define YYDPRINTF(Args)                        \
00964 do {                                            \
00965   if (yydebug)                                  \
00966     YYFPRINTF Args;                             \
00967 } while (YYID (0))
00968 
00969 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
00970 do {                                                                      \
00971   if (yydebug)                                                            \
00972     {                                                                     \
00973       YYFPRINTF (stderr, "%s ", Title);                                   \
00974       yy_symbol_print (stderr,                                            \
00975                   Type, Value); \
00976       YYFPRINTF (stderr, "\n");                                           \
00977     }                                                                     \
00978 } while (YYID (0))
00979 
00980 
00981 /*--------------------------------.
00982 | Print this symbol on YYOUTPUT.  |
00983 `--------------------------------*/
00984 
00985 /*ARGSUSED*/
00986 #if (defined __STDC__ || defined __C99__FUNC__ \
00987      || defined __cplusplus || defined _MSC_VER)
00988 static void
00989 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
00990 #else
00991 static void
00992 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
00993     FILE *yyoutput;
00994     int yytype;
00995     YYSTYPE const * const yyvaluep;
00996 #endif
00997 {
00998   if (!yyvaluep)
00999     return;
01000 # ifdef YYPRINT
01001   if (yytype < YYNTOKENS)
01002     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
01003 # else
01004   YYUSE (yyoutput);
01005 # endif
01006   switch (yytype)
01007     {
01008       default:
01009         break;
01010     }
01011 }
01012 
01013 
01014 /*--------------------------------.
01015 | Print this symbol on YYOUTPUT.  |
01016 `--------------------------------*/
01017 
01018 #if (defined __STDC__ || defined __C99__FUNC__ \
01019      || defined __cplusplus || defined _MSC_VER)
01020 static void
01021 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
01022 #else
01023 static void
01024 yy_symbol_print (yyoutput, yytype, yyvaluep)
01025     FILE *yyoutput;
01026     int yytype;
01027     YYSTYPE const * const yyvaluep;
01028 #endif
01029 {
01030   if (yytype < YYNTOKENS)
01031     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
01032   else
01033     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
01034 
01035   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
01036   YYFPRINTF (yyoutput, ")");
01037 }
01038 
01039 /*------------------------------------------------------------------.
01040 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
01041 | TOP (included).                                                   |
01042 `------------------------------------------------------------------*/
01043 
01044 #if (defined __STDC__ || defined __C99__FUNC__ \
01045      || defined __cplusplus || defined _MSC_VER)
01046 static void
01047 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
01048 #else
01049 static void
01050 yy_stack_print (yybottom, yytop)
01051     yytype_int16 *yybottom;
01052     yytype_int16 *yytop;
01053 #endif
01054 {
01055   YYFPRINTF (stderr, "Stack now");
01056   for (; yybottom <= yytop; yybottom++)
01057     {
01058       int yybot = *yybottom;
01059       YYFPRINTF (stderr, " %d", yybot);
01060     }
01061   YYFPRINTF (stderr, "\n");
01062 }
01063 
01064 # define YY_STACK_PRINT(Bottom, Top)                            \
01065 do {                                                            \
01066   if (yydebug)                                                  \
01067     yy_stack_print ((Bottom), (Top));                           \
01068 } while (YYID (0))
01069 
01070 
01071 /*------------------------------------------------.
01072 | Report that the YYRULE is going to be reduced.  |
01073 `------------------------------------------------*/
01074 
01075 #if (defined __STDC__ || defined __C99__FUNC__ \
01076      || defined __cplusplus || defined _MSC_VER)
01077 static void
01078 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
01079 #else
01080 static void
01081 yy_reduce_print (yyvsp, yyrule)
01082     YYSTYPE *yyvsp;
01083     int yyrule;
01084 #endif
01085 {
01086   int yynrhs = yyr2[yyrule];
01087   int yyi;
01088   unsigned long int yylno = yyrline[yyrule];
01089   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
01090              yyrule - 1, yylno);
01091   /* The symbols being reduced.  */
01092   for (yyi = 0; yyi < yynrhs; yyi++)
01093     {
01094       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
01095       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
01096                        &(yyvsp[(yyi + 1) - (yynrhs)])
01097                                        );
01098       YYFPRINTF (stderr, "\n");
01099     }
01100 }
01101 
01102 # define YY_REDUCE_PRINT(Rule)          \
01103 do {                                    \
01104   if (yydebug)                          \
01105     yy_reduce_print (yyvsp, Rule); \
01106 } while (YYID (0))
01107 
01108 /* Nonzero means print parse trace.  It is left uninitialized so that
01109    multiple parsers can coexist.  */
01110 int yydebug;
01111 #else /* !YYDEBUG */
01112 # define YYDPRINTF(Args)
01113 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
01114 # define YY_STACK_PRINT(Bottom, Top)
01115 # define YY_REDUCE_PRINT(Rule)
01116 #endif /* !YYDEBUG */
01117 
01118 
01119 /* YYINITDEPTH -- initial size of the parser's stacks.  */
01120 #ifndef YYINITDEPTH
01121 # define YYINITDEPTH 200
01122 #endif
01123 
01124 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
01125    if the built-in stack extension method is used).
01126 
01127    Do not make this value too large; the results are undefined if
01128    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
01129    evaluated with infinite-precision integer arithmetic.  */
01130 
01131 #ifndef YYMAXDEPTH
01132 # define YYMAXDEPTH 10000
01133 #endif
01134 
01135 
01136 
01137 #if YYERROR_VERBOSE
01138 
01139 # ifndef yystrlen
01140 #  if defined __GLIBC__ && defined _STRING_H
01141 #   define yystrlen strlen
01142 #  else
01143 /* Return the length of YYSTR.  */
01144 #if (defined __STDC__ || defined __C99__FUNC__ \
01145      || defined __cplusplus || defined _MSC_VER)
01146 static YYSIZE_T
01147 yystrlen (const char *yystr)
01148 #else
01149 static YYSIZE_T
01150 yystrlen (yystr)
01151     const char *yystr;
01152 #endif
01153 {
01154   YYSIZE_T yylen;
01155   for (yylen = 0; yystr[yylen]; yylen++)
01156     continue;
01157   return yylen;
01158 }
01159 #  endif
01160 # endif
01161 
01162 # ifndef yystpcpy
01163 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
01164 #   define yystpcpy stpcpy
01165 #  else
01166 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
01167    YYDEST.  */
01168 #if (defined __STDC__ || defined __C99__FUNC__ \
01169      || defined __cplusplus || defined _MSC_VER)
01170 static char *
01171 yystpcpy (char *yydest, const char *yysrc)
01172 #else
01173 static char *
01174 yystpcpy (yydest, yysrc)
01175     char *yydest;
01176     const char *yysrc;
01177 #endif
01178 {
01179   char *yyd = yydest;
01180   const char *yys = yysrc;
01181 
01182   while ((*yyd++ = *yys++) != '\0')
01183     continue;
01184 
01185   return yyd - 1;
01186 }
01187 #  endif
01188 # endif
01189 
01190 # ifndef yytnamerr
01191 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
01192    quotes and backslashes, so that it's suitable for yyerror.  The
01193    heuristic is that double-quoting is unnecessary unless the string
01194    contains an apostrophe, a comma, or backslash (other than
01195    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
01196    null, do not copy; instead, return the length of what the result
01197    would have been.  */
01198 static YYSIZE_T
01199 yytnamerr (char *yyres, const char *yystr)
01200 {
01201   if (*yystr == '"')
01202     {
01203       YYSIZE_T yyn = 0;
01204       char const *yyp = yystr;
01205 
01206       for (;;)
01207         switch (*++yyp)
01208           {
01209           case '\'':
01210           case ',':
01211             goto do_not_strip_quotes;
01212 
01213           case '\\':
01214             if (*++yyp != '\\')
01215               goto do_not_strip_quotes;
01216             /* Fall through.  */
01217           default:
01218             if (yyres)
01219               yyres[yyn] = *yyp;
01220             yyn++;
01221             break;
01222 
01223           case '"':
01224             if (yyres)
01225               yyres[yyn] = '\0';
01226             return yyn;
01227           }
01228     do_not_strip_quotes: ;
01229     }
01230 
01231   if (! yyres)
01232     return yystrlen (yystr);
01233 
01234   return yystpcpy (yyres, yystr) - yyres;
01235 }
01236 # endif
01237 
01238 /* Copy into YYRESULT an error message about the unexpected token
01239    YYCHAR while in state YYSTATE.  Return the number of bytes copied,
01240    including the terminating null byte.  If YYRESULT is null, do not
01241    copy anything; just return the number of bytes that would be
01242    copied.  As a special case, return 0 if an ordinary "syntax error"
01243    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
01244    size calculation.  */
01245 static YYSIZE_T
01246 yysyntax_error (char *yyresult, int yystate, int yychar)
01247 {
01248   int yyn = yypact[yystate];
01249 
01250   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
01251     return 0;
01252   else
01253     {
01254       int yytype = YYTRANSLATE (yychar);
01255       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
01256       YYSIZE_T yysize = yysize0;
01257       YYSIZE_T yysize1;
01258       int yysize_overflow = 0;
01259       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
01260       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
01261       int yyx;
01262 
01263 # if 0
01264       /* This is so xgettext sees the translatable formats that are
01265          constructed on the fly.  */
01266       YY_("syntax error, unexpected %s");
01267       YY_("syntax error, unexpected %s, expecting %s");
01268       YY_("syntax error, unexpected %s, expecting %s or %s");
01269       YY_("syntax error, unexpected %s, expecting %s or %s or %s");
01270       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
01271 # endif
01272       char *yyfmt;
01273       char const *yyf;
01274       static char const yyunexpected[] = "syntax error, unexpected %s";
01275       static char const yyexpecting[] = ", expecting %s";
01276       static char const yyor[] = " or %s";
01277       char yyformat[sizeof yyunexpected
01278                     + sizeof yyexpecting - 1
01279                     + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
01280                        * (sizeof yyor - 1))];
01281       char const *yyprefix = yyexpecting;
01282 
01283       /* Start YYX at -YYN if negative to avoid negative indexes in
01284          YYCHECK.  */
01285       int yyxbegin = yyn < 0 ? -yyn : 0;
01286 
01287       /* Stay within bounds of both yycheck and yytname.  */
01288       int yychecklim = YYLAST - yyn + 1;
01289       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
01290       int yycount = 1;
01291 
01292       yyarg[0] = yytname[yytype];
01293       yyfmt = yystpcpy (yyformat, yyunexpected);
01294 
01295       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
01296         if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
01297           {
01298             if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
01299               {
01300                 yycount = 1;
01301                 yysize = yysize0;
01302                 yyformat[sizeof yyunexpected - 1] = '\0';
01303                 break;
01304               }
01305             yyarg[yycount++] = yytname[yyx];
01306             yysize1 = yysize + yytnamerr (0, yytname[yyx]);
01307             yysize_overflow |= (yysize1 < yysize);
01308             yysize = yysize1;
01309             yyfmt = yystpcpy (yyfmt, yyprefix);
01310             yyprefix = yyor;
01311           }
01312 
01313       yyf = YY_(yyformat);
01314       yysize1 = yysize + yystrlen (yyf);
01315       yysize_overflow |= (yysize1 < yysize);
01316       yysize = yysize1;
01317 
01318       if (yysize_overflow)
01319         return YYSIZE_MAXIMUM;
01320 
01321       if (yyresult)
01322         {
01323           /* Avoid sprintf, as that infringes on the user's name space.
01324              Don't have undefined behavior even if the translation
01325              produced a string with the wrong number of "%s"s.  */
01326           char *yyp = yyresult;
01327           int yyi = 0;
01328           while ((*yyp = *yyf) != '\0')
01329             {
01330               if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
01331                 {
01332                   yyp += yytnamerr (yyp, yyarg[yyi++]);
01333                   yyf += 2;
01334                 }
01335               else
01336                 {
01337                   yyp++;
01338                   yyf++;
01339                 }
01340             }
01341         }
01342       return yysize;
01343     }
01344 }
01345 #endif /* YYERROR_VERBOSE */
01346 
01347 
01348 /*-----------------------------------------------.
01349 | Release the memory associated to this symbol.  |
01350 `-----------------------------------------------*/
01351 
01352 /*ARGSUSED*/
01353 #if (defined __STDC__ || defined __C99__FUNC__ \
01354      || defined __cplusplus || defined _MSC_VER)
01355 static void
01356 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
01357 #else
01358 static void
01359 yydestruct (yymsg, yytype, yyvaluep)
01360     const char *yymsg;
01361     int yytype;
01362     YYSTYPE *yyvaluep;
01363 #endif
01364 {
01365   YYUSE (yyvaluep);
01366 
01367   if (!yymsg)
01368     yymsg = "Deleting";
01369   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
01370 
01371   switch (yytype)
01372     {
01373 
01374       default:
01375         break;
01376     }
01377 }
01378 
01379 /* Prevent warnings from -Wmissing-prototypes.  */
01380 #ifdef YYPARSE_PARAM
01381 #if defined __STDC__ || defined __cplusplus
01382 int yyparse (void *YYPARSE_PARAM);
01383 #else
01384 int yyparse ();
01385 #endif
01386 #else /* ! YYPARSE_PARAM */
01387 #if defined __STDC__ || defined __cplusplus
01388 int yyparse (void);
01389 #else
01390 int yyparse ();
01391 #endif
01392 #endif /* ! YYPARSE_PARAM */
01393 
01394 
01395 /* The lookahead symbol.  */
01396 int yychar;
01397 
01398 /* The semantic value of the lookahead symbol.  */
01399 YYSTYPE yylval;
01400 
01401 /* Number of syntax errors so far.  */
01402 int yynerrs;
01403 
01404 
01405 
01406 /*-------------------------.
01407 | yyparse or yypush_parse.  |
01408 `-------------------------*/
01409 
01410 #ifdef YYPARSE_PARAM
01411 #if (defined __STDC__ || defined __C99__FUNC__ \
01412      || defined __cplusplus || defined _MSC_VER)
01413 int
01414 yyparse (void *YYPARSE_PARAM)
01415 #else
01416 int
01417 yyparse (YYPARSE_PARAM)
01418     void *YYPARSE_PARAM;
01419 #endif
01420 #else /* ! YYPARSE_PARAM */
01421 #if (defined __STDC__ || defined __C99__FUNC__ \
01422      || defined __cplusplus || defined _MSC_VER)
01423 int
01424 yyparse (void)
01425 #else
01426 int
01427 yyparse ()
01428 
01429 #endif
01430 #endif
01431 {
01432 
01433 
01434     int yystate;
01435     /* Number of tokens to shift before error messages enabled.  */
01436     int yyerrstatus;
01437 
01438     /* The stacks and their tools:
01439        `yyss': related to states.
01440        `yyvs': related to semantic values.
01441 
01442        Refer to the stacks thru separate pointers, to allow yyoverflow
01443        to reallocate them elsewhere.  */
01444 
01445     /* The state stack.  */
01446     yytype_int16 yyssa[YYINITDEPTH];
01447     yytype_int16 *yyss;
01448     yytype_int16 *yyssp;
01449 
01450     /* The semantic value stack.  */
01451     YYSTYPE yyvsa[YYINITDEPTH];
01452     YYSTYPE *yyvs;
01453     YYSTYPE *yyvsp;
01454 
01455     YYSIZE_T yystacksize;
01456 
01457   int yyn;
01458   int yyresult;
01459   /* Lookahead token as an internal (translated) token number.  */
01460   int yytoken;
01461   /* The variables used to return semantic value and location from the
01462      action routines.  */
01463   YYSTYPE yyval;
01464 
01465 #if YYERROR_VERBOSE
01466   /* Buffer for error messages, and its allocated size.  */
01467   char yymsgbuf[128];
01468   char *yymsg = yymsgbuf;
01469   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
01470 #endif
01471 
01472 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
01473 
01474   /* The number of symbols on the RHS of the reduced rule.
01475      Keep to zero when no symbol should be popped.  */
01476   int yylen = 0;
01477 
01478   yytoken = 0;
01479   yyss = yyssa;
01480   yyvs = yyvsa;
01481   yystacksize = YYINITDEPTH;
01482 
01483   YYDPRINTF ((stderr, "Starting parse\n"));
01484 
01485   yystate = 0;
01486   yyerrstatus = 0;
01487   yynerrs = 0;
01488   yychar = YYEMPTY; /* Cause a token to be read.  */
01489 
01490   /* Initialize stack pointers.
01491      Waste one element of value and location stack
01492      so that they stay on the same level as the state stack.
01493      The wasted elements are never initialized.  */
01494   yyssp = yyss;
01495   yyvsp = yyvs;
01496 
01497   goto yysetstate;
01498 
01499 /*------------------------------------------------------------.
01500 | yynewstate -- Push a new state, which is found in yystate.  |
01501 `------------------------------------------------------------*/
01502  yynewstate:
01503   /* In all cases, when you get here, the value and location stacks
01504      have just been pushed.  So pushing a state here evens the stacks.  */
01505   yyssp++;
01506 
01507  yysetstate:
01508   *yyssp = yystate;
01509 
01510   if (yyss + yystacksize - 1 <= yyssp)
01511     {
01512       /* Get the current used size of the three stacks, in elements.  */
01513       YYSIZE_T yysize = yyssp - yyss + 1;
01514 
01515 #ifdef yyoverflow
01516       {
01517         /* Give user a chance to reallocate the stack.  Use copies of
01518            these so that the &'s don't force the real ones into
01519            memory.  */
01520         YYSTYPE *yyvs1 = yyvs;
01521         yytype_int16 *yyss1 = yyss;
01522 
01523         /* Each stack pointer address is followed by the size of the
01524            data in use in that stack, in bytes.  This used to be a
01525            conditional around just the two extra args, but that might
01526            be undefined if yyoverflow is a macro.  */
01527         yyoverflow (YY_("memory exhausted"),
01528                     &yyss1, yysize * sizeof (*yyssp),
01529                     &yyvs1, yysize * sizeof (*yyvsp),
01530                     &yystacksize);
01531 
01532         yyss = yyss1;
01533         yyvs = yyvs1;
01534       }
01535 #else /* no yyoverflow */
01536 # ifndef YYSTACK_RELOCATE
01537       goto yyexhaustedlab;
01538 # else
01539       /* Extend the stack our own way.  */
01540       if (YYMAXDEPTH <= yystacksize)
01541         goto yyexhaustedlab;
01542       yystacksize *= 2;
01543       if (YYMAXDEPTH < yystacksize)
01544         yystacksize = YYMAXDEPTH;
01545 
01546       {
01547         yytype_int16 *yyss1 = yyss;
01548         union yyalloc *yyptr =
01549           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01550         if (! yyptr)
01551           goto yyexhaustedlab;
01552         YYSTACK_RELOCATE (yyss_alloc, yyss);
01553         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
01554 #  undef YYSTACK_RELOCATE
01555         if (yyss1 != yyssa)
01556           YYSTACK_FREE (yyss1);
01557       }
01558 # endif
01559 #endif /* no yyoverflow */
01560 
01561       yyssp = yyss + yysize - 1;
01562       yyvsp = yyvs + yysize - 1;
01563 
01564       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
01565                   (unsigned long int) yystacksize));
01566 
01567       if (yyss + yystacksize - 1 <= yyssp)
01568         YYABORT;
01569     }
01570 
01571   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
01572 
01573   if (yystate == YYFINAL)
01574     YYACCEPT;
01575 
01576   goto yybackup;
01577 
01578 /*-----------.
01579 | yybackup.  |
01580 `-----------*/
01581 yybackup:
01582 
01583   /* Do appropriate processing given the current state.  Read a
01584      lookahead token if we need one and don't already have one.  */
01585 
01586   /* First try to decide what to do without reference to lookahead token.  */
01587   yyn = yypact[yystate];
01588   if (yyn == YYPACT_NINF)
01589     goto yydefault;
01590 
01591   /* Not known => get a lookahead token if don't already have one.  */
01592 
01593   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
01594   if (yychar == YYEMPTY)
01595     {
01596       YYDPRINTF ((stderr, "Reading a token: "));
01597       yychar = YYLEX;
01598     }
01599 
01600   if (yychar <= YYEOF)
01601     {
01602       yychar = yytoken = YYEOF;
01603       YYDPRINTF ((stderr, "Now at end of input.\n"));
01604     }
01605   else
01606     {
01607       yytoken = YYTRANSLATE (yychar);
01608       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
01609     }
01610 
01611   /* If the proper action on seeing token YYTOKEN is to reduce or to
01612      detect an error, take that action.  */
01613   yyn += yytoken;
01614   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
01615     goto yydefault;
01616   yyn = yytable[yyn];
01617   if (yyn <= 0)
01618     {
01619       if (yyn == 0 || yyn == YYTABLE_NINF)
01620         goto yyerrlab;
01621       yyn = -yyn;
01622       goto yyreduce;
01623     }
01624 
01625   /* Count tokens shifted since error; after three, turn off error
01626      status.  */
01627   if (yyerrstatus)
01628     yyerrstatus--;
01629 
01630   /* Shift the lookahead token.  */
01631   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
01632 
01633   /* Discard the shifted token.  */
01634   yychar = YYEMPTY;
01635 
01636   yystate = yyn;
01637   *++yyvsp = yylval;
01638 
01639   goto yynewstate;
01640 
01641 
01642 /*-----------------------------------------------------------.
01643 | yydefault -- do the default action for the current state.  |
01644 `-----------------------------------------------------------*/
01645 yydefault:
01646   yyn = yydefact[yystate];
01647   if (yyn == 0)
01648     goto yyerrlab;
01649   goto yyreduce;
01650 
01651 
01652 /*-----------------------------.
01653 | yyreduce -- Do a reduction.  |
01654 `-----------------------------*/
01655 yyreduce:
01656   /* yyn is the number of a rule to reduce with.  */
01657   yylen = yyr2[yyn];
01658 
01659   /* If YYLEN is nonzero, implement the default value of the action:
01660      `$$ = $1'.
01661 
01662      Otherwise, the following line sets YYVAL to garbage.
01663      This behavior is undocumented and Bison
01664      users should not rely upon it.  Assigning to YYVAL
01665      unconditionally makes the parser a bit smaller, and it avoids a
01666      GCC warning that YYVAL may be used uninitialized.  */
01667   yyval = yyvsp[1-yylen];
01668 
01669 
01670   YY_REDUCE_PRINT (yyn);
01671   switch (yyn)
01672     {
01673         case 23:
01674 
01675 /* Line 1464 of yacc.c  */
01676 #line 274 "src/cfgparse.y"
01677     {
01678                 TAILQ_INSERT_TAIL(bindings, (yyvsp[(1) - (1)].binding), bindings);
01679         ;}
01680     break;
01681 
01682   case 24:
01683 
01684 /* Line 1464 of yacc.c  */
01685 #line 280 "src/cfgparse.y"
01686     { (yyval.binding) = (yyvsp[(3) - (3)].binding); ;}
01687     break;
01688 
01689   case 25:
01690 
01691 /* Line 1464 of yacc.c  */
01692 #line 281 "src/cfgparse.y"
01693     { (yyval.binding) = (yyvsp[(3) - (3)].binding); ;}
01694     break;
01695 
01696   case 26:
01697 
01698 /* Line 1464 of yacc.c  */
01699 #line 286 "src/cfgparse.y"
01700     {
01701                 printf("\tFound binding mod%d with key %d and command %s\n", (yyvsp[(1) - (4)].number), (yyvsp[(2) - (4)].number), (yyvsp[(4) - (4)].string));
01702                 Binding *new = scalloc(sizeof(Binding));
01703 
01704                 new->keycode = (yyvsp[(2) - (4)].number);
01705                 new->mods = (yyvsp[(1) - (4)].number);
01706                 new->command = (yyvsp[(4) - (4)].string);
01707 
01708                 (yyval.binding) = new;
01709         ;}
01710     break;
01711 
01712   case 27:
01713 
01714 /* Line 1464 of yacc.c  */
01715 #line 300 "src/cfgparse.y"
01716     {
01717                 printf("\tFound symbolic mod%d with key %s and command %s\n", (yyvsp[(1) - (4)].number), (yyvsp[(2) - (4)].string), (yyvsp[(4) - (4)].string));
01718                 Binding *new = scalloc(sizeof(Binding));
01719 
01720                 new->symbol = (yyvsp[(2) - (4)].string);
01721                 new->mods = (yyvsp[(1) - (4)].number);
01722                 new->command = (yyvsp[(4) - (4)].string);
01723 
01724                 (yyval.binding) = new;
01725         ;}
01726     break;
01727 
01728   case 29:
01729 
01730 /* Line 1464 of yacc.c  */
01731 #line 315 "src/cfgparse.y"
01732     {
01733                 asprintf(&(yyval.string), "%d", (yyvsp[(1) - (1)].number));
01734         ;}
01735     break;
01736 
01737   case 30:
01738 
01739 /* Line 1464 of yacc.c  */
01740 #line 322 "src/cfgparse.y"
01741     {
01742                 if (strcasecmp((yyvsp[(3) - (7)].string), "default") == 0) {
01743                         printf("You cannot use the name \"default\" for your mode\n");
01744                         exit(1);
01745                 }
01746                 printf("\t now in mode %s\n", (yyvsp[(3) - (7)].string));
01747                 printf("\t current bindings = %p\n", current_bindings);
01748                 Binding *binding;
01749                 TAILQ_FOREACH(binding, current_bindings, bindings) {
01750                         printf("got binding on mods %d, keycode %d, symbol %s, command %s\n",
01751                                         binding->mods, binding->keycode, binding->symbol, binding->command);
01752                 }
01753 
01754                 struct Mode *mode = scalloc(sizeof(struct Mode));
01755                 mode->name = (yyvsp[(3) - (7)].string);
01756                 mode->bindings = current_bindings;
01757                 current_bindings = NULL;
01758                 SLIST_INSERT_HEAD(&modes, mode, modes);
01759         ;}
01760     break;
01761 
01762   case 35:
01763 
01764 /* Line 1464 of yacc.c  */
01765 #line 353 "src/cfgparse.y"
01766     {
01767                 if (current_bindings == NULL) {
01768                         current_bindings = scalloc(sizeof(struct bindings_head));
01769                         TAILQ_INIT(current_bindings);
01770                 }
01771 
01772                 TAILQ_INSERT_TAIL(current_bindings, (yyvsp[(1) - (1)].binding), bindings);
01773         ;}
01774     break;
01775 
01776   case 36:
01777 
01778 /* Line 1464 of yacc.c  */
01779 #line 365 "src/cfgparse.y"
01780     {
01781                 DLOG("floating modifier = %d\n", (yyvsp[(3) - (3)].number));
01782                 config.floating_modifier = (yyvsp[(3) - (3)].number);
01783         ;}
01784     break;
01785 
01786   case 37:
01787 
01788 /* Line 1464 of yacc.c  */
01789 #line 373 "src/cfgparse.y"
01790     {
01791                 DLOG("new containers will be in mode %d\n", (yyvsp[(3) - (3)].number));
01792                 config.container_mode = (yyvsp[(3) - (3)].number);
01793 
01794                 /* We also need to change the layout of the already existing
01795                  * workspaces here. Workspaces may exist at this point because
01796                  * of the other directives which are modifying workspaces
01797                  * (setting the preferred screen or name). While the workspace
01798                  * objects are already created, they have never been used.
01799                  * Thus, the user very likely awaits the default container mode
01800                  * to trigger in this case, regardless of where it is inside
01801                  * his configuration file. */
01802                 Workspace *ws;
01803                 TAILQ_FOREACH(ws, workspaces, workspaces) {
01804                         if (ws->table == NULL)
01805                                 continue;
01806                         switch_layout_mode(global_conn,
01807                                            ws->table[0][0],
01808                                            config.container_mode);
01809                 }
01810         ;}
01811     break;
01812 
01813   case 38:
01814 
01815 /* Line 1464 of yacc.c  */
01816 #line 395 "src/cfgparse.y"
01817     {
01818                 DLOG("stack-limit %d with val %d\n", (yyvsp[(5) - (7)].number), (yyvsp[(7) - (7)].number));
01819                 config.container_stack_limit = (yyvsp[(5) - (7)].number);
01820                 config.container_stack_limit_value = (yyvsp[(7) - (7)].number);
01821 
01822                 /* See the comment above */
01823                 Workspace *ws;
01824                 TAILQ_FOREACH(ws, workspaces, workspaces) {
01825                         if (ws->table == NULL)
01826                                 continue;
01827                         Container *con = ws->table[0][0];
01828                         con->stack_limit = config.container_stack_limit;
01829                         con->stack_limit_value = config.container_stack_limit_value;
01830                 }
01831         ;}
01832     break;
01833 
01834   case 39:
01835 
01836 /* Line 1464 of yacc.c  */
01837 #line 414 "src/cfgparse.y"
01838     {
01839                 DLOG("new windows should start in mode %s\n", (yyvsp[(3) - (3)].string));
01840                 config.default_border = sstrdup((yyvsp[(3) - (3)].string));
01841         ;}
01842     break;
01843 
01844   case 40:
01845 
01846 /* Line 1464 of yacc.c  */
01847 #line 422 "src/cfgparse.y"
01848     {
01849                 (yyval.number) = ((yyvsp[(1) - (1)].number) == 1);
01850         ;}
01851     break;
01852 
01853   case 41:
01854 
01855 /* Line 1464 of yacc.c  */
01856 #line 426 "src/cfgparse.y"
01857     {
01858                 DLOG("checking word \"%s\"\n", (yyvsp[(1) - (1)].string));
01859                 (yyval.number) = (strcasecmp((yyvsp[(1) - (1)].string), "yes") == 0 ||
01860                               strcasecmp((yyvsp[(1) - (1)].string), "true") == 0 ||
01861                               strcasecmp((yyvsp[(1) - (1)].string), "on") == 0 ||
01862                               strcasecmp((yyvsp[(1) - (1)].string), "enable") == 0 ||
01863                               strcasecmp((yyvsp[(1) - (1)].string), "active") == 0);
01864         ;}
01865     break;
01866 
01867   case 42:
01868 
01869 /* Line 1464 of yacc.c  */
01870 #line 438 "src/cfgparse.y"
01871     {
01872                 DLOG("focus follows mouse = %d\n", (yyvsp[(3) - (3)].number));
01873                 config.disable_focus_follows_mouse = !((yyvsp[(3) - (3)].number));
01874         ;}
01875     break;
01876 
01877   case 43:
01878 
01879 /* Line 1464 of yacc.c  */
01880 #line 446 "src/cfgparse.y"
01881     {
01882                 DLOG("workspace bar = %d\n", (yyvsp[(3) - (3)].number));
01883                 config.disable_workspace_bar = !((yyvsp[(3) - (3)].number));
01884         ;}
01885     break;
01886 
01887   case 44:
01888 
01889 /* Line 1464 of yacc.c  */
01890 #line 454 "src/cfgparse.y"
01891     {
01892                 int ws_num = (yyvsp[(3) - (8)].number);
01893                 if (ws_num < 1) {
01894                         DLOG("Invalid workspace assignment, workspace number %d out of range\n", ws_num);
01895                 } else {
01896                         Workspace *ws = workspace_get(ws_num - 1);
01897                         ws->preferred_output = (yyvsp[(7) - (8)].string);
01898                         if ((yyvsp[(8) - (8)].string) != NULL) {
01899                                 workspace_set_name(ws, (yyvsp[(8) - (8)].string));
01900                                 free((yyvsp[(8) - (8)].string));
01901                         }
01902                 }
01903         ;}
01904     break;
01905 
01906   case 45:
01907 
01908 /* Line 1464 of yacc.c  */
01909 #line 468 "src/cfgparse.y"
01910     {
01911                 int ws_num = (yyvsp[(3) - (5)].number);
01912                 if (ws_num < 1) {
01913                         DLOG("Invalid workspace assignment, workspace number %d out of range\n", ws_num);
01914                 } else {
01915                         DLOG("workspace name to: %s\n", (yyvsp[(5) - (5)].string));
01916                         if ((yyvsp[(5) - (5)].string) != NULL) {
01917                                 workspace_set_name(workspace_get(ws_num - 1), (yyvsp[(5) - (5)].string));
01918                                 free((yyvsp[(5) - (5)].string));
01919                         }
01920                 }
01921         ;}
01922     break;
01923 
01924   case 46:
01925 
01926 /* Line 1464 of yacc.c  */
01927 #line 483 "src/cfgparse.y"
01928     { (yyval.string) = NULL; ;}
01929     break;
01930 
01931   case 47:
01932 
01933 /* Line 1464 of yacc.c  */
01934 #line 484 "src/cfgparse.y"
01935     { (yyval.string) = (yyvsp[(2) - (2)].string); ;}
01936     break;
01937 
01938   case 48:
01939 
01940 /* Line 1464 of yacc.c  */
01941 #line 488 "src/cfgparse.y"
01942     { (yyval.string) = (yyvsp[(1) - (1)].string); ;}
01943     break;
01944 
01945   case 49:
01946 
01947 /* Line 1464 of yacc.c  */
01948 #line 489 "src/cfgparse.y"
01949     { (yyval.string) = (yyvsp[(1) - (1)].string); ;}
01950     break;
01951 
01952   case 50:
01953 
01954 /* Line 1464 of yacc.c  */
01955 #line 490 "src/cfgparse.y"
01956     { (yyval.string) = (yyvsp[(1) - (1)].string); ;}
01957     break;
01958 
01959   case 51:
01960 
01961 /* Line 1464 of yacc.c  */
01962 #line 495 "src/cfgparse.y"
01963     {
01964                 printf("assignment of %s\n", (yyvsp[(3) - (6)].string));
01965 
01966                 struct Assignment *new = (yyvsp[(6) - (6)].assignment);
01967                 printf("  to %d\n", new->workspace);
01968                 printf("  floating = %d\n", new->floating);
01969                 new->windowclass_title = (yyvsp[(3) - (6)].string);
01970                 TAILQ_INSERT_TAIL(&assignments, new, assignments);
01971         ;}
01972     break;
01973 
01974   case 52:
01975 
01976 /* Line 1464 of yacc.c  */
01977 #line 508 "src/cfgparse.y"
01978     {
01979                 struct Assignment *new = scalloc(sizeof(struct Assignment));
01980                 new->workspace = (yyvsp[(1) - (1)].number);
01981                 new->floating = ASSIGN_FLOATING_NO;
01982                 (yyval.assignment) = new;
01983         ;}
01984     break;
01985 
01986   case 53:
01987 
01988 /* Line 1464 of yacc.c  */
01989 #line 515 "src/cfgparse.y"
01990     {
01991                 struct Assignment *new = scalloc(sizeof(struct Assignment));
01992                 new->floating = ASSIGN_FLOATING_ONLY;
01993                 (yyval.assignment) = new;
01994         ;}
01995     break;
01996 
01997   case 54:
01998 
01999 /* Line 1464 of yacc.c  */
02000 #line 521 "src/cfgparse.y"
02001     {
02002                 struct Assignment *new = scalloc(sizeof(struct Assignment));
02003                 new->workspace = (yyvsp[(2) - (2)].number);
02004                 new->floating = ASSIGN_FLOATING;
02005                 (yyval.assignment) = new;
02006         ;}
02007     break;
02008 
02009   case 59:
02010 
02011 /* Line 1464 of yacc.c  */
02012 #line 541 "src/cfgparse.y"
02013     {
02014                 config.ipc_socket_path = (yyvsp[(3) - (3)].string);
02015         ;}
02016     break;
02017 
02018   case 60:
02019 
02020 /* Line 1464 of yacc.c  */
02021 #line 548 "src/cfgparse.y"
02022     {
02023                 struct Autostart *new = smalloc(sizeof(struct Autostart));
02024                 new->command = (yyvsp[(3) - (3)].string);
02025                 TAILQ_INSERT_TAIL(&autostarts, new, autostarts);
02026         ;}
02027     break;
02028 
02029   case 61:
02030 
02031 /* Line 1464 of yacc.c  */
02032 #line 557 "src/cfgparse.y"
02033     {
02034                 ELOG("The terminal option is DEPRECATED and has no effect. "
02035                     "Please remove it from your configuration file.\n");
02036         ;}
02037     break;
02038 
02039   case 62:
02040 
02041 /* Line 1464 of yacc.c  */
02042 #line 565 "src/cfgparse.y"
02043     {
02044                 config.font = (yyvsp[(3) - (3)].string);
02045                 printf("font %s\n", config.font);
02046         ;}
02047     break;
02048 
02049   case 63:
02050 
02051 /* Line 1464 of yacc.c  */
02052 #line 574 "src/cfgparse.y"
02053     {
02054                 struct Colortriple *dest = (yyvsp[(1) - (7)].color);
02055 
02056                 dest->border = (yyvsp[(3) - (7)].number);
02057                 dest->background = (yyvsp[(5) - (7)].number);
02058                 dest->text = (yyvsp[(7) - (7)].number);
02059         ;}
02060     break;
02061 
02062   case 64:
02063 
02064 /* Line 1464 of yacc.c  */
02065 #line 585 "src/cfgparse.y"
02066     {
02067                 char *hex;
02068                 if (asprintf(&hex, "#%s", (yyvsp[(2) - (2)].string)) == -1)
02069                         die("asprintf()");
02070                 (yyval.number) = get_colorpixel(global_conn, hex);
02071                 free(hex);
02072         ;}
02073     break;
02074 
02075   case 65:
02076 
02077 /* Line 1464 of yacc.c  */
02078 #line 596 "src/cfgparse.y"
02079     { (yyval.number) = 0; ;}
02080     break;
02081 
02082   case 67:
02083 
02084 /* Line 1464 of yacc.c  */
02085 #line 598 "src/cfgparse.y"
02086     { (yyval.number) = (yyvsp[(1) - (3)].number) | (yyvsp[(3) - (3)].number); ;}
02087     break;
02088 
02089   case 68:
02090 
02091 /* Line 1464 of yacc.c  */
02092 #line 599 "src/cfgparse.y"
02093     { (yyval.number) = (yyvsp[(1) - (2)].number); ;}
02094     break;
02095 
02096   case 69:
02097 
02098 /* Line 1464 of yacc.c  */
02099 #line 603 "src/cfgparse.y"
02100     { (yyval.number) = (yyvsp[(1) - (1)].number); ;}
02101     break;
02102 
02103   case 70:
02104 
02105 /* Line 1464 of yacc.c  */
02106 #line 604 "src/cfgparse.y"
02107     { (yyval.number) = BIND_CONTROL; ;}
02108     break;
02109 
02110   case 71:
02111 
02112 /* Line 1464 of yacc.c  */
02113 #line 605 "src/cfgparse.y"
02114     { (yyval.number) = BIND_SHIFT; ;}
02115     break;
02116 
02117 
02118 
02119 /* Line 1464 of yacc.c  */
02120 #line 2121 "src/cfgparse.tab.c"
02121       default: break;
02122     }
02123   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
02124 
02125   YYPOPSTACK (yylen);
02126   yylen = 0;
02127   YY_STACK_PRINT (yyss, yyssp);
02128 
02129   *++yyvsp = yyval;
02130 
02131   /* Now `shift' the result of the reduction.  Determine what state
02132      that goes to, based on the state we popped back to and the rule
02133      number reduced by.  */
02134 
02135   yyn = yyr1[yyn];
02136 
02137   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
02138   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
02139     yystate = yytable[yystate];
02140   else
02141     yystate = yydefgoto[yyn - YYNTOKENS];
02142 
02143   goto yynewstate;
02144 
02145 
02146 /*------------------------------------.
02147 | yyerrlab -- here on detecting error |
02148 `------------------------------------*/
02149 yyerrlab:
02150   /* If not already recovering from an error, report this error.  */
02151   if (!yyerrstatus)
02152     {
02153       ++yynerrs;
02154 #if ! YYERROR_VERBOSE
02155       yyerror (YY_("syntax error"));
02156 #else
02157       {
02158         YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
02159         if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
02160           {
02161             YYSIZE_T yyalloc = 2 * yysize;
02162             if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
02163               yyalloc = YYSTACK_ALLOC_MAXIMUM;
02164             if (yymsg != yymsgbuf)
02165               YYSTACK_FREE (yymsg);
02166             yymsg = (char *) YYSTACK_ALLOC (yyalloc);
02167             if (yymsg)
02168               yymsg_alloc = yyalloc;
02169             else
02170               {
02171                 yymsg = yymsgbuf;
02172                 yymsg_alloc = sizeof yymsgbuf;
02173               }
02174           }
02175 
02176         if (0 < yysize && yysize <= yymsg_alloc)
02177           {
02178             (void) yysyntax_error (yymsg, yystate, yychar);
02179             yyerror (yymsg);
02180           }
02181         else
02182           {
02183             yyerror (YY_("syntax error"));
02184             if (yysize != 0)
02185               goto yyexhaustedlab;
02186           }
02187       }
02188 #endif
02189     }
02190 
02191 
02192 
02193   if (yyerrstatus == 3)
02194     {
02195       /* If just tried and failed to reuse lookahead token after an
02196          error, discard it.  */
02197 
02198       if (yychar <= YYEOF)
02199         {
02200           /* Return failure if at end of input.  */
02201           if (yychar == YYEOF)
02202             YYABORT;
02203         }
02204       else
02205         {
02206           yydestruct ("Error: discarding",
02207                       yytoken, &yylval);
02208           yychar = YYEMPTY;
02209         }
02210     }
02211 
02212   /* Else will try to reuse lookahead token after shifting the error
02213      token.  */
02214   goto yyerrlab1;
02215 
02216 
02217 /*---------------------------------------------------.
02218 | yyerrorlab -- error raised explicitly by YYERROR.  |
02219 `---------------------------------------------------*/
02220 yyerrorlab:
02221 
02222   /* Pacify compilers like GCC when the user code never invokes
02223      YYERROR and the label yyerrorlab therefore never appears in user
02224      code.  */
02225   if (/*CONSTCOND*/ 0)
02226      goto yyerrorlab;
02227 
02228   /* Do not reclaim the symbols of the rule which action triggered
02229      this YYERROR.  */
02230   YYPOPSTACK (yylen);
02231   yylen = 0;
02232   YY_STACK_PRINT (yyss, yyssp);
02233   yystate = *yyssp;
02234   goto yyerrlab1;
02235 
02236 
02237 /*-------------------------------------------------------------.
02238 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
02239 `-------------------------------------------------------------*/
02240 yyerrlab1:
02241   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
02242 
02243   for (;;)
02244     {
02245       yyn = yypact[yystate];
02246       if (yyn != YYPACT_NINF)
02247         {
02248           yyn += YYTERROR;
02249           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
02250             {
02251               yyn = yytable[yyn];
02252               if (0 < yyn)
02253                 break;
02254             }
02255         }
02256 
02257       /* Pop the current state because it cannot handle the error token.  */
02258       if (yyssp == yyss)
02259         YYABORT;
02260 
02261 
02262       yydestruct ("Error: popping",
02263                   yystos[yystate], yyvsp);
02264       YYPOPSTACK (1);
02265       yystate = *yyssp;
02266       YY_STACK_PRINT (yyss, yyssp);
02267     }
02268 
02269   *++yyvsp = yylval;
02270 
02271 
02272   /* Shift the error token.  */
02273   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
02274 
02275   yystate = yyn;
02276   goto yynewstate;
02277 
02278 
02279 /*-------------------------------------.
02280 | yyacceptlab -- YYACCEPT comes here.  |
02281 `-------------------------------------*/
02282 yyacceptlab:
02283   yyresult = 0;
02284   goto yyreturn;
02285 
02286 /*-----------------------------------.
02287 | yyabortlab -- YYABORT comes here.  |
02288 `-----------------------------------*/
02289 yyabortlab:
02290   yyresult = 1;
02291   goto yyreturn;
02292 
02293 #if !defined(yyoverflow) || YYERROR_VERBOSE
02294 /*-------------------------------------------------.
02295 | yyexhaustedlab -- memory exhaustion comes here.  |
02296 `-------------------------------------------------*/
02297 yyexhaustedlab:
02298   yyerror (YY_("memory exhausted"));
02299   yyresult = 2;
02300   /* Fall through.  */
02301 #endif
02302 
02303 yyreturn:
02304   if (yychar != YYEMPTY)
02305      yydestruct ("Cleanup: discarding lookahead",
02306                  yytoken, &yylval);
02307   /* Do not reclaim the symbols of the rule which action triggered
02308      this YYABORT or YYACCEPT.  */
02309   YYPOPSTACK (yylen);
02310   YY_STACK_PRINT (yyss, yyssp);
02311   while (yyssp != yyss)
02312     {
02313       yydestruct ("Cleanup: popping",
02314                   yystos[*yyssp], yyvsp);
02315       YYPOPSTACK (1);
02316     }
02317 #ifndef yyoverflow
02318   if (yyss != yyssa)
02319     YYSTACK_FREE (yyss);
02320 #endif
02321 #if YYERROR_VERBOSE
02322   if (yymsg != yymsgbuf)
02323     YYSTACK_FREE (yymsg);
02324 #endif
02325   /* Make sure YYID is used.  */
02326   return YYID (yyresult);
02327 }
02328 
02329 
02330 

Generated on Mon Aug 22 2011 for i3 by  doxygen 1.7.1