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