1 /* A Bison parser, made by GNU Bison 3.0.2. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "3.0.2"
50 #define YYSKELETON_NAME "yacc.c"
62 /* Substitute the variable and function names. */
63 #define yyparse asmshader_parse
64 #define yylex asmshader_lex
65 #define yyerror asmshader_error
66 #define yydebug asmshader_debug
67 #define yynerrs asmshader_nerrs
69 #define yylval asmshader_lval
70 #define yychar asmshader_char
72 /* Copy the first part of user declarations. */
73 #line 22 "asmshader.y" /* yacc.c:339 */
75 #include "d3dcompiler_private.h"
77 WINE_DEFAULT_DEBUG_CHANNEL(asmshader
);
79 struct asm_parser asm_ctx
;
81 void asmparser_message(struct asm_parser
*ctx
, const char *fmt
, ...)
86 compilation_message(&ctx
->messages
, fmt
, args
);
90 static void asmshader_error(char const *s
) {
91 asmparser_message(&asm_ctx
, "Line %u: Error \"%s\" from bison\n", asm_ctx
.line_no
, s
);
92 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
95 static void set_rel_reg(struct shader_reg
*reg
, struct rel_reg
*rel
) {
96 /* We can have an additional offset without true relative addressing
98 reg
->regnum
+= rel
->additional_offset
;
99 if(!rel
->has_rel_reg
) {
102 reg
->rel_reg
= d3dcompiler_alloc(sizeof(*reg
->rel_reg
));
106 reg
->rel_reg
->type
= rel
->type
;
107 reg
->rel_reg
->u
.swizzle
= rel
->swizzle
;
108 reg
->rel_reg
->regnum
= rel
->rel_regnum
;
112 /* Needed lexer functions declarations */
113 int asmshader_lex(void);
117 #line 122 "asmshader.tab.c" /* yacc.c:339 */
120 # if defined __cplusplus && 201103L <= __cplusplus
121 # define YY_NULLPTR nullptr
123 # define YY_NULLPTR 0
127 /* Enabling verbose error messages. */
128 #ifdef YYERROR_VERBOSE
129 # undef YYERROR_VERBOSE
130 # define YYERROR_VERBOSE 1
132 # define YYERROR_VERBOSE 0
141 extern int asmshader_debug
;
205 INSTR_TEXCOORD
= 314,
212 INSTR_TEXREG2AR
= 321,
213 INSTR_TEXREG2GB
= 322,
214 INSTR_TEXREG2RGB
= 323,
215 INSTR_TEXM3x2PAD
= 324,
216 INSTR_TEXM3x2TEX
= 325,
217 INSTR_TEXM3x3PAD
= 326,
218 INSTR_TEXM3x3SPEC
= 327,
219 INSTR_TEXM3x3VSPEC
= 328,
220 INSTR_TEXM3x3TEX
= 329,
221 INSTR_TEXDP3TEX
= 330,
222 INSTR_TEXM3x2DEPTH
= 331,
225 INSTR_TEXDEPTH
= 334,
236 REG_CONSTFLOAT
= 345,
245 REG_VERTEXCOLOR
= 354,
283 SMOD_SCALEBIAS
= 392,
291 SAMPTYPE_VOLUME
= 400,
292 USAGE_POSITION
= 401,
293 USAGE_BLENDWEIGHT
= 402,
294 USAGE_BLENDINDICES
= 403,
297 USAGE_TEXCOORD
= 406,
299 USAGE_BINORMAL
= 408,
300 USAGE_TESSFACTOR
= 409,
301 USAGE_POSITIONT
= 410,
313 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
314 typedef union YYSTYPE YYSTYPE
;
317 #line 70 "asmshader.y" /* yacc.c:355 */
325 struct shader_reg reg
;
343 enum bwriter_comparison_type comptype
;
348 enum bwritersampler_texture_type samplertype
;
349 struct rel_reg rel_reg
;
350 struct src_regs sregs
;
352 #line 357 "asmshader.tab.c" /* yacc.c:355 */
354 # define YYSTYPE_IS_TRIVIAL 1
355 # define YYSTYPE_IS_DECLARED 1
359 extern YYSTYPE asmshader_lval
;
361 int asmshader_parse (void);
365 /* Copy the second part of user declarations. */
367 #line 372 "asmshader.tab.c" /* yacc.c:358 */
374 typedef YYTYPE_UINT8 yytype_uint8
;
376 typedef unsigned char yytype_uint8
;
380 typedef YYTYPE_INT8 yytype_int8
;
382 typedef signed char yytype_int8
;
386 typedef YYTYPE_UINT16 yytype_uint16
;
388 typedef unsigned short int yytype_uint16
;
392 typedef YYTYPE_INT16 yytype_int16
;
394 typedef short int yytype_int16
;
398 # ifdef __SIZE_TYPE__
399 # define YYSIZE_T __SIZE_TYPE__
400 # elif defined size_t
401 # define YYSIZE_T size_t
402 # elif ! defined YYSIZE_T
403 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
404 # define YYSIZE_T size_t
406 # define YYSIZE_T unsigned int
410 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
413 # if defined YYENABLE_NLS && YYENABLE_NLS
415 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
416 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
420 # define YY_(Msgid) Msgid
425 # if (defined __GNUC__ \
426 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
427 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
428 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
430 # define YY_ATTRIBUTE(Spec) /* empty */
434 #ifndef YY_ATTRIBUTE_PURE
435 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
438 #ifndef YY_ATTRIBUTE_UNUSED
439 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
442 #if !defined _Noreturn \
443 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
444 # if defined _MSC_VER && 1200 <= _MSC_VER
445 # define _Noreturn __declspec (noreturn)
447 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
451 /* Suppress unused-variable warnings by "using" E. */
452 #if ! defined lint || defined __GNUC__
453 # define YYUSE(E) ((void) (E))
455 # define YYUSE(E) /* empty */
458 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
459 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
460 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
461 _Pragma ("GCC diagnostic push") \
462 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
463 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
464 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
465 _Pragma ("GCC diagnostic pop")
467 # define YY_INITIAL_VALUE(Value) Value
469 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
470 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
471 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
473 #ifndef YY_INITIAL_VALUE
474 # define YY_INITIAL_VALUE(Value) /* Nothing. */
478 #if ! defined yyoverflow || YYERROR_VERBOSE
480 /* The parser invokes alloca or malloc; define the necessary symbols. */
482 # ifdef YYSTACK_USE_ALLOCA
483 # if YYSTACK_USE_ALLOCA
485 # define YYSTACK_ALLOC __builtin_alloca
486 # elif defined __BUILTIN_VA_ARG_INCR
487 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
489 # define YYSTACK_ALLOC __alloca
490 # elif defined _MSC_VER
491 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
492 # define alloca _alloca
494 # define YYSTACK_ALLOC alloca
495 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
496 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
497 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
498 # ifndef EXIT_SUCCESS
499 # define EXIT_SUCCESS 0
506 # ifdef YYSTACK_ALLOC
507 /* Pacify GCC's 'empty if-body' warning. */
508 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
509 # ifndef YYSTACK_ALLOC_MAXIMUM
510 /* The OS might guarantee only one guard page at the bottom of the stack,
511 and a page size can be as small as 4096 bytes. So we cannot safely
512 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
513 to allow for a few compiler-allocated temporary stack slots. */
514 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
517 # define YYSTACK_ALLOC YYMALLOC
518 # define YYSTACK_FREE YYFREE
519 # ifndef YYSTACK_ALLOC_MAXIMUM
520 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
522 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
523 && ! ((defined YYMALLOC || defined malloc) \
524 && (defined YYFREE || defined free)))
525 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
526 # ifndef EXIT_SUCCESS
527 # define EXIT_SUCCESS 0
531 # define YYMALLOC malloc
532 # if ! defined malloc && ! defined EXIT_SUCCESS
533 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
538 # if ! defined free && ! defined EXIT_SUCCESS
539 void free (void *); /* INFRINGES ON USER NAME SPACE */
543 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
546 #if (! defined yyoverflow \
547 && (! defined __cplusplus \
548 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
550 /* A type that is properly aligned for any stack member. */
553 yytype_int16 yyss_alloc
;
557 /* The size of the maximum gap between one aligned stack and the next. */
558 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
560 /* The size of an array large to enough to hold all stacks, each with
562 # define YYSTACK_BYTES(N) \
563 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
564 + YYSTACK_GAP_MAXIMUM)
566 # define YYCOPY_NEEDED 1
568 /* Relocate STACK from its old location to the new one. The
569 local variables YYSIZE and YYSTACKSIZE give the old and new number of
570 elements in the stack, and YYPTR gives the new location of the
571 stack. Advance YYPTR to a properly aligned location for the next
573 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
576 YYSIZE_T yynewbytes; \
577 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
578 Stack = &yyptr->Stack_alloc; \
579 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
580 yyptr += yynewbytes / sizeof (*yyptr); \
586 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
587 /* Copy COUNT objects from SRC to DST. The source and destination do
590 # if defined __GNUC__ && 1 < __GNUC__
591 # define YYCOPY(Dst, Src, Count) \
592 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
594 # define YYCOPY(Dst, Src, Count) \
598 for (yyi = 0; yyi < (Count); yyi++) \
599 (Dst)[yyi] = (Src)[yyi]; \
604 #endif /* !YYCOPY_NEEDED */
606 /* YYFINAL -- State number of the termination state. */
608 /* YYLAST -- Last index in YYTABLE. */
611 /* YYNTOKENS -- Number of terminals. */
612 #define YYNTOKENS 171
613 /* YYNNTS -- Number of nonterminals. */
615 /* YYNRULES -- Number of rules. */
617 /* YYNSTATES -- Number of states. */
618 #define YYNSTATES 552
620 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
621 by yylex, with out-of-bounds checking. */
623 #define YYMAXUTOK 417
625 #define YYTRANSLATE(YYX) \
626 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
628 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
629 as returned by yylex, without out-of-bounds checking. */
630 static const yytype_uint8 yytranslate
[] =
632 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
633 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 169, 170, 2, 163, 164, 166, 165, 2, 2, 2,
637 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
638 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
640 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
641 2, 167, 2, 168, 2, 2, 2, 2, 2, 2,
642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
644 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
647 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
653 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
654 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
655 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
656 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
657 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
658 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
659 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
660 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
661 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
662 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
663 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
664 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
665 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
666 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
667 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
668 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
669 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
670 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
671 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
672 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
673 155, 156, 157, 158, 159, 160, 161, 162
677 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
678 static const yytype_uint16 yyrline
[] =
680 0, 311, 311, 316, 321, 326, 331, 336, 341, 346,
681 351, 356, 361, 366, 371, 376, 382, 383, 388, 392,
682 397, 403, 408, 413, 418, 423, 428, 433, 438, 443,
683 448, 453, 458, 463, 468, 473, 478, 483, 488, 493,
684 498, 503, 508, 513, 518, 523, 528, 533, 538, 543,
685 548, 553, 558, 563, 575, 587, 610, 633, 655, 677,
686 687, 702, 709, 716, 720, 724, 728, 733, 738, 743,
687 748, 753, 758, 763, 768, 773, 778, 783, 788, 793,
688 798, 803, 808, 813, 818, 823, 828, 833, 838, 843,
689 849, 854, 859, 864, 875, 880, 885, 890, 895, 900,
690 905, 910, 915, 920, 925, 930, 935, 940, 945, 950,
691 955, 960, 965, 970, 975, 980, 987, 995, 1004, 1008,
692 1012, 1016, 1022, 1028, 1034, 1038, 1042, 1048, 1052, 1056,
693 1060, 1064, 1068, 1072, 1076, 1082, 1088, 1093, 1100, 1115,
694 1121, 1137, 1141, 1163, 1168, 1182, 1186, 1199, 1204, 1209,
695 1214, 1219, 1224, 1229, 1234, 1239, 1245, 1250, 1261, 1269,
696 1277, 1285, 1310, 1324, 1338, 1348, 1352, 1357, 1365, 1373,
697 1381, 1390, 1399, 1409, 1413, 1417, 1421, 1425, 1429, 1434,
698 1438, 1443, 1447, 1453, 1457, 1461, 1465, 1469, 1473, 1479,
699 1483, 1489, 1495, 1501, 1507, 1513, 1517, 1521, 1525, 1529,
700 1533, 1538, 1539, 1540, 1541, 1542, 1543, 1545, 1551, 1557,
701 1563, 1569, 1575, 1581, 1587, 1593, 1599, 1605, 1611, 1617,
702 1623, 1630, 1634, 1639, 1643, 1647, 1651, 1656, 1664
706 #if YYDEBUG || YYERROR_VERBOSE || 0
707 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
708 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
709 static const char *const yytname
[] =
711 "$end", "error", "$undefined", "INSTR_ADD", "INSTR_NOP", "INSTR_MOV",
712 "INSTR_SUB", "INSTR_MAD", "INSTR_MUL", "INSTR_RCP", "INSTR_RSQ",
713 "INSTR_DP3", "INSTR_DP4", "INSTR_MIN", "INSTR_MAX", "INSTR_SLT",
714 "INSTR_SGE", "INSTR_ABS", "INSTR_EXP", "INSTR_LOG", "INSTR_EXPP",
715 "INSTR_LOGP", "INSTR_DST", "INSTR_LRP", "INSTR_FRC", "INSTR_POW",
716 "INSTR_CRS", "INSTR_SGN", "INSTR_NRM", "INSTR_SINCOS", "INSTR_M4x4",
717 "INSTR_M4x3", "INSTR_M3x4", "INSTR_M3x3", "INSTR_M3x2", "INSTR_DCL",
718 "INSTR_DEF", "INSTR_DEFB", "INSTR_DEFI", "INSTR_REP", "INSTR_ENDREP",
719 "INSTR_IF", "INSTR_ELSE", "INSTR_ENDIF", "INSTR_BREAK", "INSTR_BREAKP",
720 "INSTR_CALL", "INSTR_CALLNZ", "INSTR_LOOP", "INSTR_RET", "INSTR_ENDLOOP",
721 "INSTR_LABEL", "INSTR_SETP", "INSTR_TEXLDL", "INSTR_LIT", "INSTR_MOVA",
722 "INSTR_CND", "INSTR_CMP", "INSTR_DP2ADD", "INSTR_TEXCOORD",
723 "INSTR_TEXCRD", "INSTR_TEXKILL", "INSTR_TEX", "INSTR_TEXLD",
724 "INSTR_TEXBEM", "INSTR_TEXBEML", "INSTR_TEXREG2AR", "INSTR_TEXREG2GB",
725 "INSTR_TEXREG2RGB", "INSTR_TEXM3x2PAD", "INSTR_TEXM3x2TEX",
726 "INSTR_TEXM3x3PAD", "INSTR_TEXM3x3SPEC", "INSTR_TEXM3x3VSPEC",
727 "INSTR_TEXM3x3TEX", "INSTR_TEXDP3TEX", "INSTR_TEXM3x2DEPTH",
728 "INSTR_TEXDP3", "INSTR_TEXM3x3", "INSTR_TEXDEPTH", "INSTR_BEM",
729 "INSTR_DSX", "INSTR_DSY", "INSTR_TEXLDP", "INSTR_TEXLDB", "INSTR_TEXLDD",
730 "INSTR_PHASE", "REG_TEMP", "REG_OUTPUT", "REG_INPUT", "REG_CONSTFLOAT",
731 "REG_CONSTINT", "REG_CONSTBOOL", "REG_TEXTURE", "REG_SAMPLER",
732 "REG_TEXCRDOUT", "REG_OPOS", "REG_OFOG", "REG_OPTS", "REG_VERTEXCOLOR",
733 "REG_FRAGCOLOR", "REG_FRAGDEPTH", "REG_VPOS", "REG_VFACE", "REG_ADDRESS",
734 "REG_LOOP", "REG_PREDICATE", "REG_LABEL", "VER_VS10", "VER_VS11",
735 "VER_VS20", "VER_VS2X", "VER_VS30", "VER_PS10", "VER_PS11", "VER_PS12",
736 "VER_PS13", "VER_PS14", "VER_PS20", "VER_PS2X", "VER_PS30", "SHIFT_X2",
737 "SHIFT_X4", "SHIFT_X8", "SHIFT_D2", "SHIFT_D4", "SHIFT_D8", "MOD_SAT",
738 "MOD_PP", "MOD_CENTROID", "COMP_GT", "COMP_LT", "COMP_GE", "COMP_LE",
739 "COMP_EQ", "COMP_NE", "SMOD_BIAS", "SMOD_SCALEBIAS", "SMOD_DZ",
740 "SMOD_DW", "SMOD_ABS", "SMOD_NOT", "SAMPTYPE_1D", "SAMPTYPE_2D",
741 "SAMPTYPE_CUBE", "SAMPTYPE_VOLUME", "USAGE_POSITION",
742 "USAGE_BLENDWEIGHT", "USAGE_BLENDINDICES", "USAGE_NORMAL", "USAGE_PSIZE",
743 "USAGE_TEXCOORD", "USAGE_TANGENT", "USAGE_BINORMAL", "USAGE_TESSFACTOR",
744 "USAGE_POSITIONT", "USAGE_COLOR", "USAGE_FOG", "USAGE_DEPTH",
745 "USAGE_SAMPLE", "COMPONENT", "IMMVAL", "IMMBOOL", "'+'", "','", "'.'",
746 "'-'", "'['", "']'", "'('", "')'", "$accept", "shader", "version_marker",
747 "instructions", "complexinstr", "instruction", "dreg", "dreg_name",
748 "writemask", "wm_components", "swizzle", "sw_components", "omods",
749 "omodifier", "sregs", "sreg", "rel_reg", "immsum", "smod", "relreg_name",
750 "sreg_name", "comp", "dclusage", "dcl_inputreg", "sampdcl", "predicate", YY_NULLPTR
755 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
756 (internal) symbol number NUM (which must be that of a token). */
757 static const yytype_uint16 yytoknum
[] =
759 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
760 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
761 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
762 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
763 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
764 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
765 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
766 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
767 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
768 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
769 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
770 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
771 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
772 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
773 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
774 405, 406, 407, 408, 409, 410, 411, 412, 413, 414,
775 415, 416, 417, 43, 44, 46, 45, 91, 93, 40,
780 #define YYPACT_NINF -458
782 #define yypact_value_is_default(Yystate) \
783 (!!((Yystate) == (-458)))
785 #define YYTABLE_NINF -1
787 #define yytable_value_is_error(Yytable_value) \
790 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
792 static const yytype_int16 yypact
[] =
794 386, -458, -458, -458, -458, -458, -458, -458, -458, -458,
795 -458, -458, -458, -458, 11, -458, -458, 389, -458, -458,
796 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
797 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
798 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
799 334, -42, -28, -10, -34, -458, 95, -458, -458, 3,
800 -34, -34, -34, -34, -458, -458, -34, 3, -458, -458,
801 -458, -458, -458, -458, -458, -458, 247, -458, -458, -458,
802 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
803 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
804 -458, -458, 647, -55, -458, -458, 647, 505, 505, 505,
805 505, 505, 505, 505, 505, 505, 505, 505, 505, 505,
806 505, 505, 505, 505, 505, 505, 505, 505, 505, 505,
807 505, 505, 505, 505, 505, 505, 505, 505, -458, -458,
808 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
809 -458, -458, -458, -458, -458, -458, 123, 2, -458, -44,
810 -40, -39, -458, -458, -458, -458, -458, -458, -458, -458,
811 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
812 -458, -458, 185, -45, 185, -38, -458, -37, -458, -458,
813 -458, -458, -458, -458, -38, -34, -34, -38, -38, -38,
814 -38, -38, 247, 505, 505, 505, 505, 505, 505, 505,
815 505, -458, -458, -458, -458, -458, -458, -458, -458, -458,
816 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
817 -458, -458, -76, 505, 505, 505, 505, 505, 505, 505,
818 505, 505, 505, 505, 505, 505, 505, 505, 505, 505,
819 505, 505, 505, 505, 505, 505, 505, -458, -57, 22,
820 -458, -458, -458, -458, -458, -458, -458, -458, -458, -458,
821 -35, -458, 1, 4, 8, 9, 10, 14, 16, 29,
822 49, 50, 51, 54, 55, 57, 58, 60, 68, 69,
823 70, 73, 74, 75, 76, 77, 78, 79, 89, 90,
824 91, 93, -458, -458, -458, 94, 94, 142, 82, 5,
825 96, 6, -57, 185, -37, -34, -58, -43, -38, -38,
826 98, 119, 129, 130, 131, 132, 133, -458, 134, 100,
827 -458, -458, -458, 135, 136, 137, 138, 190, 191, 192,
828 193, 194, 195, 204, 205, 343, 344, 345, 346, -458,
829 378, 379, 380, 381, 382, 383, 388, 384, -57, -34,
830 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,
831 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,
832 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,
833 -458, -458, 94, -458, -458, -458, 385, -458, 387, -458,
834 -37, -43, -458, -458, -458, -458, -154, -57, -458, -458,
835 -458, -458, -458, -458, -458, -57, -34, -34, -34, -34,
836 -34, -34, -34, -34, -458, 390, -34, -34, -34, -34,
837 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,
838 -34, -34, -34, -34, -34, -34, -34, -34, -458, 393,
839 -458, 397, -38, -38, -38, -38, -38, -38, -38, -38,
840 -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
841 -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
842 -38, -38, -38, -458, 394, 395, -43, -458, -57, -30,
843 -458, -86, -458, -38, -38, -38, -38, -38, -38, -38,
844 -38, -458, -38, -38, -38, -38, -38, -38, -38, -38,
845 -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
846 -38, -38, -38, -38, -458, -458, 448, 449, -458, -57,
847 -458, -458, -57, 396, -458, 453, 454, -458, -84, -63,
848 452, 455, 396, -458, 456, -458, 457, 459, -59, -458,
852 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
853 Performed when YYTABLE does not specify something else to do. Zero
854 means the default is an error. */
855 static const yytype_uint8 yydefact
[] =
857 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
858 12, 13, 14, 15, 0, 16, 1, 2, 145, 22,
859 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
860 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
861 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
862 145, 0, 0, 0, 0, 67, 0, 70, 71, 72,
863 0, 0, 0, 0, 78, 79, 0, 0, 145, 145,
864 145, 145, 145, 145, 145, 145, 0, 145, 145, 145,
865 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
866 145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
867 145, 115, 0, 0, 17, 18, 0, 0, 0, 0,
868 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
869 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
870 0, 0, 0, 0, 0, 0, 0, 0, 223, 224,
871 225, 226, 207, 208, 209, 210, 211, 212, 213, 214,
872 215, 216, 217, 218, 219, 220, 0, 145, 145, 0,
873 0, 0, 181, 182, 183, 184, 185, 186, 187, 189,
874 188, 190, 191, 192, 193, 194, 196, 197, 198, 199,
875 195, 200, 0, 0, 0, 66, 156, 165, 201, 202,
876 203, 204, 205, 206, 68, 0, 0, 74, 75, 76,
877 77, 80, 0, 0, 0, 0, 0, 0, 0, 0,
878 0, 118, 119, 120, 121, 122, 123, 124, 126, 125,
879 127, 129, 128, 130, 131, 132, 134, 135, 136, 137,
880 133, 90, 165, 0, 0, 0, 0, 0, 0, 0,
881 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
882 0, 0, 0, 0, 0, 0, 0, 20, 141, 0,
883 19, 147, 148, 149, 150, 151, 152, 153, 154, 155,
884 0, 146, 0, 0, 0, 0, 0, 0, 0, 0,
885 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
886 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
887 0, 0, 221, 222, 60, 57, 53, 0, 0, 0,
888 0, 0, 141, 0, 165, 0, 0, 141, 69, 73,
889 0, 0, 0, 0, 0, 0, 0, 88, 0, 0,
890 117, 116, 91, 0, 0, 0, 0, 0, 0, 0,
891 0, 0, 0, 0, 0, 0, 0, 0, 0, 92,
892 0, 0, 0, 0, 0, 0, 0, 0, 141, 0,
893 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
894 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
895 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
896 58, 54, 55, 62, 59, 61, 0, 65, 0, 164,
897 165, 141, 157, 179, 180, 171, 0, 141, 174, 173,
898 175, 176, 177, 178, 158, 141, 0, 0, 0, 0,
899 0, 0, 0, 0, 139, 138, 0, 0, 0, 0,
900 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
901 0, 0, 0, 0, 0, 0, 0, 0, 143, 142,
902 227, 0, 21, 23, 24, 25, 26, 27, 28, 29,
903 30, 31, 32, 33, 34, 35, 36, 37, 39, 38,
904 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
905 50, 51, 52, 56, 0, 0, 141, 160, 141, 0,
906 166, 0, 159, 81, 82, 83, 84, 85, 86, 87,
907 89, 140, 93, 96, 97, 98, 99, 100, 101, 108,
908 102, 103, 104, 105, 106, 107, 109, 110, 111, 112,
909 113, 94, 95, 114, 144, 228, 0, 0, 162, 141,
910 161, 172, 141, 0, 167, 0, 0, 163, 0, 0,
911 0, 0, 0, 168, 0, 169, 0, 0, 0, 63,
915 /* YYPGOTO[NTERM-NUM]. */
916 static const yytype_int16 yypgoto
[] =
918 -458, -458, -458, -458, -458, 17, -92, -458, -293, -458,
919 -309, -458, 491, -458, -56, 306, -231, -457, -399, 146,
920 -132, 21, -458, -206, -458, -458
923 /* YYDEFGOTO[NTERM-NUM]. */
924 static const yytype_int16 yydefgoto
[] =
926 -1, 14, 15, 17, 104, 105, 231, 232, 330, 425,
927 357, 449, 107, 271, 185, 186, 317, 406, 415, 407,
928 187, 195, 157, 305, 158, 106
931 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
932 positive, shift that token. If negative, reduce the rule whose
933 number is the opposite. If YYTABLE_NINF, syntax error. */
934 static const yytype_uint16 yytable
[] =
936 194, 331, 488, 399, 197, 198, 199, 200, 414, 489,
937 201, 16, 390, 391, 490, 270, 272, 273, 274, 275,
938 276, 277, 278, 279, 280, 281, 282, 283, 284, 285,
939 286, 287, 288, 289, 290, 291, 292, 293, 294, 295,
940 296, 297, 298, 299, 300, 301, 403, 404, 159, 451,
941 312, 258, 314, 162, 163, 164, 165, 166, 167, 168,
942 169, 170, 171, 172, 160, 173, 174, 175, 176, 177,
943 178, 179, 180, 181, 403, 404, 539, 533, 408, 542,
944 196, 161, 534, 401, 543, 548, 259, 529, 202, 329,
945 306, 316, 487, 409, 410, 411, 412, 413, 491, 483,
946 544, 392, 395, 405, 544, 545, 492, 182, 356, 551,
947 320, 321, 322, 323, 324, 325, 326, 327, 328, 257,
948 309, 313, 356, 260, 310, 311, 315, 183, 358, 359,
949 316, 531, 184, 188, 189, 190, 191, 192, 193, 318,
950 319, 332, 333, 334, 335, 336, 337, 338, 339, 340,
951 341, 342, 343, 344, 345, 346, 347, 348, 349, 350,
952 351, 352, 353, 354, 355, 360, 396, 398, 361, 486,
953 393, 302, 362, 363, 364, 303, 394, 528, 365, 530,
954 366, 400, 162, 163, 164, 165, 166, 167, 168, 169,
955 170, 171, 172, 367, 173, 174, 175, 176, 177, 178,
956 179, 180, 181, 261, 262, 263, 264, 265, 266, 267,
957 268, 269, 302, 368, 369, 370, 303, 304, 371, 372,
958 537, 373, 374, 538, 375, 188, 189, 190, 191, 192,
959 193, 302, 376, 377, 378, 303, 182, 379, 380, 381,
960 382, 383, 384, 385, 261, 262, 263, 264, 265, 266,
961 267, 268, 269, 386, 387, 388, 183, 389, 397, 329,
962 424, 184, 416, 261, 262, 263, 264, 265, 266, 267,
963 268, 269, 162, 163, 164, 165, 166, 167, 168, 169,
964 170, 171, 172, 417, 173, 174, 175, 176, 177, 178,
965 179, 180, 181, 418, 419, 420, 421, 422, 423, 426,
966 427, 428, 429, 452, 453, 454, 455, 456, 457, 458,
967 459, 460, 461, 462, 463, 464, 465, 466, 467, 468,
968 469, 470, 471, 472, 473, 474, 475, 476, 477, 478,
969 479, 480, 481, 482, 211, 212, 213, 214, 215, 216,
970 217, 218, 219, 220, 221, 222, 223, 224, 225, 226,
971 227, 228, 229, 230, 430, 431, 432, 433, 434, 435,
972 493, 494, 495, 496, 497, 498, 499, 500, 436, 437,
973 502, 503, 504, 505, 506, 507, 508, 509, 510, 511,
974 512, 513, 514, 515, 516, 517, 518, 519, 520, 521,
975 522, 523, 18, 19, 20, 21, 22, 23, 24, 25,
976 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
977 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
978 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
979 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
980 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
981 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
982 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
983 96, 97, 98, 99, 100, 101, 138, 139, 140, 141,
984 142, 143, 144, 145, 146, 147, 148, 149, 150, 151,
985 152, 153, 154, 155, 1, 2, 3, 4, 5, 6,
986 7, 8, 9, 10, 11, 12, 13, 438, 439, 440,
987 441, 108, 109, 110, 111, 112, 113, 114, 115, 116,
988 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
989 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
990 137, 156, 442, 443, 444, 445, 446, 447, 448, 484,
991 501, 485, 102, 524, 450, 526, 527, 405, 103, 203,
992 204, 205, 206, 207, 208, 209, 210, 525, 233, 234,
993 235, 236, 237, 238, 239, 240, 241, 242, 243, 244,
994 245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
995 255, 256, 211, 212, 213, 214, 215, 216, 217, 218,
996 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,
997 229, 230, 535, 536, 540, 541, 546, 531, 549, 547,
998 550, 402, 0, 0, 0, 0, 261, 262, 263, 264,
999 265, 266, 267, 268, 269, 532, 0, 0, 0, 0,
1000 0, 0, 0, 0, 0, 0, 0, 0, 307, 308,
1001 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
1002 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1003 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
1004 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
1005 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
1006 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
1007 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
1008 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
1012 static const yytype_int16 yycheck
[] =
1014 56, 232, 401, 312, 60, 61, 62, 63, 317, 163,
1015 66, 0, 305, 306, 168, 107, 108, 109, 110, 111,
1016 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
1017 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
1018 132, 133, 134, 135, 136, 137, 104, 105, 90, 358,
1019 182, 106, 184, 87, 88, 89, 90, 91, 92, 93,
1020 94, 95, 96, 97, 92, 99, 100, 101, 102, 103,
1021 104, 105, 106, 107, 104, 105, 533, 163, 121, 163,
1022 59, 91, 168, 314, 168, 542, 141, 486, 67, 165,
1023 88, 167, 401, 136, 137, 138, 139, 140, 407, 392,
1024 163, 307, 308, 161, 163, 168, 415, 141, 165, 168,
1025 202, 203, 204, 205, 206, 207, 208, 209, 210, 102,
1026 164, 166, 165, 106, 164, 164, 164, 161, 106, 164,
1027 167, 161, 166, 130, 131, 132, 133, 134, 135, 195,
1028 196, 233, 234, 235, 236, 237, 238, 239, 240, 241,
1029 242, 243, 244, 245, 246, 247, 248, 249, 250, 251,
1030 252, 253, 254, 255, 256, 164, 161, 161, 164, 400,
1031 88, 89, 164, 164, 164, 93, 94, 486, 164, 488,
1032 164, 313, 87, 88, 89, 90, 91, 92, 93, 94,
1033 95, 96, 97, 164, 99, 100, 101, 102, 103, 104,
1034 105, 106, 107, 121, 122, 123, 124, 125, 126, 127,
1035 128, 129, 89, 164, 164, 164, 93, 94, 164, 164,
1036 529, 164, 164, 532, 164, 130, 131, 132, 133, 134,
1037 135, 89, 164, 164, 164, 93, 141, 164, 164, 164,
1038 164, 164, 164, 164, 121, 122, 123, 124, 125, 126,
1039 127, 128, 129, 164, 164, 164, 161, 164, 162, 165,
1040 160, 166, 164, 121, 122, 123, 124, 125, 126, 127,
1041 128, 129, 87, 88, 89, 90, 91, 92, 93, 94,
1042 95, 96, 97, 164, 99, 100, 101, 102, 103, 104,
1043 105, 106, 107, 164, 164, 164, 164, 164, 164, 164,
1044 164, 164, 164, 359, 360, 361, 362, 363, 364, 365,
1045 366, 367, 368, 369, 370, 371, 372, 373, 374, 375,
1046 376, 377, 378, 379, 380, 381, 382, 383, 384, 385,
1047 386, 387, 388, 389, 87, 88, 89, 90, 91, 92,
1048 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
1049 103, 104, 105, 106, 164, 164, 164, 164, 164, 164,
1050 416, 417, 418, 419, 420, 421, 422, 423, 164, 164,
1051 426, 427, 428, 429, 430, 431, 432, 433, 434, 435,
1052 436, 437, 438, 439, 440, 441, 442, 443, 444, 445,
1053 446, 447, 3, 4, 5, 6, 7, 8, 9, 10,
1054 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1055 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
1056 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1057 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
1058 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
1059 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
1060 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
1061 81, 82, 83, 84, 85, 86, 142, 143, 144, 145,
1062 146, 147, 148, 149, 150, 151, 152, 153, 154, 155,
1063 156, 157, 158, 159, 108, 109, 110, 111, 112, 113,
1064 114, 115, 116, 117, 118, 119, 120, 164, 164, 164,
1065 164, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1066 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1067 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
1068 49, 50, 164, 164, 164, 164, 164, 164, 160, 164,
1069 160, 164, 163, 160, 170, 161, 161, 161, 169, 68,
1070 69, 70, 71, 72, 73, 74, 75, 170, 77, 78,
1071 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1072 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
1073 99, 100, 87, 88, 89, 90, 91, 92, 93, 94,
1074 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1075 105, 106, 164, 164, 161, 161, 164, 161, 161, 164,
1076 161, 315, -1, -1, -1, -1, 121, 122, 123, 124,
1077 125, 126, 127, 128, 129, 489, -1, -1, -1, -1,
1078 -1, -1, -1, -1, -1, -1, -1, -1, 157, 158,
1079 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1080 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1081 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1082 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
1083 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
1084 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
1085 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
1086 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
1090 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1091 symbol of state STATE-NUM. */
1092 static const yytype_uint8 yystos
[] =
1094 0, 108, 109, 110, 111, 112, 113, 114, 115, 116,
1095 117, 118, 119, 120, 172, 173, 0, 174, 3, 4,
1096 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1097 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1098 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1099 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1100 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1101 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1102 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1103 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1104 85, 86, 163, 169, 175, 176, 196, 183, 183, 183,
1105 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
1106 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
1107 183, 183, 183, 183, 183, 183, 183, 183, 142, 143,
1108 144, 145, 146, 147, 148, 149, 150, 151, 152, 153,
1109 154, 155, 156, 157, 158, 159, 183, 193, 195, 90,
1110 92, 91, 87, 88, 89, 90, 91, 92, 93, 94,
1111 95, 96, 97, 99, 100, 101, 102, 103, 104, 105,
1112 106, 107, 141, 161, 166, 185, 186, 191, 130, 131,
1113 132, 133, 134, 135, 185, 192, 192, 185, 185, 185,
1114 185, 185, 192, 183, 183, 183, 183, 183, 183, 183,
1115 183, 87, 88, 89, 90, 91, 92, 93, 94, 95,
1116 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
1117 106, 177, 178, 183, 183, 183, 183, 183, 183, 183,
1118 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
1119 183, 183, 183, 183, 183, 183, 183, 176, 106, 141,
1120 176, 121, 122, 123, 124, 125, 126, 127, 128, 129,
1121 177, 184, 177, 177, 177, 177, 177, 177, 177, 177,
1122 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
1123 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
1124 177, 177, 89, 93, 94, 194, 88, 183, 183, 164,
1125 164, 164, 191, 166, 191, 164, 167, 187, 185, 185,
1126 177, 177, 177, 177, 177, 177, 177, 177, 177, 165,
1127 179, 187, 177, 177, 177, 177, 177, 177, 177, 177,
1128 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
1129 177, 177, 177, 177, 177, 177, 165, 181, 106, 164,
1130 164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
1131 164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
1132 164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
1133 179, 179, 194, 88, 94, 194, 161, 162, 161, 181,
1134 191, 187, 186, 104, 105, 161, 188, 190, 121, 136,
1135 137, 138, 139, 140, 181, 189, 164, 164, 164, 164,
1136 164, 164, 164, 164, 160, 180, 164, 164, 164, 164,
1137 164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
1138 164, 164, 164, 164, 164, 164, 164, 164, 160, 182,
1139 170, 181, 185, 185, 185, 185, 185, 185, 185, 185,
1140 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
1141 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
1142 185, 185, 185, 179, 164, 164, 187, 181, 189, 163,
1143 168, 181, 181, 185, 185, 185, 185, 185, 185, 185,
1144 185, 160, 185, 185, 185, 185, 185, 185, 185, 185,
1145 185, 185, 185, 185, 185, 185, 185, 185, 185, 185,
1146 185, 185, 185, 185, 160, 170, 161, 161, 181, 189,
1147 181, 161, 190, 163, 168, 164, 164, 181, 181, 188,
1148 161, 161, 163, 168, 163, 168, 164, 164, 188, 161,
1152 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1153 static const yytype_uint8 yyr1
[] =
1155 0, 171, 172, 173, 173, 173, 173, 173, 173, 173,
1156 173, 173, 173, 173, 173, 173, 174, 174, 175, 175,
1157 175, 176, 176, 176, 176, 176, 176, 176, 176, 176,
1158 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
1159 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
1160 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
1161 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
1162 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
1163 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
1164 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
1165 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
1166 176, 176, 176, 176, 176, 176, 177, 177, 178, 178,
1167 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
1168 178, 178, 178, 178, 178, 178, 178, 178, 179, 180,
1169 180, 181, 181, 182, 182, 183, 183, 184, 184, 184,
1170 184, 184, 184, 184, 184, 184, 185, 185, 186, 186,
1171 186, 186, 186, 186, 186, 187, 187, 187, 187, 187,
1172 187, 188, 188, 189, 189, 189, 189, 189, 189, 190,
1173 190, 191, 191, 191, 191, 191, 191, 191, 191, 191,
1174 191, 191, 191, 191, 191, 191, 191, 191, 191, 191,
1175 191, 192, 192, 192, 192, 192, 192, 193, 193, 193,
1176 193, 193, 193, 193, 193, 193, 193, 193, 193, 193,
1177 193, 194, 194, 195, 195, 195, 195, 196, 196
1180 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
1181 static const yytype_uint8 yyr2
[] =
1183 0, 2, 2, 1, 1, 1, 1, 1, 1, 1,
1184 1, 1, 1, 1, 1, 1, 0, 2, 1, 2,
1185 2, 5, 1, 5, 5, 5, 5, 5, 5, 5,
1186 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
1187 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
1188 5, 5, 5, 3, 4, 4, 5, 3, 4, 4,
1189 3, 4, 4, 10, 10, 4, 2, 1, 2, 3,
1190 1, 1, 1, 3, 2, 2, 2, 2, 1, 1,
1191 2, 5, 5, 5, 5, 5, 5, 5, 3, 5,
1192 2, 3, 3, 5, 5, 5, 5, 5, 5, 5,
1193 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
1194 5, 5, 5, 5, 5, 1, 2, 2, 1, 1,
1195 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1196 1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
1197 2, 0, 2, 1, 2, 0, 2, 1, 1, 1,
1198 1, 1, 1, 1, 1, 1, 1, 3, 3, 4,
1199 4, 5, 5, 6, 3, 0, 3, 4, 6, 6,
1200 8, 1, 3, 1, 1, 1, 1, 1, 1, 1,
1201 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1202 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1203 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1204 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1205 1, 1, 1, 1, 1, 1, 1, 4, 5
1209 #define yyerrok (yyerrstatus = 0)
1210 #define yyclearin (yychar = YYEMPTY)
1211 #define YYEMPTY (-2)
1214 #define YYACCEPT goto yyacceptlab
1215 #define YYABORT goto yyabortlab
1216 #define YYERROR goto yyerrorlab
1219 #define YYRECOVERING() (!!yyerrstatus)
1221 #define YYBACKUP(Token, Value) \
1223 if (yychar == YYEMPTY) \
1227 YYPOPSTACK (yylen); \
1233 yyerror (YY_("syntax error: cannot back up")); \
1238 /* Error token number */
1240 #define YYERRCODE 256
1244 /* Enable debugging if requested. */
1248 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1249 # define YYFPRINTF fprintf
1252 # define YYDPRINTF(Args) \
1258 /* This macro is provided for backward compatibility. */
1259 #ifndef YY_LOCATION_PRINT
1260 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1264 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1268 YYFPRINTF (stderr, "%s ", Title); \
1269 yy_symbol_print (stderr, \
1271 YYFPRINTF (stderr, "\n"); \
1276 /*----------------------------------------.
1277 | Print this symbol's value on YYOUTPUT. |
1278 `----------------------------------------*/
1281 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
1283 FILE *yyo
= yyoutput
;
1288 if (yytype
< YYNTOKENS
)
1289 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1295 /*--------------------------------.
1296 | Print this symbol on YYOUTPUT. |
1297 `--------------------------------*/
1300 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
1302 YYFPRINTF (yyoutput
, "%s %s (",
1303 yytype
< YYNTOKENS
? "token" : "nterm", yytname
[yytype
]);
1305 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
);
1306 YYFPRINTF (yyoutput
, ")");
1309 /*------------------------------------------------------------------.
1310 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1312 `------------------------------------------------------------------*/
1315 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1317 YYFPRINTF (stderr
, "Stack now");
1318 for (; yybottom
<= yytop
; yybottom
++)
1320 int yybot
= *yybottom
;
1321 YYFPRINTF (stderr
, " %d", yybot
);
1323 YYFPRINTF (stderr
, "\n");
1326 # define YY_STACK_PRINT(Bottom, Top) \
1329 yy_stack_print ((Bottom), (Top)); \
1333 /*------------------------------------------------.
1334 | Report that the YYRULE is going to be reduced. |
1335 `------------------------------------------------*/
1338 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, int yyrule
)
1340 unsigned long int yylno
= yyrline
[yyrule
];
1341 int yynrhs
= yyr2
[yyrule
];
1343 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1345 /* The symbols being reduced. */
1346 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1348 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1349 yy_symbol_print (stderr
,
1350 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1351 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1353 YYFPRINTF (stderr
, "\n");
1357 # define YY_REDUCE_PRINT(Rule) \
1360 yy_reduce_print (yyssp, yyvsp, Rule); \
1363 /* Nonzero means print parse trace. It is left uninitialized so that
1364 multiple parsers can coexist. */
1366 #else /* !YYDEBUG */
1367 # define YYDPRINTF(Args)
1368 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1369 # define YY_STACK_PRINT(Bottom, Top)
1370 # define YY_REDUCE_PRINT(Rule)
1371 #endif /* !YYDEBUG */
1374 /* YYINITDEPTH -- initial size of the parser's stacks. */
1376 # define YYINITDEPTH 200
1379 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1380 if the built-in stack extension method is used).
1382 Do not make this value too large; the results are undefined if
1383 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1384 evaluated with infinite-precision integer arithmetic. */
1387 # define YYMAXDEPTH 10000
1394 # if defined __GLIBC__ && defined _STRING_H
1395 # define yystrlen strlen
1397 /* Return the length of YYSTR. */
1399 yystrlen (const char *yystr
)
1402 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1410 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1411 # define yystpcpy stpcpy
1413 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1416 yystpcpy (char *yydest
, const char *yysrc
)
1419 const char *yys
= yysrc
;
1421 while ((*yyd
++ = *yys
++) != '\0')
1430 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1431 quotes and backslashes, so that it's suitable for yyerror. The
1432 heuristic is that double-quoting is unnecessary unless the string
1433 contains an apostrophe, a comma, or backslash (other than
1434 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1435 null, do not copy; instead, return the length of what the result
1438 yytnamerr (char *yyres
, const char *yystr
)
1443 char const *yyp
= yystr
;
1450 goto do_not_strip_quotes
;
1454 goto do_not_strip_quotes
;
1467 do_not_strip_quotes
: ;
1471 return yystrlen (yystr
);
1473 return yystpcpy (yyres
, yystr
) - yyres
;
1477 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1478 about the unexpected token YYTOKEN for the state stack whose top is
1481 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1482 not large enough to hold the message. In that case, also set
1483 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1484 required number of bytes is too large to store. */
1486 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1487 yytype_int16
*yyssp
, int yytoken
)
1489 YYSIZE_T yysize0
= yytnamerr (YY_NULLPTR
, yytname
[yytoken
]);
1490 YYSIZE_T yysize
= yysize0
;
1491 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1492 /* Internationalized format string. */
1493 const char *yyformat
= YY_NULLPTR
;
1494 /* Arguments of yyformat. */
1495 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1496 /* Number of reported tokens (one for the "unexpected", one per
1500 /* There are many possibilities here to consider:
1501 - If this state is a consistent state with a default action, then
1502 the only way this function was invoked is if the default action
1503 is an error action. In that case, don't check for expected
1504 tokens because there are none.
1505 - The only way there can be no lookahead present (in yychar) is if
1506 this state is a consistent state with a default action. Thus,
1507 detecting the absence of a lookahead is sufficient to determine
1508 that there is no unexpected or expected token to report. In that
1509 case, just report a simple "syntax error".
1510 - Don't assume there isn't a lookahead just because this state is a
1511 consistent state with a default action. There might have been a
1512 previous inconsistent state, consistent state with a non-default
1513 action, or user semantic action that manipulated yychar.
1514 - Of course, the expected token list depends on states to have
1515 correct lookahead information, and it depends on the parser not
1516 to perform extra reductions after fetching a lookahead from the
1517 scanner and before detecting a syntax error. Thus, state merging
1518 (from LALR or IELR) and default reductions corrupt the expected
1519 token list. However, the list is correct for canonical LR with
1520 one exception: it will still contain any token that will not be
1521 accepted due to an error action in a later state.
1523 if (yytoken
!= YYEMPTY
)
1525 int yyn
= yypact
[*yyssp
];
1526 yyarg
[yycount
++] = yytname
[yytoken
];
1527 if (!yypact_value_is_default (yyn
))
1529 /* Start YYX at -YYN if negative to avoid negative indexes in
1530 YYCHECK. In other words, skip the first -YYN actions for
1531 this state because they are default actions. */
1532 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1533 /* Stay within bounds of both yycheck and yytname. */
1534 int yychecklim
= YYLAST
- yyn
+ 1;
1535 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1538 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1539 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1540 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1542 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1548 yyarg
[yycount
++] = yytname
[yyx
];
1550 YYSIZE_T yysize1
= yysize
+ yytnamerr (YY_NULLPTR
, yytname
[yyx
]);
1551 if (! (yysize
<= yysize1
1552 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1562 # define YYCASE_(N, S) \
1566 YYCASE_(0, YY_("syntax error"));
1567 YYCASE_(1, YY_("syntax error, unexpected %s"));
1568 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1569 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1570 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1571 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1576 YYSIZE_T yysize1
= yysize
+ yystrlen (yyformat
);
1577 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1582 if (*yymsg_alloc
< yysize
)
1584 *yymsg_alloc
= 2 * yysize
;
1585 if (! (yysize
<= *yymsg_alloc
1586 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1587 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1591 /* Avoid sprintf, as that infringes on the user's name space.
1592 Don't have undefined behavior even if the translation
1593 produced a string with the wrong number of "%s"s. */
1597 while ((*yyp
= *yyformat
) != '\0')
1598 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1600 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1611 #endif /* YYERROR_VERBOSE */
1613 /*-----------------------------------------------.
1614 | Release the memory associated to this symbol. |
1615 `-----------------------------------------------*/
1618 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1623 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1625 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1627 YY_IGNORE_MAYBE_UNINITIALIZED_END
1633 /* The lookahead symbol. */
1636 /* The semantic value of the lookahead symbol. */
1638 /* Number of syntax errors so far. */
1650 /* Number of tokens to shift before error messages enabled. */
1653 /* The stacks and their tools:
1654 'yyss': related to states.
1655 'yyvs': related to semantic values.
1657 Refer to the stacks through separate pointers, to allow yyoverflow
1658 to reallocate them elsewhere. */
1660 /* The state stack. */
1661 yytype_int16 yyssa
[YYINITDEPTH
];
1663 yytype_int16
*yyssp
;
1665 /* The semantic value stack. */
1666 YYSTYPE yyvsa
[YYINITDEPTH
];
1670 YYSIZE_T yystacksize
;
1674 /* Lookahead token as an internal (translated) token number. */
1676 /* The variables used to return semantic value and location from the
1681 /* Buffer for error messages, and its allocated size. */
1683 char *yymsg
= yymsgbuf
;
1684 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1687 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1689 /* The number of symbols on the RHS of the reduced rule.
1690 Keep to zero when no symbol should be popped. */
1693 yyssp
= yyss
= yyssa
;
1694 yyvsp
= yyvs
= yyvsa
;
1695 yystacksize
= YYINITDEPTH
;
1697 YYDPRINTF ((stderr
, "Starting parse\n"));
1702 yychar
= YYEMPTY
; /* Cause a token to be read. */
1705 /*------------------------------------------------------------.
1706 | yynewstate -- Push a new state, which is found in yystate. |
1707 `------------------------------------------------------------*/
1709 /* In all cases, when you get here, the value and location stacks
1710 have just been pushed. So pushing a state here evens the stacks. */
1716 if (yyss
+ yystacksize
- 1 <= yyssp
)
1718 /* Get the current used size of the three stacks, in elements. */
1719 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1723 /* Give user a chance to reallocate the stack. Use copies of
1724 these so that the &'s don't force the real ones into
1726 YYSTYPE
*yyvs1
= yyvs
;
1727 yytype_int16
*yyss1
= yyss
;
1729 /* Each stack pointer address is followed by the size of the
1730 data in use in that stack, in bytes. This used to be a
1731 conditional around just the two extra args, but that might
1732 be undefined if yyoverflow is a macro. */
1733 yyoverflow (YY_("memory exhausted"),
1734 &yyss1
, yysize
* sizeof (*yyssp
),
1735 &yyvs1
, yysize
* sizeof (*yyvsp
),
1741 #else /* no yyoverflow */
1742 # ifndef YYSTACK_RELOCATE
1743 goto yyexhaustedlab
;
1745 /* Extend the stack our own way. */
1746 if (YYMAXDEPTH
<= yystacksize
)
1747 goto yyexhaustedlab
;
1749 if (YYMAXDEPTH
< yystacksize
)
1750 yystacksize
= YYMAXDEPTH
;
1753 yytype_int16
*yyss1
= yyss
;
1754 union yyalloc
*yyptr
=
1755 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1757 goto yyexhaustedlab
;
1758 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1759 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1760 # undef YYSTACK_RELOCATE
1762 YYSTACK_FREE (yyss1
);
1765 #endif /* no yyoverflow */
1767 yyssp
= yyss
+ yysize
- 1;
1768 yyvsp
= yyvs
+ yysize
- 1;
1770 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1771 (unsigned long int) yystacksize
));
1773 if (yyss
+ yystacksize
- 1 <= yyssp
)
1777 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1779 if (yystate
== YYFINAL
)
1789 /* Do appropriate processing given the current state. Read a
1790 lookahead token if we need one and don't already have one. */
1792 /* First try to decide what to do without reference to lookahead token. */
1793 yyn
= yypact
[yystate
];
1794 if (yypact_value_is_default (yyn
))
1797 /* Not known => get a lookahead token if don't already have one. */
1799 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1800 if (yychar
== YYEMPTY
)
1802 YYDPRINTF ((stderr
, "Reading a token: "));
1806 if (yychar
<= YYEOF
)
1808 yychar
= yytoken
= YYEOF
;
1809 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1813 yytoken
= YYTRANSLATE (yychar
);
1814 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1817 /* If the proper action on seeing token YYTOKEN is to reduce or to
1818 detect an error, take that action. */
1820 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1825 if (yytable_value_is_error (yyn
))
1831 /* Count tokens shifted since error; after three, turn off error
1836 /* Shift the lookahead token. */
1837 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1839 /* Discard the shifted token. */
1843 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1845 YY_IGNORE_MAYBE_UNINITIALIZED_END
1850 /*-----------------------------------------------------------.
1851 | yydefault -- do the default action for the current state. |
1852 `-----------------------------------------------------------*/
1854 yyn
= yydefact
[yystate
];
1860 /*-----------------------------.
1861 | yyreduce -- Do a reduction. |
1862 `-----------------------------*/
1864 /* yyn is the number of a rule to reduce with. */
1867 /* If YYLEN is nonzero, implement the default value of the action:
1870 Otherwise, the following line sets YYVAL to garbage.
1871 This behavior is undocumented and Bison
1872 users should not rely upon it. Assigning to YYVAL
1873 unconditionally makes the parser a bit smaller, and it avoids a
1874 GCC warning that YYVAL may be used uninitialized. */
1875 yyval
= yyvsp
[1-yylen
];
1878 YY_REDUCE_PRINT (yyn
);
1882 #line 312 "asmshader.y" /* yacc.c:1646 */
1884 asm_ctx
.funcs
->end(&asm_ctx
);
1886 #line 1891 "asmshader.tab.c" /* yacc.c:1646 */
1890 #line 317 "asmshader.y" /* yacc.c:1646 */
1892 TRACE("Vertex shader 1.0\n");
1893 create_vs10_parser(&asm_ctx
);
1895 #line 1900 "asmshader.tab.c" /* yacc.c:1646 */
1899 #line 322 "asmshader.y" /* yacc.c:1646 */
1901 TRACE("Vertex shader 1.1\n");
1902 create_vs11_parser(&asm_ctx
);
1904 #line 1909 "asmshader.tab.c" /* yacc.c:1646 */
1908 #line 327 "asmshader.y" /* yacc.c:1646 */
1910 TRACE("Vertex shader 2.0\n");
1911 create_vs20_parser(&asm_ctx
);
1913 #line 1918 "asmshader.tab.c" /* yacc.c:1646 */
1917 #line 332 "asmshader.y" /* yacc.c:1646 */
1919 TRACE("Vertex shader 2.x\n");
1920 create_vs2x_parser(&asm_ctx
);
1922 #line 1927 "asmshader.tab.c" /* yacc.c:1646 */
1926 #line 337 "asmshader.y" /* yacc.c:1646 */
1928 TRACE("Vertex shader 3.0\n");
1929 create_vs30_parser(&asm_ctx
);
1931 #line 1936 "asmshader.tab.c" /* yacc.c:1646 */
1935 #line 342 "asmshader.y" /* yacc.c:1646 */
1937 TRACE("Pixel shader 1.0\n");
1938 create_ps10_parser(&asm_ctx
);
1940 #line 1945 "asmshader.tab.c" /* yacc.c:1646 */
1944 #line 347 "asmshader.y" /* yacc.c:1646 */
1946 TRACE("Pixel shader 1.1\n");
1947 create_ps11_parser(&asm_ctx
);
1949 #line 1954 "asmshader.tab.c" /* yacc.c:1646 */
1953 #line 352 "asmshader.y" /* yacc.c:1646 */
1955 TRACE("Pixel shader 1.2\n");
1956 create_ps12_parser(&asm_ctx
);
1958 #line 1963 "asmshader.tab.c" /* yacc.c:1646 */
1962 #line 357 "asmshader.y" /* yacc.c:1646 */
1964 TRACE("Pixel shader 1.3\n");
1965 create_ps13_parser(&asm_ctx
);
1967 #line 1972 "asmshader.tab.c" /* yacc.c:1646 */
1971 #line 362 "asmshader.y" /* yacc.c:1646 */
1973 TRACE("Pixel shader 1.4\n");
1974 create_ps14_parser(&asm_ctx
);
1976 #line 1981 "asmshader.tab.c" /* yacc.c:1646 */
1980 #line 367 "asmshader.y" /* yacc.c:1646 */
1982 TRACE("Pixel shader 2.0\n");
1983 create_ps20_parser(&asm_ctx
);
1985 #line 1990 "asmshader.tab.c" /* yacc.c:1646 */
1989 #line 372 "asmshader.y" /* yacc.c:1646 */
1991 TRACE("Pixel shader 2.x\n");
1992 create_ps2x_parser(&asm_ctx
);
1994 #line 1999 "asmshader.tab.c" /* yacc.c:1646 */
1998 #line 377 "asmshader.y" /* yacc.c:1646 */
2000 TRACE("Pixel shader 3.0\n");
2001 create_ps30_parser(&asm_ctx
);
2003 #line 2008 "asmshader.tab.c" /* yacc.c:1646 */
2007 #line 384 "asmshader.y" /* yacc.c:1646 */
2011 #line 2016 "asmshader.tab.c" /* yacc.c:1646 */
2015 #line 389 "asmshader.y" /* yacc.c:1646 */
2019 #line 2024 "asmshader.tab.c" /* yacc.c:1646 */
2023 #line 393 "asmshader.y" /* yacc.c:1646 */
2025 TRACE("predicate\n");
2026 asm_ctx
.funcs
->predicate(&asm_ctx
, &(yyvsp
[-1].reg
));
2028 #line 2033 "asmshader.tab.c" /* yacc.c:1646 */
2032 #line 398 "asmshader.y" /* yacc.c:1646 */
2035 asm_ctx
.funcs
->coissue(&asm_ctx
);
2037 #line 2042 "asmshader.tab.c" /* yacc.c:1646 */
2041 #line 404 "asmshader.y" /* yacc.c:1646 */
2044 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_ADD
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2046 #line 2051 "asmshader.tab.c" /* yacc.c:1646 */
2050 #line 409 "asmshader.y" /* yacc.c:1646 */
2053 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_NOP
, 0, 0, 0, 0, 0, 0);
2055 #line 2060 "asmshader.tab.c" /* yacc.c:1646 */
2059 #line 414 "asmshader.y" /* yacc.c:1646 */
2062 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_MOV
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2064 #line 2069 "asmshader.tab.c" /* yacc.c:1646 */
2068 #line 419 "asmshader.y" /* yacc.c:1646 */
2071 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_SUB
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2073 #line 2078 "asmshader.tab.c" /* yacc.c:1646 */
2077 #line 424 "asmshader.y" /* yacc.c:1646 */
2080 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_MAD
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 3);
2082 #line 2087 "asmshader.tab.c" /* yacc.c:1646 */
2086 #line 429 "asmshader.y" /* yacc.c:1646 */
2089 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_MUL
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2091 #line 2096 "asmshader.tab.c" /* yacc.c:1646 */
2095 #line 434 "asmshader.y" /* yacc.c:1646 */
2098 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_RCP
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2100 #line 2105 "asmshader.tab.c" /* yacc.c:1646 */
2104 #line 439 "asmshader.y" /* yacc.c:1646 */
2107 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_RSQ
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2109 #line 2114 "asmshader.tab.c" /* yacc.c:1646 */
2113 #line 444 "asmshader.y" /* yacc.c:1646 */
2116 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_DP3
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2118 #line 2123 "asmshader.tab.c" /* yacc.c:1646 */
2122 #line 449 "asmshader.y" /* yacc.c:1646 */
2125 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_DP4
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2127 #line 2132 "asmshader.tab.c" /* yacc.c:1646 */
2131 #line 454 "asmshader.y" /* yacc.c:1646 */
2134 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_MIN
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2136 #line 2141 "asmshader.tab.c" /* yacc.c:1646 */
2140 #line 459 "asmshader.y" /* yacc.c:1646 */
2143 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_MAX
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2145 #line 2150 "asmshader.tab.c" /* yacc.c:1646 */
2149 #line 464 "asmshader.y" /* yacc.c:1646 */
2152 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_SLT
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2154 #line 2159 "asmshader.tab.c" /* yacc.c:1646 */
2158 #line 469 "asmshader.y" /* yacc.c:1646 */
2161 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_SGE
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2163 #line 2168 "asmshader.tab.c" /* yacc.c:1646 */
2167 #line 474 "asmshader.y" /* yacc.c:1646 */
2170 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_ABS
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2172 #line 2177 "asmshader.tab.c" /* yacc.c:1646 */
2176 #line 479 "asmshader.y" /* yacc.c:1646 */
2179 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_EXP
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2181 #line 2186 "asmshader.tab.c" /* yacc.c:1646 */
2185 #line 484 "asmshader.y" /* yacc.c:1646 */
2188 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_LOG
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2190 #line 2195 "asmshader.tab.c" /* yacc.c:1646 */
2194 #line 489 "asmshader.y" /* yacc.c:1646 */
2197 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_LOGP
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2199 #line 2204 "asmshader.tab.c" /* yacc.c:1646 */
2203 #line 494 "asmshader.y" /* yacc.c:1646 */
2206 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_EXPP
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2208 #line 2213 "asmshader.tab.c" /* yacc.c:1646 */
2212 #line 499 "asmshader.y" /* yacc.c:1646 */
2215 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_DST
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2217 #line 2222 "asmshader.tab.c" /* yacc.c:1646 */
2221 #line 504 "asmshader.y" /* yacc.c:1646 */
2224 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_LRP
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 3);
2226 #line 2231 "asmshader.tab.c" /* yacc.c:1646 */
2230 #line 509 "asmshader.y" /* yacc.c:1646 */
2233 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_FRC
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2235 #line 2240 "asmshader.tab.c" /* yacc.c:1646 */
2239 #line 514 "asmshader.y" /* yacc.c:1646 */
2242 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_POW
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2244 #line 2249 "asmshader.tab.c" /* yacc.c:1646 */
2248 #line 519 "asmshader.y" /* yacc.c:1646 */
2251 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_CRS
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2253 #line 2258 "asmshader.tab.c" /* yacc.c:1646 */
2257 #line 524 "asmshader.y" /* yacc.c:1646 */
2260 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_SGN
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 3);
2262 #line 2267 "asmshader.tab.c" /* yacc.c:1646 */
2266 #line 529 "asmshader.y" /* yacc.c:1646 */
2269 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_NRM
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2271 #line 2276 "asmshader.tab.c" /* yacc.c:1646 */
2275 #line 534 "asmshader.y" /* yacc.c:1646 */
2278 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_SINCOS
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2280 #line 2285 "asmshader.tab.c" /* yacc.c:1646 */
2284 #line 539 "asmshader.y" /* yacc.c:1646 */
2287 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_M4x4
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2289 #line 2294 "asmshader.tab.c" /* yacc.c:1646 */
2293 #line 544 "asmshader.y" /* yacc.c:1646 */
2296 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_M4x3
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2298 #line 2303 "asmshader.tab.c" /* yacc.c:1646 */
2302 #line 549 "asmshader.y" /* yacc.c:1646 */
2305 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_M3x4
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2307 #line 2312 "asmshader.tab.c" /* yacc.c:1646 */
2311 #line 554 "asmshader.y" /* yacc.c:1646 */
2314 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_M3x3
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2316 #line 2321 "asmshader.tab.c" /* yacc.c:1646 */
2320 #line 559 "asmshader.y" /* yacc.c:1646 */
2323 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_M3x2
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2325 #line 2330 "asmshader.tab.c" /* yacc.c:1646 */
2329 #line 564 "asmshader.y" /* yacc.c:1646 */
2331 struct shader_reg reg
;
2332 TRACE("Output reg declaration\n");
2333 ZeroMemory(®
, sizeof(reg
));
2334 reg
.type
= BWRITERSPR_OUTPUT
;
2335 reg
.regnum
= (yyvsp
[0].regnum
);
2338 reg
.u
.writemask
= BWRITERSP_WRITEMASK_ALL
;
2339 asm_ctx
.funcs
->dcl_output(&asm_ctx
, (yyvsp
[-1].declaration
).dclusage
, (yyvsp
[-1].declaration
).regnum
, ®
);
2341 #line 2346 "asmshader.tab.c" /* yacc.c:1646 */
2345 #line 576 "asmshader.y" /* yacc.c:1646 */
2347 struct shader_reg reg
;
2348 TRACE("Output reg declaration\n");
2349 ZeroMemory(®
, sizeof(reg
));
2350 reg
.type
= BWRITERSPR_OUTPUT
;
2351 reg
.regnum
= (yyvsp
[-1].regnum
);
2354 reg
.u
.writemask
= (yyvsp
[0].writemask
);
2355 asm_ctx
.funcs
->dcl_output(&asm_ctx
, (yyvsp
[-2].declaration
).dclusage
, (yyvsp
[-2].declaration
).regnum
, ®
);
2357 #line 2362 "asmshader.tab.c" /* yacc.c:1646 */
2361 #line 588 "asmshader.y" /* yacc.c:1646 */
2363 struct shader_reg reg
;
2364 TRACE("Input reg declaration\n");
2365 if((yyvsp
[-1].modshift
).shift
!= 0) {
2366 asmparser_message(&asm_ctx
, "Line %u: Shift modifier not allowed here\n",
2368 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
2370 if(asm_ctx
.shader
->version
== BWRITERPS_VERSION(2, 0) ||
2371 asm_ctx
.shader
->version
== BWRITERPS_VERSION(2, 1)) {
2372 asmparser_message(&asm_ctx
, "Line %u: Declaration not supported in PS 2\n",
2374 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
2376 ZeroMemory(®
, sizeof(reg
));
2377 reg
.type
= (yyvsp
[0].reg
).type
;
2378 reg
.regnum
= (yyvsp
[0].reg
).regnum
;
2381 reg
.u
.writemask
= BWRITERSP_WRITEMASK_ALL
;
2382 asm_ctx
.funcs
->dcl_input(&asm_ctx
, (yyvsp
[-2].declaration
).dclusage
, (yyvsp
[-2].declaration
).regnum
, (yyvsp
[-1].modshift
).mod
, ®
);
2384 #line 2389 "asmshader.tab.c" /* yacc.c:1646 */
2388 #line 611 "asmshader.y" /* yacc.c:1646 */
2390 struct shader_reg reg
;
2391 TRACE("Input reg declaration\n");
2392 if((yyvsp
[-2].modshift
).shift
!= 0) {
2393 asmparser_message(&asm_ctx
, "Line %u: Shift modifier not allowed here\n",
2395 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
2397 if(asm_ctx
.shader
->version
== BWRITERPS_VERSION(2, 0) ||
2398 asm_ctx
.shader
->version
== BWRITERPS_VERSION(2, 1)) {
2399 asmparser_message(&asm_ctx
, "Line %u: Declaration not supported in PS 2\n",
2401 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
2403 ZeroMemory(®
, sizeof(reg
));
2404 reg
.type
= (yyvsp
[-1].reg
).type
;
2405 reg
.regnum
= (yyvsp
[-1].reg
).regnum
;
2408 reg
.u
.writemask
= (yyvsp
[0].writemask
);
2409 asm_ctx
.funcs
->dcl_input(&asm_ctx
, (yyvsp
[-3].declaration
).dclusage
, (yyvsp
[-3].declaration
).regnum
, (yyvsp
[-2].modshift
).mod
, ®
);
2411 #line 2416 "asmshader.tab.c" /* yacc.c:1646 */
2415 #line 634 "asmshader.y" /* yacc.c:1646 */
2417 struct shader_reg reg
;
2418 TRACE("Input reg declaration\n");
2419 if((yyvsp
[-1].modshift
).shift
!= 0) {
2420 asmparser_message(&asm_ctx
, "Line %u: Shift modifier not allowed here\n",
2422 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
2424 if(asm_ctx
.shader
->type
!= ST_PIXEL
) {
2425 asmparser_message(&asm_ctx
, "Line %u: Declaration needs a semantic\n",
2427 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
2429 ZeroMemory(®
, sizeof(reg
));
2430 reg
.type
= (yyvsp
[0].reg
).type
;
2431 reg
.regnum
= (yyvsp
[0].reg
).regnum
;
2434 reg
.u
.writemask
= BWRITERSP_WRITEMASK_ALL
;
2435 asm_ctx
.funcs
->dcl_input(&asm_ctx
, 0, 0, (yyvsp
[-1].modshift
).mod
, ®
);
2437 #line 2442 "asmshader.tab.c" /* yacc.c:1646 */
2441 #line 656 "asmshader.y" /* yacc.c:1646 */
2443 struct shader_reg reg
;
2444 TRACE("Input reg declaration\n");
2445 if((yyvsp
[-2].modshift
).shift
!= 0) {
2446 asmparser_message(&asm_ctx
, "Line %u: Shift modifier not allowed here\n",
2448 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
2450 if(asm_ctx
.shader
->type
!= ST_PIXEL
) {
2451 asmparser_message(&asm_ctx
, "Line %u: Declaration needs a semantic\n",
2453 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
2455 ZeroMemory(®
, sizeof(reg
));
2456 reg
.type
= (yyvsp
[-1].reg
).type
;
2457 reg
.regnum
= (yyvsp
[-1].reg
).regnum
;
2460 reg
.u
.writemask
= (yyvsp
[0].writemask
);
2461 asm_ctx
.funcs
->dcl_input(&asm_ctx
, 0, 0, (yyvsp
[-2].modshift
).mod
, ®
);
2463 #line 2468 "asmshader.tab.c" /* yacc.c:1646 */
2467 #line 678 "asmshader.y" /* yacc.c:1646 */
2469 TRACE("Sampler declared\n");
2470 if((yyvsp
[-1].modshift
).shift
!= 0) {
2471 asmparser_message(&asm_ctx
, "Line %u: Shift modifier not allowed here\n",
2473 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
2475 asm_ctx
.funcs
->dcl_sampler(&asm_ctx
, (yyvsp
[-2].samplertype
), (yyvsp
[-1].modshift
).mod
, (yyvsp
[0].regnum
), asm_ctx
.line_no
);
2477 #line 2482 "asmshader.tab.c" /* yacc.c:1646 */
2481 #line 688 "asmshader.y" /* yacc.c:1646 */
2483 TRACE("Sampler declared\n");
2484 if((yyvsp
[-1].modshift
).shift
!= 0) {
2485 asmparser_message(&asm_ctx
, "Line %u: Shift modifier not allowed here\n",
2487 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
2489 if(asm_ctx
.shader
->type
!= ST_PIXEL
) {
2490 asmparser_message(&asm_ctx
, "Line %u: Declaration needs a sampler type\n",
2492 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
2494 asm_ctx
.funcs
->dcl_sampler(&asm_ctx
, BWRITERSTT_UNKNOWN
, (yyvsp
[-1].modshift
).mod
, (yyvsp
[0].regnum
), asm_ctx
.line_no
);
2496 #line 2501 "asmshader.tab.c" /* yacc.c:1646 */
2500 #line 703 "asmshader.y" /* yacc.c:1646 */
2502 TRACE("Error rule: sampler decl of input reg\n");
2503 asmparser_message(&asm_ctx
, "Line %u: Sampler declarations of input regs is not valid\n",
2505 set_parse_status(&asm_ctx
.status
, PARSE_WARN
);
2507 #line 2512 "asmshader.tab.c" /* yacc.c:1646 */
2511 #line 710 "asmshader.y" /* yacc.c:1646 */
2513 TRACE("Error rule: sampler decl of output reg\n");
2514 asmparser_message(&asm_ctx
, "Line %u: Sampler declarations of output regs is not valid\n",
2516 set_parse_status(&asm_ctx
.status
, PARSE_WARN
);
2518 #line 2523 "asmshader.tab.c" /* yacc.c:1646 */
2522 #line 717 "asmshader.y" /* yacc.c:1646 */
2524 asm_ctx
.funcs
->constF(&asm_ctx
, (yyvsp
[-8].regnum
), (yyvsp
[-6].immval
).val
, (yyvsp
[-4].immval
).val
, (yyvsp
[-2].immval
).val
, (yyvsp
[0].immval
).val
);
2526 #line 2531 "asmshader.tab.c" /* yacc.c:1646 */
2530 #line 721 "asmshader.y" /* yacc.c:1646 */
2532 asm_ctx
.funcs
->constI(&asm_ctx
, (yyvsp
[-8].regnum
), (yyvsp
[-6].immval
).val
, (yyvsp
[-4].immval
).val
, (yyvsp
[-2].immval
).val
, (yyvsp
[0].immval
).val
);
2534 #line 2539 "asmshader.tab.c" /* yacc.c:1646 */
2538 #line 725 "asmshader.y" /* yacc.c:1646 */
2540 asm_ctx
.funcs
->constB(&asm_ctx
, (yyvsp
[-2].regnum
), (yyvsp
[0].immbool
));
2542 #line 2547 "asmshader.tab.c" /* yacc.c:1646 */
2546 #line 729 "asmshader.y" /* yacc.c:1646 */
2549 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_REP
, 0, 0, 0, 0, &(yyvsp
[0].sregs
), 1);
2551 #line 2556 "asmshader.tab.c" /* yacc.c:1646 */
2555 #line 734 "asmshader.y" /* yacc.c:1646 */
2558 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_ENDREP
, 0, 0, 0, 0, 0, 0);
2560 #line 2565 "asmshader.tab.c" /* yacc.c:1646 */
2564 #line 739 "asmshader.y" /* yacc.c:1646 */
2567 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_IF
, 0, 0, 0, 0, &(yyvsp
[0].sregs
), 1);
2569 #line 2574 "asmshader.tab.c" /* yacc.c:1646 */
2573 #line 744 "asmshader.y" /* yacc.c:1646 */
2576 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_IFC
, 0, 0, (yyvsp
[-1].comptype
), 0, &(yyvsp
[0].sregs
), 2);
2578 #line 2583 "asmshader.tab.c" /* yacc.c:1646 */
2582 #line 749 "asmshader.y" /* yacc.c:1646 */
2585 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_ELSE
, 0, 0, 0, 0, 0, 0);
2587 #line 2592 "asmshader.tab.c" /* yacc.c:1646 */
2591 #line 754 "asmshader.y" /* yacc.c:1646 */
2594 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_ENDIF
, 0, 0, 0, 0, 0, 0);
2596 #line 2601 "asmshader.tab.c" /* yacc.c:1646 */
2600 #line 759 "asmshader.y" /* yacc.c:1646 */
2603 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_BREAK
, 0, 0, 0, 0, 0, 0);
2605 #line 2610 "asmshader.tab.c" /* yacc.c:1646 */
2609 #line 764 "asmshader.y" /* yacc.c:1646 */
2612 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_BREAKC
, 0, 0, (yyvsp
[-1].comptype
), 0, &(yyvsp
[0].sregs
), 2);
2614 #line 2619 "asmshader.tab.c" /* yacc.c:1646 */
2618 #line 769 "asmshader.y" /* yacc.c:1646 */
2621 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_BREAKP
, 0, 0, 0, 0, &(yyvsp
[0].sregs
), 1);
2623 #line 2628 "asmshader.tab.c" /* yacc.c:1646 */
2627 #line 774 "asmshader.y" /* yacc.c:1646 */
2630 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_CALL
, 0, 0, 0, 0, &(yyvsp
[0].sregs
), 1);
2632 #line 2637 "asmshader.tab.c" /* yacc.c:1646 */
2636 #line 779 "asmshader.y" /* yacc.c:1646 */
2639 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_CALLNZ
, 0, 0, 0, 0, &(yyvsp
[0].sregs
), 2);
2641 #line 2646 "asmshader.tab.c" /* yacc.c:1646 */
2645 #line 784 "asmshader.y" /* yacc.c:1646 */
2648 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_LOOP
, 0, 0, 0, 0, &(yyvsp
[0].sregs
), 2);
2650 #line 2655 "asmshader.tab.c" /* yacc.c:1646 */
2654 #line 789 "asmshader.y" /* yacc.c:1646 */
2657 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_RET
, 0, 0, 0, 0, 0, 0);
2659 #line 2664 "asmshader.tab.c" /* yacc.c:1646 */
2663 #line 794 "asmshader.y" /* yacc.c:1646 */
2666 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_ENDLOOP
, 0, 0, 0, 0, 0, 0);
2668 #line 2673 "asmshader.tab.c" /* yacc.c:1646 */
2672 #line 799 "asmshader.y" /* yacc.c:1646 */
2675 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_LABEL
, 0, 0, 0, 0, &(yyvsp
[0].sregs
), 1);
2677 #line 2682 "asmshader.tab.c" /* yacc.c:1646 */
2681 #line 804 "asmshader.y" /* yacc.c:1646 */
2684 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_SETP
, 0, 0, (yyvsp
[-3].comptype
), &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2686 #line 2691 "asmshader.tab.c" /* yacc.c:1646 */
2690 #line 809 "asmshader.y" /* yacc.c:1646 */
2693 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXLDL
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2695 #line 2700 "asmshader.tab.c" /* yacc.c:1646 */
2699 #line 814 "asmshader.y" /* yacc.c:1646 */
2702 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_LIT
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2704 #line 2709 "asmshader.tab.c" /* yacc.c:1646 */
2708 #line 819 "asmshader.y" /* yacc.c:1646 */
2711 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_MOVA
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2713 #line 2718 "asmshader.tab.c" /* yacc.c:1646 */
2717 #line 824 "asmshader.y" /* yacc.c:1646 */
2720 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_CND
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 3);
2722 #line 2727 "asmshader.tab.c" /* yacc.c:1646 */
2726 #line 829 "asmshader.y" /* yacc.c:1646 */
2729 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_CMP
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 3);
2731 #line 2736 "asmshader.tab.c" /* yacc.c:1646 */
2735 #line 834 "asmshader.y" /* yacc.c:1646 */
2738 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_DP2ADD
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 3);
2740 #line 2745 "asmshader.tab.c" /* yacc.c:1646 */
2744 #line 839 "asmshader.y" /* yacc.c:1646 */
2746 TRACE("TEXCOORD\n");
2747 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXCOORD
, (yyvsp
[-1].modshift
).mod
, (yyvsp
[-1].modshift
).shift
, 0, &(yyvsp
[0].reg
), 0, 0);
2749 #line 2754 "asmshader.tab.c" /* yacc.c:1646 */
2753 #line 844 "asmshader.y" /* yacc.c:1646 */
2756 /* texcoord and texcrd share the same opcode */
2757 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXCOORD
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2759 #line 2764 "asmshader.tab.c" /* yacc.c:1646 */
2763 #line 850 "asmshader.y" /* yacc.c:1646 */
2766 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXKILL
, 0, 0, 0, &(yyvsp
[0].reg
), 0, 0);
2768 #line 2773 "asmshader.tab.c" /* yacc.c:1646 */
2772 #line 855 "asmshader.y" /* yacc.c:1646 */
2775 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEX
, (yyvsp
[-1].modshift
).mod
, (yyvsp
[-1].modshift
).shift
, 0, &(yyvsp
[0].reg
), 0, 0);
2777 #line 2782 "asmshader.tab.c" /* yacc.c:1646 */
2781 #line 860 "asmshader.y" /* yacc.c:1646 */
2783 TRACE("TEXDEPTH\n");
2784 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXDEPTH
, (yyvsp
[-1].modshift
).mod
, (yyvsp
[-1].modshift
).shift
, 0, &(yyvsp
[0].reg
), 0, 0);
2786 #line 2791 "asmshader.tab.c" /* yacc.c:1646 */
2790 #line 865 "asmshader.y" /* yacc.c:1646 */
2793 /* There is more than one acceptable syntax for texld:
2794 with 1 sreg (PS 1.4) or
2795 with 2 sregs (PS 2.0+)
2796 Moreover, texld shares the same opcode as the tex instruction,
2797 so there are a total of 3 valid syntaxes
2798 These variations are handled in asmparser.c */
2799 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEX
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2801 #line 2806 "asmshader.tab.c" /* yacc.c:1646 */
2805 #line 876 "asmshader.y" /* yacc.c:1646 */
2808 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXLDP
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2810 #line 2815 "asmshader.tab.c" /* yacc.c:1646 */
2814 #line 881 "asmshader.y" /* yacc.c:1646 */
2817 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXLDB
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2819 #line 2824 "asmshader.tab.c" /* yacc.c:1646 */
2823 #line 886 "asmshader.y" /* yacc.c:1646 */
2826 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXBEM
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2828 #line 2833 "asmshader.tab.c" /* yacc.c:1646 */
2832 #line 891 "asmshader.y" /* yacc.c:1646 */
2835 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXBEML
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2837 #line 2842 "asmshader.tab.c" /* yacc.c:1646 */
2841 #line 896 "asmshader.y" /* yacc.c:1646 */
2843 TRACE("TEXREG2AR\n");
2844 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXREG2AR
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2846 #line 2851 "asmshader.tab.c" /* yacc.c:1646 */
2850 #line 901 "asmshader.y" /* yacc.c:1646 */
2852 TRACE("TEXREG2GB\n");
2853 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXREG2GB
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2855 #line 2860 "asmshader.tab.c" /* yacc.c:1646 */
2859 #line 906 "asmshader.y" /* yacc.c:1646 */
2861 TRACE("TEXREG2RGB\n");
2862 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXREG2RGB
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2864 #line 2869 "asmshader.tab.c" /* yacc.c:1646 */
2868 #line 911 "asmshader.y" /* yacc.c:1646 */
2870 TRACE("TEXM3x2PAD\n");
2871 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXM3x2PAD
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2873 #line 2878 "asmshader.tab.c" /* yacc.c:1646 */
2877 #line 916 "asmshader.y" /* yacc.c:1646 */
2879 TRACE("INSTR_TEXM3x3PAD\n");
2880 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXM3x3PAD
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2882 #line 2887 "asmshader.tab.c" /* yacc.c:1646 */
2886 #line 921 "asmshader.y" /* yacc.c:1646 */
2888 TRACE("TEXM3x3SPEC\n");
2889 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXM3x3SPEC
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2891 #line 2896 "asmshader.tab.c" /* yacc.c:1646 */
2895 #line 926 "asmshader.y" /* yacc.c:1646 */
2897 TRACE("TEXM3x3VSPEC\n");
2898 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXM3x3VSPEC
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2900 #line 2905 "asmshader.tab.c" /* yacc.c:1646 */
2904 #line 931 "asmshader.y" /* yacc.c:1646 */
2906 TRACE("TEXM3x3TEX\n");
2907 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXM3x3TEX
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2909 #line 2914 "asmshader.tab.c" /* yacc.c:1646 */
2913 #line 936 "asmshader.y" /* yacc.c:1646 */
2915 TRACE("TEXDP3TEX\n");
2916 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXDP3TEX
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2918 #line 2923 "asmshader.tab.c" /* yacc.c:1646 */
2922 #line 941 "asmshader.y" /* yacc.c:1646 */
2924 TRACE("TEXM3x2DEPTH\n");
2925 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXM3x2DEPTH
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2927 #line 2932 "asmshader.tab.c" /* yacc.c:1646 */
2931 #line 946 "asmshader.y" /* yacc.c:1646 */
2933 TRACE("TEXM3x2TEX\n");
2934 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXM3x2TEX
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2936 #line 2941 "asmshader.tab.c" /* yacc.c:1646 */
2940 #line 951 "asmshader.y" /* yacc.c:1646 */
2943 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXDP3
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2945 #line 2950 "asmshader.tab.c" /* yacc.c:1646 */
2949 #line 956 "asmshader.y" /* yacc.c:1646 */
2952 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXM3x3
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2954 #line 2959 "asmshader.tab.c" /* yacc.c:1646 */
2958 #line 961 "asmshader.y" /* yacc.c:1646 */
2961 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_BEM
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 2);
2963 #line 2968 "asmshader.tab.c" /* yacc.c:1646 */
2967 #line 966 "asmshader.y" /* yacc.c:1646 */
2970 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_DSX
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2972 #line 2977 "asmshader.tab.c" /* yacc.c:1646 */
2976 #line 971 "asmshader.y" /* yacc.c:1646 */
2979 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_DSY
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 1);
2981 #line 2986 "asmshader.tab.c" /* yacc.c:1646 */
2985 #line 976 "asmshader.y" /* yacc.c:1646 */
2988 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_TEXLDD
, (yyvsp
[-3].modshift
).mod
, (yyvsp
[-3].modshift
).shift
, 0, &(yyvsp
[-2].reg
), &(yyvsp
[0].sregs
), 4);
2990 #line 2995 "asmshader.tab.c" /* yacc.c:1646 */
2994 #line 981 "asmshader.y" /* yacc.c:1646 */
2997 asm_ctx
.funcs
->instr(&asm_ctx
, BWRITERSIO_PHASE
, 0, 0, 0, 0, 0, 0);
2999 #line 3004 "asmshader.tab.c" /* yacc.c:1646 */
3003 #line 988 "asmshader.y" /* yacc.c:1646 */
3005 (yyval
.reg
).regnum
= (yyvsp
[-1].reg
).regnum
;
3006 (yyval
.reg
).type
= (yyvsp
[-1].reg
).type
;
3007 (yyval
.reg
).u
.writemask
= BWRITERSP_WRITEMASK_ALL
;
3008 (yyval
.reg
).srcmod
= BWRITERSPSM_NONE
;
3009 set_rel_reg(&(yyval
.reg
), &(yyvsp
[0].rel_reg
));
3011 #line 3016 "asmshader.tab.c" /* yacc.c:1646 */
3015 #line 996 "asmshader.y" /* yacc.c:1646 */
3017 (yyval
.reg
).regnum
= (yyvsp
[-1].reg
).regnum
;
3018 (yyval
.reg
).type
= (yyvsp
[-1].reg
).type
;
3019 (yyval
.reg
).u
.writemask
= (yyvsp
[0].writemask
);
3020 (yyval
.reg
).srcmod
= BWRITERSPSM_NONE
;
3021 (yyval
.reg
).rel_reg
= NULL
;
3023 #line 3028 "asmshader.tab.c" /* yacc.c:1646 */
3027 #line 1005 "asmshader.y" /* yacc.c:1646 */
3029 (yyval
.reg
).regnum
= (yyvsp
[0].regnum
); (yyval
.reg
).type
= BWRITERSPR_TEMP
;
3031 #line 3036 "asmshader.tab.c" /* yacc.c:1646 */
3035 #line 1009 "asmshader.y" /* yacc.c:1646 */
3037 (yyval
.reg
).regnum
= (yyvsp
[0].regnum
); (yyval
.reg
).type
= BWRITERSPR_OUTPUT
;
3039 #line 3044 "asmshader.tab.c" /* yacc.c:1646 */
3043 #line 1013 "asmshader.y" /* yacc.c:1646 */
3045 (yyval
.reg
).regnum
= (yyvsp
[0].regnum
); (yyval
.reg
).type
= BWRITERSPR_INPUT
;
3047 #line 3052 "asmshader.tab.c" /* yacc.c:1646 */
3051 #line 1017 "asmshader.y" /* yacc.c:1646 */
3053 asmparser_message(&asm_ctx
, "Line %u: Register c%u is not a valid destination register\n",
3054 asm_ctx
.line_no
, (yyvsp
[0].regnum
));
3055 set_parse_status(&asm_ctx
.status
, PARSE_WARN
);
3057 #line 3062 "asmshader.tab.c" /* yacc.c:1646 */
3061 #line 1023 "asmshader.y" /* yacc.c:1646 */
3063 asmparser_message(&asm_ctx
, "Line %u: Register i%u is not a valid destination register\n",
3064 asm_ctx
.line_no
, (yyvsp
[0].regnum
));
3065 set_parse_status(&asm_ctx
.status
, PARSE_WARN
);
3067 #line 3072 "asmshader.tab.c" /* yacc.c:1646 */
3071 #line 1029 "asmshader.y" /* yacc.c:1646 */
3073 asmparser_message(&asm_ctx
, "Line %u: Register b%u is not a valid destination register\n",
3074 asm_ctx
.line_no
, (yyvsp
[0].regnum
));
3075 set_parse_status(&asm_ctx
.status
, PARSE_WARN
);
3077 #line 3082 "asmshader.tab.c" /* yacc.c:1646 */
3081 #line 1035 "asmshader.y" /* yacc.c:1646 */
3083 (yyval
.reg
).regnum
= (yyvsp
[0].regnum
); (yyval
.reg
).type
= BWRITERSPR_TEXTURE
;
3085 #line 3090 "asmshader.tab.c" /* yacc.c:1646 */
3089 #line 1039 "asmshader.y" /* yacc.c:1646 */
3091 (yyval
.reg
).regnum
= (yyvsp
[0].regnum
); (yyval
.reg
).type
= BWRITERSPR_TEXCRDOUT
;
3093 #line 3098 "asmshader.tab.c" /* yacc.c:1646 */
3097 #line 1043 "asmshader.y" /* yacc.c:1646 */
3099 asmparser_message(&asm_ctx
, "Line %u: Register s%u is not a valid destination register\n",
3100 asm_ctx
.line_no
, (yyvsp
[0].regnum
));
3101 set_parse_status(&asm_ctx
.status
, PARSE_WARN
);
3103 #line 3108 "asmshader.tab.c" /* yacc.c:1646 */
3107 #line 1049 "asmshader.y" /* yacc.c:1646 */
3109 (yyval
.reg
).regnum
= BWRITERSRO_POSITION
; (yyval
.reg
).type
= BWRITERSPR_RASTOUT
;
3111 #line 3116 "asmshader.tab.c" /* yacc.c:1646 */
3115 #line 1053 "asmshader.y" /* yacc.c:1646 */
3117 (yyval
.reg
).regnum
= BWRITERSRO_POINT_SIZE
; (yyval
.reg
).type
= BWRITERSPR_RASTOUT
;
3119 #line 3124 "asmshader.tab.c" /* yacc.c:1646 */
3123 #line 1057 "asmshader.y" /* yacc.c:1646 */
3125 (yyval
.reg
).regnum
= BWRITERSRO_FOG
; (yyval
.reg
).type
= BWRITERSPR_RASTOUT
;
3127 #line 3132 "asmshader.tab.c" /* yacc.c:1646 */
3131 #line 1061 "asmshader.y" /* yacc.c:1646 */
3133 (yyval
.reg
).regnum
= (yyvsp
[0].regnum
); (yyval
.reg
).type
= BWRITERSPR_ATTROUT
;
3135 #line 3140 "asmshader.tab.c" /* yacc.c:1646 */
3139 #line 1065 "asmshader.y" /* yacc.c:1646 */
3141 (yyval
.reg
).regnum
= (yyvsp
[0].regnum
); (yyval
.reg
).type
= BWRITERSPR_COLOROUT
;
3143 #line 3148 "asmshader.tab.c" /* yacc.c:1646 */
3147 #line 1069 "asmshader.y" /* yacc.c:1646 */
3149 (yyval
.reg
).regnum
= 0; (yyval
.reg
).type
= BWRITERSPR_DEPTHOUT
;
3151 #line 3156 "asmshader.tab.c" /* yacc.c:1646 */
3155 #line 1073 "asmshader.y" /* yacc.c:1646 */
3157 (yyval
.reg
).regnum
= 0; (yyval
.reg
).type
= BWRITERSPR_PREDICATE
;
3159 #line 3164 "asmshader.tab.c" /* yacc.c:1646 */
3163 #line 1077 "asmshader.y" /* yacc.c:1646 */
3165 asmparser_message(&asm_ctx
, "Line %u: Register vPos is not a valid destination register\n",
3167 set_parse_status(&asm_ctx
.status
, PARSE_WARN
);
3169 #line 3174 "asmshader.tab.c" /* yacc.c:1646 */
3173 #line 1083 "asmshader.y" /* yacc.c:1646 */
3175 asmparser_message(&asm_ctx
, "Line %u: Register vFace is not a valid destination register\n",
3177 set_parse_status(&asm_ctx
.status
, PARSE_WARN
);
3179 #line 3184 "asmshader.tab.c" /* yacc.c:1646 */
3183 #line 1089 "asmshader.y" /* yacc.c:1646 */
3185 /* index 0 is hardcoded for the addr register */
3186 (yyval
.reg
).regnum
= 0; (yyval
.reg
).type
= BWRITERSPR_ADDR
;
3188 #line 3193 "asmshader.tab.c" /* yacc.c:1646 */
3192 #line 1094 "asmshader.y" /* yacc.c:1646 */
3194 asmparser_message(&asm_ctx
, "Line %u: Register aL is not a valid destination register\n",
3196 set_parse_status(&asm_ctx
.status
, PARSE_WARN
);
3198 #line 3203 "asmshader.tab.c" /* yacc.c:1646 */
3202 #line 1101 "asmshader.y" /* yacc.c:1646 */
3204 if((yyvsp
[0].wm_components
).writemask
== SWIZZLE_ERR
) {
3205 asmparser_message(&asm_ctx
, "Line %u: Invalid writemask specified\n",
3207 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
3208 /* Provide a correct writemask to prevent following complaints */
3209 (yyval
.writemask
) = BWRITERSP_WRITEMASK_ALL
;
3212 (yyval
.writemask
) = (yyvsp
[0].wm_components
).writemask
;
3213 TRACE("Writemask: %x\n", (yyval
.writemask
));
3216 #line 3221 "asmshader.tab.c" /* yacc.c:1646 */
3220 #line 1116 "asmshader.y" /* yacc.c:1646 */
3222 (yyval
.wm_components
).writemask
= 1 << (yyvsp
[0].component
);
3223 (yyval
.wm_components
).last
= (yyvsp
[0].component
);
3224 (yyval
.wm_components
).idx
= 1;
3226 #line 3231 "asmshader.tab.c" /* yacc.c:1646 */
3230 #line 1122 "asmshader.y" /* yacc.c:1646 */
3232 if((yyvsp
[-1].wm_components
).writemask
== SWIZZLE_ERR
|| (yyvsp
[-1].wm_components
).idx
== 4)
3233 /* Wrong writemask */
3234 (yyval
.wm_components
).writemask
= SWIZZLE_ERR
;
3236 if((yyvsp
[0].component
) <= (yyvsp
[-1].wm_components
).last
)
3237 (yyval
.wm_components
).writemask
= SWIZZLE_ERR
;
3239 (yyval
.wm_components
).writemask
= (yyvsp
[-1].wm_components
).writemask
| (1 << (yyvsp
[0].component
));
3240 (yyval
.wm_components
).idx
= (yyvsp
[-1].wm_components
).idx
+ 1;
3244 #line 3249 "asmshader.tab.c" /* yacc.c:1646 */
3248 #line 1137 "asmshader.y" /* yacc.c:1646 */
3250 (yyval
.swizzle
) = BWRITERVS_NOSWIZZLE
;
3251 TRACE("Default swizzle: %08x\n", (yyval
.swizzle
));
3253 #line 3258 "asmshader.tab.c" /* yacc.c:1646 */
3257 #line 1142 "asmshader.y" /* yacc.c:1646 */
3259 if((yyvsp
[0].sw_components
).swizzle
== SWIZZLE_ERR
) {
3260 asmparser_message(&asm_ctx
, "Line %u: Invalid swizzle\n",
3262 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
3263 /* Provide a correct swizzle to prevent following complaints */
3264 (yyval
.swizzle
) = BWRITERVS_NOSWIZZLE
;
3269 (yyval
.swizzle
) = (yyvsp
[0].sw_components
).swizzle
<< BWRITERVS_SWIZZLE_SHIFT
;
3270 /* Fill the swizzle by extending the last component */
3271 last
= ((yyvsp
[0].sw_components
).swizzle
>> 2 * ((yyvsp
[0].sw_components
).idx
- 1)) & 0x03;
3272 for(i
= (yyvsp
[0].sw_components
).idx
; i
< 4; i
++){
3273 (yyval
.swizzle
) |= last
<< (BWRITERVS_SWIZZLE_SHIFT
+ 2 * i
);
3275 TRACE("Got a swizzle: %08x\n", (yyval
.swizzle
));
3278 #line 3283 "asmshader.tab.c" /* yacc.c:1646 */
3282 #line 1164 "asmshader.y" /* yacc.c:1646 */
3284 (yyval
.sw_components
).swizzle
= (yyvsp
[0].component
);
3285 (yyval
.sw_components
).idx
= 1;
3287 #line 3292 "asmshader.tab.c" /* yacc.c:1646 */
3291 #line 1169 "asmshader.y" /* yacc.c:1646 */
3293 if((yyvsp
[-1].sw_components
).idx
== 4) {
3294 /* Too many sw_components */
3295 (yyval
.sw_components
).swizzle
= SWIZZLE_ERR
;
3296 (yyval
.sw_components
).idx
= 4;
3299 (yyval
.sw_components
).swizzle
= (yyvsp
[-1].sw_components
).swizzle
| ((yyvsp
[0].component
) << 2 * (yyvsp
[-1].sw_components
).idx
);
3300 (yyval
.sw_components
).idx
= (yyvsp
[-1].sw_components
).idx
+ 1;
3303 #line 3308 "asmshader.tab.c" /* yacc.c:1646 */
3307 #line 1182 "asmshader.y" /* yacc.c:1646 */
3309 (yyval
.modshift
).mod
= 0;
3310 (yyval
.modshift
).shift
= 0;
3312 #line 3317 "asmshader.tab.c" /* yacc.c:1646 */
3316 #line 1187 "asmshader.y" /* yacc.c:1646 */
3318 (yyval
.modshift
).mod
= (yyvsp
[-1].modshift
).mod
| (yyvsp
[0].modshift
).mod
;
3319 if((yyvsp
[-1].modshift
).shift
&& (yyvsp
[0].modshift
).shift
) {
3320 asmparser_message(&asm_ctx
, "Line %u: More than one shift flag\n",
3322 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
3323 (yyval
.modshift
).shift
= (yyvsp
[-1].modshift
).shift
;
3325 (yyval
.modshift
).shift
= (yyvsp
[-1].modshift
).shift
| (yyvsp
[0].modshift
).shift
;
3328 #line 3333 "asmshader.tab.c" /* yacc.c:1646 */
3332 #line 1200 "asmshader.y" /* yacc.c:1646 */
3334 (yyval
.modshift
).mod
= 0;
3335 (yyval
.modshift
).shift
= 1;
3337 #line 3342 "asmshader.tab.c" /* yacc.c:1646 */
3341 #line 1205 "asmshader.y" /* yacc.c:1646 */
3343 (yyval
.modshift
).mod
= 0;
3344 (yyval
.modshift
).shift
= 2;
3346 #line 3351 "asmshader.tab.c" /* yacc.c:1646 */
3350 #line 1210 "asmshader.y" /* yacc.c:1646 */
3352 (yyval
.modshift
).mod
= 0;
3353 (yyval
.modshift
).shift
= 3;
3355 #line 3360 "asmshader.tab.c" /* yacc.c:1646 */
3359 #line 1215 "asmshader.y" /* yacc.c:1646 */
3361 (yyval
.modshift
).mod
= 0;
3362 (yyval
.modshift
).shift
= 15;
3364 #line 3369 "asmshader.tab.c" /* yacc.c:1646 */
3368 #line 1220 "asmshader.y" /* yacc.c:1646 */
3370 (yyval
.modshift
).mod
= 0;
3371 (yyval
.modshift
).shift
= 14;
3373 #line 3378 "asmshader.tab.c" /* yacc.c:1646 */
3377 #line 1225 "asmshader.y" /* yacc.c:1646 */
3379 (yyval
.modshift
).mod
= 0;
3380 (yyval
.modshift
).shift
= 13;
3382 #line 3387 "asmshader.tab.c" /* yacc.c:1646 */
3386 #line 1230 "asmshader.y" /* yacc.c:1646 */
3388 (yyval
.modshift
).mod
= BWRITERSPDM_SATURATE
;
3389 (yyval
.modshift
).shift
= 0;
3391 #line 3396 "asmshader.tab.c" /* yacc.c:1646 */
3395 #line 1235 "asmshader.y" /* yacc.c:1646 */
3397 (yyval
.modshift
).mod
= BWRITERSPDM_PARTIALPRECISION
;
3398 (yyval
.modshift
).shift
= 0;
3400 #line 3405 "asmshader.tab.c" /* yacc.c:1646 */
3404 #line 1240 "asmshader.y" /* yacc.c:1646 */
3406 (yyval
.modshift
).mod
= BWRITERSPDM_MSAMPCENTROID
;
3407 (yyval
.modshift
).shift
= 0;
3409 #line 3414 "asmshader.tab.c" /* yacc.c:1646 */
3413 #line 1246 "asmshader.y" /* yacc.c:1646 */
3415 (yyval
.sregs
).reg
[0] = (yyvsp
[0].reg
);
3416 (yyval
.sregs
).count
= 1;
3418 #line 3423 "asmshader.tab.c" /* yacc.c:1646 */
3422 #line 1251 "asmshader.y" /* yacc.c:1646 */
3424 if((yyval
.sregs
).count
== MAX_SRC_REGS
){
3425 asmparser_message(&asm_ctx
, "Line %u: Too many source registers in this instruction\n",
3427 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
3430 (yyval
.sregs
).reg
[(yyval
.sregs
).count
++] = (yyvsp
[0].reg
);
3432 #line 3437 "asmshader.tab.c" /* yacc.c:1646 */
3436 #line 1262 "asmshader.y" /* yacc.c:1646 */
3438 (yyval
.reg
).type
= (yyvsp
[-2].reg
).type
;
3439 (yyval
.reg
).regnum
= (yyvsp
[-2].reg
).regnum
;
3440 (yyval
.reg
).u
.swizzle
= (yyvsp
[0].swizzle
);
3441 (yyval
.reg
).srcmod
= BWRITERSPSM_NONE
;
3442 set_rel_reg(&(yyval
.reg
), &(yyvsp
[-1].rel_reg
));
3444 #line 3449 "asmshader.tab.c" /* yacc.c:1646 */
3448 #line 1270 "asmshader.y" /* yacc.c:1646 */
3450 (yyval
.reg
).type
= (yyvsp
[-3].reg
).type
;
3451 (yyval
.reg
).regnum
= (yyvsp
[-3].reg
).regnum
;
3452 set_rel_reg(&(yyval
.reg
), &(yyvsp
[-2].rel_reg
));
3453 (yyval
.reg
).srcmod
= (yyvsp
[-1].srcmod
);
3454 (yyval
.reg
).u
.swizzle
= (yyvsp
[0].swizzle
);
3456 #line 3461 "asmshader.tab.c" /* yacc.c:1646 */
3460 #line 1278 "asmshader.y" /* yacc.c:1646 */
3462 (yyval
.reg
).type
= (yyvsp
[-2].reg
).type
;
3463 (yyval
.reg
).regnum
= (yyvsp
[-2].reg
).regnum
;
3464 (yyval
.reg
).srcmod
= BWRITERSPSM_NEG
;
3465 set_rel_reg(&(yyval
.reg
), &(yyvsp
[-1].rel_reg
));
3466 (yyval
.reg
).u
.swizzle
= (yyvsp
[0].swizzle
);
3468 #line 3473 "asmshader.tab.c" /* yacc.c:1646 */
3472 #line 1286 "asmshader.y" /* yacc.c:1646 */
3474 (yyval
.reg
).type
= (yyvsp
[-3].reg
).type
;
3475 (yyval
.reg
).regnum
= (yyvsp
[-3].reg
).regnum
;
3476 set_rel_reg(&(yyval
.reg
), &(yyvsp
[-2].rel_reg
));
3477 switch((yyvsp
[-1].srcmod
)) {
3478 case BWRITERSPSM_BIAS
: (yyval
.reg
).srcmod
= BWRITERSPSM_BIASNEG
; break;
3479 case BWRITERSPSM_X2
: (yyval
.reg
).srcmod
= BWRITERSPSM_X2NEG
; break;
3480 case BWRITERSPSM_SIGN
: (yyval
.reg
).srcmod
= BWRITERSPSM_SIGNNEG
; break;
3481 case BWRITERSPSM_ABS
: (yyval
.reg
).srcmod
= BWRITERSPSM_ABSNEG
; break;
3482 case BWRITERSPSM_DZ
:
3483 asmparser_message(&asm_ctx
, "Line %u: Incompatible source modifiers: NEG and DZ\n",
3485 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
3487 case BWRITERSPSM_DW
:
3488 asmparser_message(&asm_ctx
, "Line %u: Incompatible source modifiers: NEG and DW\n",
3490 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
3493 FIXME("Unhandled combination of NEGATE and %u\n", (yyvsp
[-1].srcmod
));
3495 (yyval
.reg
).u
.swizzle
= (yyvsp
[0].swizzle
);
3497 #line 3502 "asmshader.tab.c" /* yacc.c:1646 */
3501 #line 1311 "asmshader.y" /* yacc.c:1646 */
3503 if((yyvsp
[-4].immval
).val
!= 1.0 || (!(yyvsp
[-4].immval
).integer
)) {
3504 asmparser_message(&asm_ctx
, "Line %u: Only \"1 - reg\" is valid for D3DSPSM_COMP, "
3505 "%g - reg found\n", asm_ctx
.line_no
, (yyvsp
[-4].immval
).val
);
3506 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
3508 /* Complement - not compatible with other source modifiers */
3509 (yyval
.reg
).type
= (yyvsp
[-2].reg
).type
;
3510 (yyval
.reg
).regnum
= (yyvsp
[-2].reg
).regnum
;
3511 (yyval
.reg
).srcmod
= BWRITERSPSM_COMP
;
3512 set_rel_reg(&(yyval
.reg
), &(yyvsp
[-1].rel_reg
));
3513 (yyval
.reg
).u
.swizzle
= (yyvsp
[0].swizzle
);
3515 #line 3520 "asmshader.tab.c" /* yacc.c:1646 */
3519 #line 1325 "asmshader.y" /* yacc.c:1646 */
3521 /* For nicer error reporting */
3522 if((yyvsp
[-5].immval
).val
!= 1.0 || (!(yyvsp
[-5].immval
).integer
)) {
3523 asmparser_message(&asm_ctx
, "Line %u: Only \"1 - reg\" is valid for D3DSPSM_COMP\n",
3525 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
3527 asmparser_message(&asm_ctx
, "Line %u: Incompatible source modifiers: D3DSPSM_COMP and %s\n",
3529 debug_print_srcmod((yyvsp
[-1].srcmod
)));
3530 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
3533 #line 3538 "asmshader.tab.c" /* yacc.c:1646 */
3537 #line 1339 "asmshader.y" /* yacc.c:1646 */
3539 (yyval
.reg
).type
= (yyvsp
[-1].reg
).type
;
3540 (yyval
.reg
).regnum
= (yyvsp
[-1].reg
).regnum
;
3541 (yyval
.reg
).rel_reg
= NULL
;
3542 (yyval
.reg
).srcmod
= BWRITERSPSM_NOT
;
3543 (yyval
.reg
).u
.swizzle
= (yyvsp
[0].swizzle
);
3545 #line 3550 "asmshader.tab.c" /* yacc.c:1646 */
3549 #line 1348 "asmshader.y" /* yacc.c:1646 */
3551 (yyval
.rel_reg
).has_rel_reg
= FALSE
;
3552 (yyval
.rel_reg
).additional_offset
= 0;
3554 #line 3559 "asmshader.tab.c" /* yacc.c:1646 */
3558 #line 1353 "asmshader.y" /* yacc.c:1646 */
3560 (yyval
.rel_reg
).has_rel_reg
= FALSE
;
3561 (yyval
.rel_reg
).additional_offset
= (yyvsp
[-1].immval
).val
;
3563 #line 3568 "asmshader.tab.c" /* yacc.c:1646 */
3567 #line 1358 "asmshader.y" /* yacc.c:1646 */
3569 (yyval
.rel_reg
).has_rel_reg
= TRUE
;
3570 (yyval
.rel_reg
).type
= (yyvsp
[-2].reg
).type
;
3571 (yyval
.rel_reg
).additional_offset
= 0;
3572 (yyval
.rel_reg
).rel_regnum
= (yyvsp
[-2].reg
).regnum
;
3573 (yyval
.rel_reg
).swizzle
= (yyvsp
[-1].swizzle
);
3575 #line 3580 "asmshader.tab.c" /* yacc.c:1646 */
3579 #line 1366 "asmshader.y" /* yacc.c:1646 */
3581 (yyval
.rel_reg
).has_rel_reg
= TRUE
;
3582 (yyval
.rel_reg
).type
= (yyvsp
[-2].reg
).type
;
3583 (yyval
.rel_reg
).additional_offset
= (yyvsp
[-4].immval
).val
;
3584 (yyval
.rel_reg
).rel_regnum
= (yyvsp
[-2].reg
).regnum
;
3585 (yyval
.rel_reg
).swizzle
= (yyvsp
[-1].swizzle
);
3587 #line 3592 "asmshader.tab.c" /* yacc.c:1646 */
3591 #line 1374 "asmshader.y" /* yacc.c:1646 */
3593 (yyval
.rel_reg
).has_rel_reg
= TRUE
;
3594 (yyval
.rel_reg
).type
= (yyvsp
[-4].reg
).type
;
3595 (yyval
.rel_reg
).additional_offset
= (yyvsp
[-1].immval
).val
;
3596 (yyval
.rel_reg
).rel_regnum
= (yyvsp
[-4].reg
).regnum
;
3597 (yyval
.rel_reg
).swizzle
= (yyvsp
[-3].swizzle
);
3599 #line 3604 "asmshader.tab.c" /* yacc.c:1646 */
3603 #line 1382 "asmshader.y" /* yacc.c:1646 */
3605 (yyval
.rel_reg
).has_rel_reg
= TRUE
;
3606 (yyval
.rel_reg
).type
= (yyvsp
[-4].reg
).type
;
3607 (yyval
.rel_reg
).additional_offset
= (yyvsp
[-6].immval
).val
+ (yyvsp
[-1].immval
).val
;
3608 (yyval
.rel_reg
).rel_regnum
= (yyvsp
[-4].reg
).regnum
;
3609 (yyval
.rel_reg
).swizzle
= (yyvsp
[-3].swizzle
);
3611 #line 3616 "asmshader.tab.c" /* yacc.c:1646 */
3615 #line 1391 "asmshader.y" /* yacc.c:1646 */
3617 if(!(yyvsp
[0].immval
).integer
) {
3618 asmparser_message(&asm_ctx
, "Line %u: Unexpected float %f\n",
3619 asm_ctx
.line_no
, (yyvsp
[0].immval
).val
);
3620 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
3622 (yyval
.immval
).val
= (yyvsp
[0].immval
).val
;
3624 #line 3629 "asmshader.tab.c" /* yacc.c:1646 */
3628 #line 1400 "asmshader.y" /* yacc.c:1646 */
3630 if(!(yyvsp
[0].immval
).integer
) {
3631 asmparser_message(&asm_ctx
, "Line %u: Unexpected float %f\n",
3632 asm_ctx
.line_no
, (yyvsp
[0].immval
).val
);
3633 set_parse_status(&asm_ctx
.status
, PARSE_ERR
);
3635 (yyval
.immval
).val
= (yyvsp
[-2].immval
).val
+ (yyvsp
[0].immval
).val
;
3637 #line 3642 "asmshader.tab.c" /* yacc.c:1646 */
3641 #line 1410 "asmshader.y" /* yacc.c:1646 */
3643 (yyval
.srcmod
) = BWRITERSPSM_BIAS
;
3645 #line 3650 "asmshader.tab.c" /* yacc.c:1646 */
3649 #line 1414 "asmshader.y" /* yacc.c:1646 */
3651 (yyval
.srcmod
) = BWRITERSPSM_X2
;
3653 #line 3658 "asmshader.tab.c" /* yacc.c:1646 */
3657 #line 1418 "asmshader.y" /* yacc.c:1646 */
3659 (yyval
.srcmod
) = BWRITERSPSM_SIGN
;
3661 #line 3666 "asmshader.tab.c" /* yacc.c:1646 */
3665 #line 1422 "asmshader.y" /* yacc.c:1646 */
3667 (yyval
.srcmod
) = BWRITERSPSM_DZ
;
3669 #line 3674 "asmshader.tab.c" /* yacc.c:1646 */
3673 #line 1426 "asmshader.y" /* yacc.c:1646 */
3675 (yyval
.srcmod
) = BWRITERSPSM_DW
;
3677 #line 3682 "asmshader.tab.c" /* yacc.c:1646 */
3681 #line 1430 "asmshader.y" /* yacc.c:1646 */
3683 (yyval
.srcmod
) = BWRITERSPSM_ABS
;
3685 #line 3690 "asmshader.tab.c" /* yacc.c:1646 */
3689 #line 1435 "asmshader.y" /* yacc.c:1646 */
3691 (yyval
.reg
).regnum
= 0; (yyval
.reg
).type
= BWRITERSPR_ADDR
;
3693 #line 3698 "asmshader.tab.c" /* yacc.c:1646 */
3697 #line 1439 "asmshader.y" /* yacc.c:1646 */
3699 (yyval
.reg
).regnum
= 0; (yyval
.reg
).type
= BWRITERSPR_LOOP
;
3701 #line 3706 "asmshader.tab.c" /* yacc.c:1646 */
3705 #line 1444 "asmshader.y" /* yacc.c:1646 */
3707 (yyval
.reg
).regnum
= (yyvsp
[0].regnum
); (yyval
.reg
).type
= BWRITERSPR_TEMP
;
3709 #line 3714 "asmshader.tab.c" /* yacc.c:1646 */
3713 #line 1448 "asmshader.y" /* yacc.c:1646 */
3715 asmparser_message(&asm_ctx
, "Line %u: Register o%u is not a valid source register\n",
3716 asm_ctx
.line_no
, (yyvsp
[0].regnum
));
3717 set_parse_status(&asm_ctx
.status
, PARSE_WARN
);
3719 #line 3724 "asmshader.tab.c" /* yacc.c:1646 */
3723 #line 1454 "asmshader.y" /* yacc.c:1646 */
3725 (yyval
.reg
).regnum
= (yyvsp
[0].regnum
); (yyval
.reg
).type
= BWRITERSPR_INPUT
;
3727 #line 3732 "asmshader.tab.c" /* yacc.c:1646 */
3731 #line 1458 "asmshader.y" /* yacc.c:1646 */
3733 (yyval
.reg
).regnum
= (yyvsp
[0].regnum
); (yyval
.reg
).type
= BWRITERSPR_CONST
;
3735 #line 3740 "asmshader.tab.c" /* yacc.c:1646 */
3739 #line 1462 "asmshader.y" /* yacc.c:1646 */
3741 (yyval
.reg
).regnum
= (yyvsp
[0].regnum
); (yyval
.reg
).type
= BWRITERSPR_CONSTINT
;
3743 #line 3748 "asmshader.tab.c" /* yacc.c:1646 */
3747 #line 1466 "asmshader.y" /* yacc.c:1646 */
3749 (yyval
.reg
).regnum
= (yyvsp
[0].regnum
); (yyval
.reg
).type
= BWRITERSPR_CONSTBOOL
;
3751 #line 3756 "asmshader.tab.c" /* yacc.c:1646 */
3755 #line 1470 "asmshader.y" /* yacc.c:1646 */
3757 (yyval
.reg
).regnum
= (yyvsp
[0].regnum
); (yyval
.reg
).type
= BWRITERSPR_TEXTURE
;
3759 #line 3764 "asmshader.tab.c" /* yacc.c:1646 */
3763 #line 1474 "asmshader.y" /* yacc.c:1646 */
3765 asmparser_message(&asm_ctx
, "Line %u: Register oT%u is not a valid source register\n",
3766 asm_ctx
.line_no
, (yyvsp
[0].regnum
));
3767 set_parse_status(&asm_ctx
.status
, PARSE_WARN
);
3769 #line 3774 "asmshader.tab.c" /* yacc.c:1646 */
3773 #line 1480 "asmshader.y" /* yacc.c:1646 */
3775 (yyval
.reg
).regnum
= (yyvsp
[0].regnum
); (yyval
.reg
).type
= BWRITERSPR_SAMPLER
;
3777 #line 3782 "asmshader.tab.c" /* yacc.c:1646 */
3781 #line 1484 "asmshader.y" /* yacc.c:1646 */
3783 asmparser_message(&asm_ctx
, "Line %u: Register oPos is not a valid source register\n",
3785 set_parse_status(&asm_ctx
.status
, PARSE_WARN
);
3787 #line 3792 "asmshader.tab.c" /* yacc.c:1646 */
3791 #line 1490 "asmshader.y" /* yacc.c:1646 */
3793 asmparser_message(&asm_ctx
, "Line %u: Register oFog is not a valid source register\n",
3795 set_parse_status(&asm_ctx
.status
, PARSE_WARN
);
3797 #line 3802 "asmshader.tab.c" /* yacc.c:1646 */
3801 #line 1496 "asmshader.y" /* yacc.c:1646 */
3803 asmparser_message(&asm_ctx
, "Line %u: Register oD%u is not a valid source register\n",
3804 asm_ctx
.line_no
, (yyvsp
[0].regnum
));
3805 set_parse_status(&asm_ctx
.status
, PARSE_WARN
);
3807 #line 3812 "asmshader.tab.c" /* yacc.c:1646 */
3811 #line 1502 "asmshader.y" /* yacc.c:1646 */
3813 asmparser_message(&asm_ctx
, "Line %u: Register oC%u is not a valid source register\n",
3814 asm_ctx
.line_no
, (yyvsp
[0].regnum
));
3815 set_parse_status(&asm_ctx
.status
, PARSE_WARN
);
3817 #line 3822 "asmshader.tab.c" /* yacc.c:1646 */
3821 #line 1508 "asmshader.y" /* yacc.c:1646 */
3823 asmparser_message(&asm_ctx
, "Line %u: Register oDepth is not a valid source register\n",
3825 set_parse_status(&asm_ctx
.status
, PARSE_WARN
);
3827 #line 3832 "asmshader.tab.c" /* yacc.c:1646 */
3831 #line 1514 "asmshader.y" /* yacc.c:1646 */
3833 (yyval
.reg
).regnum
= 0; (yyval
.reg
).type
= BWRITERSPR_PREDICATE
;
3835 #line 3840 "asmshader.tab.c" /* yacc.c:1646 */
3839 #line 1518 "asmshader.y" /* yacc.c:1646 */
3841 (yyval
.reg
).regnum
= 0; (yyval
.reg
).type
= BWRITERSPR_MISCTYPE
;
3843 #line 3848 "asmshader.tab.c" /* yacc.c:1646 */
3847 #line 1522 "asmshader.y" /* yacc.c:1646 */
3849 (yyval
.reg
).regnum
= 1; (yyval
.reg
).type
= BWRITERSPR_MISCTYPE
;
3851 #line 3856 "asmshader.tab.c" /* yacc.c:1646 */
3855 #line 1526 "asmshader.y" /* yacc.c:1646 */
3857 (yyval
.reg
).regnum
= 0; (yyval
.reg
).type
= BWRITERSPR_ADDR
;
3859 #line 3864 "asmshader.tab.c" /* yacc.c:1646 */
3863 #line 1530 "asmshader.y" /* yacc.c:1646 */
3865 (yyval
.reg
).regnum
= 0; (yyval
.reg
).type
= BWRITERSPR_LOOP
;
3867 #line 3872 "asmshader.tab.c" /* yacc.c:1646 */
3871 #line 1534 "asmshader.y" /* yacc.c:1646 */
3873 (yyval
.reg
).regnum
= (yyvsp
[0].regnum
); (yyval
.reg
).type
= BWRITERSPR_LABEL
;
3875 #line 3880 "asmshader.tab.c" /* yacc.c:1646 */
3879 #line 1538 "asmshader.y" /* yacc.c:1646 */
3880 { (yyval
.comptype
) = BWRITER_COMPARISON_GT
; }
3881 #line 3886 "asmshader.tab.c" /* yacc.c:1646 */
3885 #line 1539 "asmshader.y" /* yacc.c:1646 */
3886 { (yyval
.comptype
) = BWRITER_COMPARISON_LT
; }
3887 #line 3892 "asmshader.tab.c" /* yacc.c:1646 */
3891 #line 1540 "asmshader.y" /* yacc.c:1646 */
3892 { (yyval
.comptype
) = BWRITER_COMPARISON_GE
; }
3893 #line 3898 "asmshader.tab.c" /* yacc.c:1646 */
3897 #line 1541 "asmshader.y" /* yacc.c:1646 */
3898 { (yyval
.comptype
) = BWRITER_COMPARISON_LE
; }
3899 #line 3904 "asmshader.tab.c" /* yacc.c:1646 */
3903 #line 1542 "asmshader.y" /* yacc.c:1646 */
3904 { (yyval
.comptype
) = BWRITER_COMPARISON_EQ
; }
3905 #line 3910 "asmshader.tab.c" /* yacc.c:1646 */
3909 #line 1543 "asmshader.y" /* yacc.c:1646 */
3910 { (yyval
.comptype
) = BWRITER_COMPARISON_NE
; }
3911 #line 3916 "asmshader.tab.c" /* yacc.c:1646 */
3915 #line 1546 "asmshader.y" /* yacc.c:1646 */
3917 TRACE("dcl_position%u\n", (yyvsp
[0].regnum
));
3918 (yyval
.declaration
).regnum
= (yyvsp
[0].regnum
);
3919 (yyval
.declaration
).dclusage
= BWRITERDECLUSAGE_POSITION
;
3921 #line 3926 "asmshader.tab.c" /* yacc.c:1646 */
3925 #line 1552 "asmshader.y" /* yacc.c:1646 */
3927 TRACE("dcl_blendweight%u\n", (yyvsp
[0].regnum
));
3928 (yyval
.declaration
).regnum
= (yyvsp
[0].regnum
);
3929 (yyval
.declaration
).dclusage
= BWRITERDECLUSAGE_BLENDWEIGHT
;
3931 #line 3936 "asmshader.tab.c" /* yacc.c:1646 */
3935 #line 1558 "asmshader.y" /* yacc.c:1646 */
3937 TRACE("dcl_blendindices%u\n", (yyvsp
[0].regnum
));
3938 (yyval
.declaration
).regnum
= (yyvsp
[0].regnum
);
3939 (yyval
.declaration
).dclusage
= BWRITERDECLUSAGE_BLENDINDICES
;
3941 #line 3946 "asmshader.tab.c" /* yacc.c:1646 */
3945 #line 1564 "asmshader.y" /* yacc.c:1646 */
3947 TRACE("dcl_normal%u\n", (yyvsp
[0].regnum
));
3948 (yyval
.declaration
).regnum
= (yyvsp
[0].regnum
);
3949 (yyval
.declaration
).dclusage
= BWRITERDECLUSAGE_NORMAL
;
3951 #line 3956 "asmshader.tab.c" /* yacc.c:1646 */
3955 #line 1570 "asmshader.y" /* yacc.c:1646 */
3957 TRACE("dcl_psize%u\n", (yyvsp
[0].regnum
));
3958 (yyval
.declaration
).regnum
= (yyvsp
[0].regnum
);
3959 (yyval
.declaration
).dclusage
= BWRITERDECLUSAGE_PSIZE
;
3961 #line 3966 "asmshader.tab.c" /* yacc.c:1646 */
3965 #line 1576 "asmshader.y" /* yacc.c:1646 */
3967 TRACE("dcl_texcoord%u\n", (yyvsp
[0].regnum
));
3968 (yyval
.declaration
).regnum
= (yyvsp
[0].regnum
);
3969 (yyval
.declaration
).dclusage
= BWRITERDECLUSAGE_TEXCOORD
;
3971 #line 3976 "asmshader.tab.c" /* yacc.c:1646 */
3975 #line 1582 "asmshader.y" /* yacc.c:1646 */
3977 TRACE("dcl_tangent%u\n", (yyvsp
[0].regnum
));
3978 (yyval
.declaration
).regnum
= (yyvsp
[0].regnum
);
3979 (yyval
.declaration
).dclusage
= BWRITERDECLUSAGE_TANGENT
;
3981 #line 3986 "asmshader.tab.c" /* yacc.c:1646 */
3985 #line 1588 "asmshader.y" /* yacc.c:1646 */
3987 TRACE("dcl_binormal%u\n", (yyvsp
[0].regnum
));
3988 (yyval
.declaration
).regnum
= (yyvsp
[0].regnum
);
3989 (yyval
.declaration
).dclusage
= BWRITERDECLUSAGE_BINORMAL
;
3991 #line 3996 "asmshader.tab.c" /* yacc.c:1646 */
3995 #line 1594 "asmshader.y" /* yacc.c:1646 */
3997 TRACE("dcl_tessfactor%u\n", (yyvsp
[0].regnum
));
3998 (yyval
.declaration
).regnum
= (yyvsp
[0].regnum
);
3999 (yyval
.declaration
).dclusage
= BWRITERDECLUSAGE_TESSFACTOR
;
4001 #line 4006 "asmshader.tab.c" /* yacc.c:1646 */
4005 #line 1600 "asmshader.y" /* yacc.c:1646 */
4007 TRACE("dcl_positiont%u\n", (yyvsp
[0].regnum
));
4008 (yyval
.declaration
).regnum
= (yyvsp
[0].regnum
);
4009 (yyval
.declaration
).dclusage
= BWRITERDECLUSAGE_POSITIONT
;
4011 #line 4016 "asmshader.tab.c" /* yacc.c:1646 */
4015 #line 1606 "asmshader.y" /* yacc.c:1646 */
4017 TRACE("dcl_color%u\n", (yyvsp
[0].regnum
));
4018 (yyval
.declaration
).regnum
= (yyvsp
[0].regnum
);
4019 (yyval
.declaration
).dclusage
= BWRITERDECLUSAGE_COLOR
;
4021 #line 4026 "asmshader.tab.c" /* yacc.c:1646 */
4025 #line 1612 "asmshader.y" /* yacc.c:1646 */
4027 TRACE("dcl_fog%u\n", (yyvsp
[0].regnum
));
4028 (yyval
.declaration
).regnum
= (yyvsp
[0].regnum
);
4029 (yyval
.declaration
).dclusage
= BWRITERDECLUSAGE_FOG
;
4031 #line 4036 "asmshader.tab.c" /* yacc.c:1646 */
4035 #line 1618 "asmshader.y" /* yacc.c:1646 */
4037 TRACE("dcl_depth%u\n", (yyvsp
[0].regnum
));
4038 (yyval
.declaration
).regnum
= (yyvsp
[0].regnum
);
4039 (yyval
.declaration
).dclusage
= BWRITERDECLUSAGE_DEPTH
;
4041 #line 4046 "asmshader.tab.c" /* yacc.c:1646 */
4045 #line 1624 "asmshader.y" /* yacc.c:1646 */
4047 TRACE("dcl_sample%u\n", (yyvsp
[0].regnum
));
4048 (yyval
.declaration
).regnum
= (yyvsp
[0].regnum
);
4049 (yyval
.declaration
).dclusage
= BWRITERDECLUSAGE_SAMPLE
;
4051 #line 4056 "asmshader.tab.c" /* yacc.c:1646 */
4055 #line 1631 "asmshader.y" /* yacc.c:1646 */
4057 (yyval
.reg
).regnum
= (yyvsp
[0].regnum
); (yyval
.reg
).type
= BWRITERSPR_INPUT
;
4059 #line 4064 "asmshader.tab.c" /* yacc.c:1646 */
4063 #line 1635 "asmshader.y" /* yacc.c:1646 */
4065 (yyval
.reg
).regnum
= (yyvsp
[0].regnum
); (yyval
.reg
).type
= BWRITERSPR_TEXTURE
;
4067 #line 4072 "asmshader.tab.c" /* yacc.c:1646 */
4071 #line 1640 "asmshader.y" /* yacc.c:1646 */
4073 (yyval
.samplertype
) = BWRITERSTT_1D
;
4075 #line 4080 "asmshader.tab.c" /* yacc.c:1646 */
4079 #line 1644 "asmshader.y" /* yacc.c:1646 */
4081 (yyval
.samplertype
) = BWRITERSTT_2D
;
4083 #line 4088 "asmshader.tab.c" /* yacc.c:1646 */
4087 #line 1648 "asmshader.y" /* yacc.c:1646 */
4089 (yyval
.samplertype
) = BWRITERSTT_CUBE
;
4091 #line 4096 "asmshader.tab.c" /* yacc.c:1646 */
4095 #line 1652 "asmshader.y" /* yacc.c:1646 */
4097 (yyval
.samplertype
) = BWRITERSTT_VOLUME
;
4099 #line 4104 "asmshader.tab.c" /* yacc.c:1646 */
4103 #line 1657 "asmshader.y" /* yacc.c:1646 */
4105 (yyval
.reg
).type
= BWRITERSPR_PREDICATE
;
4106 (yyval
.reg
).regnum
= 0;
4107 (yyval
.reg
).rel_reg
= NULL
;
4108 (yyval
.reg
).srcmod
= BWRITERSPSM_NONE
;
4109 (yyval
.reg
).u
.swizzle
= (yyvsp
[-1].swizzle
);
4111 #line 4116 "asmshader.tab.c" /* yacc.c:1646 */
4115 #line 1665 "asmshader.y" /* yacc.c:1646 */
4117 (yyval
.reg
).type
= BWRITERSPR_PREDICATE
;
4118 (yyval
.reg
).regnum
= 0;
4119 (yyval
.reg
).rel_reg
= NULL
;
4120 (yyval
.reg
).srcmod
= BWRITERSPSM_NOT
;
4121 (yyval
.reg
).u
.swizzle
= (yyvsp
[-1].swizzle
);
4123 #line 4128 "asmshader.tab.c" /* yacc.c:1646 */
4127 #line 4132 "asmshader.tab.c" /* yacc.c:1646 */
4130 /* User semantic actions sometimes alter yychar, and that requires
4131 that yytoken be updated with the new translation. We take the
4132 approach of translating immediately before every use of yytoken.
4133 One alternative is translating here after every semantic action,
4134 but that translation would be missed if the semantic action invokes
4135 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
4136 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
4137 incorrect destructor might then be invoked immediately. In the
4138 case of YYERROR or YYBACKUP, subsequent parser actions might lead
4139 to an incorrect destructor call or verbose syntax error message
4140 before the lookahead is translated. */
4141 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
4145 YY_STACK_PRINT (yyss
, yyssp
);
4149 /* Now 'shift' the result of the reduction. Determine what state
4150 that goes to, based on the state we popped back to and the rule
4151 number reduced by. */
4155 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
4156 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
4157 yystate
= yytable
[yystate
];
4159 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
4164 /*--------------------------------------.
4165 | yyerrlab -- here on detecting error. |
4166 `--------------------------------------*/
4168 /* Make sure we have latest lookahead translation. See comments at
4169 user semantic actions for why this is necessary. */
4170 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
4172 /* If not already recovering from an error, report this error. */
4176 #if ! YYERROR_VERBOSE
4177 yyerror (YY_("syntax error"));
4179 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
4182 char const *yymsgp
= YY_("syntax error");
4183 int yysyntax_error_status
;
4184 yysyntax_error_status
= YYSYNTAX_ERROR
;
4185 if (yysyntax_error_status
== 0)
4187 else if (yysyntax_error_status
== 1)
4189 if (yymsg
!= yymsgbuf
)
4190 YYSTACK_FREE (yymsg
);
4191 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
4195 yymsg_alloc
= sizeof yymsgbuf
;
4196 yysyntax_error_status
= 2;
4200 yysyntax_error_status
= YYSYNTAX_ERROR
;
4205 if (yysyntax_error_status
== 2)
4206 goto yyexhaustedlab
;
4208 # undef YYSYNTAX_ERROR
4214 if (yyerrstatus
== 3)
4216 /* If just tried and failed to reuse lookahead token after an
4217 error, discard it. */
4219 if (yychar
<= YYEOF
)
4221 /* Return failure if at end of input. */
4222 if (yychar
== YYEOF
)
4227 yydestruct ("Error: discarding",
4233 /* Else will try to reuse lookahead token after shifting the error
4238 /*---------------------------------------------------.
4239 | yyerrorlab -- error raised explicitly by YYERROR. |
4240 `---------------------------------------------------*/
4243 /* Pacify compilers like GCC when the user code never invokes
4244 YYERROR and the label yyerrorlab therefore never appears in user
4246 if (/*CONSTCOND*/ 0)
4249 /* Do not reclaim the symbols of the rule whose action triggered
4253 YY_STACK_PRINT (yyss
, yyssp
);
4258 /*-------------------------------------------------------------.
4259 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4260 `-------------------------------------------------------------*/
4262 yyerrstatus
= 3; /* Each real token shifted decrements this. */
4266 yyn
= yypact
[yystate
];
4267 if (!yypact_value_is_default (yyn
))
4270 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
4278 /* Pop the current state because it cannot handle the error token. */
4283 yydestruct ("Error: popping",
4284 yystos
[yystate
], yyvsp
);
4287 YY_STACK_PRINT (yyss
, yyssp
);
4290 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
4292 YY_IGNORE_MAYBE_UNINITIALIZED_END
4295 /* Shift the error token. */
4296 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
4302 /*-------------------------------------.
4303 | yyacceptlab -- YYACCEPT comes here. |
4304 `-------------------------------------*/
4309 /*-----------------------------------.
4310 | yyabortlab -- YYABORT comes here. |
4311 `-----------------------------------*/
4316 #if !defined yyoverflow || YYERROR_VERBOSE
4317 /*-------------------------------------------------.
4318 | yyexhaustedlab -- memory exhaustion comes here. |
4319 `-------------------------------------------------*/
4321 yyerror (YY_("memory exhausted"));
4327 if (yychar
!= YYEMPTY
)
4329 /* Make sure we have latest lookahead translation. See comments at
4330 user semantic actions for why this is necessary. */
4331 yytoken
= YYTRANSLATE (yychar
);
4332 yydestruct ("Cleanup: discarding lookahead",
4335 /* Do not reclaim the symbols of the rule whose action triggered
4336 this YYABORT or YYACCEPT. */
4338 YY_STACK_PRINT (yyss
, yyssp
);
4339 while (yyssp
!= yyss
)
4341 yydestruct ("Cleanup: popping",
4342 yystos
[*yyssp
], yyvsp
);
4347 YYSTACK_FREE (yyss
);
4350 if (yymsg
!= yymsgbuf
)
4351 YYSTACK_FREE (yymsg
);
4355 #line 1673 "asmshader.y" /* yacc.c:1906 */
4358 struct bwriter_shader
*parse_asm_shader(char **messages
)
4360 struct bwriter_shader
*ret
= NULL
;
4362 asm_ctx
.shader
= NULL
;
4363 asm_ctx
.status
= PARSE_SUCCESS
;
4364 asm_ctx
.messages
.size
= asm_ctx
.messages
.capacity
= 0;
4365 asm_ctx
.line_no
= 1;
4369 if (asm_ctx
.status
!= PARSE_ERR
)
4370 ret
= asm_ctx
.shader
;
4371 else if (asm_ctx
.shader
)
4372 SlDeleteShader(asm_ctx
.shader
);
4376 if (asm_ctx
.messages
.size
)
4378 /* Shrink the buffer to the used size */
4379 *messages
= d3dcompiler_realloc(asm_ctx
.messages
.string
, asm_ctx
.messages
.size
+ 1);
4382 ERR("Out of memory, no messages reported\n");
4383 d3dcompiler_free(asm_ctx
.messages
.string
);
4393 if (asm_ctx
.messages
.capacity
)
4394 d3dcompiler_free(asm_ctx
.messages
.string
);