Commit d6053daa by James Darpinian Committed by Commit Bot

Remove tabs from source files.

WebKit's Subversion repo refuses to commit source files that contain tabs. Bug: angleproject:3439 Change-Id: I0a804bcfa0375a98e19945e20297c90d31106827 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1954410 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org>
parent caa6eccd
{
"src/libANGLE/renderer/angle_format.py":
"32ba71942c0fd00e6807104f1bb80a3c",
"src/libANGLE/renderer/gen_load_functions_table.py":
"e65c50e84fc38ad34d0eb0bebb84aab6",
"9b4ea6bcb4eb4c43f48a097a9ec920f1",
"src/libANGLE/renderer/load_functions_data.json":
"5e9a50b1eeda3b5bca68aac4bc379437",
"src/libANGLE/renderer/load_functions_table_autogen.cpp":
......
{
"src/compiler/generate_parser_tools.py":
"dca7f7926758ba89a337854f615aca46",
"src/compiler/preprocessor/generate_parser.py":
"cc871de99688a35bfe32ef501f965d5a",
"src/compiler/preprocessor/preprocessor.l":
"143dec2269b9a49a9588391bb57580ec",
"31b4f8bc0bb8f713f5e4db8ae04925e2",
"src/compiler/preprocessor/preprocessor.y":
"a3a7dcbf9fd1cf1721ab635cea0189b2",
"6d9cc9961a8df3e3712f63f01f995161",
"src/compiler/preprocessor/preprocessor_lex_autogen.cpp":
"5e2dd7b0f74393db96ca6d9b0adeae0b",
"77b814881471bcb8c2720a3bc87110de",
"src/compiler/preprocessor/preprocessor_tab_autogen.cpp":
"1faa877557cf67e564cabc547aa3f3c0",
"e6f38425fe894b07a3a961a6c81b85c2",
"tools/flex-bison/linux/bison.sha1":
"efa86001f00e7bcfdbe899dd15fc88e0",
"tools/flex-bison/linux/flex.sha1":
......
{
"src/compiler/generate_parser_tools.py":
"dca7f7926758ba89a337854f615aca46",
"src/compiler/translator/generate_parser.py":
"566178ecdfae3a29803b3687fc518ebb",
"src/compiler/translator/glslang.l":
"1aaddb610e7bde7f7cffc993ba762c93",
"1cf4635ab5c00fa10592fce2569368ac",
"src/compiler/translator/glslang.y":
"2570cc8e33a11cbff3fcbe278f96e5ba",
"ffa9809b1f330df9b9e38ada6698f8a4",
"src/compiler/translator/glslang_lex_autogen.cpp":
"2958d0637093e53e1330c67cc323bbb9",
"ce633127e7674ceb14000f2654cf2637",
"src/compiler/translator/glslang_tab_autogen.cpp":
"a1c116b14fc63d802487b5d404669d93",
"ff27c679d225ba8d0a4f9f9857eda3e5",
"src/compiler/translator/glslang_tab_autogen.h":
"c33cc1947462ebb31778181a48538b6b",
"tools/flex-bison/linux/bison.sha1":
......
......@@ -4,5 +4,7 @@
"src/libANGLE/es3_copy_conversion_table_autogen.cpp":
"b20d198cf5e292c43170d4873b381b34",
"src/libANGLE/gen_copy_conversion_table.py":
"827a4a27cea1e11bef18fed9dce6dceb"
"18e0d2ff461f730a9efb0dcdfa3f058a",
"src/libANGLE/renderer/angle_format.py":
"32ba71942c0fd00e6807104f1bb80a3c"
}
\ No newline at end of file
......@@ -6,5 +6,7 @@
"src/libANGLE/format_map_data.json":
"2dd1986f49c441ad9a71b82410f57d6e",
"src/libANGLE/gen_format_map.py":
"dbc855d50826670a9e1a4ff2747e7583"
"38320d844e6629e09afc5ccdc484e9aa",
"src/libANGLE/renderer/angle_format.py":
"32ba71942c0fd00e6807104f1bb80a3c"
}
\ No newline at end of file
{
"src/libANGLE/renderer/angle_format.py":
"32ba71942c0fd00e6807104f1bb80a3c",
"src/libANGLE/renderer/metal/gen_mtl_format_table.py":
"afa19b351ae9615be0ec962790d81bd3",
"b6468446dd1da3e44ac9dd11690b5bf1",
"src/libANGLE/renderer/metal/mtl_format_map.json":
"c6f5b6dda11e456cfbcaeec53eb46fa0",
"src/libANGLE/renderer/metal/mtl_format_table_autogen.mm":
......
......@@ -90,6 +90,10 @@ def run_flex(basename):
patched = output.replace(patch_in, patch_out)
# Remove all tab characters from output. WebKit does not allow any tab characters in source
# files.
patched = patched.replace('\t', ' ')
with open(output_source, 'w') as flex_output_patched:
flex_output_patched.write(patched)
......@@ -134,6 +138,10 @@ def generate_parser(basename, generate_header):
if sys.argv[1] == 'inputs':
inputs = get_tool_file_sha1s()
inputs += get_input_files(basename)
current_file = __file__
if current_file.endswith('.pyc'):
current_file = current_file[:-1]
inputs += [current_file]
print(','.join(inputs))
if sys.argv[1] == 'outputs':
print(','.join(get_output_files(basename, generate_header)))
......
......@@ -23,7 +23,6 @@ IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN scripts/run_code_generation.py
// preprocessor.l:
// Lexer for the OpenGL shading language preprocessor.
// clang-format off
}
%{
......
......@@ -22,8 +22,6 @@ WHICH GENERATES THE GLSL ES preprocessor expression parser.
// preprocessor.y:
// Parser for the OpenGL shading language preprocessor.
// clang-format off
#if defined(__GNUC__)
// Triggered by the auto-generated pplval variable.
#if !defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -81,33 +81,31 @@
// preprocessor.y:
// Parser for the OpenGL shading language preprocessor.
// clang-format off
#if defined(__GNUC__)
// Triggered by the auto-generated pplval variable.
#if !defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#else
#pragma GCC diagnostic ignored "-Wuninitialized"
#endif
# 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)
# pragma warning(disable : 4065 4244 4701 4702)
#endif
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunreachable-code"
# pragma clang diagnostic ignored "-Wunreachable-code"
#endif
#include "ExpressionParser.h"
#if defined(_MSC_VER)
#include <malloc.h>
# include <malloc.h>
#else
#include <stdlib.h>
# include <stdlib.h>
#endif
#include <stdint.h>
#include <cassert>
#include <sstream>
#include <stdint.h>
#include "DiagnosticsBase.h"
#include "Lexer.h"
......@@ -122,13 +120,14 @@ typedef uint32_t UNSIGNED_TYPE;
#define YYSTYPE_IS_TRIVIAL 1
#define YYSTYPE_IS_DECLARED 1
namespace {
namespace
{
struct Context
{
angle::pp::Diagnostics *diagnostics;
angle::pp::Lexer *lexer;
angle::pp::Token *token;
int* result;
int *result;
bool parsePresetToken;
angle::pp::ExpressionParser::ErrorSettings errorSettings;
......@@ -143,12 +142,10 @@ struct Context
};
} // namespace
static int yylex(YYSTYPE *lvalp, Context *context);
static void yyerror(Context *context, const char *reason);
static int yylex(YYSTYPE* lvalp, Context* context);
static void yyerror(Context* context, const char* reason);
# ifndef YY_NULLPTR
#ifndef YY_NULLPTR
# if defined __cplusplus
# if 201103L <= __cplusplus
# define YY_NULLPTR nullptr
......@@ -156,9 +153,9 @@ static void yyerror(Context* context, const char* reason);
# define YY_NULLPTR 0
# endif
# else
# define YY_NULLPTR ((void*)0)
# endif
# define YY_NULLPTR ((void *)0)
# endif
#endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
......@@ -168,7 +165,6 @@ static void yyerror(Context* context, const char* reason);
# define YYERROR_VERBOSE 0
#endif
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
......@@ -180,8 +176,8 @@ extern int ppdebug;
/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
enum yytokentype
{
TOK_CONST_INT = 258,
TOK_IDENTIFIER = 259,
TOK_OP_OR = 260,
......@@ -193,23 +189,17 @@ extern int ppdebug;
TOK_OP_LEFT = 266,
TOK_OP_RIGHT = 267,
TOK_UNARY = 268
};
};
#endif
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
#if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED
typedef int YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
int ppparse (Context *context);
int ppparse(Context *context);
#ifdef short
# undef short
......@@ -244,7 +234,7 @@ typedef short yytype_int16;
# define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
# define YYSIZE_T size_t
# elif ! defined YYSIZE_T
# elif !defined YYSIZE_T
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
......@@ -252,13 +242,13 @@ typedef short yytype_int16;
# endif
#endif
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#define YYSIZE_MAXIMUM ((YYSIZE_T)-1)
#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
# define YY_(Msgid) dgettext("bison-runtime", Msgid)
# endif
# endif
# ifndef YY_
......@@ -267,9 +257,8 @@ typedef short yytype_int16;
#endif
#ifndef YY_ATTRIBUTE
# if (defined __GNUC__ \
&& (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
|| defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
# if (defined __GNUC__ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) || \
defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
# else
# define YY_ATTRIBUTE(Spec) /* empty */
......@@ -277,28 +266,26 @@ typedef short yytype_int16;
#endif
#ifndef YY_ATTRIBUTE_PURE
# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE((__pure__))
#endif
#ifndef YY_ATTRIBUTE_UNUSED
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE((__unused__))
#endif
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
# define YYUSE(E) ((void) (E))
#if !defined lint || defined __GNUC__
# define YYUSE(E) ((void)(E))
#else
# define YYUSE(E) /* empty */
#endif
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
#if defined __GNUC__ && !defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
_Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") \
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma("GCC diagnostic pop")
#else
# define YY_INITIAL_VALUE(Value) Value
#endif
......@@ -310,8 +297,7 @@ typedef short yytype_int16;
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
#if ! defined yyoverflow || YYERROR_VERBOSE
#if !defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
......@@ -328,9 +314,9 @@ typedef short yytype_int16;
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
# if !defined _ALLOCA_H && !defined EXIT_SUCCESS
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
/* Use EXIT_SUCCESS as a witness for stdlib.h. */
/* Use EXIT_SUCCESS as a witness for stdlib.h. */
# ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
# endif
......@@ -340,10 +326,14 @@ typedef short yytype_int16;
# endif
# ifdef YYSTACK_ALLOC
/* Pacify GCC's 'empty if-body' warning. */
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
/* Pacify GCC's 'empty if-body' warning. */
# define YYSTACK_FREE(Ptr) \
do \
{ /* empty */ \
; \
} while (0)
# ifndef YYSTACK_ALLOC_MAXIMUM
/* The OS might guarantee only one guard page at the bottom of the stack,
/* The OS might guarantee only one guard page at the bottom of the stack,
and a page size can be as small as 4096 bytes. So we cannot safely
invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
to allow for a few compiler-allocated temporary stack slots. */
......@@ -355,9 +345,8 @@ typedef short yytype_int16;
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
# if (defined __cplusplus && ! defined EXIT_SUCCESS \
&& ! ((defined YYMALLOC || defined malloc) \
&& (defined YYFREE || defined free)))
# if (defined __cplusplus && !defined EXIT_SUCCESS && \
!((defined YYMALLOC || defined malloc) && (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
......@@ -365,23 +354,21 @@ typedef short yytype_int16;
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
# if ! defined malloc && ! defined EXIT_SUCCESS
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# if !defined malloc && !defined EXIT_SUCCESS
void *malloc(YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
# if ! defined free && ! defined EXIT_SUCCESS
void free (void *); /* INFRINGES ON USER NAME SPACE */
# if !defined free && !defined EXIT_SUCCESS
void free(void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# endif
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
#if (! defined yyoverflow \
&& (! defined __cplusplus \
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
#if (!defined yyoverflow && \
(!defined __cplusplus || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
......@@ -391,13 +378,11 @@ union yyalloc
};
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
# define YYSTACK_GAP_MAXIMUM (sizeof(union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
# define YYSTACK_BYTES(N) ((N) * (sizeof(yytype_int16) + sizeof(YYSTYPE)) + YYSTACK_GAP_MAXIMUM)
# define YYCOPY_NEEDED 1
......@@ -410,12 +395,11 @@ union yyalloc
do \
{ \
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
YYCOPY(&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (0)
yynewbytes = yystacksize * sizeof(*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof(*yyptr); \
} while (0)
#endif
......@@ -424,8 +408,7 @@ union yyalloc
not overlap. */
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(Dst, Src, Count) \
__builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
# define YYCOPY(Dst, Src, Count) __builtin_memcpy(Dst, Src, (Count) * sizeof(*(Src)))
# else
# define YYCOPY(Dst, Src, Count) \
do \
......@@ -433,8 +416,7 @@ union yyalloc
YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
while (0)
} while (0)
# endif
# endif
#endif /* !YYCOPY_NEEDED */
......@@ -458,198 +440,116 @@ union yyalloc
/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
as returned by yylex, with out-of-bounds checking. */
#define YYTRANSLATE(YYX) \
((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
#define YYTRANSLATE(YYX) ((unsigned)(YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
as returned by yylex. */
static const yytype_uint8 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, 24, 2, 2, 2, 22, 9, 2,
26, 27, 20, 18, 2, 19, 2, 21, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
12, 2, 13, 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, 8, 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, 7, 2, 25, 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, 2, 3, 4,
5, 6, 10, 11, 14, 15, 16, 17, 23
};
static const yytype_uint8 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, 24, 2, 2, 2, 22, 9, 2, 26, 27, 20, 18, 2, 19, 2, 21, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 12, 2, 13, 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, 8, 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, 7, 2, 25, 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, 2, 3, 4, 5, 6, 10, 11, 14, 15, 16, 17, 23};
#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
0, 115, 115, 122, 123, 134, 134, 155, 155, 176,
179, 182, 185, 188, 191, 194, 197, 200, 203, 228,
250, 253, 256, 282, 309, 312, 315, 318, 330, 333
};
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] = {0, 113, 113, 120, 121, 132, 132, 153, 153, 174,
177, 180, 183, 186, 189, 192, 195, 198, 201, 226,
248, 251, 254, 280, 307, 310, 313, 316, 328, 331};
#endif
#if YYDEBUG || YYERROR_VERBOSE || 0
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
static const char *const yytname[] = {
"$end", "error", "$undefined", "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
};
"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};
#endif
# ifdef YYPRINT
#ifdef YYPRINT
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
(internal) symbol number NUM (which must be that of a token). */
static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 124, 94, 38,
static const yytype_uint16 yytoknum[] = {0, 256, 257, 258, 259, 260, 261, 124, 94, 38,
262, 263, 60, 62, 264, 265, 266, 267, 43, 45,
42, 47, 37, 268, 33, 126, 40, 41
};
# endif
42, 47, 37, 268, 33, 126, 40, 41};
#endif
#define YYPACT_NINF -12
#define yypact_value_is_default(Yystate) \
(!!((Yystate) == (-12)))
#define yypact_value_is_default(Yystate) (!!((Yystate) == (-12)))
#define YYTABLE_NINF -1
#define yytable_value_is_error(Yytable_value) \
0
#define yytable_value_is_error(Yytable_value) 0
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
static const yytype_int16 yypact[] =
{
31, -12, -12, 31, 31, 31, 31, 31, 51, 76,
-12, -12, -12, -12, 53, -12, -12, -12, 31, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
31, 31, 31, 31, -12, 31, 31, 124, 138, 26,
149, 149, -11, -11, -11, -11, 154, 154, -8, -8,
-12, -12, -12, 93, 109
};
static const yytype_int16 yypact[] = {
31, -12, -12, 31, 31, 31, 31, 31, 51, 76, -12, -12, -12, -12, 53, -12, -12, -12, 31,
31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, -12, 31, 31, 124,
138, 26, 149, 149, -11, -11, -11, -11, 154, 154, -8, -8, -12, -12, -12, 93, 109};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
/* 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_uint8 yydefact[] =
{
0, 3, 4, 0, 0, 0, 0, 0, 0, 2,
28, 27, 25, 26, 0, 1, 5, 7, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 29, 0, 0, 9, 10, 11,
13, 12, 17, 16, 15, 14, 19, 18, 21, 20,
24, 23, 22, 6, 8
};
static const yytype_uint8 yydefact[] = {0, 3, 4, 0, 0, 0, 0, 0, 0, 2, 28, 27, 25, 26,
0, 1, 5, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 29, 0, 0, 9, 10, 11, 13, 12,
17, 16, 15, 14, 19, 18, 21, 20, 24, 23, 22, 6, 8};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] =
{
-12, -12, -3, -12, -12
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int8 yypgoto[] = {-12, -12, -3, -12, -12};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int8 yydefgoto[] =
{
-1, 8, 9, 35, 36
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int8 yydefgoto[] = {-1, 8, 9, 35, 36};
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
/* 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_uint8 yytable[] =
{
10, 11, 12, 13, 14, 27, 28, 29, 30, 31,
32, 33, 31, 32, 33, 37, 38, 39, 40, 41,
42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
52, 0, 53, 54, 1, 2, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 3,
4, 15, 0, 0, 0, 5, 6, 7, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 0, 0, 0, 0,
34, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 18, 19, 20, 21,
22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 20, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
33, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 29, 30, 31, 32, 33
};
static const yytype_int8 yycheck[] =
{
3, 4, 5, 6, 7, 16, 17, 18, 19, 20,
21, 22, 20, 21, 22, 18, 19, 20, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
33, -1, 35, 36, 3, 4, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 18,
19, 0, -1, -1, -1, 24, 25, 26, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, -1, -1, -1, -1,
27, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 18, 19, 20, 21, 22
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
static const yytype_uint8 yytable[] = {
10, 11, 12, 13, 14, 27, 28, 29, 30, 31, 32, 33, 31, 32, 33, 37, 38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 48, 49, 50, 51, 52, 0, 53, 54, 1, 2, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31, 32, 33, 3, 4, 15, 0, 0, 0, 5, 6, 7, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 0, 0, 0, 0, 34, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
33, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 29, 30, 31, 32, 33};
static const yytype_int8 yycheck[] = {
3, 4, 5, 6, 7, 16, 17, 18, 19, 20, 21, 22, 20, 21, 22, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 3, 4, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 18, 19, 0, -1, -1, -1, 24, 25, 26, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 18, 19, 20, 21, 22};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
0, 3, 4, 18, 19, 24, 25, 26, 29, 30,
30, 30, 30, 30, 30, 0, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 27, 31, 32, 30, 30, 30,
30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
30, 30, 30, 30, 30
};
static const yytype_uint8 yystos[] = {0, 3, 4, 18, 19, 24, 25, 26, 29, 30, 30, 30, 30, 30,
30, 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 27, 31, 32, 30, 30, 30, 30, 30,
30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
0, 28, 29, 30, 30, 31, 30, 32, 30, 30,
30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
30, 30, 30, 30, 30, 30, 30, 30, 30, 30
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
static const yytype_uint8 yyr2[] =
{
0, 2, 1, 1, 1, 0, 4, 0, 4, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 2, 2, 2, 2, 3
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] = {0, 28, 29, 30, 30, 31, 30, 32, 30, 30, 30, 30, 30, 30, 30,
30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
static const yytype_uint8 yyr2[] = {0, 2, 1, 1, 1, 0, 4, 0, 4, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3};
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
......@@ -660,7 +560,6 @@ static const yytype_uint8 yyr2[] =
#define YYABORT goto yyabortlab
#define YYERROR goto yyerrorlab
#define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(Token, Value) \
......@@ -669,13 +568,13 @@ static const yytype_uint8 yyr2[] =
{ \
yychar = (Token); \
yylval = (Value); \
YYPOPSTACK (yylen); \
YYPOPSTACK(yylen); \
yystate = *yyssp; \
goto yybackup; \
} \
else \
{ \
yyerror (context, YY_("syntax error: cannot back up")); \
yyerror(context, YY_("syntax error: cannot back up")); \
YYERROR; \
} \
while (0)
......@@ -684,8 +583,6 @@ static const yytype_uint8 yyr2[] =
#define YYTERROR 1
#define YYERRCODE 256
/* Enable debugging if requested. */
#if YYDEBUG
......@@ -695,61 +592,59 @@ static const yytype_uint8 yyr2[] =
# endif
# define YYDPRINTF(Args) \
do { \
do \
{ \
if (yydebug) \
YYFPRINTF Args; \
} while (0)
} while (0)
/* This macro is provided for backward compatibility. */
#ifndef YY_LOCATION_PRINT
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
#endif
# ifndef YY_LOCATION_PRINT
# define YY_LOCATION_PRINT(File, Loc) ((void)0)
# endif
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
do { \
do \
{ \
if (yydebug) \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yy_symbol_print (stderr, \
Type, Value, context); \
YYFPRINTF (stderr, "\n"); \
YYFPRINTF(stderr, "%s ", Title); \
yy_symbol_print(stderr, Type, Value, context); \
YYFPRINTF(stderr, "\n"); \
} \
} while (0)
} while (0)
/*-----------------------------------.
| Print this symbol's value on YYO. |
`-----------------------------------*/
static void
yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, Context *context)
static void yy_symbol_value_print(FILE *yyo,
int yytype,
YYSTYPE const *const yyvaluep,
Context *context)
{
FILE *yyoutput = yyo;
YYUSE (yyoutput);
YYUSE (context);
YYUSE(yyoutput);
YYUSE(context);
if (!yyvaluep)
return;
# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
YYPRINT(yyo, yytoknum[yytype], *yyvaluep);
# endif
YYUSE (yytype);
YYUSE(yytype);
}
/*---------------------------.
| Print this symbol on YYO. |
`---------------------------*/
static void
yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, Context *context)
static void yy_symbol_print(FILE *yyo, int yytype, YYSTYPE const *const yyvaluep, Context *context)
{
YYFPRINTF (yyo, "%s %s (",
yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
YYFPRINTF(yyo, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
yy_symbol_value_print (yyo, yytype, yyvaluep, context);
YYFPRINTF (yyo, ")");
yy_symbol_value_print(yyo, yytype, yyvaluep, context);
YYFPRINTF(yyo, ")");
}
/*------------------------------------------------------------------.
......@@ -757,54 +652,50 @@ yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, Context
| TOP (included). |
`------------------------------------------------------------------*/
static void
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
static void yy_stack_print(yytype_int16 *yybottom, yytype_int16 *yytop)
{
YYFPRINTF (stderr, "Stack now");
YYFPRINTF(stderr, "Stack now");
for (; yybottom <= yytop; yybottom++)
{
int yybot = *yybottom;
YYFPRINTF (stderr, " %d", yybot);
YYFPRINTF(stderr, " %d", yybot);
}
YYFPRINTF (stderr, "\n");
YYFPRINTF(stderr, "\n");
}
# define YY_STACK_PRINT(Bottom, Top) \
do { \
do \
{ \
if (yydebug) \
yy_stack_print ((Bottom), (Top)); \
} while (0)
yy_stack_print((Bottom), (Top)); \
} while (0)
/*------------------------------------------------.
| Report that the YYRULE is going to be reduced. |
`------------------------------------------------*/
static void
yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, Context *context)
static void yy_reduce_print(yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, Context *context)
{
unsigned long yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
yyrule - 1, yylno);
YYFPRINTF(stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno);
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr,
yystos[yyssp[yyi + 1 - yynrhs]],
&yyvsp[(yyi + 1) - (yynrhs)]
, context);
YYFPRINTF (stderr, "\n");
YYFPRINTF(stderr, " $%d = ", yyi + 1);
yy_symbol_print(stderr, yystos[yyssp[yyi + 1 - yynrhs]], &yyvsp[(yyi + 1) - (yynrhs)],
context);
YYFPRINTF(stderr, "\n");
}
}
# define YY_REDUCE_PRINT(Rule) \
do { \
do \
{ \
if (yydebug) \
yy_reduce_print (yyssp, yyvsp, Rule, context); \
} while (0)
yy_reduce_print(yyssp, yyvsp, Rule, context); \
} while (0)
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
......@@ -816,7 +707,6 @@ int yydebug;
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */
/* YYINITDEPTH -- initial size of the parser's stacks. */
#ifndef YYINITDEPTH
# define YYINITDEPTH 200
......@@ -833,7 +723,6 @@ int yydebug;
# define YYMAXDEPTH 10000
#endif
#if YYERROR_VERBOSE
# ifndef yystrlen
......@@ -841,8 +730,7 @@ int yydebug;
# define yystrlen strlen
# else
/* Return the length of YYSTR. */
static YYSIZE_T
yystrlen (const char *yystr)
static YYSIZE_T yystrlen(const char *yystr)
{
YYSIZE_T yylen;
for (yylen = 0; yystr[yylen]; yylen++)
......@@ -858,8 +746,7 @@ yystrlen (const char *yystr)
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
YYDEST. */
static char *
yystpcpy (char *yydest, const char *yysrc)
static char *yystpcpy(char *yydest, const char *yysrc)
{
char *yyd = yydest;
const char *yys = yysrc;
......@@ -880,8 +767,7 @@ yystpcpy (char *yydest, const char *yysrc)
backslash-backslash). YYSTR is taken from yytname. If YYRES is
null, do not copy; instead, return the length of what the result
would have been. */
static YYSIZE_T
yytnamerr (char *yyres, const char *yystr)
static YYSIZE_T yytnamerr(char *yyres, const char *yystr)
{
if (*yystr == '"')
{
......@@ -913,13 +799,13 @@ yytnamerr (char *yyres, const char *yystr)
yyres[yyn] = '\0';
return yyn;
}
do_not_strip_quotes: ;
do_not_strip_quotes:;
}
if (! yyres)
return yystrlen (yystr);
if (!yyres)
return yystrlen(yystr);
return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
return (YYSIZE_T)(yystpcpy(yyres, yystr) - yyres);
}
# endif
......@@ -931,13 +817,14 @@ yytnamerr (char *yyres, const char *yystr)
not large enough to hold the message. In that case, also set
*YYMSG_ALLOC to the required number of bytes. Return 2 if the
required number of bytes is too large to store. */
static int
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
yytype_int16 *yyssp, int yytoken)
static int yysyntax_error(YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
{
YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
YYSIZE_T yysize0 = yytnamerr(YY_NULLPTR, yytname[yytoken]);
YYSIZE_T yysize = yysize0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
enum
{
YYERROR_VERBOSE_ARGS_MAXIMUM = 5
};
/* Internationalized format string. */
const char *yyformat = YY_NULLPTR;
/* Arguments of yyformat. */
......@@ -973,7 +860,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
{
int yyn = yypact[*yyssp];
yyarg[yycount++] = yytname[yytoken];
if (!yypact_value_is_default (yyn))
if (!yypact_value_is_default(yyn))
{
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. In other words, skip the first -YYN actions for
......@@ -985,8 +872,8 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
int yyx;
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
&& !yytable_value_is_error (yytable[yyx + yyn]))
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR &&
!yytable_value_is_error(yytable[yyx + yyn]))
{
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
{
......@@ -996,7 +883,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
}
yyarg[yycount++] = yytname[yyx];
{
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
YYSIZE_T yysize1 = yysize + yytnamerr(YY_NULLPTR, yytname[yyx]);
if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
yysize = yysize1;
else
......@@ -1023,7 +910,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
}
{
YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
YYSIZE_T yysize1 = yysize + yystrlen(yyformat);
if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
yysize = yysize1;
else
......@@ -1033,8 +920,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
if (*yymsg_alloc < yysize)
{
*yymsg_alloc = 2 * yysize;
if (! (yysize <= *yymsg_alloc
&& *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
if (!(yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
*yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
return 1;
}
......@@ -1048,7 +934,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
while ((*yyp = *yyformat) != '\0')
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
{
yyp += yytnamerr (yyp, yyarg[yyi++]);
yyp += yytnamerr(yyp, yyarg[yyi++]);
yyformat += 2;
}
else
......@@ -1065,39 +951,33 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
static void
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, Context *context)
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep, Context *context)
{
YYUSE (yyvaluep);
YYUSE (context);
YYUSE(yyvaluep);
YYUSE(context);
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
YY_SYMBOL_PRINT(yymsg, yytype, yyvaluep, yylocationp);
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
YYUSE (yytype);
YYUSE(yytype);
YY_IGNORE_MAYBE_UNINITIALIZED_END
}
/*----------.
| yyparse. |
`----------*/
int
yyparse (Context *context)
int yyparse(Context *context)
{
/* The lookahead symbol. */
int yychar;
/* The lookahead symbol. */
int yychar;
/* The semantic value of the lookahead symbol. */
/* Default value used for initialization, for pacifying older GCCs
/* The semantic value of the lookahead symbol. */
/* Default value used for initialization, for pacifying older GCCs
or non-GCC compilers. */
YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
YY_INITIAL_VALUE(static YYSTYPE yyval_default;)
YYSTYPE yylval YY_INITIAL_VALUE(= yyval_default);
/* Number of syntax errors so far. */
int yynerrs;
......@@ -1150,7 +1030,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
yyvsp = yyvs = yyvsa;
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n"));
YYDPRINTF((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
......@@ -1158,7 +1038,6 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
yychar = YYEMPTY; /* Cause a token to be read. */
goto yysetstate;
/*------------------------------------------------------------.
| yynewstate -- push a new state, which is found in yystate. |
`------------------------------------------------------------*/
......@@ -1167,12 +1046,11 @@ yynewstate:
have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
/*--------------------------------------------------------------------.
| yynewstate -- set current state (the top of the stack) to yystate. |
`--------------------------------------------------------------------*/
yysetstate:
*yyssp = (yytype_int16) yystate;
*yyssp = (yytype_int16)yystate;
if (yyss + yystacksize - 1 <= yyssp)
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
......@@ -1180,7 +1058,7 @@ yysetstate:
#else
{
/* Get the current used size of the three stacks, in elements. */
YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
YYSIZE_T yysize = (YYSIZE_T)(yyssp - yyss + 1);
# if defined yyoverflow
{
......@@ -1194,10 +1072,8 @@ yysetstate:
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
be undefined if yyoverflow is a macro. */
yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
&yystacksize);
yyoverflow(YY_("memory exhausted"), &yyss1, yysize * sizeof(*yyssp), &yyvs1,
yysize * sizeof(*yyvsp), &yystacksize);
yyss = yyss1;
yyvs = yyvs1;
}
......@@ -1211,37 +1087,34 @@ yysetstate:
{
yytype_int16 *yyss1 = yyss;
union yyalloc *yyptr =
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
union yyalloc *yyptr = (union yyalloc *)YYSTACK_ALLOC(YYSTACK_BYTES(yystacksize));
if (!yyptr)
goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs_alloc, yyvs);
YYSTACK_RELOCATE(yyss_alloc, yyss);
YYSTACK_RELOCATE(yyvs_alloc, yyvs);
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
YYSTACK_FREE(yyss1);
}
# endif
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long) yystacksize));
YYDPRINTF((stderr, "Stack size increased to %lu\n", (unsigned long)yystacksize));
if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
YYDPRINTF((stderr, "Entering state %d\n", yystate));
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup;
/*-----------.
| yybackup. |
`-----------*/
......@@ -1251,7 +1124,7 @@ yybackup:
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
if (yypact_value_is_default (yyn))
if (yypact_value_is_default(yyn))
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
......@@ -1259,19 +1132,19 @@ yybackup:
/* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
yychar = yylex (&yylval, context);
YYDPRINTF((stderr, "Reading a token: "));
yychar = yylex(&yylval, context);
}
if (yychar <= YYEOF)
{
yychar = yytoken = YYEOF;
YYDPRINTF ((stderr, "Now at end of input.\n"));
YYDPRINTF((stderr, "Now at end of input.\n"));
}
else
{
yytoken = YYTRANSLATE (yychar);
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
yytoken = YYTRANSLATE(yychar);
YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc);
}
/* If the proper action on seeing token YYTOKEN is to reduce or to
......@@ -1282,7 +1155,7 @@ yybackup:
yyn = yytable[yyn];
if (yyn <= 0)
{
if (yytable_value_is_error (yyn))
if (yytable_value_is_error(yyn))
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
......@@ -1294,7 +1167,7 @@ yybackup:
yyerrstatus--;
/* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc);
/* Discard the shifted token. */
yychar = YYEMPTY;
......@@ -1306,7 +1179,6 @@ yybackup:
goto yynewstate;
/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state. |
`-----------------------------------------------------------*/
......@@ -1316,7 +1188,6 @@ yydefault:
goto yyerrlab;
goto yyreduce;
/*-----------------------------.
| yyreduce -- do a reduction. |
`-----------------------------*/
......@@ -1332,10 +1203,9 @@ yyreduce:
users should not rely upon it. Assigning to YYVAL
unconditionally makes the parser a bit smaller, and it avoids a
GCC warning that YYVAL may be used uninitialized. */
yyval = yyvsp[1-yylen];
yyval = yyvsp[1 - yylen];
YY_REDUCE_PRINT (yyn);
YY_REDUCE_PRINT(yyn);
switch (yyn)
{
case 2:
......@@ -1510,8 +1380,7 @@ yyreduce:
stream << yyvsp[-2] << " >> " << yyvsp[0];
std::string text = stream.str();
context->diagnostics->report(angle::pp::Diagnostics::PP_UNDEFINED_SHIFT,
context->token->location,
text.c_str());
context->token->location, text.c_str());
*(context->valid) = false;
}
yyval = static_cast<YYSTYPE>(0);
......@@ -1540,16 +1409,15 @@ yyreduce:
stream << yyvsp[-2] << " << " << yyvsp[0];
std::string text = stream.str();
context->diagnostics->report(angle::pp::Diagnostics::PP_UNDEFINED_SHIFT,
context->token->location,
text.c_str());
context->token->location, text.c_str());
*(context->valid) = false;
}
yyval = static_cast<YYSTYPE>(0);
}
else
{
// Logical shift left. Casting to unsigned is needed to ensure there's no signed integer
// overflow, which some tools treat as an error.
// Logical shift left. Casting to unsigned is needed to ensure there's no signed
// integer overflow, which some tools treat as an error.
yyval = static_cast<YYSTYPE>(static_cast<UNSIGNED_TYPE>(yyvsp[-2]) << yyvsp[0]);
}
}
......@@ -1583,8 +1451,7 @@ yyreduce:
stream << yyvsp[-2] << " % " << yyvsp[0];
std::string text = stream.str();
context->diagnostics->report(angle::pp::Diagnostics::PP_DIVISION_BY_ZERO,
context->token->location,
text.c_str());
context->token->location, text.c_str());
*(context->valid) = false;
}
yyval = static_cast<YYSTYPE>(0);
......@@ -1614,8 +1481,7 @@ yyreduce:
stream << yyvsp[-2] << " / " << yyvsp[0];
std::string text = stream.str();
context->diagnostics->report(angle::pp::Diagnostics::PP_DIVISION_BY_ZERO,
context->token->location,
text.c_str());
context->token->location, text.c_str());
*(context->valid) = false;
}
yyval = static_cast<YYSTYPE>(0);
......@@ -1646,7 +1512,7 @@ yyreduce:
case 25:
{
yyval = ! yyvsp[0];
yyval = !yyvsp[0];
}
break;
......@@ -1654,7 +1520,7 @@ yyreduce:
case 26:
{
yyval = ~ yyvsp[0];
yyval = ~yyvsp[0];
}
break;
......@@ -1679,7 +1545,7 @@ yyreduce:
case 28:
{
yyval = + yyvsp[0];
yyval = +yyvsp[0];
}
break;
......@@ -1692,9 +1558,8 @@ yyreduce:
break;
default: break;
default:
break;
}
/* User semantic actions sometimes alter yychar, and that requires
that yytoken be updated with the new translation. We take the
......@@ -1707,11 +1572,11 @@ yyreduce:
case of YYERROR or YYBACKUP, subsequent parser actions might lead
to an incorrect destructor call or verbose syntax error message
before the lookahead is translated. */
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YY_SYMBOL_PRINT("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen);
YYPOPSTACK(yylen);
yylen = 0;
YY_STACK_PRINT (yyss, yyssp);
YY_STACK_PRINT(yyss, yyssp);
*++yyvsp = yyval;
......@@ -1721,31 +1586,28 @@ yyreduce:
{
const int yylhs = yyr1[yyn] - YYNTOKENS;
const int yyi = yypgoto[yylhs] + *yyssp;
yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
? yytable[yyi]
: yydefgoto[yylhs]);
yystate =
(0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ? yytable[yyi] : yydefgoto[yylhs]);
}
goto yynewstate;
/*--------------------------------------.
| yyerrlab -- here on detecting error. |
`--------------------------------------*/
yyerrlab:
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE(yychar);
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
++yynerrs;
#if ! YYERROR_VERBOSE
yyerror (context, YY_("syntax error"));
#if !YYERROR_VERBOSE
yyerror(context, YY_("syntax error"));
#else
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
yyssp, yytoken)
# define YYSYNTAX_ERROR yysyntax_error(&yymsg_alloc, &yymsg, yyssp, yytoken)
{
char const *yymsgp = YY_("syntax error");
int yysyntax_error_status;
......@@ -1755,8 +1617,8 @@ yyerrlab:
else if (yysyntax_error_status == 1)
{
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
YYSTACK_FREE(yymsg);
yymsg = (char *)YYSTACK_ALLOC(yymsg_alloc);
if (!yymsg)
{
yymsg = yymsgbuf;
......@@ -1769,7 +1631,7 @@ yyerrlab:
yymsgp = yymsg;
}
}
yyerror (context, yymsgp);
yyerror(context, yymsgp);
if (yysyntax_error_status == 2)
goto yyexhaustedlab;
}
......@@ -1777,8 +1639,6 @@ yyerrlab:
#endif
}
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse lookahead token after an
......@@ -1792,8 +1652,7 @@ yyerrlab:
}
else
{
yydestruct ("Error: discarding",
yytoken, &yylval, context);
yydestruct("Error: discarding", yytoken, &yylval, context);
yychar = YYEMPTY;
}
}
......@@ -1802,7 +1661,6 @@ yyerrlab:
token. */
goto yyerrlab1;
/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR. |
`---------------------------------------------------*/
......@@ -1814,13 +1672,12 @@ yyerrorlab:
/* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */
YYPOPSTACK (yylen);
YYPOPSTACK(yylen);
yylen = 0;
YY_STACK_PRINT (yyss, yyssp);
YY_STACK_PRINT(yyss, yyssp);
yystate = *yyssp;
goto yyerrlab1;
/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR. |
`-------------------------------------------------------------*/
......@@ -1830,7 +1687,7 @@ yyerrlab1:
for (;;)
{
yyn = yypact[yystate];
if (!yypact_value_is_default (yyn))
if (!yypact_value_is_default(yyn))
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
......@@ -1845,26 +1702,22 @@ yyerrlab1:
if (yyssp == yyss)
YYABORT;
yydestruct ("Error: popping",
yystos[yystate], yyvsp, context);
YYPOPSTACK (1);
yydestruct("Error: popping", yystos[yystate], yyvsp, context);
YYPOPSTACK(1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
YY_STACK_PRINT(yyss, yyssp);
}
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
/* Shift the error token. */
YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
YY_SYMBOL_PRINT("Shifting", yystos[yyn], yyvsp, yylsp);
yystate = yyn;
goto yynewstate;
/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here. |
`-------------------------------------*/
......@@ -1872,7 +1725,6 @@ yyacceptlab:
yyresult = 0;
goto yyreturn;
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
......@@ -1880,18 +1732,16 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
#if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
yyexhaustedlab:
yyerror (context, YY_("memory exhausted"));
yyerror(context, YY_("memory exhausted"));
yyresult = 2;
/* Fall through. */
#endif
/*-----------------------------------------------------.
| yyreturn -- parsing is finished, return the result. |
`-----------------------------------------------------*/
......@@ -1900,33 +1750,29 @@ yyreturn:
{
/* Make sure we have latest lookahead translation. See comments at
user semantic actions for why this is necessary. */
yytoken = YYTRANSLATE (yychar);
yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval, context);
yytoken = YYTRANSLATE(yychar);
yydestruct("Cleanup: discarding lookahead", yytoken, &yylval, context);
}
/* Do not reclaim the symbols of the rule whose action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
YY_STACK_PRINT (yyss, yyssp);
YYPOPSTACK(yylen);
YY_STACK_PRINT(yyss, yyssp);
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
yystos[*yyssp], yyvsp, context);
YYPOPSTACK (1);
yydestruct("Cleanup: popping", yystos[*yyssp], yyvsp, context);
YYPOPSTACK(1);
}
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
YYSTACK_FREE(yyss);
#endif
#if YYERROR_VERBOSE
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
YYSTACK_FREE(yymsg);
#endif
return yyresult;
}
int yylex(YYSTYPE *lvalp, Context *context)
{
angle::pp::Token *token = context->token;
......@@ -1940,10 +1786,12 @@ int yylex(YYSTYPE *lvalp, Context *context)
switch (token->type)
{
case angle::pp::Token::CONST_INT: {
case angle::pp::Token::CONST_INT:
{
unsigned int val = 0;
int testVal = 0;
if (!token->uValue(&val) || (!token->iValue(&testVal) &&
if (!token->uValue(&val) ||
(!token->iValue(&testVal) &&
context->errorSettings.integerLiteralsMustFit32BitSignedRange))
{
context->diagnostics->report(angle::pp::Diagnostics::PP_INTEGER_OVERFLOW,
......@@ -2009,19 +1857,18 @@ int yylex(YYSTYPE *lvalp, Context *context)
void yyerror(Context *context, const char *reason)
{
context->diagnostics->report(angle::pp::Diagnostics::PP_INVALID_EXPRESSION,
context->token->location,
reason);
context->token->location, reason);
}
namespace angle {
namespace angle
{
namespace pp {
namespace pp
{
ExpressionParser::ExpressionParser(Lexer *lexer, Diagnostics *diagnostics)
: mLexer(lexer),
mDiagnostics(diagnostics)
{
}
: mLexer(lexer), mDiagnostics(diagnostics)
{}
bool ExpressionParser::parse(Token *token,
int *result,
......
......@@ -24,8 +24,6 @@ WHICH GENERATES THE GLSL ES LEXER (glslang_lex_autogen.cpp).
// glslang.l:
// Lexer for the OpenGL shading language.
// clang-format off
// Ignore errors in auto-generated code.
#if defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wswitch-enum"
......
......@@ -24,8 +24,6 @@ WHICH GENERATES THE GLSL ES PARSER (glslang_tab_autogen.cpp AND glslang_tab_auto
// glslang.y:
// Parser for the OpenGL shading language.
// clang-format off
// Ignore errors in auto-generated code.
#if defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wunused-function"
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -74,7 +74,7 @@ def main():
# auto_script parameters.
if len(sys.argv) > 1:
inputs = [data_source_name]
inputs = ['renderer/angle_format.py', data_source_name]
outputs = [out_file_name]
if sys.argv[1] == 'inputs':
......
......@@ -127,7 +127,9 @@ def main():
# auto_script parameters.
if len(sys.argv) > 1:
inputs = ['es3_format_type_combinations.json', 'format_map_data.json']
inputs = [
'renderer/angle_format.py', 'es3_format_type_combinations.json', 'format_map_data.json'
]
outputs = ['format_map_autogen.cpp']
if sys.argv[1] == 'inputs':
......
......@@ -198,7 +198,7 @@ def main():
# auto_script parameters.
if len(sys.argv) > 1:
inputs = ['load_functions_data.json']
inputs = ['angle_format.py', 'load_functions_data.json']
outputs = ['load_functions_table_autogen.cpp']
if sys.argv[1] == 'inputs':
......
......@@ -265,7 +265,7 @@ def gen_vertex_map_switch_string(vertex_table):
def main():
# auto_script parameters.
if len(sys.argv) > 1:
inputs = ['mtl_format_map.json']
inputs = ['../angle_format.py', 'mtl_format_map.json']
outputs = ['mtl_format_table_autogen.mm']
if sys.argv[1] == 'inputs':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment