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);
99 TParseContext* context = yyextra; variable
108 "attribute" { return ES2_keyword_ES3_reserved(context, ATTRIBUTE); }
111 "varying" { return ES2_keyword_ES3_reserved(context, VARYING); }
121 "switch" { return ES2_reserved_ES3_keyword(context, SWITCH); }
122 "case" { return ES2_reserved_ES3_keyword(context, CASE); }
123 "default" { return ES2_reserved_ES3_keyword(context, DEFAULT); }
125 "centroid" { return ES2_reserved_ES3_keyword(context, CENTROID); }
126 "flat" { return ES2_reserved_ES3_keyword(context, FLAT); }
127 "smooth" { return ES2_reserved_ES3_keyword(context, SMOOTH); }
133 "float" { context->lexAfterType = true; return(FLOAT_TYPE); }
134 "int" { context->lexAfterType = true; return(INT_TYPE); }
135 "uint" { return ES2_identifier_ES3_keyword(context, UINT_TYPE); }
136 "void" { context->lexAfterType = true; return(VOID_TYPE); }
137 "bool" { context->lexAfterType = true; return(BOOL_TYPE); }
144 "mat2" { context->lexAfterType = true; return(MATRIX2); }
145 "mat3" { context->lexAfterType = true; return(MATRIX3); }
146 "mat4" { context->lexAfterType = true; return(MATRIX4); }
148 "mat2x2" { return ES2_identifier_ES3_keyword(context, MATRIX2); }
149 "mat3x3" { return ES2_identifier_ES3_keyword(context, MATRIX3); }
150 "mat4x4" { return ES2_identifier_ES3_keyword(context, MATRIX4); }
152 "mat2x3" { return ES2_identifier_ES3_keyword(context, MATRIX2x3); }
153 "mat3x2" { return ES2_identifier_ES3_keyword(context, MATRIX3x2); }
154 "mat2x4" { return ES2_identifier_ES3_keyword(context, MATRIX2x4); }
155 "mat4x2" { return ES2_identifier_ES3_keyword(context, MATRIX4x2); }
156 "mat3x4" { return ES2_identifier_ES3_keyword(context, MATRIX3x4); }
157 "mat4x3" { return ES2_identifier_ES3_keyword(context, MATRIX4x3); }
159 "vec2" { context->lexAfterType = true; return (VEC2); }
160 "vec3" { context->lexAfterType = true; return (VEC3); }
161 "vec4" { context->lexAfterType = true; return (VEC4); }
162 "ivec2" { context->lexAfterType = true; return (IVEC2); }
163 "ivec3" { context->lexAfterType = true; return (IVEC3); }
164 "ivec4" { context->lexAfterType = true; return (IVEC4); }
165 "uvec2" { return ES2_identifier_ES3_keyword(context, UVEC2); }
166 "uvec3" { return ES2_identifier_ES3_keyword(context, UVEC3); }
167 "uvec4" { return ES2_identifier_ES3_keyword(context, UVEC4); }
168 "bvec2" { context->lexAfterType = true; return (BVEC2); }
169 "bvec3" { context->lexAfterType = true; return (BVEC3); }
170 "bvec4" { context->lexAfterType = true; return (BVEC4); }
172 "sampler2D" { context->lexAfterType = true; return SAMPLER2D; }
173 "samplerCube" { context->lexAfterType = true; return SAMPLERCUBE; }
174 "sampler2DRect" { context->lexAfterType = true; return SAMPLER2DRECT; }
175 "samplerExternalOES" { context->lexAfterType = true; return SAMPLER_EXTERNAL_OES; }
176 "sampler3D" { context->lexAfterType = true; return SAMPLER3D; }
177 "sampler3DRect" { return ES2_reserved_ES3_keyword(context, SAMPLER3DRECT); }
178 "sampler2DArray" { return ES2_identifier_ES3_keyword(context, SAMPLER2DARRAY); }
179 "isampler2D" { return ES2_identifier_ES3_keyword(context, ISAMPLER2D); }
180 "isampler3D" { return ES2_identifier_ES3_keyword(context, ISAMPLER3D); }
181 "isamplerCube" { return ES2_identifier_ES3_keyword(context, ISAMPLERCUBE); }
182 "isampler2DArray" { return ES2_identifier_ES3_keyword(context, ISAMPLER2DARRAY); }
183 "usampler2D" { return ES2_identifier_ES3_keyword(context, USAMPLER2D); }
184 "usampler3D" { return ES2_identifier_ES3_keyword(context, USAMPLER3D); }
185 "usamplerCube" { return ES2_identifier_ES3_keyword(context, USAMPLERCUBE); }
186 "usampler2DArray" { return ES2_identifier_ES3_keyword(context, USAMPLER2DARRAY); }
187 "sampler2DShadow" { return ES2_reserved_ES3_keyword(context, SAMPLER2DSHADOW); }
188 "samplerCubeShadow" { return ES2_identifier_ES3_keyword(context, SAMPLERCUBESHADOW); }
189 "sampler2DArrayShadow" { return ES2_identifier_ES3_keyword(context, SAMPLER2DARRAYSHADOW); }
191 "struct" { context->lexAfterType = true; return(STRUCT); }
193 "layout" { return ES2_identifier_ES3_keyword(context, LAYOUT); }
254 if (context->getShaderVersion() < 300) {
263 if (context->getShaderVersion() >= 300)
333 0[xX]{H}+[uU] { return uint_constant(context); }
334 0{O}+[uU] { return uint_constant(context); }
335 {D}+[uU] { return uint_constant(context); }
341 {D}+{E}[fF] { return floatsuffix_check(context); }
342 {D}+"."{D}*({E})?[fF] { return floatsuffix_check(context); }
343 "."{D}+({E})?[fF] { return floatsuffix_check(context); }
367 ";" { context->lexAfterType = false; return(SEMICOLON); }
368 ("{"|"<%") { context->lexAfterType = false; return(LEFT_BRACE); }
370 "," { if (context->inTypeParen) context->lexAfterType = false; return(COMMA); }
372 "=" { context->lexAfterType = false; return(EQUAL); }
373 "(" { context->lexAfterType = false; context->inTypeParen = true; return(LEFT_PAREN); }
374 ")" { context->inTypeParen = false; return(RIGHT_PAREN); }
400 <*><<EOF>> { context->AfterEOF = true; yyterminate(); }
401 <*>. { context->warning(*yylloc, "Unknown char", yytext, ""); return 0; }
445 int ES2_reserved_ES3_keyword(TParseContext *context, int token) in ES2_reserved_ES3_keyword() argument
447 yyscan_t yyscanner = (yyscan_t) context->getScanner(); in ES2_reserved_ES3_keyword()
449 if (context->getShaderVersion() < 300) in ES2_reserved_ES3_keyword()
457 int ES2_keyword_ES3_reserved(TParseContext *context, int token) in ES2_keyword_ES3_reserved() argument
459 yyscan_t yyscanner = (yyscan_t) context->getScanner(); in ES2_keyword_ES3_reserved()
461 if (context->getShaderVersion() >= 300) in ES2_keyword_ES3_reserved()
469 int ES2_identifier_ES3_keyword(TParseContext *context, int token) in ES2_identifier_ES3_keyword() argument
471 struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner(); in ES2_identifier_ES3_keyword()
472 yyscan_t yyscanner = (yyscan_t) context->getScanner(); in ES2_identifier_ES3_keyword()
475 if (context->getShaderVersion() < 300) in ES2_identifier_ES3_keyword()
484 int uint_constant(TParseContext *context) in uint_constant() argument
486 struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner(); in uint_constant()
488 if (context->getShaderVersion() < 300) in uint_constant()
490context->error(*yylloc, "Unsigned integers are unsupported prior to GLSL ES 3.00", yytext, ""); in uint_constant()
491 context->recover(); in uint_constant()
501 int floatsuffix_check(TParseContext* context) in floatsuffix_check() argument
503 struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner(); in floatsuffix_check()
505 if (context->getShaderVersion() < 300) in floatsuffix_check()
507 context->error(*yylloc, "Floating-point suffix unsupported prior to GLSL ES 3.00", yytext); in floatsuffix_check()
508 context->recover(); in floatsuffix_check()
534 void yyerror(YYLTYPE* lloc, TParseContext* context, void* scanner, const char* reason) { in yyerror() argument
537 if (context->AfterEOF) { in yyerror()
538 context->error(*lloc, reason, "unexpected EOF"); in yyerror()
540 context->error(*lloc, reason, yytext); in yyerror()
542 context->recover(); in yyerror()
545 int glslang_initialize(TParseContext* context) { in glslang_initialize() argument
547 if (yylex_init_extra(context, &scanner)) in glslang_initialize()
550 context->setScanner(scanner); in glslang_initialize()
554 int glslang_finalize(TParseContext* context) { in glslang_finalize() argument
555 yyscan_t scanner = context->getScanner(); in glslang_finalize()
558 context->setScanner(NULL); in glslang_finalize()
565 TParseContext* context) { in glslang_scan() argument
566 yyrestart(NULL, context->getScanner()); in glslang_scan()
567 yyset_column(0, context->getScanner()); in glslang_scan()
568 yyset_lineno(1, context->getScanner()); in glslang_scan()
569 context->AfterEOF = false; in glslang_scan()
572 if (!context->getPreprocessor().init(count, string, length)) in glslang_scan()
576 const TExtensionBehavior& extBehavior = context->extensionBehavior(); in glslang_scan()
580 context->getPreprocessor().predefineMacro(iter->first.c_str(), 1); in glslang_scan()
583 context->getPreprocessor().predefineMacro("GL_FRAGMENT_PRECISION_HIGH", 1); in glslang_scan()