summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_lexer.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-01-27 18:19:54 -0800
committerIan Romanick <[email protected]>2011-02-11 14:12:44 -0800
commitafdceede5565eb6aa9752aed41a2023eb04a8df8 (patch)
tree81f17984fd55d77abf77d32915bdbd1a1f2fbc18 /src/glsl/glsl_lexer.cpp
parent884215894493bdbc55abd567c121c9df06ae3bc7 (diff)
glsl: Regenerate files modified by previous commits
Diffstat (limited to 'src/glsl/glsl_lexer.cpp')
-rw-r--r--src/glsl/glsl_lexer.cpp447
1 files changed, 230 insertions, 217 deletions
diff --git a/src/glsl/glsl_lexer.cpp b/src/glsl/glsl_lexer.cpp
index 04927950f4a..40d2294ef8c 100644
--- a/src/glsl/glsl_lexer.cpp
+++ b/src/glsl/glsl_lexer.cpp
@@ -1018,6 +1018,8 @@ static yyconst flex_int16_t yy_chk[1283] =
#include "glsl_parser_extras.h"
#include "glsl_parser.h"
+static int classify_identifier(struct _mesa_glsl_parse_state *, const char *);
+
#define YY_USER_ACTION \
do { \
yylloc->source = 0; \
@@ -1053,7 +1055,7 @@ static yyconst flex_int16_t yy_chk[1283] =
return ERROR_TOK; \
} else { \
yylval->identifier = strdup(yytext); \
- return IDENTIFIER; \
+ return classify_identifier(yyextra, yytext); \
} \
} while (0)
@@ -1067,7 +1069,7 @@ static yyconst flex_int16_t yy_chk[1283] =
*/
#define ES yyextra->es_shader
-#line 1071 "glsl_lexer.cpp"
+#line 1073 "glsl_lexer.cpp"
#define INITIAL 0
#define PP 1
@@ -1305,10 +1307,10 @@ YY_DECL
register int yy_act;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-#line 95 "glsl_lexer.lpp"
+#line 97 "glsl_lexer.lpp"
-#line 1312 "glsl_lexer.cpp"
+#line 1314 "glsl_lexer.cpp"
yylval = yylval_param;
@@ -1394,7 +1396,7 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 97 "glsl_lexer.lpp"
+#line 99 "glsl_lexer.lpp"
;
YY_BREAK
/* Preprocessor tokens. */
@@ -1403,17 +1405,17 @@ case 2:
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 100 "glsl_lexer.lpp"
+#line 102 "glsl_lexer.lpp"
;
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 101 "glsl_lexer.lpp"
+#line 103 "glsl_lexer.lpp"
{ BEGIN PP; return VERSION; }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 102 "glsl_lexer.lpp"
+#line 104 "glsl_lexer.lpp"
{ BEGIN PP; return EXTENSION; }
YY_BREAK
case 5:
@@ -1421,7 +1423,7 @@ case 5:
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 103 "glsl_lexer.lpp"
+#line 105 "glsl_lexer.lpp"
{
/* Eat characters until the first digit is
* encountered
@@ -1443,7 +1445,7 @@ case 6:
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 118 "glsl_lexer.lpp"
+#line 120 "glsl_lexer.lpp"
{
/* Eat characters until the first digit is
* encountered
@@ -1461,7 +1463,7 @@ YY_RULE_SETUP
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 132 "glsl_lexer.lpp"
+#line 134 "glsl_lexer.lpp"
{
BEGIN PP;
return PRAGMA_DEBUG_ON;
@@ -1469,7 +1471,7 @@ YY_RULE_SETUP
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 136 "glsl_lexer.lpp"
+#line 138 "glsl_lexer.lpp"
{
BEGIN PP;
return PRAGMA_DEBUG_OFF;
@@ -1477,7 +1479,7 @@ YY_RULE_SETUP
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 140 "glsl_lexer.lpp"
+#line 142 "glsl_lexer.lpp"
{
BEGIN PP;
return PRAGMA_OPTIMIZE_ON;
@@ -1485,7 +1487,7 @@ YY_RULE_SETUP
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 144 "glsl_lexer.lpp"
+#line 146 "glsl_lexer.lpp"
{
BEGIN PP;
return PRAGMA_OPTIMIZE_OFF;
@@ -1493,7 +1495,7 @@ YY_RULE_SETUP
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 148 "glsl_lexer.lpp"
+#line 150 "glsl_lexer.lpp"
{
BEGIN PP;
return PRAGMA_INVARIANT_ALL;
@@ -1501,38 +1503,38 @@ YY_RULE_SETUP
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 152 "glsl_lexer.lpp"
+#line 154 "glsl_lexer.lpp"
{ BEGIN PRAGMA; }
YY_BREAK
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
-#line 154 "glsl_lexer.lpp"
+#line 156 "glsl_lexer.lpp"
{ BEGIN 0; yylineno++; yycolumn = 0; }
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 155 "glsl_lexer.lpp"
+#line 157 "glsl_lexer.lpp"
{ }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 157 "glsl_lexer.lpp"
+#line 159 "glsl_lexer.lpp"
{ }
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 158 "glsl_lexer.lpp"
+#line 160 "glsl_lexer.lpp"
{ }
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 159 "glsl_lexer.lpp"
+#line 161 "glsl_lexer.lpp"
return COLON;
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 160 "glsl_lexer.lpp"
+#line 162 "glsl_lexer.lpp"
{
yylval->identifier = strdup(yytext);
return IDENTIFIER;
@@ -1540,7 +1542,7 @@ YY_RULE_SETUP
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 164 "glsl_lexer.lpp"
+#line 166 "glsl_lexer.lpp"
{
yylval->n = strtol(yytext, NULL, 10);
return INTCONSTANT;
@@ -1549,388 +1551,388 @@ YY_RULE_SETUP
case 20:
/* rule 20 can match eol */
YY_RULE_SETUP
-#line 168 "glsl_lexer.lpp"
+#line 170 "glsl_lexer.lpp"
{ BEGIN 0; yylineno++; yycolumn = 0; return EOL; }
YY_BREAK
case 21:
/* rule 21 can match eol */
YY_RULE_SETUP
-#line 170 "glsl_lexer.lpp"
+#line 172 "glsl_lexer.lpp"
{ yylineno++; yycolumn = 0; }
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 172 "glsl_lexer.lpp"
+#line 174 "glsl_lexer.lpp"
return ATTRIBUTE;
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 173 "glsl_lexer.lpp"
+#line 175 "glsl_lexer.lpp"
return CONST_TOK;
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 174 "glsl_lexer.lpp"
+#line 176 "glsl_lexer.lpp"
return BOOL_TOK;
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 175 "glsl_lexer.lpp"
+#line 177 "glsl_lexer.lpp"
return FLOAT_TOK;
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 176 "glsl_lexer.lpp"
+#line 178 "glsl_lexer.lpp"
return INT_TOK;
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 177 "glsl_lexer.lpp"
+#line 179 "glsl_lexer.lpp"
KEYWORD(130, 130, UINT_TOK);
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 179 "glsl_lexer.lpp"
+#line 181 "glsl_lexer.lpp"
return BREAK;
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 180 "glsl_lexer.lpp"
+#line 182 "glsl_lexer.lpp"
return CONTINUE;
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 181 "glsl_lexer.lpp"
+#line 183 "glsl_lexer.lpp"
return DO;
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 182 "glsl_lexer.lpp"
+#line 184 "glsl_lexer.lpp"
return WHILE;
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 183 "glsl_lexer.lpp"
+#line 185 "glsl_lexer.lpp"
return ELSE;
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 184 "glsl_lexer.lpp"
+#line 186 "glsl_lexer.lpp"
return FOR;
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 185 "glsl_lexer.lpp"
+#line 187 "glsl_lexer.lpp"
return IF;
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 186 "glsl_lexer.lpp"
+#line 188 "glsl_lexer.lpp"
return DISCARD;
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 187 "glsl_lexer.lpp"
+#line 189 "glsl_lexer.lpp"
return RETURN;
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 189 "glsl_lexer.lpp"
+#line 191 "glsl_lexer.lpp"
return BVEC2;
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 190 "glsl_lexer.lpp"
+#line 192 "glsl_lexer.lpp"
return BVEC3;
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 191 "glsl_lexer.lpp"
+#line 193 "glsl_lexer.lpp"
return BVEC4;
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 192 "glsl_lexer.lpp"
+#line 194 "glsl_lexer.lpp"
return IVEC2;
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 193 "glsl_lexer.lpp"
+#line 195 "glsl_lexer.lpp"
return IVEC3;
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 194 "glsl_lexer.lpp"
+#line 196 "glsl_lexer.lpp"
return IVEC4;
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 195 "glsl_lexer.lpp"
+#line 197 "glsl_lexer.lpp"
KEYWORD(130, 130, UVEC2);
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 196 "glsl_lexer.lpp"
+#line 198 "glsl_lexer.lpp"
KEYWORD(130, 130, UVEC3);
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 197 "glsl_lexer.lpp"
+#line 199 "glsl_lexer.lpp"
KEYWORD(130, 130, UVEC4);
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 198 "glsl_lexer.lpp"
+#line 200 "glsl_lexer.lpp"
return VEC2;
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 199 "glsl_lexer.lpp"
+#line 201 "glsl_lexer.lpp"
return VEC3;
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 200 "glsl_lexer.lpp"
+#line 202 "glsl_lexer.lpp"
return VEC4;
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 201 "glsl_lexer.lpp"
+#line 203 "glsl_lexer.lpp"
return MAT2X2;
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 202 "glsl_lexer.lpp"
+#line 204 "glsl_lexer.lpp"
return MAT3X3;
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 203 "glsl_lexer.lpp"
+#line 205 "glsl_lexer.lpp"
return MAT4X4;
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 204 "glsl_lexer.lpp"
+#line 206 "glsl_lexer.lpp"
KEYWORD(120, 120, MAT2X2);
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 205 "glsl_lexer.lpp"
+#line 207 "glsl_lexer.lpp"
KEYWORD(120, 120, MAT2X3);
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 206 "glsl_lexer.lpp"
+#line 208 "glsl_lexer.lpp"
KEYWORD(120, 120, MAT2X4);
YY_BREAK
case 55:
YY_RULE_SETUP
-#line 207 "glsl_lexer.lpp"
+#line 209 "glsl_lexer.lpp"
KEYWORD(120, 120, MAT3X2);
YY_BREAK
case 56:
YY_RULE_SETUP
-#line 208 "glsl_lexer.lpp"
+#line 210 "glsl_lexer.lpp"
KEYWORD(120, 120, MAT3X3);
YY_BREAK
case 57:
YY_RULE_SETUP
-#line 209 "glsl_lexer.lpp"
+#line 211 "glsl_lexer.lpp"
KEYWORD(120, 120, MAT3X4);
YY_BREAK
case 58:
YY_RULE_SETUP
-#line 210 "glsl_lexer.lpp"
+#line 212 "glsl_lexer.lpp"
KEYWORD(120, 120, MAT4X2);
YY_BREAK
case 59:
YY_RULE_SETUP
-#line 211 "glsl_lexer.lpp"
+#line 213 "glsl_lexer.lpp"
KEYWORD(120, 120, MAT4X3);
YY_BREAK
case 60:
YY_RULE_SETUP
-#line 212 "glsl_lexer.lpp"
+#line 214 "glsl_lexer.lpp"
KEYWORD(120, 120, MAT4X4);
YY_BREAK
case 61:
YY_RULE_SETUP
-#line 214 "glsl_lexer.lpp"
+#line 216 "glsl_lexer.lpp"
return IN_TOK;
YY_BREAK
case 62:
YY_RULE_SETUP
-#line 215 "glsl_lexer.lpp"
+#line 217 "glsl_lexer.lpp"
return OUT_TOK;
YY_BREAK
case 63:
YY_RULE_SETUP
-#line 216 "glsl_lexer.lpp"
+#line 218 "glsl_lexer.lpp"
return INOUT_TOK;
YY_BREAK
case 64:
YY_RULE_SETUP
-#line 217 "glsl_lexer.lpp"
+#line 219 "glsl_lexer.lpp"
return UNIFORM;
YY_BREAK
case 65:
YY_RULE_SETUP
-#line 218 "glsl_lexer.lpp"
+#line 220 "glsl_lexer.lpp"
return VARYING;
YY_BREAK
case 66:
YY_RULE_SETUP
-#line 219 "glsl_lexer.lpp"
+#line 221 "glsl_lexer.lpp"
KEYWORD(120, 120, CENTROID);
YY_BREAK
case 67:
YY_RULE_SETUP
-#line 220 "glsl_lexer.lpp"
+#line 222 "glsl_lexer.lpp"
KEYWORD(120 || ES, 120 || ES, INVARIANT);
YY_BREAK
case 68:
YY_RULE_SETUP
-#line 221 "glsl_lexer.lpp"
+#line 223 "glsl_lexer.lpp"
KEYWORD(130 || ES, 130, FLAT);
YY_BREAK
case 69:
YY_RULE_SETUP
-#line 222 "glsl_lexer.lpp"
+#line 224 "glsl_lexer.lpp"
KEYWORD(130, 130, SMOOTH);
YY_BREAK
case 70:
YY_RULE_SETUP
-#line 223 "glsl_lexer.lpp"
+#line 225 "glsl_lexer.lpp"
KEYWORD(130, 130, NOPERSPECTIVE);
YY_BREAK
case 71:
YY_RULE_SETUP
-#line 225 "glsl_lexer.lpp"
+#line 227 "glsl_lexer.lpp"
return SAMPLER1D;
YY_BREAK
case 72:
YY_RULE_SETUP
-#line 226 "glsl_lexer.lpp"
+#line 228 "glsl_lexer.lpp"
return SAMPLER2D;
YY_BREAK
case 73:
YY_RULE_SETUP
-#line 227 "glsl_lexer.lpp"
+#line 229 "glsl_lexer.lpp"
return SAMPLER3D;
YY_BREAK
case 74:
YY_RULE_SETUP
-#line 228 "glsl_lexer.lpp"
+#line 230 "glsl_lexer.lpp"
return SAMPLERCUBE;
YY_BREAK
case 75:
YY_RULE_SETUP
-#line 229 "glsl_lexer.lpp"
+#line 231 "glsl_lexer.lpp"
KEYWORD(130, 130, SAMPLER1DARRAY);
YY_BREAK
case 76:
YY_RULE_SETUP
-#line 230 "glsl_lexer.lpp"
+#line 232 "glsl_lexer.lpp"
KEYWORD(130, 130, SAMPLER2DARRAY);
YY_BREAK
case 77:
YY_RULE_SETUP
-#line 231 "glsl_lexer.lpp"
+#line 233 "glsl_lexer.lpp"
return SAMPLER1DSHADOW;
YY_BREAK
case 78:
YY_RULE_SETUP
-#line 232 "glsl_lexer.lpp"
+#line 234 "glsl_lexer.lpp"
return SAMPLER2DSHADOW;
YY_BREAK
case 79:
YY_RULE_SETUP
-#line 233 "glsl_lexer.lpp"
+#line 235 "glsl_lexer.lpp"
KEYWORD(130, 130, SAMPLERCUBESHADOW);
YY_BREAK
case 80:
YY_RULE_SETUP
-#line 234 "glsl_lexer.lpp"
+#line 236 "glsl_lexer.lpp"
KEYWORD(130, 130, SAMPLER1DARRAYSHADOW);
YY_BREAK
case 81:
YY_RULE_SETUP
-#line 235 "glsl_lexer.lpp"
+#line 237 "glsl_lexer.lpp"
KEYWORD(130, 130, SAMPLER2DARRAYSHADOW);
YY_BREAK
case 82:
YY_RULE_SETUP
-#line 236 "glsl_lexer.lpp"
+#line 238 "glsl_lexer.lpp"
KEYWORD(130, 130, ISAMPLER1D);
YY_BREAK
case 83:
YY_RULE_SETUP
-#line 237 "glsl_lexer.lpp"
+#line 239 "glsl_lexer.lpp"
KEYWORD(130, 130, ISAMPLER2D);
YY_BREAK
case 84:
YY_RULE_SETUP
-#line 238 "glsl_lexer.lpp"
+#line 240 "glsl_lexer.lpp"
KEYWORD(130, 130, ISAMPLER3D);
YY_BREAK
case 85:
YY_RULE_SETUP
-#line 239 "glsl_lexer.lpp"
+#line 241 "glsl_lexer.lpp"
KEYWORD(130, 130, ISAMPLERCUBE);
YY_BREAK
case 86:
YY_RULE_SETUP
-#line 240 "glsl_lexer.lpp"
+#line 242 "glsl_lexer.lpp"
KEYWORD(130, 130, ISAMPLER1DARRAY);
YY_BREAK
case 87:
YY_RULE_SETUP
-#line 241 "glsl_lexer.lpp"
+#line 243 "glsl_lexer.lpp"
KEYWORD(130, 130, ISAMPLER2DARRAY);
YY_BREAK
case 88:
YY_RULE_SETUP
-#line 242 "glsl_lexer.lpp"
+#line 244 "glsl_lexer.lpp"
KEYWORD(130, 130, USAMPLER1D);
YY_BREAK
case 89:
YY_RULE_SETUP
-#line 243 "glsl_lexer.lpp"
+#line 245 "glsl_lexer.lpp"
KEYWORD(130, 130, USAMPLER2D);
YY_BREAK
case 90:
YY_RULE_SETUP
-#line 244 "glsl_lexer.lpp"
+#line 246 "glsl_lexer.lpp"
KEYWORD(130, 130, USAMPLER3D);
YY_BREAK
case 91:
YY_RULE_SETUP
-#line 245 "glsl_lexer.lpp"
+#line 247 "glsl_lexer.lpp"
KEYWORD(130, 130, USAMPLERCUBE);
YY_BREAK
case 92:
YY_RULE_SETUP
-#line 246 "glsl_lexer.lpp"
+#line 248 "glsl_lexer.lpp"
KEYWORD(130, 130, USAMPLER1DARRAY);
YY_BREAK
case 93:
YY_RULE_SETUP
-#line 247 "glsl_lexer.lpp"
+#line 249 "glsl_lexer.lpp"
KEYWORD(130, 130, USAMPLER2DARRAY);
YY_BREAK
case 94:
YY_RULE_SETUP
-#line 250 "glsl_lexer.lpp"
+#line 252 "glsl_lexer.lpp"
return STRUCT;
YY_BREAK
case 95:
YY_RULE_SETUP
-#line 251 "glsl_lexer.lpp"
+#line 253 "glsl_lexer.lpp"
return VOID_TOK;
YY_BREAK
case 96:
YY_RULE_SETUP
-#line 253 "glsl_lexer.lpp"
+#line 255 "glsl_lexer.lpp"
{
if ((yyextra->language_version >= 140)
|| yyextra->AMD_conservative_depth_enable
@@ -1945,112 +1947,112 @@ YY_RULE_SETUP
YY_BREAK
case 97:
YY_RULE_SETUP
-#line 265 "glsl_lexer.lpp"
+#line 267 "glsl_lexer.lpp"
return INC_OP;
YY_BREAK
case 98:
YY_RULE_SETUP
-#line 266 "glsl_lexer.lpp"
+#line 268 "glsl_lexer.lpp"
return DEC_OP;
YY_BREAK
case 99:
YY_RULE_SETUP
-#line 267 "glsl_lexer.lpp"
+#line 269 "glsl_lexer.lpp"
return LE_OP;
YY_BREAK
case 100:
YY_RULE_SETUP
-#line 268 "glsl_lexer.lpp"
+#line 270 "glsl_lexer.lpp"
return GE_OP;
YY_BREAK
case 101:
YY_RULE_SETUP
-#line 269 "glsl_lexer.lpp"
+#line 271 "glsl_lexer.lpp"
return EQ_OP;
YY_BREAK
case 102:
YY_RULE_SETUP
-#line 270 "glsl_lexer.lpp"
+#line 272 "glsl_lexer.lpp"
return NE_OP;
YY_BREAK
case 103:
YY_RULE_SETUP
-#line 271 "glsl_lexer.lpp"
+#line 273 "glsl_lexer.lpp"
return AND_OP;
YY_BREAK
case 104:
YY_RULE_SETUP
-#line 272 "glsl_lexer.lpp"
+#line 274 "glsl_lexer.lpp"
return OR_OP;
YY_BREAK
case 105:
YY_RULE_SETUP
-#line 273 "glsl_lexer.lpp"
+#line 275 "glsl_lexer.lpp"
return XOR_OP;
YY_BREAK
case 106:
YY_RULE_SETUP
-#line 274 "glsl_lexer.lpp"
+#line 276 "glsl_lexer.lpp"
return LEFT_OP;
YY_BREAK
case 107:
YY_RULE_SETUP
-#line 275 "glsl_lexer.lpp"
+#line 277 "glsl_lexer.lpp"
return RIGHT_OP;
YY_BREAK
case 108:
YY_RULE_SETUP
-#line 277 "glsl_lexer.lpp"
+#line 279 "glsl_lexer.lpp"
return MUL_ASSIGN;
YY_BREAK
case 109:
YY_RULE_SETUP
-#line 278 "glsl_lexer.lpp"
+#line 280 "glsl_lexer.lpp"
return DIV_ASSIGN;
YY_BREAK
case 110:
YY_RULE_SETUP
-#line 279 "glsl_lexer.lpp"
+#line 281 "glsl_lexer.lpp"
return ADD_ASSIGN;
YY_BREAK
case 111:
YY_RULE_SETUP
-#line 280 "glsl_lexer.lpp"
+#line 282 "glsl_lexer.lpp"
return MOD_ASSIGN;
YY_BREAK
case 112:
YY_RULE_SETUP
-#line 281 "glsl_lexer.lpp"
+#line 283 "glsl_lexer.lpp"
return LEFT_ASSIGN;
YY_BREAK
case 113:
YY_RULE_SETUP
-#line 282 "glsl_lexer.lpp"
+#line 284 "glsl_lexer.lpp"
return RIGHT_ASSIGN;
YY_BREAK
case 114:
YY_RULE_SETUP
-#line 283 "glsl_lexer.lpp"
+#line 285 "glsl_lexer.lpp"
return AND_ASSIGN;
YY_BREAK
case 115:
YY_RULE_SETUP
-#line 284 "glsl_lexer.lpp"
+#line 286 "glsl_lexer.lpp"
return XOR_ASSIGN;
YY_BREAK
case 116:
YY_RULE_SETUP
-#line 285 "glsl_lexer.lpp"
+#line 287 "glsl_lexer.lpp"
return OR_ASSIGN;
YY_BREAK
case 117:
YY_RULE_SETUP
-#line 286 "glsl_lexer.lpp"
+#line 288 "glsl_lexer.lpp"
return SUB_ASSIGN;
YY_BREAK
case 118:
YY_RULE_SETUP
-#line 288 "glsl_lexer.lpp"
+#line 290 "glsl_lexer.lpp"
{
yylval->n = strtol(yytext, NULL, 10);
return IS_UINT ? UINTCONSTANT : INTCONSTANT;
@@ -2058,7 +2060,7 @@ YY_RULE_SETUP
YY_BREAK
case 119:
YY_RULE_SETUP
-#line 292 "glsl_lexer.lpp"
+#line 294 "glsl_lexer.lpp"
{
yylval->n = strtol(yytext + 2, NULL, 16);
return IS_UINT ? UINTCONSTANT : INTCONSTANT;
@@ -2066,7 +2068,7 @@ YY_RULE_SETUP
YY_BREAK
case 120:
YY_RULE_SETUP
-#line 296 "glsl_lexer.lpp"
+#line 298 "glsl_lexer.lpp"
{
yylval->n = strtol(yytext, NULL, 8);
return IS_UINT ? UINTCONSTANT : INTCONSTANT;
@@ -2074,7 +2076,7 @@ YY_RULE_SETUP
YY_BREAK
case 121:
YY_RULE_SETUP
-#line 301 "glsl_lexer.lpp"
+#line 303 "glsl_lexer.lpp"
{
yylval->real = glsl_strtod(yytext, NULL);
return FLOATCONSTANT;
@@ -2082,7 +2084,7 @@ YY_RULE_SETUP
YY_BREAK
case 122:
YY_RULE_SETUP
-#line 305 "glsl_lexer.lpp"
+#line 307 "glsl_lexer.lpp"
{
yylval->real = glsl_strtod(yytext, NULL);
return FLOATCONSTANT;
@@ -2090,7 +2092,7 @@ YY_RULE_SETUP
YY_BREAK
case 123:
YY_RULE_SETUP
-#line 309 "glsl_lexer.lpp"
+#line 311 "glsl_lexer.lpp"
{
yylval->real = glsl_strtod(yytext, NULL);
return FLOATCONSTANT;
@@ -2098,7 +2100,7 @@ YY_RULE_SETUP
YY_BREAK
case 124:
YY_RULE_SETUP
-#line 313 "glsl_lexer.lpp"
+#line 315 "glsl_lexer.lpp"
{
yylval->real = glsl_strtod(yytext, NULL);
return FLOATCONSTANT;
@@ -2106,7 +2108,7 @@ YY_RULE_SETUP
YY_BREAK
case 125:
YY_RULE_SETUP
-#line 317 "glsl_lexer.lpp"
+#line 319 "glsl_lexer.lpp"
{
yylval->real = glsl_strtod(yytext, NULL);
return FLOATCONSTANT;
@@ -2114,7 +2116,7 @@ YY_RULE_SETUP
YY_BREAK
case 126:
YY_RULE_SETUP
-#line 322 "glsl_lexer.lpp"
+#line 324 "glsl_lexer.lpp"
{
yylval->n = 1;
return BOOLCONSTANT;
@@ -2122,7 +2124,7 @@ YY_RULE_SETUP
YY_BREAK
case 127:
YY_RULE_SETUP
-#line 326 "glsl_lexer.lpp"
+#line 328 "glsl_lexer.lpp"
{
yylval->n = 0;
return BOOLCONSTANT;
@@ -2131,427 +2133,427 @@ YY_RULE_SETUP
/* Reserved words in GLSL 1.10. */
case 128:
YY_RULE_SETUP
-#line 333 "glsl_lexer.lpp"
+#line 335 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, ASM);
YY_BREAK
case 129:
YY_RULE_SETUP
-#line 334 "glsl_lexer.lpp"
+#line 336 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, CLASS);
YY_BREAK
case 130:
YY_RULE_SETUP
-#line 335 "glsl_lexer.lpp"
+#line 337 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, UNION);
YY_BREAK
case 131:
YY_RULE_SETUP
-#line 336 "glsl_lexer.lpp"
+#line 338 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, ENUM);
YY_BREAK
case 132:
YY_RULE_SETUP
-#line 337 "glsl_lexer.lpp"
+#line 339 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, TYPEDEF);
YY_BREAK
case 133:
YY_RULE_SETUP
-#line 338 "glsl_lexer.lpp"
+#line 340 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, TEMPLATE);
YY_BREAK
case 134:
YY_RULE_SETUP
-#line 339 "glsl_lexer.lpp"
+#line 341 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, THIS);
YY_BREAK
case 135:
YY_RULE_SETUP
-#line 340 "glsl_lexer.lpp"
+#line 342 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, PACKED_TOK);
YY_BREAK
case 136:
YY_RULE_SETUP
-#line 341 "glsl_lexer.lpp"
+#line 343 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, GOTO);
YY_BREAK
case 137:
YY_RULE_SETUP
-#line 342 "glsl_lexer.lpp"
+#line 344 "glsl_lexer.lpp"
KEYWORD(110 || ES, 130, SWITCH);
YY_BREAK
case 138:
YY_RULE_SETUP
-#line 343 "glsl_lexer.lpp"
+#line 345 "glsl_lexer.lpp"
KEYWORD(110 || ES, 130, DEFAULT);
YY_BREAK
case 139:
YY_RULE_SETUP
-#line 344 "glsl_lexer.lpp"
+#line 346 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, INLINE_TOK);
YY_BREAK
case 140:
YY_RULE_SETUP
-#line 345 "glsl_lexer.lpp"
+#line 347 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, NOINLINE);
YY_BREAK
case 141:
YY_RULE_SETUP
-#line 346 "glsl_lexer.lpp"
+#line 348 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, VOLATILE);
YY_BREAK
case 142:
YY_RULE_SETUP
-#line 347 "glsl_lexer.lpp"
+#line 349 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, PUBLIC_TOK);
YY_BREAK
case 143:
YY_RULE_SETUP
-#line 348 "glsl_lexer.lpp"
+#line 350 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, STATIC);
YY_BREAK
case 144:
YY_RULE_SETUP
-#line 349 "glsl_lexer.lpp"
+#line 351 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, EXTERN);
YY_BREAK
case 145:
YY_RULE_SETUP
-#line 350 "glsl_lexer.lpp"
+#line 352 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, EXTERNAL);
YY_BREAK
case 146:
YY_RULE_SETUP
-#line 351 "glsl_lexer.lpp"
+#line 353 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, INTERFACE);
YY_BREAK
case 147:
YY_RULE_SETUP
-#line 352 "glsl_lexer.lpp"
+#line 354 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, LONG_TOK);
YY_BREAK
case 148:
YY_RULE_SETUP
-#line 353 "glsl_lexer.lpp"
+#line 355 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, SHORT_TOK);
YY_BREAK
case 149:
YY_RULE_SETUP
-#line 354 "glsl_lexer.lpp"
+#line 356 "glsl_lexer.lpp"
KEYWORD(110 || ES, 400, DOUBLE_TOK);
YY_BREAK
case 150:
YY_RULE_SETUP
-#line 355 "glsl_lexer.lpp"
+#line 357 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, HALF);
YY_BREAK
case 151:
YY_RULE_SETUP
-#line 356 "glsl_lexer.lpp"
+#line 358 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, FIXED_TOK);
YY_BREAK
case 152:
YY_RULE_SETUP
-#line 357 "glsl_lexer.lpp"
+#line 359 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, UNSIGNED);
YY_BREAK
case 153:
YY_RULE_SETUP
-#line 358 "glsl_lexer.lpp"
+#line 360 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, INPUT_TOK);
YY_BREAK
case 154:
YY_RULE_SETUP
-#line 359 "glsl_lexer.lpp"
+#line 361 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, OUTPUT);
YY_BREAK
case 155:
YY_RULE_SETUP
-#line 360 "glsl_lexer.lpp"
+#line 362 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, HVEC2);
YY_BREAK
case 156:
YY_RULE_SETUP
-#line 361 "glsl_lexer.lpp"
+#line 363 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, HVEC3);
YY_BREAK
case 157:
YY_RULE_SETUP
-#line 362 "glsl_lexer.lpp"
+#line 364 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, HVEC4);
YY_BREAK
case 158:
YY_RULE_SETUP
-#line 363 "glsl_lexer.lpp"
+#line 365 "glsl_lexer.lpp"
KEYWORD(110 || ES, 400, DVEC2);
YY_BREAK
case 159:
YY_RULE_SETUP
-#line 364 "glsl_lexer.lpp"
+#line 366 "glsl_lexer.lpp"
KEYWORD(110 || ES, 400, DVEC3);
YY_BREAK
case 160:
YY_RULE_SETUP
-#line 365 "glsl_lexer.lpp"
+#line 367 "glsl_lexer.lpp"
KEYWORD(110 || ES, 400, DVEC4);
YY_BREAK
case 161:
YY_RULE_SETUP
-#line 366 "glsl_lexer.lpp"
+#line 368 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, FVEC2);
YY_BREAK
case 162:
YY_RULE_SETUP
-#line 367 "glsl_lexer.lpp"
+#line 369 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, FVEC3);
YY_BREAK
case 163:
YY_RULE_SETUP
-#line 368 "glsl_lexer.lpp"
+#line 370 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, FVEC4);
YY_BREAK
case 164:
YY_RULE_SETUP
-#line 369 "glsl_lexer.lpp"
+#line 371 "glsl_lexer.lpp"
return SAMPLER2DRECT;
YY_BREAK
case 165:
YY_RULE_SETUP
-#line 370 "glsl_lexer.lpp"
+#line 372 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, SAMPLER3DRECT);
YY_BREAK
case 166:
YY_RULE_SETUP
-#line 371 "glsl_lexer.lpp"
+#line 373 "glsl_lexer.lpp"
return SAMPLER2DRECTSHADOW;
YY_BREAK
case 167:
YY_RULE_SETUP
-#line 372 "glsl_lexer.lpp"
+#line 374 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, SIZEOF);
YY_BREAK
case 168:
YY_RULE_SETUP
-#line 373 "glsl_lexer.lpp"
+#line 375 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, CAST);
YY_BREAK
case 169:
YY_RULE_SETUP
-#line 374 "glsl_lexer.lpp"
+#line 376 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, NAMESPACE);
YY_BREAK
case 170:
YY_RULE_SETUP
-#line 375 "glsl_lexer.lpp"
+#line 377 "glsl_lexer.lpp"
KEYWORD(110 || ES, 999, USING);
YY_BREAK
/* Additional reserved words in GLSL 1.20. */
case 171:
YY_RULE_SETUP
-#line 378 "glsl_lexer.lpp"
+#line 380 "glsl_lexer.lpp"
KEYWORD(120, 130 || ES, LOWP);
YY_BREAK
case 172:
YY_RULE_SETUP
-#line 379 "glsl_lexer.lpp"
+#line 381 "glsl_lexer.lpp"
KEYWORD(120, 130 || ES, MEDIUMP);
YY_BREAK
case 173:
YY_RULE_SETUP
-#line 380 "glsl_lexer.lpp"
+#line 382 "glsl_lexer.lpp"
KEYWORD(120, 130 || ES, HIGHP);
YY_BREAK
case 174:
YY_RULE_SETUP
-#line 381 "glsl_lexer.lpp"
+#line 383 "glsl_lexer.lpp"
KEYWORD(120, 130 || ES, PRECISION);
YY_BREAK
/* Additional reserved words in GLSL 1.30. */
case 175:
YY_RULE_SETUP
-#line 384 "glsl_lexer.lpp"
+#line 386 "glsl_lexer.lpp"
KEYWORD(130, 130, CASE);
YY_BREAK
case 176:
YY_RULE_SETUP
-#line 385 "glsl_lexer.lpp"
+#line 387 "glsl_lexer.lpp"
KEYWORD(130, 999, COMMON);
YY_BREAK
case 177:
YY_RULE_SETUP
-#line 386 "glsl_lexer.lpp"
+#line 388 "glsl_lexer.lpp"
KEYWORD(130, 999, PARTITION);
YY_BREAK
case 178:
YY_RULE_SETUP
-#line 387 "glsl_lexer.lpp"
+#line 389 "glsl_lexer.lpp"
KEYWORD(130, 999, ACTIVE);
YY_BREAK
case 179:
YY_RULE_SETUP
-#line 388 "glsl_lexer.lpp"
+#line 390 "glsl_lexer.lpp"
KEYWORD(130 || ES, 999, SUPERP);
YY_BREAK
case 180:
YY_RULE_SETUP
-#line 389 "glsl_lexer.lpp"
+#line 391 "glsl_lexer.lpp"
KEYWORD(130, 140, SAMPLERBUFFER);
YY_BREAK
case 181:
YY_RULE_SETUP
-#line 390 "glsl_lexer.lpp"
+#line 392 "glsl_lexer.lpp"
KEYWORD(130, 999, FILTER);
YY_BREAK
case 182:
YY_RULE_SETUP
-#line 391 "glsl_lexer.lpp"
+#line 393 "glsl_lexer.lpp"
KEYWORD(130, 999, IMAGE1D);
YY_BREAK
case 183:
YY_RULE_SETUP
-#line 392 "glsl_lexer.lpp"
+#line 394 "glsl_lexer.lpp"
KEYWORD(130, 999, IMAGE2D);
YY_BREAK
case 184:
YY_RULE_SETUP
-#line 393 "glsl_lexer.lpp"
+#line 395 "glsl_lexer.lpp"
KEYWORD(130, 999, IMAGE3D);
YY_BREAK
case 185:
YY_RULE_SETUP
-#line 394 "glsl_lexer.lpp"
+#line 396 "glsl_lexer.lpp"
KEYWORD(130, 999, IMAGECUBE);
YY_BREAK
case 186:
YY_RULE_SETUP
-#line 395 "glsl_lexer.lpp"
+#line 397 "glsl_lexer.lpp"
KEYWORD(130, 999, IIMAGE1D);
YY_BREAK
case 187:
YY_RULE_SETUP
-#line 396 "glsl_lexer.lpp"
+#line 398 "glsl_lexer.lpp"
KEYWORD(130, 999, IIMAGE2D);
YY_BREAK
case 188:
YY_RULE_SETUP
-#line 397 "glsl_lexer.lpp"
+#line 399 "glsl_lexer.lpp"
KEYWORD(130, 999, IIMAGE3D);
YY_BREAK
case 189:
YY_RULE_SETUP
-#line 398 "glsl_lexer.lpp"
+#line 400 "glsl_lexer.lpp"
KEYWORD(130, 999, IIMAGECUBE);
YY_BREAK
case 190:
YY_RULE_SETUP
-#line 399 "glsl_lexer.lpp"
+#line 401 "glsl_lexer.lpp"
KEYWORD(130, 999, UIMAGE1D);
YY_BREAK
case 191:
YY_RULE_SETUP
-#line 400 "glsl_lexer.lpp"
+#line 402 "glsl_lexer.lpp"
KEYWORD(130, 999, UIMAGE2D);
YY_BREAK
case 192:
YY_RULE_SETUP
-#line 401 "glsl_lexer.lpp"
+#line 403 "glsl_lexer.lpp"
KEYWORD(130, 999, UIMAGE3D);
YY_BREAK
case 193:
YY_RULE_SETUP
-#line 402 "glsl_lexer.lpp"
+#line 404 "glsl_lexer.lpp"
KEYWORD(130, 999, UIMAGECUBE);
YY_BREAK
case 194:
YY_RULE_SETUP
-#line 403 "glsl_lexer.lpp"
+#line 405 "glsl_lexer.lpp"
KEYWORD(130, 999, IMAGE1DARRAY);
YY_BREAK
case 195:
YY_RULE_SETUP
-#line 404 "glsl_lexer.lpp"
+#line 406 "glsl_lexer.lpp"
KEYWORD(130, 999, IMAGE2DARRAY);
YY_BREAK
case 196:
YY_RULE_SETUP
-#line 405 "glsl_lexer.lpp"
+#line 407 "glsl_lexer.lpp"
KEYWORD(130, 999, IIMAGE1DARRAY);
YY_BREAK
case 197:
YY_RULE_SETUP
-#line 406 "glsl_lexer.lpp"
+#line 408 "glsl_lexer.lpp"
KEYWORD(130, 999, IIMAGE2DARRAY);
YY_BREAK
case 198:
YY_RULE_SETUP
-#line 407 "glsl_lexer.lpp"
+#line 409 "glsl_lexer.lpp"
KEYWORD(130, 999, UIMAGE1DARRAY);
YY_BREAK
case 199:
YY_RULE_SETUP
-#line 408 "glsl_lexer.lpp"
+#line 410 "glsl_lexer.lpp"
KEYWORD(130, 999, UIMAGE2DARRAY);
YY_BREAK
case 200:
YY_RULE_SETUP
-#line 409 "glsl_lexer.lpp"
+#line 411 "glsl_lexer.lpp"
KEYWORD(130, 999, IMAGE1DSHADOW);
YY_BREAK
case 201:
YY_RULE_SETUP
-#line 410 "glsl_lexer.lpp"
+#line 412 "glsl_lexer.lpp"
KEYWORD(130, 999, IMAGE2DSHADOW);
YY_BREAK
case 202:
YY_RULE_SETUP
-#line 411 "glsl_lexer.lpp"
+#line 413 "glsl_lexer.lpp"
KEYWORD(130, 999, IMAGE1DARRAYSHADOW);
YY_BREAK
case 203:
YY_RULE_SETUP
-#line 412 "glsl_lexer.lpp"
+#line 414 "glsl_lexer.lpp"
KEYWORD(130, 999, IMAGE2DARRAYSHADOW);
YY_BREAK
case 204:
YY_RULE_SETUP
-#line 413 "glsl_lexer.lpp"
+#line 415 "glsl_lexer.lpp"
KEYWORD(130, 999, IMAGEBUFFER);
YY_BREAK
case 205:
YY_RULE_SETUP
-#line 414 "glsl_lexer.lpp"
+#line 416 "glsl_lexer.lpp"
KEYWORD(130, 999, IIMAGEBUFFER);
YY_BREAK
case 206:
YY_RULE_SETUP
-#line 415 "glsl_lexer.lpp"
+#line 417 "glsl_lexer.lpp"
KEYWORD(130, 999, UIMAGEBUFFER);
YY_BREAK
case 207:
YY_RULE_SETUP
-#line 416 "glsl_lexer.lpp"
+#line 418 "glsl_lexer.lpp"
KEYWORD(130, 999, ROW_MAJOR);
YY_BREAK
case 208:
YY_RULE_SETUP
-#line 418 "glsl_lexer.lpp"
+#line 420 "glsl_lexer.lpp"
{
struct _mesa_glsl_parse_state *state = yyextra;
void *ctx = state;
yylval->identifier = ralloc_strdup(ctx, yytext);
- return IDENTIFIER;
+ return classify_identifier(state, yytext);
}
YY_BREAK
case 209:
YY_RULE_SETUP
-#line 425 "glsl_lexer.lpp"
+#line 427 "glsl_lexer.lpp"
{ return yytext[0]; }
YY_BREAK
case 210:
YY_RULE_SETUP
-#line 427 "glsl_lexer.lpp"
+#line 429 "glsl_lexer.lpp"
ECHO;
YY_BREAK
-#line 2555 "glsl_lexer.cpp"
+#line 2557 "glsl_lexer.cpp"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(PP):
case YY_STATE_EOF(PRAGMA):
@@ -3694,9 +3696,20 @@ void _mesa_glsl_free (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables"
-#line 427 "glsl_lexer.lpp"
+#line 429 "glsl_lexer.lpp"
+
+int
+classify_identifier(struct _mesa_glsl_parse_state *state, const char *name)
+{
+ if (state->symbols->get_variable(name) || state->symbols->get_function(name))
+ return IDENTIFIER;
+ else if (state->symbols->get_type(name))
+ return TYPE_IDENTIFIER;
+ else
+ return NEW_IDENTIFIER;
+}
void
_mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state, const char *string)