summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/compiler/translator/glslang_lex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/angle/src/compiler/translator/glslang_lex.cpp')
-rwxr-xr-xgfx/angle/src/compiler/translator/glslang_lex.cpp195
1 files changed, 53 insertions, 142 deletions
diff --git a/gfx/angle/src/compiler/translator/glslang_lex.cpp b/gfx/angle/src/compiler/translator/glslang_lex.cpp
index 2dcc1bc0f..8ad7b1464 100755
--- a/gfx/angle/src/compiler/translator/glslang_lex.cpp
+++ b/gfx/angle/src/compiler/translator/glslang_lex.cpp
@@ -1,3 +1,4 @@
+#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
@@ -6,8 +7,6 @@
// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
-/* clang-format off */
-
// Ignore errors in auto-generated code.
#if defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wunused-function"
@@ -25,7 +24,7 @@
-#line 30 "./glslang_lex.cpp"
+#line 28 "./glslang_lex.cpp"
#define YY_INT_ALIGNED short int
@@ -221,7 +220,7 @@ typedef size_t yy_size_t;
#define YY_LESS_LINENO(n) \
do { \
yy_size_t yyl;\
- for ( yyl = n; yyl < static_cast<yy_site_t>(yyleng); ++yyl )\
+ for ( yyl = n; yyl < yyleng; ++yyl )\
if ( yytext[yyl] == '\n' )\
--yylineno;\
}while(0)
@@ -396,7 +395,7 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
*/
#define YY_DO_BEFORE_ACTION \
yyg->yytext_ptr = yy_bp; \
- yyleng = (size_t) (yy_cp - yy_bp); \
+ yyleng = (yy_size_t) (yy_cp - yy_bp); \
yyg->yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
@@ -429,7 +428,7 @@ static yyconst flex_int16_t yy_accept[820] =
177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
177, 199, 203, 235, 0, 189, 185, 0, 188, 182,
- 0, 184, 178, 195, 196, 177, 137, 177, 177, 177,
+ 0, 184, 178, 195, 196, 177, 136, 177, 177, 177,
177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
13, 177, 177, 177, 177, 177, 177, 177, 177, 177,
@@ -441,67 +440,67 @@ static yyconst flex_int16_t yy_accept[820] =
177, 177, 177, 177, 177, 177, 177, 177, 0, 186,
0, 185, 187, 181, 177, 177, 177, 30, 177, 177,
18, 174, 177, 177, 177, 177, 177, 177, 177, 177,
- 177, 177, 16, 140, 177, 177, 177, 177, 21, 177,
- 177, 144, 155, 177, 177, 177, 177, 177, 177, 177,
+ 177, 177, 16, 139, 177, 177, 177, 177, 21, 177,
+ 177, 143, 155, 177, 177, 177, 177, 177, 177, 177,
177, 177, 177, 177, 177, 152, 4, 35, 36, 37,
177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
- 177, 177, 177, 177, 143, 31, 177, 177, 28, 177,
+ 177, 177, 177, 177, 142, 31, 177, 177, 28, 177,
177, 177, 177, 177, 177, 177, 47, 48, 49, 29,
177, 177, 177, 177, 177, 177, 10, 53, 54, 55,
- 177, 138, 177, 177, 7, 177, 177, 177, 177, 164,
+ 177, 137, 177, 177, 7, 177, 177, 177, 177, 164,
165, 166, 177, 32, 177, 156, 26, 167, 168, 169,
2, 161, 162, 163, 177, 177, 177, 25, 159, 177,
177, 177, 50, 51, 52, 177, 177, 177, 177, 177,
- 177, 177, 177, 177, 177, 177, 99, 177, 177, 177,
+ 177, 177, 177, 177, 177, 177, 86, 177, 177, 177,
177, 177, 177, 177, 153, 177, 177, 177, 177, 177,
- 177, 177, 177, 177, 177, 177, 139, 177, 177, 176,
- 56, 57, 58, 177, 177, 14, 177, 104, 177, 177,
- 177, 177, 102, 177, 177, 177, 154, 149, 105, 177,
- 177, 177, 177, 177, 177, 145, 177, 177, 177, 78,
+ 177, 177, 177, 177, 177, 177, 138, 177, 177, 176,
+ 56, 57, 58, 177, 177, 14, 177, 91, 177, 177,
+ 177, 177, 89, 177, 177, 177, 154, 149, 92, 177,
+ 177, 177, 177, 177, 177, 144, 177, 177, 177, 78,
38, 41, 43, 42, 39, 45, 44, 46, 40, 177,
- 177, 177, 177, 160, 136, 177, 177, 147, 177, 177,
- 177, 34, 100, 173, 22, 148, 77, 177, 158, 17,
+ 177, 177, 177, 160, 135, 177, 177, 147, 177, 177,
+ 177, 34, 87, 173, 22, 148, 77, 177, 158, 17,
177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
177, 177, 177, 177, 19, 33, 177, 177, 177, 177,
- 177, 177, 106, 79, 85, 177, 177, 177, 177, 177,
+ 177, 177, 93, 94, 95, 177, 177, 177, 177, 177,
3, 177, 177, 177, 177, 177, 177, 177, 177, 177,
- 177, 177, 141, 177, 177, 177, 177, 177, 8, 177,
- 177, 9, 177, 177, 177, 177, 20, 93, 11, 150,
- 107, 80, 87, 177, 177, 177, 177, 177, 177, 177,
- 177, 177, 177, 177, 177, 146, 177, 177, 177, 91,
- 96, 94, 177, 177, 177, 177, 177, 177, 177, 142,
- 108, 81, 86, 177, 177, 157, 177, 95, 177, 177,
+ 177, 177, 140, 177, 177, 177, 177, 177, 8, 177,
+ 177, 9, 177, 177, 177, 177, 20, 79, 11, 150,
+ 97, 98, 99, 177, 177, 177, 177, 177, 177, 177,
+ 177, 177, 177, 177, 177, 145, 177, 177, 177, 81,
+ 83, 80, 177, 177, 177, 177, 177, 177, 177, 141,
+ 101, 102, 103, 177, 177, 157, 177, 146, 177, 177,
6, 177, 177, 177, 177, 177, 177, 177, 177, 177,
- 90, 151, 1, 177, 177, 177, 177, 177, 175, 177,
+ 96, 151, 1, 177, 177, 177, 177, 177, 175, 177,
- 103, 5, 170, 59, 62, 177, 177, 177, 177, 177,
- 177, 177, 177, 177, 177, 177, 177, 177, 92, 177,
- 177, 177, 177, 88, 177, 177, 177, 177, 177, 121,
+ 90, 5, 170, 59, 62, 177, 177, 177, 177, 177,
+ 177, 177, 177, 177, 177, 177, 177, 177, 82, 177,
+ 177, 177, 177, 100, 177, 177, 177, 177, 177, 120,
66, 67, 177, 177, 177, 177, 177, 177, 177, 177,
- 177, 177, 177, 177, 177, 101, 177, 177, 177, 89,
- 123, 70, 71, 177, 177, 97, 177, 177, 177, 177,
- 177, 177, 177, 116, 177, 177, 177, 177, 177, 177,
- 177, 177, 177, 177, 130, 177, 177, 177, 177, 60,
+ 177, 177, 177, 177, 177, 88, 177, 177, 177, 104,
+ 122, 70, 71, 177, 177, 84, 177, 177, 177, 177,
+ 177, 177, 177, 115, 177, 177, 177, 177, 177, 177,
+ 177, 177, 177, 177, 129, 177, 177, 177, 177, 60,
177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
- 177, 177, 117, 109, 177, 82, 177, 177, 177, 131,
+ 177, 177, 116, 105, 177, 106, 177, 177, 177, 130,
177, 177, 68, 177, 177, 177, 177, 177, 177, 177,
- 177, 177, 177, 177, 177, 177, 118, 177, 177, 132,
- 177, 177, 72, 110, 83, 177, 112, 177, 113, 177,
- 177, 177, 177, 177, 98, 177, 177, 177, 177, 64,
- 177, 63, 127, 177, 177, 111, 84, 177, 177, 177,
- 177, 177, 177, 177, 177, 177, 177, 125, 128, 119,
+ 177, 177, 177, 177, 177, 177, 117, 177, 177, 131,
+ 177, 177, 72, 107, 108, 177, 111, 177, 112, 177,
+ 177, 177, 177, 177, 85, 177, 177, 177, 177, 64,
+ 177, 63, 126, 177, 177, 109, 110, 177, 177, 177,
+ 177, 177, 177, 177, 177, 177, 177, 124, 127, 118,
177, 65, 177, 177, 177, 177, 177, 177, 177, 177,
- 126, 129, 177, 177, 122, 69, 177, 177, 171, 177,
- 177, 177, 74, 177, 177, 124, 73, 177, 177, 177,
- 177, 177, 177, 133, 177, 177, 177, 177, 177, 177,
+ 125, 128, 177, 177, 121, 69, 177, 177, 171, 177,
+ 177, 177, 74, 177, 177, 123, 73, 177, 177, 177,
+ 177, 177, 177, 132, 177, 177, 177, 177, 177, 177,
- 134, 177, 177, 177, 75, 177, 135, 114, 115, 177,
- 177, 177, 61, 177, 177, 172, 120, 76, 0
+ 133, 177, 177, 177, 75, 177, 134, 113, 114, 177,
+ 177, 177, 61, 177, 177, 172, 119, 76, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -1028,9 +1027,6 @@ WHICH GENERATES THE GLSL ES LEXER (glslang_lex.cpp).
#include "compiler/preprocessor/Token.h"
#include "compiler/translator/util.h"
#include "compiler/translator/length_limits.h"
-
-using namespace sh;
-
#include "glslang_tab.h"
/* windows only pragma */
@@ -1058,8 +1054,6 @@ static int reserved_word(yyscan_t yyscanner);
static int ES2_reserved_ES3_keyword(TParseContext *context, int token);
static int ES2_keyword_ES3_reserved(TParseContext *context, int token);
static int ES2_ident_ES3_keyword(TParseContext *context, int token);
-static int ES2_ident_ES3_reserved_ES3_1_keyword(TParseContext *context, int token);
-static int ES2_and_ES3_reserved_ES3_1_keyword(TParseContext *context, int token);
static int uint_constant(TParseContext *context);
static int int_constant(TParseContext *context);
static int float_constant(yyscan_t yyscanner);
@@ -1374,7 +1368,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 < static_cast<yy_size_t>(yyleng); ++yyl )
+ for ( yyl = 0; yyl < yyleng; ++yyl )
if ( yytext[yyl] == '\n' )
do{ yylineno++;
@@ -1706,75 +1700,24 @@ case 78:
YY_RULE_SETUP
{ return ES2_ident_ES3_keyword(context, LAYOUT); }
YY_BREAK
+/* Reserved keywords for GLSL ES 3.00 that are not reserved for GLSL ES 1.00 */
case 79:
-YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IMAGE2D); }
- YY_BREAK
case 80:
-YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IIMAGE2D); }
- YY_BREAK
case 81:
-YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, UIMAGE2D); }
- YY_BREAK
case 82:
-YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IMAGE2DARRAY); }
- YY_BREAK
case 83:
-YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IIMAGE2DARRAY); }
- YY_BREAK
case 84:
-YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, UIMAGE2DARRAY); }
- YY_BREAK
case 85:
-YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IMAGE3D); }
- YY_BREAK
case 86:
-YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, UIMAGE3D); }
- YY_BREAK
case 87:
-YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IIMAGE3D); }
- YY_BREAK
case 88:
-YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IIMAGECUBE); }
- YY_BREAK
case 89:
-YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, UIMAGECUBE); }
- YY_BREAK
case 90:
-YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IMAGECUBE); }
- YY_BREAK
case 91:
-YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, READONLY); }
- YY_BREAK
case 92:
-YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, WRITEONLY); }
- YY_BREAK
case 93:
-YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, COHERENT); }
- YY_BREAK
case 94:
-YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, RESTRICT); }
- YY_BREAK
case 95:
-YY_RULE_SETUP
-{ return ES2_and_ES3_reserved_ES3_1_keyword(context, VOLATILE); }
- YY_BREAK
-/* Reserved keywords for GLSL ES 3.00 that are not reserved for GLSL ES 1.00 */
case 96:
case 97:
case 98:
@@ -1814,7 +1757,6 @@ case 131:
case 132:
case 133:
case 134:
-case 135:
YY_RULE_SETUP
{
if (context->getShaderVersion() < 300) {
@@ -1825,7 +1767,7 @@ YY_RULE_SETUP
}
YY_BREAK
/* Reserved keywords in GLSL ES 1.00 that are not reserved in GLSL ES 3.00 */
-case 136:
+case 135:
YY_RULE_SETUP
{
if (context->getShaderVersion() >= 300)
@@ -1838,6 +1780,7 @@ YY_RULE_SETUP
}
YY_BREAK
/* Reserved keywords */
+case 136:
case 137:
case 138:
case 139:
@@ -2338,7 +2281,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{
- int num_to_read =
+ yy_size_t num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
@@ -2374,7 +2317,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 -
- static_cast<int>(number_to_move) - 1;
+ number_to_move - 1;
}
@@ -2382,10 +2325,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
num_to_read = YY_READ_BUF_SIZE;
/* Read in more data. */
- size_t result = 0;
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- result, num_to_read );
- yyg->yy_n_chars = static_cast<int>(result);
+ yyg->yy_n_chars, num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
}
@@ -2826,7 +2767,7 @@ static void yyensure_buffer_stack (yyscan_t yyscanner)
/* Increase the buffer to prepare for a possible push. */
int grow_size = 8 /* arbitrary grow size */;
- num_to_alloc = static_cast<int>(yyg->yy_buffer_stack_max + grow_size);
+ num_to_alloc = 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*)
@@ -2860,7 +2801,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 = static_cast<int>(size) - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_size = 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 = 0;
@@ -2909,7 +2850,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
- for ( i = 0; i < static_cast<yy_size_t>(_yybytes_len); ++i )
+ for ( i = 0; i < _yybytes_len; ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
@@ -3360,24 +3301,6 @@ int ES2_keyword_ES3_reserved(TParseContext *context, int token)
return token;
}
-int ES2_ident_ES3_reserved_ES3_1_keyword(TParseContext *context, int token)
-{
- struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner();
- yyscan_t yyscanner = (yyscan_t) context->getScanner();
-
- if (context->getShaderVersion() < 300)
- {
- yylval->lex.string = NewPoolTString(yytext);
- return check_type(yyscanner);
- }
- else if (context->getShaderVersion() == 300)
- {
- return reserved_word(yyscanner);
- }
-
- return token;
-}
-
int ES2_ident_ES3_keyword(TParseContext *context, int token)
{
struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner();
@@ -3393,18 +3316,6 @@ int ES2_ident_ES3_keyword(TParseContext *context, int token)
return token;
}
-int ES2_and_ES3_reserved_ES3_1_keyword(TParseContext *context, int token)
-{
- yyscan_t yyscanner = (yyscan_t) context->getScanner();
-
- if (context->getShaderVersion() < 310)
- {
- return reserved_word(yyscanner);
- }
-
- return token;
-}
-
int uint_constant(TParseContext *context)
{
struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner();
@@ -3506,7 +3417,7 @@ int glslang_scan(size_t count, const char* const string[], const int length[],
if (context->getFragmentPrecisionHigh())
preprocessor->predefineMacro("GL_FRAGMENT_PRECISION_HIGH", 1);
- preprocessor->setMaxTokenSize(sh::GetGlobalMaxTokenSize(context->getShaderSpec()));
+ preprocessor->setMaxTokenSize(GetGlobalMaxTokenSize(context->getShaderSpec()));
return 0;
}