diff options
Diffstat (limited to 'Source/LexerParser/cmExprParser.cxx')
-rw-r--r-- | Source/LexerParser/cmExprParser.cxx | 146 |
1 files changed, 81 insertions, 65 deletions
diff --git a/Source/LexerParser/cmExprParser.cxx b/Source/LexerParser/cmExprParser.cxx index b747d8b..d9b0ae3 100644 --- a/Source/LexerParser/cmExprParser.cxx +++ b/Source/LexerParser/cmExprParser.cxx @@ -1,8 +1,8 @@ -/* A Bison parser, made by GNU Bison 3.7.4. */ +/* A Bison parser, made by GNU Bison 3.7.5. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -46,10 +46,10 @@ USER NAME SPACE" below. */ /* Identify Bison output, and Bison version. */ -#define YYBISON 30704 +#define YYBISON 30705 /* Bison version string. */ -#define YYBISON_VERSION "3.7.4" +#define YYBISON_VERSION "3.7.5" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -120,7 +120,11 @@ static void cmExpr_yyerror(yyscan_t yyscanner, const char* message); # endif #endif -#line 124 "cmExprParser.cxx" +#if defined(__NVCOMPILER) +# pragma diag_suppress 550 /* variable set but never used */ +#endif + +#line 128 "cmExprParser.cxx" # ifndef YY_CAST # ifdef __cplusplus @@ -218,6 +222,18 @@ typedef int_least16_t yytype_int16; typedef short yytype_int16; #endif +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 +#endif + #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ @@ -315,9 +331,9 @@ typedef int yy_state_fast_t; /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) +# define YY_USE(E) ((void) (E)) #else -# define YYUSE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ @@ -544,9 +560,9 @@ static const yytype_int8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { - 0, 81, 81, 86, 89, 94, 97, 102, 105, 110, - 113, 116, 121, 124, 127, 132, 135, 138, 144, 149, - 152, 155, 158, 163, 166 + 0, 85, 85, 90, 93, 98, 101, 106, 109, 114, + 117, 120, 125, 128, 131, 136, 139, 142, 148, 153, + 156, 159, 162, 167, 170 }; #endif @@ -629,7 +645,7 @@ static const yytype_int8 yypgoto[] = /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 6, 7, 8, 9, 10, 11, 12, 13, 14 + 0, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -754,8 +770,8 @@ yy_symbol_value_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, yyscan_t yyscanner) { FILE *yyoutput = yyo; - YYUSE (yyoutput); - YYUSE (yyscanner); + YY_USE (yyoutput); + YY_USE (yyscanner); if (!yyvaluep) return; # ifdef YYPRINT @@ -763,7 +779,7 @@ yy_symbol_value_print (FILE *yyo, YYPRINT (yyo, yytoknum[yykind], *yyvaluep); # endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yykind); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1144,14 +1160,14 @@ static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, yyscan_t yyscanner) { - YYUSE (yyvaluep); - YYUSE (yyscanner); + YY_USE (yyvaluep); + YY_USE (yyscanner); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yykind); + YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -1421,194 +1437,194 @@ yyreduce: switch (yyn) { case 2: /* start: exp */ -#line 81 "cmExprParser.y" +#line 85 "cmExprParser.y" { cmExpr_yyget_extra(yyscanner)->SetResult((yyvsp[0].Number)); } -#line 1429 "cmExprParser.cxx" +#line 1445 "cmExprParser.cxx" break; case 3: /* exp: bitwiseor */ -#line 86 "cmExprParser.y" +#line 90 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1437 "cmExprParser.cxx" +#line 1453 "cmExprParser.cxx" break; case 4: /* exp: exp exp_OR bitwiseor */ -#line 89 "cmExprParser.y" +#line 93 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) | (yyvsp[0].Number); } -#line 1445 "cmExprParser.cxx" +#line 1461 "cmExprParser.cxx" break; case 5: /* bitwiseor: bitwisexor */ -#line 94 "cmExprParser.y" +#line 98 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1453 "cmExprParser.cxx" +#line 1469 "cmExprParser.cxx" break; case 6: /* bitwiseor: bitwiseor exp_XOR bitwisexor */ -#line 97 "cmExprParser.y" +#line 101 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) ^ (yyvsp[0].Number); } -#line 1461 "cmExprParser.cxx" +#line 1477 "cmExprParser.cxx" break; case 7: /* bitwisexor: bitwiseand */ -#line 102 "cmExprParser.y" +#line 106 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1469 "cmExprParser.cxx" +#line 1485 "cmExprParser.cxx" break; case 8: /* bitwisexor: bitwisexor exp_AND bitwiseand */ -#line 105 "cmExprParser.y" +#line 109 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) & (yyvsp[0].Number); } -#line 1477 "cmExprParser.cxx" +#line 1493 "cmExprParser.cxx" break; case 9: /* bitwiseand: shift */ -#line 110 "cmExprParser.y" +#line 114 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1485 "cmExprParser.cxx" +#line 1501 "cmExprParser.cxx" break; case 10: /* bitwiseand: bitwiseand exp_SHIFTLEFT shift */ -#line 113 "cmExprParser.y" +#line 117 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) << (yyvsp[0].Number); } -#line 1493 "cmExprParser.cxx" +#line 1509 "cmExprParser.cxx" break; case 11: /* bitwiseand: bitwiseand exp_SHIFTRIGHT shift */ -#line 116 "cmExprParser.y" +#line 120 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) >> (yyvsp[0].Number); } -#line 1501 "cmExprParser.cxx" +#line 1517 "cmExprParser.cxx" break; case 12: /* shift: term */ -#line 121 "cmExprParser.y" +#line 125 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1509 "cmExprParser.cxx" +#line 1525 "cmExprParser.cxx" break; case 13: /* shift: shift exp_PLUS term */ -#line 124 "cmExprParser.y" +#line 128 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) + (yyvsp[0].Number); } -#line 1517 "cmExprParser.cxx" +#line 1533 "cmExprParser.cxx" break; case 14: /* shift: shift exp_MINUS term */ -#line 127 "cmExprParser.y" +#line 131 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) - (yyvsp[0].Number); } -#line 1525 "cmExprParser.cxx" +#line 1541 "cmExprParser.cxx" break; case 15: /* term: unary */ -#line 132 "cmExprParser.y" +#line 136 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1533 "cmExprParser.cxx" +#line 1549 "cmExprParser.cxx" break; case 16: /* term: term exp_TIMES unary */ -#line 135 "cmExprParser.y" +#line 139 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) * (yyvsp[0].Number); } -#line 1541 "cmExprParser.cxx" +#line 1557 "cmExprParser.cxx" break; case 17: /* term: term exp_DIVIDE unary */ -#line 138 "cmExprParser.y" +#line 142 "cmExprParser.y" { if (yyvsp[0].Number == 0) { throw std::overflow_error("divide by zero"); } (yyval.Number) = (yyvsp[-2].Number) / (yyvsp[0].Number); } -#line 1552 "cmExprParser.cxx" +#line 1568 "cmExprParser.cxx" break; case 18: /* term: term exp_MOD unary */ -#line 144 "cmExprParser.y" +#line 148 "cmExprParser.y" { (yyval.Number) = (yyvsp[-2].Number) % (yyvsp[0].Number); } -#line 1560 "cmExprParser.cxx" +#line 1576 "cmExprParser.cxx" break; case 19: /* unary: factor */ -#line 149 "cmExprParser.y" +#line 153 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1568 "cmExprParser.cxx" +#line 1584 "cmExprParser.cxx" break; case 20: /* unary: exp_PLUS unary */ -#line 152 "cmExprParser.y" +#line 156 "cmExprParser.y" { (yyval.Number) = + (yyvsp[0].Number); } -#line 1576 "cmExprParser.cxx" +#line 1592 "cmExprParser.cxx" break; case 21: /* unary: exp_MINUS unary */ -#line 155 "cmExprParser.y" +#line 159 "cmExprParser.y" { (yyval.Number) = - (yyvsp[0].Number); } -#line 1584 "cmExprParser.cxx" +#line 1600 "cmExprParser.cxx" break; case 22: /* unary: exp_NOT unary */ -#line 158 "cmExprParser.y" +#line 162 "cmExprParser.y" { (yyval.Number) = ~ (yyvsp[0].Number); } -#line 1592 "cmExprParser.cxx" +#line 1608 "cmExprParser.cxx" break; case 23: /* factor: exp_NUMBER */ -#line 163 "cmExprParser.y" +#line 167 "cmExprParser.y" { (yyval.Number) = (yyvsp[0].Number); } -#line 1600 "cmExprParser.cxx" +#line 1616 "cmExprParser.cxx" break; case 24: /* factor: exp_OPENPARENT exp exp_CLOSEPARENT */ -#line 166 "cmExprParser.y" +#line 170 "cmExprParser.y" { (yyval.Number) = (yyvsp[-1].Number); } -#line 1608 "cmExprParser.cxx" +#line 1624 "cmExprParser.cxx" break; -#line 1612 "cmExprParser.cxx" +#line 1628 "cmExprParser.cxx" default: break; } @@ -1833,7 +1849,7 @@ yyreturn: return yyresult; } -#line 171 "cmExprParser.y" +#line 175 "cmExprParser.y" /* End of grammar */ |