#define YYBISON …
#define YYBISON_VERSION …
#define YYSKELETON_NAME …
#define YYPURE …
#define YYPUSH …
#define YYPULL …
#define YYSTYPE …
#define yyparse …
#define yylex …
#define yyerror …
#define yydebug …
#define yynerrs …
#if defined(__GNUC__)
# if !defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
# else
# pragma GCC diagnostic ignored "-Wuninitialized"
# endif
#elif defined(_MSC_VER)
# pragma warning(disable : 4065 4244 4701 4702)
#endif
#if defined(__clang__)
# pragma clang diagnostic ignored "-Wunreachable-code"
# pragma clang diagnostic ignored "-Wunused-but-set-variable"
#endif
#include "ExpressionParser.h"
#if defined(_MSC_VER)
# include <malloc.h>
#else
# include <stdlib.h>
#endif
#include <stdint.h>
#include <cassert>
#include <sstream>
#include "DiagnosticsBase.h"
#include "Lexer.h"
#include "Token.h"
#include "common/mathutil.h"
PPSTYPE;
UNSIGNED_TYPE;
#define YYENABLE_NLS …
#define YYLTYPE_IS_TRIVIAL …
#define YYSTYPE_IS_TRIVIAL …
#define YYSTYPE_IS_DECLARED …
namespace
{
struct Context
{ … };
}
static int yylex(YYSTYPE *lvalp, Context *context);
static void yyerror(Context *context, const char *reason);
#ifndef YY_CAST
# ifdef __cplusplus
#define YY_CAST(Type, Val) …
#define YY_REINTERPRET_CAST(Type, Val) …
# else
#define YY_CAST …
#define YY_REINTERPRET_CAST …
# endif
#endif
#ifndef YY_NULLPTR
# if defined __cplusplus
# if 201103L <= __cplusplus
#define YY_NULLPTR …
# else
#define YY_NULLPTR …
# endif
# else
#define YY_NULLPTR …
# endif
#endif
#ifndef PPDEBUG
# if defined YYDEBUG
# if YYDEBUG
#define PPDEBUG …
# else
#define PPDEBUG …
# endif
# else
#define PPDEBUG …
# endif
#endif
#if PPDEBUG
extern int ppdebug;
#endif
#ifndef PPTOKENTYPE
#define PPTOKENTYPE
enum pptokentype
{ … };
pptoken_kind_t;
#endif
#if !defined PPSTYPE && !defined PPSTYPE_IS_DECLARED
PPSTYPE;
#define PPSTYPE_IS_TRIVIAL …
#define PPSTYPE_IS_DECLARED …
#endif
int ppparse(Context *context);
enum yysymbol_kind_t
{ … };
yysymbol_kind_t;
#ifdef short
# undef short
#endif
#ifndef __PTRDIFF_MAX__
# include <limits.h>
# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
# include <stdint.h>
#define YY_STDINT_H
# endif
#endif
#ifdef __INT_LEAST8_MAX__
yytype_int8;
#elif defined YY_STDINT_H
typedef int_least8_t yytype_int8;
#else
typedef signed char yytype_int8;
#endif
#ifdef __INT_LEAST16_MAX__
yytype_int16;
#elif defined YY_STDINT_H
typedef int_least16_t yytype_int16;
#else
typedef short yytype_int16;
#endif
#ifdef __hpux
# undef UINT_LEAST8_MAX
# undef UINT_LEAST16_MAX
#define UINT_LEAST8_MAX …
#define UINT_LEAST16_MAX …
#endif
#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
yytype_uint8;
#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H && UINT_LEAST8_MAX <= INT_MAX)
typedef uint_least8_t yytype_uint8;
#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
typedef unsigned char yytype_uint8;
#else
typedef short yytype_uint8;
#endif
#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
yytype_uint16;
#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H && UINT_LEAST16_MAX <= INT_MAX)
typedef uint_least16_t yytype_uint16;
#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
typedef unsigned short yytype_uint16;
#else
typedef int yytype_uint16;
#endif
#ifndef YYPTRDIFF_T
# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
#define YYPTRDIFF_T …
#define YYPTRDIFF_MAXIMUM …
# elif defined PTRDIFF_MAX
# ifndef ptrdiff_t
# include <stddef.h>
# endif
#define YYPTRDIFF_T …
#define YYPTRDIFF_MAXIMUM …
# else
#define YYPTRDIFF_T …
#define YYPTRDIFF_MAXIMUM …
# endif
#endif
#ifndef YYSIZE_T
# ifdef __SIZE_TYPE__
#define YYSIZE_T …
# elif defined size_t
#define YYSIZE_T …
# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
# include <stddef.h>
#define YYSIZE_T …
# else
#define YYSIZE_T …
# endif
#endif
#define YYSIZE_MAXIMUM …
#define YYSIZEOF(X) …
yy_state_t;
yy_state_fast_t;
#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h>
#define YY_ …
# endif
# endif
# ifndef YY_
#define YY_(Msgid) …
# endif
#endif
#ifndef YY_ATTRIBUTE_PURE
# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
#define YY_ATTRIBUTE_PURE …
# else
#define YY_ATTRIBUTE_PURE
# endif
#endif
#ifndef YY_ATTRIBUTE_UNUSED
# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
#define YY_ATTRIBUTE_UNUSED …
# else
#define YY_ATTRIBUTE_UNUSED
# endif
#endif
#if !defined lint || defined __GNUC__
#define YY_USE(E) …
#else
#define YY_USE …
#endif
#if defined __GNUC__ && !defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN …
# else
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN …
# endif
#define YY_IGNORE_MAYBE_UNINITIALIZED_END …
#else
#define YY_INITIAL_VALUE(Value) …
#endif
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
#endif
#ifndef YY_INITIAL_VALUE
#define YY_INITIAL_VALUE …
#endif
#if defined __cplusplus && defined __GNUC__ && !defined __ICC && 6 <= __GNUC__
#define YY_IGNORE_USELESS_CAST_BEGIN …
#define YY_IGNORE_USELESS_CAST_END …
#endif
#ifndef YY_IGNORE_USELESS_CAST_BEGIN
#define YY_IGNORE_USELESS_CAST_BEGIN
#define YY_IGNORE_USELESS_CAST_END
#endif
#define YY_ASSERT(E) …
#if !defined yyoverflow
# ifdef YYSTACK_USE_ALLOCA
# if YYSTACK_USE_ALLOCA
# ifdef __GNUC__
#define YYSTACK_ALLOC …
# elif defined __BUILTIN_VA_ARG_INCR
# include <alloca.h>
# elif defined _AIX
#define YYSTACK_ALLOC …
# elif defined _MSC_VER
# include <malloc.h>
#define alloca …
# else
#define YYSTACK_ALLOC …
# if !defined _ALLOCA_H && !defined EXIT_SUCCESS
# include <stdlib.h>
# ifndef EXIT_SUCCESS
#define EXIT_SUCCESS …
# endif
# endif
# endif
# endif
# endif
# ifdef YYSTACK_ALLOC
#define YYSTACK_FREE …
# ifndef YYSTACK_ALLOC_MAXIMUM
#define YYSTACK_ALLOC_MAXIMUM …
# endif
# else
#define YYSTACK_ALLOC …
#define YYSTACK_FREE …
# ifndef YYSTACK_ALLOC_MAXIMUM
#define YYSTACK_ALLOC_MAXIMUM …
# endif
# if (defined __cplusplus && !defined EXIT_SUCCESS && \
!((defined YYMALLOC || defined malloc) && (defined YYFREE || defined free)))
# include <stdlib.h>
# ifndef EXIT_SUCCESS
#define EXIT_SUCCESS …
# endif
# endif
# ifndef YYMALLOC
#define YYMALLOC …
# if !defined malloc && !defined EXIT_SUCCESS
void *malloc(YYSIZE_T);
# endif
# endif
# ifndef YYFREE
#define YYFREE …
# if !defined free && !defined EXIT_SUCCESS
void free(void *);
# endif
# endif
# endif
#endif
#if (!defined yyoverflow && \
(!defined __cplusplus || (defined PPSTYPE_IS_TRIVIAL && PPSTYPE_IS_TRIVIAL)))
yyalloc;
#define YYSTACK_GAP_MAXIMUM …
#define YYSTACK_BYTES(N) …
#define YYCOPY_NEEDED …
#define YYSTACK_RELOCATE …
#endif
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
#define YYCOPY(Dst, Src, Count) …
# else
#define YYCOPY …
# endif
# endif
#endif
#define YYFINAL …
#define YYLAST …
#define YYNTOKENS …
#define YYNNTS …
#define YYNRULES …
#define YYNSTATES …
#define YYMAXUTOK …
#define YYTRANSLATE(YYX) …
static const yytype_int8 yytranslate[] = …;
#if PPDEBUG
static const yytype_int16 yyrline[] = {0, 114, 114, 121, 122, 133, 133, 154, 154, 175,
178, 181, 184, 187, 190, 193, 196, 199, 202, 227,
249, 252, 255, 281, 308, 311, 314, 317, 329, 332};
#endif
#define YY_ACCESSING_SYMBOL(State) …
#if PPDEBUG || 0
static const char *yysymbol_name(yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
static const char *const yytname[] = {"\"end of file\"",
"error",
"\"invalid token\"",
"TOK_CONST_INT",
"TOK_IDENTIFIER",
"TOK_OP_OR",
"TOK_OP_AND",
"'|'",
"'^'",
"'&'",
"TOK_OP_EQ",
"TOK_OP_NE",
"'<'",
"'>'",
"TOK_OP_LE",
"TOK_OP_GE",
"TOK_OP_LEFT",
"TOK_OP_RIGHT",
"'+'",
"'-'",
"'*'",
"'/'",
"'%'",
"TOK_UNARY",
"'!'",
"'~'",
"'('",
"')'",
"$accept",
"input",
"expression",
"$@1",
"$@2",
YY_NULLPTR};
static const char *yysymbol_name(yysymbol_kind_t yysymbol)
{
return yytname[yysymbol];
}
#endif
#define YYPACT_NINF …
#define yypact_value_is_default(Yyn) …
#define YYTABLE_NINF …
#define yytable_value_is_error(Yyn) …
static const yytype_int16 yypact[] = …;
static const yytype_int8 yydefact[] = …;
static const yytype_int8 yypgoto[] = …;
static const yytype_int8 yydefgoto[] = …;
static const yytype_int8 yytable[] = …;
static const yytype_int8 yycheck[] = …;
static const yytype_int8 yystos[] = …;
static const yytype_int8 yyr1[] = …;
static const yytype_int8 yyr2[] = …;
enum
{ … };
#define yyerrok …
#define yyclearin …
#define YYACCEPT …
#define YYABORT …
#define YYERROR …
#define YYNOMEM …
#define YYRECOVERING() …
#define YYBACKUP(Token, Value) …
#define YYERRCODE …
#if PPDEBUG
# ifndef YYFPRINTF
# include <stdio.h>
#define YYFPRINTF …
# endif
#define YYDPRINTF …
#define YY_SYMBOL_PRINT …
static void yy_symbol_value_print(FILE *yyo,
yysymbol_kind_t yykind,
YYSTYPE const *const yyvaluep,
Context *context)
{
FILE *yyoutput = yyo;
YY_USE(yyoutput);
YY_USE(context);
if (!yyvaluep)
return;
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
YY_USE(yykind);
YY_IGNORE_MAYBE_UNINITIALIZED_END
}
static void yy_symbol_print(FILE *yyo,
yysymbol_kind_t yykind,
YYSTYPE const *const yyvaluep,
Context *context)
{
YYFPRINTF(yyo, "%s %s (", yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name(yykind));
yy_symbol_value_print(yyo, yykind, yyvaluep, context);
YYFPRINTF(yyo, ")");
}
static void yy_stack_print(yy_state_t *yybottom, yy_state_t *yytop)
{
YYFPRINTF(stderr, "Stack now");
for (; yybottom <= yytop; yybottom++)
{
int yybot = *yybottom;
YYFPRINTF(stderr, " %d", yybot);
}
YYFPRINTF(stderr, "\n");
}
#define YY_STACK_PRINT …
static void yy_reduce_print(yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule, Context *context)
{
int yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
YYFPRINTF(stderr, "Reducing stack by rule %d (line %d):\n", yyrule - 1, yylno);
for (yyi = 0; yyi < yynrhs; yyi++)
{
YYFPRINTF(stderr, " $%d = ", yyi + 1);
yy_symbol_print(stderr, YY_ACCESSING_SYMBOL(+yyssp[yyi + 1 - yynrhs]),
&yyvsp[(yyi + 1) - (yynrhs)], context);
YYFPRINTF(stderr, "\n");
}
}
#define YY_REDUCE_PRINT …
int yydebug;
#else
#define YYDPRINTF(Args) …
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location) …
#define YY_STACK_PRINT(Bottom, Top) …
#define YY_REDUCE_PRINT(Rule) …
#endif
#ifndef YYINITDEPTH
#define YYINITDEPTH …
#endif
#ifndef YYMAXDEPTH
#define YYMAXDEPTH …
#endif
static void yydestruct(const char *yymsg,
yysymbol_kind_t yykind,
YYSTYPE *yyvaluep,
Context *context)
{ … }
int yyparse(Context *context)
{ … }
int yylex(YYSTYPE *lvalp, Context *context)
{ … }
void yyerror(Context *context, const char *reason)
{ … }
namespace angle
{
namespace pp
{
ExpressionParser::ExpressionParser(Lexer *lexer, Diagnostics *diagnostics)
: … { … }
bool ExpressionParser::parse(Token *token,
int *result,
bool parsePresetToken,
const ErrorSettings &errorSettings,
bool *valid)
{ … }
}
}