Lines Matching refs:context

76 static int ES2_reserved_ES3_keyword(TParseContext *context, int token);
77 static int ES2_keyword_ES3_reserved(TParseContext *context, int token);
78 static int ES2_identifier_ES3_keyword(TParseContext *context, int token);
79 static int uint_constant(TParseContext *context);
82 static int floatsuffix_check(TParseContext* context);
100 TParseContext* context = yyextra; variable
118 "attribute" { return ES2_keyword_ES3_reserved(context, ATTRIBUTE); }
121 "varying" { return ES2_keyword_ES3_reserved(context, VARYING); }
131 "switch" { return ES2_reserved_ES3_keyword(context, SWITCH); }
132 "case" { return ES2_reserved_ES3_keyword(context, CASE); }
133 "default" { return ES2_reserved_ES3_keyword(context, DEFAULT); }
135 "centroid" { return ES2_reserved_ES3_keyword(context, CENTROID); }
136 "flat" { return ES2_reserved_ES3_keyword(context, FLAT); }
137 "smooth" { return ES2_reserved_ES3_keyword(context, SMOOTH); }
143 "float" { context->lexAfterType = true; return(FLOAT_TYPE); }
144 "int" { context->lexAfterType = true; return(INT_TYPE); }
145 "uint" { return ES2_identifier_ES3_keyword(context, UINT_TYPE); }
146 "void" { context->lexAfterType = true; return(VOID_TYPE); }
147 "bool" { context->lexAfterType = true; return(BOOL_TYPE); }
154 "mat2" { context->lexAfterType = true; return(MATRIX2); }
155 "mat3" { context->lexAfterType = true; return(MATRIX3); }
156 "mat4" { context->lexAfterType = true; return(MATRIX4); }
158 "mat2x2" { return ES2_identifier_ES3_keyword(context, MATRIX2); }
159 "mat3x3" { return ES2_identifier_ES3_keyword(context, MATRIX3); }
160 "mat4x4" { return ES2_identifier_ES3_keyword(context, MATRIX4); }
162 "mat2x3" { return ES2_identifier_ES3_keyword(context, MATRIX2x3); }
163 "mat3x2" { return ES2_identifier_ES3_keyword(context, MATRIX3x2); }
164 "mat2x4" { return ES2_identifier_ES3_keyword(context, MATRIX2x4); }
165 "mat4x2" { return ES2_identifier_ES3_keyword(context, MATRIX4x2); }
166 "mat3x4" { return ES2_identifier_ES3_keyword(context, MATRIX3x4); }
167 "mat4x3" { return ES2_identifier_ES3_keyword(context, MATRIX4x3); }
169 "vec2" { context->lexAfterType = true; return (VEC2); }
170 "vec3" { context->lexAfterType = true; return (VEC3); }
171 "vec4" { context->lexAfterType = true; return (VEC4); }
172 "ivec2" { context->lexAfterType = true; return (IVEC2); }
173 "ivec3" { context->lexAfterType = true; return (IVEC3); }
174 "ivec4" { context->lexAfterType = true; return (IVEC4); }
175 "uvec2" { return ES2_identifier_ES3_keyword(context, UVEC2); }
176 "uvec3" { return ES2_identifier_ES3_keyword(context, UVEC3); }
177 "uvec4" { return ES2_identifier_ES3_keyword(context, UVEC4); }
178 "bvec2" { context->lexAfterType = true; return (BVEC2); }
179 "bvec3" { context->lexAfterType = true; return (BVEC3); }
180 "bvec4" { context->lexAfterType = true; return (BVEC4); }
182 "sampler2D" { context->lexAfterType = true; return SAMPLER2D; }
183 "samplerCube" { context->lexAfterType = true; return SAMPLERCUBE; }
184 "samplerExternalOES" { context->lexAfterType = true; return SAMPLER_EXTERNAL_OES; }
185 "sampler3D" { context->lexAfterType = true; return SAMPLER3D; }
186 "sampler3DRect" { return ES2_reserved_ES3_keyword(context, SAMPLER3DRECT); }
187 "sampler2DArray" { return ES2_identifier_ES3_keyword(context, SAMPLER2DARRAY); }
188 "isampler2D" { return ES2_identifier_ES3_keyword(context, ISAMPLER2D); }
189 "isampler3D" { return ES2_identifier_ES3_keyword(context, ISAMPLER3D); }
190 "isamplerCube" { return ES2_identifier_ES3_keyword(context, ISAMPLERCUBE); }
191 "isampler2DArray" { return ES2_identifier_ES3_keyword(context, ISAMPLER2DARRAY); }
192 "usampler2D" { return ES2_identifier_ES3_keyword(context, USAMPLER2D); }
193 "usampler3D" { return ES2_identifier_ES3_keyword(context, USAMPLER3D); }
194 "usamplerCube" { return ES2_identifier_ES3_keyword(context, USAMPLERCUBE); }
195 "usampler2DArray" { return ES2_identifier_ES3_keyword(context, USAMPLER2DARRAY); }
196 "sampler2DShadow" { return ES2_reserved_ES3_keyword(context, SAMPLER2DSHADOW); }
197 "samplerCubeShadow" { return ES2_identifier_ES3_keyword(context, SAMPLERCUBESHADOW); }
198 "sampler2DArrayShadow" { return ES2_identifier_ES3_keyword(context, SAMPLER2DARRAYSHADOW); }
200 "struct" { context->lexAfterType = true; return(STRUCT); }
202 "layout" { return ES2_identifier_ES3_keyword(context, LAYOUT); }
263 if (context->getShaderVersion() < 300) {
272 if (context->getShaderVersion() >= 300)
343 0[xX]{H}+[uU] { return uint_constant(context); }
344 0{O}+[uU] { return uint_constant(context); }
345 {D}+[uU] { return uint_constant(context); }
351 {D}+{E}[fF] { return floatsuffix_check(context); }
352 {D}+"."{D}*({E})?[fF] { return floatsuffix_check(context); }
353 "."{D}+({E})?[fF] { return floatsuffix_check(context); }
377 ";" { context->lexAfterType = false; return(SEMICOLON); }
378 ("{"|"<%") { context->lexAfterType = false; return(LEFT_BRACE); }
380 "," { if (context->inTypeParen) context->lexAfterType = false; return(COMMA); }
382 "=" { context->lexAfterType = false; return(EQUAL); }
383 "(" { context->lexAfterType = false; context->inTypeParen = true; return(LEFT_PAREN); }
384 ")" { context->inTypeParen = false; return(RIGHT_PAREN); }
410 <*><<EOF>> { context->AfterEOF = true; yyterminate(); }
411 <*>. { context->warning(*yylloc, "Unknown char", yytext, ""); return 0; }
455 int ES2_reserved_ES3_keyword(TParseContext *context, int token) in ES2_reserved_ES3_keyword() argument
457 yyscan_t yyscanner = (yyscan_t) context->getScanner(); in ES2_reserved_ES3_keyword()
459 if (context->getShaderVersion() < 300) in ES2_reserved_ES3_keyword()
467 int ES2_keyword_ES3_reserved(TParseContext *context, int token) in ES2_keyword_ES3_reserved() argument
469 yyscan_t yyscanner = (yyscan_t) context->getScanner(); in ES2_keyword_ES3_reserved()
471 if (context->getShaderVersion() >= 300) in ES2_keyword_ES3_reserved()
479 int ES2_identifier_ES3_keyword(TParseContext *context, int token) in ES2_identifier_ES3_keyword() argument
481 struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner(); in ES2_identifier_ES3_keyword()
482 yyscan_t yyscanner = (yyscan_t) context->getScanner(); in ES2_identifier_ES3_keyword()
485 if (context->getShaderVersion() < 300) in ES2_identifier_ES3_keyword()
494 int uint_constant(TParseContext *context) in uint_constant() argument
496 struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner(); in uint_constant()
497 yyscan_t yyscanner = (yyscan_t) context->getScanner(); in uint_constant()
499 if (context->getShaderVersion() < 300) in uint_constant()
501context->error(*yylloc, "Unsigned integers are unsupported prior to GLSL ES 3.00", yytext, ""); in uint_constant()
502 context->recover(); in uint_constant()
512 int floatsuffix_check(TParseContext* context) in floatsuffix_check() argument
514 struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner(); in floatsuffix_check()
516 if (context->getShaderVersion() < 300) in floatsuffix_check()
518 context->error(*yylloc, "Floating-point suffix unsupported prior to GLSL ES 3.00", yytext); in floatsuffix_check()
519 context->recover(); in floatsuffix_check()
545 void yyerror(YYLTYPE* lloc, TParseContext* context, void* scanner, const char* reason) { in yyerror() argument
548 if (context->AfterEOF) { in yyerror()
549 context->error(*lloc, reason, "unexpected EOF"); in yyerror()
551 context->error(*lloc, reason, yytext); in yyerror()
553 context->recover(); in yyerror()
556 int glslang_initialize(TParseContext* context) { in glslang_initialize() argument
558 if (yylex_init_extra(context, &scanner)) in glslang_initialize()
561 context->setScanner(scanner); in glslang_initialize()
565 int glslang_finalize(TParseContext* context) { in glslang_finalize() argument
566 yyscan_t scanner = context->getScanner(); in glslang_finalize()
569 context->setScanner(NULL); in glslang_finalize()
576 TParseContext* context) { in glslang_scan() argument
577 yyrestart(NULL, context->getScanner()); in glslang_scan()
578 yyset_column(0, context->getScanner()); in glslang_scan()
579 yyset_lineno(1, context->getScanner()); in glslang_scan()
580 context->AfterEOF = false; in glslang_scan()
583 if (!context->getPreprocessor().init(count, string, length)) in glslang_scan()
587 const TExtensionBehavior& extBehavior = context->extensionBehavior(); in glslang_scan()
591 context->getPreprocessor().predefineMacro(iter->first.c_str(), 1); in glslang_scan()
594 context->getPreprocessor().predefineMacro("GL_FRAGMENT_PRECISION_HIGH", 1); in glslang_scan()