Commit 168d5e80 by Corentin Wallez Committed by Commit Bot

compiler: Regenerate parser with latest flex and bison

Flex version is 2.6.4 Bison version is 3.0.4 BUG=chromium:668842 Change-Id: Ia05ae338c9b9e588534f8346ff5c59ed747c56bf Reviewed-on: https://chromium-review.googlesource.com/435553Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 5978e28d
......@@ -2,26 +2,6 @@ diff --git a/src/compiler/preprocessor/Tokenizer.cpp b/src/compiler/preprocessor
index 0d7ad58..5ef0e5e 100644
--- a/src/compiler/preprocessor/Tokenizer.cpp
+++ b/src/compiler/preprocessor/Tokenizer.cpp
@@ -1703,7 +1703,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{
int num_to_read =
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+ static_cast<int>(YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1);
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
@@ -1737,8 +1737,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
- num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
- number_to_move - 1;
+ num_to_read = static_cast<int>(YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1);
}
@@ -1746,8 +1746,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
num_to_read = YY_READ_BUF_SIZE;
......@@ -34,46 +14,3 @@ index 0d7ad58..5ef0e5e 100644
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
}
@@ -1773,13 +1775,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
if ((int) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
- int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
+ yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) pprealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
}
- yyg->yy_n_chars += number_to_move;
+ yyg->yy_n_chars += static_cast<int>(number_to_move);
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
@@ -2171,7 +2173,7 @@ void pppop_buffer_state (yyscan_t yyscanner)
*/
static void ppensure_buffer_stack (yyscan_t yyscanner)
{
- int num_to_alloc;
+ yy_size_t num_to_alloc;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!yyg->yy_buffer_stack) {
@@ -2238,7 +2240,7 @@ YY_BUFFER_STATE pp_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in pp_scan_buffer()" );
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_size = static_cast<int>(size - 2); /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = NULL;
@@ -2293,7 +2295,7 @@ YY_BUFFER_STATE pp_scan_bytes (yyconst char * yybytes, int _yybytes_len , yysc
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in pp_scan_bytes()" );
- for ( i = 0; i < _yybytes_len; ++i )
+ for ( i = 0; i < static_cast<yy_size_t>(_yybytes_len); ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
......@@ -2,69 +2,6 @@ diff --git a/src/compiler/translator/glslang_lex.cpp b/src/compiler/translator/g
index 1ba63df..2a206ab 100644
--- a/src/compiler/translator/glslang_lex.cpp
+++ b/src/compiler/translator/glslang_lex.cpp
@@ -1,4 +1,3 @@
-#line 17 "./glslang.l"
//
// Copyright (c) 2012-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
@@ -149,6 +148,7 @@ typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
+typedef uint64_t flex_uint64_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
@@ -335,6 +335,11 @@ typedef size_t yy_size_t;
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
@@ -351,8 +356,8 @@ typedef size_t yy_size_t;
*/
#define YY_LESS_LINENO(n) \
do { \
- int yyl;\
- for ( yyl = n; yyl < yyleng; ++yyl )\
+ yy_size_t yyl;\
+ for ( yyl = n; yyl < static_cast<yy_site_t>(yyleng); ++yyl )\
if ( yytext[yyl] == '\n' )\
--yylineno;\
}while(0)
@@ -1692,7 +1697,7 @@ yy_find_action:
if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
{
yy_size_t yyl;
- for ( yyl = 0; yyl < yyleng; ++yyl )
+ for ( yyl = 0; yyl < static_cast<yy_size_t>(yyleng); ++yyl )
if ( yytext[yyl] == '\n' )
do{ yylineno++;
@@ -2655,7 +2660,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{
int num_to_read =
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - static_cast<int>(number_to_move) - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
@@ -2690,7 +2695,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
- number_to_move - 1;
+ static_cast<int>(number_to_move) - 1;
}
@@ -2698,8 +2703,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
num_to_read = YY_READ_BUF_SIZE;
......@@ -77,46 +14,3 @@ index 1ba63df..2a206ab 100644
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
}
@@ -2725,13 +2732,13 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
if ((int) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
- int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
+ int new_size = yyg->yy_n_chars + static_cast<int>(number_to_move) + (yyg->yy_n_chars >> 1);
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
}
- yyg->yy_n_chars += number_to_move;
+ yyg->yy_n_chars += static_cast<int>(number_to_move);
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
@@ -3158,7 +3165,7 @@ static void yyensure_buffer_stack (yyscan_t yyscanner)
/* Increase the buffer to prepare for a possible push. */
yy_size_t grow_size = 8 /* arbitrary grow size */;
- num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
+ num_to_alloc = static_cast<int>(yyg->yy_buffer_stack_max + grow_size);
yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
(yyg->yy_buffer_stack,
num_to_alloc * sizeof(struct yy_buffer_state*)
@@ -3196,7 +3203,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_size = static_cast<int>(size) - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = NULL;
@@ -3251,7 +3258,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yysc
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
- for ( i = 0; i < _yybytes_len; ++i )
+ for ( i = 0; i < static_cast<yy_size_t>(_yybytes_len); ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
......@@ -58,8 +58,12 @@
/* Pull parsers. */
#define YYPULL 1
/* Copy the first part of user declarations. */
//
// Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
......
......@@ -31,24 +31,27 @@
version 2.2 of Bison. */
#ifndef YY_YY_GLSLANG_TAB_H_INCLUDED
#define YY_YY_GLSLANG_TAB_H_INCLUDED
# define YY_YY_GLSLANG_TAB_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
#define YYDEBUG 0
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif
/* "%code requires" blocks. */
#define YYLTYPE TSourceLoc
#define YYLTYPE_IS_DECLARED 1
/* Token type. */
#ifndef YYTOKENTYPE
#define YYTOKENTYPE
enum yytokentype
{
# define YYTOKENTYPE
enum yytokentype
{
INVARIANT = 258,
HIGH_PRECISION = 259,
MEDIUM_PRECISION = 260,
......@@ -198,16 +201,17 @@ enum yytokentype
CARET = 404,
AMPERSAND = 405,
QUESTION = 406
};
};
#endif
/* Value type. */
#if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{
union YYSTYPE {
struct
{
struct {
union {
TString *string;
float f;
......@@ -215,10 +219,9 @@ union YYSTYPE {
unsigned int u;
bool b;
};
TSymbol *symbol;
TSymbol* symbol;
} lex;
struct
{
struct {
TOperator op;
union {
TIntermNode *intermNode;
......@@ -246,15 +249,17 @@ union YYSTYPE {
TTypeQualifierBuilder *typeQualifierBuilder;
};
} interm;
};
typedef union YYSTYPE YYSTYPE;
#define YYSTYPE_IS_TRIVIAL 1
#define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
/* Location type. */
#if !defined YYLTYPE && !defined YYLTYPE_IS_DECLARED
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
typedef struct YYLTYPE YYLTYPE;
struct YYLTYPE
{
......@@ -263,10 +268,12 @@ struct YYLTYPE
int last_line;
int last_column;
};
#define YYLTYPE_IS_DECLARED 1
#define YYLTYPE_IS_TRIVIAL 1
# define YYLTYPE_IS_DECLARED 1
# define YYLTYPE_IS_TRIVIAL 1
#endif
int yyparse(TParseContext *context, void *scanner);
int yyparse (TParseContext* context, void *scanner);
#endif /* !YY_YY_GLSLANG_TAB_H_INCLUDED */
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