My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
parse_citi.cpp
Go to the documentation of this file.
1 
2 /* A Bison parser, made by GNU Bison 2.4.1. */
3 
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 
6  Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7  Free Software Foundation, Inc.
8 
9  This program is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 
22 /* As a special exception, you may create a larger work that contains
23  part or all of the Bison parser skeleton and distribute that work
24  under terms of your choice, so long as that work isn't itself a
25  parser generator using the skeleton or a modified version thereof
26  as a parser skeleton. Alternatively, if you modify or redistribute
27  the parser skeleton itself, you may (at your option) remove this
28  special exception, which will cause the skeleton and the resulting
29  Bison output files to be licensed under the GNU General Public
30  License without this special exception.
31 
32  This special exception was added by the Free Software Foundation in
33  version 2.2 of Bison. */
34 
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36  simplifying the original so-called "semantic" parser. */
37 
38 /* All symbols defined below should begin with yy or YY, to avoid
39  infringing on user name space. This should be done even for local
40  variables, as they might otherwise be expanded by user macros.
41  There are some unavoidable exceptions within include files to
42  define necessary library symbols; they are noted "INFRINGES ON
43  USER NAME SPACE" below. */
44 
45 /* Identify Bison output. */
46 #define YYBISON 1
47 
48 /* Bison version. */
49 #define YYBISON_VERSION "2.4.1"
50 
51 /* Skeleton name. */
52 #define YYSKELETON_NAME "yacc.c"
53 
54 /* Pure parsers. */
55 #define YYPURE 0
56 
57 /* Push parsers. */
58 #define YYPUSH 0
59 
60 /* Pull parsers. */
61 #define YYPULL 1
62 
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
65 
66 /* Substitute the variable and function names. */
67 #define yyparse citi_parse
68 #define yylex citi_lex
69 #define yyerror citi_error
70 #define yylval citi_lval
71 #define yychar citi_char
72 #define yydebug citi_debug
73 #define yynerrs citi_nerrs
74 
75 
76 /* Copy the first part of user declarations. */
77 
78 /* Line 189 of yacc.c */
79 #line 3 "parse_citi.y"
80 
81 /*
82  * parse_citi.y - parser for CITIfiles
83  *
84  * Copyright (C) 2006 Stefan Jahn <stefan@lkcc.org>
85  *
86  * This is free software; you can redistribute it and/or modify
87  * it under the terms of the GNU General Public License as published by
88  * the Free Software Foundation; either version 2, or (at your option)
89  * any later version.
90  *
91  * This software is distributed in the hope that it will be useful,
92  * but WITHOUT ANY WARRANTY; without even the implied warranty of
93  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
94  * GNU General Public License for more details.
95  *
96  * You should have received a copy of the GNU General Public License
97  * along with this package; see the file COPYING. If not, write to
98  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
99  * Boston, MA 02110-1301, USA.
100  *
101  * $Id: parse_citi.y 1825 2011-03-11 20:42:14Z ela $
102  *
103  */
104 
105 #if HAVE_CONFIG_H
106 # include <config.h>
107 #endif
108 
109 #include <stdio.h>
110 #include <stdlib.h>
111 #include <string.h>
112 
113 #define YYERROR_VERBOSE 42
114 #define YYDEBUG 1
115 #define YYMAXDEPTH 1000000
116 
117 #include "logging.h"
118 #include "complex.h"
119 #include "object.h"
120 #include "vector.h"
121 #include "dataset.h"
122 #include "strlist.h"
123 #include "check_citi.h"
124 
125 
126 
127 /* Line 189 of yacc.c */
128 #line 129 "parse_citi.cpp"
129 
130 /* Enabling traces. */
131 #ifndef YYDEBUG
132 # define YYDEBUG 0
133 #endif
134 
135 /* Enabling verbose error messages. */
136 #ifdef YYERROR_VERBOSE
137 # undef YYERROR_VERBOSE
138 # define YYERROR_VERBOSE 1
139 #else
140 # define YYERROR_VERBOSE 0
141 #endif
142 
143 /* Enabling the token table. */
144 #ifndef YYTOKEN_TABLE
145 # define YYTOKEN_TABLE 0
146 #endif
147 
148 
149 /* Tokens. */
150 #ifndef YYTOKENTYPE
151 # define YYTOKENTYPE
152  /* Put the tokens into the symbol table, so that GDB and other debuggers
153  know about them. */
154  enum yytokentype {
156  Float = 259,
157  Eol = 260,
158  DATA = 261,
159  VAR = 262,
160  NAME = 263,
161  Begin = 264,
162  End = 265,
163  Version = 266,
164  Identifier = 267,
165  Integer = 268,
166  CITIFILE = 269,
167  VarType = 270,
170  SegListEnd = 273,
171  VarListEnd = 274,
172  COMMENT = 275,
173  CONSTANT = 276,
174  SEG = 277
175  };
176 #endif
177 /* Tokens. */
178 #define InvalidCharacter 258
179 #define Float 259
180 #define Eol 260
181 #define DATA 261
182 #define VAR 262
183 #define NAME 263
184 #define Begin 264
185 #define End 265
186 #define Version 266
187 #define Identifier 267
188 #define Integer 268
189 #define CITIFILE 269
190 #define VarType 270
191 #define SegListBegin 271
192 #define VarListBegin 272
193 #define SegListEnd 273
194 #define VarListEnd 274
195 #define COMMENT 275
196 #define CONSTANT 276
197 #define SEG 277
198 
199 
200 
201 
202 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
203 typedef union YYSTYPE
204 {
205 
206 /* Line 214 of yacc.c */
207 #line 73 "parse_citi.y"
208 
209  char * ident;
210  double f;
211  int d;
213  struct citi_package_t * p;
214  struct citi_header_t * h;
215 
216 
217 
218 /* Line 214 of yacc.c */
219 #line 220 "parse_citi.cpp"
220 } YYSTYPE;
221 # define YYSTYPE_IS_TRIVIAL 1
222 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
223 # define YYSTYPE_IS_DECLARED 1
224 #endif
225 
226 
227 /* Copy the second part of user declarations. */
228 
229 
230 /* Line 264 of yacc.c */
231 #line 232 "parse_citi.cpp"
232 
233 #ifdef short
234 # undef short
235 #endif
236 
237 #ifdef YYTYPE_UINT8
238 typedef YYTYPE_UINT8 yytype_uint8;
239 #else
240 typedef unsigned char yytype_uint8;
241 #endif
242 
243 #ifdef YYTYPE_INT8
244 typedef YYTYPE_INT8 yytype_int8;
245 #elif (defined __STDC__ || defined __C99__FUNC__ \
246  || defined __cplusplus || defined _MSC_VER)
247 typedef signed char yytype_int8;
248 #else
249 typedef short int yytype_int8;
250 #endif
251 
252 #ifdef YYTYPE_UINT16
253 typedef YYTYPE_UINT16 yytype_uint16;
254 #else
255 typedef unsigned short int yytype_uint16;
256 #endif
257 
258 #ifdef YYTYPE_INT16
259 typedef YYTYPE_INT16 yytype_int16;
260 #else
261 typedef short int yytype_int16;
262 #endif
263 
264 #ifndef YYSIZE_T
265 # ifdef __SIZE_TYPE__
266 # define YYSIZE_T __SIZE_TYPE__
267 # elif defined size_t
268 # define YYSIZE_T size_t
269 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
270  || defined __cplusplus || defined _MSC_VER)
271 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
272 # define YYSIZE_T size_t
273 # else
274 # define YYSIZE_T unsigned int
275 # endif
276 #endif
277 
278 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
279 
280 #ifndef YY_
281 # if YYENABLE_NLS
282 # if ENABLE_NLS
283 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
284 # define YY_(msgid) dgettext ("bison-runtime", msgid)
285 # endif
286 # endif
287 # ifndef YY_
288 # define YY_(msgid) msgid
289 # endif
290 #endif
291 
292 /* Suppress unused-variable warnings by "using" E. */
293 #if ! defined lint || defined __GNUC__
294 # define YYUSE(e) ((void) (e))
295 #else
296 # define YYUSE(e) /* empty */
297 #endif
298 
299 /* Identity function, used to suppress warnings about constant conditions. */
300 #ifndef lint
301 # define YYID(n) (n)
302 #else
303 #if (defined __STDC__ || defined __C99__FUNC__ \
304  || defined __cplusplus || defined _MSC_VER)
305 static int
306 YYID (int yyi)
307 #else
308 static int
309 YYID (yyi)
310  int yyi;
311 #endif
312 {
313  return yyi;
314 }
315 #endif
316 
317 #if ! defined yyoverflow || YYERROR_VERBOSE
318 
319 /* The parser invokes alloca or malloc; define the necessary symbols. */
320 
321 # ifdef YYSTACK_USE_ALLOCA
322 # if YYSTACK_USE_ALLOCA
323 # ifdef __GNUC__
324 # define YYSTACK_ALLOC __builtin_alloca
325 # elif defined __BUILTIN_VA_ARG_INCR
326 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
327 # elif defined _AIX
328 # define YYSTACK_ALLOC __alloca
329 # elif defined _MSC_VER
330 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
331 # define alloca _alloca
332 # else
333 # define YYSTACK_ALLOC alloca
334 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
335  || defined __cplusplus || defined _MSC_VER)
336 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
337 # ifndef _STDLIB_H
338 # define _STDLIB_H 1
339 # endif
340 # endif
341 # endif
342 # endif
343 # endif
344 
345 # ifdef YYSTACK_ALLOC
346  /* Pacify GCC's `empty if-body' warning. */
347 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
348 # ifndef YYSTACK_ALLOC_MAXIMUM
349  /* The OS might guarantee only one guard page at the bottom of the stack,
350  and a page size can be as small as 4096 bytes. So we cannot safely
351  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
352  to allow for a few compiler-allocated temporary stack slots. */
353 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
354 # endif
355 # else
356 # define YYSTACK_ALLOC YYMALLOC
357 # define YYSTACK_FREE YYFREE
358 # ifndef YYSTACK_ALLOC_MAXIMUM
359 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
360 # endif
361 # if (defined __cplusplus && ! defined _STDLIB_H \
362  && ! ((defined YYMALLOC || defined malloc) \
363  && (defined YYFREE || defined free)))
364 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
365 # ifndef _STDLIB_H
366 # define _STDLIB_H 1
367 # endif
368 # endif
369 # ifndef YYMALLOC
370 # define YYMALLOC malloc
371 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
372  || defined __cplusplus || defined _MSC_VER)
373 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
374 # endif
375 # endif
376 # ifndef YYFREE
377 # define YYFREE free
378 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
379  || defined __cplusplus || defined _MSC_VER)
380 void free (void *); /* INFRINGES ON USER NAME SPACE */
381 # endif
382 # endif
383 # endif
384 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
385 
386 
387 #if (! defined yyoverflow \
388  && (! defined __cplusplus \
389  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
390 
391 /* A type that is properly aligned for any stack member. */
392 union yyalloc
393 {
396 };
397 
398 /* The size of the maximum gap between one aligned stack and the next. */
399 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
400 
401 /* The size of an array large to enough to hold all stacks, each with
402  N elements. */
403 # define YYSTACK_BYTES(N) \
404  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
405  + YYSTACK_GAP_MAXIMUM)
406 
407 /* Copy COUNT objects from FROM to TO. The source and destination do
408  not overlap. */
409 # ifndef YYCOPY
410 # if defined __GNUC__ && 1 < __GNUC__
411 # define YYCOPY(To, From, Count) \
412  __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
413 # else
414 # define YYCOPY(To, From, Count) \
415  do \
416  { \
417  YYSIZE_T yyi; \
418  for (yyi = 0; yyi < (Count); yyi++) \
419  (To)[yyi] = (From)[yyi]; \
420  } \
421  while (YYID (0))
422 # endif
423 # endif
424 
425 /* Relocate STACK from its old location to the new one. The
426  local variables YYSIZE and YYSTACKSIZE give the old and new number of
427  elements in the stack, and YYPTR gives the new location of the
428  stack. Advance YYPTR to a properly aligned location for the next
429  stack. */
430 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
431  do \
432  { \
433  YYSIZE_T yynewbytes; \
434  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
435  Stack = &yyptr->Stack_alloc; \
436  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
437  yyptr += yynewbytes / sizeof (*yyptr); \
438  } \
439  while (YYID (0))
440 
441 #endif
442 
443 /* YYFINAL -- State number of the termination state. */
444 #define YYFINAL 9
445 /* YYLAST -- Last index in YYTABLE. */
446 #define YYLAST 77
447 
448 /* YYNTOKENS -- Number of terminals. */
449 #define YYNTOKENS 26
450 /* YYNNTS -- Number of nonterminals. */
451 #define YYNNTS 13
452 /* YYNRULES -- Number of rules. */
453 #define YYNRULES 28
454 /* YYNRULES -- Number of states. */
455 #define YYNSTATES 77
456 
457 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
458 #define YYUNDEFTOK 2
459 #define YYMAXUTOK 277
460 
461 #define YYTRANSLATE(YYX) \
462  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
463 
464 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
465 static const yytype_uint8 yytranslate[] =
466 {
467  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471  2, 2, 2, 2, 24, 2, 2, 2, 2, 2,
472  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
476  2, 23, 2, 25, 2, 2, 2, 2, 2, 2,
477  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
478  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
480  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
481  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
482  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
483  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
484  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
485  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
486  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
487  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
488  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
489  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
490  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
491  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
492  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
493  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
494  15, 16, 17, 18, 19, 20, 21, 22
495 };
496 
497 #if YYDEBUG
498 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
499  YYRHS. */
500 static const yytype_uint8 yyprhs[] =
501 {
502  0, 0, 3, 5, 6, 9, 12, 15, 20, 21,
503  24, 28, 34, 39, 49, 57, 63, 64, 67, 77,
504  83, 84, 87, 93, 95, 96, 100, 106, 107
505 };
506 
507 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
508 static const yytype_int8 yyrhs[] =
509 {
510  27, 0, -1, 28, -1, -1, 29, 28, -1, 5,
511  28, -1, 30, 35, -1, 14, 11, 5, 31, -1,
512  -1, 32, 31, -1, 8, 12, 5, -1, 7, 12,
513  15, 13, 5, -1, 6, 12, 15, 5, -1, 6,
514  12, 23, 13, 24, 13, 25, 15, 5, -1, 6,
515  12, 23, 13, 25, 15, 5, -1, 21, 12, 4,
516  33, 5, -1, -1, 4, 33, -1, 16, 5, 22,
517  4, 4, 4, 5, 18, 5, -1, 17, 5, 38,
518  19, 5, -1, -1, 36, 35, -1, 9, 5, 37,
519  10, 5, -1, 34, -1, -1, 4, 5, 37, -1,
520  4, 24, 4, 5, 37, -1, -1, 4, 5, 38,
521  -1
522 };
523 
524 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
525 static const yytype_uint8 yyrline[] =
526 {
527  0, 92, 92, 97, 98, 106, 112, 120, 125, 126,
528  137, 141, 148, 154, 162, 169, 174, 175, 180, 183,
529  188, 189, 200, 203, 208, 209, 213, 219, 220
530 };
531 #endif
532 
533 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
534 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
535  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
536 static const char *const yytname[] =
537 {
538  "$end", "error", "$undefined", "InvalidCharacter", "Float", "Eol",
539  "DATA", "VAR", "NAME", "Begin", "End", "Version", "Identifier",
540  "Integer", "CITIFILE", "VarType", "SegListBegin", "VarListBegin",
541  "SegListEnd", "VarListEnd", "COMMENT", "CONSTANT", "SEG", "'['", "','",
542  "']'", "$accept", "Input", "PackageList", "Package", "Header",
543  "HeaderList", "HeaderLine", "ValueList", "List", "DataList", "Data",
544  "FloatList", "VarList", 0
545 };
546 #endif
547 
548 # ifdef YYPRINT
549 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
550  token YYLEX-NUM. */
551 static const yytype_uint16 yytoknum[] =
552 {
553  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
554  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
555  275, 276, 277, 91, 44, 93
556 };
557 # endif
558 
559 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
560 static const yytype_uint8 yyr1[] =
561 {
562  0, 26, 27, 28, 28, 28, 29, 30, 31, 31,
563  32, 32, 32, 32, 32, 32, 33, 33, 34, 34,
564  35, 35, 36, 36, 37, 37, 37, 38, 38
565 };
566 
567 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
568 static const yytype_uint8 yyr2[] =
569 {
570  0, 2, 1, 0, 2, 2, 2, 4, 0, 2,
571  3, 5, 4, 9, 7, 5, 0, 2, 9, 5,
572  0, 2, 5, 1, 0, 3, 5, 0, 3
573 };
574 
575 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
576  STATE-NUM when YYTABLE doesn't specify something else to do. Zero
577  means the default is an error. */
578 static const yytype_uint8 yydefact[] =
579 {
580  3, 3, 0, 0, 2, 3, 20, 5, 0, 1,
581  4, 0, 0, 0, 23, 6, 20, 8, 24, 0,
582  27, 21, 0, 0, 0, 0, 7, 8, 0, 0,
583  0, 0, 0, 0, 0, 0, 0, 9, 24, 0,
584  0, 0, 27, 0, 0, 0, 0, 10, 16, 25,
585  0, 22, 0, 28, 19, 12, 0, 0, 16, 0,
586  24, 0, 0, 0, 11, 17, 15, 26, 0, 0,
587  0, 0, 0, 14, 18, 0, 13
588 };
589 
590 /* YYDEFGOTO[NTERM-NUM]. */
591 static const yytype_int8 yydefgoto[] =
592 {
593  -1, 3, 4, 5, 6, 26, 27, 59, 14, 15,
594  16, 29, 32
595 };
596 
597 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
598  STATE-NUM. */
599 #define YYPACT_NINF -39
600 static const yytype_int8 yypact[] =
601 {
602  1, 1, 3, 8, -39, 1, -7, -39, 7, -39,
603  -39, 14, 18, 19, -39, -39, -7, -3, 21, 4,
604  23, -39, 16, 17, 20, 22, -39, -3, -4, 25,
605  26, 28, 12, -2, 24, 31, 33, -39, 21, 34,
606  35, 37, 23, 38, 39, 29, 32, -39, 42, -39,
607  43, -39, 45, -39, -39, -39, -8, 46, 42, 47,
608  21, 48, 41, 40, -39, -39, -39, -39, 44, 36,
609  51, 52, 49, -39, -39, 53, -39
610 };
611 
612 /* YYPGOTO[NTERM-NUM]. */
613 static const yytype_int8 yypgoto[] =
614 {
615  -39, -39, 6, -39, -39, 50, -39, -11, -39, 54,
616  -39, -38, 27
617 };
618 
619 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
620  positive, shift that token. If negative, reduce the rule which
621  number is the opposite. If zero, do what YYDEFACT says.
622  If YYTABLE_NINF, syntax error. */
623 #define YYTABLE_NINF -1
624 static const yytype_uint8 yytable[] =
625 {
626  49, 38, 11, 22, 23, 24, 1, 7, 9, 12,
627  13, 10, 17, 44, 8, 2, 62, 63, 25, 18,
628  39, 45, 67, 19, 20, 28, 30, 31, 33, 34,
629  41, 43, 35, 42, 36, 40, 47, 48, 50, 46,
630  51, 52, 56, 54, 55, 57, 58, 65, 60, 61,
631  0, 64, 66, 68, 69, 70, 73, 74, 76, 0,
632  0, 72, 71, 0, 75, 0, 0, 0, 0, 53,
633  21, 0, 0, 0, 0, 0, 0, 37
634 };
635 
636 static const yytype_int8 yycheck[] =
637 {
638  38, 5, 9, 6, 7, 8, 5, 1, 0, 16,
639  17, 5, 5, 15, 11, 14, 24, 25, 21, 5,
640  24, 23, 60, 5, 5, 4, 22, 4, 12, 12,
641  4, 19, 12, 5, 12, 10, 5, 4, 4, 15,
642  5, 4, 13, 5, 5, 13, 4, 58, 5, 4,
643  -1, 5, 5, 5, 13, 15, 5, 5, 5, -1,
644  -1, 25, 18, -1, 15, -1, -1, -1, -1, 42,
645  16, -1, -1, -1, -1, -1, -1, 27
646 };
647 
648 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
649  symbol of state STATE-NUM. */
650 static const yytype_uint8 yystos[] =
651 {
652  0, 5, 14, 27, 28, 29, 30, 28, 11, 0,
653  28, 9, 16, 17, 34, 35, 36, 5, 5, 5,
654  5, 35, 6, 7, 8, 21, 31, 32, 4, 37,
655  22, 4, 38, 12, 12, 12, 12, 31, 5, 24,
656  10, 4, 5, 19, 15, 23, 15, 5, 4, 37,
657  4, 5, 4, 38, 5, 5, 13, 13, 4, 33,
658  5, 4, 24, 25, 5, 33, 5, 37, 5, 13,
659  15, 18, 25, 5, 5, 15, 5
660 };
661 
662 #define yyerrok (yyerrstatus = 0)
663 #define yyclearin (yychar = YYEMPTY)
664 #define YYEMPTY (-2)
665 #define YYEOF 0
666 
667 #define YYACCEPT goto yyacceptlab
668 #define YYABORT goto yyabortlab
669 #define YYERROR goto yyerrorlab
670 
671 
672 /* Like YYERROR except do call yyerror. This remains here temporarily
673  to ease the transition to the new meaning of YYERROR, for GCC.
674  Once GCC version 2 has supplanted version 1, this can go. */
675 
676 #define YYFAIL goto yyerrlab
677 
678 #define YYRECOVERING() (!!yyerrstatus)
679 
680 #define YYBACKUP(Token, Value) \
681 do \
682  if (yychar == YYEMPTY && yylen == 1) \
683  { \
684  yychar = (Token); \
685  yylval = (Value); \
686  yytoken = YYTRANSLATE (yychar); \
687  YYPOPSTACK (1); \
688  goto yybackup; \
689  } \
690  else \
691  { \
692  yyerror (YY_("syntax error: cannot back up")); \
693  YYERROR; \
694  } \
695 while (YYID (0))
696 
697 
698 #define YYTERROR 1
699 #define YYERRCODE 256
700 
701 
702 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
703  If N is 0, then set CURRENT to the empty location which ends
704  the previous symbol: RHS[0] (always defined). */
705 
706 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
707 #ifndef YYLLOC_DEFAULT
708 # define YYLLOC_DEFAULT(Current, Rhs, N) \
709  do \
710  if (YYID (N)) \
711  { \
712  (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
713  (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
714  (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
715  (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
716  } \
717  else \
718  { \
719  (Current).first_line = (Current).last_line = \
720  YYRHSLOC (Rhs, 0).last_line; \
721  (Current).first_column = (Current).last_column = \
722  YYRHSLOC (Rhs, 0).last_column; \
723  } \
724  while (YYID (0))
725 #endif
726 
727 
728 /* YY_LOCATION_PRINT -- Print the location on the stream.
729  This macro was not mandated originally: define only if we know
730  we won't break user code: when these are the locations we know. */
731 
732 #ifndef YY_LOCATION_PRINT
733 # if YYLTYPE_IS_TRIVIAL
734 # define YY_LOCATION_PRINT(File, Loc) \
735  fprintf (File, "%d.%d-%d.%d", \
736  (Loc).first_line, (Loc).first_column, \
737  (Loc).last_line, (Loc).last_column)
738 # else
739 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
740 # endif
741 #endif
742 
743 
744 /* YYLEX -- calling `yylex' with the right arguments. */
745 
746 #ifdef YYLEX_PARAM
747 # define YYLEX yylex (YYLEX_PARAM)
748 #else
749 # define YYLEX yylex ()
750 #endif
751 
752 /* Enable debugging if requested. */
753 #if YYDEBUG
754 
755 # ifndef YYFPRINTF
756 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
757 # define YYFPRINTF fprintf
758 # endif
759 
760 # define YYDPRINTF(Args) \
761 do { \
762  if (yydebug) \
763  YYFPRINTF Args; \
764 } while (YYID (0))
765 
766 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
767 do { \
768  if (yydebug) \
769  { \
770  YYFPRINTF (stderr, "%s ", Title); \
771  yy_symbol_print (stderr, \
772  Type, Value); \
773  YYFPRINTF (stderr, "\n"); \
774  } \
775 } while (YYID (0))
776 
777 
778 /*--------------------------------.
779 | Print this symbol on YYOUTPUT. |
780 `--------------------------------*/
781 
782 /*ARGSUSED*/
783 #if (defined __STDC__ || defined __C99__FUNC__ \
784  || defined __cplusplus || defined _MSC_VER)
785 static void
786 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
787 #else
788 static void
789 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
790  FILE *yyoutput;
791  int yytype;
792  YYSTYPE const * const yyvaluep;
793 #endif
794 {
795  if (!yyvaluep)
796  return;
797 # ifdef YYPRINT
798  if (yytype < YYNTOKENS)
799  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
800 # else
801  YYUSE (yyoutput);
802 # endif
803  switch (yytype)
804  {
805  default:
806  break;
807  }
808 }
809 
810 
811 /*--------------------------------.
812 | Print this symbol on YYOUTPUT. |
813 `--------------------------------*/
814 
815 #if (defined __STDC__ || defined __C99__FUNC__ \
816  || defined __cplusplus || defined _MSC_VER)
817 static void
818 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
819 #else
820 static void
821 yy_symbol_print (yyoutput, yytype, yyvaluep)
822  FILE *yyoutput;
823  int yytype;
824  YYSTYPE const * const yyvaluep;
825 #endif
826 {
827  if (yytype < YYNTOKENS)
828  YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
829  else
830  YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
831 
832  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
833  YYFPRINTF (yyoutput, ")");
834 }
835 
836 /*------------------------------------------------------------------.
837 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
838 | TOP (included). |
839 `------------------------------------------------------------------*/
840 
841 #if (defined __STDC__ || defined __C99__FUNC__ \
842  || defined __cplusplus || defined _MSC_VER)
843 static void
844 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
845 #else
846 static void
847 yy_stack_print (yybottom, yytop)
848  yytype_int16 *yybottom;
849  yytype_int16 *yytop;
850 #endif
851 {
852  YYFPRINTF (stderr, "Stack now");
853  for (; yybottom <= yytop; yybottom++)
854  {
855  int yybot = *yybottom;
856  YYFPRINTF (stderr, " %d", yybot);
857  }
858  YYFPRINTF (stderr, "\n");
859 }
860 
861 # define YY_STACK_PRINT(Bottom, Top) \
862 do { \
863  if (yydebug) \
864  yy_stack_print ((Bottom), (Top)); \
865 } while (YYID (0))
866 
867 
868 /*------------------------------------------------.
869 | Report that the YYRULE is going to be reduced. |
870 `------------------------------------------------*/
871 
872 #if (defined __STDC__ || defined __C99__FUNC__ \
873  || defined __cplusplus || defined _MSC_VER)
874 static void
875 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
876 #else
877 static void
878 yy_reduce_print (yyvsp, yyrule)
879  YYSTYPE *yyvsp;
880  int yyrule;
881 #endif
882 {
883  int yynrhs = yyr2[yyrule];
884  int yyi;
885  unsigned long int yylno = yyrline[yyrule];
886  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
887  yyrule - 1, yylno);
888  /* The symbols being reduced. */
889  for (yyi = 0; yyi < yynrhs; yyi++)
890  {
891  YYFPRINTF (stderr, " $%d = ", yyi + 1);
892  yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
893  &(yyvsp[(yyi + 1) - (yynrhs)])
894  );
895  YYFPRINTF (stderr, "\n");
896  }
897 }
898 
899 # define YY_REDUCE_PRINT(Rule) \
900 do { \
901  if (yydebug) \
902  yy_reduce_print (yyvsp, Rule); \
903 } while (YYID (0))
904 
905 /* Nonzero means print parse trace. It is left uninitialized so that
906  multiple parsers can coexist. */
908 #else /* !YYDEBUG */
909 # define YYDPRINTF(Args)
910 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
911 # define YY_STACK_PRINT(Bottom, Top)
912 # define YY_REDUCE_PRINT(Rule)
913 #endif /* !YYDEBUG */
914 
915 
916 /* YYINITDEPTH -- initial size of the parser's stacks. */
917 #ifndef YYINITDEPTH
918 # define YYINITDEPTH 200
919 #endif
920 
921 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
922  if the built-in stack extension method is used).
923 
924  Do not make this value too large; the results are undefined if
925  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
926  evaluated with infinite-precision integer arithmetic. */
927 
928 #ifndef YYMAXDEPTH
929 # define YYMAXDEPTH 10000
930 #endif
931 
932 
933 
934 #if YYERROR_VERBOSE
935 
936 # ifndef yystrlen
937 # if defined __GLIBC__ && defined _STRING_H
938 # define yystrlen strlen
939 # else
940 /* Return the length of YYSTR. */
941 #if (defined __STDC__ || defined __C99__FUNC__ \
942  || defined __cplusplus || defined _MSC_VER)
943 static YYSIZE_T
944 yystrlen (const char *yystr)
945 #else
946 static YYSIZE_T
947 yystrlen (yystr)
948  const char *yystr;
949 #endif
950 {
951  YYSIZE_T yylen;
952  for (yylen = 0; yystr[yylen]; yylen++)
953  continue;
954  return yylen;
955 }
956 # endif
957 # endif
958 
959 # ifndef yystpcpy
960 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
961 # define yystpcpy stpcpy
962 # else
963 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
964  YYDEST. */
965 #if (defined __STDC__ || defined __C99__FUNC__ \
966  || defined __cplusplus || defined _MSC_VER)
967 static char *
968 yystpcpy (char *yydest, const char *yysrc)
969 #else
970 static char *
971 yystpcpy (yydest, yysrc)
972  char *yydest;
973  const char *yysrc;
974 #endif
975 {
976  char *yyd = yydest;
977  const char *yys = yysrc;
978 
979  while ((*yyd++ = *yys++) != '\0')
980  continue;
981 
982  return yyd - 1;
983 }
984 # endif
985 # endif
986 
987 # ifndef yytnamerr
988 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
989  quotes and backslashes, so that it's suitable for yyerror. The
990  heuristic is that double-quoting is unnecessary unless the string
991  contains an apostrophe, a comma, or backslash (other than
992  backslash-backslash). YYSTR is taken from yytname. If YYRES is
993  null, do not copy; instead, return the length of what the result
994  would have been. */
995 static YYSIZE_T
996 yytnamerr (char *yyres, const char *yystr)
997 {
998  if (*yystr == '"')
999  {
1000  YYSIZE_T yyn = 0;
1001  char const *yyp = yystr;
1002 
1003  for (;;)
1004  switch (*++yyp)
1005  {
1006  case '\'':
1007  case ',':
1008  goto do_not_strip_quotes;
1009 
1010  case '\\':
1011  if (*++yyp != '\\')
1012  goto do_not_strip_quotes;
1013  /* Fall through. */
1014  default:
1015  if (yyres)
1016  yyres[yyn] = *yyp;
1017  yyn++;
1018  break;
1019 
1020  case '"':
1021  if (yyres)
1022  yyres[yyn] = '\0';
1023  return yyn;
1024  }
1025  do_not_strip_quotes: ;
1026  }
1027 
1028  if (! yyres)
1029  return yystrlen (yystr);
1030 
1031  return yystpcpy (yyres, yystr) - yyres;
1032 }
1033 # endif
1034 
1035 /* Copy into YYRESULT an error message about the unexpected token
1036  YYCHAR while in state YYSTATE. Return the number of bytes copied,
1037  including the terminating null byte. If YYRESULT is null, do not
1038  copy anything; just return the number of bytes that would be
1039  copied. As a special case, return 0 if an ordinary "syntax error"
1040  message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1041  size calculation. */
1042 static YYSIZE_T
1043 yysyntax_error (char *yyresult, int yystate, int yychar)
1044 {
1045  int yyn = yypact[yystate];
1046 
1047  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1048  return 0;
1049  else
1050  {
1051  int yytype = YYTRANSLATE (yychar);
1052  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1053  YYSIZE_T yysize = yysize0;
1054  YYSIZE_T yysize1;
1055  int yysize_overflow = 0;
1056  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1057  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1058  int yyx;
1059 
1060 # if 0
1061  /* This is so xgettext sees the translatable formats that are
1062  constructed on the fly. */
1063  YY_("syntax error, unexpected %s");
1064  YY_("syntax error, unexpected %s, expecting %s");
1065  YY_("syntax error, unexpected %s, expecting %s or %s");
1066  YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1067  YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1068 # endif
1069  char *yyfmt;
1070  char const *yyf;
1071  static char const yyunexpected[] = "syntax error, unexpected %s";
1072  static char const yyexpecting[] = ", expecting %s";
1073  static char const yyor[] = " or %s";
1074  char yyformat[sizeof yyunexpected
1075  + sizeof yyexpecting - 1
1076  + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1077  * (sizeof yyor - 1))];
1078  char const *yyprefix = yyexpecting;
1079 
1080  /* Start YYX at -YYN if negative to avoid negative indexes in
1081  YYCHECK. */
1082  int yyxbegin = yyn < 0 ? -yyn : 0;
1083 
1084  /* Stay within bounds of both yycheck and yytname. */
1085  int yychecklim = YYLAST - yyn + 1;
1086  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1087  int yycount = 1;
1088 
1089  yyarg[0] = yytname[yytype];
1090  yyfmt = yystpcpy (yyformat, yyunexpected);
1091 
1092  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1093  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1094  {
1095  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1096  {
1097  yycount = 1;
1098  yysize = yysize0;
1099  yyformat[sizeof yyunexpected - 1] = '\0';
1100  break;
1101  }
1102  yyarg[yycount++] = yytname[yyx];
1103  yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1104  yysize_overflow |= (yysize1 < yysize);
1105  yysize = yysize1;
1106  yyfmt = yystpcpy (yyfmt, yyprefix);
1107  yyprefix = yyor;
1108  }
1109 
1110  yyf = YY_(yyformat);
1111  yysize1 = yysize + yystrlen (yyf);
1112  yysize_overflow |= (yysize1 < yysize);
1113  yysize = yysize1;
1114 
1115  if (yysize_overflow)
1116  return YYSIZE_MAXIMUM;
1117 
1118  if (yyresult)
1119  {
1120  /* Avoid sprintf, as that infringes on the user's name space.
1121  Don't have undefined behavior even if the translation
1122  produced a string with the wrong number of "%s"s. */
1123  char *yyp = yyresult;
1124  int yyi = 0;
1125  while ((*yyp = *yyf) != '\0')
1126  {
1127  if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1128  {
1129  yyp += yytnamerr (yyp, yyarg[yyi++]);
1130  yyf += 2;
1131  }
1132  else
1133  {
1134  yyp++;
1135  yyf++;
1136  }
1137  }
1138  }
1139  return yysize;
1140  }
1141 }
1142 #endif /* YYERROR_VERBOSE */
1143 
1144 
1145 /*-----------------------------------------------.
1146 | Release the memory associated to this symbol. |
1147 `-----------------------------------------------*/
1148 
1149 /*ARGSUSED*/
1150 #if (defined __STDC__ || defined __C99__FUNC__ \
1151  || defined __cplusplus || defined _MSC_VER)
1152 static void
1153 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1154 #else
1155 static void
1156 yydestruct (yymsg, yytype, yyvaluep)
1157  const char *yymsg;
1158  int yytype;
1159  YYSTYPE *yyvaluep;
1160 #endif
1161 {
1162  YYUSE (yyvaluep);
1163 
1164  if (!yymsg)
1165  yymsg = "Deleting";
1166  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1167 
1168  switch (yytype)
1169  {
1170 
1171  default:
1172  break;
1173  }
1174 }
1175 
1176 /* Prevent warnings from -Wmissing-prototypes. */
1177 #ifdef YYPARSE_PARAM
1178 #if defined __STDC__ || defined __cplusplus
1179 int yyparse (void *YYPARSE_PARAM);
1180 #else
1181 int yyparse ();
1182 #endif
1183 #else /* ! YYPARSE_PARAM */
1184 #if defined __STDC__ || defined __cplusplus
1185 int yyparse (void);
1186 #else
1187 int yyparse ();
1188 #endif
1189 #endif /* ! YYPARSE_PARAM */
1190 
1191 
1192 /* The lookahead symbol. */
1194 
1195 /* The semantic value of the lookahead symbol. */
1197 
1198 /* Number of syntax errors so far. */
1200 
1201 
1202 
1203 /*-------------------------.
1204 | yyparse or yypush_parse. |
1205 `-------------------------*/
1206 
1207 #ifdef YYPARSE_PARAM
1208 #if (defined __STDC__ || defined __C99__FUNC__ \
1209  || defined __cplusplus || defined _MSC_VER)
1210 int
1211 yyparse (void *YYPARSE_PARAM)
1212 #else
1213 int
1214 yyparse (YYPARSE_PARAM)
1215  void *YYPARSE_PARAM;
1216 #endif
1217 #else /* ! YYPARSE_PARAM */
1218 #if (defined __STDC__ || defined __C99__FUNC__ \
1219  || defined __cplusplus || defined _MSC_VER)
1220 int
1221 yyparse (void)
1222 #else
1223 int
1224 yyparse ()
1225 
1226 #endif
1227 #endif
1228 {
1229 
1230 
1231  int yystate;
1232  /* Number of tokens to shift before error messages enabled. */
1233  int yyerrstatus;
1234 
1235  /* The stacks and their tools:
1236  `yyss': related to states.
1237  `yyvs': related to semantic values.
1238 
1239  Refer to the stacks thru separate pointers, to allow yyoverflow
1240  to reallocate them elsewhere. */
1241 
1242  /* The state stack. */
1243  yytype_int16 yyssa[YYINITDEPTH];
1244  yytype_int16 *yyss;
1245  yytype_int16 *yyssp;
1246 
1247  /* The semantic value stack. */
1248  YYSTYPE yyvsa[YYINITDEPTH];
1249  YYSTYPE *yyvs;
1250  YYSTYPE *yyvsp;
1251 
1252  YYSIZE_T yystacksize;
1253 
1254  int yyn;
1255  int yyresult;
1256  /* Lookahead token as an internal (translated) token number. */
1257  int yytoken;
1258  /* The variables used to return semantic value and location from the
1259  action routines. */
1260  YYSTYPE yyval;
1261 
1262 #if YYERROR_VERBOSE
1263  /* Buffer for error messages, and its allocated size. */
1264  char yymsgbuf[128];
1265  char *yymsg = yymsgbuf;
1266  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1267 #endif
1268 
1269 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1270 
1271  /* The number of symbols on the RHS of the reduced rule.
1272  Keep to zero when no symbol should be popped. */
1273  int yylen = 0;
1274 
1275  yytoken = 0;
1276  yyss = yyssa;
1277  yyvs = yyvsa;
1278  yystacksize = YYINITDEPTH;
1279 
1280  YYDPRINTF ((stderr, "Starting parse\n"));
1281 
1282  yystate = 0;
1283  yyerrstatus = 0;
1284  yynerrs = 0;
1285  yychar = YYEMPTY; /* Cause a token to be read. */
1286 
1287  /* Initialize stack pointers.
1288  Waste one element of value and location stack
1289  so that they stay on the same level as the state stack.
1290  The wasted elements are never initialized. */
1291  yyssp = yyss;
1292  yyvsp = yyvs;
1293 
1294  goto yysetstate;
1295 
1296 /*------------------------------------------------------------.
1297 | yynewstate -- Push a new state, which is found in yystate. |
1298 `------------------------------------------------------------*/
1299  yynewstate:
1300  /* In all cases, when you get here, the value and location stacks
1301  have just been pushed. So pushing a state here evens the stacks. */
1302  yyssp++;
1303 
1304  yysetstate:
1305  *yyssp = yystate;
1306 
1307  if (yyss + yystacksize - 1 <= yyssp)
1308  {
1309  /* Get the current used size of the three stacks, in elements. */
1310  YYSIZE_T yysize = yyssp - yyss + 1;
1311 
1312 #ifdef yyoverflow
1313  {
1314  /* Give user a chance to reallocate the stack. Use copies of
1315  these so that the &'s don't force the real ones into
1316  memory. */
1317  YYSTYPE *yyvs1 = yyvs;
1318  yytype_int16 *yyss1 = yyss;
1319 
1320  /* Each stack pointer address is followed by the size of the
1321  data in use in that stack, in bytes. This used to be a
1322  conditional around just the two extra args, but that might
1323  be undefined if yyoverflow is a macro. */
1324  yyoverflow (YY_("memory exhausted"),
1325  &yyss1, yysize * sizeof (*yyssp),
1326  &yyvs1, yysize * sizeof (*yyvsp),
1327  &yystacksize);
1328 
1329  yyss = yyss1;
1330  yyvs = yyvs1;
1331  }
1332 #else /* no yyoverflow */
1333 # ifndef YYSTACK_RELOCATE
1334  goto yyexhaustedlab;
1335 # else
1336  /* Extend the stack our own way. */
1337  if (YYMAXDEPTH <= yystacksize)
1338  goto yyexhaustedlab;
1339  yystacksize *= 2;
1340  if (YYMAXDEPTH < yystacksize)
1341  yystacksize = YYMAXDEPTH;
1342 
1343  {
1344  yytype_int16 *yyss1 = yyss;
1345  union yyalloc *yyptr =
1346  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1347  if (! yyptr)
1348  goto yyexhaustedlab;
1349  YYSTACK_RELOCATE (yyss_alloc, yyss);
1350  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1351 # undef YYSTACK_RELOCATE
1352  if (yyss1 != yyssa)
1353  YYSTACK_FREE (yyss1);
1354  }
1355 # endif
1356 #endif /* no yyoverflow */
1357 
1358  yyssp = yyss + yysize - 1;
1359  yyvsp = yyvs + yysize - 1;
1360 
1361  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1362  (unsigned long int) yystacksize));
1363 
1364  if (yyss + yystacksize - 1 <= yyssp)
1365  YYABORT;
1366  }
1367 
1368  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1369 
1370  if (yystate == YYFINAL)
1371  YYACCEPT;
1372 
1373  goto yybackup;
1374 
1375 /*-----------.
1376 | yybackup. |
1377 `-----------*/
1378 yybackup:
1379 
1380  /* Do appropriate processing given the current state. Read a
1381  lookahead token if we need one and don't already have one. */
1382 
1383  /* First try to decide what to do without reference to lookahead token. */
1384  yyn = yypact[yystate];
1385  if (yyn == YYPACT_NINF)
1386  goto yydefault;
1387 
1388  /* Not known => get a lookahead token if don't already have one. */
1389 
1390  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1391  if (yychar == YYEMPTY)
1392  {
1393  YYDPRINTF ((stderr, "Reading a token: "));
1394  yychar = YYLEX;
1395  }
1396 
1397  if (yychar <= YYEOF)
1398  {
1399  yychar = yytoken = YYEOF;
1400  YYDPRINTF ((stderr, "Now at end of input.\n"));
1401  }
1402  else
1403  {
1404  yytoken = YYTRANSLATE (yychar);
1405  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1406  }
1407 
1408  /* If the proper action on seeing token YYTOKEN is to reduce or to
1409  detect an error, take that action. */
1410  yyn += yytoken;
1411  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1412  goto yydefault;
1413  yyn = yytable[yyn];
1414  if (yyn <= 0)
1415  {
1416  if (yyn == 0 || yyn == YYTABLE_NINF)
1417  goto yyerrlab;
1418  yyn = -yyn;
1419  goto yyreduce;
1420  }
1421 
1422  /* Count tokens shifted since error; after three, turn off error
1423  status. */
1424  if (yyerrstatus)
1425  yyerrstatus--;
1426 
1427  /* Shift the lookahead token. */
1428  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1429 
1430  /* Discard the shifted token. */
1431  yychar = YYEMPTY;
1432 
1433  yystate = yyn;
1434  *++yyvsp = yylval;
1435 
1436  goto yynewstate;
1437 
1438 
1439 /*-----------------------------------------------------------.
1440 | yydefault -- do the default action for the current state. |
1441 `-----------------------------------------------------------*/
1442 yydefault:
1443  yyn = yydefact[yystate];
1444  if (yyn == 0)
1445  goto yyerrlab;
1446  goto yyreduce;
1447 
1448 
1449 /*-----------------------------.
1450 | yyreduce -- Do a reduction. |
1451 `-----------------------------*/
1452 yyreduce:
1453  /* yyn is the number of a rule to reduce with. */
1454  yylen = yyr2[yyn];
1455 
1456  /* If YYLEN is nonzero, implement the default value of the action:
1457  `$$ = $1'.
1458 
1459  Otherwise, the following line sets YYVAL to garbage.
1460  This behavior is undocumented and Bison
1461  users should not rely upon it. Assigning to YYVAL
1462  unconditionally makes the parser a bit smaller, and it avoids a
1463  GCC warning that YYVAL may be used uninitialized. */
1464  yyval = yyvsp[1-yylen];
1465 
1466 
1467  YY_REDUCE_PRINT (yyn);
1468  switch (yyn)
1469  {
1470  case 2:
1471 
1472 /* Line 1455 of yacc.c */
1473 #line 92 "parse_citi.y"
1474  {
1475  citi_root = (yyvsp[(1) - (1)].p); /* describes a valid CITIfile */
1476  }
1477  break;
1478 
1479  case 3:
1480 
1481 /* Line 1455 of yacc.c */
1482 #line 97 "parse_citi.y"
1483  { (yyval.p) = NULL; }
1484  break;
1485 
1486  case 4:
1487 
1488 /* Line 1455 of yacc.c */
1489 #line 98 "parse_citi.y"
1490  {
1491  if ((yyvsp[(1) - (2)].p)) {
1492  (yyvsp[(1) - (2)].p)->next = (yyvsp[(2) - (2)].p);
1493  (yyval.p) = (yyvsp[(1) - (2)].p);
1494  } else {
1495  (yyval.p) = (yyvsp[(2) - (2)].p);
1496  }
1497  }
1498  break;
1499 
1500  case 5:
1501 
1502 /* Line 1455 of yacc.c */
1503 #line 106 "parse_citi.y"
1504  {
1505  (yyval.p) = (yyvsp[(2) - (2)].p);
1506  }
1507  break;
1508 
1509  case 6:
1510 
1511 /* Line 1455 of yacc.c */
1512 #line 112 "parse_citi.y"
1513  {
1514  (yyval.p) = (struct citi_package_t *) calloc (sizeof (struct citi_package_t), 1);
1515  (yyval.p)->head = (yyvsp[(1) - (2)].h);
1516  (yyval.p)->data = (yyvsp[(2) - (2)].v);
1517  }
1518  break;
1519 
1520  case 7:
1521 
1522 /* Line 1455 of yacc.c */
1523 #line 120 "parse_citi.y"
1524  {
1525  (yyval.h) = (yyvsp[(4) - (4)].h);
1526  }
1527  break;
1528 
1529  case 8:
1530 
1531 /* Line 1455 of yacc.c */
1532 #line 125 "parse_citi.y"
1533  { (yyval.h) = NULL; }
1534  break;
1535 
1536  case 9:
1537 
1538 /* Line 1455 of yacc.c */
1539 #line 126 "parse_citi.y"
1540  {
1541  if ((yyvsp[(1) - (2)].h)) {
1542  (yyvsp[(1) - (2)].h)->next = (yyvsp[(2) - (2)].h);
1543  (yyval.h) = (yyvsp[(1) - (2)].h);
1544  } else {
1545  (yyval.h) = (yyvsp[(2) - (2)].h);
1546  }
1547  }
1548  break;
1549 
1550  case 10:
1551 
1552 /* Line 1455 of yacc.c */
1553 #line 137 "parse_citi.y"
1554  {
1555  (yyval.h) = (struct citi_header_t *) calloc (sizeof (struct citi_header_t), 1);
1556  (yyval.h)->package = (yyvsp[(2) - (3)].ident);
1557  }
1558  break;
1559 
1560  case 11:
1561 
1562 /* Line 1455 of yacc.c */
1563 #line 141 "parse_citi.y"
1564  {
1565  (yyval.h) = (struct citi_header_t *) calloc (sizeof (struct citi_header_t), 1);
1566  (yyval.h)->var = (yyvsp[(2) - (5)].ident);
1567  (yyval.h)->type = (yyvsp[(3) - (5)].ident);
1568  (yyval.h)->n = (yyvsp[(4) - (5)].d);
1569  (yyval.h)->i1 = (yyval.h)->i2 = -1;
1570  }
1571  break;
1572 
1573  case 12:
1574 
1575 /* Line 1455 of yacc.c */
1576 #line 148 "parse_citi.y"
1577  {
1578  (yyval.h) = (struct citi_header_t *) calloc (sizeof (struct citi_header_t), 1);
1579  (yyval.h)->var = (yyvsp[(2) - (4)].ident);
1580  (yyval.h)->type = (yyvsp[(3) - (4)].ident);
1581  (yyval.h)->n = (yyval.h)->i1 = (yyval.h)->i2 = -1;
1582  }
1583  break;
1584 
1585  case 13:
1586 
1587 /* Line 1455 of yacc.c */
1588 #line 154 "parse_citi.y"
1589  {
1590  (yyval.h) = (struct citi_header_t *) calloc (sizeof (struct citi_header_t), 1);
1591  (yyval.h)->var = (yyvsp[(2) - (9)].ident);
1592  (yyval.h)->i1 = (yyvsp[(4) - (9)].d);
1593  (yyval.h)->i2 = (yyvsp[(6) - (9)].d);
1594  (yyval.h)->type = (yyvsp[(8) - (9)].ident);
1595  (yyval.h)->n = -1;
1596  }
1597  break;
1598 
1599  case 14:
1600 
1601 /* Line 1455 of yacc.c */
1602 #line 162 "parse_citi.y"
1603  {
1604  (yyval.h) = (struct citi_header_t *) calloc (sizeof (struct citi_header_t), 1);
1605  (yyval.h)->var = (yyvsp[(2) - (7)].ident);
1606  (yyval.h)->i1 = (yyvsp[(4) - (7)].d);
1607  (yyval.h)->type = (yyvsp[(6) - (7)].ident);
1608  (yyval.h)->n = (yyval.h)->i2 = -1;
1609  }
1610  break;
1611 
1612  case 15:
1613 
1614 /* Line 1455 of yacc.c */
1615 #line 169 "parse_citi.y"
1616  {
1617  /* ignore constants */
1618  }
1619  break;
1620 
1621  case 16:
1622 
1623 /* Line 1455 of yacc.c */
1624 #line 174 "parse_citi.y"
1625  { }
1626  break;
1627 
1628  case 17:
1629 
1630 /* Line 1455 of yacc.c */
1631 #line 175 "parse_citi.y"
1632  {
1633  }
1634  break;
1635 
1636  case 18:
1637 
1638 /* Line 1455 of yacc.c */
1639 #line 180 "parse_citi.y"
1640  {
1641  (yyval.v) = new vector (linspace ((yyvsp[(5) - (9)].f), (yyvsp[(4) - (9)].f), (int) (yyvsp[(6) - (9)].f)));
1642  }
1643  break;
1644 
1645  case 19:
1646 
1647 /* Line 1455 of yacc.c */
1648 #line 183 "parse_citi.y"
1649  {
1650  (yyval.v) = (yyvsp[(3) - (5)].v);
1651  }
1652  break;
1653 
1654  case 20:
1655 
1656 /* Line 1455 of yacc.c */
1657 #line 188 "parse_citi.y"
1658  { (yyval.v) = NULL; }
1659  break;
1660 
1661  case 21:
1662 
1663 /* Line 1455 of yacc.c */
1664 #line 189 "parse_citi.y"
1665  {
1666  if ((yyvsp[(1) - (2)].v)) {
1667  (yyvsp[(1) - (2)].v)->setNext ((yyvsp[(2) - (2)].v));
1668  (yyval.v) = (yyvsp[(1) - (2)].v);
1669  } else {
1670  (yyval.v) = (yyvsp[(2) - (2)].v);
1671  }
1672  }
1673  break;
1674 
1675  case 22:
1676 
1677 /* Line 1455 of yacc.c */
1678 #line 200 "parse_citi.y"
1679  {
1680  (yyval.v) = (yyvsp[(3) - (5)].v);
1681  }
1682  break;
1683 
1684  case 23:
1685 
1686 /* Line 1455 of yacc.c */
1687 #line 203 "parse_citi.y"
1688  {
1689  (yyval.v) = (yyvsp[(1) - (1)].v);
1690  }
1691  break;
1692 
1693  case 24:
1694 
1695 /* Line 1455 of yacc.c */
1696 #line 208 "parse_citi.y"
1697  { (yyval.v) = new vector (); }
1698  break;
1699 
1700  case 25:
1701 
1702 /* Line 1455 of yacc.c */
1703 #line 209 "parse_citi.y"
1704  {
1705  (yyvsp[(3) - (3)].v)->add ((yyvsp[(1) - (3)].f));
1706  (yyval.v) = (yyvsp[(3) - (3)].v);
1707  }
1708  break;
1709 
1710  case 26:
1711 
1712 /* Line 1455 of yacc.c */
1713 #line 213 "parse_citi.y"
1714  {
1715  (yyvsp[(5) - (5)].v)->add (rect ((yyvsp[(1) - (5)].f), (yyvsp[(3) - (5)].f)));
1716  (yyval.v) = (yyvsp[(5) - (5)].v);
1717  }
1718  break;
1719 
1720  case 27:
1721 
1722 /* Line 1455 of yacc.c */
1723 #line 219 "parse_citi.y"
1724  { (yyval.v) = new vector (); }
1725  break;
1726 
1727  case 28:
1728 
1729 /* Line 1455 of yacc.c */
1730 #line 220 "parse_citi.y"
1731  {
1732  (yyvsp[(3) - (3)].v)->add ((yyvsp[(1) - (3)].f));
1733  (yyval.v) = (yyvsp[(3) - (3)].v);
1734  }
1735  break;
1736 
1737 
1738 
1739 /* Line 1455 of yacc.c */
1740 #line 1741 "parse_citi.cpp"
1741  default: break;
1742  }
1743  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1744 
1745  YYPOPSTACK (yylen);
1746  yylen = 0;
1747  YY_STACK_PRINT (yyss, yyssp);
1748 
1749  *++yyvsp = yyval;
1750 
1751  /* Now `shift' the result of the reduction. Determine what state
1752  that goes to, based on the state we popped back to and the rule
1753  number reduced by. */
1754 
1755  yyn = yyr1[yyn];
1756 
1757  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1758  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1759  yystate = yytable[yystate];
1760  else
1761  yystate = yydefgoto[yyn - YYNTOKENS];
1762 
1763  goto yynewstate;
1764 
1765 
1766 /*------------------------------------.
1767 | yyerrlab -- here on detecting error |
1768 `------------------------------------*/
1769 yyerrlab:
1770  /* If not already recovering from an error, report this error. */
1771  if (!yyerrstatus)
1772  {
1773  ++yynerrs;
1774 #if ! YYERROR_VERBOSE
1775  yyerror (YY_("syntax error"));
1776 #else
1777  {
1778  YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1779  if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1780  {
1781  YYSIZE_T yyalloc = 2 * yysize;
1782  if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1783  yyalloc = YYSTACK_ALLOC_MAXIMUM;
1784  if (yymsg != yymsgbuf)
1785  YYSTACK_FREE (yymsg);
1786  yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1787  if (yymsg)
1788  yymsg_alloc = yyalloc;
1789  else
1790  {
1791  yymsg = yymsgbuf;
1792  yymsg_alloc = sizeof yymsgbuf;
1793  }
1794  }
1795 
1796  if (0 < yysize && yysize <= yymsg_alloc)
1797  {
1798  (void) yysyntax_error (yymsg, yystate, yychar);
1799  yyerror (yymsg);
1800  }
1801  else
1802  {
1803  yyerror (YY_("syntax error"));
1804  if (yysize != 0)
1805  goto yyexhaustedlab;
1806  }
1807  }
1808 #endif
1809  }
1810 
1811 
1812 
1813  if (yyerrstatus == 3)
1814  {
1815  /* If just tried and failed to reuse lookahead token after an
1816  error, discard it. */
1817 
1818  if (yychar <= YYEOF)
1819  {
1820  /* Return failure if at end of input. */
1821  if (yychar == YYEOF)
1822  YYABORT;
1823  }
1824  else
1825  {
1826  yydestruct ("Error: discarding",
1827  yytoken, &yylval);
1828  yychar = YYEMPTY;
1829  }
1830  }
1831 
1832  /* Else will try to reuse lookahead token after shifting the error
1833  token. */
1834  goto yyerrlab1;
1835 
1836 
1837 /*---------------------------------------------------.
1838 | yyerrorlab -- error raised explicitly by YYERROR. |
1839 `---------------------------------------------------*/
1840 yyerrorlab:
1841 
1842  /* Pacify compilers like GCC when the user code never invokes
1843  YYERROR and the label yyerrorlab therefore never appears in user
1844  code. */
1845  if (/*CONSTCOND*/ 0)
1846  goto yyerrorlab;
1847 
1848  /* Do not reclaim the symbols of the rule which action triggered
1849  this YYERROR. */
1850  YYPOPSTACK (yylen);
1851  yylen = 0;
1852  YY_STACK_PRINT (yyss, yyssp);
1853  yystate = *yyssp;
1854  goto yyerrlab1;
1855 
1856 
1857 /*-------------------------------------------------------------.
1858 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1859 `-------------------------------------------------------------*/
1860 yyerrlab1:
1861  yyerrstatus = 3; /* Each real token shifted decrements this. */
1862 
1863  for (;;)
1864  {
1865  yyn = yypact[yystate];
1866  if (yyn != YYPACT_NINF)
1867  {
1868  yyn += YYTERROR;
1869  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1870  {
1871  yyn = yytable[yyn];
1872  if (0 < yyn)
1873  break;
1874  }
1875  }
1876 
1877  /* Pop the current state because it cannot handle the error token. */
1878  if (yyssp == yyss)
1879  YYABORT;
1880 
1881 
1882  yydestruct ("Error: popping",
1883  yystos[yystate], yyvsp);
1884  YYPOPSTACK (1);
1885  yystate = *yyssp;
1886  YY_STACK_PRINT (yyss, yyssp);
1887  }
1888 
1889  *++yyvsp = yylval;
1890 
1891 
1892  /* Shift the error token. */
1893  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1894 
1895  yystate = yyn;
1896  goto yynewstate;
1897 
1898 
1899 /*-------------------------------------.
1900 | yyacceptlab -- YYACCEPT comes here. |
1901 `-------------------------------------*/
1902 yyacceptlab:
1903  yyresult = 0;
1904  goto yyreturn;
1905 
1906 /*-----------------------------------.
1907 | yyabortlab -- YYABORT comes here. |
1908 `-----------------------------------*/
1909 yyabortlab:
1910  yyresult = 1;
1911  goto yyreturn;
1912 
1913 #if !defined(yyoverflow) || YYERROR_VERBOSE
1914 /*-------------------------------------------------.
1915 | yyexhaustedlab -- memory exhaustion comes here. |
1916 `-------------------------------------------------*/
1917 yyexhaustedlab:
1918  yyerror (YY_("memory exhausted"));
1919  yyresult = 2;
1920  /* Fall through. */
1921 #endif
1922 
1923 yyreturn:
1924  if (yychar != YYEMPTY)
1925  yydestruct ("Cleanup: discarding lookahead",
1926  yytoken, &yylval);
1927  /* Do not reclaim the symbols of the rule which action triggered
1928  this YYABORT or YYACCEPT. */
1929  YYPOPSTACK (yylen);
1930  YY_STACK_PRINT (yyss, yyssp);
1931  while (yyssp != yyss)
1932  {
1933  yydestruct ("Cleanup: popping",
1934  yystos[*yyssp], yyvsp);
1935  YYPOPSTACK (1);
1936  }
1937 #ifndef yyoverflow
1938  if (yyss != yyssa)
1939  YYSTACK_FREE (yyss);
1940 #endif
1941 #if YYERROR_VERBOSE
1942  if (yymsg != yymsgbuf)
1943  YYSTACK_FREE (yymsg);
1944 #endif
1945  /* Make sure YYID is used. */
1946  return YYID (yyresult);
1947 }
1948 
1949 
1950 
1951 /* Line 1675 of yacc.c */
1952 #line 226 "parse_citi.y"
1953 
1954 
1955 int citi_error (char * error) {
1956  logprint (LOG_ERROR, "line %d: %s\n", citi_lineno, error);
1957  return 0;
1958 }
1959