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