PIPS
readmakefile.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 pipsmake_parse
69 #define yylex pipsmake_lex
70 #define yyerror pipsmake_error
71 #define yydebug pipsmake_debug
72 #define yynerrs pipsmake_nerrs
73 #define yylval pipsmake_lval
74 #define yychar pipsmake_char
75 
76 /* First part of user prologue. */
77 #line 60 "readmakefile.y"
78 
79 #ifdef HAVE_CONFIG_H
80  #include "pips_config.h"
81 #endif
82 #include <stdio.h>
83 #include <stdlib.h>
84 #include <string.h>
85 #include "linear.h"
86 
87 #include "genC.h"
88 #include "ri.h"
89 #include "database.h"
90 #include "makefile.h"
91 
92 #include "misc.h"
93 
94 #include "properties.h"
95 #include "top-level.h"
96 #include "pipsmake.h"
97 
98 #include "stdlib.h"
99 
101 static hash_table activated = NULL;
102 
103 #line 104 "y.tab.c"
104 
105 # ifndef YY_CAST
106 # ifdef __cplusplus
107 # define YY_CAST(Type, Val) static_cast<Type> (Val)
108 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
109 # else
110 # define YY_CAST(Type, Val) ((Type) (Val))
111 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
112 # endif
113 # endif
114 # ifndef YY_NULLPTR
115 # if defined __cplusplus
116 # if 201103L <= __cplusplus
117 # define YY_NULLPTR nullptr
118 # else
119 # define YY_NULLPTR 0
120 # endif
121 # else
122 # define YY_NULLPTR ((void*)0)
123 # endif
124 # endif
125 
126 /* Use api.header.include to #include this header
127  instead of duplicating it here. */
128 #ifndef YY_PIPSMAKE_Y_TAB_H_INCLUDED
129 # define YY_PIPSMAKE_Y_TAB_H_INCLUDED
130 /* Debug traces. */
131 #ifndef YYDEBUG
132 # define YYDEBUG 0
133 #endif
134 #if YYDEBUG
135 extern int pipsmake_debug;
136 #endif
137 
138 /* Token kinds. */
139 #ifndef YYTOKENTYPE
140 # define YYTOKENTYPE
142  {
143  YYEMPTY = -2,
144  YYEOF = 0, /* "end of file" */
145  YYerror = 256, /* error */
146  YYUNDEF = 257, /* "invalid token" */
147  PROGRAM = 258, /* PROGRAM */
148  MODULE = 259, /* MODULE */
149  MAIN = 260, /* MAIN */
150  COMMON = 261, /* COMMON */
151  TK_CALLEES = 262, /* TK_CALLEES */
152  CALLERS = 263, /* CALLERS */
153  ALL = 264, /* ALL */
154  SELECT = 265, /* SELECT */
155  COMPILATION_UNIT = 266, /* COMPILATION_UNIT */
156  REQUIRED = 267, /* REQUIRED */
157  PRODUCED = 268, /* PRODUCED */
158  MODIFIED = 269, /* MODIFIED */
159  PRESERVED = 270, /* PRESERVED */
160  PRE_TRANSFORMATION = 271, /* PRE_TRANSFORMATION */
161  POST_TRANSFORMATION = 272, /* POST_TRANSFORMATION */
162  DOT = 273, /* DOT */
163  NAME = 274 /* NAME */
164  };
165  typedef enum yytokentype yytoken_kind_t;
166 #endif
167 /* Token kinds. */
168 #define YYEMPTY -2
169 #define YYEOF 0
170 #define YYerror 256
171 #define YYUNDEF 257
172 #define PROGRAM 258
173 #define MODULE 259
174 #define MAIN 260
175 #define COMMON 261
176 #define TK_CALLEES 262
177 #define CALLERS 263
178 #define ALL 264
179 #define SELECT 265
180 #define COMPILATION_UNIT 266
181 #define REQUIRED 267
182 #define PRODUCED 268
183 #define MODIFIED 269
184 #define PRESERVED 270
185 #define PRE_TRANSFORMATION 271
186 #define POST_TRANSFORMATION 272
187 #define DOT 273
188 #define NAME 274
189 
190 /* Value type. */
191 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
192 union YYSTYPE
193 {
194 #line 86 "readmakefile.y"
195 
196  string name;
201  int tag;
202 
203 #line 204 "y.tab.c"
204 
205 };
206 typedef union YYSTYPE YYSTYPE;
207 # define YYSTYPE_IS_TRIVIAL 1
208 # define YYSTYPE_IS_DECLARED 1
209 #endif
210 
211 
212 extern YYSTYPE pipsmake_lval;
213 
214 
215 int pipsmake_parse (void);
216 
217 
218 #endif /* !YY_PIPSMAKE_Y_TAB_H_INCLUDED */
219 /* Symbol kind. */
221 {
223  YYSYMBOL_YYEOF = 0, /* "end of file" */
224  YYSYMBOL_YYerror = 1, /* error */
225  YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
226  YYSYMBOL_PROGRAM = 3, /* PROGRAM */
227  YYSYMBOL_MODULE = 4, /* MODULE */
228  YYSYMBOL_MAIN = 5, /* MAIN */
229  YYSYMBOL_COMMON = 6, /* COMMON */
230  YYSYMBOL_TK_CALLEES = 7, /* TK_CALLEES */
231  YYSYMBOL_CALLERS = 8, /* CALLERS */
232  YYSYMBOL_ALL = 9, /* ALL */
233  YYSYMBOL_SELECT = 10, /* SELECT */
234  YYSYMBOL_COMPILATION_UNIT = 11, /* COMPILATION_UNIT */
235  YYSYMBOL_REQUIRED = 12, /* REQUIRED */
236  YYSYMBOL_PRODUCED = 13, /* PRODUCED */
237  YYSYMBOL_MODIFIED = 14, /* MODIFIED */
238  YYSYMBOL_PRESERVED = 15, /* PRESERVED */
239  YYSYMBOL_PRE_TRANSFORMATION = 16, /* PRE_TRANSFORMATION */
240  YYSYMBOL_POST_TRANSFORMATION = 17, /* POST_TRANSFORMATION */
241  YYSYMBOL_DOT = 18, /* DOT */
242  YYSYMBOL_NAME = 19, /* NAME */
243  YYSYMBOL_YYACCEPT = 20, /* $accept */
244  YYSYMBOL_rules = 21, /* rules */
245  YYSYMBOL_rule = 22, /* rule */
246  YYSYMBOL_deps = 23, /* deps */
247  YYSYMBOL_dir = 24, /* dir */
248  YYSYMBOL_virtuals = 25, /* virtuals */
249  YYSYMBOL_virtual = 26, /* virtual */
250  YYSYMBOL_owner = 27, /* owner */
251  YYSYMBOL_phase = 28, /* phase */
252  YYSYMBOL_resource = 29 /* resource */
253 };
254 typedef enum yysymbol_kind_t yysymbol_kind_t;
255 
256 
257 
258 
259 #ifdef short
260 # undef short
261 #endif
262 
263 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
264  <limits.h> and (if available) <stdint.h> are included
265  so that the code can choose integer types of a good width. */
266 
267 #ifndef __PTRDIFF_MAX__
268 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
269 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
270 # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
271 # define YY_STDINT_H
272 # endif
273 #endif
274 
275 /* Narrow types that promote to a signed type and that can represent a
276  signed or unsigned integer of at least N bits. In tables they can
277  save space and decrease cache pressure. Promoting to a signed type
278  helps avoid bugs in integer arithmetic. */
279 
280 #ifdef __INT_LEAST8_MAX__
281 typedef __INT_LEAST8_TYPE__ yytype_int8;
282 #elif defined YY_STDINT_H
283 typedef int_least8_t yytype_int8;
284 #else
285 typedef signed char yytype_int8;
286 #endif
287 
288 #ifdef __INT_LEAST16_MAX__
289 typedef __INT_LEAST16_TYPE__ yytype_int16;
290 #elif defined YY_STDINT_H
292 #else
293 typedef short yytype_int16;
294 #endif
295 
296 /* Work around bug in HP-UX 11.23, which defines these macros
297  incorrectly for preprocessor constants. This workaround can likely
298  be removed in 2023, as HPE has promised support for HP-UX 11.23
299  (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
300  <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
301 #ifdef __hpux
302 # undef UINT_LEAST8_MAX
303 # undef UINT_LEAST16_MAX
304 # define UINT_LEAST8_MAX 255
305 # define UINT_LEAST16_MAX 65535
306 #endif
307 
308 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
309 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
310 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
311  && UINT_LEAST8_MAX <= INT_MAX)
313 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
314 typedef unsigned char yytype_uint8;
315 #else
316 typedef short yytype_uint8;
317 #endif
318 
319 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
320 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
321 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
322  && UINT_LEAST16_MAX <= INT_MAX)
324 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
325 typedef unsigned short yytype_uint16;
326 #else
327 typedef int yytype_uint16;
328 #endif
329 
330 #ifndef YYPTRDIFF_T
331 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
332 # define YYPTRDIFF_T __PTRDIFF_TYPE__
333 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
334 # elif defined PTRDIFF_MAX
335 # ifndef ptrdiff_t
336 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
337 # endif
338 # define YYPTRDIFF_T ptrdiff_t
339 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
340 # else
341 # define YYPTRDIFF_T long
342 # define YYPTRDIFF_MAXIMUM LONG_MAX
343 # endif
344 #endif
345 
346 #ifndef YYSIZE_T
347 # ifdef __SIZE_TYPE__
348 # define YYSIZE_T __SIZE_TYPE__
349 # elif defined size_t
350 # define YYSIZE_T size_t
351 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
352 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
353 # define YYSIZE_T size_t
354 # else
355 # define YYSIZE_T unsigned
356 # endif
357 #endif
358 
359 #define YYSIZE_MAXIMUM \
360  YY_CAST (YYPTRDIFF_T, \
361  (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
362  ? YYPTRDIFF_MAXIMUM \
363  : YY_CAST (YYSIZE_T, -1)))
364 
365 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
366 
367 
368 /* Stored state numbers (used for stacks). */
370 
371 /* State numbers in computations. */
372 typedef int yy_state_fast_t;
373 
374 #ifndef YY_
375 # if defined YYENABLE_NLS && YYENABLE_NLS
376 # if ENABLE_NLS
377 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
378 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
379 # endif
380 # endif
381 # ifndef YY_
382 # define YY_(Msgid) Msgid
383 # endif
384 #endif
385 
386 
387 #ifndef YY_ATTRIBUTE_PURE
388 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
389 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
390 # else
391 # define YY_ATTRIBUTE_PURE
392 # endif
393 #endif
394 
395 #ifndef YY_ATTRIBUTE_UNUSED
396 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
397 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
398 # else
399 # define YY_ATTRIBUTE_UNUSED
400 # endif
401 #endif
402 
403 /* Suppress unused-variable warnings by "using" E. */
404 #if ! defined lint || defined __GNUC__
405 # define YY_USE(E) ((void) (E))
406 #else
407 # define YY_USE(E) /* empty */
408 #endif
409 
410 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
411 #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
412 # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
413 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
414  _Pragma ("GCC diagnostic push") \
415  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
416 # else
417 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
418  _Pragma ("GCC diagnostic push") \
419  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
420  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
421 # endif
422 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
423  _Pragma ("GCC diagnostic pop")
424 #else
425 # define YY_INITIAL_VALUE(Value) Value
426 #endif
427 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
428 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
429 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
430 #endif
431 #ifndef YY_INITIAL_VALUE
432 # define YY_INITIAL_VALUE(Value) /* Nothing. */
433 #endif
434 
435 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
436 # define YY_IGNORE_USELESS_CAST_BEGIN \
437  _Pragma ("GCC diagnostic push") \
438  _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
439 # define YY_IGNORE_USELESS_CAST_END \
440  _Pragma ("GCC diagnostic pop")
441 #endif
442 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
443 # define YY_IGNORE_USELESS_CAST_BEGIN
444 # define YY_IGNORE_USELESS_CAST_END
445 #endif
446 
447 
448 #define YY_ASSERT(E) ((void) (0 && (E)))
449 
450 #if !defined yyoverflow
451 
452 /* The parser invokes alloca or malloc; define the necessary symbols. */
453 
454 # ifdef YYSTACK_USE_ALLOCA
455 # if YYSTACK_USE_ALLOCA
456 # ifdef __GNUC__
457 # define YYSTACK_ALLOC __builtin_alloca
458 # elif defined __BUILTIN_VA_ARG_INCR
459 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
460 # elif defined _AIX
461 # define YYSTACK_ALLOC __alloca
462 # elif defined _MSC_VER
463 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
464 # define alloca _alloca
465 # else
466 # define YYSTACK_ALLOC alloca
467 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
468 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
469  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
470 # ifndef EXIT_SUCCESS
471 # define EXIT_SUCCESS 0
472 # endif
473 # endif
474 # endif
475 # endif
476 # endif
477 
478 # ifdef YYSTACK_ALLOC
479  /* Pacify GCC's 'empty if-body' warning. */
480 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
481 # ifndef YYSTACK_ALLOC_MAXIMUM
482  /* The OS might guarantee only one guard page at the bottom of the stack,
483  and a page size can be as small as 4096 bytes. So we cannot safely
484  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
485  to allow for a few compiler-allocated temporary stack slots. */
486 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
487 # endif
488 # else
489 # define YYSTACK_ALLOC YYMALLOC
490 # define YYSTACK_FREE YYFREE
491 # ifndef YYSTACK_ALLOC_MAXIMUM
492 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
493 # endif
494 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
495  && ! ((defined YYMALLOC || defined malloc) \
496  && (defined YYFREE || defined free)))
497 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
498 # ifndef EXIT_SUCCESS
499 # define EXIT_SUCCESS 0
500 # endif
501 # endif
502 # ifndef YYMALLOC
503 # define YYMALLOC malloc
504 # if ! defined malloc && ! defined EXIT_SUCCESS
505 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
506 # endif
507 # endif
508 # ifndef YYFREE
509 # define YYFREE free
510 # if ! defined free && ! defined EXIT_SUCCESS
511 void free (void *); /* INFRINGES ON USER NAME SPACE */
512 # endif
513 # endif
514 # endif
515 #endif /* !defined yyoverflow */
516 
517 #if (! defined yyoverflow \
518  && (! defined __cplusplus \
519  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
520 
521 /* A type that is properly aligned for any stack member. */
522 union yyalloc
523 {
526 };
527 
528 /* The size of the maximum gap between one aligned stack and the next. */
529 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
530 
531 /* The size of an array large to enough to hold all stacks, each with
532  N elements. */
533 # define YYSTACK_BYTES(N) \
534  ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
535  + YYSTACK_GAP_MAXIMUM)
536 
537 # define YYCOPY_NEEDED 1
538 
539 /* Relocate STACK from its old location to the new one. The
540  local variables YYSIZE and YYSTACKSIZE give the old and new number of
541  elements in the stack, and YYPTR gives the new location of the
542  stack. Advance YYPTR to a properly aligned location for the next
543  stack. */
544 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
545  do \
546  { \
547  YYPTRDIFF_T yynewbytes; \
548  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
549  Stack = &yyptr->Stack_alloc; \
550  yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
551  yyptr += yynewbytes / YYSIZEOF (*yyptr); \
552  } \
553  while (0)
554 
555 #endif
556 
557 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
558 /* Copy COUNT objects from SRC to DST. The source and destination do
559  not overlap. */
560 # ifndef YYCOPY
561 # if defined __GNUC__ && 1 < __GNUC__
562 # define YYCOPY(Dst, Src, Count) \
563  __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
564 # else
565 # define YYCOPY(Dst, Src, Count) \
566  do \
567  { \
568  YYPTRDIFF_T yyi; \
569  for (yyi = 0; yyi < (Count); yyi++) \
570  (Dst)[yyi] = (Src)[yyi]; \
571  } \
572  while (0)
573 # endif
574 # endif
575 #endif /* !YYCOPY_NEEDED */
576 
577 /* YYFINAL -- State number of the termination state. */
578 #define YYFINAL 2
579 /* YYLAST -- Last index in YYTABLE. */
580 #define YYLAST 20
581 
582 /* YYNTOKENS -- Number of terminals. */
583 #define YYNTOKENS 20
584 /* YYNNTS -- Number of nonterminals. */
585 #define YYNNTS 10
586 /* YYNRULES -- Number of rules. */
587 #define YYNRULES 26
588 /* YYNSTATES -- Number of states. */
589 #define YYNSTATES 29
590 
591 /* YYMAXUTOK -- Last valid token kind. */
592 #define YYMAXUTOK 274
593 
594 
595 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
596  as returned by yylex, with out-of-bounds checking. */
597 #define YYTRANSLATE(YYX) \
598  (0 <= (YYX) && (YYX) <= YYMAXUTOK \
599  ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
600  : YYSYMBOL_YYUNDEF)
601 
602 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
603  as returned by yylex. */
604 static const yytype_int8 yytranslate[] =
605 {
606  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
615  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
616  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
617  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
618  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
619  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
620  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
621  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
622  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
623  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
624  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
625  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
626  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
627  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
628  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
629  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
630  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
631  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
632  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
633  15, 16, 17, 18, 19
634 };
635 
636 #if YYDEBUG
637 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
638 static const yytype_uint8 yyrline[] =
639 {
640  0, 96, 96, 99, 107, 111, 143, 146, 148, 150,
641  152, 154, 156, 160, 163, 166, 170, 172, 174, 176,
642  181, 183, 185, 187, 189, 193, 197
643 };
644 #endif
645 
646 /** Accessing symbol of state STATE. */
647 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
648 
649 #if YYDEBUG || 0
650 /* The user-facing name of the symbol whose (internal) number is
651  YYSYMBOL. No bounds checking. */
652 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
653 
654 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
655  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
656 static const char *const yytname[] =
657 {
658  "\"end of file\"", "error", "\"invalid token\"", "PROGRAM", "MODULE",
659  "MAIN", "COMMON", "TK_CALLEES", "CALLERS", "ALL", "SELECT",
660  "COMPILATION_UNIT", "REQUIRED", "PRODUCED", "MODIFIED", "PRESERVED",
661  "PRE_TRANSFORMATION", "POST_TRANSFORMATION", "DOT", "NAME", "$accept",
662  "rules", "rule", "deps", "dir", "virtuals", "virtual", "owner", "phase",
663  "resource", YY_NULLPTR
664 };
665 
666 static const char *
668 {
669  return yytname[yysymbol];
670 }
671 #endif
672 
673 #define YYPACT_NINF (-9)
674 
675 #define yypact_value_is_default(Yyn) \
676  ((Yyn) == YYPACT_NINF)
677 
678 #define YYTABLE_NINF (-1)
679 
680 #define yytable_value_is_error(Yyn) \
681  0
682 
683 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
684  STATE-NUM. */
685 static const yytype_int8 yypact[] =
686 {
687  -9, 0, -9, -9, -9, -9, -1, -9, -9, -9,
688  -9, -9, -9, -9, -2, -9, -9, -9, -9, -9,
689  -9, -9, -9, -9, -9, -8, 1, -9, -9
690 };
691 
692 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
693  Performed when YYTABLE does not specify something else to do. Zero
694  means the default is an error. */
695 static const yytype_int8 yydefact[] =
696 {
697  3, 0, 1, 25, 2, 6, 4, 7, 8, 9,
698  10, 11, 12, 14, 5, 16, 17, 18, 19, 20,
699  21, 22, 23, 24, 13, 0, 0, 26, 15
700 };
701 
702 /* YYPGOTO[NTERM-NUM]. */
703 static const yytype_int8 yypgoto[] =
704 {
705  -9, -9, -9, -9, -9, -9, -9, -9, -9, -9
706 };
707 
708 /* YYDEFGOTO[NTERM-NUM]. */
709 static const yytype_int8 yydefgoto[] =
710 {
711  0, 1, 4, 6, 13, 14, 24, 25, 5, 28
712 };
713 
714 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
715  positive, shift that token. If negative, reduce the rule whose
716  number is the opposite. If YYTABLE_NINF, syntax error. */
717 static const yytype_int8 yytable[] =
718 {
719  2, 15, 16, 17, 18, 19, 20, 21, 22, 23,
720  26, 7, 8, 9, 10, 11, 12, 0, 0, 3,
721  27
722 };
723 
724 static const yytype_int8 yycheck[] =
725 {
726  0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
727  18, 12, 13, 14, 15, 16, 17, -1, -1, 19,
728  19
729 };
730 
731 /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
732  state STATE-NUM. */
733 static const yytype_int8 yystos[] =
734 {
735  0, 21, 0, 19, 22, 28, 23, 12, 13, 14,
736  15, 16, 17, 24, 25, 3, 4, 5, 6, 7,
737  8, 9, 10, 11, 26, 27, 18, 19, 29
738 };
739 
740 /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
741 static const yytype_int8 yyr1[] =
742 {
743  0, 20, 21, 21, 22, 23, 23, 24, 24, 24,
744  24, 24, 24, 25, 25, 26, 27, 27, 27, 27,
745  27, 27, 27, 27, 27, 28, 29
746 };
747 
748 /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
749 static const yytype_int8 yyr2[] =
750 {
751  0, 2, 2, 0, 2, 3, 0, 1, 1, 1,
752  1, 1, 1, 2, 0, 3, 1, 1, 1, 1,
753  1, 1, 1, 1, 1, 1, 1
754 };
755 
756 
757 enum { YYENOMEM = -2 };
758 
759 #define yyerrok (yyerrstatus = 0)
760 #define yyclearin (yychar = YYEMPTY)
761 
762 #define YYACCEPT goto yyacceptlab
763 #define YYABORT goto yyabortlab
764 #define YYERROR goto yyerrorlab
765 #define YYNOMEM goto yyexhaustedlab
766 
767 
768 #define YYRECOVERING() (!!yyerrstatus)
769 
770 #define YYBACKUP(Token, Value) \
771  do \
772  if (yychar == YYEMPTY) \
773  { \
774  yychar = (Token); \
775  yylval = (Value); \
776  YYPOPSTACK (yylen); \
777  yystate = *yyssp; \
778  goto yybackup; \
779  } \
780  else \
781  { \
782  yyerror (YY_("syntax error: cannot back up")); \
783  YYERROR; \
784  } \
785  while (0)
786 
787 /* Backward compatibility with an undocumented macro.
788  Use YYerror or YYUNDEF. */
789 #define YYERRCODE YYUNDEF
790 
791 
792 /* Enable debugging if requested. */
793 #if YYDEBUG
794 
795 # ifndef YYFPRINTF
796 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
797 # define YYFPRINTF fprintf
798 # endif
799 
800 # define YYDPRINTF(Args) \
801 do { \
802  if (yydebug) \
803  YYFPRINTF Args; \
804 } while (0)
805 
806 
807 
808 
809 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
810 do { \
811  if (yydebug) \
812  { \
813  YYFPRINTF (stderr, "%s ", Title); \
814  yy_symbol_print (stderr, \
815  Kind, Value); \
816  YYFPRINTF (stderr, "\n"); \
817  } \
818 } while (0)
819 
820 
821 /*-----------------------------------.
822 | Print this symbol's value on YYO. |
823 `-----------------------------------*/
824 
825 static void
826 yy_symbol_value_print (FILE *yyo,
827  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
828 {
829  FILE *yyoutput = yyo;
830  YY_USE (yyoutput);
831  if (!yyvaluep)
832  return;
834  YY_USE (yykind);
836 }
837 
838 
839 /*---------------------------.
840 | Print this symbol on YYO. |
841 `---------------------------*/
842 
843 static void
844 yy_symbol_print (FILE *yyo,
845  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
846 {
847  YYFPRINTF (yyo, "%s %s (",
848  yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
849 
850  yy_symbol_value_print (yyo, yykind, yyvaluep);
851  YYFPRINTF (yyo, ")");
852 }
853 
854 /*------------------------------------------------------------------.
855 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
856 | TOP (included). |
857 `------------------------------------------------------------------*/
858 
859 static void
860 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
861 {
862  YYFPRINTF (stderr, "Stack now");
863  for (; yybottom <= yytop; yybottom++)
864  {
865  int yybot = *yybottom;
866  YYFPRINTF (stderr, " %d", yybot);
867  }
868  YYFPRINTF (stderr, "\n");
869 }
870 
871 # define YY_STACK_PRINT(Bottom, Top) \
872 do { \
873  if (yydebug) \
874  yy_stack_print ((Bottom), (Top)); \
875 } while (0)
876 
877 
878 /*------------------------------------------------.
879 | Report that the YYRULE is going to be reduced. |
880 `------------------------------------------------*/
881 
882 static void
883 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
884  int yyrule)
885 {
886  int yylno = yyrline[yyrule];
887  int yynrhs = yyr2[yyrule];
888  int yyi;
889  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
890  yyrule - 1, yylno);
891  /* The symbols being reduced. */
892  for (yyi = 0; yyi < yynrhs; yyi++)
893  {
894  YYFPRINTF (stderr, " $%d = ", yyi + 1);
895  yy_symbol_print (stderr,
896  YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
897  &yyvsp[(yyi + 1) - (yynrhs)]);
898  YYFPRINTF (stderr, "\n");
899  }
900 }
901 
902 # define YY_REDUCE_PRINT(Rule) \
903 do { \
904  if (yydebug) \
905  yy_reduce_print (yyssp, yyvsp, Rule); \
906 } while (0)
907 
908 /* Nonzero means print parse trace. It is left uninitialized so that
909  multiple parsers can coexist. */
910 int yydebug;
911 #else /* !YYDEBUG */
912 # define YYDPRINTF(Args) ((void) 0)
913 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
914 # define YY_STACK_PRINT(Bottom, Top)
915 # define YY_REDUCE_PRINT(Rule)
916 #endif /* !YYDEBUG */
917 
918 
919 /* YYINITDEPTH -- initial size of the parser's stacks. */
920 #ifndef YYINITDEPTH
921 # define YYINITDEPTH 200
922 #endif
923 
924 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
925  if the built-in stack extension method is used).
926 
927  Do not make this value too large; the results are undefined if
928  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
929  evaluated with infinite-precision integer arithmetic. */
930 
931 #ifndef YYMAXDEPTH
932 # define YYMAXDEPTH 10000
933 #endif
934 
935 
936 
937 
938 
939 
940 /*-----------------------------------------------.
941 | Release the memory associated to this symbol. |
942 `-----------------------------------------------*/
943 
944 static void
945 yydestruct (const char *yymsg,
946  yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
947 {
948  YY_USE (yyvaluep);
949  if (!yymsg)
950  yymsg = "Deleting";
951  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
952 
954  YY_USE (yykind);
956 }
957 
958 
959 /* Lookahead token kind. */
960 int yychar;
961 
962 /* The semantic value of the lookahead symbol. */
964 /* Number of syntax errors so far. */
966 
967 
968 
969 
970 /*----------.
971 | yyparse. |
972 `----------*/
973 
974 int
975 yyparse (void)
976 {
977  yy_state_fast_t yystate = 0;
978  /* Number of tokens to shift before error messages enabled. */
979  int yyerrstatus = 0;
980 
981  /* Refer to the stacks through separate pointers, to allow yyoverflow
982  to reallocate them elsewhere. */
983 
984  /* Their size. */
985  YYPTRDIFF_T yystacksize = YYINITDEPTH;
986 
987  /* The state stack: array, bottom, top. */
988  yy_state_t yyssa[YYINITDEPTH];
989  yy_state_t *yyss = yyssa;
990  yy_state_t *yyssp = yyss;
991 
992  /* The semantic value stack: array, bottom, top. */
993  YYSTYPE yyvsa[YYINITDEPTH];
994  YYSTYPE *yyvs = yyvsa;
995  YYSTYPE *yyvsp = yyvs;
996 
997  int yyn;
998  /* The return value of yyparse. */
999  int yyresult;
1000  /* Lookahead symbol kind. */
1002  /* The variables used to return semantic value and location from the
1003  action routines. */
1004  YYSTYPE yyval;
1005 
1006 
1007 
1008 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1009 
1010  /* The number of symbols on the RHS of the reduced rule.
1011  Keep to zero when no symbol should be popped. */
1012  int yylen = 0;
1013 
1014  YYDPRINTF ((stderr, "Starting parse\n"));
1015 
1016  yychar = YYEMPTY; /* Cause a token to be read. */
1017 
1018  goto yysetstate;
1019 
1020 
1021 /*------------------------------------------------------------.
1022 | yynewstate -- push a new state, which is found in yystate. |
1023 `------------------------------------------------------------*/
1024 yynewstate:
1025  /* In all cases, when you get here, the value and location stacks
1026  have just been pushed. So pushing a state here evens the stacks. */
1027  yyssp++;
1028 
1029 
1030 /*--------------------------------------------------------------------.
1031 | yysetstate -- set current state (the top of the stack) to yystate. |
1032 `--------------------------------------------------------------------*/
1033 yysetstate:
1034  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1035  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1037  *yyssp = YY_CAST (yy_state_t, yystate);
1039  YY_STACK_PRINT (yyss, yyssp);
1040 
1041  if (yyss + yystacksize - 1 <= yyssp)
1042 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1043  YYNOMEM;
1044 #else
1045  {
1046  /* Get the current used size of the three stacks, in elements. */
1047  YYPTRDIFF_T yysize = yyssp - yyss + 1;
1048 
1049 # if defined yyoverflow
1050  {
1051  /* Give user a chance to reallocate the stack. Use copies of
1052  these so that the &'s don't force the real ones into
1053  memory. */
1054  yy_state_t *yyss1 = yyss;
1055  YYSTYPE *yyvs1 = yyvs;
1056 
1057  /* Each stack pointer address is followed by the size of the
1058  data in use in that stack, in bytes. This used to be a
1059  conditional around just the two extra args, but that might
1060  be undefined if yyoverflow is a macro. */
1061  yyoverflow (YY_("memory exhausted"),
1062  &yyss1, yysize * YYSIZEOF (*yyssp),
1063  &yyvs1, yysize * YYSIZEOF (*yyvsp),
1064  &yystacksize);
1065  yyss = yyss1;
1066  yyvs = yyvs1;
1067  }
1068 # else /* defined YYSTACK_RELOCATE */
1069  /* Extend the stack our own way. */
1070  if (YYMAXDEPTH <= yystacksize)
1071  YYNOMEM;
1072  yystacksize *= 2;
1073  if (YYMAXDEPTH < yystacksize)
1074  yystacksize = YYMAXDEPTH;
1075 
1076  {
1077  yy_state_t *yyss1 = yyss;
1078  union yyalloc *yyptr =
1079  YY_CAST (union yyalloc *,
1080  YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1081  if (! yyptr)
1082  YYNOMEM;
1083  YYSTACK_RELOCATE (yyss_alloc, yyss);
1084  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1085 # undef YYSTACK_RELOCATE
1086  if (yyss1 != yyssa)
1087  YYSTACK_FREE (yyss1);
1088  }
1089 # endif
1090 
1091  yyssp = yyss + yysize - 1;
1092  yyvsp = yyvs + yysize - 1;
1093 
1095  YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1096  YY_CAST (long, yystacksize)));
1098 
1099  if (yyss + yystacksize - 1 <= yyssp)
1100  YYABORT;
1101  }
1102 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1103 
1104 
1105  if (yystate == YYFINAL)
1106  YYACCEPT;
1107 
1108  goto yybackup;
1109 
1110 
1111 /*-----------.
1112 | yybackup. |
1113 `-----------*/
1114 yybackup:
1115  /* Do appropriate processing given the current state. Read a
1116  lookahead token if we need one and don't already have one. */
1117 
1118  /* First try to decide what to do without reference to lookahead token. */
1119  yyn = yypact[yystate];
1120  if (yypact_value_is_default (yyn))
1121  goto yydefault;
1122 
1123  /* Not known => get a lookahead token if don't already have one. */
1124 
1125  /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1126  if (yychar == YYEMPTY)
1127  {
1128  YYDPRINTF ((stderr, "Reading a token\n"));
1129  yychar = yylex ();
1130  }
1131 
1132  if (yychar <= YYEOF)
1133  {
1134  yychar = YYEOF;
1135  yytoken = YYSYMBOL_YYEOF;
1136  YYDPRINTF ((stderr, "Now at end of input.\n"));
1137  }
1138  else if (yychar == YYerror)
1139  {
1140  /* The scanner already issued an error message, process directly
1141  to error recovery. But do not keep the error token as
1142  lookahead, it is too special and may lead us to an endless
1143  loop in error recovery. */
1144  yychar = YYUNDEF;
1145  yytoken = YYSYMBOL_YYerror;
1146  goto yyerrlab1;
1147  }
1148  else
1149  {
1150  yytoken = YYTRANSLATE (yychar);
1151  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1152  }
1153 
1154  /* If the proper action on seeing token YYTOKEN is to reduce or to
1155  detect an error, take that action. */
1156  yyn += yytoken;
1157  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1158  goto yydefault;
1159  yyn = yytable[yyn];
1160  if (yyn <= 0)
1161  {
1162  if (yytable_value_is_error (yyn))
1163  goto yyerrlab;
1164  yyn = -yyn;
1165  goto yyreduce;
1166  }
1167 
1168  /* Count tokens shifted since error; after three, turn off error
1169  status. */
1170  if (yyerrstatus)
1171  yyerrstatus--;
1172 
1173  /* Shift the lookahead token. */
1174  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1175  yystate = yyn;
1177  *++yyvsp = yylval;
1179 
1180  /* Discard the shifted token. */
1181  yychar = YYEMPTY;
1182  goto yynewstate;
1183 
1184 
1185 /*-----------------------------------------------------------.
1186 | yydefault -- do the default action for the current state. |
1187 `-----------------------------------------------------------*/
1188 yydefault:
1189  yyn = yydefact[yystate];
1190  if (yyn == 0)
1191  goto yyerrlab;
1192  goto yyreduce;
1193 
1194 
1195 /*-----------------------------.
1196 | yyreduce -- do a reduction. |
1197 `-----------------------------*/
1198 yyreduce:
1199  /* yyn is the number of a rule to reduce with. */
1200  yylen = yyr2[yyn];
1201 
1202  /* If YYLEN is nonzero, implement the default value of the action:
1203  '$$ = $1'.
1204 
1205  Otherwise, the following line sets YYVAL to garbage.
1206  This behavior is undocumented and Bison
1207  users should not rely upon it. Assigning to YYVAL
1208  unconditionally makes the parser a bit smaller, and it avoids a
1209  GCC warning that YYVAL may be used uninitialized. */
1210  yyval = yyvsp[1-yylen];
1211 
1212 
1213  YY_REDUCE_PRINT (yyn);
1214  switch (yyn)
1215  {
1216  case 2: /* rules: rules rule */
1217 #line 97 "readmakefile.y"
1218  { add_rule((yyvsp[0].rule)); }
1219 #line 1220 "y.tab.c"
1220  break;
1221 
1222  case 3: /* rules: %empty */
1223 #line 99 "readmakefile.y"
1224  {
1226  if (activated)
1229  }
1230 #line 1231 "y.tab.c"
1231  break;
1232 
1233  case 4: /* rule: phase deps */
1234 #line 108 "readmakefile.y"
1235  { rule_phase((yyvsp[0].rule)) = (yyvsp[-1].name); (yyval.rule) = (yyvsp[0].rule); }
1236 #line 1237 "y.tab.c"
1237  break;
1238 
1239  case 5: /* deps: deps dir virtuals */
1240 #line 112 "readmakefile.y"
1241  {
1242  if ((yyvsp[-1].tag) == REQUIRED) {
1243  rule_required((yyvsp[-2].rule)) =
1244  gen_nconc(rule_required((yyvsp[-2].rule)), (yyvsp[0].list));
1245  }
1246  else if ((yyvsp[-1].tag) == PRODUCED) {
1247  rule_produced((yyvsp[-2].rule)) =
1248  gen_nconc(rule_produced((yyvsp[-2].rule)), (yyvsp[0].list));
1249  }
1250  else if ((yyvsp[-1].tag) == PRESERVED) {
1251  rule_preserved((yyvsp[-2].rule)) =
1252  gen_nconc(rule_preserved((yyvsp[-2].rule)), (yyvsp[0].list));
1253  }
1254  else if ((yyvsp[-1].tag) == MODIFIED) {
1255  rule_modified((yyvsp[-2].rule)) =
1256  gen_nconc(rule_modified((yyvsp[-2].rule)), (yyvsp[0].list));
1257  }
1258  else if ((yyvsp[-1].tag) == PRE_TRANSFORMATION) {
1259  rule_pre_transformation((yyvsp[-2].rule)) =
1260  gen_nconc(rule_pre_transformation((yyvsp[-2].rule)), (yyvsp[0].list));
1261  }
1262  else if ((yyvsp[-1].tag) == POST_TRANSFORMATION) {
1263  rule_post_transformation((yyvsp[-2].rule)) =
1264  gen_nconc(rule_post_transformation((yyvsp[-2].rule)), (yyvsp[0].list));
1265  }
1266  else {
1267  pips_internal_error("unknown dir: %d", (yyvsp[-1].tag));
1268  }
1269  (yyval.rule) = (yyvsp[-2].rule);
1270  }
1271 #line 1272 "y.tab.c"
1272  break;
1273 
1274  case 6: /* deps: %empty */
1275 #line 143 "readmakefile.y"
1276  { (yyval.rule) = make_rule(string_undefined, NIL, NIL, NIL, NIL, NIL,NIL); }
1277 #line 1278 "y.tab.c"
1278  break;
1279 
1280  case 7: /* dir: REQUIRED */
1281 #line 147 "readmakefile.y"
1282  { (yyval.tag) = REQUIRED; }
1283 #line 1284 "y.tab.c"
1284  break;
1285 
1286  case 8: /* dir: PRODUCED */
1287 #line 149 "readmakefile.y"
1288  { (yyval.tag) = PRODUCED; }
1289 #line 1290 "y.tab.c"
1290  break;
1291 
1292  case 9: /* dir: MODIFIED */
1293 #line 151 "readmakefile.y"
1294  { (yyval.tag) = MODIFIED; }
1295 #line 1296 "y.tab.c"
1296  break;
1297 
1298  case 10: /* dir: PRESERVED */
1299 #line 153 "readmakefile.y"
1300  { (yyval.tag) = PRESERVED; }
1301 #line 1302 "y.tab.c"
1302  break;
1303 
1304  case 11: /* dir: PRE_TRANSFORMATION */
1305 #line 155 "readmakefile.y"
1306  { (yyval.tag) = PRE_TRANSFORMATION; }
1307 #line 1308 "y.tab.c"
1308  break;
1309 
1310  case 12: /* dir: POST_TRANSFORMATION */
1311 #line 157 "readmakefile.y"
1312  { (yyval.tag) = POST_TRANSFORMATION; }
1313 #line 1314 "y.tab.c"
1314  break;
1315 
1316  case 13: /* virtuals: virtuals virtual */
1317 #line 161 "readmakefile.y"
1318  { (yyval.list) = gen_nconc((yyvsp[-1].list), CONS(VIRTUAL_RESOURCE, (yyvsp[0].virtual), NIL)); }
1319 #line 1320 "y.tab.c"
1320  break;
1321 
1322  case 14: /* virtuals: %empty */
1323 #line 163 "readmakefile.y"
1324  { (yyval.list) = NIL; }
1325 #line 1326 "y.tab.c"
1326  break;
1327 
1328  case 15: /* virtual: owner DOT resource */
1329 #line 167 "readmakefile.y"
1330  { (yyval.virtual) = make_virtual_resource((yyvsp[0].name), (yyvsp[-2].owner)); }
1331 #line 1332 "y.tab.c"
1332  break;
1333 
1334  case 16: /* owner: PROGRAM */
1335 #line 171 "readmakefile.y"
1336  { (yyval.owner) = make_owner(is_owner_program, UU); }
1337 #line 1338 "y.tab.c"
1338  break;
1339 
1340  case 17: /* owner: MODULE */
1341 #line 173 "readmakefile.y"
1342  { (yyval.owner) = make_owner(is_owner_module, UU); }
1343 #line 1344 "y.tab.c"
1344  break;
1345 
1346  case 18: /* owner: MAIN */
1347 #line 175 "readmakefile.y"
1348  { (yyval.owner) = make_owner(is_owner_main, UU); }
1349 #line 1350 "y.tab.c"
1350  break;
1351 
1352  case 19: /* owner: COMMON */
1353 #line 177 "readmakefile.y"
1354  {
1355  /*$$ = make_owner(is_owner_common, UU);*/
1356  YYERROR;
1357  }
1358 #line 1359 "y.tab.c"
1359  break;
1360 
1361  case 20: /* owner: TK_CALLEES */
1362 #line 182 "readmakefile.y"
1363  { (yyval.owner) = make_owner(is_owner_callees, UU); }
1364 #line 1365 "y.tab.c"
1365  break;
1366 
1367  case 21: /* owner: CALLERS */
1368 #line 184 "readmakefile.y"
1369  { (yyval.owner) = make_owner(is_owner_callers, UU); }
1370 #line 1371 "y.tab.c"
1371  break;
1372 
1373  case 22: /* owner: ALL */
1374 #line 186 "readmakefile.y"
1375  { (yyval.owner) = make_owner(is_owner_all, UU); }
1376 #line 1377 "y.tab.c"
1377  break;
1378 
1379  case 23: /* owner: SELECT */
1380 #line 188 "readmakefile.y"
1381  { (yyval.owner) = make_owner(is_owner_select, UU); }
1382 #line 1383 "y.tab.c"
1383  break;
1384 
1385  case 24: /* owner: COMPILATION_UNIT */
1386 #line 190 "readmakefile.y"
1387  { (yyval.owner) = make_owner(is_owner_compilation_unit, UU); }
1388 #line 1389 "y.tab.c"
1389  break;
1390 
1391  case 25: /* phase: NAME */
1392 #line 194 "readmakefile.y"
1393  { (yyval.name) = strupper((yyvsp[0].name), (yyvsp[0].name)); }
1394 #line 1395 "y.tab.c"
1395  break;
1396 
1397  case 26: /* resource: NAME */
1398 #line 198 "readmakefile.y"
1399  { (yyval.name) = strupper((yyvsp[0].name), (yyvsp[0].name)); }
1400 #line 1401 "y.tab.c"
1401  break;
1402 
1403 
1404 #line 1405 "y.tab.c"
1405 
1406  default: break;
1407  }
1408  /* User semantic actions sometimes alter yychar, and that requires
1409  that yytoken be updated with the new translation. We take the
1410  approach of translating immediately before every use of yytoken.
1411  One alternative is translating here after every semantic action,
1412  but that translation would be missed if the semantic action invokes
1413  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1414  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1415  incorrect destructor might then be invoked immediately. In the
1416  case of YYERROR or YYBACKUP, subsequent parser actions might lead
1417  to an incorrect destructor call or verbose syntax error message
1418  before the lookahead is translated. */
1419  YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1420 
1421  YYPOPSTACK (yylen);
1422  yylen = 0;
1423 
1424  *++yyvsp = yyval;
1425 
1426  /* Now 'shift' the result of the reduction. Determine what state
1427  that goes to, based on the state we popped back to and the rule
1428  number reduced by. */
1429  {
1430  const int yylhs = yyr1[yyn] - YYNTOKENS;
1431  const int yyi = yypgoto[yylhs] + *yyssp;
1432  yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1433  ? yytable[yyi]
1434  : yydefgoto[yylhs]);
1435  }
1436 
1437  goto yynewstate;
1438 
1439 
1440 /*--------------------------------------.
1441 | yyerrlab -- here on detecting error. |
1442 `--------------------------------------*/
1443 yyerrlab:
1444  /* Make sure we have latest lookahead translation. See comments at
1445  user semantic actions for why this is necessary. */
1446  yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1447  /* If not already recovering from an error, report this error. */
1448  if (!yyerrstatus)
1449  {
1450  ++yynerrs;
1451  yyerror (YY_("syntax error"));
1452  }
1453 
1454  if (yyerrstatus == 3)
1455  {
1456  /* If just tried and failed to reuse lookahead token after an
1457  error, discard it. */
1458 
1459  if (yychar <= YYEOF)
1460  {
1461  /* Return failure if at end of input. */
1462  if (yychar == YYEOF)
1463  YYABORT;
1464  }
1465  else
1466  {
1467  yydestruct ("Error: discarding",
1468  yytoken, &yylval);
1469  yychar = YYEMPTY;
1470  }
1471  }
1472 
1473  /* Else will try to reuse lookahead token after shifting the error
1474  token. */
1475  goto yyerrlab1;
1476 
1477 
1478 /*---------------------------------------------------.
1479 | yyerrorlab -- error raised explicitly by YYERROR. |
1480 `---------------------------------------------------*/
1481 yyerrorlab:
1482  /* Pacify compilers when the user code never invokes YYERROR and the
1483  label yyerrorlab therefore never appears in user code. */
1484  if (0)
1485  YYERROR;
1486  ++yynerrs;
1487 
1488  /* Do not reclaim the symbols of the rule whose action triggered
1489  this YYERROR. */
1490  YYPOPSTACK (yylen);
1491  yylen = 0;
1492  YY_STACK_PRINT (yyss, yyssp);
1493  yystate = *yyssp;
1494  goto yyerrlab1;
1495 
1496 
1497 /*-------------------------------------------------------------.
1498 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1499 `-------------------------------------------------------------*/
1500 yyerrlab1:
1501  yyerrstatus = 3; /* Each real token shifted decrements this. */
1502 
1503  /* Pop stack until we find a state that shifts the error token. */
1504  for (;;)
1505  {
1506  yyn = yypact[yystate];
1507  if (!yypact_value_is_default (yyn))
1508  {
1509  yyn += YYSYMBOL_YYerror;
1510  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1511  {
1512  yyn = yytable[yyn];
1513  if (0 < yyn)
1514  break;
1515  }
1516  }
1517 
1518  /* Pop the current state because it cannot handle the error token. */
1519  if (yyssp == yyss)
1520  YYABORT;
1521 
1522 
1523  yydestruct ("Error: popping",
1524  YY_ACCESSING_SYMBOL (yystate), yyvsp);
1525  YYPOPSTACK (1);
1526  yystate = *yyssp;
1527  YY_STACK_PRINT (yyss, yyssp);
1528  }
1529 
1531  *++yyvsp = yylval;
1533 
1534 
1535  /* Shift the error token. */
1536  YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1537 
1538  yystate = yyn;
1539  goto yynewstate;
1540 
1541 
1542 /*-------------------------------------.
1543 | yyacceptlab -- YYACCEPT comes here. |
1544 `-------------------------------------*/
1545 yyacceptlab:
1546  yyresult = 0;
1547  goto yyreturnlab;
1548 
1549 
1550 /*-----------------------------------.
1551 | yyabortlab -- YYABORT comes here. |
1552 `-----------------------------------*/
1553 yyabortlab:
1554  yyresult = 1;
1555  goto yyreturnlab;
1556 
1557 
1558 /*-----------------------------------------------------------.
1559 | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
1560 `-----------------------------------------------------------*/
1561 yyexhaustedlab:
1562  yyerror (YY_("memory exhausted"));
1563  yyresult = 2;
1564  goto yyreturnlab;
1565 
1566 
1567 /*----------------------------------------------------------.
1568 | yyreturnlab -- parsing is finished, clean up and return. |
1569 `----------------------------------------------------------*/
1570 yyreturnlab:
1571  if (yychar != YYEMPTY)
1572  {
1573  /* Make sure we have latest lookahead translation. See comments at
1574  user semantic actions for why this is necessary. */
1575  yytoken = YYTRANSLATE (yychar);
1576  yydestruct ("Cleanup: discarding lookahead",
1577  yytoken, &yylval);
1578  }
1579  /* Do not reclaim the symbols of the rule whose action triggered
1580  this YYABORT or YYACCEPT. */
1581  YYPOPSTACK (yylen);
1582  YY_STACK_PRINT (yyss, yyssp);
1583  while (yyssp != yyss)
1584  {
1585  yydestruct ("Cleanup: popping",
1586  YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
1587  YYPOPSTACK (1);
1588  }
1589 #ifndef yyoverflow
1590  if (yyss != yyssa)
1591  YYSTACK_FREE (yyss);
1592 #endif
1593 
1594  return yyresult;
1595 }
1596 
1597 #line 200 "readmakefile.y"
1598 
1599 
1600 void yyerror_lex_part(const char *);
1601 void yyerror(const char * s)
1602 {
1603  int c;
1604  yyerror_lex_part(s);
1605  fprintf(stderr, "[readmakefile] unparsed text:\n");
1606  while ((c = getc(pipsmake_in)) != EOF) putc(c, stderr);
1607  pips_internal_error("reading pips makefile failed");
1608 }
1609 
1610 void
1611 fprint_virtual_resources(FILE *fd, const char* dir, list lrv)
1612 {
1613  FOREACH(VIRTUAL_RESOURCE, vr, lrv)
1614  {
1615  owner o = virtual_resource_owner(vr);
1616  string n = virtual_resource_name(vr);
1617 
1618  switch (owner_tag(o)) {
1619  case is_owner_program:
1620  fprintf(fd, " %s program.%s\n", dir, n);
1621  break;
1622  case is_owner_module:
1623  fprintf(fd, " %s module.%s\n", dir, n);
1624  break;
1625  case is_owner_main:
1626  fprintf(fd, " %s main.%s\n", dir, n);
1627  break;
1628  case is_owner_callees:
1629  fprintf(fd, " %s callees.%s\n", dir, n);
1630  break;
1631  case is_owner_callers:
1632  fprintf(fd, " %s callers.%s\n", dir, n);
1633  break;
1634  case is_owner_all:
1635  fprintf(fd, " %s all.%s\n", dir, n);
1636  break;
1637  case is_owner_select:
1638  fprintf(fd, " %s select.%s\n", dir, n);
1639  break;
1641  fprintf(fd, " %s compilation_unit.%s\n", dir, n);
1642  break;
1643  default:
1644  pips_internal_error("bad owner tag (%d)\n", owner_tag(o));
1645  }
1646  }
1647 }
1648 
1649 void fprint_makefile(FILE *fd, makefile m)
1650 {
1651  FOREACH(RULE, r, makefile_rules(m))
1652  {
1653  fprintf(fd, "%s\n", rule_phase(r));
1655  fprint_virtual_resources(fd, "\t<", rule_required(r));
1656  fprint_virtual_resources(fd, "\t>", rule_produced(r));
1658  fprint_virtual_resources(fd, "\t#", rule_modified(r));
1659  }
1660 }
1661 
1662 makefile
1664 {
1665  // do it only once
1667  {
1668  debug_on("PIPSMAKE_DEBUG_LEVEL");
1669 
1670  pipsmake_in = fopen_config(PIPSMAKE_RC, NULL, "PIPS_PIPSMAKERC");
1671 
1672  init_lex();
1673  yyparse();
1674  safe_fclose(pipsmake_in, "PIPS_PIPSMAKERC");
1675 
1676  ifdebug(8) fprint_makefile(stderr, pipsmakefile);
1677 
1678  debug_off();
1679  }
1680 
1681  return pipsmakefile;
1682 }
1683 
1684 
1685 /* this function returns the rule that defines builder pname */
1686 rule find_rule_by_phase(const char* pname)
1687 {
1688  rule fr = rule_undefined;
1689  makefile m = parse_makefile();
1690 
1691  pips_debug(9, "searching rule for phase %s\n", pname);
1692 
1693  /* walking thru rules */
1694  FOREACH(RULE, r, makefile_rules(m)) {
1695  if (same_string_p(rule_phase(r), pname)) {
1696  fr = r;
1697  break;
1698  }
1699  }
1700 
1701  return fr;
1702 }
1703 
1705 {
1706  string pn = rule_phase(r);
1707  bool active_phase = false;
1708 
1709  // Check resources produced by this rule
1711  string vrn = virtual_resource_name(vr);
1712  string phase;
1713 
1714  // We activated this rule to produce this resource only if
1715  // this resource is not already produced
1716  if ((phase = hash_get(activated, vrn)) == HASH_UNDEFINED_VALUE) {
1717  pips_debug(1, "Default function for %s is %s\n", vrn, pn);
1718 
1719  active_phase = true;
1720  hash_put(activated, vrn, pn);
1721 
1724  }
1725  else pips_debug(1, "Function %s not activated\n", pn);
1726  }
1727 
1728  // Check resources required for this rule if it is an active one
1729  if (active_phase) {
1731  string vrn = virtual_resource_name(vr);
1732  owner vro = virtual_resource_owner(vr);
1733  string phase;
1734 
1735  // We must use a resource already defined
1736  if ( owner_callers_p(vro) || owner_callees_p(vro) ) {}
1737  else {
1738  phase = hash_get(activated, vrn);
1739  if (phase == HASH_UNDEFINED_VALUE)
1740  {
1741  if (get_bool_property("PIPSMAKE_WARNINGS"))
1743  "%s: phase %s requires an undefined resource %s\n",
1744  PIPSMAKE_RC, pn, vrn);
1745  }
1746  // If we use a resource, another function should have produced it
1747  else if (strcmp(phase, pn) == 0) {
1749  "%s: phase %s cannot be active for the %s resource\n",
1750  PIPSMAKE_RC, phase, vrn);
1751  }
1752  else
1753  pips_debug(1, "Required resource %s is checked OK for Function %s\n",
1754  vrn, pn);
1755  }
1756  }
1757  }
1758 
1759  // FI: no check of rule name unicity; e.g. double declaration of sesamify
1761  if(rule_undefined_p(or))
1763  CONS(RULE, r, NIL));
1764  else
1765  pips_internal_error("Double declaration of phase \"%s\"\n"
1766  "Check pipsmake-rc.tex or pipsmake.rc\n",
1767  rule_phase(r));
1768 }
1769 
1770 makefile open_makefile(const char* name)
1771 {
1772  FILE * fd;
1773  char * mkf_name;
1774 
1775  mkf_name = build_pgm_makefile(name);
1776  fd = fopen(mkf_name, "r");
1777 
1779  {
1782  pips_debug(1, "current makefile erased\n");
1783  }
1784 
1785  if (fd)
1786  {
1788  safe_fclose(fd, mkf_name);
1789  }
1790  else
1791  {
1792  pips_user_warning("pipsmake file not found in database...\n");
1794  }
1795 
1796  free(mkf_name);
1797  return pipsmakefile;
1798 }
1799 
1800 void
1801 save_makefile(const char* name)
1802 {
1803  char * mkf_name = build_pgm_makefile(name);
1804  FILE * fd = safe_fopen(mkf_name, "w");
1806  safe_fclose(fd, mkf_name);
1807  pips_debug(1, "makefile written on %s\n", mkf_name);
1808  free(mkf_name);
1809 }
1810 
1811 bool
1812 close_makefile(const char* name)
1813 {
1814  save_makefile(name);
1816  return true;
1817 }
owner make_owner(enum owner_utype tag, void *val)
Definition: makefile.c:107
makefile read_makefile(FILE *f)
Definition: makefile.c:49
rule make_rule(string a1, list a2, list a3, list a4, list a5, list a6, list a7)
Definition: makefile.c:215
void write_makefile(FILE *f, makefile p)
Definition: makefile.c:46
virtual_resource make_virtual_resource(string a1, owner a2)
Definition: makefile.c:257
makefile make_makefile(list a1, list a2)
Definition: makefile.c:52
void free_makefile(makefile p)
Definition: makefile.c:19
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
FILE * safe_fopen(const char *filename, const char *what)
Definition: file.c:67
int safe_fclose(FILE *stream, const char *filename)
Definition: file.c:77
FILE * fopen_config(const char *canonical_name, const char *cproperty, const char *cenv)
Definition: file.c:952
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define STRING(x)
Definition: genC.h:87
yytokentype
Definition: genread.h:52
yysymbol_kind_t
!YY_GENREAD_Y_TAB_H_INCLUDED
Definition: genread_yacc.c:294
unsigned char yytype_uint8
Work around bug in HP-UX 11.23, which defines these macros incorrectly for preprocessor constants.
Definition: genread_yacc.c:399
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 NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
Definition: newgen_list.h:179
hash_table hash_table_make(hash_key_type key_type, size_t size)
Definition: hash.c:294
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
Definition: hash.c:449
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
Definition: hash.c:364
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
Definition: hash.c:327
#define rule_modified(x)
Definition: makefile.h:252
#define makefile_undefined
Definition: makefile.h:58
#define rule_post_transformation(x)
Definition: makefile.h:256
#define rule_phase(x)
Definition: makefile.h:244
#define RULE(x)
RULE.
Definition: makefile.h:209
#define virtual_resource_owner(x)
Definition: makefile.h:292
#define rule_pre_transformation(x)
Definition: makefile.h:254
#define owner_tag(x)
Definition: makefile.h:145
#define rule_required(x)
Definition: makefile.h:246
#define owner_callers_p(x)
Definition: makefile.h:158
#define rule_undefined
Definition: makefile.h:215
#define rule_preserved(x)
Definition: makefile.h:250
#define virtual_resource_name(x)
Definition: makefile.h:290
#define makefile_active_phases(x)
Definition: makefile.h:84
#define rule_undefined_p(x)
Definition: makefile.h:216
@ is_owner_main
Definition: makefile.h:111
@ is_owner_callees
Definition: makefile.h:112
@ is_owner_select
Definition: makefile.h:115
@ is_owner_compilation_unit
Definition: makefile.h:116
@ is_owner_module
Definition: makefile.h:110
@ is_owner_callers
Definition: makefile.h:113
@ is_owner_all
Definition: makefile.h:114
@ is_owner_program
Definition: makefile.h:109
#define rule_produced(x)
Definition: makefile.h:248
#define owner_callees_p(x)
Definition: makefile.h:155
#define VIRTUAL_RESOURCE(x)
VIRTUAL_RESOURCE.
Definition: makefile.h:260
#define makefile_rules(x)
Definition: makefile.h:82
#define makefile_undefined_p(x)
Definition: makefile.h:59
#define debug_on(env)
Definition: misc-local.h:157
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
#define pips_user_warning
Definition: misc-local.h:146
#define pips_internal_error
Definition: misc-local.h:149
#define debug_off()
Definition: misc-local.h:160
string strupper(string, const char *)
Definition: string.c:213
@ hash_string
Definition: newgen_hash.h:32
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
Definition: newgen_hash.h:56
#define same_string_p(s1, s2)
int tag
TAG.
Definition: newgen_types.h:92
#define string_undefined
Definition: newgen_types.h:40
#define UU
Definition: newgen_types.h:98
string build_pgm_makefile(const char *__attribute__((unused)) n)
Definition: openclose.c:63
FILE * pipsmake_in
Definition: pipsmake.h:142
int init_lex(void)
YYSTYPE pipsmake_lval
#define yyparse
------—.
Definition: readmakefile.c:68
#define CALLERS
Definition: readmakefile.c:177
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: readmakefile.c:428
#define YYMAXDEPTH
YYMAXDEPTH – maximum size the stacks can grow to (effective only if the built-in stack extension meth...
Definition: readmakefile.c:932
#define MODIFIED
Definition: readmakefile.c:183
#define YYSTACK_FREE
Definition: readmakefile.c:490
static const yytype_int8 yytranslate[]
YYTRANSLATE[TOKEN-NUM] – Symbol number corresponding to TOKEN-NUM as returned by yylex.
Definition: readmakefile.c:604
#define ALL
Definition: readmakefile.c:178
yysymbol_kind_t
!YY_PIPSMAKE_Y_TAB_H_INCLUDED
Definition: readmakefile.c:221
@ YYSYMBOL_MODIFIED
PRODUCED
Definition: readmakefile.c:237
@ YYSYMBOL_YYUNDEF
error
Definition: readmakefile.c:225
@ YYSYMBOL_phase
owner
Definition: readmakefile.c:251
@ YYSYMBOL_CALLERS
TK_CALLEES
Definition: readmakefile.c:231
@ YYSYMBOL_PRE_TRANSFORMATION
PRESERVED
Definition: readmakefile.c:239
@ YYSYMBOL_YYerror
"end of file"
Definition: readmakefile.c:224
@ YYSYMBOL_COMMON
MAIN
Definition: readmakefile.c:229
@ YYSYMBOL_virtuals
dir
Definition: readmakefile.c:248
@ YYSYMBOL_REQUIRED
COMPILATION_UNIT
Definition: readmakefile.c:235
@ YYSYMBOL_dir
deps
Definition: readmakefile.c:247
@ YYSYMBOL_TK_CALLEES
COMMON
Definition: readmakefile.c:230
@ YYSYMBOL_ALL
CALLERS
Definition: readmakefile.c:232
@ YYSYMBOL_MAIN
MODULE
Definition: readmakefile.c:228
@ YYSYMBOL_POST_TRANSFORMATION
PRE_TRANSFORMATION
Definition: readmakefile.c:240
@ YYSYMBOL_MODULE
PROGRAM
Definition: readmakefile.c:227
@ YYSYMBOL_deps
rule
Definition: readmakefile.c:246
@ YYSYMBOL_SELECT
ALL
Definition: readmakefile.c:233
@ YYSYMBOL_DOT
POST_TRANSFORMATION
Definition: readmakefile.c:241
@ YYSYMBOL_resource
phase
Definition: readmakefile.c:252
@ YYSYMBOL_PROGRAM
"invalid token"
Definition: readmakefile.c:226
@ YYSYMBOL_PRESERVED
MODIFIED
Definition: readmakefile.c:238
@ YYSYMBOL_YYACCEPT
NAME
Definition: readmakefile.c:243
@ YYSYMBOL_owner
virtual
Definition: readmakefile.c:250
@ YYSYMBOL_virtual
virtuals
Definition: readmakefile.c:249
@ YYSYMBOL_YYEOF
Definition: readmakefile.c:223
@ YYSYMBOL_YYEMPTY
Definition: readmakefile.c:222
@ YYSYMBOL_PRODUCED
REQUIRED
Definition: readmakefile.c:236
@ YYSYMBOL_rule
rules
Definition: readmakefile.c:245
@ YYSYMBOL_rules
$accept
Definition: readmakefile.c:244
@ YYSYMBOL_NAME
DOT
Definition: readmakefile.c:242
@ YYSYMBOL_COMPILATION_UNIT
SELECT
Definition: readmakefile.c:234
#define YY_ASSERT(E)
Definition: readmakefile.c:448
#define YY_(Msgid)
Definition: readmakefile.c:382
void fprint_makefile(FILE *fd, makefile m)
static hash_table activated
Definition: readmakefile.c:101
#define YYNOMEM
Definition: readmakefile.c:765
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: readmakefile.c:429
static const yytype_int8 yydefact[]
YYDEFACT[STATE-NUM] – Default reduction number in state STATE-NUM.
Definition: readmakefile.c:695
#define YYNSTATES
YYNSTATES – Number of states.
Definition: readmakefile.c:589
#define MODULE
Definition: readmakefile.c:173
#define YY_IGNORE_USELESS_CAST_END
Definition: readmakefile.c:444
#define TK_CALLEES
Definition: readmakefile.c:176
short yytype_int16
Definition: readmakefile.c:293
#define yychar
Definition: readmakefile.c:74
#define MAIN
Definition: readmakefile.c:174
#define YYEOF
Definition: readmakefile.c:169
#define YYABORT
Definition: readmakefile.c:763
#define PRESERVED
Definition: readmakefile.c:184
#define YYSTACK_BYTES(N)
The size of an array large to enough to hold all stacks, each with N elements.
Definition: readmakefile.c:533
static const yytype_int8 yycheck[]
Definition: readmakefile.c:724
#define NAME
Definition: readmakefile.c:188
#define YY_REDUCE_PRINT(Rule)
Definition: readmakefile.c:915
#define YY_CAST(Type, Val)
Definition: readmakefile.c:110
static void yydestruct(const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
-------------------------------------------—.
Definition: readmakefile.c:945
#define COMMON
Definition: readmakefile.c:175
#define REQUIRED
Definition: readmakefile.c:181
#define SELECT
Definition: readmakefile.c:179
#define yylex
Definition: readmakefile.c:69
#define YYerror
Definition: readmakefile.c:170
#define YY_NULLPTR
Definition: readmakefile.c:122
#define YYUNDEF
Definition: readmakefile.c:171
static const yytype_int8 yypact[]
YYPACT[STATE-NUM] – Index in YYTABLE of the portion describing STATE-NUM.
Definition: readmakefile.c:685
void save_makefile(const char *name)
void * malloc(YYSIZE_T)
#define YYFINAL
!YYCOPY_NEEDED
Definition: readmakefile.c:578
#define YY_ACCESSING_SYMBOL(State)
Accessing symbol of state STATE.
Definition: readmakefile.c:647
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
Definition: readmakefile.c:913
#define PRE_TRANSFORMATION
Definition: readmakefile.c:185
#define yylval
Definition: readmakefile.c:73
#define YYNTOKENS
YYNTOKENS – Number of terminals.
Definition: readmakefile.c:583
void add_rule(rule r)
unsigned char yytype_uint8
Work around bug in HP-UX 11.23, which defines these macros incorrectly for preprocessor constants.
Definition: readmakefile.c:314
#define YY_STACK_PRINT(Bottom, Top)
Definition: readmakefile.c:914
#define YYSIZE_T
Definition: readmakefile.c:355
#define yydebug
Definition: readmakefile.c:71
@ YYENOMEM
Definition: readmakefile.c:757
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition: readmakefile.c:443
static const yytype_int8 yyr2[]
YYR2[RULE-NUM] – Number of symbols on the right-hand side of rule RULE-NUM.
Definition: readmakefile.c:749
#define DOT
Definition: readmakefile.c:187
void fprint_virtual_resources(FILE *fd, const char *dir, list lrv)
static const yytype_int8 yytable[]
YYTABLE[YYPACT[STATE-NUM]] – What to do in state STATE-NUM.
Definition: readmakefile.c:717
#define PROGRAM
Definition: readmakefile.c:172
#define YYPTRDIFF_T
Definition: readmakefile.c:341
#define COMPILATION_UNIT
Definition: readmakefile.c:180
#define yynerrs
Definition: readmakefile.c:72
void yyerror_lex_part(const char *)
rule find_rule_by_phase(const char *pname)
this function returns the rule that defines builder pname
#define YYACCEPT
Definition: readmakefile.c:762
#define yytable_value_is_error(Yyn)
Definition: readmakefile.c:680
#define YYTRANSLATE(YYX)
YYTRANSLATE(TOKEN-NUM) – Symbol number corresponding to TOKEN-NUM as returned by yylex,...
Definition: readmakefile.c:597
static const yytype_int8 yystos[]
YYSTOS[STATE-NUM] – The symbol kind of the accessing symbol of state STATE-NUM.
Definition: readmakefile.c:733
static makefile pipsmakefile
First part of user prologue.
Definition: readmakefile.c:100
#define PRODUCED
Definition: readmakefile.c:182
#define YY_ATTRIBUTE_UNUSED
Definition: readmakefile.c:399
int pipsmake_parse(void)
static const yytype_int8 yypgoto[]
YYPGOTO[NTERM-NUM].
Definition: readmakefile.c:703
static const yytype_int8 yyr1[]
YYR1[RULE-NUM] – Symbol kind of the left-hand side of rule RULE-NUM.
Definition: readmakefile.c:741
makefile open_makefile(const char *name)
enum yytokentype yytoken_kind_t
Definition: readmakefile.c:165
#define YYPOPSTACK(N)
int yy_state_fast_t
State numbers in computations.
Definition: readmakefile.c:372
unsigned short yytype_uint16
Definition: readmakefile.c:325
static const yytype_int8 yydefgoto[]
YYDEFGOTO[NTERM-NUM].
Definition: readmakefile.c:709
#define YYEMPTY
Token kinds.
Definition: readmakefile.c:168
#define YYLAST
YYLAST – Last index in YYTABLE.
Definition: readmakefile.c:580
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Relocate STACK from its old location to the new one.
Definition: readmakefile.c:544
#define yypact_value_is_default(Yyn)
Definition: readmakefile.c:675
#define YYINITDEPTH
!YYDEBUG
Definition: readmakefile.c:921
signed char yytype_int8
On compilers that do not define PTRDIFF_MAX etc., make sure <limits.h> and (if available) <stdint....
Definition: readmakefile.c:285
void free(void *)
#define YYERROR
Definition: readmakefile.c:764
#define YYSIZEOF(X)
Definition: readmakefile.c:365
makefile parse_makefile(void)
#define YYSTACK_ALLOC
The parser invokes alloca or malloc; define the necessary symbols.
Definition: readmakefile.c:489
yytype_int8 yy_state_t
Stored state numbers (used for stacks).
Definition: readmakefile.c:369
#define YYDPRINTF(Args)
Enable debugging if requested.
Definition: readmakefile.c:912
bool close_makefile(const char *name)
#define POST_TRANSFORMATION
Definition: readmakefile.c:186
#define YY_USE(E)
Suppress unused-variable warnings by "using" E.
Definition: readmakefile.c:405
#define yyerror
Definition: readmakefile.c:70
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
char * strdup()
#define ifdebug(n)
Definition: sg.c:47
#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
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
Value type.
Definition: genread.h:115
string name
Definition: readmakefile.c:196
rule rule
Definition: readmakefile.c:200
cons * list
Definition: readmakefile.c:199
virtual_resource virtual
Definition: readmakefile.c:198
owner owner
Definition: readmakefile.c:197
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