/src/CMake/Source/LexerParser/cmFortranParser.cxx
Line | Count | Source |
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 1 |
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 cmFortran_yyparse |
69 | 0 | #define yylex cmFortran_yylex |
70 | 0 | #define yyerror cmFortran_yyerror |
71 | | #define yydebug cmFortran_yydebug |
72 | 0 | #define yynerrs cmFortran_yynerrs |
73 | | |
74 | | /* First part of user prologue. */ |
75 | | #line 1 "cmFortranParser.y" |
76 | | |
77 | | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
78 | | file LICENSE.rst or https://cmake.org/licensing for details. */ |
79 | | /*------------------------------------------------------------------------- |
80 | | Portions of this source have been derived from makedepf90 version 2.8.8, |
81 | | |
82 | | Copyright (C) 2000--2006 Erik Edelmann <erik.edelmann@iki.fi> |
83 | | |
84 | | The code was originally distributed under the GPL but permission |
85 | | from the copyright holder has been obtained to distribute this |
86 | | derived work under the CMake license. |
87 | | -------------------------------------------------------------------------*/ |
88 | | |
89 | | /* |
90 | | |
91 | | This file must be translated to C and modified to build everywhere. |
92 | | |
93 | | Run bison like this: |
94 | | |
95 | | bison --name-prefix=cmFortran_yy |
96 | | --defines=cmFortranParserTokens.h |
97 | | -ocmFortranParser.cxx |
98 | | cmFortranParser.y |
99 | | |
100 | | */ |
101 | | |
102 | | #include "cmConfigure.h" // IWYU pragma: keep |
103 | | |
104 | | #include "cmsys/String.h" |
105 | | #include <stdlib.h> |
106 | | #include <string.h> |
107 | | |
108 | | /*-------------------------------------------------------------------------*/ |
109 | | #define cmFortranParser_cxx |
110 | | #include "cmFortranParser.h" /* Interface to parser object. */ |
111 | | |
112 | | /* Forward declare the lexer entry point. */ |
113 | | YY_DECL; |
114 | | |
115 | | /* Helper function to forward error callback from parser. */ |
116 | | static void cmFortran_yyerror(yyscan_t yyscanner, const char* message) |
117 | 0 | { |
118 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
119 | 0 | cmFortranParser_Error(parser, message); |
120 | 0 | } |
121 | | |
122 | | /* Disable some warnings in the generated code. */ |
123 | | #ifdef _MSC_VER |
124 | | # pragma warning (disable: 4102) /* Unused goto label. */ |
125 | | # pragma warning (disable: 4065) /* Switch contains default but no case. */ |
126 | | # pragma warning (disable: 4701) /* Local variable may not be initialized. */ |
127 | | # pragma warning (disable: 4702) /* Unreachable code. */ |
128 | | # pragma warning (disable: 4127) /* Conditional expression is constant. */ |
129 | | # pragma warning (disable: 4244) /* Conversion to smaller type, data loss. */ |
130 | | #endif |
131 | | #if defined(__GNUC__) && __GNUC__ >= 8 |
132 | | # pragma GCC diagnostic ignored "-Wconversion" |
133 | | # pragma GCC diagnostic ignored "-Wfree-nonheap-object" |
134 | | #endif |
135 | | #if defined(__clang__) && defined(__has_warning) |
136 | | # if __has_warning("-Wunused-but-set-variable") |
137 | | # pragma clang diagnostic ignored "-Wunused-but-set-variable" |
138 | | # endif |
139 | | #endif |
140 | | |
141 | | #line 142 "cmFortranParser.cxx" |
142 | | |
143 | | # ifndef YY_CAST |
144 | | # ifdef __cplusplus |
145 | 0 | # define YY_CAST(Type, Val) static_cast<Type> (Val) |
146 | | # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val) |
147 | | # else |
148 | | # define YY_CAST(Type, Val) ((Type) (Val)) |
149 | | # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) |
150 | | # endif |
151 | | # endif |
152 | | # ifndef YY_NULLPTR |
153 | | # if defined __cplusplus |
154 | | # if 201103L <= __cplusplus |
155 | 0 | # define YY_NULLPTR nullptr |
156 | | # else |
157 | | # define YY_NULLPTR 0 |
158 | | # endif |
159 | | # else |
160 | | # define YY_NULLPTR ((void*)0) |
161 | | # endif |
162 | | # endif |
163 | | |
164 | | #include "cmFortranParserTokens.h" |
165 | | /* Symbol kind. */ |
166 | | enum yysymbol_kind_t |
167 | | { |
168 | | YYSYMBOL_YYEMPTY = -2, |
169 | | YYSYMBOL_YYEOF = 0, /* "end of file" */ |
170 | | YYSYMBOL_YYerror = 1, /* error */ |
171 | | YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ |
172 | | YYSYMBOL_EOSTMT = 3, /* EOSTMT */ |
173 | | YYSYMBOL_ASSIGNMENT_OP = 4, /* ASSIGNMENT_OP */ |
174 | | YYSYMBOL_GARBAGE = 5, /* GARBAGE */ |
175 | | YYSYMBOL_CPP_LINE_DIRECTIVE = 6, /* CPP_LINE_DIRECTIVE */ |
176 | | YYSYMBOL_CPP_INCLUDE = 7, /* CPP_INCLUDE */ |
177 | | YYSYMBOL_F90PPR_INCLUDE = 8, /* F90PPR_INCLUDE */ |
178 | | YYSYMBOL_COCO_INCLUDE = 9, /* COCO_INCLUDE */ |
179 | | YYSYMBOL_F90PPR_DEFINE = 10, /* F90PPR_DEFINE */ |
180 | | YYSYMBOL_CPP_DEFINE = 11, /* CPP_DEFINE */ |
181 | | YYSYMBOL_F90PPR_UNDEF = 12, /* F90PPR_UNDEF */ |
182 | | YYSYMBOL_CPP_UNDEF = 13, /* CPP_UNDEF */ |
183 | | YYSYMBOL_CPP_IFDEF = 14, /* CPP_IFDEF */ |
184 | | YYSYMBOL_CPP_IFNDEF = 15, /* CPP_IFNDEF */ |
185 | | YYSYMBOL_CPP_IF = 16, /* CPP_IF */ |
186 | | YYSYMBOL_CPP_ELSE = 17, /* CPP_ELSE */ |
187 | | YYSYMBOL_CPP_ELIF = 18, /* CPP_ELIF */ |
188 | | YYSYMBOL_CPP_ENDIF = 19, /* CPP_ENDIF */ |
189 | | YYSYMBOL_F90PPR_IFDEF = 20, /* F90PPR_IFDEF */ |
190 | | YYSYMBOL_F90PPR_IFNDEF = 21, /* F90PPR_IFNDEF */ |
191 | | YYSYMBOL_F90PPR_IF = 22, /* F90PPR_IF */ |
192 | | YYSYMBOL_F90PPR_ELSE = 23, /* F90PPR_ELSE */ |
193 | | YYSYMBOL_F90PPR_ELIF = 24, /* F90PPR_ELIF */ |
194 | | YYSYMBOL_F90PPR_ENDIF = 25, /* F90PPR_ENDIF */ |
195 | | YYSYMBOL_COMMA = 26, /* COMMA */ |
196 | | YYSYMBOL_COLON = 27, /* COLON */ |
197 | | YYSYMBOL_DCOLON = 28, /* DCOLON */ |
198 | | YYSYMBOL_LPAREN = 29, /* LPAREN */ |
199 | | YYSYMBOL_RPAREN = 30, /* RPAREN */ |
200 | | YYSYMBOL_UNTERMINATED_STRING = 31, /* UNTERMINATED_STRING */ |
201 | | YYSYMBOL_STRING = 32, /* STRING */ |
202 | | YYSYMBOL_WORD = 33, /* WORD */ |
203 | | YYSYMBOL_CPP_INCLUDE_ANGLE = 34, /* CPP_INCLUDE_ANGLE */ |
204 | | YYSYMBOL_END = 35, /* END */ |
205 | | YYSYMBOL_INCLUDE = 36, /* INCLUDE */ |
206 | | YYSYMBOL_INTERFACE = 37, /* INTERFACE */ |
207 | | YYSYMBOL_MODULE = 38, /* MODULE */ |
208 | | YYSYMBOL_SUBMODULE = 39, /* SUBMODULE */ |
209 | | YYSYMBOL_USE = 40, /* USE */ |
210 | | YYSYMBOL_YYACCEPT = 41, /* $accept */ |
211 | | YYSYMBOL_code = 42, /* code */ |
212 | | YYSYMBOL_stmt = 43, /* stmt */ |
213 | | YYSYMBOL_include = 44, /* include */ |
214 | | YYSYMBOL_define = 45, /* define */ |
215 | | YYSYMBOL_undef = 46, /* undef */ |
216 | | YYSYMBOL_ifdef = 47, /* ifdef */ |
217 | | YYSYMBOL_ifndef = 48, /* ifndef */ |
218 | | YYSYMBOL_if = 49, /* if */ |
219 | | YYSYMBOL_elif = 50, /* elif */ |
220 | | YYSYMBOL_else = 51, /* else */ |
221 | | YYSYMBOL_endif = 52, /* endif */ |
222 | | YYSYMBOL_other = 53, /* other */ |
223 | | YYSYMBOL_misc_code = 54 /* misc_code */ |
224 | | }; |
225 | | typedef enum yysymbol_kind_t yysymbol_kind_t; |
226 | | |
227 | | |
228 | | |
229 | | |
230 | | #ifdef short |
231 | | # undef short |
232 | | #endif |
233 | | |
234 | | /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure |
235 | | <limits.h> and (if available) <stdint.h> are included |
236 | | so that the code can choose integer types of a good width. */ |
237 | | |
238 | | #ifndef __PTRDIFF_MAX__ |
239 | | # include <limits.h> /* INFRINGES ON USER NAME SPACE */ |
240 | | # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ |
241 | | # include <stdint.h> /* INFRINGES ON USER NAME SPACE */ |
242 | | # define YY_STDINT_H |
243 | | # endif |
244 | | #endif |
245 | | |
246 | | /* Narrow types that promote to a signed type and that can represent a |
247 | | signed or unsigned integer of at least N bits. In tables they can |
248 | | save space and decrease cache pressure. Promoting to a signed type |
249 | | helps avoid bugs in integer arithmetic. */ |
250 | | |
251 | | #ifdef __INT_LEAST8_MAX__ |
252 | | typedef __INT_LEAST8_TYPE__ yytype_int8; |
253 | | #elif defined YY_STDINT_H |
254 | | typedef int_least8_t yytype_int8; |
255 | | #else |
256 | | typedef signed char yytype_int8; |
257 | | #endif |
258 | | |
259 | | #ifdef __INT_LEAST16_MAX__ |
260 | | typedef __INT_LEAST16_TYPE__ yytype_int16; |
261 | | #elif defined YY_STDINT_H |
262 | | typedef int_least16_t yytype_int16; |
263 | | #else |
264 | | typedef short yytype_int16; |
265 | | #endif |
266 | | |
267 | | /* Work around bug in HP-UX 11.23, which defines these macros |
268 | | incorrectly for preprocessor constants. This workaround can likely |
269 | | be removed in 2023, as HPE has promised support for HP-UX 11.23 |
270 | | (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of |
271 | | <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */ |
272 | | #ifdef __hpux |
273 | | # undef UINT_LEAST8_MAX |
274 | | # undef UINT_LEAST16_MAX |
275 | | # define UINT_LEAST8_MAX 255 |
276 | | # define UINT_LEAST16_MAX 65535 |
277 | | #endif |
278 | | |
279 | | #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ |
280 | | typedef __UINT_LEAST8_TYPE__ yytype_uint8; |
281 | | #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ |
282 | | && UINT_LEAST8_MAX <= INT_MAX) |
283 | | typedef uint_least8_t yytype_uint8; |
284 | | #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX |
285 | | typedef unsigned char yytype_uint8; |
286 | | #else |
287 | | typedef short yytype_uint8; |
288 | | #endif |
289 | | |
290 | | #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ |
291 | | typedef __UINT_LEAST16_TYPE__ yytype_uint16; |
292 | | #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ |
293 | | && UINT_LEAST16_MAX <= INT_MAX) |
294 | | typedef uint_least16_t yytype_uint16; |
295 | | #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX |
296 | | typedef unsigned short yytype_uint16; |
297 | | #else |
298 | | typedef int yytype_uint16; |
299 | | #endif |
300 | | |
301 | | #ifndef YYPTRDIFF_T |
302 | | # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ |
303 | 0 | # define YYPTRDIFF_T __PTRDIFF_TYPE__ |
304 | | # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ |
305 | | # elif defined PTRDIFF_MAX |
306 | | # ifndef ptrdiff_t |
307 | | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
308 | | # endif |
309 | | # define YYPTRDIFF_T ptrdiff_t |
310 | | # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX |
311 | | # else |
312 | | # define YYPTRDIFF_T long |
313 | | # define YYPTRDIFF_MAXIMUM LONG_MAX |
314 | | # endif |
315 | | #endif |
316 | | |
317 | | #ifndef YYSIZE_T |
318 | | # ifdef __SIZE_TYPE__ |
319 | | # define YYSIZE_T __SIZE_TYPE__ |
320 | | # elif defined size_t |
321 | | # define YYSIZE_T size_t |
322 | | # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ |
323 | | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
324 | | # define YYSIZE_T size_t |
325 | | # else |
326 | | # define YYSIZE_T unsigned |
327 | | # endif |
328 | | #endif |
329 | | |
330 | | #define YYSIZE_MAXIMUM \ |
331 | 0 | YY_CAST (YYPTRDIFF_T, \ |
332 | | (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ |
333 | | ? YYPTRDIFF_MAXIMUM \ |
334 | | : YY_CAST (YYSIZE_T, -1))) |
335 | | |
336 | | #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) |
337 | | |
338 | | |
339 | | /* Stored state numbers (used for stacks). */ |
340 | | typedef yytype_int8 yy_state_t; |
341 | | |
342 | | /* State numbers in computations. */ |
343 | | typedef int yy_state_fast_t; |
344 | | |
345 | | #ifndef YY_ |
346 | | # if defined YYENABLE_NLS && YYENABLE_NLS |
347 | | # if ENABLE_NLS |
348 | | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
349 | | # define YY_(Msgid) dgettext ("bison-runtime", Msgid) |
350 | | # endif |
351 | | # endif |
352 | | # ifndef YY_ |
353 | 0 | # define YY_(Msgid) Msgid |
354 | | # endif |
355 | | #endif |
356 | | |
357 | | |
358 | | #ifndef YY_ATTRIBUTE_PURE |
359 | | # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) |
360 | | # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) |
361 | | # else |
362 | | # define YY_ATTRIBUTE_PURE |
363 | | # endif |
364 | | #endif |
365 | | |
366 | | #ifndef YY_ATTRIBUTE_UNUSED |
367 | | # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) |
368 | | # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) |
369 | | # else |
370 | | # define YY_ATTRIBUTE_UNUSED |
371 | | # endif |
372 | | #endif |
373 | | |
374 | | /* Suppress unused-variable warnings by "using" E. */ |
375 | | #if ! defined lint || defined __GNUC__ |
376 | 0 | # define YY_USE(E) ((void) (E)) |
377 | | #else |
378 | | # define YY_USE(E) /* empty */ |
379 | | #endif |
380 | | |
381 | | /* Suppress an incorrect diagnostic about yylval being uninitialized. */ |
382 | | #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ |
383 | | # if __GNUC__ * 100 + __GNUC_MINOR__ < 407 |
384 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ |
385 | | _Pragma ("GCC diagnostic push") \ |
386 | | _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") |
387 | | # else |
388 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ |
389 | | _Pragma ("GCC diagnostic push") \ |
390 | | _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ |
391 | | _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") |
392 | | # endif |
393 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ |
394 | | _Pragma ("GCC diagnostic pop") |
395 | | #else |
396 | 0 | # define YY_INITIAL_VALUE(Value) Value |
397 | | #endif |
398 | | #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
399 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
400 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_END |
401 | | #endif |
402 | | #ifndef YY_INITIAL_VALUE |
403 | | # define YY_INITIAL_VALUE(Value) /* Nothing. */ |
404 | | #endif |
405 | | |
406 | | #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ |
407 | | # define YY_IGNORE_USELESS_CAST_BEGIN \ |
408 | | _Pragma ("GCC diagnostic push") \ |
409 | | _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") |
410 | | # define YY_IGNORE_USELESS_CAST_END \ |
411 | | _Pragma ("GCC diagnostic pop") |
412 | | #endif |
413 | | #ifndef YY_IGNORE_USELESS_CAST_BEGIN |
414 | | # define YY_IGNORE_USELESS_CAST_BEGIN |
415 | | # define YY_IGNORE_USELESS_CAST_END |
416 | | #endif |
417 | | |
418 | | |
419 | 0 | #define YY_ASSERT(E) ((void) (0 && (E))) |
420 | | |
421 | | #if 1 |
422 | | |
423 | | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
424 | | |
425 | | # ifdef YYSTACK_USE_ALLOCA |
426 | | # if YYSTACK_USE_ALLOCA |
427 | | # ifdef __GNUC__ |
428 | | # define YYSTACK_ALLOC __builtin_alloca |
429 | | # elif defined __BUILTIN_VA_ARG_INCR |
430 | | # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ |
431 | | # elif defined _AIX |
432 | | # define YYSTACK_ALLOC __alloca |
433 | | # elif defined _MSC_VER |
434 | | # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ |
435 | | # define alloca _alloca |
436 | | # else |
437 | | # define YYSTACK_ALLOC alloca |
438 | | # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS |
439 | | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
440 | | /* Use EXIT_SUCCESS as a witness for stdlib.h. */ |
441 | | # ifndef EXIT_SUCCESS |
442 | | # define EXIT_SUCCESS 0 |
443 | | # endif |
444 | | # endif |
445 | | # endif |
446 | | # endif |
447 | | # endif |
448 | | |
449 | | # ifdef YYSTACK_ALLOC |
450 | | /* Pacify GCC's 'empty if-body' warning. */ |
451 | | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) |
452 | | # ifndef YYSTACK_ALLOC_MAXIMUM |
453 | | /* The OS might guarantee only one guard page at the bottom of the stack, |
454 | | and a page size can be as small as 4096 bytes. So we cannot safely |
455 | | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number |
456 | | to allow for a few compiler-allocated temporary stack slots. */ |
457 | | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
458 | | # endif |
459 | | # else |
460 | | # define YYSTACK_ALLOC YYMALLOC |
461 | 0 | # define YYSTACK_FREE YYFREE |
462 | | # ifndef YYSTACK_ALLOC_MAXIMUM |
463 | 0 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
464 | | # endif |
465 | | # if (defined __cplusplus && ! defined EXIT_SUCCESS \ |
466 | | && ! ((defined YYMALLOC || defined malloc) \ |
467 | | && (defined YYFREE || defined free))) |
468 | | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
469 | | # ifndef EXIT_SUCCESS |
470 | | # define EXIT_SUCCESS 0 |
471 | | # endif |
472 | | # endif |
473 | | # ifndef YYMALLOC |
474 | | # define YYMALLOC malloc |
475 | | # if ! defined malloc && ! defined EXIT_SUCCESS |
476 | | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
477 | | # endif |
478 | | # endif |
479 | | # ifndef YYFREE |
480 | 0 | # define YYFREE free |
481 | | # if ! defined free && ! defined EXIT_SUCCESS |
482 | | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
483 | | # endif |
484 | | # endif |
485 | | # endif |
486 | | #endif /* 1 */ |
487 | | |
488 | | #if (! defined yyoverflow \ |
489 | | && (! defined __cplusplus \ |
490 | | || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) |
491 | | |
492 | | /* A type that is properly aligned for any stack member. */ |
493 | | union yyalloc |
494 | | { |
495 | | yy_state_t yyss_alloc; |
496 | | YYSTYPE yyvs_alloc; |
497 | | }; |
498 | | |
499 | | /* The size of the maximum gap between one aligned stack and the next. */ |
500 | | # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) |
501 | | |
502 | | /* The size of an array large to enough to hold all stacks, each with |
503 | | N elements. */ |
504 | | # define YYSTACK_BYTES(N) \ |
505 | | ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ |
506 | | + YYSTACK_GAP_MAXIMUM) |
507 | | |
508 | | # define YYCOPY_NEEDED 1 |
509 | | |
510 | | /* Relocate STACK from its old location to the new one. The |
511 | | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
512 | | elements in the stack, and YYPTR gives the new location of the |
513 | | stack. Advance YYPTR to a properly aligned location for the next |
514 | | stack. */ |
515 | | # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
516 | | do \ |
517 | | { \ |
518 | | YYPTRDIFF_T yynewbytes; \ |
519 | | YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ |
520 | | Stack = &yyptr->Stack_alloc; \ |
521 | | yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
522 | | yyptr += yynewbytes / YYSIZEOF (*yyptr); \ |
523 | | } \ |
524 | | while (0) |
525 | | |
526 | | #endif |
527 | | |
528 | | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
529 | | /* Copy COUNT objects from SRC to DST. The source and destination do |
530 | | not overlap. */ |
531 | | # ifndef YYCOPY |
532 | | # if defined __GNUC__ && 1 < __GNUC__ |
533 | | # define YYCOPY(Dst, Src, Count) \ |
534 | | __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) |
535 | | # else |
536 | | # define YYCOPY(Dst, Src, Count) \ |
537 | | do \ |
538 | | { \ |
539 | | YYPTRDIFF_T yyi; \ |
540 | | for (yyi = 0; yyi < (Count); yyi++) \ |
541 | | (Dst)[yyi] = (Src)[yyi]; \ |
542 | | } \ |
543 | | while (0) |
544 | | # endif |
545 | | # endif |
546 | | #endif /* !YYCOPY_NEEDED */ |
547 | | |
548 | | /* YYFINAL -- State number of the termination state. */ |
549 | 0 | #define YYFINAL 2 |
550 | | /* YYLAST -- Last index in YYTABLE. */ |
551 | 0 | #define YYLAST 433 |
552 | | |
553 | | /* YYNTOKENS -- Number of terminals. */ |
554 | 0 | #define YYNTOKENS 41 |
555 | | /* YYNNTS -- Number of nonterminals. */ |
556 | | #define YYNNTS 14 |
557 | | /* YYNRULES -- Number of rules. */ |
558 | | #define YYNRULES 65 |
559 | | /* YYNSTATES -- Number of states. */ |
560 | | #define YYNSTATES 123 |
561 | | |
562 | | /* YYMAXUTOK -- Last valid token kind. */ |
563 | 0 | #define YYMAXUTOK 295 |
564 | | |
565 | | |
566 | | /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM |
567 | | as returned by yylex, with out-of-bounds checking. */ |
568 | | #define YYTRANSLATE(YYX) \ |
569 | 0 | (0 <= (YYX) && (YYX) <= YYMAXUTOK \ |
570 | 0 | ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ |
571 | 0 | : YYSYMBOL_YYUNDEF) |
572 | | |
573 | | /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM |
574 | | as returned by yylex. */ |
575 | | static const yytype_int8 yytranslate[] = |
576 | | { |
577 | | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
578 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
579 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
580 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
581 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
582 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
583 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
584 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
585 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
586 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
587 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
588 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
589 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
590 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
591 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
592 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
593 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
594 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
595 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
596 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
597 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
598 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
599 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
600 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
601 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
602 | | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
603 | | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
604 | | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
605 | | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, |
606 | | 35, 36, 37, 38, 39, 40 |
607 | | }; |
608 | | |
609 | | #if YYDEBUG |
610 | | /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ |
611 | | static const yytype_int16 yyrline[] = |
612 | | { |
613 | | 0, 106, 106, 106, 109, 113, 118, 123, 129, 136, |
614 | | 141, 146, 150, 155, 167, 172, 177, 182, 187, 192, |
615 | | 197, 202, 207, 211, 215, 219, 223, 224, 229, 229, |
616 | | 229, 230, 230, 231, 231, 232, 232, 233, 233, 234, |
617 | | 234, 235, 235, 236, 236, 237, 237, 238, 238, 241, |
618 | | 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, |
619 | | 252, 253, 254, 255, 256, 257 |
620 | | }; |
621 | | #endif |
622 | | |
623 | | /** Accessing symbol of state STATE. */ |
624 | 0 | #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) |
625 | | |
626 | | #if 1 |
627 | | /* The user-facing name of the symbol whose (internal) number is |
628 | | YYSYMBOL. No bounds checking. */ |
629 | | static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; |
630 | | |
631 | | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
632 | | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
633 | | static const char *const yytname[] = |
634 | | { |
635 | | "\"end of file\"", "error", "\"invalid token\"", "EOSTMT", |
636 | | "ASSIGNMENT_OP", "GARBAGE", "CPP_LINE_DIRECTIVE", "CPP_INCLUDE", |
637 | | "F90PPR_INCLUDE", "COCO_INCLUDE", "F90PPR_DEFINE", "CPP_DEFINE", |
638 | | "F90PPR_UNDEF", "CPP_UNDEF", "CPP_IFDEF", "CPP_IFNDEF", "CPP_IF", |
639 | | "CPP_ELSE", "CPP_ELIF", "CPP_ENDIF", "F90PPR_IFDEF", "F90PPR_IFNDEF", |
640 | | "F90PPR_IF", "F90PPR_ELSE", "F90PPR_ELIF", "F90PPR_ENDIF", "COMMA", |
641 | | "COLON", "DCOLON", "LPAREN", "RPAREN", "UNTERMINATED_STRING", "STRING", |
642 | | "WORD", "CPP_INCLUDE_ANGLE", "END", "INCLUDE", "INTERFACE", "MODULE", |
643 | | "SUBMODULE", "USE", "$accept", "code", "stmt", "include", "define", |
644 | | "undef", "ifdef", "ifndef", "if", "elif", "else", "endif", "other", |
645 | | "misc_code", YY_NULLPTR |
646 | | }; |
647 | | |
648 | | static const char * |
649 | | yysymbol_name (yysymbol_kind_t yysymbol) |
650 | 0 | { |
651 | 0 | return yytname[yysymbol]; |
652 | 0 | } |
653 | | #endif |
654 | | |
655 | 0 | #define YYPACT_NINF (-39) |
656 | | |
657 | | #define yypact_value_is_default(Yyn) \ |
658 | 0 | ((Yyn) == YYPACT_NINF) |
659 | | |
660 | | #define YYTABLE_NINF (-1) |
661 | | |
662 | | #define yytable_value_is_error(Yyn) \ |
663 | 0 | 0 |
664 | | |
665 | | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
666 | | STATE-NUM. */ |
667 | | static const yytype_int16 yypact[] = |
668 | | { |
669 | | -39, 21, -39, 5, -39, -23, -39, -39, -39, -39, |
670 | | -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, |
671 | | -39, -39, -39, -39, -39, -39, -25, -19, 20, -8, |
672 | | -15, -22, -39, -6, 14, 15, 16, 17, -39, -39, |
673 | | -39, -39, -39, -39, 59, 51, 48, -39, 63, 64, |
674 | | 35, 36, 37, -39, -39, -39, -39, -39, -39, 75, |
675 | | 113, 128, 166, 181, -39, -39, -39, -39, -39, -39, |
676 | | -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, |
677 | | -39, -39, -39, -39, 68, -39, -39, -39, -20, 44, |
678 | | -39, 219, 234, 272, 287, 325, 340, -39, -39, -39, |
679 | | -39, -39, -39, 40, 41, 42, 378, -39, -39, -39, |
680 | | -39, -39, -39, 46, 79, -39, -39, 50, -39, 393, |
681 | | 90, -39, -39 |
682 | | }; |
683 | | |
684 | | /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. |
685 | | Performed when YYTABLE does not specify something else to do. Zero |
686 | | means the default is an error. */ |
687 | | static const yytype_int8 yydefact[] = |
688 | | { |
689 | | 2, 0, 1, 0, 26, 0, 28, 29, 30, 32, |
690 | | 31, 34, 33, 35, 37, 39, 43, 41, 45, 36, |
691 | | 38, 40, 44, 42, 46, 47, 0, 0, 0, 0, |
692 | | 0, 0, 3, 0, 0, 0, 0, 0, 47, 47, |
693 | | 47, 47, 27, 47, 0, 0, 0, 4, 0, 0, |
694 | | 0, 0, 0, 47, 47, 47, 47, 47, 47, 0, |
695 | | 0, 0, 0, 0, 16, 58, 57, 65, 63, 59, |
696 | | 60, 61, 62, 64, 56, 49, 50, 51, 52, 53, |
697 | | 54, 55, 48, 11, 0, 14, 9, 6, 0, 0, |
698 | | 47, 0, 0, 0, 0, 0, 0, 22, 23, 24, |
699 | | 25, 15, 10, 0, 0, 0, 0, 5, 17, 18, |
700 | | 19, 20, 21, 0, 0, 47, 12, 0, 7, 0, |
701 | | 0, 13, 8 |
702 | | }; |
703 | | |
704 | | /* YYPGOTO[NTERM-NUM]. */ |
705 | | static const yytype_int8 yypgoto[] = |
706 | | { |
707 | | -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, |
708 | | -39, -39, -38, -39 |
709 | | }; |
710 | | |
711 | | /* YYDEFGOTO[NTERM-NUM]. */ |
712 | | static const yytype_int8 yydefgoto[] = |
713 | | { |
714 | | 0, 1, 32, 33, 34, 35, 36, 37, 38, 39, |
715 | | 40, 41, 44, 82 |
716 | | }; |
717 | | |
718 | | /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If |
719 | | positive, shift that token. If negative, reduce the rule whose |
720 | | number is the opposite. If YYTABLE_NINF, syntax error. */ |
721 | | static const yytype_int8 yytable[] = |
722 | | { |
723 | | 59, 60, 61, 62, 51, 63, 52, 103, 42, 43, |
724 | | 104, 53, 45, 46, 50, 91, 92, 93, 94, 95, |
725 | | 96, 2, 3, 47, 4, 49, 54, 5, 6, 7, |
726 | | 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, |
727 | | 18, 19, 20, 21, 22, 23, 24, 55, 56, 57, |
728 | | 58, 85, 106, 48, 83, 25, 26, 27, 28, 29, |
729 | | 30, 31, 64, 65, 66, 67, 86, 87, 88, 89, |
730 | | 90, 102, 105, 113, 114, 115, 117, 119, 97, 65, |
731 | | 66, 67, 118, 120, 84, 68, 69, 70, 71, 72, |
732 | | 73, 74, 75, 122, 76, 77, 78, 79, 80, 81, |
733 | | 0, 68, 69, 70, 71, 72, 73, 74, 75, 0, |
734 | | 76, 77, 78, 79, 80, 81, 98, 65, 66, 67, |
735 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
736 | | 0, 99, 65, 66, 67, 0, 0, 0, 0, 68, |
737 | | 69, 70, 71, 72, 73, 74, 75, 0, 76, 77, |
738 | | 78, 79, 80, 81, 68, 69, 70, 71, 72, 73, |
739 | | 74, 75, 0, 76, 77, 78, 79, 80, 81, 100, |
740 | | 65, 66, 67, 0, 0, 0, 0, 0, 0, 0, |
741 | | 0, 0, 0, 0, 101, 65, 66, 67, 0, 0, |
742 | | 0, 0, 68, 69, 70, 71, 72, 73, 74, 75, |
743 | | 0, 76, 77, 78, 79, 80, 81, 68, 69, 70, |
744 | | 71, 72, 73, 74, 75, 0, 76, 77, 78, 79, |
745 | | 80, 81, 107, 65, 66, 67, 0, 0, 0, 0, |
746 | | 0, 0, 0, 0, 0, 0, 0, 108, 65, 66, |
747 | | 67, 0, 0, 0, 0, 68, 69, 70, 71, 72, |
748 | | 73, 74, 75, 0, 76, 77, 78, 79, 80, 81, |
749 | | 68, 69, 70, 71, 72, 73, 74, 75, 0, 76, |
750 | | 77, 78, 79, 80, 81, 109, 65, 66, 67, 0, |
751 | | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
752 | | 110, 65, 66, 67, 0, 0, 0, 0, 68, 69, |
753 | | 70, 71, 72, 73, 74, 75, 0, 76, 77, 78, |
754 | | 79, 80, 81, 68, 69, 70, 71, 72, 73, 74, |
755 | | 75, 0, 76, 77, 78, 79, 80, 81, 111, 65, |
756 | | 66, 67, 0, 0, 0, 0, 0, 0, 0, 0, |
757 | | 0, 0, 0, 112, 65, 66, 67, 0, 0, 0, |
758 | | 0, 68, 69, 70, 71, 72, 73, 74, 75, 0, |
759 | | 76, 77, 78, 79, 80, 81, 68, 69, 70, 71, |
760 | | 72, 73, 74, 75, 0, 76, 77, 78, 79, 80, |
761 | | 81, 116, 65, 66, 67, 0, 0, 0, 0, 0, |
762 | | 0, 0, 0, 0, 0, 0, 121, 65, 66, 67, |
763 | | 0, 0, 0, 0, 68, 69, 70, 71, 72, 73, |
764 | | 74, 75, 0, 76, 77, 78, 79, 80, 81, 68, |
765 | | 69, 70, 71, 72, 73, 74, 75, 0, 76, 77, |
766 | | 78, 79, 80, 81 |
767 | | }; |
768 | | |
769 | | static const yytype_int8 yycheck[] = |
770 | | { |
771 | | 38, 39, 40, 41, 26, 43, 28, 27, 3, 32, |
772 | | 30, 33, 37, 32, 29, 53, 54, 55, 56, 57, |
773 | | 58, 0, 1, 3, 3, 33, 32, 6, 7, 8, |
774 | | 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, |
775 | | 19, 20, 21, 22, 23, 24, 25, 33, 33, 33, |
776 | | 33, 3, 90, 33, 3, 34, 35, 36, 37, 38, |
777 | | 39, 40, 3, 4, 5, 6, 3, 3, 33, 33, |
778 | | 33, 3, 28, 33, 33, 33, 30, 115, 3, 4, |
779 | | 5, 6, 3, 33, 33, 26, 27, 28, 29, 30, |
780 | | 31, 32, 33, 3, 35, 36, 37, 38, 39, 40, |
781 | | -1, 26, 27, 28, 29, 30, 31, 32, 33, -1, |
782 | | 35, 36, 37, 38, 39, 40, 3, 4, 5, 6, |
783 | | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
784 | | -1, 3, 4, 5, 6, -1, -1, -1, -1, 26, |
785 | | 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, |
786 | | 37, 38, 39, 40, 26, 27, 28, 29, 30, 31, |
787 | | 32, 33, -1, 35, 36, 37, 38, 39, 40, 3, |
788 | | 4, 5, 6, -1, -1, -1, -1, -1, -1, -1, |
789 | | -1, -1, -1, -1, 3, 4, 5, 6, -1, -1, |
790 | | -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, |
791 | | -1, 35, 36, 37, 38, 39, 40, 26, 27, 28, |
792 | | 29, 30, 31, 32, 33, -1, 35, 36, 37, 38, |
793 | | 39, 40, 3, 4, 5, 6, -1, -1, -1, -1, |
794 | | -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, |
795 | | 6, -1, -1, -1, -1, 26, 27, 28, 29, 30, |
796 | | 31, 32, 33, -1, 35, 36, 37, 38, 39, 40, |
797 | | 26, 27, 28, 29, 30, 31, 32, 33, -1, 35, |
798 | | 36, 37, 38, 39, 40, 3, 4, 5, 6, -1, |
799 | | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
800 | | 3, 4, 5, 6, -1, -1, -1, -1, 26, 27, |
801 | | 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, |
802 | | 38, 39, 40, 26, 27, 28, 29, 30, 31, 32, |
803 | | 33, -1, 35, 36, 37, 38, 39, 40, 3, 4, |
804 | | 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, |
805 | | -1, -1, -1, 3, 4, 5, 6, -1, -1, -1, |
806 | | -1, 26, 27, 28, 29, 30, 31, 32, 33, -1, |
807 | | 35, 36, 37, 38, 39, 40, 26, 27, 28, 29, |
808 | | 30, 31, 32, 33, -1, 35, 36, 37, 38, 39, |
809 | | 40, 3, 4, 5, 6, -1, -1, -1, -1, -1, |
810 | | -1, -1, -1, -1, -1, -1, 3, 4, 5, 6, |
811 | | -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, |
812 | | 32, 33, -1, 35, 36, 37, 38, 39, 40, 26, |
813 | | 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, |
814 | | 37, 38, 39, 40 |
815 | | }; |
816 | | |
817 | | /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of |
818 | | state STATE-NUM. */ |
819 | | static const yytype_int8 yystos[] = |
820 | | { |
821 | | 0, 42, 0, 1, 3, 6, 7, 8, 9, 10, |
822 | | 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, |
823 | | 21, 22, 23, 24, 25, 34, 35, 36, 37, 38, |
824 | | 39, 40, 43, 44, 45, 46, 47, 48, 49, 50, |
825 | | 51, 52, 3, 32, 53, 37, 32, 3, 33, 33, |
826 | | 29, 26, 28, 33, 32, 33, 33, 33, 33, 53, |
827 | | 53, 53, 53, 53, 3, 4, 5, 6, 26, 27, |
828 | | 28, 29, 30, 31, 32, 33, 35, 36, 37, 38, |
829 | | 39, 40, 54, 3, 33, 3, 3, 3, 33, 33, |
830 | | 33, 53, 53, 53, 53, 53, 53, 3, 3, 3, |
831 | | 3, 3, 3, 27, 30, 28, 53, 3, 3, 3, |
832 | | 3, 3, 3, 33, 33, 33, 3, 30, 3, 53, |
833 | | 33, 3, 3 |
834 | | }; |
835 | | |
836 | | /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ |
837 | | static const yytype_int8 yyr1[] = |
838 | | { |
839 | | 0, 41, 42, 42, 43, 43, 43, 43, 43, 43, |
840 | | 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, |
841 | | 43, 43, 43, 43, 43, 43, 43, 43, 44, 44, |
842 | | 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, |
843 | | 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, |
844 | | 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, |
845 | | 54, 54, 54, 54, 54, 54 |
846 | | }; |
847 | | |
848 | | /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ |
849 | | static const yytype_int8 yyr2[] = |
850 | | { |
851 | | 0, 2, 0, 2, 2, 4, 3, 6, 8, 3, |
852 | | 4, 3, 5, 7, 3, 4, 3, 4, 4, 4, |
853 | | 4, 4, 3, 3, 3, 3, 1, 2, 1, 1, |
854 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
855 | | 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, |
856 | | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
857 | | 1, 1, 1, 1, 1, 1 |
858 | | }; |
859 | | |
860 | | |
861 | | enum { YYENOMEM = -2 }; |
862 | | |
863 | | #define yyerrok (yyerrstatus = 0) |
864 | | #define yyclearin (yychar = YYEMPTY) |
865 | | |
866 | 0 | #define YYACCEPT goto yyacceptlab |
867 | 0 | #define YYABORT goto yyabortlab |
868 | 0 | #define YYERROR goto yyerrorlab |
869 | 0 | #define YYNOMEM goto yyexhaustedlab |
870 | | |
871 | | |
872 | | #define YYRECOVERING() (!!yyerrstatus) |
873 | | |
874 | | #define YYBACKUP(Token, Value) \ |
875 | | do \ |
876 | | if (yychar == YYEMPTY) \ |
877 | | { \ |
878 | | yychar = (Token); \ |
879 | | yylval = (Value); \ |
880 | | YYPOPSTACK (yylen); \ |
881 | | yystate = *yyssp; \ |
882 | | goto yybackup; \ |
883 | | } \ |
884 | | else \ |
885 | | { \ |
886 | | yyerror (yyscanner, YY_("syntax error: cannot back up")); \ |
887 | | YYERROR; \ |
888 | | } \ |
889 | | while (0) |
890 | | |
891 | | /* Backward compatibility with an undocumented macro. |
892 | | Use YYerror or YYUNDEF. */ |
893 | | #define YYERRCODE YYUNDEF |
894 | | |
895 | | |
896 | | /* Enable debugging if requested. */ |
897 | | #if YYDEBUG |
898 | | |
899 | | # ifndef YYFPRINTF |
900 | | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
901 | | # define YYFPRINTF fprintf |
902 | | # endif |
903 | | |
904 | | # define YYDPRINTF(Args) \ |
905 | | do { \ |
906 | | if (yydebug) \ |
907 | | YYFPRINTF Args; \ |
908 | | } while (0) |
909 | | |
910 | | |
911 | | |
912 | | |
913 | | # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ |
914 | | do { \ |
915 | | if (yydebug) \ |
916 | | { \ |
917 | | YYFPRINTF (stderr, "%s ", Title); \ |
918 | | yy_symbol_print (stderr, \ |
919 | | Kind, Value, yyscanner); \ |
920 | | YYFPRINTF (stderr, "\n"); \ |
921 | | } \ |
922 | | } while (0) |
923 | | |
924 | | |
925 | | /*-----------------------------------. |
926 | | | Print this symbol's value on YYO. | |
927 | | `-----------------------------------*/ |
928 | | |
929 | | static void |
930 | | yy_symbol_value_print (FILE *yyo, |
931 | | yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, yyscan_t yyscanner) |
932 | | { |
933 | | FILE *yyoutput = yyo; |
934 | | YY_USE (yyoutput); |
935 | | YY_USE (yyscanner); |
936 | | if (!yyvaluep) |
937 | | return; |
938 | | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
939 | | YY_USE (yykind); |
940 | | YY_IGNORE_MAYBE_UNINITIALIZED_END |
941 | | } |
942 | | |
943 | | |
944 | | /*---------------------------. |
945 | | | Print this symbol on YYO. | |
946 | | `---------------------------*/ |
947 | | |
948 | | static void |
949 | | yy_symbol_print (FILE *yyo, |
950 | | yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, yyscan_t yyscanner) |
951 | | { |
952 | | YYFPRINTF (yyo, "%s %s (", |
953 | | yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); |
954 | | |
955 | | yy_symbol_value_print (yyo, yykind, yyvaluep, yyscanner); |
956 | | YYFPRINTF (yyo, ")"); |
957 | | } |
958 | | |
959 | | /*------------------------------------------------------------------. |
960 | | | yy_stack_print -- Print the state stack from its BOTTOM up to its | |
961 | | | TOP (included). | |
962 | | `------------------------------------------------------------------*/ |
963 | | |
964 | | static void |
965 | | yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) |
966 | | { |
967 | | YYFPRINTF (stderr, "Stack now"); |
968 | | for (; yybottom <= yytop; yybottom++) |
969 | | { |
970 | | int yybot = *yybottom; |
971 | | YYFPRINTF (stderr, " %d", yybot); |
972 | | } |
973 | | YYFPRINTF (stderr, "\n"); |
974 | | } |
975 | | |
976 | | # define YY_STACK_PRINT(Bottom, Top) \ |
977 | | do { \ |
978 | | if (yydebug) \ |
979 | | yy_stack_print ((Bottom), (Top)); \ |
980 | | } while (0) |
981 | | |
982 | | |
983 | | /*------------------------------------------------. |
984 | | | Report that the YYRULE is going to be reduced. | |
985 | | `------------------------------------------------*/ |
986 | | |
987 | | static void |
988 | | yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, |
989 | | int yyrule, yyscan_t yyscanner) |
990 | | { |
991 | | int yylno = yyrline[yyrule]; |
992 | | int yynrhs = yyr2[yyrule]; |
993 | | int yyi; |
994 | | YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", |
995 | | yyrule - 1, yylno); |
996 | | /* The symbols being reduced. */ |
997 | | for (yyi = 0; yyi < yynrhs; yyi++) |
998 | | { |
999 | | YYFPRINTF (stderr, " $%d = ", yyi + 1); |
1000 | | yy_symbol_print (stderr, |
1001 | | YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), |
1002 | | &yyvsp[(yyi + 1) - (yynrhs)], yyscanner); |
1003 | | YYFPRINTF (stderr, "\n"); |
1004 | | } |
1005 | | } |
1006 | | |
1007 | | # define YY_REDUCE_PRINT(Rule) \ |
1008 | | do { \ |
1009 | | if (yydebug) \ |
1010 | | yy_reduce_print (yyssp, yyvsp, Rule, yyscanner); \ |
1011 | | } while (0) |
1012 | | |
1013 | | /* Nonzero means print parse trace. It is left uninitialized so that |
1014 | | multiple parsers can coexist. */ |
1015 | | int yydebug; |
1016 | | #else /* !YYDEBUG */ |
1017 | 0 | # define YYDPRINTF(Args) ((void) 0) |
1018 | | # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) |
1019 | | # define YY_STACK_PRINT(Bottom, Top) |
1020 | | # define YY_REDUCE_PRINT(Rule) |
1021 | | #endif /* !YYDEBUG */ |
1022 | | |
1023 | | |
1024 | | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
1025 | | #ifndef YYINITDEPTH |
1026 | 0 | # define YYINITDEPTH 200 |
1027 | | #endif |
1028 | | |
1029 | | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
1030 | | if the built-in stack extension method is used). |
1031 | | |
1032 | | Do not make this value too large; the results are undefined if |
1033 | | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
1034 | | evaluated with infinite-precision integer arithmetic. */ |
1035 | | |
1036 | | #ifndef YYMAXDEPTH |
1037 | | # define YYMAXDEPTH 10000 |
1038 | | #endif |
1039 | | |
1040 | | |
1041 | | /* Context of a parse error. */ |
1042 | | typedef struct |
1043 | | { |
1044 | | yy_state_t *yyssp; |
1045 | | yysymbol_kind_t yytoken; |
1046 | | } yypcontext_t; |
1047 | | |
1048 | | /* Put in YYARG at most YYARGN of the expected tokens given the |
1049 | | current YYCTX, and return the number of tokens stored in YYARG. If |
1050 | | YYARG is null, return the number of expected tokens (guaranteed to |
1051 | | be less than YYNTOKENS). Return YYENOMEM on memory exhaustion. |
1052 | | Return 0 if there are more than YYARGN expected tokens, yet fill |
1053 | | YYARG up to YYARGN. */ |
1054 | | static int |
1055 | | yypcontext_expected_tokens (const yypcontext_t *yyctx, |
1056 | | yysymbol_kind_t yyarg[], int yyargn) |
1057 | 0 | { |
1058 | | /* Actual size of YYARG. */ |
1059 | 0 | int yycount = 0; |
1060 | 0 | int yyn = yypact[+*yyctx->yyssp]; |
1061 | 0 | if (!yypact_value_is_default (yyn)) |
1062 | 0 | { |
1063 | | /* Start YYX at -YYN if negative to avoid negative indexes in |
1064 | | YYCHECK. In other words, skip the first -YYN actions for |
1065 | | this state because they are default actions. */ |
1066 | 0 | int yyxbegin = yyn < 0 ? -yyn : 0; |
1067 | | /* Stay within bounds of both yycheck and yytname. */ |
1068 | 0 | int yychecklim = YYLAST - yyn + 1; |
1069 | 0 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
1070 | 0 | int yyx; |
1071 | 0 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
1072 | 0 | if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror |
1073 | 0 | && !yytable_value_is_error (yytable[yyx + yyn])) |
1074 | 0 | { |
1075 | 0 | if (!yyarg) |
1076 | 0 | ++yycount; |
1077 | 0 | else if (yycount == yyargn) |
1078 | 0 | return 0; |
1079 | 0 | else |
1080 | 0 | yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx); |
1081 | 0 | } |
1082 | 0 | } |
1083 | 0 | if (yyarg && yycount == 0 && 0 < yyargn) |
1084 | 0 | yyarg[0] = YYSYMBOL_YYEMPTY; |
1085 | 0 | return yycount; |
1086 | 0 | } |
1087 | | |
1088 | | |
1089 | | |
1090 | | |
1091 | | #ifndef yystrlen |
1092 | | # if defined __GLIBC__ && defined _STRING_H |
1093 | 0 | # define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) |
1094 | | # else |
1095 | | /* Return the length of YYSTR. */ |
1096 | | static YYPTRDIFF_T |
1097 | | yystrlen (const char *yystr) |
1098 | | { |
1099 | | YYPTRDIFF_T yylen; |
1100 | | for (yylen = 0; yystr[yylen]; yylen++) |
1101 | | continue; |
1102 | | return yylen; |
1103 | | } |
1104 | | # endif |
1105 | | #endif |
1106 | | |
1107 | | #ifndef yystpcpy |
1108 | | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
1109 | 0 | # define yystpcpy stpcpy |
1110 | | # else |
1111 | | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |
1112 | | YYDEST. */ |
1113 | | static char * |
1114 | | yystpcpy (char *yydest, const char *yysrc) |
1115 | | { |
1116 | | char *yyd = yydest; |
1117 | | const char *yys = yysrc; |
1118 | | |
1119 | | while ((*yyd++ = *yys++) != '\0') |
1120 | | continue; |
1121 | | |
1122 | | return yyd - 1; |
1123 | | } |
1124 | | # endif |
1125 | | #endif |
1126 | | |
1127 | | #ifndef yytnamerr |
1128 | | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary |
1129 | | quotes and backslashes, so that it's suitable for yyerror. The |
1130 | | heuristic is that double-quoting is unnecessary unless the string |
1131 | | contains an apostrophe, a comma, or backslash (other than |
1132 | | backslash-backslash). YYSTR is taken from yytname. If YYRES is |
1133 | | null, do not copy; instead, return the length of what the result |
1134 | | would have been. */ |
1135 | | static YYPTRDIFF_T |
1136 | | yytnamerr (char *yyres, const char *yystr) |
1137 | 0 | { |
1138 | 0 | if (*yystr == '"') |
1139 | 0 | { |
1140 | 0 | YYPTRDIFF_T yyn = 0; |
1141 | 0 | char const *yyp = yystr; |
1142 | 0 | for (;;) |
1143 | 0 | switch (*++yyp) |
1144 | 0 | { |
1145 | 0 | case '\'': |
1146 | 0 | case ',': |
1147 | 0 | goto do_not_strip_quotes; |
1148 | | |
1149 | 0 | case '\\': |
1150 | 0 | if (*++yyp != '\\') |
1151 | 0 | goto do_not_strip_quotes; |
1152 | 0 | else |
1153 | 0 | goto append; |
1154 | | |
1155 | 0 | append: |
1156 | 0 | default: |
1157 | 0 | if (yyres) |
1158 | 0 | yyres[yyn] = *yyp; |
1159 | 0 | yyn++; |
1160 | 0 | break; |
1161 | | |
1162 | 0 | case '"': |
1163 | 0 | if (yyres) |
1164 | 0 | yyres[yyn] = '\0'; |
1165 | 0 | return yyn; |
1166 | 0 | } |
1167 | 0 | do_not_strip_quotes: ; |
1168 | 0 | } |
1169 | | |
1170 | 0 | if (yyres) |
1171 | 0 | return yystpcpy (yyres, yystr) - yyres; |
1172 | 0 | else |
1173 | 0 | return yystrlen (yystr); |
1174 | 0 | } |
1175 | | #endif |
1176 | | |
1177 | | |
1178 | | static int |
1179 | | yy_syntax_error_arguments (const yypcontext_t *yyctx, |
1180 | | yysymbol_kind_t yyarg[], int yyargn) |
1181 | 0 | { |
1182 | | /* Actual size of YYARG. */ |
1183 | 0 | int yycount = 0; |
1184 | | /* There are many possibilities here to consider: |
1185 | | - If this state is a consistent state with a default action, then |
1186 | | the only way this function was invoked is if the default action |
1187 | | is an error action. In that case, don't check for expected |
1188 | | tokens because there are none. |
1189 | | - The only way there can be no lookahead present (in yychar) is if |
1190 | | this state is a consistent state with a default action. Thus, |
1191 | | detecting the absence of a lookahead is sufficient to determine |
1192 | | that there is no unexpected or expected token to report. In that |
1193 | | case, just report a simple "syntax error". |
1194 | | - Don't assume there isn't a lookahead just because this state is a |
1195 | | consistent state with a default action. There might have been a |
1196 | | previous inconsistent state, consistent state with a non-default |
1197 | | action, or user semantic action that manipulated yychar. |
1198 | | - Of course, the expected token list depends on states to have |
1199 | | correct lookahead information, and it depends on the parser not |
1200 | | to perform extra reductions after fetching a lookahead from the |
1201 | | scanner and before detecting a syntax error. Thus, state merging |
1202 | | (from LALR or IELR) and default reductions corrupt the expected |
1203 | | token list. However, the list is correct for canonical LR with |
1204 | | one exception: it will still contain any token that will not be |
1205 | | accepted due to an error action in a later state. |
1206 | | */ |
1207 | 0 | if (yyctx->yytoken != YYSYMBOL_YYEMPTY) |
1208 | 0 | { |
1209 | 0 | int yyn; |
1210 | 0 | if (yyarg) |
1211 | 0 | yyarg[yycount] = yyctx->yytoken; |
1212 | 0 | ++yycount; |
1213 | 0 | yyn = yypcontext_expected_tokens (yyctx, |
1214 | 0 | yyarg ? yyarg + 1 : yyarg, yyargn - 1); |
1215 | 0 | if (yyn == YYENOMEM) |
1216 | 0 | return YYENOMEM; |
1217 | 0 | else |
1218 | 0 | yycount += yyn; |
1219 | 0 | } |
1220 | 0 | return yycount; |
1221 | 0 | } |
1222 | | |
1223 | | /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message |
1224 | | about the unexpected token YYTOKEN for the state stack whose top is |
1225 | | YYSSP. |
1226 | | |
1227 | | Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is |
1228 | | not large enough to hold the message. In that case, also set |
1229 | | *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the |
1230 | | required number of bytes is too large to store. */ |
1231 | | static int |
1232 | | yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, |
1233 | | const yypcontext_t *yyctx) |
1234 | 0 | { |
1235 | 0 | enum { YYARGS_MAX = 5 }; |
1236 | | /* Internationalized format string. */ |
1237 | 0 | const char *yyformat = YY_NULLPTR; |
1238 | | /* Arguments of yyformat: reported tokens (one for the "unexpected", |
1239 | | one per "expected"). */ |
1240 | 0 | yysymbol_kind_t yyarg[YYARGS_MAX]; |
1241 | | /* Cumulated lengths of YYARG. */ |
1242 | 0 | YYPTRDIFF_T yysize = 0; |
1243 | | |
1244 | | /* Actual size of YYARG. */ |
1245 | 0 | int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX); |
1246 | 0 | if (yycount == YYENOMEM) |
1247 | 0 | return YYENOMEM; |
1248 | | |
1249 | 0 | switch (yycount) |
1250 | 0 | { |
1251 | 0 | #define YYCASE_(N, S) \ |
1252 | 0 | case N: \ |
1253 | 0 | yyformat = S; \ |
1254 | 0 | break |
1255 | 0 | default: /* Avoid compiler warnings. */ |
1256 | 0 | YYCASE_(0, YY_("syntax error")); |
1257 | 0 | YYCASE_(1, YY_("syntax error, unexpected %s")); |
1258 | 0 | YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); |
1259 | 0 | YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); |
1260 | 0 | YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); |
1261 | 0 | YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); |
1262 | 0 | #undef YYCASE_ |
1263 | 0 | } |
1264 | | |
1265 | | /* Compute error message size. Don't count the "%s"s, but reserve |
1266 | | room for the terminator. */ |
1267 | 0 | yysize = yystrlen (yyformat) - 2 * yycount + 1; |
1268 | 0 | { |
1269 | 0 | int yyi; |
1270 | 0 | for (yyi = 0; yyi < yycount; ++yyi) |
1271 | 0 | { |
1272 | 0 | YYPTRDIFF_T yysize1 |
1273 | 0 | = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]); |
1274 | 0 | if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) |
1275 | 0 | yysize = yysize1; |
1276 | 0 | else |
1277 | 0 | return YYENOMEM; |
1278 | 0 | } |
1279 | 0 | } |
1280 | | |
1281 | 0 | if (*yymsg_alloc < yysize) |
1282 | 0 | { |
1283 | 0 | *yymsg_alloc = 2 * yysize; |
1284 | 0 | if (! (yysize <= *yymsg_alloc |
1285 | 0 | && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) |
1286 | 0 | *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; |
1287 | 0 | return -1; |
1288 | 0 | } |
1289 | | |
1290 | | /* Avoid sprintf, as that infringes on the user's name space. |
1291 | | Don't have undefined behavior even if the translation |
1292 | | produced a string with the wrong number of "%s"s. */ |
1293 | 0 | { |
1294 | 0 | char *yyp = *yymsg; |
1295 | 0 | int yyi = 0; |
1296 | 0 | while ((*yyp = *yyformat) != '\0') |
1297 | 0 | if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) |
1298 | 0 | { |
1299 | 0 | yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]); |
1300 | 0 | yyformat += 2; |
1301 | 0 | } |
1302 | 0 | else |
1303 | 0 | { |
1304 | 0 | ++yyp; |
1305 | 0 | ++yyformat; |
1306 | 0 | } |
1307 | 0 | } |
1308 | 0 | return 0; |
1309 | 0 | } |
1310 | | |
1311 | | |
1312 | | /*-----------------------------------------------. |
1313 | | | Release the memory associated to this symbol. | |
1314 | | `-----------------------------------------------*/ |
1315 | | |
1316 | | static void |
1317 | | yydestruct (const char *yymsg, |
1318 | | yysymbol_kind_t yykind, YYSTYPE *yyvaluep, yyscan_t yyscanner) |
1319 | 0 | { |
1320 | 0 | YY_USE (yyvaluep); |
1321 | 0 | YY_USE (yyscanner); |
1322 | 0 | if (!yymsg) |
1323 | 0 | yymsg = "Deleting"; |
1324 | 0 | YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); |
1325 | |
|
1326 | 0 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
1327 | 0 | switch (yykind) |
1328 | 0 | { |
1329 | 0 | case YYSYMBOL_STRING: /* STRING */ |
1330 | 0 | #line 100 "cmFortranParser.y" |
1331 | 0 | { free(((*yyvaluep).string)); } |
1332 | 0 | #line 1333 "cmFortranParser.cxx" |
1333 | 0 | break; |
1334 | | |
1335 | 0 | case YYSYMBOL_WORD: /* WORD */ |
1336 | 0 | #line 100 "cmFortranParser.y" |
1337 | 0 | { free(((*yyvaluep).string)); } |
1338 | 0 | #line 1339 "cmFortranParser.cxx" |
1339 | 0 | break; |
1340 | | |
1341 | 0 | case YYSYMBOL_CPP_INCLUDE_ANGLE: /* CPP_INCLUDE_ANGLE */ |
1342 | 0 | #line 100 "cmFortranParser.y" |
1343 | 0 | { free(((*yyvaluep).string)); } |
1344 | 0 | #line 1345 "cmFortranParser.cxx" |
1345 | 0 | break; |
1346 | | |
1347 | 0 | default: |
1348 | 0 | break; |
1349 | 0 | } |
1350 | 0 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
1351 | 0 | } |
1352 | | |
1353 | | |
1354 | | |
1355 | | |
1356 | | |
1357 | | |
1358 | | /*----------. |
1359 | | | yyparse. | |
1360 | | `----------*/ |
1361 | | |
1362 | | int |
1363 | | yyparse (yyscan_t yyscanner) |
1364 | 0 | { |
1365 | | /* Lookahead token kind. */ |
1366 | 0 | int yychar; |
1367 | | |
1368 | | |
1369 | | /* The semantic value of the lookahead symbol. */ |
1370 | | /* Default value used for initialization, for pacifying older GCCs |
1371 | | or non-GCC compilers. */ |
1372 | 0 | YY_INITIAL_VALUE (static YYSTYPE yyval_default;) |
1373 | 0 | YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); |
1374 | | |
1375 | | /* Number of syntax errors so far. */ |
1376 | 0 | int yynerrs = 0; |
1377 | |
|
1378 | 0 | yy_state_fast_t yystate = 0; |
1379 | | /* Number of tokens to shift before error messages enabled. */ |
1380 | 0 | int yyerrstatus = 0; |
1381 | | |
1382 | | /* Refer to the stacks through separate pointers, to allow yyoverflow |
1383 | | to reallocate them elsewhere. */ |
1384 | | |
1385 | | /* Their size. */ |
1386 | 0 | YYPTRDIFF_T yystacksize = YYINITDEPTH; |
1387 | | |
1388 | | /* The state stack: array, bottom, top. */ |
1389 | 0 | yy_state_t yyssa[YYINITDEPTH]; |
1390 | 0 | yy_state_t *yyss = yyssa; |
1391 | 0 | yy_state_t *yyssp = yyss; |
1392 | | |
1393 | | /* The semantic value stack: array, bottom, top. */ |
1394 | 0 | YYSTYPE yyvsa[YYINITDEPTH]; |
1395 | 0 | YYSTYPE *yyvs = yyvsa; |
1396 | 0 | YYSTYPE *yyvsp = yyvs; |
1397 | |
|
1398 | 0 | int yyn; |
1399 | | /* The return value of yyparse. */ |
1400 | 0 | int yyresult; |
1401 | | /* Lookahead symbol kind. */ |
1402 | 0 | yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; |
1403 | | /* The variables used to return semantic value and location from the |
1404 | | action routines. */ |
1405 | 0 | YYSTYPE yyval; |
1406 | | |
1407 | | /* Buffer for error messages, and its allocated size. */ |
1408 | 0 | char yymsgbuf[128]; |
1409 | 0 | char *yymsg = yymsgbuf; |
1410 | 0 | YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; |
1411 | |
|
1412 | 0 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
1413 | | |
1414 | | /* The number of symbols on the RHS of the reduced rule. |
1415 | | Keep to zero when no symbol should be popped. */ |
1416 | 0 | int yylen = 0; |
1417 | |
|
1418 | 0 | YYDPRINTF ((stderr, "Starting parse\n")); |
1419 | |
|
1420 | 0 | yychar = YYEMPTY; /* Cause a token to be read. */ |
1421 | |
|
1422 | 0 | goto yysetstate; |
1423 | | |
1424 | | |
1425 | | /*------------------------------------------------------------. |
1426 | | | yynewstate -- push a new state, which is found in yystate. | |
1427 | | `------------------------------------------------------------*/ |
1428 | 0 | yynewstate: |
1429 | | /* In all cases, when you get here, the value and location stacks |
1430 | | have just been pushed. So pushing a state here evens the stacks. */ |
1431 | 0 | yyssp++; |
1432 | | |
1433 | | |
1434 | | /*--------------------------------------------------------------------. |
1435 | | | yysetstate -- set current state (the top of the stack) to yystate. | |
1436 | | `--------------------------------------------------------------------*/ |
1437 | 0 | yysetstate: |
1438 | 0 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
1439 | 0 | YY_ASSERT (0 <= yystate && yystate < YYNSTATES); |
1440 | 0 | YY_IGNORE_USELESS_CAST_BEGIN |
1441 | 0 | *yyssp = YY_CAST (yy_state_t, yystate); |
1442 | 0 | YY_IGNORE_USELESS_CAST_END |
1443 | 0 | YY_STACK_PRINT (yyss, yyssp); |
1444 | |
|
1445 | 0 | if (yyss + yystacksize - 1 <= yyssp) |
1446 | 0 | #if !defined yyoverflow && !defined YYSTACK_RELOCATE |
1447 | 0 | YYNOMEM; |
1448 | | #else |
1449 | | { |
1450 | | /* Get the current used size of the three stacks, in elements. */ |
1451 | | YYPTRDIFF_T yysize = yyssp - yyss + 1; |
1452 | | |
1453 | | # if defined yyoverflow |
1454 | | { |
1455 | | /* Give user a chance to reallocate the stack. Use copies of |
1456 | | these so that the &'s don't force the real ones into |
1457 | | memory. */ |
1458 | | yy_state_t *yyss1 = yyss; |
1459 | | YYSTYPE *yyvs1 = yyvs; |
1460 | | |
1461 | | /* Each stack pointer address is followed by the size of the |
1462 | | data in use in that stack, in bytes. This used to be a |
1463 | | conditional around just the two extra args, but that might |
1464 | | be undefined if yyoverflow is a macro. */ |
1465 | | yyoverflow (YY_("memory exhausted"), |
1466 | | &yyss1, yysize * YYSIZEOF (*yyssp), |
1467 | | &yyvs1, yysize * YYSIZEOF (*yyvsp), |
1468 | | &yystacksize); |
1469 | | yyss = yyss1; |
1470 | | yyvs = yyvs1; |
1471 | | } |
1472 | | # else /* defined YYSTACK_RELOCATE */ |
1473 | | /* Extend the stack our own way. */ |
1474 | | if (YYMAXDEPTH <= yystacksize) |
1475 | | YYNOMEM; |
1476 | | yystacksize *= 2; |
1477 | | if (YYMAXDEPTH < yystacksize) |
1478 | | yystacksize = YYMAXDEPTH; |
1479 | | |
1480 | | { |
1481 | | yy_state_t *yyss1 = yyss; |
1482 | | union yyalloc *yyptr = |
1483 | | YY_CAST (union yyalloc *, |
1484 | | YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); |
1485 | | if (! yyptr) |
1486 | | YYNOMEM; |
1487 | | YYSTACK_RELOCATE (yyss_alloc, yyss); |
1488 | | YYSTACK_RELOCATE (yyvs_alloc, yyvs); |
1489 | | # undef YYSTACK_RELOCATE |
1490 | | if (yyss1 != yyssa) |
1491 | | YYSTACK_FREE (yyss1); |
1492 | | } |
1493 | | # endif |
1494 | | |
1495 | | yyssp = yyss + yysize - 1; |
1496 | | yyvsp = yyvs + yysize - 1; |
1497 | | |
1498 | | YY_IGNORE_USELESS_CAST_BEGIN |
1499 | | YYDPRINTF ((stderr, "Stack size increased to %ld\n", |
1500 | | YY_CAST (long, yystacksize))); |
1501 | | YY_IGNORE_USELESS_CAST_END |
1502 | | |
1503 | | if (yyss + yystacksize - 1 <= yyssp) |
1504 | | YYABORT; |
1505 | | } |
1506 | | #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ |
1507 | | |
1508 | | |
1509 | 0 | if (yystate == YYFINAL) |
1510 | 0 | YYACCEPT; |
1511 | | |
1512 | 0 | goto yybackup; |
1513 | | |
1514 | | |
1515 | | /*-----------. |
1516 | | | yybackup. | |
1517 | | `-----------*/ |
1518 | 0 | yybackup: |
1519 | | /* Do appropriate processing given the current state. Read a |
1520 | | lookahead token if we need one and don't already have one. */ |
1521 | | |
1522 | | /* First try to decide what to do without reference to lookahead token. */ |
1523 | 0 | yyn = yypact[yystate]; |
1524 | 0 | if (yypact_value_is_default (yyn)) |
1525 | 0 | goto yydefault; |
1526 | | |
1527 | | /* Not known => get a lookahead token if don't already have one. */ |
1528 | | |
1529 | | /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ |
1530 | 0 | if (yychar == YYEMPTY) |
1531 | 0 | { |
1532 | 0 | YYDPRINTF ((stderr, "Reading a token\n")); |
1533 | 0 | yychar = yylex (&yylval, yyscanner); |
1534 | 0 | } |
1535 | |
|
1536 | 0 | if (yychar <= YYEOF) |
1537 | 0 | { |
1538 | 0 | yychar = YYEOF; |
1539 | 0 | yytoken = YYSYMBOL_YYEOF; |
1540 | 0 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
1541 | 0 | } |
1542 | 0 | else if (yychar == YYerror) |
1543 | 0 | { |
1544 | | /* The scanner already issued an error message, process directly |
1545 | | to error recovery. But do not keep the error token as |
1546 | | lookahead, it is too special and may lead us to an endless |
1547 | | loop in error recovery. */ |
1548 | 0 | yychar = YYUNDEF; |
1549 | 0 | yytoken = YYSYMBOL_YYerror; |
1550 | 0 | goto yyerrlab1; |
1551 | 0 | } |
1552 | 0 | else |
1553 | 0 | { |
1554 | 0 | yytoken = YYTRANSLATE (yychar); |
1555 | 0 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
1556 | 0 | } |
1557 | | |
1558 | | /* If the proper action on seeing token YYTOKEN is to reduce or to |
1559 | | detect an error, take that action. */ |
1560 | 0 | yyn += yytoken; |
1561 | 0 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
1562 | 0 | goto yydefault; |
1563 | 0 | yyn = yytable[yyn]; |
1564 | 0 | if (yyn <= 0) |
1565 | 0 | { |
1566 | 0 | if (yytable_value_is_error (yyn)) |
1567 | 0 | goto yyerrlab; |
1568 | 0 | yyn = -yyn; |
1569 | 0 | goto yyreduce; |
1570 | 0 | } |
1571 | | |
1572 | | /* Count tokens shifted since error; after three, turn off error |
1573 | | status. */ |
1574 | 0 | if (yyerrstatus) |
1575 | 0 | yyerrstatus--; |
1576 | | |
1577 | | /* Shift the lookahead token. */ |
1578 | 0 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
1579 | 0 | yystate = yyn; |
1580 | 0 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
1581 | 0 | *++yyvsp = yylval; |
1582 | 0 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
1583 | | |
1584 | | /* Discard the shifted token. */ |
1585 | 0 | yychar = YYEMPTY; |
1586 | 0 | goto yynewstate; |
1587 | | |
1588 | | |
1589 | | /*-----------------------------------------------------------. |
1590 | | | yydefault -- do the default action for the current state. | |
1591 | | `-----------------------------------------------------------*/ |
1592 | 0 | yydefault: |
1593 | 0 | yyn = yydefact[yystate]; |
1594 | 0 | if (yyn == 0) |
1595 | 0 | goto yyerrlab; |
1596 | 0 | goto yyreduce; |
1597 | | |
1598 | | |
1599 | | /*-----------------------------. |
1600 | | | yyreduce -- do a reduction. | |
1601 | | `-----------------------------*/ |
1602 | 0 | yyreduce: |
1603 | | /* yyn is the number of a rule to reduce with. */ |
1604 | 0 | yylen = yyr2[yyn]; |
1605 | | |
1606 | | /* If YYLEN is nonzero, implement the default value of the action: |
1607 | | '$$ = $1'. |
1608 | | |
1609 | | Otherwise, the following line sets YYVAL to garbage. |
1610 | | This behavior is undocumented and Bison |
1611 | | users should not rely upon it. Assigning to YYVAL |
1612 | | unconditionally makes the parser a bit smaller, and it avoids a |
1613 | | GCC warning that YYVAL may be used uninitialized. */ |
1614 | 0 | yyval = yyvsp[1-yylen]; |
1615 | | |
1616 | |
|
1617 | 0 | YY_REDUCE_PRINT (yyn); |
1618 | 0 | switch (yyn) |
1619 | 0 | { |
1620 | 0 | case 4: /* stmt: INTERFACE EOSTMT */ |
1621 | 0 | #line 109 "cmFortranParser.y" |
1622 | 0 | { |
1623 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1624 | 0 | cmFortranParser_SetInInterface(parser, true); |
1625 | 0 | } |
1626 | 0 | #line 1627 "cmFortranParser.cxx" |
1627 | 0 | break; |
1628 | | |
1629 | 0 | case 5: /* stmt: USE WORD other EOSTMT */ |
1630 | 0 | #line 113 "cmFortranParser.y" |
1631 | 0 | { |
1632 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1633 | 0 | cmFortranParser_RuleUse(parser, (yyvsp[-2].string)); |
1634 | 0 | free((yyvsp[-2].string)); |
1635 | 0 | } |
1636 | 0 | #line 1637 "cmFortranParser.cxx" |
1637 | 0 | break; |
1638 | | |
1639 | 0 | case 6: /* stmt: MODULE WORD EOSTMT */ |
1640 | 0 | #line 118 "cmFortranParser.y" |
1641 | 0 | { |
1642 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1643 | 0 | cmFortranParser_RuleModule(parser, (yyvsp[-1].string)); |
1644 | 0 | free((yyvsp[-1].string)); |
1645 | 0 | } |
1646 | 0 | #line 1647 "cmFortranParser.cxx" |
1647 | 0 | break; |
1648 | | |
1649 | 0 | case 7: /* stmt: SUBMODULE LPAREN WORD RPAREN WORD EOSTMT */ |
1650 | 0 | #line 123 "cmFortranParser.y" |
1651 | 0 | { |
1652 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1653 | 0 | cmFortranParser_RuleSubmodule(parser, (yyvsp[-3].string), (yyvsp[-1].string)); |
1654 | 0 | free((yyvsp[-3].string)); |
1655 | 0 | free((yyvsp[-1].string)); |
1656 | 0 | } |
1657 | 0 | #line 1658 "cmFortranParser.cxx" |
1658 | 0 | break; |
1659 | | |
1660 | 0 | case 8: /* stmt: SUBMODULE LPAREN WORD COLON WORD RPAREN WORD EOSTMT */ |
1661 | 0 | #line 129 "cmFortranParser.y" |
1662 | 0 | { |
1663 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1664 | 0 | cmFortranParser_RuleSubmoduleNested(parser, (yyvsp[-5].string), (yyvsp[-3].string), (yyvsp[-1].string)); |
1665 | 0 | free((yyvsp[-5].string)); |
1666 | 0 | free((yyvsp[-3].string)); |
1667 | 0 | free((yyvsp[-1].string)); |
1668 | 0 | } |
1669 | 0 | #line 1670 "cmFortranParser.cxx" |
1670 | 0 | break; |
1671 | | |
1672 | 0 | case 9: /* stmt: INTERFACE WORD EOSTMT */ |
1673 | 0 | #line 136 "cmFortranParser.y" |
1674 | 0 | { |
1675 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1676 | 0 | cmFortranParser_SetInInterface(parser, true); |
1677 | 0 | free((yyvsp[-1].string)); |
1678 | 0 | } |
1679 | 0 | #line 1680 "cmFortranParser.cxx" |
1680 | 0 | break; |
1681 | | |
1682 | 0 | case 10: /* stmt: END INTERFACE WORD EOSTMT */ |
1683 | 0 | #line 141 "cmFortranParser.y" |
1684 | 0 | { |
1685 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1686 | 0 | cmFortranParser_SetInInterface(parser, false); |
1687 | 0 | free((yyvsp[-1].string)); |
1688 | 0 | } |
1689 | 0 | #line 1690 "cmFortranParser.cxx" |
1690 | 0 | break; |
1691 | | |
1692 | 0 | case 11: /* stmt: END INTERFACE EOSTMT */ |
1693 | 0 | #line 146 "cmFortranParser.y" |
1694 | 0 | { |
1695 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1696 | 0 | cmFortranParser_SetInInterface(parser, false); |
1697 | 0 | } |
1698 | 0 | #line 1699 "cmFortranParser.cxx" |
1699 | 0 | break; |
1700 | | |
1701 | 0 | case 12: /* stmt: USE DCOLON WORD other EOSTMT */ |
1702 | 0 | #line 150 "cmFortranParser.y" |
1703 | 0 | { |
1704 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1705 | 0 | cmFortranParser_RuleUse(parser, (yyvsp[-2].string)); |
1706 | 0 | free((yyvsp[-2].string)); |
1707 | 0 | } |
1708 | 0 | #line 1709 "cmFortranParser.cxx" |
1709 | 0 | break; |
1710 | | |
1711 | 0 | case 13: /* stmt: USE COMMA WORD DCOLON WORD other EOSTMT */ |
1712 | 0 | #line 155 "cmFortranParser.y" |
1713 | 0 | { |
1714 | 0 | if (cmsysString_strcasecmp((yyvsp[-4].string), "non_intrinsic") == 0) { |
1715 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1716 | 0 | cmFortranParser_RuleUse(parser, (yyvsp[-2].string)); |
1717 | 0 | } |
1718 | 0 | if (cmsysString_strcasecmp((yyvsp[-4].string), "intrinsic") == 0) { |
1719 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1720 | 0 | cmFortranParser_RuleUseIntrinsic(parser, (yyvsp[-2].string)); |
1721 | 0 | } |
1722 | 0 | free((yyvsp[-4].string)); |
1723 | 0 | free((yyvsp[-2].string)); |
1724 | 0 | } |
1725 | 0 | #line 1726 "cmFortranParser.cxx" |
1726 | 0 | break; |
1727 | | |
1728 | 0 | case 14: /* stmt: INCLUDE STRING EOSTMT */ |
1729 | 0 | #line 167 "cmFortranParser.y" |
1730 | 0 | { |
1731 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1732 | 0 | cmFortranParser_RuleInclude(parser, (yyvsp[-1].string)); |
1733 | 0 | free((yyvsp[-1].string)); |
1734 | 0 | } |
1735 | 0 | #line 1736 "cmFortranParser.cxx" |
1736 | 0 | break; |
1737 | | |
1738 | 0 | case 15: /* stmt: CPP_LINE_DIRECTIVE STRING other EOSTMT */ |
1739 | 0 | #line 172 "cmFortranParser.y" |
1740 | 0 | { |
1741 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1742 | 0 | cmFortranParser_RuleLineDirective(parser, (yyvsp[-2].string)); |
1743 | 0 | free((yyvsp[-2].string)); |
1744 | 0 | } |
1745 | 0 | #line 1746 "cmFortranParser.cxx" |
1746 | 0 | break; |
1747 | | |
1748 | 0 | case 16: /* stmt: CPP_INCLUDE_ANGLE other EOSTMT */ |
1749 | 0 | #line 177 "cmFortranParser.y" |
1750 | 0 | { |
1751 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1752 | 0 | cmFortranParser_RuleInclude(parser, (yyvsp[-2].string)); |
1753 | 0 | free((yyvsp[-2].string)); |
1754 | 0 | } |
1755 | 0 | #line 1756 "cmFortranParser.cxx" |
1756 | 0 | break; |
1757 | | |
1758 | 0 | case 17: /* stmt: include STRING other EOSTMT */ |
1759 | 0 | #line 182 "cmFortranParser.y" |
1760 | 0 | { |
1761 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1762 | 0 | cmFortranParser_RuleInclude(parser, (yyvsp[-2].string)); |
1763 | 0 | free((yyvsp[-2].string)); |
1764 | 0 | } |
1765 | 0 | #line 1766 "cmFortranParser.cxx" |
1766 | 0 | break; |
1767 | | |
1768 | 0 | case 18: /* stmt: define WORD other EOSTMT */ |
1769 | 0 | #line 187 "cmFortranParser.y" |
1770 | 0 | { |
1771 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1772 | 0 | cmFortranParser_RuleDefine(parser, (yyvsp[-2].string)); |
1773 | 0 | free((yyvsp[-2].string)); |
1774 | 0 | } |
1775 | 0 | #line 1776 "cmFortranParser.cxx" |
1776 | 0 | break; |
1777 | | |
1778 | 0 | case 19: /* stmt: undef WORD other EOSTMT */ |
1779 | 0 | #line 192 "cmFortranParser.y" |
1780 | 0 | { |
1781 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1782 | 0 | cmFortranParser_RuleUndef(parser, (yyvsp[-2].string)); |
1783 | 0 | free((yyvsp[-2].string)); |
1784 | 0 | } |
1785 | 0 | #line 1786 "cmFortranParser.cxx" |
1786 | 0 | break; |
1787 | | |
1788 | 0 | case 20: /* stmt: ifdef WORD other EOSTMT */ |
1789 | 0 | #line 197 "cmFortranParser.y" |
1790 | 0 | { |
1791 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1792 | 0 | cmFortranParser_RuleIfdef(parser, (yyvsp[-2].string)); |
1793 | 0 | free((yyvsp[-2].string)); |
1794 | 0 | } |
1795 | 0 | #line 1796 "cmFortranParser.cxx" |
1796 | 0 | break; |
1797 | | |
1798 | 0 | case 21: /* stmt: ifndef WORD other EOSTMT */ |
1799 | 0 | #line 202 "cmFortranParser.y" |
1800 | 0 | { |
1801 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1802 | 0 | cmFortranParser_RuleIfndef(parser, (yyvsp[-2].string)); |
1803 | 0 | free((yyvsp[-2].string)); |
1804 | 0 | } |
1805 | 0 | #line 1806 "cmFortranParser.cxx" |
1806 | 0 | break; |
1807 | | |
1808 | 0 | case 22: /* stmt: if other EOSTMT */ |
1809 | 0 | #line 207 "cmFortranParser.y" |
1810 | 0 | { |
1811 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1812 | 0 | cmFortranParser_RuleIf(parser); |
1813 | 0 | } |
1814 | 0 | #line 1815 "cmFortranParser.cxx" |
1815 | 0 | break; |
1816 | | |
1817 | 0 | case 23: /* stmt: elif other EOSTMT */ |
1818 | 0 | #line 211 "cmFortranParser.y" |
1819 | 0 | { |
1820 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1821 | 0 | cmFortranParser_RuleElif(parser); |
1822 | 0 | } |
1823 | 0 | #line 1824 "cmFortranParser.cxx" |
1824 | 0 | break; |
1825 | | |
1826 | 0 | case 24: /* stmt: else other EOSTMT */ |
1827 | 0 | #line 215 "cmFortranParser.y" |
1828 | 0 | { |
1829 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1830 | 0 | cmFortranParser_RuleElse(parser); |
1831 | 0 | } |
1832 | 0 | #line 1833 "cmFortranParser.cxx" |
1833 | 0 | break; |
1834 | | |
1835 | 0 | case 25: /* stmt: endif other EOSTMT */ |
1836 | 0 | #line 219 "cmFortranParser.y" |
1837 | 0 | { |
1838 | 0 | cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); |
1839 | 0 | cmFortranParser_RuleEndif(parser); |
1840 | 0 | } |
1841 | 0 | #line 1842 "cmFortranParser.cxx" |
1842 | 0 | break; |
1843 | | |
1844 | 0 | case 49: /* misc_code: WORD */ |
1845 | 0 | #line 241 "cmFortranParser.y" |
1846 | 0 | { free ((yyvsp[0].string)); } |
1847 | 0 | #line 1848 "cmFortranParser.cxx" |
1848 | 0 | break; |
1849 | | |
1850 | 0 | case 56: /* misc_code: STRING */ |
1851 | 0 | #line 248 "cmFortranParser.y" |
1852 | 0 | { free ((yyvsp[0].string)); } |
1853 | 0 | #line 1854 "cmFortranParser.cxx" |
1854 | 0 | break; |
1855 | | |
1856 | | |
1857 | 0 | #line 1858 "cmFortranParser.cxx" |
1858 | | |
1859 | 0 | default: break; |
1860 | 0 | } |
1861 | | /* User semantic actions sometimes alter yychar, and that requires |
1862 | | that yytoken be updated with the new translation. We take the |
1863 | | approach of translating immediately before every use of yytoken. |
1864 | | One alternative is translating here after every semantic action, |
1865 | | but that translation would be missed if the semantic action invokes |
1866 | | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or |
1867 | | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an |
1868 | | incorrect destructor might then be invoked immediately. In the |
1869 | | case of YYERROR or YYBACKUP, subsequent parser actions might lead |
1870 | | to an incorrect destructor call or verbose syntax error message |
1871 | | before the lookahead is translated. */ |
1872 | 0 | YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); |
1873 | |
|
1874 | 0 | YYPOPSTACK (yylen); |
1875 | 0 | yylen = 0; |
1876 | |
|
1877 | 0 | *++yyvsp = yyval; |
1878 | | |
1879 | | /* Now 'shift' the result of the reduction. Determine what state |
1880 | | that goes to, based on the state we popped back to and the rule |
1881 | | number reduced by. */ |
1882 | 0 | { |
1883 | 0 | const int yylhs = yyr1[yyn] - YYNTOKENS; |
1884 | 0 | const int yyi = yypgoto[yylhs] + *yyssp; |
1885 | 0 | yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp |
1886 | 0 | ? yytable[yyi] |
1887 | 0 | : yydefgoto[yylhs]); |
1888 | 0 | } |
1889 | |
|
1890 | 0 | goto yynewstate; |
1891 | | |
1892 | | |
1893 | | /*--------------------------------------. |
1894 | | | yyerrlab -- here on detecting error. | |
1895 | | `--------------------------------------*/ |
1896 | 0 | yyerrlab: |
1897 | | /* Make sure we have latest lookahead translation. See comments at |
1898 | | user semantic actions for why this is necessary. */ |
1899 | 0 | yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); |
1900 | | /* If not already recovering from an error, report this error. */ |
1901 | 0 | if (!yyerrstatus) |
1902 | 0 | { |
1903 | 0 | ++yynerrs; |
1904 | 0 | { |
1905 | 0 | yypcontext_t yyctx |
1906 | 0 | = {yyssp, yytoken}; |
1907 | 0 | char const *yymsgp = YY_("syntax error"); |
1908 | 0 | int yysyntax_error_status; |
1909 | 0 | yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); |
1910 | 0 | if (yysyntax_error_status == 0) |
1911 | 0 | yymsgp = yymsg; |
1912 | 0 | else if (yysyntax_error_status == -1) |
1913 | 0 | { |
1914 | 0 | if (yymsg != yymsgbuf) |
1915 | 0 | YYSTACK_FREE (yymsg); |
1916 | 0 | yymsg = YY_CAST (char *, |
1917 | 0 | YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); |
1918 | 0 | if (yymsg) |
1919 | 0 | { |
1920 | 0 | yysyntax_error_status |
1921 | 0 | = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); |
1922 | 0 | yymsgp = yymsg; |
1923 | 0 | } |
1924 | 0 | else |
1925 | 0 | { |
1926 | 0 | yymsg = yymsgbuf; |
1927 | 0 | yymsg_alloc = sizeof yymsgbuf; |
1928 | 0 | yysyntax_error_status = YYENOMEM; |
1929 | 0 | } |
1930 | 0 | } |
1931 | 0 | yyerror (yyscanner, yymsgp); |
1932 | 0 | if (yysyntax_error_status == YYENOMEM) |
1933 | 0 | YYNOMEM; |
1934 | 0 | } |
1935 | 0 | } |
1936 | | |
1937 | 0 | if (yyerrstatus == 3) |
1938 | 0 | { |
1939 | | /* If just tried and failed to reuse lookahead token after an |
1940 | | error, discard it. */ |
1941 | |
|
1942 | 0 | if (yychar <= YYEOF) |
1943 | 0 | { |
1944 | | /* Return failure if at end of input. */ |
1945 | 0 | if (yychar == YYEOF) |
1946 | 0 | YYABORT; |
1947 | 0 | } |
1948 | 0 | else |
1949 | 0 | { |
1950 | 0 | yydestruct ("Error: discarding", |
1951 | 0 | yytoken, &yylval, yyscanner); |
1952 | 0 | yychar = YYEMPTY; |
1953 | 0 | } |
1954 | 0 | } |
1955 | | |
1956 | | /* Else will try to reuse lookahead token after shifting the error |
1957 | | token. */ |
1958 | 0 | goto yyerrlab1; |
1959 | | |
1960 | | |
1961 | | /*---------------------------------------------------. |
1962 | | | yyerrorlab -- error raised explicitly by YYERROR. | |
1963 | | `---------------------------------------------------*/ |
1964 | 0 | yyerrorlab: |
1965 | | /* Pacify compilers when the user code never invokes YYERROR and the |
1966 | | label yyerrorlab therefore never appears in user code. */ |
1967 | 0 | if (0) |
1968 | 0 | YYERROR; |
1969 | 0 | ++yynerrs; |
1970 | | |
1971 | | /* Do not reclaim the symbols of the rule whose action triggered |
1972 | | this YYERROR. */ |
1973 | 0 | YYPOPSTACK (yylen); |
1974 | 0 | yylen = 0; |
1975 | 0 | YY_STACK_PRINT (yyss, yyssp); |
1976 | 0 | yystate = *yyssp; |
1977 | 0 | goto yyerrlab1; |
1978 | | |
1979 | | |
1980 | | /*-------------------------------------------------------------. |
1981 | | | yyerrlab1 -- common code for both syntax error and YYERROR. | |
1982 | | `-------------------------------------------------------------*/ |
1983 | 0 | yyerrlab1: |
1984 | 0 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
1985 | | |
1986 | | /* Pop stack until we find a state that shifts the error token. */ |
1987 | 0 | for (;;) |
1988 | 0 | { |
1989 | 0 | yyn = yypact[yystate]; |
1990 | 0 | if (!yypact_value_is_default (yyn)) |
1991 | 0 | { |
1992 | 0 | yyn += YYSYMBOL_YYerror; |
1993 | 0 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) |
1994 | 0 | { |
1995 | 0 | yyn = yytable[yyn]; |
1996 | 0 | if (0 < yyn) |
1997 | 0 | break; |
1998 | 0 | } |
1999 | 0 | } |
2000 | | |
2001 | | /* Pop the current state because it cannot handle the error token. */ |
2002 | 0 | if (yyssp == yyss) |
2003 | 0 | YYABORT; |
2004 | | |
2005 | | |
2006 | 0 | yydestruct ("Error: popping", |
2007 | 0 | YY_ACCESSING_SYMBOL (yystate), yyvsp, yyscanner); |
2008 | 0 | YYPOPSTACK (1); |
2009 | 0 | yystate = *yyssp; |
2010 | 0 | YY_STACK_PRINT (yyss, yyssp); |
2011 | 0 | } |
2012 | | |
2013 | 0 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
2014 | 0 | *++yyvsp = yylval; |
2015 | 0 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
2016 | | |
2017 | | |
2018 | | /* Shift the error token. */ |
2019 | 0 | YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); |
2020 | |
|
2021 | 0 | yystate = yyn; |
2022 | 0 | goto yynewstate; |
2023 | | |
2024 | | |
2025 | | /*-------------------------------------. |
2026 | | | yyacceptlab -- YYACCEPT comes here. | |
2027 | | `-------------------------------------*/ |
2028 | 0 | yyacceptlab: |
2029 | 0 | yyresult = 0; |
2030 | 0 | goto yyreturnlab; |
2031 | | |
2032 | | |
2033 | | /*-----------------------------------. |
2034 | | | yyabortlab -- YYABORT comes here. | |
2035 | | `-----------------------------------*/ |
2036 | 0 | yyabortlab: |
2037 | 0 | yyresult = 1; |
2038 | 0 | goto yyreturnlab; |
2039 | | |
2040 | | |
2041 | | /*-----------------------------------------------------------. |
2042 | | | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | |
2043 | | `-----------------------------------------------------------*/ |
2044 | 0 | yyexhaustedlab: |
2045 | 0 | yyerror (yyscanner, YY_("memory exhausted")); |
2046 | 0 | yyresult = 2; |
2047 | 0 | goto yyreturnlab; |
2048 | | |
2049 | | |
2050 | | /*----------------------------------------------------------. |
2051 | | | yyreturnlab -- parsing is finished, clean up and return. | |
2052 | | `----------------------------------------------------------*/ |
2053 | 0 | yyreturnlab: |
2054 | 0 | if (yychar != YYEMPTY) |
2055 | 0 | { |
2056 | | /* Make sure we have latest lookahead translation. See comments at |
2057 | | user semantic actions for why this is necessary. */ |
2058 | 0 | yytoken = YYTRANSLATE (yychar); |
2059 | 0 | yydestruct ("Cleanup: discarding lookahead", |
2060 | 0 | yytoken, &yylval, yyscanner); |
2061 | 0 | } |
2062 | | /* Do not reclaim the symbols of the rule whose action triggered |
2063 | | this YYABORT or YYACCEPT. */ |
2064 | 0 | YYPOPSTACK (yylen); |
2065 | 0 | YY_STACK_PRINT (yyss, yyssp); |
2066 | 0 | while (yyssp != yyss) |
2067 | 0 | { |
2068 | 0 | yydestruct ("Cleanup: popping", |
2069 | 0 | YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yyscanner); |
2070 | 0 | YYPOPSTACK (1); |
2071 | 0 | } |
2072 | 0 | #ifndef yyoverflow |
2073 | 0 | if (yyss != yyssa) |
2074 | 0 | YYSTACK_FREE (yyss); |
2075 | 0 | #endif |
2076 | 0 | if (yymsg != yymsgbuf) |
2077 | 0 | YYSTACK_FREE (yymsg); |
2078 | 0 | return yyresult; |
2079 | 0 | } |
2080 | | |
2081 | | #line 260 "cmFortranParser.y" |
2082 | | |
2083 | | /* End of grammar */ |