1 /* A Bison parser, made by GNU Bison 3.8.2. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
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.
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, see <https://www.gnu.org/licenses/>. */
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.
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
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. */
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. */
48 /* Identify Bison output, and Bison version. */
51 /* Bison version string. */
52 #define YYBISON_VERSION "3.8.2"
55 #define YYSKELETON_NAME "yacc.c"
67 /* Substitute the variable and function names. */
68 #define yyparse cmFortran_yyparse
69 #define yylex cmFortran_yylex
70 #define yyerror cmFortran_yyerror
71 #define yydebug cmFortran_yydebug
72 #define yynerrs cmFortran_yynerrs
74 /* First part of user prologue. */
75 #line 1 "cmFortranParser.y"
77 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
78 file Copyright.txt or https://cmake.org/licensing for details. */
79 /*-------------------------------------------------------------------------
80 Portions of this source have been derived from makedepf90 version 2.8.8,
82 Copyright (C) 2000--2006 Erik Edelmann <erik.edelmann@iki.fi>
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 -------------------------------------------------------------------------*/
91 This file must be translated to C and modified to build everywhere.
95 bison --name-prefix=cmFortran_yy
96 --defines=cmFortranParserTokens.h
102 #include "cmConfigure.h" // IWYU pragma: keep
104 #include "cmsys/String.h"
108 /*-------------------------------------------------------------------------*/
109 #define cmFortranParser_cxx
110 #include "cmFortranParser.h" /* Interface to parser object. */
112 /* Forward declare the lexer entry point. */
115 /* Helper function to forward error callback from parser. */
116 static void cmFortran_yyerror(yyscan_t yyscanner, const char* message)
118 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
119 cmFortranParser_Error(parser, message);
122 /* Disable some warnings in the generated code. */
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. */
131 #if defined(__GNUC__) && __GNUC__ >= 8
132 # pragma GCC diagnostic ignored "-Wconversion"
133 # pragma GCC diagnostic ignored "-Wfree-nonheap-object"
135 #if defined(__clang__) && defined(__has_warning)
136 # if __has_warning("-Wunused-but-set-variable")
137 # pragma clang diagnostic ignored "-Wunused-but-set-variable"
141 #line 142 "cmFortranParser.cxx"
145 # define YY_CAST(Type, Val) static_cast<Type> (Val)
146 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
148 # define YY_CAST(Type, Val) ((Type) (Val))
149 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
153 # if defined __cplusplus
154 # if 201103L <= __cplusplus
155 # define YY_NULLPTR nullptr
157 # define YY_NULLPTR 0
160 # define YY_NULLPTR ((void*)0)
164 #include "cmFortranParserTokens.h"
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 */
225 typedef enum yysymbol_kind_t yysymbol_kind_t;
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. */
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 */
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. */
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;
256 typedef signed char yytype_int8;
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;
264 typedef short yytype_int16;
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>. */
273 # undef UINT_LEAST8_MAX
274 # undef UINT_LEAST16_MAX
275 # define UINT_LEAST8_MAX 255
276 # define UINT_LEAST16_MAX 65535
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;
287 typedef short yytype_uint8;
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;
298 typedef int yytype_uint16;
302 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
303 # define YYPTRDIFF_T __PTRDIFF_TYPE__
304 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
305 # elif defined PTRDIFF_MAX
307 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
309 # define YYPTRDIFF_T ptrdiff_t
310 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
312 # define YYPTRDIFF_T long
313 # define YYPTRDIFF_MAXIMUM LONG_MAX
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
326 # define YYSIZE_T unsigned
330 #define YYSIZE_MAXIMUM \
331 YY_CAST (YYPTRDIFF_T, \
332 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
333 ? YYPTRDIFF_MAXIMUM \
334 : YY_CAST (YYSIZE_T, -1)))
336 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
339 /* Stored state numbers (used for stacks). */
340 typedef yytype_int8 yy_state_t;
342 /* State numbers in computations. */
343 typedef int yy_state_fast_t;
346 # if defined YYENABLE_NLS && YYENABLE_NLS
348 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
349 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
353 # define YY_(Msgid) Msgid
358 #ifndef YY_ATTRIBUTE_PURE
359 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
360 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
362 # define YY_ATTRIBUTE_PURE
366 #ifndef YY_ATTRIBUTE_UNUSED
367 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
368 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
370 # define YY_ATTRIBUTE_UNUSED
374 /* Suppress unused-variable warnings by "using" E. */
375 #if ! defined lint || defined __GNUC__
376 # define YY_USE(E) ((void) (E))
378 # define YY_USE(E) /* empty */
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\"")
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\"")
393 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
394 _Pragma ("GCC diagnostic pop")
396 # define YY_INITIAL_VALUE(Value) Value
398 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
399 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
400 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
402 #ifndef YY_INITIAL_VALUE
403 # define YY_INITIAL_VALUE(Value) /* Nothing. */
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")
413 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
414 # define YY_IGNORE_USELESS_CAST_BEGIN
415 # define YY_IGNORE_USELESS_CAST_END
419 #define YY_ASSERT(E) ((void) (0 && (E)))
423 /* The parser invokes alloca or malloc; define the necessary symbols. */
425 # ifdef YYSTACK_USE_ALLOCA
426 # if YYSTACK_USE_ALLOCA
428 # define YYSTACK_ALLOC __builtin_alloca
429 # elif defined __BUILTIN_VA_ARG_INCR
430 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
432 # define YYSTACK_ALLOC __alloca
433 # elif defined _MSC_VER
434 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
435 # define alloca _alloca
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
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 */
460 # define YYSTACK_ALLOC YYMALLOC
461 # define YYSTACK_FREE YYFREE
462 # ifndef YYSTACK_ALLOC_MAXIMUM
463 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
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
474 # define YYMALLOC malloc
475 # if ! defined malloc && ! defined EXIT_SUCCESS
476 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
481 # if ! defined free && ! defined EXIT_SUCCESS
482 void free (void *); /* INFRINGES ON USER NAME SPACE */
488 #if (! defined yyoverflow \
489 && (! defined __cplusplus \
490 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
492 /* A type that is properly aligned for any stack member. */
495 yy_state_t yyss_alloc;
499 /* The size of the maximum gap between one aligned stack and the next. */
500 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
502 /* The size of an array large to enough to hold all stacks, each with
504 # define YYSTACK_BYTES(N) \
505 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
506 + YYSTACK_GAP_MAXIMUM)
508 # define YYCOPY_NEEDED 1
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
515 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
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); \
528 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
529 /* Copy COUNT objects from SRC to DST. The source and destination do
532 # if defined __GNUC__ && 1 < __GNUC__
533 # define YYCOPY(Dst, Src, Count) \
534 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
536 # define YYCOPY(Dst, Src, Count) \
540 for (yyi = 0; yyi < (Count); yyi++) \
541 (Dst)[yyi] = (Src)[yyi]; \
546 #endif /* !YYCOPY_NEEDED */
548 /* YYFINAL -- State number of the termination state. */
550 /* YYLAST -- Last index in YYTABLE. */
553 /* YYNTOKENS -- Number of terminals. */
555 /* YYNNTS -- Number of nonterminals. */
557 /* YYNRULES -- Number of rules. */
559 /* YYNSTATES -- Number of states. */
560 #define YYNSTATES 127
562 /* YYMAXUTOK -- Last valid token kind. */
563 #define YYMAXUTOK 295
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 <= (YYX) && (YYX) <= YYMAXUTOK \
570 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
573 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
574 as returned by yylex. */
575 static const yytype_int8 yytranslate[] =
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
610 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
611 static const yytype_int16 yyrline[] =
613 0, 106, 106, 106, 109, 113, 118, 127, 133, 140,
614 145, 149, 154, 166, 171, 176, 181, 186, 191, 196,
615 201, 206, 210, 214, 218, 222, 223, 228, 228, 228,
616 229, 229, 230, 230, 231, 231, 232, 232, 233, 233,
617 234, 234, 235, 235, 236, 236, 237, 237, 240, 241,
618 242, 243, 244, 245, 246, 247, 248, 249, 250, 251,
619 252, 253, 254, 255, 256
623 /** Accessing symbol of state STATE. */
624 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
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;
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[] =
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
649 yysymbol_name (yysymbol_kind_t yysymbol)
651 return yytname[yysymbol];
655 #define YYPACT_NINF (-39)
657 #define yypact_value_is_default(Yyn) \
658 ((Yyn) == YYPACT_NINF)
660 #define YYTABLE_NINF (-1)
662 #define yytable_value_is_error(Yyn) \
665 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
667 static const yytype_int16 yypact[] =
669 -39, 21, -39, 1, -39, -20, -39, -39, -39, -39,
670 -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
671 -39, -39, -39, -39, -39, -39, -24, -18, 20, -8,
672 -3, 40, -39, 15, 16, 17, 19, 34, -39, -39,
673 -39, -39, -39, -39, 59, -39, -39, -39, -39, -39,
674 36, 37, 38, -39, -39, -39, -39, -39, -39, 77,
675 115, 130, 168, 183, -39, -39, -39, -39, -39, -39,
676 -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
677 -39, -39, -39, 221, 236, 274, 289, -21, 26, -39,
678 327, 342, 380, 395, 433, 448, -39, -39, -39, -39,
679 -39, -39, -39, -39, -39, 39, 41, 42, 486, -39,
680 -39, -39, -39, -39, -39, 18, -39, -39, -39, 43,
681 501, 539, -39, -39, -39, 554, -39
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[] =
689 2, 0, 1, 0, 25, 0, 27, 28, 29, 31,
690 30, 33, 32, 34, 36, 38, 42, 40, 44, 35,
691 37, 39, 43, 41, 45, 46, 0, 0, 0, 0,
692 0, 0, 3, 0, 0, 0, 0, 0, 46, 46,
693 46, 46, 26, 46, 0, 46, 46, 4, 46, 46,
694 0, 0, 0, 46, 46, 46, 46, 46, 46, 0,
695 0, 0, 0, 0, 15, 57, 56, 64, 62, 58,
696 59, 60, 61, 63, 55, 48, 49, 50, 51, 52,
697 53, 54, 47, 0, 0, 0, 0, 0, 0, 46,
698 0, 0, 0, 0, 0, 0, 21, 22, 23, 24,
699 14, 10, 13, 9, 6, 0, 0, 0, 0, 5,
700 16, 17, 18, 19, 20, 0, 46, 46, 11, 0,
701 0, 0, 46, 7, 12, 0, 8
704 /* YYPGOTO[NTERM-NUM]. */
705 static const yytype_int8 yypgoto[] =
707 -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
711 /* YYDEFGOTO[NTERM-NUM]. */
712 static const yytype_int8 yydefgoto[] =
714 0, 1, 32, 33, 34, 35, 36, 37, 38, 39,
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[] =
723 59, 60, 61, 62, 42, 63, 105, 83, 84, 106,
724 85, 86, 43, 45, 46, 90, 91, 92, 93, 94,
725 95, 2, 3, 47, 4, 49, 50, 5, 6, 7,
726 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
727 18, 19, 20, 21, 22, 23, 24, 54, 119, 55,
728 56, 108, 57, 48, 107, 25, 26, 27, 28, 29,
729 30, 31, 64, 65, 66, 67, 51, 58, 52, 87,
730 88, 89, 115, 53, 116, 117, 122, 0, 120, 121,
731 96, 65, 66, 67, 125, 68, 69, 70, 71, 72,
732 73, 74, 75, 0, 76, 77, 78, 79, 80, 81,
733 0, 0, 0, 68, 69, 70, 71, 72, 73, 74,
734 75, 0, 76, 77, 78, 79, 80, 81, 97, 65,
735 66, 67, 0, 0, 0, 0, 0, 0, 0, 0,
736 0, 0, 0, 98, 65, 66, 67, 0, 0, 0,
737 0, 68, 69, 70, 71, 72, 73, 74, 75, 0,
738 76, 77, 78, 79, 80, 81, 68, 69, 70, 71,
739 72, 73, 74, 75, 0, 76, 77, 78, 79, 80,
740 81, 99, 65, 66, 67, 0, 0, 0, 0, 0,
741 0, 0, 0, 0, 0, 0, 100, 65, 66, 67,
742 0, 0, 0, 0, 68, 69, 70, 71, 72, 73,
743 74, 75, 0, 76, 77, 78, 79, 80, 81, 68,
744 69, 70, 71, 72, 73, 74, 75, 0, 76, 77,
745 78, 79, 80, 81, 101, 65, 66, 67, 0, 0,
746 0, 0, 0, 0, 0, 0, 0, 0, 0, 102,
747 65, 66, 67, 0, 0, 0, 0, 68, 69, 70,
748 71, 72, 73, 74, 75, 0, 76, 77, 78, 79,
749 80, 81, 68, 69, 70, 71, 72, 73, 74, 75,
750 0, 76, 77, 78, 79, 80, 81, 103, 65, 66,
751 67, 0, 0, 0, 0, 0, 0, 0, 0, 0,
752 0, 0, 104, 65, 66, 67, 0, 0, 0, 0,
753 68, 69, 70, 71, 72, 73, 74, 75, 0, 76,
754 77, 78, 79, 80, 81, 68, 69, 70, 71, 72,
755 73, 74, 75, 0, 76, 77, 78, 79, 80, 81,
756 109, 65, 66, 67, 0, 0, 0, 0, 0, 0,
757 0, 0, 0, 0, 0, 110, 65, 66, 67, 0,
758 0, 0, 0, 68, 69, 70, 71, 72, 73, 74,
759 75, 0, 76, 77, 78, 79, 80, 81, 68, 69,
760 70, 71, 72, 73, 74, 75, 0, 76, 77, 78,
761 79, 80, 81, 111, 65, 66, 67, 0, 0, 0,
762 0, 0, 0, 0, 0, 0, 0, 0, 112, 65,
763 66, 67, 0, 0, 0, 0, 68, 69, 70, 71,
764 72, 73, 74, 75, 0, 76, 77, 78, 79, 80,
765 81, 68, 69, 70, 71, 72, 73, 74, 75, 0,
766 76, 77, 78, 79, 80, 81, 113, 65, 66, 67,
767 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
768 0, 114, 65, 66, 67, 0, 0, 0, 0, 68,
769 69, 70, 71, 72, 73, 74, 75, 0, 76, 77,
770 78, 79, 80, 81, 68, 69, 70, 71, 72, 73,
771 74, 75, 0, 76, 77, 78, 79, 80, 81, 118,
772 65, 66, 67, 0, 0, 0, 0, 0, 0, 0,
773 0, 0, 0, 0, 123, 65, 66, 67, 0, 0,
774 0, 0, 68, 69, 70, 71, 72, 73, 74, 75,
775 0, 76, 77, 78, 79, 80, 81, 68, 69, 70,
776 71, 72, 73, 74, 75, 0, 76, 77, 78, 79,
777 80, 81, 124, 65, 66, 67, 0, 0, 0, 0,
778 0, 0, 0, 0, 0, 0, 0, 126, 65, 66,
779 67, 0, 0, 0, 0, 68, 69, 70, 71, 72,
780 73, 74, 75, 0, 76, 77, 78, 79, 80, 81,
781 68, 69, 70, 71, 72, 73, 74, 75, 0, 76,
785 static const yytype_int8 yycheck[] =
787 38, 39, 40, 41, 3, 43, 27, 45, 46, 30,
788 48, 49, 32, 37, 32, 53, 54, 55, 56, 57,
789 58, 0, 1, 3, 3, 33, 29, 6, 7, 8,
790 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
791 19, 20, 21, 22, 23, 24, 25, 32, 30, 33,
792 33, 89, 33, 33, 28, 34, 35, 36, 37, 38,
793 39, 40, 3, 4, 5, 6, 26, 33, 28, 33,
794 33, 33, 33, 33, 33, 33, 33, -1, 116, 117,
795 3, 4, 5, 6, 122, 26, 27, 28, 29, 30,
796 31, 32, 33, -1, 35, 36, 37, 38, 39, 40,
797 -1, -1, -1, 26, 27, 28, 29, 30, 31, 32,
798 33, -1, 35, 36, 37, 38, 39, 40, 3, 4,
799 5, 6, -1, -1, -1, -1, -1, -1, -1, -1,
800 -1, -1, -1, 3, 4, 5, 6, -1, -1, -1,
801 -1, 26, 27, 28, 29, 30, 31, 32, 33, -1,
802 35, 36, 37, 38, 39, 40, 26, 27, 28, 29,
803 30, 31, 32, 33, -1, 35, 36, 37, 38, 39,
804 40, 3, 4, 5, 6, -1, -1, -1, -1, -1,
805 -1, -1, -1, -1, -1, -1, 3, 4, 5, 6,
806 -1, -1, -1, -1, 26, 27, 28, 29, 30, 31,
807 32, 33, -1, 35, 36, 37, 38, 39, 40, 26,
808 27, 28, 29, 30, 31, 32, 33, -1, 35, 36,
809 37, 38, 39, 40, 3, 4, 5, 6, -1, -1,
810 -1, -1, -1, -1, -1, -1, -1, -1, -1, 3,
811 4, 5, 6, -1, -1, -1, -1, 26, 27, 28,
812 29, 30, 31, 32, 33, -1, 35, 36, 37, 38,
813 39, 40, 26, 27, 28, 29, 30, 31, 32, 33,
814 -1, 35, 36, 37, 38, 39, 40, 3, 4, 5,
815 6, -1, -1, -1, -1, -1, -1, -1, -1, -1,
816 -1, -1, 3, 4, 5, 6, -1, -1, -1, -1,
817 26, 27, 28, 29, 30, 31, 32, 33, -1, 35,
818 36, 37, 38, 39, 40, 26, 27, 28, 29, 30,
819 31, 32, 33, -1, 35, 36, 37, 38, 39, 40,
820 3, 4, 5, 6, -1, -1, -1, -1, -1, -1,
821 -1, -1, -1, -1, -1, 3, 4, 5, 6, -1,
822 -1, -1, -1, 26, 27, 28, 29, 30, 31, 32,
823 33, -1, 35, 36, 37, 38, 39, 40, 26, 27,
824 28, 29, 30, 31, 32, 33, -1, 35, 36, 37,
825 38, 39, 40, 3, 4, 5, 6, -1, -1, -1,
826 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
827 5, 6, -1, -1, -1, -1, 26, 27, 28, 29,
828 30, 31, 32, 33, -1, 35, 36, 37, 38, 39,
829 40, 26, 27, 28, 29, 30, 31, 32, 33, -1,
830 35, 36, 37, 38, 39, 40, 3, 4, 5, 6,
831 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
832 -1, 3, 4, 5, 6, -1, -1, -1, -1, 26,
833 27, 28, 29, 30, 31, 32, 33, -1, 35, 36,
834 37, 38, 39, 40, 26, 27, 28, 29, 30, 31,
835 32, 33, -1, 35, 36, 37, 38, 39, 40, 3,
836 4, 5, 6, -1, -1, -1, -1, -1, -1, -1,
837 -1, -1, -1, -1, 3, 4, 5, 6, -1, -1,
838 -1, -1, 26, 27, 28, 29, 30, 31, 32, 33,
839 -1, 35, 36, 37, 38, 39, 40, 26, 27, 28,
840 29, 30, 31, 32, 33, -1, 35, 36, 37, 38,
841 39, 40, 3, 4, 5, 6, -1, -1, -1, -1,
842 -1, -1, -1, -1, -1, -1, -1, 3, 4, 5,
843 6, -1, -1, -1, -1, 26, 27, 28, 29, 30,
844 31, 32, 33, -1, 35, 36, 37, 38, 39, 40,
845 26, 27, 28, 29, 30, 31, 32, 33, -1, 35,
849 /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
851 static const yytype_int8 yystos[] =
853 0, 42, 0, 1, 3, 6, 7, 8, 9, 10,
854 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
855 21, 22, 23, 24, 25, 34, 35, 36, 37, 38,
856 39, 40, 43, 44, 45, 46, 47, 48, 49, 50,
857 51, 52, 3, 32, 53, 37, 32, 3, 33, 33,
858 29, 26, 28, 33, 32, 33, 33, 33, 33, 53,
859 53, 53, 53, 53, 3, 4, 5, 6, 26, 27,
860 28, 29, 30, 31, 32, 33, 35, 36, 37, 38,
861 39, 40, 54, 53, 53, 53, 53, 33, 33, 33,
862 53, 53, 53, 53, 53, 53, 3, 3, 3, 3,
863 3, 3, 3, 3, 3, 27, 30, 28, 53, 3,
864 3, 3, 3, 3, 3, 33, 33, 33, 3, 30,
865 53, 53, 33, 3, 3, 53, 3
868 /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
869 static const yytype_int8 yyr1[] =
871 0, 41, 42, 42, 43, 43, 43, 43, 43, 43,
872 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
873 43, 43, 43, 43, 43, 43, 43, 44, 44, 44,
874 45, 45, 46, 46, 47, 47, 48, 48, 49, 49,
875 50, 50, 51, 51, 52, 52, 53, 53, 54, 54,
876 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
880 /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
881 static const yytype_int8 yyr2[] =
883 0, 2, 0, 2, 2, 4, 4, 7, 9, 4,
884 4, 5, 7, 4, 4, 3, 4, 4, 4, 4,
885 4, 3, 3, 3, 3, 1, 2, 1, 1, 1,
886 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
887 1, 1, 1, 1, 1, 1, 0, 2, 1, 1,
888 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
893 enum { YYENOMEM = -2 };
895 #define yyerrok (yyerrstatus = 0)
896 #define yyclearin (yychar = YYEMPTY)
898 #define YYACCEPT goto yyacceptlab
899 #define YYABORT goto yyabortlab
900 #define YYERROR goto yyerrorlab
901 #define YYNOMEM goto yyexhaustedlab
904 #define YYRECOVERING() (!!yyerrstatus)
906 #define YYBACKUP(Token, Value) \
908 if (yychar == YYEMPTY) \
912 YYPOPSTACK (yylen); \
918 yyerror (yyscanner, YY_("syntax error: cannot back up")); \
923 /* Backward compatibility with an undocumented macro.
924 Use YYerror or YYUNDEF. */
925 #define YYERRCODE YYUNDEF
928 /* Enable debugging if requested. */
932 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
933 # define YYFPRINTF fprintf
936 # define YYDPRINTF(Args) \
945 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
949 YYFPRINTF (stderr, "%s ", Title); \
950 yy_symbol_print (stderr, \
951 Kind, Value, yyscanner); \
952 YYFPRINTF (stderr, "\n"); \
957 /*-----------------------------------.
958 | Print this symbol's value on YYO. |
959 `-----------------------------------*/
962 yy_symbol_value_print (FILE *yyo,
963 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, yyscan_t yyscanner)
965 FILE *yyoutput = yyo;
970 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
972 YY_IGNORE_MAYBE_UNINITIALIZED_END
976 /*---------------------------.
977 | Print this symbol on YYO. |
978 `---------------------------*/
981 yy_symbol_print (FILE *yyo,
982 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, yyscan_t yyscanner)
984 YYFPRINTF (yyo, "%s %s (",
985 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
987 yy_symbol_value_print (yyo, yykind, yyvaluep, yyscanner);
988 YYFPRINTF (yyo, ")");
991 /*------------------------------------------------------------------.
992 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
994 `------------------------------------------------------------------*/
997 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
999 YYFPRINTF (stderr, "Stack now");
1000 for (; yybottom <= yytop; yybottom++)
1002 int yybot = *yybottom;
1003 YYFPRINTF (stderr, " %d", yybot);
1005 YYFPRINTF (stderr, "\n");
1008 # define YY_STACK_PRINT(Bottom, Top) \
1011 yy_stack_print ((Bottom), (Top)); \
1015 /*------------------------------------------------.
1016 | Report that the YYRULE is going to be reduced. |
1017 `------------------------------------------------*/
1020 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
1021 int yyrule, yyscan_t yyscanner)
1023 int yylno = yyrline[yyrule];
1024 int yynrhs = yyr2[yyrule];
1026 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1028 /* The symbols being reduced. */
1029 for (yyi = 0; yyi < yynrhs; yyi++)
1031 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1032 yy_symbol_print (stderr,
1033 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1034 &yyvsp[(yyi + 1) - (yynrhs)], yyscanner);
1035 YYFPRINTF (stderr, "\n");
1039 # define YY_REDUCE_PRINT(Rule) \
1042 yy_reduce_print (yyssp, yyvsp, Rule, yyscanner); \
1045 /* Nonzero means print parse trace. It is left uninitialized so that
1046 multiple parsers can coexist. */
1048 #else /* !YYDEBUG */
1049 # define YYDPRINTF(Args) ((void) 0)
1050 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1051 # define YY_STACK_PRINT(Bottom, Top)
1052 # define YY_REDUCE_PRINT(Rule)
1053 #endif /* !YYDEBUG */
1056 /* YYINITDEPTH -- initial size of the parser's stacks. */
1058 # define YYINITDEPTH 200
1061 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1062 if the built-in stack extension method is used).
1064 Do not make this value too large; the results are undefined if
1065 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1066 evaluated with infinite-precision integer arithmetic. */
1069 # define YYMAXDEPTH 10000
1073 /* Context of a parse error. */
1077 yysymbol_kind_t yytoken;
1080 /* Put in YYARG at most YYARGN of the expected tokens given the
1081 current YYCTX, and return the number of tokens stored in YYARG. If
1082 YYARG is null, return the number of expected tokens (guaranteed to
1083 be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
1084 Return 0 if there are more than YYARGN expected tokens, yet fill
1085 YYARG up to YYARGN. */
1087 yypcontext_expected_tokens (const yypcontext_t *yyctx,
1088 yysymbol_kind_t yyarg[], int yyargn)
1090 /* Actual size of YYARG. */
1092 int yyn = yypact[+*yyctx->yyssp];
1093 if (!yypact_value_is_default (yyn))
1095 /* Start YYX at -YYN if negative to avoid negative indexes in
1096 YYCHECK. In other words, skip the first -YYN actions for
1097 this state because they are default actions. */
1098 int yyxbegin = yyn < 0 ? -yyn : 0;
1099 /* Stay within bounds of both yycheck and yytname. */
1100 int yychecklim = YYLAST - yyn + 1;
1101 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1103 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1104 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
1105 && !yytable_value_is_error (yytable[yyx + yyn]))
1109 else if (yycount == yyargn)
1112 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
1115 if (yyarg && yycount == 0 && 0 < yyargn)
1116 yyarg[0] = YYSYMBOL_YYEMPTY;
1124 # if defined __GLIBC__ && defined _STRING_H
1125 # define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
1127 /* Return the length of YYSTR. */
1129 yystrlen (const char *yystr)
1132 for (yylen = 0; yystr[yylen]; yylen++)
1140 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1141 # define yystpcpy stpcpy
1143 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1146 yystpcpy (char *yydest, const char *yysrc)
1149 const char *yys = yysrc;
1151 while ((*yyd++ = *yys++) != '\0')
1160 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1161 quotes and backslashes, so that it's suitable for yyerror. The
1162 heuristic is that double-quoting is unnecessary unless the string
1163 contains an apostrophe, a comma, or backslash (other than
1164 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1165 null, do not copy; instead, return the length of what the result
1168 yytnamerr (char *yyres, const char *yystr)
1172 YYPTRDIFF_T yyn = 0;
1173 char const *yyp = yystr;
1179 goto do_not_strip_quotes;
1183 goto do_not_strip_quotes;
1199 do_not_strip_quotes: ;
1203 return yystpcpy (yyres, yystr) - yyres;
1205 return yystrlen (yystr);
1211 yy_syntax_error_arguments (const yypcontext_t *yyctx,
1212 yysymbol_kind_t yyarg[], int yyargn)
1214 /* Actual size of YYARG. */
1216 /* There are many possibilities here to consider:
1217 - If this state is a consistent state with a default action, then
1218 the only way this function was invoked is if the default action
1219 is an error action. In that case, don't check for expected
1220 tokens because there are none.
1221 - The only way there can be no lookahead present (in yychar) is if
1222 this state is a consistent state with a default action. Thus,
1223 detecting the absence of a lookahead is sufficient to determine
1224 that there is no unexpected or expected token to report. In that
1225 case, just report a simple "syntax error".
1226 - Don't assume there isn't a lookahead just because this state is a
1227 consistent state with a default action. There might have been a
1228 previous inconsistent state, consistent state with a non-default
1229 action, or user semantic action that manipulated yychar.
1230 - Of course, the expected token list depends on states to have
1231 correct lookahead information, and it depends on the parser not
1232 to perform extra reductions after fetching a lookahead from the
1233 scanner and before detecting a syntax error. Thus, state merging
1234 (from LALR or IELR) and default reductions corrupt the expected
1235 token list. However, the list is correct for canonical LR with
1236 one exception: it will still contain any token that will not be
1237 accepted due to an error action in a later state.
1239 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
1243 yyarg[yycount] = yyctx->yytoken;
1245 yyn = yypcontext_expected_tokens (yyctx,
1246 yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1247 if (yyn == YYENOMEM)
1255 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1256 about the unexpected token YYTOKEN for the state stack whose top is
1259 Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
1260 not large enough to hold the message. In that case, also set
1261 *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
1262 required number of bytes is too large to store. */
1264 yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
1265 const yypcontext_t *yyctx)
1267 enum { YYARGS_MAX = 5 };
1268 /* Internationalized format string. */
1269 const char *yyformat = YY_NULLPTR;
1270 /* Arguments of yyformat: reported tokens (one for the "unexpected",
1271 one per "expected"). */
1272 yysymbol_kind_t yyarg[YYARGS_MAX];
1273 /* Cumulated lengths of YYARG. */
1274 YYPTRDIFF_T yysize = 0;
1276 /* Actual size of YYARG. */
1277 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
1278 if (yycount == YYENOMEM)
1283 #define YYCASE_(N, S) \
1287 default: /* Avoid compiler warnings. */
1288 YYCASE_(0, YY_("syntax error"));
1289 YYCASE_(1, YY_("syntax error, unexpected %s"));
1290 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1291 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1292 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1293 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1297 /* Compute error message size. Don't count the "%s"s, but reserve
1298 room for the terminator. */
1299 yysize = yystrlen (yyformat) - 2 * yycount + 1;
1302 for (yyi = 0; yyi < yycount; ++yyi)
1305 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
1306 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1313 if (*yymsg_alloc < yysize)
1315 *yymsg_alloc = 2 * yysize;
1316 if (! (yysize <= *yymsg_alloc
1317 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1318 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1322 /* Avoid sprintf, as that infringes on the user's name space.
1323 Don't have undefined behavior even if the translation
1324 produced a string with the wrong number of "%s"s. */
1328 while ((*yyp = *yyformat) != '\0')
1329 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1331 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
1344 /*-----------------------------------------------.
1345 | Release the memory associated to this symbol. |
1346 `-----------------------------------------------*/
1349 yydestruct (const char *yymsg,
1350 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, yyscan_t yyscanner)
1356 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1358 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1361 case YYSYMBOL_STRING: /* STRING */
1362 #line 100 "cmFortranParser.y"
1363 { free(((*yyvaluep).string)); }
1364 #line 1365 "cmFortranParser.cxx"
1367 case YYSYMBOL_WORD: /* WORD */
1368 #line 100 "cmFortranParser.y"
1369 { free(((*yyvaluep).string)); }
1370 #line 1371 "cmFortranParser.cxx"
1373 case YYSYMBOL_CPP_INCLUDE_ANGLE: /* CPP_INCLUDE_ANGLE */
1374 #line 100 "cmFortranParser.y"
1375 { free(((*yyvaluep).string)); }
1376 #line 1377 "cmFortranParser.cxx"
1382 YY_IGNORE_MAYBE_UNINITIALIZED_END
1395 yyparse (yyscan_t yyscanner)
1397 /* Lookahead token kind. */
1401 /* The semantic value of the lookahead symbol. */
1402 /* Default value used for initialization, for pacifying older GCCs
1403 or non-GCC compilers. */
1404 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1405 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1407 /* Number of syntax errors so far. */
1410 yy_state_fast_t yystate = 0;
1411 /* Number of tokens to shift before error messages enabled. */
1412 int yyerrstatus = 0;
1414 /* Refer to the stacks through separate pointers, to allow yyoverflow
1415 to reallocate them elsewhere. */
1418 YYPTRDIFF_T yystacksize = YYINITDEPTH;
1420 /* The state stack: array, bottom, top. */
1421 yy_state_t yyssa[YYINITDEPTH];
1422 yy_state_t *yyss = yyssa;
1423 yy_state_t *yyssp = yyss;
1425 /* The semantic value stack: array, bottom, top. */
1426 YYSTYPE yyvsa[YYINITDEPTH];
1427 YYSTYPE *yyvs = yyvsa;
1428 YYSTYPE *yyvsp = yyvs;
1431 /* The return value of yyparse. */
1433 /* Lookahead symbol kind. */
1434 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1435 /* The variables used to return semantic value and location from the
1439 /* Buffer for error messages, and its allocated size. */
1441 char *yymsg = yymsgbuf;
1442 YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1444 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1446 /* The number of symbols on the RHS of the reduced rule.
1447 Keep to zero when no symbol should be popped. */
1450 YYDPRINTF ((stderr, "Starting parse\n"));
1452 yychar = YYEMPTY; /* Cause a token to be read. */
1457 /*------------------------------------------------------------.
1458 | yynewstate -- push a new state, which is found in yystate. |
1459 `------------------------------------------------------------*/
1461 /* In all cases, when you get here, the value and location stacks
1462 have just been pushed. So pushing a state here evens the stacks. */
1466 /*--------------------------------------------------------------------.
1467 | yysetstate -- set current state (the top of the stack) to yystate. |
1468 `--------------------------------------------------------------------*/
1470 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1471 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1472 YY_IGNORE_USELESS_CAST_BEGIN
1473 *yyssp = YY_CAST (yy_state_t, yystate);
1474 YY_IGNORE_USELESS_CAST_END
1475 YY_STACK_PRINT (yyss, yyssp);
1477 if (yyss + yystacksize - 1 <= yyssp)
1478 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1482 /* Get the current used size of the three stacks, in elements. */
1483 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1485 # if defined yyoverflow
1487 /* Give user a chance to reallocate the stack. Use copies of
1488 these so that the &'s don't force the real ones into
1490 yy_state_t *yyss1 = yyss;
1491 YYSTYPE *yyvs1 = yyvs;
1493 /* Each stack pointer address is followed by the size of the
1494 data in use in that stack, in bytes. This used to be a
1495 conditional around just the two extra args, but that might
1496 be undefined if yyoverflow is a macro. */
1497 yyoverflow (YY_("memory exhausted"),
1498 &yyss1, yysize * YYSIZEOF (*yyssp),
1499 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1504 # else /* defined YYSTACK_RELOCATE */
1505 /* Extend the stack our own way. */
1506 if (YYMAXDEPTH <= yystacksize)
1509 if (YYMAXDEPTH < yystacksize)
1510 yystacksize = YYMAXDEPTH;
1513 yy_state_t *yyss1 = yyss;
1514 union yyalloc *yyptr =
1515 YY_CAST (union yyalloc *,
1516 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1519 YYSTACK_RELOCATE (yyss_alloc, yyss);
1520 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1521 # undef YYSTACK_RELOCATE
1523 YYSTACK_FREE (yyss1);
1527 yyssp = yyss + yysize - 1;
1528 yyvsp = yyvs + yysize - 1;
1530 YY_IGNORE_USELESS_CAST_BEGIN
1531 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1532 YY_CAST (long, yystacksize)));
1533 YY_IGNORE_USELESS_CAST_END
1535 if (yyss + yystacksize - 1 <= yyssp)
1538 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1541 if (yystate == YYFINAL)
1551 /* Do appropriate processing given the current state. Read a
1552 lookahead token if we need one and don't already have one. */
1554 /* First try to decide what to do without reference to lookahead token. */
1555 yyn = yypact[yystate];
1556 if (yypact_value_is_default (yyn))
1559 /* Not known => get a lookahead token if don't already have one. */
1561 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1562 if (yychar == YYEMPTY)
1564 YYDPRINTF ((stderr, "Reading a token\n"));
1565 yychar = yylex (&yylval, yyscanner);
1568 if (yychar <= YYEOF)
1571 yytoken = YYSYMBOL_YYEOF;
1572 YYDPRINTF ((stderr, "Now at end of input.\n"));
1574 else if (yychar == YYerror)
1576 /* The scanner already issued an error message, process directly
1577 to error recovery. But do not keep the error token as
1578 lookahead, it is too special and may lead us to an endless
1579 loop in error recovery. */
1581 yytoken = YYSYMBOL_YYerror;
1586 yytoken = YYTRANSLATE (yychar);
1587 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1590 /* If the proper action on seeing token YYTOKEN is to reduce or to
1591 detect an error, take that action. */
1593 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1598 if (yytable_value_is_error (yyn))
1604 /* Count tokens shifted since error; after three, turn off error
1609 /* Shift the lookahead token. */
1610 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1612 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1614 YY_IGNORE_MAYBE_UNINITIALIZED_END
1616 /* Discard the shifted token. */
1621 /*-----------------------------------------------------------.
1622 | yydefault -- do the default action for the current state. |
1623 `-----------------------------------------------------------*/
1625 yyn = yydefact[yystate];
1631 /*-----------------------------.
1632 | yyreduce -- do a reduction. |
1633 `-----------------------------*/
1635 /* yyn is the number of a rule to reduce with. */
1638 /* If YYLEN is nonzero, implement the default value of the action:
1641 Otherwise, the following line sets YYVAL to garbage.
1642 This behavior is undocumented and Bison
1643 users should not rely upon it. Assigning to YYVAL
1644 unconditionally makes the parser a bit smaller, and it avoids a
1645 GCC warning that YYVAL may be used uninitialized. */
1646 yyval = yyvsp[1-yylen];
1649 YY_REDUCE_PRINT (yyn);
1652 case 4: /* stmt: INTERFACE EOSTMT */
1653 #line 109 "cmFortranParser.y"
1655 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1656 cmFortranParser_SetInInterface(parser, true);
1658 #line 1659 "cmFortranParser.cxx"
1661 case 5: /* stmt: USE WORD other EOSTMT */
1662 #line 113 "cmFortranParser.y"
1664 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1665 cmFortranParser_RuleUse(parser, (yyvsp[-2].string));
1666 free((yyvsp[-2].string));
1668 #line 1669 "cmFortranParser.cxx"
1671 case 6: /* stmt: MODULE WORD other EOSTMT */
1672 #line 118 "cmFortranParser.y"
1674 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1675 if (cmsysString_strcasecmp((yyvsp[-2].string), "function") != 0 &&
1676 cmsysString_strcasecmp((yyvsp[-2].string), "procedure") != 0 &&
1677 cmsysString_strcasecmp((yyvsp[-2].string), "subroutine") != 0) {
1678 cmFortranParser_RuleModule(parser, (yyvsp[-2].string));
1680 free((yyvsp[-2].string));
1682 #line 1683 "cmFortranParser.cxx"
1685 case 7: /* stmt: SUBMODULE LPAREN WORD RPAREN WORD other EOSTMT */
1686 #line 127 "cmFortranParser.y"
1688 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1689 cmFortranParser_RuleSubmodule(parser, (yyvsp[-4].string), (yyvsp[-2].string));
1690 free((yyvsp[-4].string));
1691 free((yyvsp[-2].string));
1693 #line 1694 "cmFortranParser.cxx"
1696 case 8: /* stmt: SUBMODULE LPAREN WORD COLON WORD RPAREN WORD other EOSTMT */
1697 #line 133 "cmFortranParser.y"
1699 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1700 cmFortranParser_RuleSubmoduleNested(parser, (yyvsp[-6].string), (yyvsp[-4].string), (yyvsp[-2].string));
1701 free((yyvsp[-6].string));
1702 free((yyvsp[-4].string));
1703 free((yyvsp[-2].string));
1705 #line 1706 "cmFortranParser.cxx"
1708 case 9: /* stmt: INTERFACE WORD other EOSTMT */
1709 #line 140 "cmFortranParser.y"
1711 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1712 cmFortranParser_SetInInterface(parser, true);
1713 free((yyvsp[-2].string));
1715 #line 1716 "cmFortranParser.cxx"
1718 case 10: /* stmt: END INTERFACE other EOSTMT */
1719 #line 145 "cmFortranParser.y"
1721 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1722 cmFortranParser_SetInInterface(parser, false);
1724 #line 1725 "cmFortranParser.cxx"
1727 case 11: /* stmt: USE DCOLON WORD other EOSTMT */
1728 #line 149 "cmFortranParser.y"
1730 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1731 cmFortranParser_RuleUse(parser, (yyvsp[-2].string));
1732 free((yyvsp[-2].string));
1734 #line 1735 "cmFortranParser.cxx"
1737 case 12: /* stmt: USE COMMA WORD DCOLON WORD other EOSTMT */
1738 #line 154 "cmFortranParser.y"
1740 if (cmsysString_strcasecmp((yyvsp[-4].string), "non_intrinsic") == 0) {
1741 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1742 cmFortranParser_RuleUse(parser, (yyvsp[-2].string));
1744 if (cmsysString_strcasecmp((yyvsp[-4].string), "intrinsic") == 0) {
1745 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1746 cmFortranParser_RuleUseIntrinsic(parser, (yyvsp[-2].string));
1748 free((yyvsp[-4].string));
1749 free((yyvsp[-2].string));
1751 #line 1752 "cmFortranParser.cxx"
1754 case 13: /* stmt: INCLUDE STRING other EOSTMT */
1755 #line 166 "cmFortranParser.y"
1757 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1758 cmFortranParser_RuleInclude(parser, (yyvsp[-2].string));
1759 free((yyvsp[-2].string));
1761 #line 1762 "cmFortranParser.cxx"
1764 case 14: /* stmt: CPP_LINE_DIRECTIVE STRING other EOSTMT */
1765 #line 171 "cmFortranParser.y"
1767 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1768 cmFortranParser_RuleLineDirective(parser, (yyvsp[-2].string));
1769 free((yyvsp[-2].string));
1771 #line 1772 "cmFortranParser.cxx"
1774 case 15: /* stmt: CPP_INCLUDE_ANGLE other EOSTMT */
1775 #line 176 "cmFortranParser.y"
1777 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1778 cmFortranParser_RuleInclude(parser, (yyvsp[-2].string));
1779 free((yyvsp[-2].string));
1781 #line 1782 "cmFortranParser.cxx"
1784 case 16: /* stmt: include STRING other EOSTMT */
1785 #line 181 "cmFortranParser.y"
1787 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1788 cmFortranParser_RuleInclude(parser, (yyvsp[-2].string));
1789 free((yyvsp[-2].string));
1791 #line 1792 "cmFortranParser.cxx"
1794 case 17: /* stmt: define WORD other EOSTMT */
1795 #line 186 "cmFortranParser.y"
1797 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1798 cmFortranParser_RuleDefine(parser, (yyvsp[-2].string));
1799 free((yyvsp[-2].string));
1801 #line 1802 "cmFortranParser.cxx"
1804 case 18: /* stmt: undef WORD other EOSTMT */
1805 #line 191 "cmFortranParser.y"
1807 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1808 cmFortranParser_RuleUndef(parser, (yyvsp[-2].string));
1809 free((yyvsp[-2].string));
1811 #line 1812 "cmFortranParser.cxx"
1814 case 19: /* stmt: ifdef WORD other EOSTMT */
1815 #line 196 "cmFortranParser.y"
1817 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1818 cmFortranParser_RuleIfdef(parser, (yyvsp[-2].string));
1819 free((yyvsp[-2].string));
1821 #line 1822 "cmFortranParser.cxx"
1824 case 20: /* stmt: ifndef WORD other EOSTMT */
1825 #line 201 "cmFortranParser.y"
1827 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1828 cmFortranParser_RuleIfndef(parser, (yyvsp[-2].string));
1829 free((yyvsp[-2].string));
1831 #line 1832 "cmFortranParser.cxx"
1834 case 21: /* stmt: if other EOSTMT */
1835 #line 206 "cmFortranParser.y"
1837 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1838 cmFortranParser_RuleIf(parser);
1840 #line 1841 "cmFortranParser.cxx"
1843 case 22: /* stmt: elif other EOSTMT */
1844 #line 210 "cmFortranParser.y"
1846 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1847 cmFortranParser_RuleElif(parser);
1849 #line 1850 "cmFortranParser.cxx"
1852 case 23: /* stmt: else other EOSTMT */
1853 #line 214 "cmFortranParser.y"
1855 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1856 cmFortranParser_RuleElse(parser);
1858 #line 1859 "cmFortranParser.cxx"
1861 case 24: /* stmt: endif other EOSTMT */
1862 #line 218 "cmFortranParser.y"
1864 cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
1865 cmFortranParser_RuleEndif(parser);
1867 #line 1868 "cmFortranParser.cxx"
1870 case 48: /* misc_code: WORD */
1871 #line 240 "cmFortranParser.y"
1872 { free ((yyvsp[0].string)); }
1873 #line 1874 "cmFortranParser.cxx"
1876 case 55: /* misc_code: STRING */
1877 #line 247 "cmFortranParser.y"
1878 { free ((yyvsp[0].string)); }
1879 #line 1880 "cmFortranParser.cxx"
1883 #line 1884 "cmFortranParser.cxx"
1887 /* User semantic actions sometimes alter yychar, and that requires
1888 that yytoken be updated with the new translation. We take the
1889 approach of translating immediately before every use of yytoken.
1890 One alternative is translating here after every semantic action,
1891 but that translation would be missed if the semantic action invokes
1892 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1893 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1894 incorrect destructor might then be invoked immediately. In the
1895 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1896 to an incorrect destructor call or verbose syntax error message
1897 before the lookahead is translated. */
1898 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1905 /* Now 'shift' the result of the reduction. Determine what state
1906 that goes to, based on the state we popped back to and the rule
1907 number reduced by. */
1909 const int yylhs = yyr1[yyn] - YYNTOKENS;
1910 const int yyi = yypgoto[yylhs] + *yyssp;
1911 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1913 : yydefgoto[yylhs]);
1919 /*--------------------------------------.
1920 | yyerrlab -- here on detecting error. |
1921 `--------------------------------------*/
1923 /* Make sure we have latest lookahead translation. See comments at
1924 user semantic actions for why this is necessary. */
1925 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1926 /* If not already recovering from an error, report this error. */
1933 char const *yymsgp = YY_("syntax error");
1934 int yysyntax_error_status;
1935 yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
1936 if (yysyntax_error_status == 0)
1938 else if (yysyntax_error_status == -1)
1940 if (yymsg != yymsgbuf)
1941 YYSTACK_FREE (yymsg);
1942 yymsg = YY_CAST (char *,
1943 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
1946 yysyntax_error_status
1947 = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
1953 yymsg_alloc = sizeof yymsgbuf;
1954 yysyntax_error_status = YYENOMEM;
1957 yyerror (yyscanner, yymsgp);
1958 if (yysyntax_error_status == YYENOMEM)
1963 if (yyerrstatus == 3)
1965 /* If just tried and failed to reuse lookahead token after an
1966 error, discard it. */
1968 if (yychar <= YYEOF)
1970 /* Return failure if at end of input. */
1971 if (yychar == YYEOF)
1976 yydestruct ("Error: discarding",
1977 yytoken, &yylval, yyscanner);
1982 /* Else will try to reuse lookahead token after shifting the error
1987 /*---------------------------------------------------.
1988 | yyerrorlab -- error raised explicitly by YYERROR. |
1989 `---------------------------------------------------*/
1991 /* Pacify compilers when the user code never invokes YYERROR and the
1992 label yyerrorlab therefore never appears in user code. */
1997 /* Do not reclaim the symbols of the rule whose action triggered
2001 YY_STACK_PRINT (yyss, yyssp);
2006 /*-------------------------------------------------------------.
2007 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2008 `-------------------------------------------------------------*/
2010 yyerrstatus = 3; /* Each real token shifted decrements this. */
2012 /* Pop stack until we find a state that shifts the error token. */
2015 yyn = yypact[yystate];
2016 if (!yypact_value_is_default (yyn))
2018 yyn += YYSYMBOL_YYerror;
2019 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
2027 /* Pop the current state because it cannot handle the error token. */
2032 yydestruct ("Error: popping",
2033 YY_ACCESSING_SYMBOL (yystate), yyvsp, yyscanner);
2036 YY_STACK_PRINT (yyss, yyssp);
2039 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2041 YY_IGNORE_MAYBE_UNINITIALIZED_END
2044 /* Shift the error token. */
2045 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
2051 /*-------------------------------------.
2052 | yyacceptlab -- YYACCEPT comes here. |
2053 `-------------------------------------*/
2059 /*-----------------------------------.
2060 | yyabortlab -- YYABORT comes here. |
2061 `-----------------------------------*/
2067 /*-----------------------------------------------------------.
2068 | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
2069 `-----------------------------------------------------------*/
2071 yyerror (yyscanner, YY_("memory exhausted"));
2076 /*----------------------------------------------------------.
2077 | yyreturnlab -- parsing is finished, clean up and return. |
2078 `----------------------------------------------------------*/
2080 if (yychar != YYEMPTY)
2082 /* Make sure we have latest lookahead translation. See comments at
2083 user semantic actions for why this is necessary. */
2084 yytoken = YYTRANSLATE (yychar);
2085 yydestruct ("Cleanup: discarding lookahead",
2086 yytoken, &yylval, yyscanner);
2088 /* Do not reclaim the symbols of the rule whose action triggered
2089 this YYABORT or YYACCEPT. */
2091 YY_STACK_PRINT (yyss, yyssp);
2092 while (yyssp != yyss)
2094 yydestruct ("Cleanup: popping",
2095 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yyscanner);
2100 YYSTACK_FREE (yyss);
2102 if (yymsg != yymsgbuf)
2103 YYSTACK_FREE (yymsg);
2107 #line 259 "cmFortranParser.y"
2109 /* End of grammar */