diff options
Diffstat (limited to 'Source/LexerParser/cmFortranParser.cxx')
-rw-r--r-- | Source/LexerParser/cmFortranParser.cxx | 235 |
1 files changed, 114 insertions, 121 deletions
diff --git a/Source/LexerParser/cmFortranParser.cxx b/Source/LexerParser/cmFortranParser.cxx index 50e9752..b177296 100644 --- a/Source/LexerParser/cmFortranParser.cxx +++ b/Source/LexerParser/cmFortranParser.cxx @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.7.5. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program. If not, see <https://www.gnu.org/licenses/>. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -46,10 +46,10 @@ USER NAME SPACE" below. */ /* Identify Bison output, and Bison version. */ -#define YYBISON 30705 +#define YYBISON 30802 /* Bison version string. */ -#define YYBISON_VERSION "3.7.5" +#define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -132,8 +132,13 @@ static void cmFortran_yyerror(yyscan_t yyscanner, const char* message) # pragma GCC diagnostic ignored "-Wconversion" # pragma GCC diagnostic ignored "-Wfree-nonheap-object" #endif +#if defined(__clang__) && defined(__has_warning) +# if __has_warning("-Wunused-but-set-variable") +# pragma clang diagnostic ignored "-Wunused-but-set-variable" +# endif +#endif -#line 137 "cmFortranParser.cxx" +#line 142 "cmFortranParser.cxx" # ifndef YY_CAST # ifdef __cplusplus @@ -373,12 +378,18 @@ typedef int yy_state_fast_t; # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -596,16 +607,16 @@ static const yytype_int8 yytranslate[] = }; #if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint8 yyrline[] = +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_int16 yyrline[] = { - 0, 101, 101, 101, 104, 108, 113, 122, 128, 135, - 140, 144, 149, 161, 166, 171, 176, 181, 186, 191, - 196, 201, 205, 209, 213, 217, 218, 223, 223, 223, - 224, 224, 225, 225, 226, 226, 227, 227, 228, 228, - 229, 229, 230, 230, 231, 231, 232, 232, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251 + 0, 106, 106, 106, 109, 113, 118, 127, 133, 140, + 145, 149, 154, 166, 171, 176, 181, 186, 191, 196, + 201, 206, 210, 214, 218, 222, 223, 228, 228, 228, + 229, 229, 230, 230, 231, 231, 232, 232, 233, 233, + 234, 234, 235, 235, 236, 236, 237, 237, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256 }; #endif @@ -641,19 +652,6 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_int16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295 -}; -#endif - #define YYPACT_NINF (-39) #define yypact_value_is_default(Yyn) \ @@ -664,8 +662,8 @@ static const yytype_int16 yytoknum[] = #define yytable_value_is_error(Yyn) \ 0 - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int16 yypact[] = { -39, 21, -39, 1, -39, -20, -39, -39, -39, -39, @@ -683,9 +681,9 @@ static const yytype_int16 yypact[] = 501, 539, -39, -39, -39, 554, -39 }; - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ static const yytype_int8 yydefact[] = { 2, 0, 1, 0, 25, 0, 27, 28, 29, 31, @@ -703,23 +701,23 @@ static const yytype_int8 yydefact[] = 0, 0, 46, 7, 12, 0, 8 }; - /* YYPGOTO[NTERM-NUM]. */ +/* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -39, -38, -39 }; - /* YYDEFGOTO[NTERM-NUM]. */ +/* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { 0, 1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 44, 82 }; - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int8 yytable[] = { 59, 60, 61, 62, 42, 63, 105, 83, 84, 106, @@ -848,8 +846,8 @@ static const yytype_int8 yycheck[] = 36, 37, 38, 39, 40 }; - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ static const yytype_int8 yystos[] = { 0, 42, 0, 1, 3, 6, 7, 8, 9, 10, @@ -867,7 +865,7 @@ static const yytype_int8 yystos[] = 53, 53, 33, 3, 3, 53, 3 }; - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_int8 yyr1[] = { 0, 41, 42, 42, 43, 43, 43, 43, 43, 43, @@ -879,7 +877,7 @@ static const yytype_int8 yyr1[] = 54, 54, 54, 54, 54 }; - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { 0, 2, 0, 2, 2, 4, 4, 7, 9, 4, @@ -900,6 +898,7 @@ enum { YYENOMEM = -2 }; #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) @@ -940,10 +939,7 @@ do { \ YYFPRINTF Args; \ } while (0) -/* This macro is provided for backward compatibility. */ -# ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif + # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ @@ -971,10 +967,6 @@ yy_symbol_value_print (FILE *yyo, YY_USE (yyscanner); if (!yyvaluep) return; -# ifdef YYPRINT - if (yykind < YYNTOKENS) - YYPRINT (yyo, yytoknum[yykind], *yyvaluep); -# endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END @@ -1367,21 +1359,21 @@ yydestruct (const char *yymsg, switch (yykind) { case YYSYMBOL_STRING: /* STRING */ -#line 95 "cmFortranParser.y" +#line 100 "cmFortranParser.y" { free(((*yyvaluep).string)); } -#line 1373 "cmFortranParser.cxx" +#line 1365 "cmFortranParser.cxx" break; case YYSYMBOL_WORD: /* WORD */ -#line 95 "cmFortranParser.y" +#line 100 "cmFortranParser.y" { free(((*yyvaluep).string)); } -#line 1379 "cmFortranParser.cxx" +#line 1371 "cmFortranParser.cxx" break; case YYSYMBOL_CPP_INCLUDE_ANGLE: /* CPP_INCLUDE_ANGLE */ -#line 95 "cmFortranParser.y" +#line 100 "cmFortranParser.y" { free(((*yyvaluep).string)); } -#line 1385 "cmFortranParser.cxx" +#line 1377 "cmFortranParser.cxx" break; default: @@ -1458,6 +1450,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); YYDPRINTF ((stderr, "Starting parse\n")); yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; @@ -1483,7 +1476,7 @@ yysetstate: if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; + YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ @@ -1511,7 +1504,7 @@ yysetstate: # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; @@ -1522,7 +1515,7 @@ yysetstate: YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) - goto yyexhaustedlab; + YYNOMEM; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE @@ -1544,6 +1537,7 @@ yysetstate: } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + if (yystate == YYFINAL) YYACCEPT; @@ -1656,26 +1650,26 @@ yyreduce: switch (yyn) { case 4: /* stmt: INTERFACE EOSTMT */ -#line 104 "cmFortranParser.y" +#line 109 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_SetInInterface(parser, true); } -#line 1665 "cmFortranParser.cxx" +#line 1659 "cmFortranParser.cxx" break; case 5: /* stmt: USE WORD other EOSTMT */ -#line 108 "cmFortranParser.y" +#line 113 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleUse(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1675 "cmFortranParser.cxx" +#line 1669 "cmFortranParser.cxx" break; case 6: /* stmt: MODULE WORD other EOSTMT */ -#line 113 "cmFortranParser.y" +#line 118 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); if (cmsysString_strcasecmp((yyvsp[-2].string), "function") != 0 && @@ -1685,22 +1679,22 @@ yyreduce: } free((yyvsp[-2].string)); } -#line 1689 "cmFortranParser.cxx" +#line 1683 "cmFortranParser.cxx" break; case 7: /* stmt: SUBMODULE LPAREN WORD RPAREN WORD other EOSTMT */ -#line 122 "cmFortranParser.y" +#line 127 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleSubmodule(parser, (yyvsp[-4].string), (yyvsp[-2].string)); free((yyvsp[-4].string)); free((yyvsp[-2].string)); } -#line 1700 "cmFortranParser.cxx" +#line 1694 "cmFortranParser.cxx" break; case 8: /* stmt: SUBMODULE LPAREN WORD COLON WORD RPAREN WORD other EOSTMT */ -#line 128 "cmFortranParser.y" +#line 133 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleSubmoduleNested(parser, (yyvsp[-6].string), (yyvsp[-4].string), (yyvsp[-2].string)); @@ -1708,40 +1702,40 @@ yyreduce: free((yyvsp[-4].string)); free((yyvsp[-2].string)); } -#line 1712 "cmFortranParser.cxx" +#line 1706 "cmFortranParser.cxx" break; case 9: /* stmt: INTERFACE WORD other EOSTMT */ -#line 135 "cmFortranParser.y" +#line 140 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_SetInInterface(parser, true); free((yyvsp[-2].string)); } -#line 1722 "cmFortranParser.cxx" +#line 1716 "cmFortranParser.cxx" break; case 10: /* stmt: END INTERFACE other EOSTMT */ -#line 140 "cmFortranParser.y" +#line 145 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_SetInInterface(parser, false); } -#line 1731 "cmFortranParser.cxx" +#line 1725 "cmFortranParser.cxx" break; case 11: /* stmt: USE DCOLON WORD other EOSTMT */ -#line 144 "cmFortranParser.y" +#line 149 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleUse(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1741 "cmFortranParser.cxx" +#line 1735 "cmFortranParser.cxx" break; case 12: /* stmt: USE COMMA WORD DCOLON WORD other EOSTMT */ -#line 149 "cmFortranParser.y" +#line 154 "cmFortranParser.y" { if (cmsysString_strcasecmp((yyvsp[-4].string), "non_intrinsic") == 0) { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); @@ -1754,139 +1748,139 @@ yyreduce: free((yyvsp[-4].string)); free((yyvsp[-2].string)); } -#line 1758 "cmFortranParser.cxx" +#line 1752 "cmFortranParser.cxx" break; case 13: /* stmt: INCLUDE STRING other EOSTMT */ -#line 161 "cmFortranParser.y" +#line 166 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleInclude(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1768 "cmFortranParser.cxx" +#line 1762 "cmFortranParser.cxx" break; case 14: /* stmt: CPP_LINE_DIRECTIVE STRING other EOSTMT */ -#line 166 "cmFortranParser.y" +#line 171 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleLineDirective(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1778 "cmFortranParser.cxx" +#line 1772 "cmFortranParser.cxx" break; case 15: /* stmt: CPP_INCLUDE_ANGLE other EOSTMT */ -#line 171 "cmFortranParser.y" +#line 176 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleInclude(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1788 "cmFortranParser.cxx" +#line 1782 "cmFortranParser.cxx" break; case 16: /* stmt: include STRING other EOSTMT */ -#line 176 "cmFortranParser.y" +#line 181 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleInclude(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1798 "cmFortranParser.cxx" +#line 1792 "cmFortranParser.cxx" break; case 17: /* stmt: define WORD other EOSTMT */ -#line 181 "cmFortranParser.y" +#line 186 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleDefine(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1808 "cmFortranParser.cxx" +#line 1802 "cmFortranParser.cxx" break; case 18: /* stmt: undef WORD other EOSTMT */ -#line 186 "cmFortranParser.y" +#line 191 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleUndef(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1818 "cmFortranParser.cxx" +#line 1812 "cmFortranParser.cxx" break; case 19: /* stmt: ifdef WORD other EOSTMT */ -#line 191 "cmFortranParser.y" +#line 196 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleIfdef(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1828 "cmFortranParser.cxx" +#line 1822 "cmFortranParser.cxx" break; case 20: /* stmt: ifndef WORD other EOSTMT */ -#line 196 "cmFortranParser.y" +#line 201 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleIfndef(parser, (yyvsp[-2].string)); free((yyvsp[-2].string)); } -#line 1838 "cmFortranParser.cxx" +#line 1832 "cmFortranParser.cxx" break; case 21: /* stmt: if other EOSTMT */ -#line 201 "cmFortranParser.y" +#line 206 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleIf(parser); } -#line 1847 "cmFortranParser.cxx" +#line 1841 "cmFortranParser.cxx" break; case 22: /* stmt: elif other EOSTMT */ -#line 205 "cmFortranParser.y" +#line 210 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleElif(parser); } -#line 1856 "cmFortranParser.cxx" +#line 1850 "cmFortranParser.cxx" break; case 23: /* stmt: else other EOSTMT */ -#line 209 "cmFortranParser.y" +#line 214 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleElse(parser); } -#line 1865 "cmFortranParser.cxx" +#line 1859 "cmFortranParser.cxx" break; case 24: /* stmt: endif other EOSTMT */ -#line 213 "cmFortranParser.y" +#line 218 "cmFortranParser.y" { cmFortranParser* parser = cmFortran_yyget_extra(yyscanner); cmFortranParser_RuleEndif(parser); } -#line 1874 "cmFortranParser.cxx" +#line 1868 "cmFortranParser.cxx" break; case 48: /* misc_code: WORD */ -#line 235 "cmFortranParser.y" +#line 240 "cmFortranParser.y" { free ((yyvsp[0].string)); } -#line 1880 "cmFortranParser.cxx" +#line 1874 "cmFortranParser.cxx" break; case 55: /* misc_code: STRING */ -#line 242 "cmFortranParser.y" +#line 247 "cmFortranParser.y" { free ((yyvsp[0].string)); } -#line 1886 "cmFortranParser.cxx" +#line 1880 "cmFortranParser.cxx" break; -#line 1890 "cmFortranParser.cxx" +#line 1884 "cmFortranParser.cxx" default: break; } @@ -1962,7 +1956,7 @@ yyerrlab: } yyerror (yyscanner, yymsgp); if (yysyntax_error_status == YYENOMEM) - goto yyexhaustedlab; + YYNOMEM; } } @@ -1998,6 +1992,7 @@ yyerrorlab: label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; + ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -2058,7 +2053,7 @@ yyerrlab1: `-------------------------------------*/ yyacceptlab: yyresult = 0; - goto yyreturn; + goto yyreturnlab; /*-----------------------------------. @@ -2066,24 +2061,22 @@ yyacceptlab: `-----------------------------------*/ yyabortlab: yyresult = 1; - goto yyreturn; + goto yyreturnlab; -#if 1 -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ yyexhaustedlab: yyerror (yyscanner, YY_("memory exhausted")); yyresult = 2; - goto yyreturn; -#endif + goto yyreturnlab; -/*-------------------------------------------------------. -| yyreturn -- parsing is finished, clean up and return. | -`-------------------------------------------------------*/ -yyreturn: +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at @@ -2111,6 +2104,6 @@ yyreturn: return yyresult; } -#line 254 "cmFortranParser.y" +#line 259 "cmFortranParser.y" /* End of grammar */ |