PIPS
genspec_yacc.c
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.8.2. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6  Inc.
7 
8  This program is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <https://www.gnu.org/licenses/>. */
20 
21 /* As a special exception, you may create a larger work that contains
22  part or all of the Bison parser skeleton and distribute that work
23  under terms of your choice, so long as that work isn't itself a
24  parser generator using the skeleton or a modified version thereof
25  as a parser skeleton. Alternatively, if you modify or redistribute
26  the parser skeleton itself, you may (at your option) remove this
27  special exception, which will cause the skeleton and the resulting
28  Bison output files to be licensed under the GNU General Public
29  License without this special exception.
30 
31  This special exception was added by the Free Software Foundation in
32  version 2.2 of Bison. */
33 
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35  simplifying the original so-called "semantic" parser. */
36 
37 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38  especially those whose name start with YY_ or yy_. They are
39  private implementation details that can be changed or removed. */
40 
41 /* All symbols defined below should begin with yy or YY, to avoid
42  infringing on user name space. This should be done even for local
43  variables, as they might otherwise be expanded by user macros.
44  There are some unavoidable exceptions within include files to
45  define necessary library symbols; they are noted "INFRINGES ON
46  USER NAME SPACE" below. */
47 
48 /* Identify Bison output, and Bison version. */
49 #define YYBISON 30802
50 
51 /* Bison version string. */
52 #define YYBISON_VERSION "3.8.2"
53 
54 /* Skeleton name. */
55 #define YYSKELETON_NAME "yacc.c"
56 
57 /* Pure parsers. */
58 #define YYPURE 0
59 
60 /* Push parsers. */
61 #define YYPUSH 0
62 
63 /* Pull parsers. */
64 #define YYPULL 1
65 
66 
67 /* Substitute the variable and function names. */
68 #define yyparse genspec_parse
69 #define yylex genspec_lex
70 #define yyerror genspec_error
71 #define yydebug genspec_debug
72 #define yynerrs genspec_nerrs
73 #define yylval genspec_lval
74 #define yychar genspec_char
75 
76 /* First part of user prologue. */
77 #line 1 "spec.y"
78 
79 /*
80 
81  $Id: spec.y 1361 2016-07-01 11:57:40Z coelho $
82 
83  Copyright 1989-2016 MINES ParisTech
84 
85  This file is part of NewGen.
86 
87  NewGen is free software: you can redistribute it and/or modify it under the
88  terms of the GNU General Public License as published by the Free Software
89  Foundation, either version 3 of the License, or any later version.
90 
91  NewGen is distributed in the hope that it will be useful, but WITHOUT ANY
92  WARRANTY; without even the implied warranty of MERCHANTABILITY or
93  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
94  License for more details.
95 
96  You should have received a copy of the GNU General Public License along with
97  NewGen. If not, see <http://www.gnu.org/licenses/>.
98 
99 */
100 
101 #include <stdio.h>
102 #include <string.h>
103 #include <stdlib.h>
104 
105 #include "genC.h"
106 #include "newgen_include.h"
107 
108 #define YYERROR_VERBOSE 1 /* better error messages by bison */
109 
110 extern int genspec_input(void);
111 extern void genspec_error(const char*);
112 extern int check_not_keyword(char *); /* in build.c */
113 
116 
117 /* UPDATE_OP checks whether the just read OPerator is compatible with
118  the current one. If not, an ERROR_MSG is signaled. */
119 
120 void update_op(int op, char * error_msg)
121 {
122  if( Current_op == UNDEF_OP ) {
123  Current_op = op ;
124  }
125  else if( Current_op == ARROW_OP ) {
126  user( error_msg, (char *)NULL ) ;
127  }
128  else if(Current_op != op ) {
129  user( error_msg, (char *)NULL ) ;
130  }
131 }
132 
133 
134 
135 #line 136 "y.tab.c"
136 
137 # ifndef YY_CAST
138 # ifdef __cplusplus
139 # define YY_CAST(Type, Val) static_cast<Type> (Val)
140 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
141 # else
142 # define YY_CAST(Type, Val) ((Type) (Val))
143 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
144 # endif
145 # endif
146 # ifndef YY_NULLPTR
147 # if defined __cplusplus
148 # if 201103L <= __cplusplus
149 # define YY_NULLPTR nullptr
150 # else
151 # define YY_NULLPTR 0
152 # endif
153 # else
154 # define YY_NULLPTR ((void*)0)
155 # endif
156 # endif
157 
158 /* Use api.header.include to #include this header
159  instead of duplicating it here. */
160 #ifndef YY_GENSPEC_Y_TAB_H_INCLUDED
161 # define YY_GENSPEC_Y_TAB_H_INCLUDED
162 /* Debug traces. */
163 #ifndef YYDEBUG
164 # define YYDEBUG 0
165 #endif
166 #if YYDEBUG
167 extern int genspec_debug;
168 #endif
169 
170 /* Token kinds. */
171 #ifndef YYTOKENTYPE
172 # define YYTOKENTYPE
174  {
175  YYEMPTY = -2,
176  YYEOF = 0, /* "end of file" */
177  YYerror = 256, /* error */
178  YYUNDEF = 257, /* "invalid token" */
179  COMMA = 258, /* COMMA */
180  COLUMN = 259, /* COLUMN */
181  SEMI_COLUMN = 260, /* SEMI_COLUMN */
182  AND = 261, /* AND */
183  OR = 262, /* OR */
184  ARROW = 263, /* ARROW */
185  STAR = 264, /* STAR */
186  LB = 265, /* LB */
187  RB = 266, /* RB */
188  LR = 267, /* LR */
189  RR = 268, /* RR */
190  EQUAL = 269, /* EQUAL */
191  FROM = 270, /* FROM */
192  GRAM_EXTERNAL = 271, /* GRAM_EXTERNAL */
193  GRAM_IMPORT = 272, /* GRAM_IMPORT */
194  TABULATED = 273, /* TABULATED */
195  PERSISTANT = 274, /* PERSISTANT */
196  IDENT = 275, /* IDENT */
197  GRAM_FILE = 276, /* GRAM_FILE */
198  GRAM_INT = 277 /* GRAM_INT */
199  };
200  typedef enum yytokentype yytoken_kind_t;
201 #endif
202 /* Token kinds. */
203 #define YYEMPTY -2
204 #define YYEOF 0
205 #define YYerror 256
206 #define YYUNDEF 257
207 #define COMMA 258
208 #define COLUMN 259
209 #define SEMI_COLUMN 260
210 #define AND 261
211 #define OR 262
212 #define ARROW 263
213 #define STAR 264
214 #define LB 265
215 #define RB 266
216 #define LR 267
217 #define RR 268
218 #define EQUAL 269
219 #define FROM 270
220 #define GRAM_EXTERNAL 271
221 #define GRAM_IMPORT 272
222 #define TABULATED 273
223 #define PERSISTANT 274
224 #define IDENT 275
225 #define GRAM_FILE 276
226 #define GRAM_INT 277
227 
228 /* Value type. */
229 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
230 union YYSTYPE
231 {
232 #line 81 "spec.y"
233 
234  union domain *domain ;
235  struct domainlist *domainlist ;
236  struct namelist *namelist ;
237  struct intlist *intlist ;
238  char *name ;
239  int val ;
240 
241 #line 242 "y.tab.c"
242 
243 };
244 typedef union YYSTYPE YYSTYPE;
245 # define YYSTYPE_IS_TRIVIAL 1
246 # define YYSTYPE_IS_DECLARED 1
247 #endif
248 
249 
250 extern YYSTYPE genspec_lval;
251 
252 
253 int genspec_parse (void);
254 
255 
256 #endif /* !YY_GENSPEC_Y_TAB_H_INCLUDED */
257 /* Symbol kind. */
259 {
261  YYSYMBOL_YYEOF = 0, /* "end of file" */
262  YYSYMBOL_YYerror = 1, /* error */
263  YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
264  YYSYMBOL_COMMA = 3, /* COMMA */
265  YYSYMBOL_COLUMN = 4, /* COLUMN */
266  YYSYMBOL_SEMI_COLUMN = 5, /* SEMI_COLUMN */
267  YYSYMBOL_AND = 6, /* AND */
268  YYSYMBOL_OR = 7, /* OR */
269  YYSYMBOL_ARROW = 8, /* ARROW */
270  YYSYMBOL_STAR = 9, /* STAR */
271  YYSYMBOL_LB = 10, /* LB */
272  YYSYMBOL_RB = 11, /* RB */
273  YYSYMBOL_LR = 12, /* LR */
274  YYSYMBOL_RR = 13, /* RR */
275  YYSYMBOL_EQUAL = 14, /* EQUAL */
276  YYSYMBOL_FROM = 15, /* FROM */
277  YYSYMBOL_GRAM_EXTERNAL = 16, /* GRAM_EXTERNAL */
278  YYSYMBOL_GRAM_IMPORT = 17, /* GRAM_IMPORT */
279  YYSYMBOL_TABULATED = 18, /* TABULATED */
280  YYSYMBOL_PERSISTANT = 19, /* PERSISTANT */
281  YYSYMBOL_IDENT = 20, /* IDENT */
282  YYSYMBOL_GRAM_FILE = 21, /* GRAM_FILE */
283  YYSYMBOL_GRAM_INT = 22, /* GRAM_INT */
284  YYSYMBOL_YYACCEPT = 23, /* $accept */
285  YYSYMBOL_Specification = 24, /* Specification */
286  YYSYMBOL_25_1 = 25, /* $@1 */
287  YYSYMBOL_Externals = 26, /* Externals */
288  YYSYMBOL_Imports = 27, /* Imports */
289  YYSYMBOL_File = 28, /* File */
290  YYSYMBOL_Definitions = 29, /* Definitions */
291  YYSYMBOL_Definition = 30, /* Definition */
292  YYSYMBOL_Tabulated = 31, /* Tabulated */
293  YYSYMBOL_Domain = 32, /* Domain */
294  YYSYMBOL_Simple = 33, /* Simple */
295  YYSYMBOL_Persistant = 34, /* Persistant */
296  YYSYMBOL_Basis = 35, /* Basis */
297  YYSYMBOL_Constructed = 36, /* Constructed */
298  YYSYMBOL_Namelist = 37, /* Namelist */
299  YYSYMBOL_Dimensions = 38, /* Dimensions */
300  YYSYMBOL_Int = 39, /* Int */
301  YYSYMBOL_Name = 40 /* Name */
302 };
303 typedef enum yysymbol_kind_t yysymbol_kind_t;
304 
305 
306 
307 
308 #ifdef short
309 # undef short
310 #endif
311 
312 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
313  <limits.h> and (if available) <stdint.h> are included
314  so that the code can choose integer types of a good width. */
315 
316 #ifndef __PTRDIFF_MAX__
317 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
318 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
319 # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
320 # define YY_STDINT_H
321 # endif
322 #endif
323 
324 /* Narrow types that promote to a signed type and that can represent a
325  signed or unsigned integer of at least N bits. In tables they can
326  save space and decrease cache pressure. Promoting to a signed type
327  helps avoid bugs in integer arithmetic. */
328 
329 #ifdef __INT_LEAST8_MAX__
330 typedef __INT_LEAST8_TYPE__ yytype_int8;
331 #elif defined YY_STDINT_H
332 typedef int_least8_t yytype_int8;
333 #else
334 typedef signed char yytype_int8;
335 #endif
336 
337 #ifdef __INT_LEAST16_MAX__
338 typedef __INT_LEAST16_TYPE__ yytype_int16;
339 #elif defined YY_STDINT_H
341 #else
342 typedef short yytype_int16;
343 #endif
344 
345 /* Work around bug in HP-UX 11.23, which defines these macros
346  incorrectly for preprocessor constants. This workaround can likely
347  be removed in 2023, as HPE has promised support for HP-UX 11.23
348  (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
349  <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
350 #ifdef __hpux
351 # undef UINT_LEAST8_MAX
352 # undef UINT_LEAST16_MAX
353 # define UINT_LEAST8_MAX 255
354 # define UINT_LEAST16_MAX 65535
355 #endif
356 
357 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
358 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
359 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
360  && UINT_LEAST8_MAX <= INT_MAX)
362 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
363 typedef unsigned char yytype_uint8;
364 #else
365 typedef short yytype_uint8;
366 #endif
367 
368 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
369 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
370 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
371  && UINT_LEAST16_MAX <= INT_MAX)
373 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
374 typedef unsigned short yytype_uint16;
375 #else
376 typedef int yytype_uint16;
377 #endif
378 
379 #ifndef YYPTRDIFF_T
380 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
381 # define YYPTRDIFF_T __PTRDIFF_TYPE__
382 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
383 # elif defined PTRDIFF_MAX
384 # ifndef ptrdiff_t
385 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
386 # endif
387 # define YYPTRDIFF_T ptrdiff_t
388 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
389 # else
390 # define YYPTRDIFF_T long
391 # define YYPTRDIFF_MAXIMUM LONG_MAX
392 # endif
393 #endif
394 
395 #ifndef YYSIZE_T
396 # ifdef __SIZE_TYPE__
397 # define YYSIZE_T __SIZE_TYPE__
398 # elif defined size_t
399 # define YYSIZE_T size_t
400 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
401 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
402 # define YYSIZE_T size_t
403 # else
404 # define YYSIZE_T unsigned
405 # endif
406 #endif
407 
408 #define YYSIZE_MAXIMUM \
409  YY_CAST (YYPTRDIFF_T, \
410  (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
411  ? YYPTRDIFF_MAXIMUM \
412  : YY_CAST (YYSIZE_T, -1)))
413 
414 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
415 
416 
417 /* Stored state numbers (used for stacks). */
419 
420 /* State numbers in computations. */
421 typedef int yy_state_fast_t;
422 
423 #ifndef YY_
424 # if defined YYENABLE_NLS && YYENABLE_NLS
425 # if ENABLE_NLS
426 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
427 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
428 # endif
429 # endif
430 # ifndef YY_
431 # define YY_(Msgid) Msgid
432 # endif
433 #endif
434 
435 
436 #ifndef YY_ATTRIBUTE_PURE
437 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
438 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
439 # else
440 # define YY_ATTRIBUTE_PURE
441 # endif
442 #endif
443 
444 #ifndef YY_ATTRIBUTE_UNUSED
445 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
446 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
447 # else
448 # define YY_ATTRIBUTE_UNUSED
449 # endif
450 #endif
451 
452 /* Suppress unused-variable warnings by "using" E. */
453 #if ! defined lint || defined __GNUC__
454 # define YY_USE(E) ((void) (E))
455 #else
456 # define YY_USE(E) /* empty */
457 #endif
458 
459 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
460 #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
461 # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
462 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
463  _Pragma ("GCC diagnostic push") \
464  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
465 # else
466 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
467  _Pragma ("GCC diagnostic push") \
468  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
469  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
470 # endif
471 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
472  _Pragma ("GCC diagnostic pop")
473 #else
474 # define YY_INITIAL_VALUE(Value) Value
475 #endif
476 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
477 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
478 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
479 #endif
480 #ifndef YY_INITIAL_VALUE
481 # define YY_INITIAL_VALUE(Value) /* Nothing. */
482 #endif
483 
484 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
485 # define YY_IGNORE_USELESS_CAST_BEGIN \
486  _Pragma ("GCC diagnostic push") \
487  _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
488 # define YY_IGNORE_USELESS_CAST_END \
489  _Pragma ("GCC diagnostic pop")
490 #endif
491 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
492 # define YY_IGNORE_USELESS_CAST_BEGIN
493 # define YY_IGNORE_USELESS_CAST_END
494 #endif
495 
496 
497 #define YY_ASSERT(E) ((void) (0 && (E)))
498 
499 #if !defined yyoverflow
500 
501 /* The parser invokes alloca or malloc; define the necessary symbols. */
502 
503 # ifdef YYSTACK_USE_ALLOCA
504 # if YYSTACK_USE_ALLOCA
505 # ifdef __GNUC__
506 # define YYSTACK_ALLOC __builtin_alloca
507 # elif defined __BUILTIN_VA_ARG_INCR
508 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
509 # elif defined _AIX
510 # define YYSTACK_ALLOC __alloca
511 # elif defined _MSC_VER
512 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
513 # define alloca _alloca
514 # else
515 # define YYSTACK_ALLOC alloca
516 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
517 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
518  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
519 # ifndef EXIT_SUCCESS
520 # define EXIT_SUCCESS 0
521 # endif
522 # endif
523 # endif
524 # endif
525 # endif
526 
527 # ifdef YYSTACK_ALLOC
528  /* Pacify GCC's 'empty if-body' warning. */
529 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
530 # ifndef YYSTACK_ALLOC_MAXIMUM
531  /* The OS might guarantee only one guard page at the bottom of the stack,
532  and a page size can be as small as 4096 bytes. So we cannot safely
533  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
534  to allow for a few compiler-allocated temporary stack slots. */
535 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
536 # endif
537 # else
538 # define YYSTACK_ALLOC YYMALLOC
539 # define YYSTACK_FREE YYFREE
540 # ifndef YYSTACK_ALLOC_MAXIMUM
541 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
542 # endif
543 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
544  && ! ((defined YYMALLOC || defined malloc) \
545  && (defined YYFREE || defined free)))
546 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
547 # ifndef EXIT_SUCCESS
548 # define EXIT_SUCCESS 0
549 # endif
550 # endif
551 # ifndef YYMALLOC
552 # define YYMALLOC malloc
553 # if ! defined malloc && ! defined EXIT_SUCCESS
554 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
555 # endif
556 # endif
557 # ifndef YYFREE
558 # define YYFREE free
559 # if ! defined free && ! defined EXIT_SUCCESS
560 void free (void *); /* INFRINGES ON USER NAME SPACE */
561 # endif
562 # endif
563 # endif
564 #endif /* !defined yyoverflow */
565 
566 #if (! defined yyoverflow \
567  && (! defined __cplusplus \
568  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
569 
570 /* A type that is properly aligned for any stack member. */
571 union yyalloc
572 {
575 };
576 
577 /* The size of the maximum gap between one aligned stack and the next. */
578 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
579 
580 /* The size of an array large to enough to hold all stacks, each with
581  N elements. */
582 # define YYSTACK_BYTES(N) \
583  ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
584  + YYSTACK_GAP_MAXIMUM)
585 
586 # define YYCOPY_NEEDED 1
587 
588 /* Relocate STACK from its old location to the new one. The
589  local variables YYSIZE and YYSTACKSIZE give the old and new number of
590  elements in the stack, and YYPTR gives the new location of the
591  stack. Advance YYPTR to a properly aligned location for the next
592  stack. */
593 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
594  do \
595  { \
596  YYPTRDIFF_T yynewbytes; \
597  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
598  Stack = &yyptr->Stack_alloc; \
599  yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
600  yyptr += yynewbytes / YYSIZEOF (*yyptr); \
601  } \
602  while (0)
603 
604 #endif
605 
606 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
607 /* Copy COUNT objects from SRC to DST. The source and destination do
608  not overlap. */
609 # ifndef YYCOPY
610 # if defined __GNUC__ && 1 < __GNUC__
611 # define YYCOPY(Dst, Src, Count) \
612  __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
613 # else
614 # define YYCOPY(Dst, Src, Count) \
615  do \
616  { \
617  YYPTRDIFF_T yyi; \
618  for (yyi = 0; yyi < (Count); yyi++) \
619  (Dst)[yyi] = (Src)[yyi]; \
620  } \
621  while (0)
622 # endif
623 # endif
624 #endif /* !YYCOPY_NEEDED */
625 
626 /* YYFINAL -- State number of the termination state. */
627 #define YYFINAL 3
628 /* YYLAST -- Last index in YYTABLE. */
629 #define YYLAST 40
630 
631 /* YYNTOKENS -- Number of terminals. */
632 #define YYNTOKENS 23
633 /* YYNNTS -- Number of nonterminals. */
634 #define YYNNTS 18
635 /* YYNRULES -- Number of rules. */
636 #define YYNRULES 33
637 /* YYNSTATES -- Number of states. */
638 #define YYNSTATES 55
639 
640 /* YYMAXUTOK -- Last valid token kind. */
641 #define YYMAXUTOK 277
642 
643 
644 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
645  as returned by yylex, with out-of-bounds checking. */
646 #define YYTRANSLATE(YYX) \
647  (0 <= (YYX) && (YYX) <= YYMAXUTOK \
648  ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
649  : YYSYMBOL_YYUNDEF)
650 
651 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
652  as returned by yylex. */
653 static const yytype_int8 yytranslate[] =
654 {
655  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
656  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
657  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
658  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
659  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
660  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
661  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
662  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
663  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
664  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
665  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
666  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
667  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
668  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
669  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
670  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
671  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
672  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
673  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
674  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
675  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
676  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
677  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
678  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
679  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
680  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
681  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
682  15, 16, 17, 18, 19, 20, 21, 22
683 };
684 
685 #if YYDEBUG
686 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
687 static const yytype_int16 yyrline[] =
688 {
689  0, 99, 99, 99, 106, 118, 121, 131, 134, 140,
690  141, 145, 152, 153, 156, 182, 214, 217, 223, 230,
691  245, 248, 251, 259, 270, 277, 284, 290, 296, 302,
692  311, 317, 325, 328
693 };
694 #endif
695 
696 /** Accessing symbol of state STATE. */
697 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
698 
699 #if YYDEBUG || 0
700 /* The user-facing name of the symbol whose (internal) number is
701  YYSYMBOL. No bounds checking. */
702 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
703 
704 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
705  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
706 static const char *const yytname[] =
707 {
708  "\"end of file\"", "error", "\"invalid token\"", "COMMA", "COLUMN",
709  "SEMI_COLUMN", "AND", "OR", "ARROW", "STAR", "LB", "RB", "LR", "RR",
710  "EQUAL", "FROM", "GRAM_EXTERNAL", "GRAM_IMPORT", "TABULATED",
711  "PERSISTANT", "IDENT", "GRAM_FILE", "GRAM_INT", "$accept",
712  "Specification", "$@1", "Externals", "Imports", "File", "Definitions",
713  "Definition", "Tabulated", "Domain", "Simple", "Persistant", "Basis",
714  "Constructed", "Namelist", "Dimensions", "Int", "Name", YY_NULLPTR
715 };
716 
717 static const char *
719 {
720  return yytname[yysymbol];
721 }
722 #endif
723 
724 #define YYPACT_NINF (-33)
725 
726 #define yypact_value_is_default(Yyn) \
727  ((Yyn) == YYPACT_NINF)
728 
729 #define YYTABLE_NINF (-14)
730 
731 #define yytable_value_is_error(Yyn) \
732  0
733 
734 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
735  STATE-NUM. */
736 static const yytype_int8 yypact[] =
737 {
738  -33, 9, -33, -33, 1, 0, 6, -33, 8, 0,
739  -1, 3, 20, -33, -33, 0, -33, 21, -33, 13,
740  -33, -11, 0, -33, 23, 5, 0, 16, 27, -33,
741  12, 12, 12, -33, -7, 28, -33, 0, 5, 5,
742  -33, -33, 11, 22, -33, 0, -33, -33, -33, -33,
743  25, -33, -33, 24, -33
744 };
745 
746 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
747  Performed when YYTABLE does not specify something else to do. Zero
748  means the default is an error. */
749 static const yytype_int8 yydefact[] =
750 {
751  2, 0, 7, 1, 5, 0, 10, 33, 0, 0,
752  3, 0, 0, 12, 9, 0, 8, 0, 4, 0,
753  6, 21, 0, 20, 0, 27, 0, 0, 29, 11,
754  21, 21, 21, 14, 16, 22, 15, 0, 27, 27,
755  26, 17, 0, 0, 18, 0, 28, 24, 25, 32,
756  0, 19, 23, 31, 30
757 };
758 
759 /* YYPGOTO[NTERM-NUM]. */
760 static const yytype_int8 yypgoto[] =
761 {
762  -33, -33, -33, -33, -33, -33, -33, -33, -33, -33,
763  -16, -33, -33, -32, 2, -15, -33, -5
764 };
765 
766 /* YYDEFGOTO[NTERM-NUM]. */
767 static const yytype_int8 yydefgoto[] =
768 {
769  0, 1, 2, 6, 4, 17, 10, 14, 15, 24,
770  25, 26, 34, 33, 27, 44, 50, 28
771 };
772 
773 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
774  positive, shift that token. If negative, reduce the rule whose
775  number is the opposite. If YYTABLE_NINF, syntax error. */
776 static const yytype_int8 yytable[] =
777 {
778  8, 22, 41, 42, 12, 43, 47, 48, 23, 3,
779  19, 30, 31, 32, 38, 39, 40, 13, 5, -13,
780  7, 35, 9, 11, 16, 18, 20, 21, 29, 36,
781  37, 23, 45, 49, 42, 51, 53, 0, 54, 46,
782  52
783 };
784 
785 static const yytype_int8 yycheck[] =
786 {
787  5, 12, 9, 10, 9, 12, 38, 39, 19, 0,
788  15, 6, 7, 8, 30, 31, 32, 18, 17, 20,
789  20, 26, 16, 15, 21, 5, 5, 14, 5, 13,
790  3, 19, 4, 22, 10, 13, 11, -1, 53, 37,
791  45
792 };
793 
794 /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
795  state STATE-NUM. */
796 static const yytype_int8 yystos[] =
797 {
798  0, 24, 25, 0, 27, 17, 26, 20, 40, 16,
799  29, 15, 40, 18, 30, 31, 21, 28, 5, 40,
800  5, 14, 12, 19, 32, 33, 34, 37, 40, 5,
801  6, 7, 8, 36, 35, 40, 13, 3, 33, 33,
802  33, 9, 10, 12, 38, 4, 37, 36, 36, 22,
803  39, 13, 40, 11, 38
804 };
805 
806 /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
807 static const yytype_int8 yyr1[] =
808 {
809  0, 23, 25, 24, 26, 26, 27, 27, 28, 29,
810  29, 30, 31, 31, 32, 32, 33, 33, 33, 33,
811  34, 34, 35, 35, 36, 36, 36, 36, 37, 37,
812  38, 38, 39, 40
813 };
814 
815 /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
816 static const yytype_int8 yyr2[] =
817 {
818  0, 2, 0, 4, 4, 0, 6, 0, 1, 2,
819  0, 5, 1, 0, 2, 3, 2, 3, 3, 4,
820  1, 0, 1, 3, 3, 3, 2, 0, 3, 1,
821  4, 3, 1, 1
822 };
823 
824 
825 enum { YYENOMEM = -2 };
826 
827 #define yyerrok (yyerrstatus = 0)
828 #define yyclearin (yychar = YYEMPTY)
829 
830 #define YYACCEPT goto yyacceptlab
831 #define YYABORT goto yyabortlab
832 #define YYERROR goto yyerrorlab
833 #define YYNOMEM goto yyexhaustedlab
834 
835 
836 #define YYRECOVERING() (!!yyerrstatus)
837 
838 #define YYBACKUP(Token, Value) \
839  do \
840  if (yychar == YYEMPTY) \
841  { \
842  yychar = (Token); \
843  yylval = (Value); \
844  YYPOPSTACK (yylen); \
845  yystate = *yyssp; \
846  goto yybackup; \
847  } \
848  else \
849  { \
850  yyerror (YY_("syntax error: cannot back up")); \
851  YYERROR; \
852  } \
853  while (0)
854 
855 /* Backward compatibility with an undocumented macro.
856  Use YYerror or YYUNDEF. */
857 #define YYERRCODE YYUNDEF
858 
859 
860 /* Enable debugging if requested. */
861 #if YYDEBUG
862 
863 # ifndef YYFPRINTF
864 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
865 # define YYFPRINTF fprintf
866 # endif
867 
868 # define YYDPRINTF(Args) \
869 do { \
870  if (yydebug) \
871  YYFPRINTF Args; \
872 } while (0)
873 
874 
875 
876 
877 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
878 do { \
879  if (yydebug) \
880  { \
881  YYFPRINTF (stderr, "%s ", Title); \
882  yy_symbol_print (stderr, \
883  Kind, Value); \
884  YYFPRINTF (stderr, "\n"); \
885  } \
886 } while (0)
887 
888 
889 /*-----------------------------------.
890 | Print this symbol's value on YYO. |
891 `-----------------------------------*/
892 
893 static void
894 yy_symbol_value_print (FILE *yyo,
895  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
896 {
897  FILE *yyoutput = yyo;
898  YY_USE (yyoutput);
899  if (!yyvaluep)
900  return;
902  YY_USE (yykind);
904 }
905 
906 
907 /*---------------------------.
908 | Print this symbol on YYO. |
909 `---------------------------*/
910 
911 static void
912 yy_symbol_print (FILE *yyo,
913  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
914 {
915  YYFPRINTF (yyo, "%s %s (",
916  yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
917 
918  yy_symbol_value_print (yyo, yykind, yyvaluep);
919  YYFPRINTF (yyo, ")");
920 }
921 
922 /*------------------------------------------------------------------.
923 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
924 | TOP (included). |
925 `------------------------------------------------------------------*/
926 
927 static void
928 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
929 {
930  YYFPRINTF (stderr, "Stack now");
931  for (; yybottom <= yytop; yybottom++)
932  {
933  int yybot = *yybottom;
934  YYFPRINTF (stderr, " %d", yybot);
935  }
936  YYFPRINTF (stderr, "\n");
937 }
938 
939 # define YY_STACK_PRINT(Bottom, Top) \
940 do { \
941  if (yydebug) \
942  yy_stack_print ((Bottom), (Top)); \
943 } while (0)
944 
945 
946 /*------------------------------------------------.
947 | Report that the YYRULE is going to be reduced. |
948 `------------------------------------------------*/
949 
950 static void
951 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
952  int yyrule)
953 {
954  int yylno = yyrline[yyrule];
955  int yynrhs = yyr2[yyrule];
956  int yyi;
957  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
958  yyrule - 1, yylno);
959  /* The symbols being reduced. */
960  for (yyi = 0; yyi < yynrhs; yyi++)
961  {
962  YYFPRINTF (stderr, " $%d = ", yyi + 1);
963  yy_symbol_print (stderr,
964  YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
965  &yyvsp[(yyi + 1) - (yynrhs)]);
966  YYFPRINTF (stderr, "\n");
967  }
968 }
969 
970 # define YY_REDUCE_PRINT(Rule) \
971 do { \
972  if (yydebug) \
973  yy_reduce_print (yyssp, yyvsp, Rule); \
974 } while (0)
975 
976 /* Nonzero means print parse trace. It is left uninitialized so that
977  multiple parsers can coexist. */
978 int yydebug;
979 #else /* !YYDEBUG */
980 # define YYDPRINTF(Args) ((void) 0)
981 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
982 # define YY_STACK_PRINT(Bottom, Top)
983 # define YY_REDUCE_PRINT(Rule)
984 #endif /* !YYDEBUG */
985 
986 
987 /* YYINITDEPTH -- initial size of the parser's stacks. */
988 #ifndef YYINITDEPTH
989 # define YYINITDEPTH 200
990 #endif
991 
992 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
993  if the built-in stack extension method is used).
994 
995  Do not make this value too large; the results are undefined if
996  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
997  evaluated with infinite-precision integer arithmetic. */
998 
999 #ifndef YYMAXDEPTH
1000 # define YYMAXDEPTH 10000
1001 #endif
1002 
1003 
1004 
1005 
1006 
1007 
1008 /*-----------------------------------------------.
1009 | Release the memory associated to this symbol. |
1010 `-----------------------------------------------*/
1011 
1012 static void
1013 yydestruct (const char *yymsg,
1014  yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
1015 {
1016  YY_USE (yyvaluep);
1017  if (!yymsg)
1018  yymsg = "Deleting";
1019  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1020 
1022  YY_USE (yykind);
1024 }
1025 
1026 
1027 /* Lookahead token kind. */
1029 
1030 /* The semantic value of the lookahead symbol. */
1032 /* Number of syntax errors so far. */
1034 
1035 
1036 
1037 
1038 /*----------.
1039 | yyparse. |
1040 `----------*/
1041 
1042 int
1043 yyparse (void)
1044 {
1045  yy_state_fast_t yystate = 0;
1046  /* Number of tokens to shift before error messages enabled. */
1047  int yyerrstatus = 0;
1048 
1049  /* Refer to the stacks through separate pointers, to allow yyoverflow
1050  to reallocate them elsewhere. */
1051 
1052  /* Their size. */
1053  YYPTRDIFF_T yystacksize = YYINITDEPTH;
1054 
1055  /* The state stack: array, bottom, top. */
1056  yy_state_t yyssa[YYINITDEPTH];
1057  yy_state_t *yyss = yyssa;
1058  yy_state_t *yyssp = yyss;
1059 
1060  /* The semantic value stack: array, bottom, top. */
1061  YYSTYPE yyvsa[YYINITDEPTH];
1062  YYSTYPE *yyvs = yyvsa;
1063  YYSTYPE *yyvsp = yyvs;
1064 
1065  int yyn;
1066  /* The return value of yyparse. */
1067  int yyresult;
1068  /* Lookahead symbol kind. */
1070  /* The variables used to return semantic value and location from the
1071  action routines. */
1072  YYSTYPE yyval;
1073 
1074 
1075 
1076 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1077 
1078  /* The number of symbols on the RHS of the reduced rule.
1079  Keep to zero when no symbol should be popped. */
1080  int yylen = 0;
1081 
1082  YYDPRINTF ((stderr, "Starting parse\n"));
1083 
1084  yychar = YYEMPTY; /* Cause a token to be read. */
1085 
1086  goto yysetstate;
1087 
1088 
1089 /*------------------------------------------------------------.
1090 | yynewstate -- push a new state, which is found in yystate. |
1091 `------------------------------------------------------------*/
1092 yynewstate:
1093  /* In all cases, when you get here, the value and location stacks
1094  have just been pushed. So pushing a state here evens the stacks. */
1095  yyssp++;
1096 
1097 
1098 /*--------------------------------------------------------------------.
1099 | yysetstate -- set current state (the top of the stack) to yystate. |
1100 `--------------------------------------------------------------------*/
1101 yysetstate:
1102  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1103  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1105  *yyssp = YY_CAST (yy_state_t, yystate);
1107  YY_STACK_PRINT (yyss, yyssp);
1108 
1109  if (yyss + yystacksize - 1 <= yyssp)
1110 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1111  YYNOMEM;
1112 #else
1113  {
1114  /* Get the current used size of the three stacks, in elements. */
1115  YYPTRDIFF_T yysize = yyssp - yyss + 1;
1116 
1117 # if defined yyoverflow
1118  {
1119  /* Give user a chance to reallocate the stack. Use copies of
1120  these so that the &'s don't force the real ones into
1121  memory. */
1122  yy_state_t *yyss1 = yyss;
1123  YYSTYPE *yyvs1 = yyvs;
1124 
1125  /* Each stack pointer address is followed by the size of the
1126  data in use in that stack, in bytes. This used to be a
1127  conditional around just the two extra args, but that might
1128  be undefined if yyoverflow is a macro. */
1129  yyoverflow (YY_("memory exhausted"),
1130  &yyss1, yysize * YYSIZEOF (*yyssp),
1131  &yyvs1, yysize * YYSIZEOF (*yyvsp),
1132  &yystacksize);
1133  yyss = yyss1;
1134  yyvs = yyvs1;
1135  }
1136 # else /* defined YYSTACK_RELOCATE */
1137  /* Extend the stack our own way. */
1138  if (YYMAXDEPTH <= yystacksize)
1139  YYNOMEM;
1140  yystacksize *= 2;
1141  if (YYMAXDEPTH < yystacksize)
1142  yystacksize = YYMAXDEPTH;
1143 
1144  {
1145  yy_state_t *yyss1 = yyss;
1146  union yyalloc *yyptr =
1147  YY_CAST (union yyalloc *,
1148  YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1149  if (! yyptr)
1150  YYNOMEM;
1151  YYSTACK_RELOCATE (yyss_alloc, yyss);
1152  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1153 # undef YYSTACK_RELOCATE
1154  if (yyss1 != yyssa)
1155  YYSTACK_FREE (yyss1);
1156  }
1157 # endif
1158 
1159  yyssp = yyss + yysize - 1;
1160  yyvsp = yyvs + yysize - 1;
1161 
1163  YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1164  YY_CAST (long, yystacksize)));
1166 
1167  if (yyss + yystacksize - 1 <= yyssp)
1168  YYABORT;
1169  }
1170 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1171 
1172 
1173  if (yystate == YYFINAL)
1174  YYACCEPT;
1175 
1176  goto yybackup;
1177 
1178 
1179 /*-----------.
1180 | yybackup. |
1181 `-----------*/
1182 yybackup:
1183  /* Do appropriate processing given the current state. Read a
1184  lookahead token if we need one and don't already have one. */
1185 
1186  /* First try to decide what to do without reference to lookahead token. */
1187  yyn = yypact[yystate];
1188  if (yypact_value_is_default (yyn))
1189  goto yydefault;
1190 
1191  /* Not known => get a lookahead token if don't already have one. */
1192 
1193  /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1194  if (yychar == YYEMPTY)
1195  {
1196  YYDPRINTF ((stderr, "Reading a token\n"));
1197  yychar = yylex ();
1198  }
1199 
1200  if (yychar <= YYEOF)
1201  {
1202  yychar = YYEOF;
1203  yytoken = YYSYMBOL_YYEOF;
1204  YYDPRINTF ((stderr, "Now at end of input.\n"));
1205  }
1206  else if (yychar == YYerror)
1207  {
1208  /* The scanner already issued an error message, process directly
1209  to error recovery. But do not keep the error token as
1210  lookahead, it is too special and may lead us to an endless
1211  loop in error recovery. */
1212  yychar = YYUNDEF;
1213  yytoken = YYSYMBOL_YYerror;
1214  goto yyerrlab1;
1215  }
1216  else
1217  {
1218  yytoken = YYTRANSLATE (yychar);
1219  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1220  }
1221 
1222  /* If the proper action on seeing token YYTOKEN is to reduce or to
1223  detect an error, take that action. */
1224  yyn += yytoken;
1225  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1226  goto yydefault;
1227  yyn = yytable[yyn];
1228  if (yyn <= 0)
1229  {
1230  if (yytable_value_is_error (yyn))
1231  goto yyerrlab;
1232  yyn = -yyn;
1233  goto yyreduce;
1234  }
1235 
1236  /* Count tokens shifted since error; after three, turn off error
1237  status. */
1238  if (yyerrstatus)
1239  yyerrstatus--;
1240 
1241  /* Shift the lookahead token. */
1242  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1243  yystate = yyn;
1245  *++yyvsp = yylval;
1247 
1248  /* Discard the shifted token. */
1249  yychar = YYEMPTY;
1250  goto yynewstate;
1251 
1252 
1253 /*-----------------------------------------------------------.
1254 | yydefault -- do the default action for the current state. |
1255 `-----------------------------------------------------------*/
1256 yydefault:
1257  yyn = yydefact[yystate];
1258  if (yyn == 0)
1259  goto yyerrlab;
1260  goto yyreduce;
1261 
1262 
1263 /*-----------------------------.
1264 | yyreduce -- do a reduction. |
1265 `-----------------------------*/
1266 yyreduce:
1267  /* yyn is the number of a rule to reduce with. */
1268  yylen = yyr2[yyn];
1269 
1270  /* If YYLEN is nonzero, implement the default value of the action:
1271  '$$ = $1'.
1272 
1273  Otherwise, the following line sets YYVAL to garbage.
1274  This behavior is undocumented and Bison
1275  users should not rely upon it. Assigning to YYVAL
1276  unconditionally makes the parser a bit smaller, and it avoids a
1277  GCC warning that YYVAL may be used uninitialized. */
1278  yyval = yyvsp[1-yylen];
1279 
1280 
1281  YY_REDUCE_PRINT (yyn);
1282  switch (yyn)
1283  {
1284  case 2: /* $@1: %empty */
1285 #line 99 "spec.y"
1286  {Number_imports = 0;}
1287 #line 1288 "y.tab.c"
1288  break;
1289 
1290  case 3: /* Specification: $@1 Imports Externals Definitions */
1291 #line 99 "spec.y"
1292  {
1293  YYACCEPT ;
1294  /*NOTREACHED*/
1295  }
1296 #line 1297 "y.tab.c"
1297  break;
1298 
1299  case 4: /* Externals: Externals GRAM_EXTERNAL Name SEMI_COLUMN */
1300 #line 106 "spec.y"
1301  {
1302  union domain *dp ;
1303 
1304  /*NOSTRICT*/
1305  dp = (union domain *)alloc( sizeof( union domain )) ;
1306  dp->ex.type = EXTERNAL_DT ;
1307  dp->ex.read = (void *(*)(FILE*, int(*)(void))) NULL;
1308  dp->ex.write = (void (*)(FILE*, void*)) NULL;
1309  dp->ex.copy = (void*(*)(void*)) NULL;
1310  dp->ex.free = (void (*)(void*)) NULL;
1311  new_binding( (yyvsp[-1].name), dp ) ;
1312  }
1313 #line 1314 "y.tab.c"
1314  break;
1315 
1316  case 6: /* Imports: Imports GRAM_IMPORT Name FROM File SEMI_COLUMN */
1317 #line 121 "spec.y"
1318  {
1319  union domain *dp ;
1320 
1321  /*NOSTRICT*/
1322  dp = (union domain *)alloc( sizeof( union domain )) ;
1323  dp->ba.type = IMPORT_DT ;
1324  dp->im.filename = (yyvsp[-1].name) ;
1325  new_binding( (yyvsp[-3].name), dp ) ;
1326  Number_imports++ ;
1327  }
1328 #line 1329 "y.tab.c"
1329  break;
1330 
1331  case 8: /* File: GRAM_FILE */
1332 #line 134 "spec.y"
1333  {
1334  (yyval.name) = (yyvsp[0].name) ;
1335  }
1336 #line 1337 "y.tab.c"
1337  break;
1338 
1339  case 11: /* Definition: Tabulated Name EQUAL Domain SEMI_COLUMN */
1340 #line 145 "spec.y"
1341  {
1342  struct gen_binding * bp = new_binding((yyvsp[-3].name), (yyvsp[-1].domain));
1343  if ((yyvsp[-4].val)) bp->tabulated = gen_init_tabulated(bp-Domains);
1344  }
1345 #line 1346 "y.tab.c"
1346  break;
1347 
1348  case 12: /* Tabulated: TABULATED */
1349 #line 152 "spec.y"
1350  { (yyval.val) = 1; }
1351 #line 1352 "y.tab.c"
1352  break;
1353 
1354  case 13: /* Tabulated: %empty */
1355 #line 153 "spec.y"
1356  { (yyval.val) = 0 ; }
1357 #line 1358 "y.tab.c"
1358  break;
1359 
1360  case 14: /* Domain: Simple Constructed */
1361 #line 156 "spec.y"
1362  {
1363  /* A BASIS type with just one field is considered as an
1364  AND_OP. */
1365 
1366  if( (yyvsp[0].domainlist) == NULL && (yyvsp[-1].domain)->ba.type != BASIS_DT )
1367  (yyval.domain) = (yyvsp[-1].domain) ;
1368  else {
1369  struct domainlist *dlp ;
1370 
1371  /*NOSTRICT*/
1372  dlp = (struct domainlist *)
1373  alloc( sizeof( struct domainlist ));
1374  dlp->domain = (yyvsp[-1].domain) ;
1375  dlp->cdr = (yyvsp[0].domainlist) ;
1376  /*NOSTRICT*/
1377  (yyval.domain) = (union domain *)alloc( sizeof( union domain )) ;
1378  (yyval.domain)->co.type = CONSTRUCTED_DT ;
1379  (yyval.domain)->co.components = dlp ;
1380  (yyval.domain)->co.op = ((yyvsp[0].domainlist) == NULL) ? AND_OP : Current_op ;
1381 
1382  if( (yyval.domain)->co.op == OR_OP && Read_spec_mode )
1383  (yyval.domain)->co.first = 0 ;
1384 
1385  Current_op = UNDEF_OP ;
1386  }
1387  }
1388 #line 1389 "y.tab.c"
1389  break;
1390 
1391  case 15: /* Domain: LR Namelist RR */
1392 #line 182 "spec.y"
1393  {
1394  /* This is sugar for an OR node with domains of type unit.*/
1395 
1396  /*NOSTRICT*/
1397  struct domainlist *dlp =
1398  (struct domainlist *)alloc( sizeof( struct domainlist )) ;
1399 
1400  /*NOSTRICT*/
1401  (yyval.domain) = (union domain *)
1402  alloc( sizeof( union domain )) ;
1403  (yyval.domain)->co.type = CONSTRUCTED_DT ;
1404  (yyval.domain)->co.op = OR_OP ;
1405  (yyval.domain)->co.components = dlp ;
1406 
1407  if( Read_spec_mode ) (yyval.domain)->co.first = 0 ;
1408 
1409  for( ; (yyvsp[-1].namelist) != NULL ; (yyvsp[-1].namelist) = (yyvsp[-1].namelist)->cdr, dlp = dlp->cdr ) {
1410  /*NOSTRICT*/
1411  dlp->domain =
1412  (union domain *)alloc( sizeof( union domain )) ;
1413  dlp->cdr =
1414  ((yyvsp[-1].namelist)->cdr == NULL) ?
1415  NULL :
1416  (struct domainlist *)alloc( sizeof( struct domainlist ));
1417  dlp->domain->ba.type = BASIS_DT ;
1418  dlp->domain->ba.constructor = (yyvsp[-1].namelist)->name ;
1419  /*NOSTRICT*/
1420  dlp->domain->ba.constructand = (struct gen_binding *)UNIT_TYPE_NAME ;
1421  }
1422  }
1423 #line 1424 "y.tab.c"
1424  break;
1425 
1426  case 16: /* Simple: Persistant Basis */
1427 #line 214 "spec.y"
1428  {
1429  ((yyval.domain) = (yyvsp[0].domain))->ba.persistant = (yyvsp[-1].val) ;
1430  }
1431 #line 1432 "y.tab.c"
1432  break;
1433 
1434  case 17: /* Simple: Persistant Basis STAR */
1435 #line 217 "spec.y"
1436  {
1437  ((yyval.domain) = (yyvsp[-1].domain))->li.type = LIST_DT ;
1438  (yyval.domain)->li.persistant = (yyvsp[-2].val) ;
1439  (yyval.domain)->li.constructor = (yyvsp[-1].domain)->ba.constructor ;
1440  (yyval.domain)->li.element = (yyvsp[-1].domain)->ba.constructand ;
1441  }
1442 #line 1443 "y.tab.c"
1443  break;
1444 
1445  case 18: /* Simple: Persistant Basis Dimensions */
1446 #line 223 "spec.y"
1447  {
1448  ((yyval.domain) = (yyvsp[-1].domain))->ar.type = ARRAY_DT ;
1449  (yyval.domain)->ar.persistant = (yyvsp[-2].val) ;
1450  (yyval.domain)->ar.constructor = (yyvsp[-1].domain)->ba.constructor ;
1451  (yyval.domain)->ar.element = (yyvsp[-1].domain)->ba.constructand ;
1452  (yyval.domain)->ar.dimensions = (yyvsp[0].intlist) ;
1453  }
1454 #line 1455 "y.tab.c"
1455  break;
1456 
1457  case 19: /* Simple: Persistant Basis LR RR */
1458 #line 230 "spec.y"
1459  {
1460  char *below = (char *)(yyvsp[-2].domain)->ba.constructand ;
1461 
1462  ((yyval.domain) = (yyvsp[-2].domain))->se.type = SET_DT ;
1463  (yyval.domain)->se.persistant = (yyvsp[-3].val) ;
1464  (yyval.domain)->se.constructor = (yyvsp[-2].domain)->ba.constructor ;
1465  (yyval.domain)->se.element = (yyvsp[-2].domain)->ba.constructand ;
1466  (yyval.domain)->se.what =
1467  (strcmp( below, "string" ) == 0) ? set_string :
1468  (strcmp( below, "int" ) == 0) ? set_int :
1469  set_pointer ;
1470  }
1471 #line 1472 "y.tab.c"
1472  break;
1473 
1474  case 20: /* Persistant: PERSISTANT */
1475 #line 245 "spec.y"
1476  {
1477  (yyval.val) = 1 ;
1478  }
1479 #line 1480 "y.tab.c"
1480  break;
1481 
1482  case 21: /* Persistant: %empty */
1483 #line 248 "spec.y"
1484  {(yyval.val) = 0;}
1485 #line 1486 "y.tab.c"
1486  break;
1487 
1488  case 22: /* Basis: Name */
1489 #line 251 "spec.y"
1490  {
1491  /*NOSTRICT*/
1492  (yyval.domain) = (union domain *)alloc( sizeof( union domain )) ;
1493  (yyval.domain)->ba.type = BASIS_DT ;
1494  (yyval.domain)->ba.constructor = (yyvsp[0].name) ;
1495  /*NOSTRICT*/
1496  (yyval.domain)->ba.constructand = (struct gen_binding *)(yyvsp[0].name) ;
1497  }
1498 #line 1499 "y.tab.c"
1499  break;
1500 
1501  case 23: /* Basis: Name COLUMN Name */
1502 #line 259 "spec.y"
1503  {
1504  /*NOSTRICT*/
1505  (yyval.domain) = (union domain *)alloc( sizeof( union domain )) ;
1506  (yyval.domain)->ba.type = BASIS_DT ;
1507  (yyval.domain)->ba.constructor = (yyvsp[-2].name) ;
1508  /*NOSTRICT*/
1509  (yyval.domain)->ba.constructand = (struct gen_binding *)(yyvsp[0].name) ;
1510  }
1511 #line 1512 "y.tab.c"
1512  break;
1513 
1514  case 24: /* Constructed: AND Simple Constructed */
1515 #line 270 "spec.y"
1516  {
1517  /*NOSTRICT*/
1518  (yyval.domainlist) = (struct domainlist *)alloc( sizeof( struct domainlist ));
1519  (yyval.domainlist)->domain = (yyvsp[-1].domain) ;
1520  (yyval.domainlist)->cdr = (yyvsp[0].domainlist) ;
1521  update_op( AND_OP, "OR prohibited in an AND constructor\n" ) ;
1522  }
1523 #line 1524 "y.tab.c"
1524  break;
1525 
1526  case 25: /* Constructed: OR Simple Constructed */
1527 #line 277 "spec.y"
1528  {
1529  /*NOSTRICT*/
1530  (yyval.domainlist) = (struct domainlist *)alloc( sizeof( struct domainlist ));
1531  (yyval.domainlist)->domain = (yyvsp[-1].domain) ;
1532  (yyval.domainlist)->cdr = (yyvsp[0].domainlist) ;
1533  update_op( OR_OP, "AND prohibited in an OR constructor\n" ) ;
1534  }
1535 #line 1536 "y.tab.c"
1536  break;
1537 
1538  case 26: /* Constructed: ARROW Simple */
1539 #line 284 "spec.y"
1540  {
1541  (yyval.domainlist) = (struct domainlist *)alloc( sizeof( struct domainlist ));
1542  (yyval.domainlist)->domain = (yyvsp[0].domain) ;
1543  (yyval.domainlist)->cdr = NULL ;
1544  update_op( ARROW_OP, "-> is a unary constructor\n" ) ;
1545  }
1546 #line 1547 "y.tab.c"
1547  break;
1548 
1549  case 27: /* Constructed: %empty */
1550 #line 290 "spec.y"
1551  {
1552  (yyval.domainlist) = NULL ;
1553  }
1554 #line 1555 "y.tab.c"
1555  break;
1556 
1557  case 28: /* Namelist: Name COMMA Namelist */
1558 #line 296 "spec.y"
1559  {
1560  /*NOSTRICT*/
1561  (yyval.namelist) = (struct namelist *)alloc( sizeof( struct namelist )) ;
1562  (yyval.namelist)->name = (yyvsp[-2].name) ;
1563  (yyval.namelist)->cdr = (yyvsp[0].namelist) ;
1564  }
1565 #line 1566 "y.tab.c"
1566  break;
1567 
1568  case 29: /* Namelist: Name */
1569 #line 302 "spec.y"
1570  {
1571  /*NOSTRICT*/
1572  (yyval.namelist) = (struct namelist *)alloc( sizeof( struct namelist )) ;
1573  (yyval.namelist)->name = (yyvsp[0].name) ;
1574  (yyval.namelist)->cdr = NULL ;
1575  }
1576 #line 1577 "y.tab.c"
1577  break;
1578 
1579  case 30: /* Dimensions: LB Int RB Dimensions */
1580 #line 311 "spec.y"
1581  {
1582  /*NOSTRICT*/
1583  (yyval.intlist) = (struct intlist *)alloc( sizeof( struct intlist )) ;
1584  (yyval.intlist)->val = (yyvsp[-2].val) ;
1585  (yyval.intlist)->cdr = (yyvsp[0].intlist) ;
1586  }
1587 #line 1588 "y.tab.c"
1588  break;
1589 
1590  case 31: /* Dimensions: LB Int RB */
1591 #line 317 "spec.y"
1592  {
1593  /*NOSTRICT*/
1594  (yyval.intlist) = (struct intlist *)alloc( sizeof( struct intlist )) ;
1595  (yyval.intlist)->val = (yyvsp[-1].val) ;
1596  (yyval.intlist)->cdr = NULL ;
1597  }
1598 #line 1599 "y.tab.c"
1599  break;
1600 
1601  case 32: /* Int: GRAM_INT */
1602 #line 325 "spec.y"
1603  {(yyval.val) = (yyvsp[0].val);}
1604 #line 1605 "y.tab.c"
1605  break;
1606 
1607  case 33: /* Name: IDENT */
1608 #line 328 "spec.y"
1609  {
1610  check_not_keyword( (yyvsp[0].name) ) ;
1611  (yyval.name) = (yyvsp[0].name);
1612  }
1613 #line 1614 "y.tab.c"
1614  break;
1615 
1616 
1617 #line 1618 "y.tab.c"
1618 
1619  default: break;
1620  }
1621  /* User semantic actions sometimes alter yychar, and that requires
1622  that yytoken be updated with the new translation. We take the
1623  approach of translating immediately before every use of yytoken.
1624  One alternative is translating here after every semantic action,
1625  but that translation would be missed if the semantic action invokes
1626  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1627  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1628  incorrect destructor might then be invoked immediately. In the
1629  case of YYERROR or YYBACKUP, subsequent parser actions might lead
1630  to an incorrect destructor call or verbose syntax error message
1631  before the lookahead is translated. */
1632  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1633 
1634  YYPOPSTACK (yylen);
1635  yylen = 0;
1636 
1637  *++yyvsp = yyval;
1638 
1639  /* Now 'shift' the result of the reduction. Determine what state
1640  that goes to, based on the state we popped back to and the rule
1641  number reduced by. */
1642  {
1643  const int yylhs = yyr1[yyn] - YYNTOKENS;
1644  const int yyi = yypgoto[yylhs] + *yyssp;
1645  yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1646  ? yytable[yyi]
1647  : yydefgoto[yylhs]);
1648  }
1649 
1650  goto yynewstate;
1651 
1652 
1653 /*--------------------------------------.
1654 | yyerrlab -- here on detecting error. |
1655 `--------------------------------------*/
1656 yyerrlab:
1657  /* Make sure we have latest lookahead translation. See comments at
1658  user semantic actions for why this is necessary. */
1659  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1660  /* If not already recovering from an error, report this error. */
1661  if (!yyerrstatus)
1662  {
1663  ++yynerrs;
1664  yyerror (YY_("syntax error"));
1665  }
1666 
1667  if (yyerrstatus == 3)
1668  {
1669  /* If just tried and failed to reuse lookahead token after an
1670  error, discard it. */
1671 
1672  if (yychar <= YYEOF)
1673  {
1674  /* Return failure if at end of input. */
1675  if (yychar == YYEOF)
1676  YYABORT;
1677  }
1678  else
1679  {
1680  yydestruct ("Error: discarding",
1681  yytoken, &yylval);
1682  yychar = YYEMPTY;
1683  }
1684  }
1685 
1686  /* Else will try to reuse lookahead token after shifting the error
1687  token. */
1688  goto yyerrlab1;
1689 
1690 
1691 /*---------------------------------------------------.
1692 | yyerrorlab -- error raised explicitly by YYERROR. |
1693 `---------------------------------------------------*/
1694 yyerrorlab:
1695  /* Pacify compilers when the user code never invokes YYERROR and the
1696  label yyerrorlab therefore never appears in user code. */
1697  if (0)
1698  YYERROR;
1699  ++yynerrs;
1700 
1701  /* Do not reclaim the symbols of the rule whose action triggered
1702  this YYERROR. */
1703  YYPOPSTACK (yylen);
1704  yylen = 0;
1705  YY_STACK_PRINT (yyss, yyssp);
1706  yystate = *yyssp;
1707  goto yyerrlab1;
1708 
1709 
1710 /*-------------------------------------------------------------.
1711 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1712 `-------------------------------------------------------------*/
1713 yyerrlab1:
1714  yyerrstatus = 3; /* Each real token shifted decrements this. */
1715 
1716  /* Pop stack until we find a state that shifts the error token. */
1717  for (;;)
1718  {
1719  yyn = yypact[yystate];
1720  if (!yypact_value_is_default (yyn))
1721  {
1722  yyn += YYSYMBOL_YYerror;
1723  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1724  {
1725  yyn = yytable[yyn];
1726  if (0 < yyn)
1727  break;
1728  }
1729  }
1730 
1731  /* Pop the current state because it cannot handle the error token. */
1732  if (yyssp == yyss)
1733  YYABORT;
1734 
1735 
1736  yydestruct ("Error: popping",
1737  YY_ACCESSING_SYMBOL (yystate), yyvsp);
1738  YYPOPSTACK (1);
1739  yystate = *yyssp;
1740  YY_STACK_PRINT (yyss, yyssp);
1741  }
1742 
1744  *++yyvsp = yylval;
1746 
1747 
1748  /* Shift the error token. */
1749  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1750 
1751  yystate = yyn;
1752  goto yynewstate;
1753 
1754 
1755 /*-------------------------------------.
1756 | yyacceptlab -- YYACCEPT comes here. |
1757 `-------------------------------------*/
1758 yyacceptlab:
1759  yyresult = 0;
1760  goto yyreturnlab;
1761 
1762 
1763 /*-----------------------------------.
1764 | yyabortlab -- YYABORT comes here. |
1765 `-----------------------------------*/
1766 yyabortlab:
1767  yyresult = 1;
1768  goto yyreturnlab;
1769 
1770 
1771 /*-----------------------------------------------------------.
1772 | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
1773 `-----------------------------------------------------------*/
1774 yyexhaustedlab:
1775  yyerror (YY_("memory exhausted"));
1776  yyresult = 2;
1777  goto yyreturnlab;
1778 
1779 
1780 /*----------------------------------------------------------.
1781 | yyreturnlab -- parsing is finished, clean up and return. |
1782 `----------------------------------------------------------*/
1783 yyreturnlab:
1784  if (yychar != YYEMPTY)
1785  {
1786  /* Make sure we have latest lookahead translation. See comments at
1787  user semantic actions for why this is necessary. */
1788  yytoken = YYTRANSLATE (yychar);
1789  yydestruct ("Cleanup: discarding lookahead",
1790  yytoken, &yylval);
1791  }
1792  /* Do not reclaim the symbols of the rule whose action triggered
1793  this YYABORT or YYACCEPT. */
1794  YYPOPSTACK (yylen);
1795  YY_STACK_PRINT (yyss, yyssp);
1796  while (yyssp != yyss)
1797  {
1798  yydestruct ("Cleanup: popping",
1799  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
1800  YYPOPSTACK (1);
1801  }
1802 #ifndef yyoverflow
1803  if (yyss != yyssa)
1804  YYSTACK_FREE (yyss);
1805 #endif
1806 
1807  return yyresult;
1808 }
1809 
1810 #line 333 "spec.y"
1811 
1812 
1813 /* Syntax error routines called by yacc. */
1814 
1815 void genspec_error(const char * s)
1816 {
1817  int c;
1818 
1819  user( "%s before ", s ) ;
1820 
1821  while( (c=genspec_input()) != 0 )
1822  fprintf( stderr, "%c", c ) ;
1823 
1824  exit( 1 ) ;
1825 }
1826 
char * alloc(int size)
ALLOC is an "iron-clad" version of malloc(3).
Definition: build.c:501
struct gen_binding * new_binding(char *name, union domain *val)
NEW_BINDING introduces a new pair (NAME, VAL) in the Domains table.
Definition: build.c:230
int Current_op
Used to check, while parsing specs, that a constructed domain use only one operator type.
Definition: build.c:62
static const char * yysymbol_name(yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED
The user-facing name of the symbol whose (internal) number is YYSYMBOL.
Definition: cyacc.tab.c:1383
static void yy_symbol_print(FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const *const yyvaluep)
-----------------------—.
Definition: cyacc.tab.c:2447
static const yytype_int16 yyrline[]
YYRLINE[YYN] – Source line where rule number YYN was defined.
Definition: cyacc.tab.c:1279
static void yy_symbol_value_print(FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const *const yyvaluep)
-------------------------------—.
Definition: cyacc.tab.c:2429
static void yy_reduce_print(yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule)
--------------------------------------------—.
Definition: cyacc.tab.c:2486
static const char *const yytname[]
YYTNAME[SYMBOL-NUM] – String name of the symbol SYMBOL-NUM.
Definition: cyacc.tab.c:1327
static void yy_stack_print(yy_state_t *yybottom, yy_state_t *yytop)
--------------------------------------------------------------—.
Definition: cyacc.tab.c:2463
#define YYFPRINTF
Enable debugging if requested.
Definition: cyacc.tab.c:2400
int Read_spec_mode
extern int Current_first ;
Definition: genClib.c:60
yytokentype
Definition: genread.h:52
yysymbol_kind_t
!YY_GENREAD_Y_TAB_H_INCLUDED
Definition: genread_yacc.c:294
short yytype_int16
Definition: genread_yacc.c:378
int yy_state_fast_t
State numbers in computations.
Definition: genread_yacc.c:457
signed char yytype_int8
On compilers that do not define PTRDIFF_MAX etc., make sure <limits.h> and (if available) <stdint....
Definition: genread_yacc.c:370
yytype_int8 yy_state_t
Stored state numbers (used for stacks).
Definition: genread_yacc.c:454
#define IDENT
Definition: genspec_yacc.c:224
void update_op(int op, char *error_msg)
UPDATE_OP checks whether the just read OPerator is compatible with the current one.
Definition: genspec_yacc.c:120
#define yyparse
------—.
Definition: genspec_yacc.c:68
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: genspec_yacc.c:477
#define YYMAXDEPTH
YYMAXDEPTH – maximum size the stacks can grow to (effective only if the built-in stack extension meth...
#define RB
Definition: genspec_yacc.c:215
#define YYSTACK_FREE
Definition: genspec_yacc.c:539
int Number_imports
To manage imported domains:
Definition: genspec_yacc.c:115
static const yytype_int8 yytranslate[]
YYTRANSLATE[TOKEN-NUM] – Symbol number corresponding to TOKEN-NUM as returned by yylex.
Definition: genspec_yacc.c:653
#define COLUMN
Definition: genspec_yacc.c:208
yysymbol_kind_t
!YY_GENSPEC_Y_TAB_H_INCLUDED
Definition: genspec_yacc.c:259
@ YYSYMBOL_Dimensions
Namelist
Definition: genspec_yacc.c:299
@ YYSYMBOL_RR
LR
Definition: genspec_yacc.c:274
@ YYSYMBOL_Constructed
Basis
Definition: genspec_yacc.c:297
@ YYSYMBOL_TABULATED
GRAM_IMPORT
Definition: genspec_yacc.c:279
@ YYSYMBOL_YYUNDEF
error
Definition: genspec_yacc.c:263
@ YYSYMBOL_File
Imports
Definition: genspec_yacc.c:289
@ YYSYMBOL_LR
RB
Definition: genspec_yacc.c:273
@ YYSYMBOL_FROM
EQUAL
Definition: genspec_yacc.c:276
@ YYSYMBOL_Definitions
File
Definition: genspec_yacc.c:290
@ YYSYMBOL_STAR
ARROW
Definition: genspec_yacc.c:270
@ YYSYMBOL_Domain
Tabulated
Definition: genspec_yacc.c:293
@ YYSYMBOL_25_1
Specification
Definition: genspec_yacc.c:286
@ YYSYMBOL_YYerror
"end of file"
Definition: genspec_yacc.c:262
@ YYSYMBOL_Specification
$accept
Definition: genspec_yacc.c:285
@ YYSYMBOL_COLUMN
COMMA
Definition: genspec_yacc.c:265
@ YYSYMBOL_AND
SEMI_COLUMN
Definition: genspec_yacc.c:267
@ YYSYMBOL_Persistant
Simple
Definition: genspec_yacc.c:295
@ YYSYMBOL_ARROW
OR
Definition: genspec_yacc.c:269
@ YYSYMBOL_Imports
Externals
Definition: genspec_yacc.c:288
@ YYSYMBOL_Tabulated
Definition
Definition: genspec_yacc.c:292
@ YYSYMBOL_Definition
Definitions
Definition: genspec_yacc.c:291
@ YYSYMBOL_Int
Dimensions
Definition: genspec_yacc.c:300
@ YYSYMBOL_Simple
Domain
Definition: genspec_yacc.c:294
@ YYSYMBOL_Externals
$@1
Definition: genspec_yacc.c:287
@ YYSYMBOL_Basis
Persistant
Definition: genspec_yacc.c:296
@ YYSYMBOL_GRAM_IMPORT
GRAM_EXTERNAL
Definition: genspec_yacc.c:278
@ YYSYMBOL_COMMA
"invalid token"
Definition: genspec_yacc.c:264
@ YYSYMBOL_Namelist
Constructed
Definition: genspec_yacc.c:298
@ YYSYMBOL_YYACCEPT
GRAM_INT
Definition: genspec_yacc.c:284
@ YYSYMBOL_GRAM_EXTERNAL
FROM
Definition: genspec_yacc.c:277
@ YYSYMBOL_LB
STAR
Definition: genspec_yacc.c:271
@ YYSYMBOL_OR
AND
Definition: genspec_yacc.c:268
@ YYSYMBOL_GRAM_FILE
IDENT
Definition: genspec_yacc.c:282
@ YYSYMBOL_Name
Int
Definition: genspec_yacc.c:301
@ YYSYMBOL_YYEOF
Definition: genspec_yacc.c:261
@ YYSYMBOL_SEMI_COLUMN
COLUMN
Definition: genspec_yacc.c:266
@ YYSYMBOL_PERSISTANT
TABULATED
Definition: genspec_yacc.c:280
@ YYSYMBOL_GRAM_INT
GRAM_FILE
Definition: genspec_yacc.c:283
@ YYSYMBOL_YYEMPTY
Definition: genspec_yacc.c:260
@ YYSYMBOL_EQUAL
RR
Definition: genspec_yacc.c:275
@ YYSYMBOL_RB
LB
Definition: genspec_yacc.c:272
@ YYSYMBOL_IDENT
PERSISTANT
Definition: genspec_yacc.c:281
#define EQUAL
Definition: genspec_yacc.c:218
#define YY_ASSERT(E)
Definition: genspec_yacc.c:497
#define YY_(Msgid)
Definition: genspec_yacc.c:431
#define YYNOMEM
Definition: genspec_yacc.c:833
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: genspec_yacc.c:478
static const yytype_int8 yydefact[]
YYDEFACT[STATE-NUM] – Default reduction number in state STATE-NUM.
Definition: genspec_yacc.c:749
#define YYNSTATES
YYNSTATES – Number of states.
Definition: genspec_yacc.c:638
#define YY_IGNORE_USELESS_CAST_END
Definition: genspec_yacc.c:493
short yytype_int16
Definition: genspec_yacc.c:342
#define OR
Definition: genspec_yacc.c:211
#define yychar
Definition: genspec_yacc.c:74
#define LR
Definition: genspec_yacc.c:216
#define YYEOF
Definition: genspec_yacc.c:204
#define YYABORT
Definition: genspec_yacc.c:831
#define YYSTACK_BYTES(N)
The size of an array large to enough to hold all stacks, each with N elements.
Definition: genspec_yacc.c:582
static const yytype_int8 yycheck[]
Definition: genspec_yacc.c:785
#define GRAM_FILE
Definition: genspec_yacc.c:225
#define YY_REDUCE_PRINT(Rule)
Definition: genspec_yacc.c:983
#define YY_CAST(Type, Val)
Definition: genspec_yacc.c:142
static void yydestruct(const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
-------------------------------------------—.
#define yylex
Definition: genspec_yacc.c:69
#define YYerror
Definition: genspec_yacc.c:205
#define YY_NULLPTR
Definition: genspec_yacc.c:154
#define YYUNDEF
Definition: genspec_yacc.c:206
static const yytype_int8 yypact[]
YYPACT[STATE-NUM] – Index in YYTABLE of the portion describing STATE-NUM.
Definition: genspec_yacc.c:736
void * malloc(YYSIZE_T)
#define ARROW
Definition: genspec_yacc.c:212
struct gen_binding Domains[MAX_DOMAIN]
in build.c
Definition: genspec_yacc.c:114
#define RR
Definition: genspec_yacc.c:217
#define YYFINAL
!YYCOPY_NEEDED
Definition: genspec_yacc.c:627
#define YY_ACCESSING_SYMBOL(State)
Accessing symbol of state STATE.
Definition: genspec_yacc.c:697
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
Definition: genspec_yacc.c:981
void genspec_error(const char *)
Syntax error routines called by yacc.
int genspec_parse(void)
#define yylval
Definition: genspec_yacc.c:73
#define YYNTOKENS
YYNTOKENS – Number of terminals.
Definition: genspec_yacc.c:632
unsigned char yytype_uint8
Work around bug in HP-UX 11.23, which defines these macros incorrectly for preprocessor constants.
Definition: genspec_yacc.c:363
#define YY_STACK_PRINT(Bottom, Top)
Definition: genspec_yacc.c:982
#define GRAM_EXTERNAL
Definition: genspec_yacc.c:220
#define YYSIZE_T
Definition: genspec_yacc.c:404
#define yydebug
Definition: genspec_yacc.c:71
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition: genspec_yacc.c:492
static const yytype_int8 yyr2[]
YYR2[RULE-NUM] – Number of symbols on the right-hand side of rule RULE-NUM.
Definition: genspec_yacc.c:816
static const yytype_int8 yytable[]
YYTABLE[YYPACT[STATE-NUM]] – What to do in state STATE-NUM.
Definition: genspec_yacc.c:776
#define YYPTRDIFF_T
Definition: genspec_yacc.c:390
#define STAR
Definition: genspec_yacc.c:213
#define yynerrs
Definition: genspec_yacc.c:72
#define GRAM_INT
Definition: genspec_yacc.c:226
int check_not_keyword(char *)
CHECK_NOT_KEYWORD checks if S isn't a reserved word.
Definition: build.c:117
#define SEMI_COLUMN
Definition: genspec_yacc.c:209
#define FROM
Definition: genspec_yacc.c:219
#define COMMA
Definition: genspec_yacc.c:207
#define YYACCEPT
Definition: genspec_yacc.c:830
#define yytable_value_is_error(Yyn)
Definition: genspec_yacc.c:731
#define YYTRANSLATE(YYX)
YYTRANSLATE(TOKEN-NUM) – Symbol number corresponding to TOKEN-NUM as returned by yylex,...
Definition: genspec_yacc.c:646
static const yytype_int8 yystos[]
YYSTOS[STATE-NUM] – The symbol kind of the accessing symbol of state STATE-NUM.
Definition: genspec_yacc.c:796
int genspec_input(void)
#define GRAM_IMPORT
Definition: genspec_yacc.c:221
#define YY_ATTRIBUTE_UNUSED
Definition: genspec_yacc.c:448
static const yytype_int8 yypgoto[]
YYPGOTO[NTERM-NUM].
Definition: genspec_yacc.c:760
static const yytype_int8 yyr1[]
YYR1[RULE-NUM] – Symbol kind of the left-hand side of rule RULE-NUM.
Definition: genspec_yacc.c:807
#define LB
Definition: genspec_yacc.c:214
#define AND
Definition: genspec_yacc.c:210
enum yytokentype yytoken_kind_t
Definition: genspec_yacc.c:200
#define YYPOPSTACK(N)
int yy_state_fast_t
State numbers in computations.
Definition: genspec_yacc.c:421
YYSTYPE genspec_lval
unsigned short yytype_uint16
Definition: genspec_yacc.c:374
static const yytype_int8 yydefgoto[]
YYDEFGOTO[NTERM-NUM].
Definition: genspec_yacc.c:767
@ YYENOMEM
Definition: genspec_yacc.c:825
#define YYEMPTY
Token kinds.
Definition: genspec_yacc.c:203
#define YYLAST
YYLAST – Last index in YYTABLE.
Definition: genspec_yacc.c:629
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Relocate STACK from its old location to the new one.
Definition: genspec_yacc.c:593
#define yypact_value_is_default(Yyn)
Definition: genspec_yacc.c:726
#define PERSISTANT
Definition: genspec_yacc.c:223
#define YYINITDEPTH
!YYDEBUG
Definition: genspec_yacc.c:989
signed char yytype_int8
On compilers that do not define PTRDIFF_MAX etc., make sure <limits.h> and (if available) <stdint....
Definition: genspec_yacc.c:334
void free(void *)
#define YYERROR
Definition: genspec_yacc.c:832
#define YYSIZEOF(X)
Definition: genspec_yacc.c:414
#define YYSTACK_ALLOC
The parser invokes alloca or malloc; define the necessary symbols.
Definition: genspec_yacc.c:538
yytype_int8 yy_state_t
Stored state numbers (used for stacks).
Definition: genspec_yacc.c:418
#define YYDPRINTF(Args)
Enable debugging if requested.
Definition: genspec_yacc.c:980
#define TABULATED
Definition: genspec_yacc.c:222
#define YY_USE(E)
Suppress unused-variable warnings by "using" E.
Definition: genspec_yacc.c:454
#define yyerror
Definition: genspec_yacc.c:70
#define exit(code)
Definition: misc-local.h:54
@ ARROW_OP
@ OR_OP
@ AND_OP
@ UNDEF_OP
gen_tabulated_p gen_init_tabulated(int)
Definition: tabulated.c:66
@ EXTERNAL_DT
@ SET_DT
@ ARRAY_DT
@ LIST_DT
@ BASIS_DT
@ IMPORT_DT
@ CONSTRUCTED_DT
#define MAX_DOMAIN
MAX_DOMAIN is the maximum number of entries in the DOMAINS table.
void user(char *,...)
External routines.
#define UNIT_TYPE_NAME
The UNIT_TYPE_NAME is the used to type expressions which only perform side-effects.
@ set_pointer
Definition: newgen_set.h:44
@ set_int
Definition: newgen_set.h:43
@ set_string
Definition: newgen_set.h:42
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
#define uint_least8_t
Definition: stdint.in.h:229
#define int_least16_t
Definition: stdint.in.h:230
#define int_least8_t
7.18.1.2.
Definition: stdint.in.h:228
#define uint_least16_t
Definition: stdint.in.h:231
gen_tabulated_p tabulated
number of chunks to hold this data.
Value type.
Definition: genread.h:115
char * name
Definition: genspec.h:116
struct namelist * namelist
Definition: genspec.h:114
struct domainlist * domainlist
Definition: genspec.h:113
intptr_t val
Definition: genread.h:121
union domain * domain
Definition: genspec.h:112
struct intlist * intlist
Definition: genspec.h:115
A DOMAIN union describes the structure of a user type.
struct domain::@2 ex
void *(* read)(FILE *, int(*)(void))
void *(* copy)(void *)
int type
EXTERNAL.
struct domain::@3 ba
struct domain::@8 im
void(* free)(void *)
char * filename
void(* write)(FILE *, void *)
INFRINGES ON USER NAME SPACE.
Definition: genread_yacc.c:608
YYSTYPE yyvs_alloc
Definition: genread_yacc.c:610
yy_state_t yyss_alloc
Definition: genread_yacc.c:609