Initial commit.
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / cmDependsFortranParser.cxx
blob39a1c2d4b9076acf5bfafa9008bc8cf8feee0204
1 /* A Bison parser, made by GNU Bison 2.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
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 2, or (at your option)
11 any later version.
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.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
47 #define YYBISON 1
49 /* Bison version. */
50 #define YYBISON_VERSION "2.3"
52 /* Skeleton name. */
53 #define YYSKELETON_NAME "yacc.c"
55 /* Pure parsers. */
56 #define YYPURE 1
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
61 /* Substitute the variable and function names. */
62 #define yyparse cmDependsFortran_yyparse
63 #define yylex cmDependsFortran_yylex
64 #define yyerror cmDependsFortran_yyerror
65 #define yylval cmDependsFortran_yylval
66 #define yychar cmDependsFortran_yychar
67 #define yydebug cmDependsFortran_yydebug
68 #define yynerrs cmDependsFortran_yynerrs
71 /* Tokens. */
72 #ifndef YYTOKENTYPE
73 # define YYTOKENTYPE
74 /* Put the tokens into the symbol table, so that GDB and other debuggers
75 know about them. */
76 enum yytokentype {
77 EOSTMT = 258,
78 ASSIGNMENT_OP = 259,
79 GARBAGE = 260,
80 CPP_INCLUDE = 261,
81 F90PPR_INCLUDE = 262,
82 COCO_INCLUDE = 263,
83 F90PPR_DEFINE = 264,
84 CPP_DEFINE = 265,
85 F90PPR_UNDEF = 266,
86 CPP_UNDEF = 267,
87 CPP_IFDEF = 268,
88 CPP_IFNDEF = 269,
89 CPP_IF = 270,
90 CPP_ELSE = 271,
91 CPP_ELIF = 272,
92 CPP_ENDIF = 273,
93 F90PPR_IFDEF = 274,
94 F90PPR_IFNDEF = 275,
95 F90PPR_IF = 276,
96 F90PPR_ELSE = 277,
97 F90PPR_ELIF = 278,
98 F90PPR_ENDIF = 279,
99 CPP_TOENDL = 280,
100 UNTERMINATED_STRING = 281,
101 STRING = 282,
102 WORD = 283
104 #endif
105 /* Tokens. */
106 #define EOSTMT 258
107 #define ASSIGNMENT_OP 259
108 #define GARBAGE 260
109 #define CPP_INCLUDE 261
110 #define F90PPR_INCLUDE 262
111 #define COCO_INCLUDE 263
112 #define F90PPR_DEFINE 264
113 #define CPP_DEFINE 265
114 #define F90PPR_UNDEF 266
115 #define CPP_UNDEF 267
116 #define CPP_IFDEF 268
117 #define CPP_IFNDEF 269
118 #define CPP_IF 270
119 #define CPP_ELSE 271
120 #define CPP_ELIF 272
121 #define CPP_ENDIF 273
122 #define F90PPR_IFDEF 274
123 #define F90PPR_IFNDEF 275
124 #define F90PPR_IF 276
125 #define F90PPR_ELSE 277
126 #define F90PPR_ELIF 278
127 #define F90PPR_ENDIF 279
128 #define CPP_TOENDL 280
129 #define UNTERMINATED_STRING 281
130 #define STRING 282
131 #define WORD 283
136 /* Copy the first part of user declarations. */
137 #line 1 "cmDependsFortranParser.y"
139 /*=========================================================================
141 Program: CMake - Cross-Platform Makefile Generator
142 Module: $RCSfile: cmDependsFortranParser.cxx,v $
143 Language: C++
144 Date: $Date: 2008/01/08 04:08:42 $
145 Version: $Revision: 1.16 $
147 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
148 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
150 This software is distributed WITHOUT ANY WARRANTY; without even
151 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
152 PURPOSE. See the above copyright notices for more information.
154 =========================================================================*/
155 /*-------------------------------------------------------------------------
156 Portions of this source have been derived from makefdep90 version 2.6.2,
158 Copyright (C) 2000,2001 Erik Edelmann <eedelman@beam.helsinki.fi>.
160 The code was originally distributed under the GPL but permission
161 from the copyright holder has been obtained to distribute this
162 derived work under the CMake license.
163 -------------------------------------------------------------------------*/
167 This file must be translated to C and modified to build everywhere.
169 Run bison like this:
171 bison --yacc --name-prefix=cmDependsFortran_yy
172 --defines=cmDependsFortranParserTokens.h
173 -ocmDependsFortranParser.cxx
174 cmDependsFortranParser.y
176 Modify cmDependsFortranParser.cxx:
177 - remove TABs
178 - Remove the yyerrorlab block in range ["goto yyerrlab1", "yyerrlab1:"]
181 /*-------------------------------------------------------------------------*/
182 #define cmDependsFortranParser_cxx
183 #include "cmDependsFortranParser.h" /* Interface to parser object. */
184 #include "cmDependsFortranParserTokens.h" /* Need YYSTYPE for YY_DECL. */
186 /* Configure the parser to use a lexer object. */
187 #define YYPARSE_PARAM yyscanner
188 #define YYLEX_PARAM yyscanner
189 #define YYERROR_VERBOSE 1
190 #define cmDependsFortran_yyerror(x) \
191 cmDependsFortranError(yyscanner, x)
193 /* Forward declare the lexer entry point. */
194 YY_DECL;
196 /* Helper function to forward error callback. */
197 static void cmDependsFortranError(yyscan_t yyscanner, const char* message)
199 cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
200 cmDependsFortranParser_Error(parser, message);
203 static char charmap[] = {
204 '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
205 '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
206 '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
207 '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037',
208 '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047',
209 '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057',
210 '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067',
211 '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077',
212 '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
213 '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
214 '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
215 '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137',
216 '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
217 '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
218 '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
219 '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177',
220 '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
221 '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217',
222 '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
223 '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
224 '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247',
225 '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
226 '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
227 '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
228 '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
229 '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317',
230 '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
231 '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337',
232 '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
233 '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
234 '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
235 '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377'
238 inline int strcasecmpCM(const char *s1, const char *s2)
240 const char *cm = charmap;
241 const char* us1 = s1;
242 const char* us2 = s2;
244 while(cm[*us1] == cm[*us2++])
245 if(*us1++ == '\0')
247 return(0);
249 return(cm[*us1] - cm[*--us2]);
252 static bool cmDependsFortranParserIsKeyword(const char* word,
253 const char* keyword)
255 return strcasecmpCM(word, keyword) == 0;
258 /* Disable some warnings in the generated code. */
259 #ifdef __BORLANDC__
260 # pragma warn -8004 /* Variable assigned a value that is not used. */
261 # pragma warn -8008 /* condition always returns true */
262 # pragma warn -8060 /* possibly incorrect assignment */
263 # pragma warn -8066 /* unreachable code */
264 #endif
265 #ifdef _MSC_VER
266 # pragma warning (disable: 4102) /* Unused goto label. */
267 # pragma warning (disable: 4065) /* Switch contains default but no case. */
268 # pragma warning (disable: 4701) /* Local variable may not be initialized. */
269 # pragma warning (disable: 4702) /* Unreachable code. */
270 # pragma warning (disable: 4127) /* Conditional expression is constant. */
271 # pragma warning (disable: 4244) /* Conversion to smaller type, data loss. */
272 #endif
275 /* Enabling traces. */
276 #ifndef YYDEBUG
277 # define YYDEBUG 0
278 #endif
280 /* Enabling verbose error messages. */
281 #ifdef YYERROR_VERBOSE
282 # undef YYERROR_VERBOSE
283 # define YYERROR_VERBOSE 1
284 #else
285 # define YYERROR_VERBOSE 0
286 #endif
288 /* Enabling the token table. */
289 #ifndef YYTOKEN_TABLE
290 # define YYTOKEN_TABLE 0
291 #endif
293 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
294 typedef union YYSTYPE
295 #line 141 "cmDependsFortranParser.y"
297 char* string;
299 /* Line 187 of yacc.c. */
300 #line 301 "cmDependsFortranParser.cxx"
301 YYSTYPE;
302 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
303 # define YYSTYPE_IS_DECLARED 1
304 # define YYSTYPE_IS_TRIVIAL 1
305 #endif
309 /* Copy the second part of user declarations. */
312 /* Line 216 of yacc.c. */
313 #line 314 "cmDependsFortranParser.cxx"
315 #ifdef short
316 # undef short
317 #endif
319 #ifdef YYTYPE_UINT8
320 typedef YYTYPE_UINT8 yytype_uint8;
321 #else
322 typedef unsigned char yytype_uint8;
323 #endif
325 #ifdef YYTYPE_INT8
326 typedef YYTYPE_INT8 yytype_int8;
327 #elif (defined __STDC__ || defined __C99__FUNC__ \
328 || defined __cplusplus || defined _MSC_VER)
329 typedef signed char yytype_int8;
330 #else
331 typedef short int yytype_int8;
332 #endif
334 #ifdef YYTYPE_UINT16
335 typedef YYTYPE_UINT16 yytype_uint16;
336 #else
337 typedef unsigned short int yytype_uint16;
338 #endif
340 #ifdef YYTYPE_INT16
341 typedef YYTYPE_INT16 yytype_int16;
342 #else
343 typedef short int yytype_int16;
344 #endif
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 YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
352 || defined __cplusplus || defined _MSC_VER)
353 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
354 # define YYSIZE_T size_t
355 # else
356 # define YYSIZE_T unsigned int
357 # endif
358 #endif
360 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
362 #ifndef YY_
363 # if YYENABLE_NLS
364 # if ENABLE_NLS
365 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
366 # define YY_(msgid) dgettext ("bison-runtime", msgid)
367 # endif
368 # endif
369 # ifndef YY_
370 # define YY_(msgid) msgid
371 # endif
372 #endif
374 /* Suppress unused-variable warnings by "using" E. */
375 #if ! defined lint || defined __GNUC__
376 # define YYUSE(e) ((void) (e))
377 #else
378 # define YYUSE(e) /* empty */
379 #endif
381 /* Identity function, used to suppress warnings about constant conditions. */
382 #ifndef lint
383 # define YYID(n) (n)
384 #else
385 #if (defined __STDC__ || defined __C99__FUNC__ \
386 || defined __cplusplus || defined _MSC_VER)
387 static int
388 YYID (int i)
389 #else
390 static int
391 YYID (i)
392 int i;
393 #endif
395 return i;
397 #endif
399 #if ! defined yyoverflow || YYERROR_VERBOSE
401 /* The parser invokes alloca or malloc; define the necessary symbols. */
403 # ifdef YYSTACK_USE_ALLOCA
404 # if YYSTACK_USE_ALLOCA
405 # ifdef __GNUC__
406 # define YYSTACK_ALLOC __builtin_alloca
407 # elif defined __BUILTIN_VA_ARG_INCR
408 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
409 # elif defined _AIX
410 # define YYSTACK_ALLOC __alloca
411 # elif defined _MSC_VER
412 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
413 # define alloca _alloca
414 # else
415 # define YYSTACK_ALLOC alloca
416 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
417 || defined __cplusplus || defined _MSC_VER)
418 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
419 # ifndef _STDLIB_H
420 # define _STDLIB_H 1
421 # endif
422 # endif
423 # endif
424 # endif
425 # endif
427 # ifdef YYSTACK_ALLOC
428 /* Pacify GCC's `empty if-body' warning. */
429 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
430 # ifndef YYSTACK_ALLOC_MAXIMUM
431 /* The OS might guarantee only one guard page at the bottom of the stack,
432 and a page size can be as small as 4096 bytes. So we cannot safely
433 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
434 to allow for a few compiler-allocated temporary stack slots. */
435 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
436 # endif
437 # else
438 # define YYSTACK_ALLOC YYMALLOC
439 # define YYSTACK_FREE YYFREE
440 # ifndef YYSTACK_ALLOC_MAXIMUM
441 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
442 # endif
443 # if (defined __cplusplus && ! defined _STDLIB_H \
444 && ! ((defined YYMALLOC || defined malloc) \
445 && (defined YYFREE || defined free)))
446 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
447 # ifndef _STDLIB_H
448 # define _STDLIB_H 1
449 # endif
450 # endif
451 # ifndef YYMALLOC
452 # define YYMALLOC malloc
453 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
454 || defined __cplusplus || defined _MSC_VER)
455 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
456 # endif
457 # endif
458 # ifndef YYFREE
459 # define YYFREE free
460 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
461 || defined __cplusplus || defined _MSC_VER)
462 void free (void *); /* INFRINGES ON USER NAME SPACE */
463 # endif
464 # endif
465 # endif
466 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
469 #if (! defined yyoverflow \
470 && (! defined __cplusplus \
471 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
473 /* A type that is properly aligned for any stack member. */
474 union yyalloc
476 yytype_int16 yyss;
477 YYSTYPE yyvs;
480 /* The size of the maximum gap between one aligned stack and the next. */
481 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
483 /* The size of an array large to enough to hold all stacks, each with
484 N elements. */
485 # define YYSTACK_BYTES(N) \
486 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
487 + YYSTACK_GAP_MAXIMUM)
489 /* Copy COUNT objects from FROM to TO. The source and destination do
490 not overlap. */
491 # ifndef YYCOPY
492 # if defined __GNUC__ && 1 < __GNUC__
493 # define YYCOPY(To, From, Count) \
494 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
495 # else
496 # define YYCOPY(To, From, Count) \
497 do \
499 YYSIZE_T yyi; \
500 for (yyi = 0; yyi < (Count); yyi++) \
501 (To)[yyi] = (From)[yyi]; \
503 while (YYID (0))
504 # endif
505 # endif
507 /* Relocate STACK from its old location to the new one. The
508 local variables YYSIZE and YYSTACKSIZE give the old and new number of
509 elements in the stack, and YYPTR gives the new location of the
510 stack. Advance YYPTR to a properly aligned location for the next
511 stack. */
512 # define YYSTACK_RELOCATE(Stack) \
513 do \
515 YYSIZE_T yynewbytes; \
516 YYCOPY (&yyptr->Stack, Stack, yysize); \
517 Stack = &yyptr->Stack; \
518 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
519 yyptr += yynewbytes / sizeof (*yyptr); \
521 while (YYID (0))
523 #endif
525 /* YYFINAL -- State number of the termination state. */
526 #define YYFINAL 2
527 /* YYLAST -- Last index in YYTABLE. */
528 #define YYLAST 139
530 /* YYNTOKENS -- Number of terminals. */
531 #define YYNTOKENS 29
532 /* YYNNTS -- Number of nonterminals. */
533 #define YYNNTS 16
534 /* YYNRULES -- Number of rules. */
535 #define YYNRULES 48
536 /* YYNRULES -- Number of states. */
537 #define YYNSTATES 82
539 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
540 #define YYUNDEFTOK 2
541 #define YYMAXUTOK 283
543 #define YYTRANSLATE(YYX) \
544 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
546 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
547 static const yytype_uint8 yytranslate[] =
549 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
550 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
551 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
552 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
554 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
555 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
556 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
557 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
558 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
559 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
560 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
561 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
562 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
563 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
564 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
565 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
566 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
567 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
570 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
571 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
572 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
575 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
576 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
577 25, 26, 27, 28
580 #if YYDEBUG
581 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
582 YYRHS. */
583 static const yytype_uint8 yyprhs[] =
585 0, 0, 3, 4, 7, 9, 11, 16, 19, 24,
586 29, 34, 39, 44, 49, 54, 58, 62, 66, 70,
587 75, 79, 81, 83, 85, 87, 89, 91, 93, 95,
588 97, 99, 101, 103, 105, 107, 109, 111, 113, 115,
589 117, 119, 121, 122, 125, 127, 129, 131, 133
592 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
593 static const yytype_int8 yyrhs[] =
595 30, 0, -1, -1, 30, 31, -1, 33, -1, 32,
596 -1, 28, 4, 43, 3, -1, 28, 3, -1, 28,
597 28, 43, 3, -1, 28, 27, 43, 3, -1, 34,
598 27, 43, 3, -1, 35, 28, 43, 3, -1, 36,
599 28, 43, 3, -1, 37, 28, 43, 3, -1, 38,
600 28, 43, 3, -1, 39, 43, 3, -1, 40, 43,
601 3, -1, 41, 43, 3, -1, 42, 43, 3, -1,
602 28, 5, 43, 3, -1, 5, 43, 3, -1, 3,
603 -1, 1, -1, 6, -1, 7, -1, 8, -1, 10,
604 -1, 9, -1, 12, -1, 11, -1, 13, -1, 19,
605 -1, 14, -1, 20, -1, 15, -1, 21, -1, 17,
606 -1, 23, -1, 16, -1, 22, -1, 18, -1, 24,
607 -1, -1, 43, 44, -1, 28, -1, 27, -1, 5,
608 -1, 4, -1, 26, -1
611 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
612 static const yytype_uint16 yyrline[] =
614 0, 161, 161, 161, 163, 163, 165, 171, 181, 211,
615 222, 229, 235, 241, 247, 253, 258, 263, 268, 273,
616 277, 278, 279, 284, 284, 284, 285, 285, 286, 286,
617 287, 287, 288, 288, 289, 289, 290, 290, 291, 291,
618 292, 292, 293, 293, 296, 297, 298, 299, 300
620 #endif
622 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
623 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
624 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
625 static const char *const yytname[] =
627 "$end", "error", "$undefined", "EOSTMT", "ASSIGNMENT_OP", "GARBAGE",
628 "CPP_INCLUDE", "F90PPR_INCLUDE", "COCO_INCLUDE", "F90PPR_DEFINE",
629 "CPP_DEFINE", "F90PPR_UNDEF", "CPP_UNDEF", "CPP_IFDEF", "CPP_IFNDEF",
630 "CPP_IF", "CPP_ELSE", "CPP_ELIF", "CPP_ENDIF", "F90PPR_IFDEF",
631 "F90PPR_IFNDEF", "F90PPR_IF", "F90PPR_ELSE", "F90PPR_ELIF",
632 "F90PPR_ENDIF", "CPP_TOENDL", "UNTERMINATED_STRING", "STRING", "WORD",
633 "$accept", "code", "stmt", "assignment_stmt", "keyword_stmt", "include",
634 "define", "undef", "ifdef", "ifndef", "if", "elif", "else", "endif",
635 "other", "misc_code", 0
637 #endif
639 # ifdef YYPRINT
640 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
641 token YYLEX-NUM. */
642 static const yytype_uint16 yytoknum[] =
644 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
645 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
646 275, 276, 277, 278, 279, 280, 281, 282, 283
648 # endif
650 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
651 static const yytype_uint8 yyr1[] =
653 0, 29, 30, 30, 31, 31, 32, 33, 33, 33,
654 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
655 33, 33, 33, 34, 34, 34, 35, 35, 36, 36,
656 37, 37, 38, 38, 39, 39, 40, 40, 41, 41,
657 42, 42, 43, 43, 44, 44, 44, 44, 44
660 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
661 static const yytype_uint8 yyr2[] =
663 0, 2, 0, 2, 1, 1, 4, 2, 4, 4,
664 4, 4, 4, 4, 4, 3, 3, 3, 3, 4,
665 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
666 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
667 1, 1, 0, 2, 1, 1, 1, 1, 1
670 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
671 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
672 means the default is an error. */
673 static const yytype_uint8 yydefact[] =
675 2, 0, 1, 22, 21, 42, 23, 24, 25, 27,
676 26, 29, 28, 30, 32, 34, 38, 36, 40, 31,
677 33, 35, 39, 37, 41, 0, 3, 5, 4, 0,
678 0, 0, 0, 0, 42, 42, 42, 42, 0, 7,
679 42, 42, 42, 42, 42, 42, 42, 42, 42, 0,
680 0, 0, 0, 20, 47, 46, 48, 45, 44, 43,
681 0, 0, 0, 0, 0, 0, 0, 0, 0, 15,
682 16, 17, 18, 6, 19, 9, 8, 10, 11, 12,
683 13, 14
686 /* YYDEFGOTO[NTERM-NUM]. */
687 static const yytype_int8 yydefgoto[] =
689 -1, 1, 26, 27, 28, 29, 30, 31, 32, 33,
690 34, 35, 36, 37, 38, 59
693 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
694 STATE-NUM. */
695 #define YYPACT_NINF -26
696 static const yytype_int8 yypact[] =
698 -26, 0, -26, -26, -26, -26, -26, -26, -26, -26,
699 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
700 -26, -26, -26, -26, -26, 111, -26, -26, -26, -25,
701 -24, 19, 23, 63, -26, -26, -26, -26, 22, -26,
702 -26, -26, -26, -26, -26, -26, -26, -26, -26, 26,
703 29, 32, 35, -26, -26, -26, -26, -26, -26, -26,
704 38, 41, 67, 70, 73, 76, 79, 82, 85, -26,
705 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
706 -26, -26
709 /* YYPGOTO[NTERM-NUM]. */
710 static const yytype_int8 yypgoto[] =
712 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
713 -26, -26, -26, -26, 83, -26
716 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
717 positive, shift that token. If negative, reduce the rule which
718 number is the opposite. If zero, do what YYDEFACT says.
719 If YYTABLE_NINF, syntax error. */
720 #define YYTABLE_NINF -1
721 static const yytype_uint8 yytable[] =
723 2, 3, 44, 4, 45, 5, 6, 7, 8, 9,
724 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
725 20, 21, 22, 23, 24, 53, 54, 55, 25, 69,
726 54, 55, 70, 54, 55, 71, 54, 55, 72, 54,
727 55, 73, 54, 55, 74, 54, 55, 46, 56, 57,
728 58, 47, 56, 57, 58, 56, 57, 58, 56, 57,
729 58, 56, 57, 58, 56, 57, 58, 56, 57, 58,
730 75, 54, 55, 76, 54, 55, 77, 54, 55, 78,
731 54, 55, 79, 54, 55, 80, 54, 55, 81, 54,
732 55, 48, 0, 56, 57, 58, 56, 57, 58, 56,
733 57, 58, 56, 57, 58, 56, 57, 58, 56, 57,
734 58, 56, 57, 58, 39, 40, 41, 49, 50, 51,
735 52, 0, 0, 60, 61, 62, 63, 64, 65, 66,
736 67, 68, 0, 0, 0, 0, 0, 0, 42, 43
739 static const yytype_int8 yycheck[] =
741 0, 1, 27, 3, 28, 5, 6, 7, 8, 9,
742 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
743 20, 21, 22, 23, 24, 3, 4, 5, 28, 3,
744 4, 5, 3, 4, 5, 3, 4, 5, 3, 4,
745 5, 3, 4, 5, 3, 4, 5, 28, 26, 27,
746 28, 28, 26, 27, 28, 26, 27, 28, 26, 27,
747 28, 26, 27, 28, 26, 27, 28, 26, 27, 28,
748 3, 4, 5, 3, 4, 5, 3, 4, 5, 3,
749 4, 5, 3, 4, 5, 3, 4, 5, 3, 4,
750 5, 28, -1, 26, 27, 28, 26, 27, 28, 26,
751 27, 28, 26, 27, 28, 26, 27, 28, 26, 27,
752 28, 26, 27, 28, 3, 4, 5, 34, 35, 36,
753 37, -1, -1, 40, 41, 42, 43, 44, 45, 46,
754 47, 48, -1, -1, -1, -1, -1, -1, 27, 28
757 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
758 symbol of state STATE-NUM. */
759 static const yytype_uint8 yystos[] =
761 0, 30, 0, 1, 3, 5, 6, 7, 8, 9,
762 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
763 20, 21, 22, 23, 24, 28, 31, 32, 33, 34,
764 35, 36, 37, 38, 39, 40, 41, 42, 43, 3,
765 4, 5, 27, 28, 27, 28, 28, 28, 28, 43,
766 43, 43, 43, 3, 4, 5, 26, 27, 28, 44,
767 43, 43, 43, 43, 43, 43, 43, 43, 43, 3,
768 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
769 3, 3
772 #define yyerrok (yyerrstatus = 0)
773 #define yyclearin (yychar = YYEMPTY)
774 #define YYEMPTY (-2)
775 #define YYEOF 0
777 #define YYACCEPT goto yyacceptlab
778 #define YYABORT goto yyabortlab
779 #define YYERROR goto yyerrorlab
782 /* Like YYERROR except do call yyerror. This remains here temporarily
783 to ease the transition to the new meaning of YYERROR, for GCC.
784 Once GCC version 2 has supplanted version 1, this can go. */
786 #define YYFAIL goto yyerrlab
788 #define YYRECOVERING() (!!yyerrstatus)
790 #define YYBACKUP(Token, Value) \
791 do \
792 if (yychar == YYEMPTY && yylen == 1) \
794 yychar = (Token); \
795 yylval = (Value); \
796 yytoken = YYTRANSLATE (yychar); \
797 YYPOPSTACK (1); \
798 goto yybackup; \
800 else \
802 yyerror (YY_("syntax error: cannot back up")); \
803 YYERROR; \
805 while (YYID (0))
808 #define YYTERROR 1
809 #define YYERRCODE 256
812 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
813 If N is 0, then set CURRENT to the empty location which ends
814 the previous symbol: RHS[0] (always defined). */
816 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
817 #ifndef YYLLOC_DEFAULT
818 # define YYLLOC_DEFAULT(Current, Rhs, N) \
819 do \
820 if (YYID (N)) \
822 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
823 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
824 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
825 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
827 else \
829 (Current).first_line = (Current).last_line = \
830 YYRHSLOC (Rhs, 0).last_line; \
831 (Current).first_column = (Current).last_column = \
832 YYRHSLOC (Rhs, 0).last_column; \
834 while (YYID (0))
835 #endif
838 /* YY_LOCATION_PRINT -- Print the location on the stream.
839 This macro was not mandated originally: define only if we know
840 we won't break user code: when these are the locations we know. */
842 #ifndef YY_LOCATION_PRINT
843 # if YYLTYPE_IS_TRIVIAL
844 # define YY_LOCATION_PRINT(File, Loc) \
845 fprintf (File, "%d.%d-%d.%d", \
846 (Loc).first_line, (Loc).first_column, \
847 (Loc).last_line, (Loc).last_column)
848 # else
849 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
850 # endif
851 #endif
854 /* YYLEX -- calling `yylex' with the right arguments. */
856 #ifdef YYLEX_PARAM
857 # define YYLEX yylex (&yylval, YYLEX_PARAM)
858 #else
859 # define YYLEX yylex (&yylval)
860 #endif
862 /* Enable debugging if requested. */
863 #if YYDEBUG
865 # ifndef YYFPRINTF
866 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
867 # define YYFPRINTF fprintf
868 # endif
870 # define YYDPRINTF(Args) \
871 do { \
872 if (yydebug) \
873 YYFPRINTF Args; \
874 } while (YYID (0))
876 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
877 do { \
878 if (yydebug) \
880 YYFPRINTF (stderr, "%s ", Title); \
881 yy_symbol_print (stderr, \
882 Type, Value); \
883 YYFPRINTF (stderr, "\n"); \
885 } while (YYID (0))
888 /*--------------------------------.
889 | Print this symbol on YYOUTPUT. |
890 `--------------------------------*/
892 /*ARGSUSED*/
893 #if (defined __STDC__ || defined __C99__FUNC__ \
894 || defined __cplusplus || defined _MSC_VER)
895 static void
896 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
897 #else
898 static void
899 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
900 FILE *yyoutput;
901 int yytype;
902 YYSTYPE const * const yyvaluep;
903 #endif
905 if (!yyvaluep)
906 return;
907 # ifdef YYPRINT
908 if (yytype < YYNTOKENS)
909 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
910 # else
911 YYUSE (yyoutput);
912 # endif
913 switch (yytype)
915 default:
916 break;
921 /*--------------------------------.
922 | Print this symbol on YYOUTPUT. |
923 `--------------------------------*/
925 #if (defined __STDC__ || defined __C99__FUNC__ \
926 || defined __cplusplus || defined _MSC_VER)
927 static void
928 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
929 #else
930 static void
931 yy_symbol_print (yyoutput, yytype, yyvaluep)
932 FILE *yyoutput;
933 int yytype;
934 YYSTYPE const * const yyvaluep;
935 #endif
937 if (yytype < YYNTOKENS)
938 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
939 else
940 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
942 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
943 YYFPRINTF (yyoutput, ")");
946 /*------------------------------------------------------------------.
947 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
948 | TOP (included). |
949 `------------------------------------------------------------------*/
951 #if (defined __STDC__ || defined __C99__FUNC__ \
952 || defined __cplusplus || defined _MSC_VER)
953 static void
954 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
955 #else
956 static void
957 yy_stack_print (bottom, top)
958 yytype_int16 *bottom;
959 yytype_int16 *top;
960 #endif
962 YYFPRINTF (stderr, "Stack now");
963 for (; bottom <= top; ++bottom)
964 YYFPRINTF (stderr, " %d", *bottom);
965 YYFPRINTF (stderr, "\n");
968 # define YY_STACK_PRINT(Bottom, Top) \
969 do { \
970 if (yydebug) \
971 yy_stack_print ((Bottom), (Top)); \
972 } while (YYID (0))
975 /*------------------------------------------------.
976 | Report that the YYRULE is going to be reduced. |
977 `------------------------------------------------*/
979 #if (defined __STDC__ || defined __C99__FUNC__ \
980 || defined __cplusplus || defined _MSC_VER)
981 static void
982 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
983 #else
984 static void
985 yy_reduce_print (yyvsp, yyrule)
986 YYSTYPE *yyvsp;
987 int yyrule;
988 #endif
990 int yynrhs = yyr2[yyrule];
991 int yyi;
992 unsigned long int yylno = yyrline[yyrule];
993 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
994 yyrule - 1, yylno);
995 /* The symbols being reduced. */
996 for (yyi = 0; yyi < yynrhs; yyi++)
998 fprintf (stderr, " $%d = ", yyi + 1);
999 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1000 &(yyvsp[(yyi + 1) - (yynrhs)])
1002 fprintf (stderr, "\n");
1006 # define YY_REDUCE_PRINT(Rule) \
1007 do { \
1008 if (yydebug) \
1009 yy_reduce_print (yyvsp, Rule); \
1010 } while (YYID (0))
1012 /* Nonzero means print parse trace. It is left uninitialized so that
1013 multiple parsers can coexist. */
1014 int yydebug;
1015 #else /* !YYDEBUG */
1016 # define YYDPRINTF(Args)
1017 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1018 # define YY_STACK_PRINT(Bottom, Top)
1019 # define YY_REDUCE_PRINT(Rule)
1020 #endif /* !YYDEBUG */
1023 /* YYINITDEPTH -- initial size of the parser's stacks. */
1024 #ifndef YYINITDEPTH
1025 # define YYINITDEPTH 200
1026 #endif
1028 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1029 if the built-in stack extension method is used).
1031 Do not make this value too large; the results are undefined if
1032 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1033 evaluated with infinite-precision integer arithmetic. */
1035 #ifndef YYMAXDEPTH
1036 # define YYMAXDEPTH 10000
1037 #endif
1041 #if YYERROR_VERBOSE
1043 # ifndef yystrlen
1044 # if defined __GLIBC__ && defined _STRING_H
1045 # define yystrlen strlen
1046 # else
1047 /* Return the length of YYSTR. */
1048 #if (defined __STDC__ || defined __C99__FUNC__ \
1049 || defined __cplusplus || defined _MSC_VER)
1050 static YYSIZE_T
1051 yystrlen (const char *yystr)
1052 #else
1053 static YYSIZE_T
1054 yystrlen (yystr)
1055 const char *yystr;
1056 #endif
1058 YYSIZE_T yylen;
1059 for (yylen = 0; yystr[yylen]; yylen++)
1060 continue;
1061 return yylen;
1063 # endif
1064 # endif
1066 # ifndef yystpcpy
1067 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1068 # define yystpcpy stpcpy
1069 # else
1070 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1071 YYDEST. */
1072 #if (defined __STDC__ || defined __C99__FUNC__ \
1073 || defined __cplusplus || defined _MSC_VER)
1074 static char *
1075 yystpcpy (char *yydest, const char *yysrc)
1076 #else
1077 static char *
1078 yystpcpy (yydest, yysrc)
1079 char *yydest;
1080 const char *yysrc;
1081 #endif
1083 char *yyd = yydest;
1084 const char *yys = yysrc;
1086 while ((*yyd++ = *yys++) != '\0')
1087 continue;
1089 return yyd - 1;
1091 # endif
1092 # endif
1094 # ifndef yytnamerr
1095 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1096 quotes and backslashes, so that it's suitable for yyerror. The
1097 heuristic is that double-quoting is unnecessary unless the string
1098 contains an apostrophe, a comma, or backslash (other than
1099 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1100 null, do not copy; instead, return the length of what the result
1101 would have been. */
1102 static YYSIZE_T
1103 yytnamerr (char *yyres, const char *yystr)
1105 if (*yystr == '"')
1107 YYSIZE_T yyn = 0;
1108 char const *yyp = yystr;
1110 for (;;)
1111 switch (*++yyp)
1113 case '\'':
1114 case ',':
1115 goto do_not_strip_quotes;
1117 case '\\':
1118 if (*++yyp != '\\')
1119 goto do_not_strip_quotes;
1120 /* Fall through. */
1121 default:
1122 if (yyres)
1123 yyres[yyn] = *yyp;
1124 yyn++;
1125 break;
1127 case '"':
1128 if (yyres)
1129 yyres[yyn] = '\0';
1130 return yyn;
1132 do_not_strip_quotes: ;
1135 if (! yyres)
1136 return yystrlen (yystr);
1138 return yystpcpy (yyres, yystr) - yyres;
1140 # endif
1142 /* Copy into YYRESULT an error message about the unexpected token
1143 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1144 including the terminating null byte. If YYRESULT is null, do not
1145 copy anything; just return the number of bytes that would be
1146 copied. As a special case, return 0 if an ordinary "syntax error"
1147 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1148 size calculation. */
1149 static YYSIZE_T
1150 yysyntax_error (char *yyresult, int yystate, int yychar)
1152 int yyn = yypact[yystate];
1154 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1155 return 0;
1156 else
1158 int yytype = YYTRANSLATE (yychar);
1159 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1160 YYSIZE_T yysize = yysize0;
1161 YYSIZE_T yysize1;
1162 int yysize_overflow = 0;
1163 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1164 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1165 int yyx;
1167 # if 0
1168 /* This is so xgettext sees the translatable formats that are
1169 constructed on the fly. */
1170 YY_("syntax error, unexpected %s");
1171 YY_("syntax error, unexpected %s, expecting %s");
1172 YY_("syntax error, unexpected %s, expecting %s or %s");
1173 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1174 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1175 # endif
1176 char *yyfmt;
1177 char const *yyf;
1178 static char const yyunexpected[] = "syntax error, unexpected %s";
1179 static char const yyexpecting[] = ", expecting %s";
1180 static char const yyor[] = " or %s";
1181 char yyformat[sizeof yyunexpected
1182 + sizeof yyexpecting - 1
1183 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1184 * (sizeof yyor - 1))];
1185 char const *yyprefix = yyexpecting;
1187 /* Start YYX at -YYN if negative to avoid negative indexes in
1188 YYCHECK. */
1189 int yyxbegin = yyn < 0 ? -yyn : 0;
1191 /* Stay within bounds of both yycheck and yytname. */
1192 int yychecklim = YYLAST - yyn + 1;
1193 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1194 int yycount = 1;
1196 yyarg[0] = yytname[yytype];
1197 yyfmt = yystpcpy (yyformat, yyunexpected);
1199 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1200 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1202 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1204 yycount = 1;
1205 yysize = yysize0;
1206 yyformat[sizeof yyunexpected - 1] = '\0';
1207 break;
1209 yyarg[yycount++] = yytname[yyx];
1210 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1211 yysize_overflow |= (yysize1 < yysize);
1212 yysize = yysize1;
1213 yyfmt = yystpcpy (yyfmt, yyprefix);
1214 yyprefix = yyor;
1217 yyf = YY_(yyformat);
1218 yysize1 = yysize + yystrlen (yyf);
1219 yysize_overflow |= (yysize1 < yysize);
1220 yysize = yysize1;
1222 if (yysize_overflow)
1223 return YYSIZE_MAXIMUM;
1225 if (yyresult)
1227 /* Avoid sprintf, as that infringes on the user's name space.
1228 Don't have undefined behavior even if the translation
1229 produced a string with the wrong number of "%s"s. */
1230 char *yyp = yyresult;
1231 int yyi = 0;
1232 while ((*yyp = *yyf) != '\0')
1234 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1236 yyp += yytnamerr (yyp, yyarg[yyi++]);
1237 yyf += 2;
1239 else
1241 yyp++;
1242 yyf++;
1246 return yysize;
1249 #endif /* YYERROR_VERBOSE */
1252 /*-----------------------------------------------.
1253 | Release the memory associated to this symbol. |
1254 `-----------------------------------------------*/
1256 /*ARGSUSED*/
1257 #if (defined __STDC__ || defined __C99__FUNC__ \
1258 || defined __cplusplus || defined _MSC_VER)
1259 static void
1260 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1261 #else
1262 static void
1263 yydestruct (yymsg, yytype, yyvaluep)
1264 const char *yymsg;
1265 int yytype;
1266 YYSTYPE *yyvaluep;
1267 #endif
1269 YYUSE (yyvaluep);
1271 if (!yymsg)
1272 yymsg = "Deleting";
1273 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1275 switch (yytype)
1278 default:
1279 break;
1284 /* Prevent warnings from -Wmissing-prototypes. */
1286 #ifdef YYPARSE_PARAM
1287 #if defined __STDC__ || defined __cplusplus
1288 int yyparse (void *YYPARSE_PARAM);
1289 #else
1290 int yyparse ();
1291 #endif
1292 #else /* ! YYPARSE_PARAM */
1293 #if defined __STDC__ || defined __cplusplus
1294 int yyparse (void);
1295 #else
1296 int yyparse ();
1297 #endif
1298 #endif /* ! YYPARSE_PARAM */
1305 /*----------.
1306 | yyparse. |
1307 `----------*/
1309 #ifdef YYPARSE_PARAM
1310 #if (defined __STDC__ || defined __C99__FUNC__ \
1311 || defined __cplusplus || defined _MSC_VER)
1313 yyparse (void *YYPARSE_PARAM)
1314 #else
1316 yyparse (YYPARSE_PARAM)
1317 void *YYPARSE_PARAM;
1318 #endif
1319 #else /* ! YYPARSE_PARAM */
1320 #if (defined __STDC__ || defined __C99__FUNC__ \
1321 || defined __cplusplus || defined _MSC_VER)
1323 yyparse (void)
1324 #else
1326 yyparse ()
1328 #endif
1329 #endif
1331 /* The look-ahead symbol. */
1332 int yychar;
1334 /* The semantic value of the look-ahead symbol. */
1335 YYSTYPE yylval;
1337 /* Number of syntax errors so far. */
1338 int yynerrs;
1340 int yystate;
1341 int yyn;
1342 int yyresult;
1343 /* Number of tokens to shift before error messages enabled. */
1344 int yyerrstatus;
1345 /* Look-ahead token as an internal (translated) token number. */
1346 int yytoken = 0;
1347 #if YYERROR_VERBOSE
1348 /* Buffer for error messages, and its allocated size. */
1349 char yymsgbuf[128];
1350 char *yymsg = yymsgbuf;
1351 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1352 #endif
1354 /* Three stacks and their tools:
1355 `yyss': related to states,
1356 `yyvs': related to semantic values,
1357 `yyls': related to locations.
1359 Refer to the stacks thru separate pointers, to allow yyoverflow
1360 to reallocate them elsewhere. */
1362 /* The state stack. */
1363 yytype_int16 yyssa[YYINITDEPTH];
1364 yytype_int16 *yyss = yyssa;
1365 yytype_int16 *yyssp;
1367 /* The semantic value stack. */
1368 YYSTYPE yyvsa[YYINITDEPTH];
1369 YYSTYPE *yyvs = yyvsa;
1370 YYSTYPE *yyvsp;
1374 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1376 YYSIZE_T yystacksize = YYINITDEPTH;
1378 /* The variables used to return semantic value and location from the
1379 action routines. */
1380 YYSTYPE yyval;
1383 /* The number of symbols on the RHS of the reduced rule.
1384 Keep to zero when no symbol should be popped. */
1385 int yylen = 0;
1387 YYDPRINTF ((stderr, "Starting parse\n"));
1389 yystate = 0;
1390 yyerrstatus = 0;
1391 yynerrs = 0;
1392 yychar = YYEMPTY; /* Cause a token to be read. */
1394 /* Initialize stack pointers.
1395 Waste one element of value and location stack
1396 so that they stay on the same level as the state stack.
1397 The wasted elements are never initialized. */
1399 yyssp = yyss;
1400 yyvsp = yyvs;
1402 goto yysetstate;
1404 /*------------------------------------------------------------.
1405 | yynewstate -- Push a new state, which is found in yystate. |
1406 `------------------------------------------------------------*/
1407 yynewstate:
1408 /* In all cases, when you get here, the value and location stacks
1409 have just been pushed. So pushing a state here evens the stacks. */
1410 yyssp++;
1412 yysetstate:
1413 *yyssp = yystate;
1415 if (yyss + yystacksize - 1 <= yyssp)
1417 /* Get the current used size of the three stacks, in elements. */
1418 YYSIZE_T yysize = yyssp - yyss + 1;
1420 #ifdef yyoverflow
1422 /* Give user a chance to reallocate the stack. Use copies of
1423 these so that the &'s don't force the real ones into
1424 memory. */
1425 YYSTYPE *yyvs1 = yyvs;
1426 yytype_int16 *yyss1 = yyss;
1429 /* Each stack pointer address is followed by the size of the
1430 data in use in that stack, in bytes. This used to be a
1431 conditional around just the two extra args, but that might
1432 be undefined if yyoverflow is a macro. */
1433 yyoverflow (YY_("memory exhausted"),
1434 &yyss1, yysize * sizeof (*yyssp),
1435 &yyvs1, yysize * sizeof (*yyvsp),
1437 &yystacksize);
1439 yyss = yyss1;
1440 yyvs = yyvs1;
1442 #else /* no yyoverflow */
1443 # ifndef YYSTACK_RELOCATE
1444 goto yyexhaustedlab;
1445 # else
1446 /* Extend the stack our own way. */
1447 if (YYMAXDEPTH <= yystacksize)
1448 goto yyexhaustedlab;
1449 yystacksize *= 2;
1450 if (YYMAXDEPTH < yystacksize)
1451 yystacksize = YYMAXDEPTH;
1454 yytype_int16 *yyss1 = yyss;
1455 union yyalloc *yyptr =
1456 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1457 if (! yyptr)
1458 goto yyexhaustedlab;
1459 YYSTACK_RELOCATE (yyss);
1460 YYSTACK_RELOCATE (yyvs);
1462 # undef YYSTACK_RELOCATE
1463 if (yyss1 != yyssa)
1464 YYSTACK_FREE (yyss1);
1466 # endif
1467 #endif /* no yyoverflow */
1469 yyssp = yyss + yysize - 1;
1470 yyvsp = yyvs + yysize - 1;
1473 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1474 (unsigned long int) yystacksize));
1476 if (yyss + yystacksize - 1 <= yyssp)
1477 YYABORT;
1480 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1482 goto yybackup;
1484 /*-----------.
1485 | yybackup. |
1486 `-----------*/
1487 yybackup:
1489 /* Do appropriate processing given the current state. Read a
1490 look-ahead token if we need one and don't already have one. */
1492 /* First try to decide what to do without reference to look-ahead token. */
1493 yyn = yypact[yystate];
1494 if (yyn == YYPACT_NINF)
1495 goto yydefault;
1497 /* Not known => get a look-ahead token if don't already have one. */
1499 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1500 if (yychar == YYEMPTY)
1502 YYDPRINTF ((stderr, "Reading a token: "));
1503 yychar = YYLEX;
1506 if (yychar <= YYEOF)
1508 yychar = yytoken = YYEOF;
1509 YYDPRINTF ((stderr, "Now at end of input.\n"));
1511 else
1513 yytoken = YYTRANSLATE (yychar);
1514 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1517 /* If the proper action on seeing token YYTOKEN is to reduce or to
1518 detect an error, take that action. */
1519 yyn += yytoken;
1520 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1521 goto yydefault;
1522 yyn = yytable[yyn];
1523 if (yyn <= 0)
1525 if (yyn == 0 || yyn == YYTABLE_NINF)
1526 goto yyerrlab;
1527 yyn = -yyn;
1528 goto yyreduce;
1531 if (yyn == YYFINAL)
1532 YYACCEPT;
1534 /* Count tokens shifted since error; after three, turn off error
1535 status. */
1536 if (yyerrstatus)
1537 yyerrstatus--;
1539 /* Shift the look-ahead token. */
1540 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1542 /* Discard the shifted token unless it is eof. */
1543 if (yychar != YYEOF)
1544 yychar = YYEMPTY;
1546 yystate = yyn;
1547 *++yyvsp = yylval;
1549 goto yynewstate;
1552 /*-----------------------------------------------------------.
1553 | yydefault -- do the default action for the current state. |
1554 `-----------------------------------------------------------*/
1555 yydefault:
1556 yyn = yydefact[yystate];
1557 if (yyn == 0)
1558 goto yyerrlab;
1559 goto yyreduce;
1562 /*-----------------------------.
1563 | yyreduce -- Do a reduction. |
1564 `-----------------------------*/
1565 yyreduce:
1566 /* yyn is the number of a rule to reduce with. */
1567 yylen = yyr2[yyn];
1569 /* If YYLEN is nonzero, implement the default value of the action:
1570 `$$ = $1'.
1572 Otherwise, the following line sets YYVAL to garbage.
1573 This behavior is undocumented and Bison
1574 users should not rely upon it. Assigning to YYVAL
1575 unconditionally makes the parser a bit smaller, and it avoids a
1576 GCC warning that YYVAL may be used uninitialized. */
1577 yyval = yyvsp[1-yylen];
1580 YY_REDUCE_PRINT (yyn);
1581 switch (yyn)
1583 case 6:
1584 #line 166 "cmDependsFortranParser.y"
1586 free((yyvsp[(1) - (4)].string));
1588 break;
1590 case 7:
1591 #line 172 "cmDependsFortranParser.y"
1593 if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (2)].string), "interface"))
1595 cmDependsFortranParser* parser =
1596 cmDependsFortran_yyget_extra(yyscanner);
1597 cmDependsFortranParser_SetInInterface(parser, true);
1599 free((yyvsp[(1) - (2)].string));
1601 break;
1603 case 8:
1604 #line 182 "cmDependsFortranParser.y"
1606 if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (4)].string), "use"))
1608 cmDependsFortranParser* parser =
1609 cmDependsFortran_yyget_extra(yyscanner);
1610 cmDependsFortranParser_RuleUse(parser, (yyvsp[(2) - (4)].string));
1612 else if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (4)].string), "module"))
1614 cmDependsFortranParser* parser =
1615 cmDependsFortran_yyget_extra(yyscanner);
1616 cmDependsFortranParser_RuleModule(parser, (yyvsp[(2) - (4)].string));
1618 else if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (4)].string), "interface"))
1620 cmDependsFortranParser* parser =
1621 cmDependsFortran_yyget_extra(yyscanner);
1622 cmDependsFortranParser_SetInInterface(parser, true);
1624 else if (cmDependsFortranParserIsKeyword((yyvsp[(2) - (4)].string), "interface") &&
1625 cmDependsFortranParserIsKeyword((yyvsp[(1) - (4)].string), "end"))
1627 cmDependsFortranParser* parser =
1628 cmDependsFortran_yyget_extra(yyscanner);
1629 cmDependsFortranParser_SetInInterface(parser, false);
1631 free((yyvsp[(1) - (4)].string));
1632 free((yyvsp[(2) - (4)].string));
1634 break;
1636 case 9:
1637 #line 212 "cmDependsFortranParser.y"
1639 if (cmDependsFortranParserIsKeyword((yyvsp[(1) - (4)].string), "include"))
1641 cmDependsFortranParser* parser =
1642 cmDependsFortran_yyget_extra(yyscanner);
1643 cmDependsFortranParser_RuleInclude(parser, (yyvsp[(2) - (4)].string));
1645 free((yyvsp[(1) - (4)].string));
1646 free((yyvsp[(2) - (4)].string));
1648 break;
1650 case 10:
1651 #line 223 "cmDependsFortranParser.y"
1653 cmDependsFortranParser* parser =
1654 cmDependsFortran_yyget_extra(yyscanner);
1655 cmDependsFortranParser_RuleInclude(parser, (yyvsp[(2) - (4)].string));
1656 free((yyvsp[(2) - (4)].string));
1658 break;
1660 case 11:
1661 #line 230 "cmDependsFortranParser.y"
1663 cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
1664 cmDependsFortranParser_RuleDefine(parser, (yyvsp[(2) - (4)].string));
1665 free((yyvsp[(2) - (4)].string));
1667 break;
1669 case 12:
1670 #line 236 "cmDependsFortranParser.y"
1672 cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
1673 cmDependsFortranParser_RuleUndef(parser, (yyvsp[(2) - (4)].string));
1674 free((yyvsp[(2) - (4)].string));
1676 break;
1678 case 13:
1679 #line 242 "cmDependsFortranParser.y"
1681 cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
1682 cmDependsFortranParser_RuleIfdef(parser, (yyvsp[(2) - (4)].string));
1683 free((yyvsp[(2) - (4)].string));
1685 break;
1687 case 14:
1688 #line 248 "cmDependsFortranParser.y"
1690 cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
1691 cmDependsFortranParser_RuleIfndef(parser, (yyvsp[(2) - (4)].string));
1692 free((yyvsp[(2) - (4)].string));
1694 break;
1696 case 15:
1697 #line 254 "cmDependsFortranParser.y"
1699 cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
1700 cmDependsFortranParser_RuleIf(parser);
1702 break;
1704 case 16:
1705 #line 259 "cmDependsFortranParser.y"
1707 cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
1708 cmDependsFortranParser_RuleElif(parser);
1710 break;
1712 case 17:
1713 #line 264 "cmDependsFortranParser.y"
1715 cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
1716 cmDependsFortranParser_RuleElse(parser);
1718 break;
1720 case 18:
1721 #line 269 "cmDependsFortranParser.y"
1723 cmDependsFortranParser* parser = cmDependsFortran_yyget_extra(yyscanner);
1724 cmDependsFortranParser_RuleEndif(parser);
1726 break;
1728 case 19:
1729 #line 274 "cmDependsFortranParser.y"
1731 free((yyvsp[(1) - (4)].string));
1733 break;
1735 case 44:
1736 #line 296 "cmDependsFortranParser.y"
1737 { free ((yyvsp[(1) - (1)].string)); }
1738 break;
1740 case 45:
1741 #line 297 "cmDependsFortranParser.y"
1742 { free ((yyvsp[(1) - (1)].string)); }
1743 break;
1746 /* Line 1267 of yacc.c. */
1747 #line 1748 "cmDependsFortranParser.cxx"
1748 default: break;
1750 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1752 YYPOPSTACK (yylen);
1753 yylen = 0;
1754 YY_STACK_PRINT (yyss, yyssp);
1756 *++yyvsp = yyval;
1759 /* Now `shift' the result of the reduction. Determine what state
1760 that goes to, based on the state we popped back to and the rule
1761 number reduced by. */
1763 yyn = yyr1[yyn];
1765 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1766 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1767 yystate = yytable[yystate];
1768 else
1769 yystate = yydefgoto[yyn - YYNTOKENS];
1771 goto yynewstate;
1774 /*------------------------------------.
1775 | yyerrlab -- here on detecting error |
1776 `------------------------------------*/
1777 yyerrlab:
1778 /* If not already recovering from an error, report this error. */
1779 if (!yyerrstatus)
1781 ++yynerrs;
1782 #if ! YYERROR_VERBOSE
1783 yyerror (YY_("syntax error"));
1784 #else
1786 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1787 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1789 YYSIZE_T yyalloc = 2 * yysize;
1790 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1791 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1792 if (yymsg != yymsgbuf)
1793 YYSTACK_FREE (yymsg);
1794 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1795 if (yymsg)
1796 yymsg_alloc = yyalloc;
1797 else
1799 yymsg = yymsgbuf;
1800 yymsg_alloc = sizeof yymsgbuf;
1804 if (0 < yysize && yysize <= yymsg_alloc)
1806 (void) yysyntax_error (yymsg, yystate, yychar);
1807 yyerror (yymsg);
1809 else
1811 yyerror (YY_("syntax error"));
1812 if (yysize != 0)
1813 goto yyexhaustedlab;
1816 #endif
1821 if (yyerrstatus == 3)
1823 /* If just tried and failed to reuse look-ahead token after an
1824 error, discard it. */
1826 if (yychar <= YYEOF)
1828 /* Return failure if at end of input. */
1829 if (yychar == YYEOF)
1830 YYABORT;
1832 else
1834 yydestruct ("Error: discarding",
1835 yytoken, &yylval);
1836 yychar = YYEMPTY;
1840 #if 0
1841 /* Else will try to reuse look-ahead token after shifting the error
1842 token. */
1843 goto yyerrlab1;
1846 /*---------------------------------------------------.
1847 | yyerrorlab -- error raised explicitly by YYERROR. |
1848 `---------------------------------------------------*/
1849 yyerrorlab:
1851 /* Pacify compilers like GCC when the user code never invokes
1852 YYERROR and the label yyerrorlab therefore never appears in user
1853 code. */
1854 if (/*CONSTCOND*/ 0)
1855 goto yyerrorlab;
1857 /* Do not reclaim the symbols of the rule which action triggered
1858 this YYERROR. */
1859 YYPOPSTACK (yylen);
1860 yylen = 0;
1861 YY_STACK_PRINT (yyss, yyssp);
1862 yystate = *yyssp;
1863 goto yyerrlab1;
1866 /*-------------------------------------------------------------.
1867 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1868 `-------------------------------------------------------------*/
1869 yyerrlab1:
1870 #endif
1871 yyerrstatus = 3; /* Each real token shifted decrements this. */
1873 for (;;)
1875 yyn = yypact[yystate];
1876 if (yyn != YYPACT_NINF)
1878 yyn += YYTERROR;
1879 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1881 yyn = yytable[yyn];
1882 if (0 < yyn)
1883 break;
1887 /* Pop the current state because it cannot handle the error token. */
1888 if (yyssp == yyss)
1889 YYABORT;
1892 yydestruct ("Error: popping",
1893 yystos[yystate], yyvsp);
1894 YYPOPSTACK (1);
1895 yystate = *yyssp;
1896 YY_STACK_PRINT (yyss, yyssp);
1899 if (yyn == YYFINAL)
1900 YYACCEPT;
1902 *++yyvsp = yylval;
1905 /* Shift the error token. */
1906 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1908 yystate = yyn;
1909 goto yynewstate;
1912 /*-------------------------------------.
1913 | yyacceptlab -- YYACCEPT comes here. |
1914 `-------------------------------------*/
1915 yyacceptlab:
1916 yyresult = 0;
1917 goto yyreturn;
1919 /*-----------------------------------.
1920 | yyabortlab -- YYABORT comes here. |
1921 `-----------------------------------*/
1922 yyabortlab:
1923 yyresult = 1;
1924 goto yyreturn;
1926 #ifndef yyoverflow
1927 /*-------------------------------------------------.
1928 | yyexhaustedlab -- memory exhaustion comes here. |
1929 `-------------------------------------------------*/
1930 yyexhaustedlab:
1931 yyerror (YY_("memory exhausted"));
1932 yyresult = 2;
1933 /* Fall through. */
1934 #endif
1936 yyreturn:
1937 if (yychar != YYEOF && yychar != YYEMPTY)
1938 yydestruct ("Cleanup: discarding lookahead",
1939 yytoken, &yylval);
1940 /* Do not reclaim the symbols of the rule which action triggered
1941 this YYABORT or YYACCEPT. */
1942 YYPOPSTACK (yylen);
1943 YY_STACK_PRINT (yyss, yyssp);
1944 while (yyssp != yyss)
1946 yydestruct ("Cleanup: popping",
1947 yystos[*yyssp], yyvsp);
1948 YYPOPSTACK (1);
1950 #ifndef yyoverflow
1951 if (yyss != yyssa)
1952 YYSTACK_FREE (yyss);
1953 #endif
1954 #if YYERROR_VERBOSE
1955 if (yymsg != yymsgbuf)
1956 YYSTACK_FREE (yymsg);
1957 #endif
1958 /* Make sure YYID is used. */
1959 return YYID (yyresult);
1963 #line 303 "cmDependsFortranParser.y"
1965 /* End of grammar */