📄 ce_parse.cpp
字号:
/* A Bison parser, made from constexp.y by GNU bison 1.29. */#define YYBISON 1 /* Identify Bison output. */#define yyparse cppExpYYparse#define yylex cppExpYYlex#define yyerror cppExpYYerror#define yylval cppExpYYlval#define yychar cppExpYYchar#define yydebug cppExpYYdebug#define yynerrs cppExpYYnerrs# define TOK_QUESTIONMARK 257# define TOK_COLON 258# define TOK_OR 259# define TOK_AND 260# define TOK_BITWISEOR 261# define TOK_BITWISEXOR 262# define TOK_AMPERSAND 263# define TOK_NOTEQUAL 264# define TOK_EQUAL 265# define TOK_LESSTHAN 266# define TOK_GREATERTHAN 267# define TOK_LESSTHANOREQUALTO 268# define TOK_GREATERTHANOREQUALTO 269# define TOK_SHIFTLEFT 270# define TOK_SHIFTRIGHT 271# define TOK_PLUS 272# define TOK_MINUS 273# define TOK_STAR 274# define TOK_DIVIDE 275# define TOK_MOD 276# define TOK_TILDE 277# define TOK_NOT 278# define TOK_LPAREN 279# define TOK_RPAREN 280# define TOK_OCTALINT 281# define TOK_DECIMALINT 282# define TOK_HEXADECIMALINT 283# define TOK_CHARACTER 284# define TOK_FLOAT 285#include "cppvalue.h"#include "constexp.h"#include "message.h"#if defined(_MSC_VER)#define MSDOS#endif#define YYSTYPE CPPValue#include <stdio.h>#include <stdlib.h>int cppExpYYerror(const char *s){ warn(g_constExpFileName,g_constExpLineNr, "Problem during constant expression evaluation: %s",s); return 0;}int cppExpYYlex();#ifndef YYSTYPE#define YYSTYPE int#endif#include <stdio.h>#define YYFINAL 73#define YYFLAG -32768#define YYNTBASE 32/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */#define YYTRANSLATE(x) ((unsigned)(x) <= 285 ? yytranslate[x] : 47)/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */static const char yytranslate[] ={ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};#if YYDEBUG != 0static const short yyprhs[] ={ 0, 0, 2, 4, 10, 12, 16, 18, 22, 24, 28, 30, 34, 36, 40, 42, 46, 50, 52, 56, 60, 64, 68, 70, 74, 78, 80, 84, 88, 90, 94, 98, 102, 104, 107, 110, 113, 116, 118, 122, 124, 126, 128, 130};static const short yyrhs[] ={ 33, 0, 34, 0, 34, 3, 34, 4, 34, 0, 35, 0, 34, 5, 35, 0, 36, 0, 35, 6, 36, 0, 37, 0, 36, 7, 37, 0, 38, 0, 37, 8, 38, 0, 39, 0, 38, 9, 39, 0, 40, 0, 39, 11, 40, 0, 39, 10, 40, 0, 41, 0, 40, 12, 41, 0, 40, 13, 41, 0, 40, 14, 41, 0, 40, 15, 41, 0, 42, 0, 41, 16, 42, 0, 41, 17, 42, 0, 43, 0, 42, 18, 43, 0, 42, 19, 43, 0, 44, 0, 43, 20, 44, 0, 43, 21, 44, 0, 43, 22, 44, 0, 45, 0, 18, 44, 0, 19, 44, 0, 23, 44, 0, 24, 44, 0, 46, 0, 25, 33, 26, 0, 27, 0, 28, 0, 29, 0, 30, 0, 31, 0};#endif#if YYDEBUG != 0/* YYRLINE[YYN] -- source line where rule number YYN was defined. */static const short yyrline[] ={ 0, 77, 81, 83, 92, 94, 100, 102, 108, 110, 117, 119, 125, 127, 133, 135, 139, 145, 147, 151, 155, 160, 167, 169, 173, 179, 181, 192, 205, 207, 218, 231, 239, 241, 243, 250, 254, 260, 262, 266, 268, 270, 272, 274};#endif#if YYDEBUG != 0 || defined YYERROR_VERBOSE/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */static const char *const yytname[] ={ "$", "error", "$undefined.", "TOK_QUESTIONMARK", "TOK_COLON", "TOK_OR", "TOK_AND", "TOK_BITWISEOR", "TOK_BITWISEXOR", "TOK_AMPERSAND", "TOK_NOTEQUAL", "TOK_EQUAL", "TOK_LESSTHAN", "TOK_GREATERTHAN", "TOK_LESSTHANOREQUALTO", "TOK_GREATERTHANOREQUALTO", "TOK_SHIFTLEFT", "TOK_SHIFTRIGHT", "TOK_PLUS", "TOK_MINUS", "TOK_STAR", "TOK_DIVIDE", "TOK_MOD", "TOK_TILDE", "TOK_NOT", "TOK_LPAREN", "TOK_RPAREN", "TOK_OCTALINT", "TOK_DECIMALINT", "TOK_HEXADECIMALINT", "TOK_CHARACTER", "TOK_FLOAT", "start", "constant_expression", "logical_or_expression", "logical_and_expression", "inclusive_or_expression", "exclusive_or_expression", "and_expression", "equality_expression", "relational_expression", "shift_expression", "additive_expression", "multiplicative_expression", "unary_expression", "primary_expression", "constant", NULL};#endif/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */static const short yyr1[] ={ 0, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 39, 40, 40, 40, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 46, 46, 46, 46, 46};/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */static const short yyr2[] ={ 0, 1, 1, 5, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 1, 3, 3, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 3, 1, 2, 2, 2, 2, 1, 3, 1, 1, 1, 1, 1};/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE doesn't specify something else to do. Zero means the default is an error. */static const short yydefact[] ={ 0, 0, 0, 0, 0, 0, 39, 40, 41, 42, 43, 1, 2, 4, 6, 8, 10, 12, 14, 17, 22, 25, 28, 32, 37, 33, 34, 35, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 0, 5, 7, 9, 11, 13, 16, 15, 18, 19, 20, 21, 23, 24, 26, 27, 29, 30, 31, 0, 3, 0, 0, 0};static const short yydefgoto[] ={ 71, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24};static const short yypact[] ={ -13, -13, -13, -13, -13, -13,-32768,-32768,-32768,-32768, -32768,-32768, 4, 2, 20, 27, 31, 21, 7, 17, 18, 8,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 24, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, -13,-32768, 34, 2, 20, 27, 31, 21, 7, 7, 17, 17, 17, 17, 18, 18, 8, 8,-32768,-32768,-32768, -13, 39, 13, 51,-32768};static const short yypgoto[] ={ -32768, 47, -26, 25, 23, 26, 28, 22, 5, -15, 6, 9, -1,-32768,-32768};#define YYLAST 62static const short yytable[] ={ 25, 26, 27, 28, 50, 1, 2, 30, 32, 31, 3, 4, 5, 72, 6, 7, 8, 9, 10, 38, 39, 40, 41, 58, 59, 60, 61, 33, 46, 47, 48, 36, 37, 42, 43, 34, 44, 45, 69, 31, 35, 56, 57, 70, 31, 66, 67, 68, 62, 63, 49, 73, 29, 64, 65, 52, 51, 55, 0, 53, 0, 0, 54};static const short yycheck[] ={ 1, 2, 3, 4, 30, 18, 19, 3, 6, 5, 23, 24, 25, 0, 27, 28, 29, 30, 31, 12, 13, 14, 15, 38, 39, 40, 41, 7, 20, 21, 22, 10, 11, 16, 17, 8, 18, 19, 4, 5, 9, 36, 37, 69, 5, 46, 47, 48, 42, 43, 26, 0, 5, 44, 45, 32, 31, 35, -1, 33, -1, -1, 34};/* -*-C-*- Note some compilers choke on comments on `#line' lines. *//* Skeleton output parser for bison, Copyright 1984, 1989, 1990, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 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, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *//* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. *//* This is the parser code that is written into each bison parser when the %semantic_parser declaration is not specified in the grammar. It was written by Richard Stallman by simplifying the hairy parser used when %semantic_parser is specified. */#ifndef YYSTACK_USE_ALLOCA# ifdef alloca# define YYSTACK_USE_ALLOCA 1# else /* alloca not defined */# ifdef __GNUC__# define YYSTACK_USE_ALLOCA 1# define alloca __builtin_alloca# else /* not GNU C. */# if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))# define YYSTACK_USE_ALLOCA 1# include <alloca.h># else /* not sparc */ /* We think this test detects Watcom and Microsoft C. */ /* This used to test MSDOS, but that is a bad idea since that symbol is in the user namespace. */# if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)# if 0 /* No need for malloc.h, which pollutes the namespace; instead, just don't use alloca. */# include <malloc.h># endif# else /* not MSDOS, or __TURBOC__ */# if defined(_AIX) /* I don't know what this was needed for, but it pollutes the namespace. So I turned it off. rms, 2 May 1997. */ /* #include <malloc.h> */ #pragma alloca# define YYSTACK_USE_ALLOCA 1# else /* not MSDOS, or __TURBOC__, or _AIX */# if 0 /* haible@ilog.fr says this works for HPUX 9.05 and up, and on HPUX 10. Eventually we can turn this on. */# ifdef __hpux# define YYSTACK_USE_ALLOCA 1# define alloca __builtin_alloca# endif /* __hpux */# endif# endif /* not _AIX */# endif /* not MSDOS, or __TURBOC__ */# endif /* not sparc */# endif /* not GNU C */# endif /* alloca not defined */#endif /* YYSTACK_USE_ALLOCA not defined */#if YYSTACK_USE_ALLOCA# define YYSTACK_ALLOC alloca#else# define YYSTACK_ALLOC malloc#endif#define yyerrok (yyerrstatus = 0)#define yyclearin (yychar = YYEMPTY)#define YYEMPTY -2#define YYEOF 0#define YYACCEPT goto yyacceptlab#define YYABORT goto yyabortlab#define YYERROR goto yyerrlab1/* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */#define YYFAIL goto yyerrlab#define YYRECOVERING() (!!yyerrstatus)#define YYBACKUP(Token, Value) \do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up"); \ YYERROR; \ } \while (0)#define YYTERROR 1#define YYERRCODE 256/* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). When YYLLOC_DEFAULT is run, CURRENT is set the location of the first token. By default, to implement support for ranges, extend its range to the last symbol. */#ifndef YYLLOC_DEFAULT# define YYLLOC_DEFAULT(Current, Rhs, N) \ Current.last_line = Rhs[N].last_line; \ Current.last_column = Rhs[N].last_column;#endif/* YYLEX -- calling `yylex' with the right arguments. */#if YYPURE# if YYLSP_NEEDED# ifdef YYLEX_PARAM# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)# else# define YYLEX yylex (&yylval, &yylloc)# endif# else /* !YYLSP_NEEDED */# ifdef YYLEX_PARAM# define YYLEX yylex (&yylval, YYLEX_PARAM)# else# define YYLEX yylex (&yylval)# endif# endif /* !YYLSP_NEEDED */#else /* !YYPURE */# define YYLEX yylex ()#endif /* !YYPURE *//* Enable debugging if requested. */#if YYDEBUG# define YYDPRINTF(Args) \do { \ if (yydebug) \ fprintf Args; \} while (0)/* Nonzero means print parse trace. [The following comment makes no sense to me. Could someone clarify it? --akim] Since this is uninitialized, it does not stop multiple parsers from coexisting. */int yydebug;#else /* !YYDEBUG */# define YYDPRINTF(Args)#endif /* !YYDEBUG *//* YYINITDEPTH -- initial size of the parser's stacks. */#ifndef YYINITDEPTH# define YYINITDEPTH 200#endif/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). */#if YYMAXDEPTH == 0# undef YYMAXDEPTH#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -