Lines Matching refs:cur

42 static boolean is_alpha_underscore( const char *cur )  in is_alpha_underscore()  argument
45 (*cur >= 'a' && *cur <= 'z') || in is_alpha_underscore()
46 (*cur >= 'A' && *cur <= 'Z') || in is_alpha_underscore()
47 *cur == '_'; in is_alpha_underscore()
50 static boolean is_digit( const char *cur ) in is_digit() argument
52 return *cur >= '0' && *cur <= '9'; in is_digit()
55 static boolean is_digit_alpha_underscore( const char *cur ) in is_digit_alpha_underscore() argument
57 return is_digit( cur ) || is_alpha_underscore( cur ); in is_digit_alpha_underscore()
91 const char *cur = *pcur; in str_match_no_case() local
93 while (*str != '\0' && *str == uprcase( *cur )) { in str_match_no_case()
95 cur++; in str_match_no_case()
98 *pcur = cur; in str_match_no_case()
112 const char *cur = *pcur; in str_match_nocase_whole() local
114 if (str_match_no_case(&cur, str) && in str_match_nocase_whole()
115 !is_digit_alpha_underscore(cur)) { in str_match_nocase_whole()
116 *pcur = cur; in str_match_nocase_whole()
135 const char *cur = *pcur; in eat_white() local
138 return *pcur > cur; in eat_white()
146 const char *cur = *pcur; in parse_uint() local
148 if (is_digit( cur )) { in parse_uint()
149 *val = *cur++ - '0'; in parse_uint()
150 while (is_digit( cur )) in parse_uint()
151 *val = *val * 10 + *cur++ - '0'; in parse_uint()
152 *pcur = cur; in parse_uint()
160 const char *cur = *pcur; in parse_int() local
161 int sign = (*cur == '-' ? -1 : 1); in parse_int()
163 if (*cur == '+' || *cur == '-') in parse_int()
164 cur++; in parse_int()
166 if (parse_uint(&cur, (uint *)val)) { in parse_int()
168 *pcur = cur; in parse_int()
177 const char *cur = *pcur; in parse_identifier() local
179 if (is_alpha_underscore( cur )) { in parse_identifier()
180 ret[i++] = *cur++; in parse_identifier()
181 while (is_alpha_underscore( cur ) || is_digit( cur )) in parse_identifier()
182 ret[i++] = *cur++; in parse_identifier()
184 *pcur = cur; in parse_identifier()
194 const char *cur = *pcur; in parse_float() local
198 *val = (float) atof( cur ); in parse_float()
200 if (*cur == '-' || *cur == '+') in parse_float()
201 cur++; in parse_float()
202 if (is_digit( cur )) { in parse_float()
203 cur++; in parse_float()
205 while (is_digit( cur )) in parse_float()
206 cur++; in parse_float()
208 if (*cur == '.') { in parse_float()
209 cur++; in parse_float()
210 if (is_digit( cur )) { in parse_float()
211 cur++; in parse_float()
213 while (is_digit( cur )) in parse_float()
214 cur++; in parse_float()
219 if (uprcase( *cur ) == 'E') { in parse_float()
220 cur++; in parse_float()
221 if (*cur == '-' || *cur == '+') in parse_float()
222 cur++; in parse_float()
223 if (is_digit( cur )) { in parse_float()
224 cur++; in parse_float()
225 while (is_digit( cur )) in parse_float()
226 cur++; in parse_float()
231 *pcur = cur; in parse_float()
238 const char *cur; member
253 while (itr != ctx->cur) { in report_error()
275 if (str_match_nocase_whole( &ctx->cur, "FRAG" )) in parse_header()
277 else if (str_match_nocase_whole( &ctx->cur, "VERT" )) in parse_header()
279 else if (str_match_nocase_whole( &ctx->cur, "GEOM" )) in parse_header()
281 else if (str_match_nocase_whole( &ctx->cur, "COMP" )) in parse_header()
303 const char *cur = ctx->cur; in parse_label() local
305 if (parse_uint( &cur, val )) { in parse_label()
306 eat_opt_white( &cur ); in parse_label()
307 if (*cur == ':') { in parse_label()
308 cur++; in parse_label()
309 ctx->cur = cur; in parse_label()
322 const char *cur = *pcur; in parse_file() local
324 if (str_match_nocase_whole( &cur, tgsi_file_names[i] )) { in parse_file()
325 *pcur = cur; in parse_file()
338 const char *cur; in parse_opt_writemask() local
340 cur = ctx->cur; in parse_opt_writemask()
341 eat_opt_white( &cur ); in parse_opt_writemask()
342 if (*cur == '.') { in parse_opt_writemask()
343 cur++; in parse_opt_writemask()
345 eat_opt_white( &cur ); in parse_opt_writemask()
346 if (uprcase( *cur ) == 'X') { in parse_opt_writemask()
347 cur++; in parse_opt_writemask()
350 if (uprcase( *cur ) == 'Y') { in parse_opt_writemask()
351 cur++; in parse_opt_writemask()
354 if (uprcase( *cur ) == 'Z') { in parse_opt_writemask()
355 cur++; in parse_opt_writemask()
358 if (uprcase( *cur ) == 'W') { in parse_opt_writemask()
359 cur++; in parse_opt_writemask()
368 ctx->cur = cur; in parse_opt_writemask()
384 if (!parse_file( &ctx->cur, file )) { in parse_register_file_bracket()
388 eat_opt_white( &ctx->cur ); in parse_register_file_bracket()
389 if (*ctx->cur != '[') { in parse_register_file_bracket()
393 ctx->cur++; in parse_register_file_bracket()
409 eat_opt_white( &ctx->cur ); in parse_register_file_bracket_index()
410 if (!parse_uint( &ctx->cur, &uindex )) { in parse_register_file_bracket_index()
428 eat_opt_white( &ctx->cur ); in parse_register_1d()
429 if (*ctx->cur != ']') { in parse_register_1d()
433 ctx->cur++; in parse_register_1d()
451 const char *cur; in parse_register_bracket() local
456 eat_opt_white( &ctx->cur ); in parse_register_bracket()
458 cur = ctx->cur; in parse_register_bracket()
459 if (parse_file( &cur, &brackets->ind_file )) { in parse_register_bracket()
463 eat_opt_white( &ctx->cur ); in parse_register_bracket()
465 if (*ctx->cur == '.') { in parse_register_bracket()
466 ctx->cur++; in parse_register_bracket()
467 eat_opt_white(&ctx->cur); in parse_register_bracket()
469 switch (uprcase(*ctx->cur)) { in parse_register_bracket()
486 ctx->cur++; in parse_register_bracket()
487 eat_opt_white(&ctx->cur); in parse_register_bracket()
490 if (*ctx->cur == '+' || *ctx->cur == '-') in parse_register_bracket()
491 parse_int( &ctx->cur, &brackets->index ); in parse_register_bracket()
496 if (!parse_uint( &ctx->cur, &uindex )) { in parse_register_bracket()
504 eat_opt_white( &ctx->cur ); in parse_register_bracket()
505 if (*ctx->cur != ']') { in parse_register_bracket()
509 ctx->cur++; in parse_register_bracket()
519 const char *cur = ctx->cur; in parse_opt_register_src_bracket() local
523 eat_opt_white( &cur ); in parse_opt_register_src_bracket()
524 if (cur[0] == '[') { in parse_opt_register_src_bracket()
525 ++cur; in parse_opt_register_src_bracket()
526 ctx->cur = cur; in parse_opt_register_src_bracket()
572 eat_opt_white( &ctx->cur ); in parse_register_dcl_bracket()
574 if (!parse_uint( &ctx->cur, &uindex )) { in parse_register_dcl_bracket()
577 if (ctx->cur[0] == ']' && ctx->implied_array_size != 0) { in parse_register_dcl_bracket()
587 eat_opt_white( &ctx->cur ); in parse_register_dcl_bracket()
589 if (ctx->cur[0] == '.' && ctx->cur[1] == '.') { in parse_register_dcl_bracket()
592 ctx->cur += 2; in parse_register_dcl_bracket()
593 eat_opt_white( &ctx->cur ); in parse_register_dcl_bracket()
594 if (!parse_uint( &ctx->cur, &uindex )) { in parse_register_dcl_bracket()
599 eat_opt_white( &ctx->cur ); in parse_register_dcl_bracket()
606 if (*ctx->cur != ']') { in parse_register_dcl_bracket()
610 ctx->cur++; in parse_register_dcl_bracket()
625 const char *cur; in parse_register_dcl() local
636 cur = ctx->cur; in parse_register_dcl()
637 eat_opt_white( &cur ); in parse_register_dcl()
639 if (cur[0] == '[') { in parse_register_dcl()
640 ++cur; in parse_register_dcl()
641 ctx->cur = cur; in parse_register_dcl()
684 const char *cur; in parse_dst_operand() local
693 cur = ctx->cur; in parse_dst_operand()
694 eat_opt_white( &cur ); in parse_dst_operand()
727 const char *cur = ctx->cur; in parse_optional_swizzle() local
731 eat_opt_white( &cur ); in parse_optional_swizzle()
732 if (*cur == '.') { in parse_optional_swizzle()
735 cur++; in parse_optional_swizzle()
736 eat_opt_white( &cur ); in parse_optional_swizzle()
738 if (uprcase( *cur ) == 'X') in parse_optional_swizzle()
740 else if (uprcase( *cur ) == 'Y') in parse_optional_swizzle()
742 else if (uprcase( *cur ) == 'Z') in parse_optional_swizzle()
744 else if (uprcase( *cur ) == 'W') in parse_optional_swizzle()
750 cur++; in parse_optional_swizzle()
753 ctx->cur = cur; in parse_optional_swizzle()
769 if (*ctx->cur == '-') { in parse_src_operand()
770 ctx->cur++; in parse_src_operand()
771 eat_opt_white( &ctx->cur ); in parse_src_operand()
775 if (*ctx->cur == '|') { in parse_src_operand()
776 ctx->cur++; in parse_src_operand()
777 eat_opt_white( &ctx->cur ); in parse_src_operand()
817 eat_opt_white( &ctx->cur ); in parse_src_operand()
818 if (*ctx->cur != '|') { in parse_src_operand()
822 ctx->cur++; in parse_src_operand()
834 const char *cur = *pcur; in match_inst() local
837 if (str_match_nocase_whole(&cur, info->mnemonic)) { in match_inst()
838 *pcur = cur; in match_inst()
843 if (str_match_no_case(&cur, info->mnemonic)) { in match_inst()
845 if (str_match_nocase_whole(&cur, "_SAT")) { in match_inst()
846 *pcur = cur; in match_inst()
851 if (str_match_nocase_whole(&cur, "_SATNV")) { in match_inst()
852 *pcur = cur; in match_inst()
870 const char *cur; in parse_instruction() local
877 eat_opt_white( &ctx->cur ); in parse_instruction()
878 if (*ctx->cur == '(') { in parse_instruction()
886 ctx->cur++; in parse_instruction()
887 if (*ctx->cur == '!') { in parse_instruction()
888 ctx->cur++; in parse_instruction()
904 if (*ctx->cur != ')') { in parse_instruction()
909 ctx->cur++; in parse_instruction()
914 eat_opt_white( &ctx->cur ); in parse_instruction()
916 cur = ctx->cur; in parse_instruction()
919 if (match_inst(&cur, &saturate, info)) { in parse_instruction()
921 ctx->cur = cur; in parse_instruction()
924 else if (*cur == '\0' || eat_white( &cur )) { in parse_instruction()
925 ctx->cur = cur; in parse_instruction()
947 eat_opt_white( &ctx->cur ); in parse_instruction()
948 if (*ctx->cur != ',') { in parse_instruction()
952 ctx->cur++; in parse_instruction()
953 eat_opt_white( &ctx->cur ); in parse_instruction()
968 if (str_match_nocase_whole( &ctx->cur, tgsi_texture_names[j] )) { in parse_instruction()
981 cur = ctx->cur; in parse_instruction()
982 eat_opt_white( &cur ); in parse_instruction()
983 if (info->is_branch && *cur == ':') { in parse_instruction()
986 cur++; in parse_instruction()
987 eat_opt_white( &cur ); in parse_instruction()
988 if (!parse_uint( &cur, &target )) { in parse_instruction()
994 ctx->cur = cur; in parse_instruction()
1017 eat_opt_white( &ctx->cur ); in parse_immediate_data()
1018 if (*ctx->cur != '{') { in parse_immediate_data()
1022 ctx->cur++; in parse_immediate_data()
1024 eat_opt_white( &ctx->cur ); in parse_immediate_data()
1026 if (*ctx->cur != ',') { in parse_immediate_data()
1030 ctx->cur++; in parse_immediate_data()
1031 eat_opt_white( &ctx->cur ); in parse_immediate_data()
1036 ret = parse_float(&ctx->cur, &values[i].Float); in parse_immediate_data()
1039 ret = parse_uint(&ctx->cur, &values[i].Uint); in parse_immediate_data()
1042 ret = parse_int(&ctx->cur, &values[i].Int); in parse_immediate_data()
1055 eat_opt_white( &ctx->cur ); in parse_immediate_data()
1056 if (*ctx->cur != '}') { in parse_immediate_data()
1060 ctx->cur++; in parse_immediate_data()
1072 const char *cur, *cur2; in parse_declaration() local
1077 if (!eat_white( &ctx->cur )) { in parse_declaration()
1105 cur = ctx->cur; in parse_declaration()
1106 eat_opt_white( &cur ); in parse_declaration()
1107 if (*cur == ',' && !is_vs_input) { in parse_declaration()
1110 cur++; in parse_declaration()
1111 eat_opt_white( &cur ); in parse_declaration()
1114 if (str_match_nocase_whole(&cur, tgsi_texture_names[i])) { in parse_declaration()
1124 cur2 = cur; in parse_declaration()
1138 cur = cur2; in parse_declaration()
1142 ctx->cur = cur; in parse_declaration()
1146 if (str_match_nocase_whole(&cur, tgsi_texture_names[i])) { in parse_declaration()
1155 eat_opt_white( &cur ); in parse_declaration()
1156 if (*cur != ',') { in parse_declaration()
1160 ++cur; in parse_declaration()
1161 eat_opt_white( &cur ); in parse_declaration()
1164 if (str_match_nocase_whole(&cur, tgsi_type_names[i])) { in parse_declaration()
1191 cur2 = cur; in parse_declaration()
1196 cur = cur2; in parse_declaration()
1208 ctx->cur = cur; in parse_declaration()
1210 if (str_match_nocase_whole(&cur, "LOCAL")) { in parse_declaration()
1212 ctx->cur = cur; in parse_declaration()
1215 cur = ctx->cur; in parse_declaration()
1216 eat_opt_white( &cur ); in parse_declaration()
1217 if (*cur == ',') { in parse_declaration()
1218 cur++; in parse_declaration()
1219 eat_opt_white( &cur ); in parse_declaration()
1222 if (str_match_nocase_whole(&cur, tgsi_semantic_names[i])) { in parse_declaration()
1225 cur2 = cur; in parse_declaration()
1243 cur = cur2; in parse_declaration()
1249 ctx->cur = cur; in parse_declaration()
1259 if (*cur != '{') { in parse_declaration()
1263 ++cur; in parse_declaration()
1264 ctx->cur = cur; in parse_declaration()
1276 eat_opt_white( &ctx->cur ); in parse_declaration()
1277 if (*ctx->cur != ',') { in parse_declaration()
1284 ++ctx->cur; in parse_declaration()
1286 eat_opt_white( &ctx->cur ); in parse_declaration()
1287 if (*ctx->cur != '}') { in parse_declaration()
1292 ++ctx->cur; in parse_declaration()
1295 cur = ctx->cur; in parse_declaration()
1296 eat_opt_white( &cur ); in parse_declaration()
1297 if (*cur == ',' && !is_vs_input) { in parse_declaration()
1300 cur++; in parse_declaration()
1301 eat_opt_white( &cur ); in parse_declaration()
1303 if (str_match_nocase_whole( &cur, tgsi_interpolate_names[i] )) { in parse_declaration()
1307 ctx->cur = cur; in parse_declaration()
1339 if (!eat_white( &ctx->cur )) { in parse_immediate()
1344 if (str_match_nocase_whole(&ctx->cur, tgsi_immediate_type_names[type])) in parse_immediate()
1375 const char *cur = *pcur; in parse_primitive() local
1377 if (str_match_nocase_whole( &cur, tgsi_primitive_names[i])) { in parse_primitive()
1379 *pcur = cur; in parse_primitive()
1392 const char *cur = *pcur; in parse_fs_coord_origin() local
1394 if (str_match_nocase_whole( &cur, tgsi_fs_coord_origin_names[i])) { in parse_fs_coord_origin()
1396 *pcur = cur; in parse_fs_coord_origin()
1409 const char *cur = *pcur; in parse_fs_coord_pixel_center() local
1411 if (str_match_nocase_whole( &cur, tgsi_fs_coord_pixel_center_names[i])) { in parse_fs_coord_pixel_center()
1413 *pcur = cur; in parse_fs_coord_pixel_center()
1429 if (!eat_white( &ctx->cur )) { in parse_property()
1433 if (!parse_identifier( &ctx->cur, id )) { in parse_property()
1448 eat_opt_white( &ctx->cur ); in parse_property()
1452 if (!parse_primitive(&ctx->cur, &values[0] )) { in parse_property()
1462 if (!parse_fs_coord_origin(&ctx->cur, &values[0] )) { in parse_property()
1468 if (!parse_fs_coord_pixel_center(&ctx->cur, &values[0] )) { in parse_property()
1475 if (!parse_uint(&ctx->cur, &values[0] )) { in parse_property()
1501 eat_opt_white( &ctx->cur ); in translate()
1505 while (*ctx->cur != '\0') { in translate()
1507 if (!eat_white( &ctx->cur )) { in translate()
1512 if (*ctx->cur == '\0') in translate()
1518 else if (str_match_nocase_whole( &ctx->cur, "DCL" )) { in translate()
1522 else if (str_match_nocase_whole( &ctx->cur, "IMM" )) { in translate()
1526 else if (str_match_nocase_whole( &ctx->cur, "PROPERTY" )) { in translate()
1547 ctx.cur = text; in tgsi_text_translate()